routers
Creates, updates, deletes, gets or lists a routers
resource.
Overview
Name | routers |
Type | Resource |
Id | google.compute.routers |
Fields
The following fields are returned by SELECT
queries:
- get
- list
- aggregated_list
Successful response
Name | Datatype | Description |
---|---|---|
id | string (uint64) | [Output Only] The unique identifier for the resource. This identifier is defined by the server. |
name | string | Name of the resource. Provided by the client when the resource is created. The name must be 1-63 characters long, and comply with RFC1035. Specifically, the name must be 1-63 characters long and match the regular expression [a-z]([-a-z0-9]*[a-z0-9])? which means the first character must be a lowercase letter, and all following characters must be a dash, lowercase letter, or digit, except the last character, which cannot be a dash. (pattern: a-z?) |
bgp | object | BGP information specific to this router. (id: RouterBgp) |
bgpPeers | array | BGP information that must be configured into the routing stack to establish BGP peering. This information must specify the peer ASN and either the interface name, IP address, or peer IP address. Please refer to RFC4273. |
creationTimestamp | string | [Output Only] Creation timestamp in RFC3339 text format. |
description | string | An optional description of this resource. Provide this property when you create the resource. |
encryptedInterconnectRouter | boolean | Indicates if a router is dedicated for use with encrypted VLAN attachments (interconnectAttachments). |
interfaces | array | Router interfaces. To create a BGP peer that uses a router interface, the interface must have one of the following fields specified: - linkedVpnTunnel - linkedInterconnectAttachment - subnetwork You can create a router interface without any of these fields specified. However, you cannot create a BGP peer that uses that interface. |
kind | string | [Output Only] Type of resource. Always compute#router for routers. (default: compute#router) |
md5AuthenticationKeys | array | Keys used for MD5 authentication. |
nats | array | A list of NAT services created in this router. |
network | string | URI of the network to which this router belongs. |
region | string | [Output Only] URI of the region where the router resides. You must specify this field as part of the HTTP request URL. It is not settable as a field in the request body. |
selfLink | string | [Output Only] Server-defined URL for the resource. |
Successful response
Name | Datatype | Description |
---|---|---|
id | string | [Output Only] Unique identifier for the resource; defined by the server. |
items | array | A list of Router resources. |
kind | string | [Output Only] Type of resource. Always compute#router for routers. (default: compute#routerList) |
nextPageToken | string | [Output Only] This token allows you to get the next page of results for list requests. If the number of results is larger than maxResults, use the nextPageToken as a value for the query parameter pageToken in the next list request. Subsequent list requests will have their own nextPageToken to continue paging through the results. |
selfLink | string | [Output Only] Server-defined URL for this resource. |
warning | object | [Output Only] Informational warning message. |
Successful response
Name | Datatype | Description |
---|---|---|
id | string (uint64) | [Output Only] The unique identifier for the resource. This identifier is defined by the server. |
name | string | Name of the resource. Provided by the client when the resource is created. The name must be 1-63 characters long, and comply with RFC1035. Specifically, the name must be 1-63 characters long and match the regular expression [a-z]([-a-z0-9]*[a-z0-9])? which means the first character must be a lowercase letter, and all following characters must be a dash, lowercase letter, or digit, except the last character, which cannot be a dash. (pattern: a-z?) |
bgp | object | BGP information specific to this router. (id: RouterBgp) |
bgpPeers | array | BGP information that must be configured into the routing stack to establish BGP peering. This information must specify the peer ASN and either the interface name, IP address, or peer IP address. Please refer to RFC4273. |
creationTimestamp | string | [Output Only] Creation timestamp in RFC3339 text format. |
description | string | An optional description of this resource. Provide this property when you create the resource. |
encryptedInterconnectRouter | boolean | Indicates if a router is dedicated for use with encrypted VLAN attachments (interconnectAttachments). |
interfaces | array | Router interfaces. To create a BGP peer that uses a router interface, the interface must have one of the following fields specified: - linkedVpnTunnel - linkedInterconnectAttachment - subnetwork You can create a router interface without any of these fields specified. However, you cannot create a BGP peer that uses that interface. |
kind | string | [Output Only] Type of resource. Always compute#router for routers. (default: compute#router) |
md5AuthenticationKeys | array | Keys used for MD5 authentication. |
nats | array | A list of NAT services created in this router. |
network | string | URI of the network to which this router belongs. |
region | string | [Output Only] URI of the region where the router resides. You must specify this field as part of the HTTP request URL. It is not settable as a field in the request body. |
selfLink | string | [Output Only] Server-defined URL for the resource. |
Methods
The following methods are available for this resource:
Name | Accessible by | Required Params | Optional Params | Description |
---|---|---|---|---|
get | select | project , region , router | Returns the specified Router resource. | |
list | select | project , region | filter , maxResults , orderBy , pageToken , returnPartialSuccess | Retrieves a list of Router resources available to the specified project. |
aggregated_list | select | project | filter , includeAllScopes , maxResults , orderBy , pageToken , returnPartialSuccess , serviceProjectNumber | Retrieves an aggregated list of routers. To prevent failure, Google recommends that you set the returnPartialSuccess parameter to true . |
insert | insert | project , region | requestId | Creates a Router resource in the specified project and region using the data included in the request. |
patch | update | project , region , router | requestId | Patches the specified Router resource with the data included in the request. This method supports PATCH semantics and uses JSON merge patch format and processing rules. |
patch_route_policy | update | project , region , router | requestId | Patches Route Policy |
update | replace | project , region , router | requestId | Updates the specified Router resource with the data included in the request. This method conforms to PUT semantics, which requests that the state of the target resource be created or replaced with the state defined by the representation enclosed in the request message payload. |
delete | delete | project , region , router | requestId | Deletes the specified Router resource. |
preview | exec | project , region , router | Preview fields auto-generated during router create and update operations. Calling this method does NOT create or update the router. |
Parameters
Parameters can be passed in the WHERE
clause of a query. Check the Methods section to see which parameters are required or optional for each operation.
Name | Datatype | Description |
---|---|---|
project | string | |
region | string | |
router | string | |
filter | string | |
includeAllScopes | boolean | |
maxResults | integer (uint32) | |
orderBy | string | |
pageToken | string | |
requestId | string | |
returnPartialSuccess | boolean | |
serviceProjectNumber | string (int64) |
SELECT
examples
- get
- list
- aggregated_list
Returns the specified Router resource.
SELECT
id,
name,
bgp,
bgpPeers,
creationTimestamp,
description,
encryptedInterconnectRouter,
interfaces,
kind,
md5AuthenticationKeys,
nats,
network,
region,
selfLink
FROM google.compute.routers
WHERE project = '{{ project }}' -- required
AND region = '{{ region }}' -- required
AND router = '{{ router }}' -- required;
Retrieves a list of Router resources available to the specified project.
SELECT
id,
items,
kind,
nextPageToken,
selfLink,
warning
FROM google.compute.routers
WHERE project = '{{ project }}' -- required
AND region = '{{ region }}' -- required
AND filter = '{{ filter }}'
AND maxResults = '{{ maxResults }}'
AND orderBy = '{{ orderBy }}'
AND pageToken = '{{ pageToken }}'
AND returnPartialSuccess = '{{ returnPartialSuccess }}';
Retrieves an aggregated list of routers. To prevent failure, Google recommends that you set the returnPartialSuccess
parameter to true
.
SELECT
id,
name,
bgp,
bgpPeers,
creationTimestamp,
description,
encryptedInterconnectRouter,
interfaces,
kind,
md5AuthenticationKeys,
nats,
network,
region,
selfLink
FROM google.compute.routers
WHERE project = '{{ project }}' -- required
AND filter = '{{ filter }}'
AND includeAllScopes = '{{ includeAllScopes }}'
AND maxResults = '{{ maxResults }}'
AND orderBy = '{{ orderBy }}'
AND pageToken = '{{ pageToken }}'
AND returnPartialSuccess = '{{ returnPartialSuccess }}'
AND serviceProjectNumber = '{{ serviceProjectNumber }}';
INSERT
examples
- insert
- Manifest
Creates a Router resource in the specified project and region using the data included in the request.
INSERT INTO google.compute.routers (
data__kind,
data__id,
data__creationTimestamp,
data__name,
data__description,
data__region,
data__network,
data__interfaces,
data__bgpPeers,
data__bgp,
data__selfLink,
data__nats,
data__encryptedInterconnectRouter,
data__md5AuthenticationKeys,
project,
region,
requestId
)
SELECT
'{{ kind }}',
'{{ id }}',
'{{ creationTimestamp }}',
'{{ name }}',
'{{ description }}',
'{{ region }}',
'{{ network }}',
'{{ interfaces }}',
'{{ bgpPeers }}',
'{{ bgp }}',
'{{ selfLink }}',
'{{ nats }}',
{{ encryptedInterconnectRouter }},
'{{ md5AuthenticationKeys }}',
'{{ project }}',
'{{ region }}',
'{{ requestId }}'
RETURNING
id,
name,
clientOperationId,
creationTimestamp,
description,
endTime,
error,
httpErrorMessage,
httpErrorStatusCode,
insertTime,
instancesBulkInsertOperationMetadata,
kind,
operationGroupId,
operationType,
progress,
region,
selfLink,
setCommonInstanceMetadataOperationMetadata,
startTime,
status,
statusMessage,
targetId,
targetLink,
user,
warnings,
zone
;
# Description fields are for documentation purposes
- name: routers
props:
- name: project
value: string
description: Required parameter for the routers resource.
- name: region
value: string
description: Required parameter for the routers resource.
- name: kind
value: string
description: >
[Output Only] Type of resource. Always compute#router for routers.
default: compute#router
- name: id
value: string
description: >
[Output Only] The unique identifier for the resource. This identifier is defined by the server.
- name: creationTimestamp
value: string
description: >
[Output Only] Creation timestamp in RFC3339 text format.
- name: name
value: string
description: >
Name of the resource. Provided by the client when the resource is created. The name must be 1-63 characters long, and comply with RFC1035. Specifically, the name must be 1-63 characters long and match the regular expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means the first character must be a lowercase letter, and all following characters must be a dash, lowercase letter, or digit, except the last character, which cannot be a dash.
- name: description
value: string
description: >
An optional description of this resource. Provide this property when you create the resource.
- name: region
value: string
description: >
[Output Only] URI of the region where the router resides. You must specify this field as part of the HTTP request URL. It is not settable as a field in the request body.
- name: network
value: string
description: >
URI of the network to which this router belongs.
- name: interfaces
value: array
description: >
Router interfaces. To create a BGP peer that uses a router interface, the interface must have one of the following fields specified: - linkedVpnTunnel - linkedInterconnectAttachment - subnetwork You can create a router interface without any of these fields specified. However, you cannot create a BGP peer that uses that interface.
- name: bgpPeers
value: array
description: >
BGP information that must be configured into the routing stack to establish BGP peering. This information must specify the peer ASN and either the interface name, IP address, or peer IP address. Please refer to RFC4273.
- name: bgp
value: object
description: >
BGP information specific to this router.
- name: selfLink
value: string
description: >
[Output Only] Server-defined URL for the resource.
- name: nats
value: array
description: >
A list of NAT services created in this router.
- name: encryptedInterconnectRouter
value: boolean
description: >
Indicates if a router is dedicated for use with encrypted VLAN attachments (interconnectAttachments).
- name: md5AuthenticationKeys
value: array
description: >
Keys used for MD5 authentication.
- name: requestId
value: string
UPDATE
examples
- patch
- patch_route_policy
Patches the specified Router resource with the data included in the request. This method supports PATCH semantics and uses JSON merge patch format and processing rules.
UPDATE google.compute.routers
SET
data__kind = '{{ kind }}',
data__id = '{{ id }}',
data__creationTimestamp = '{{ creationTimestamp }}',
data__name = '{{ name }}',
data__description = '{{ description }}',
data__region = '{{ region }}',
data__network = '{{ network }}',
data__interfaces = '{{ interfaces }}',
data__bgpPeers = '{{ bgpPeers }}',
data__bgp = '{{ bgp }}',
data__selfLink = '{{ selfLink }}',
data__nats = '{{ nats }}',
data__encryptedInterconnectRouter = {{ encryptedInterconnectRouter }},
data__md5AuthenticationKeys = '{{ md5AuthenticationKeys }}'
WHERE
project = '{{ project }}' --required
AND region = '{{ region }}' --required
AND router = '{{ router }}' --required
AND requestId = '{{ requestId}}'
RETURNING
id,
name,
clientOperationId,
creationTimestamp,
description,
endTime,
error,
httpErrorMessage,
httpErrorStatusCode,
insertTime,
instancesBulkInsertOperationMetadata,
kind,
operationGroupId,
operationType,
progress,
region,
selfLink,
setCommonInstanceMetadataOperationMetadata,
startTime,
status,
statusMessage,
targetId,
targetLink,
user,
warnings,
zone;
Patches Route Policy
UPDATE google.compute.routers
SET
data__name = '{{ name }}',
data__type = '{{ type }}',
data__terms = '{{ terms }}',
data__fingerprint = '{{ fingerprint }}',
data__description = '{{ description }}'
WHERE
project = '{{ project }}' --required
AND region = '{{ region }}' --required
AND router = '{{ router }}' --required
AND requestId = '{{ requestId}}'
RETURNING
id,
name,
clientOperationId,
creationTimestamp,
description,
endTime,
error,
httpErrorMessage,
httpErrorStatusCode,
insertTime,
instancesBulkInsertOperationMetadata,
kind,
operationGroupId,
operationType,
progress,
region,
selfLink,
setCommonInstanceMetadataOperationMetadata,
startTime,
status,
statusMessage,
targetId,
targetLink,
user,
warnings,
zone;
REPLACE
examples
- update
Updates the specified Router resource with the data included in the request. This method conforms to PUT semantics, which requests that the state of the target resource be created or replaced with the state defined by the representation enclosed in the request message payload.
REPLACE google.compute.routers
SET
data__kind = '{{ kind }}',
data__id = '{{ id }}',
data__creationTimestamp = '{{ creationTimestamp }}',
data__name = '{{ name }}',
data__description = '{{ description }}',
data__region = '{{ region }}',
data__network = '{{ network }}',
data__interfaces = '{{ interfaces }}',
data__bgpPeers = '{{ bgpPeers }}',
data__bgp = '{{ bgp }}',
data__selfLink = '{{ selfLink }}',
data__nats = '{{ nats }}',
data__encryptedInterconnectRouter = {{ encryptedInterconnectRouter }},
data__md5AuthenticationKeys = '{{ md5AuthenticationKeys }}'
WHERE
project = '{{ project }}' --required
AND region = '{{ region }}' --required
AND router = '{{ router }}' --required
AND requestId = '{{ requestId}}'
RETURNING
id,
name,
clientOperationId,
creationTimestamp,
description,
endTime,
error,
httpErrorMessage,
httpErrorStatusCode,
insertTime,
instancesBulkInsertOperationMetadata,
kind,
operationGroupId,
operationType,
progress,
region,
selfLink,
setCommonInstanceMetadataOperationMetadata,
startTime,
status,
statusMessage,
targetId,
targetLink,
user,
warnings,
zone;
DELETE
examples
- delete
Deletes the specified Router resource.
DELETE FROM google.compute.routers
WHERE project = '{{ project }}' --required
AND region = '{{ region }}' --required
AND router = '{{ router }}' --required
AND requestId = '{{ requestId }}';
Lifecycle Methods
- preview
Preview fields auto-generated during router create and update operations. Calling this method does NOT create or update the router.
EXEC google.compute.routers.preview
@project='{{ project }}' --required,
@region='{{ region }}' --required,
@router='{{ router }}' --required
@@json=
'{
"kind": "{{ kind }}",
"id": "{{ id }}",
"creationTimestamp": "{{ creationTimestamp }}",
"name": "{{ name }}",
"description": "{{ description }}",
"region": "{{ region }}",
"network": "{{ network }}",
"interfaces": "{{ interfaces }}",
"bgpPeers": "{{ bgpPeers }}",
"bgp": "{{ bgp }}",
"selfLink": "{{ selfLink }}",
"nats": "{{ nats }}",
"encryptedInterconnectRouter": {{ encryptedInterconnectRouter }},
"md5AuthenticationKeys": "{{ md5AuthenticationKeys }}"
}';