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
| 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 withRFC1035. 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](?:[-a-z0-9]{0,61}[a-z0-9])?) |
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 toRFC4273. |
creationTimestamp | string | Output only. [Output Only] Creation timestamp inRFC3339 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. [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. |
nccGateway | string | URI of the ncc_gateway to which this router associated. |
network | string | URI of the network to which this router belongs. |
params | object | Input only. [Input Only] Additional params passed with the request, but not persisted as part of resource payload. (id: RouterParams) |
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. |
| 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. [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 thanmaxResults, 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. [Output Only] Server-defined URL for this resource. |
warning | object | [Output Only] Informational warning message. |
| 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 withRFC1035. 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](?:[-a-z0-9]{0,61}[a-z0-9])?) |
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 toRFC4273. |
creationTimestamp | string | Output only. [Output Only] Creation timestamp inRFC3339 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. [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. |
nccGateway | string | URI of the ncc_gateway to which this router associated. |
network | string | URI of the network to which this router belongs. |
params | object | Input only. [Input Only] Additional params passed with the request, but not persisted as part of resource payload. (id: RouterParams) |
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 | maxResults, pageToken, filter, orderBy, returnPartialSuccess | Retrieves a list of Router resources available to the specified project. |
aggregated_list | select | project | returnPartialSuccess, filter, serviceProjectNumber, maxResults, pageToken, includeAllScopes, orderBy | 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 supportsPATCH semantics and usesJSON merge patch format and processing rules. |
patch_named_set | update | project, region, router | requestId | Patches Named Set |
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 toPUT 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 andupdate 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,
nccGateway,
network,
params,
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 maxResults = '{{ maxResults }}'
AND pageToken = '{{ pageToken }}'
AND filter = '{{ filter }}'
AND orderBy = '{{ orderBy }}'
AND returnPartialSuccess = '{{ returnPartialSuccess }}'
;
Retrieves an aggregated list of routers.
To prevent failure, Google recommends that you set thereturnPartialSuccess parameter to true.
SELECT
id,
name,
bgp,
bgpPeers,
creationTimestamp,
description,
encryptedInterconnectRouter,
interfaces,
kind,
md5AuthenticationKeys,
nats,
nccGateway,
network,
params,
region,
selfLink
FROM google.compute.routers
WHERE project = '{{ project }}' -- required
AND returnPartialSuccess = '{{ returnPartialSuccess }}'
AND filter = '{{ filter }}'
AND serviceProjectNumber = '{{ serviceProjectNumber }}'
AND maxResults = '{{ maxResults }}'
AND pageToken = '{{ pageToken }}'
AND includeAllScopes = '{{ includeAllScopes }}'
AND orderBy = '{{ orderBy }}'
;
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__bgp,
data__region,
data__md5AuthenticationKeys,
data__network,
data__params,
data__bgpPeers,
data__name,
data__interfaces,
data__nccGateway,
data__description,
data__nats,
data__selfLink,
data__id,
data__encryptedInterconnectRouter,
project,
region,
requestId
)
SELECT
'{{ bgp }}',
'{{ region }}',
'{{ md5AuthenticationKeys }}',
'{{ network }}',
'{{ params }}',
'{{ bgpPeers }}',
'{{ name }}',
'{{ interfaces }}',
'{{ nccGateway }}',
'{{ description }}',
'{{ nats }}',
'{{ selfLink }}',
'{{ id }}',
{{ encryptedInterconnectRouter }},
'{{ project }}',
'{{ region }}',
'{{ requestId }}'
RETURNING
id,
name,
clientOperationId,
creationTimestamp,
description,
endTime,
error,
getVersionOperationMetadata,
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: "{{ project }}"
description: Required parameter for the routers resource.
- name: region
value: "{{ region }}"
description: Required parameter for the routers resource.
- name: bgp
description: |
BGP information specific to this router.
value:
advertiseMode: "{{ advertiseMode }}"
keepaliveInterval: {{ keepaliveInterval }}
asn: {{ asn }}
advertisedIpRanges:
- range: "{{ range }}"
description: "{{ description }}"
identifierRange: "{{ identifierRange }}"
advertisedGroups:
- "{{ advertisedGroups }}"
- name: region
value: "{{ region }}"
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: md5AuthenticationKeys
description: |
Keys used for MD5 authentication.
value:
- key: "{{ key }}"
name: "{{ name }}"
- name: network
value: "{{ network }}"
description: |
URI of the network to which this router belongs.
- name: params
description: |
Input only. [Input Only] Additional params passed with the request, but not persisted
as part of resource payload.
value:
resourceManagerTags: "{{ resourceManagerTags }}"
- name: bgpPeers
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 toRFC4273.
value:
- ipAddress: "{{ ipAddress }}"
routerApplianceInstance: "{{ routerApplianceInstance }}"
enableIpv6: {{ enableIpv6 }}
peerIpv4NexthopAddress: "{{ peerIpv4NexthopAddress }}"
name: "{{ name }}"
peerAsn: {{ peerAsn }}
md5AuthenticationKeyName: "{{ md5AuthenticationKeyName }}"
interfaceName: "{{ interfaceName }}"
advertiseMode: "{{ advertiseMode }}"
importPolicies: "{{ importPolicies }}"
advertisedGroups: "{{ advertisedGroups }}"
customLearnedIpRanges: "{{ customLearnedIpRanges }}"
ipv6NexthopAddress: "{{ ipv6NexthopAddress }}"
advertisedIpRanges: "{{ advertisedIpRanges }}"
exportPolicies: "{{ exportPolicies }}"
ipv4NexthopAddress: "{{ ipv4NexthopAddress }}"
customLearnedRoutePriority: {{ customLearnedRoutePriority }}
bfd:
minTransmitInterval: {{ minTransmitInterval }}
minReceiveInterval: {{ minReceiveInterval }}
multiplier: {{ multiplier }}
sessionInitializationMode: "{{ sessionInitializationMode }}"
enableIpv4: {{ enableIpv4 }}
managementType: "{{ managementType }}"
enable: "{{ enable }}"
peerIpAddress: "{{ peerIpAddress }}"
peerIpv6NexthopAddress: "{{ peerIpv6NexthopAddress }}"
advertisedRoutePriority: {{ advertisedRoutePriority }}
- name: name
value: "{{ name }}"
description: |
Name of the resource. Provided by the client when the resource is created.
The name must be 1-63 characters long, and comply withRFC1035.
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: interfaces
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.
value:
- ipVersion: "{{ ipVersion }}"
name: "{{ name }}"
redundantInterface: "{{ redundantInterface }}"
privateIpAddress: "{{ privateIpAddress }}"
ipRange: "{{ ipRange }}"
linkedVpnTunnel: "{{ linkedVpnTunnel }}"
subnetwork: "{{ subnetwork }}"
managementType: "{{ managementType }}"
linkedInterconnectAttachment: "{{ linkedInterconnectAttachment }}"
- name: nccGateway
value: "{{ nccGateway }}"
description: |
URI of the ncc_gateway to which this router associated.
- name: description
value: "{{ description }}"
description: |
An optional description of this resource. Provide this property when you
create the resource.
- name: nats
description: |
A list of NAT services created in this router.
value:
- natIpAllocateOption: "{{ natIpAllocateOption }}"
icmpIdleTimeoutSec: {{ icmpIdleTimeoutSec }}
nat64Subnetworks: "{{ nat64Subnetworks }}"
natIps: "{{ natIps }}"
minPortsPerVm: {{ minPortsPerVm }}
logConfig:
enable: {{ enable }}
filter: "{{ filter }}"
drainNatIps: "{{ drainNatIps }}"
effectiveTcpTimeWaitTimeoutSec: {{ effectiveTcpTimeWaitTimeoutSec }}
type: "{{ type }}"
name: "{{ name }}"
autoNetworkTier: "{{ autoNetworkTier }}"
tcpEstablishedIdleTimeoutSec: {{ tcpEstablishedIdleTimeoutSec }}
udpIdleTimeoutSec: {{ udpIdleTimeoutSec }}
rules: "{{ rules }}"
tcpTransitoryIdleTimeoutSec: {{ tcpTransitoryIdleTimeoutSec }}
subnetworks: "{{ subnetworks }}"
sourceSubnetworkIpRangesToNat: "{{ sourceSubnetworkIpRangesToNat }}"
sourceSubnetworkIpRangesToNat64: "{{ sourceSubnetworkIpRangesToNat64 }}"
maxPortsPerVm: {{ maxPortsPerVm }}
enableEndpointIndependentMapping: {{ enableEndpointIndependentMapping }}
tcpTimeWaitTimeoutSec: {{ tcpTimeWaitTimeoutSec }}
enableDynamicPortAllocation: {{ enableDynamicPortAllocation }}
endpointTypes: "{{ endpointTypes }}"
- name: selfLink
value: "{{ selfLink }}"
description: |
[Output Only] Server-defined URL for the resource.
- name: id
value: "{{ id }}"
description: |
[Output Only] The unique identifier for the resource. This identifier is
defined by the server.
- name: encryptedInterconnectRouter
value: {{ encryptedInterconnectRouter }}
description: |
Indicates if a router is dedicated for use with encrypted VLAN
attachments (interconnectAttachments).
- name: requestId
value: "{{ requestId }}"
UPDATE examples
- patch
- patch_named_set
- patch_route_policy
Patches the specified Router resource with the data included in the
request. This method supportsPATCH
semantics and usesJSON merge
patch format and processing rules.
UPDATE google.compute.routers
SET
data__bgp = '{{ bgp }}',
data__region = '{{ region }}',
data__md5AuthenticationKeys = '{{ md5AuthenticationKeys }}',
data__network = '{{ network }}',
data__params = '{{ params }}',
data__bgpPeers = '{{ bgpPeers }}',
data__name = '{{ name }}',
data__interfaces = '{{ interfaces }}',
data__nccGateway = '{{ nccGateway }}',
data__description = '{{ description }}',
data__nats = '{{ nats }}',
data__selfLink = '{{ selfLink }}',
data__id = '{{ id }}',
data__encryptedInterconnectRouter = {{ encryptedInterconnectRouter }}
WHERE
project = '{{ project }}' --required
AND region = '{{ region }}' --required
AND router = '{{ router }}' --required
AND requestId = '{{ requestId}}'
RETURNING
id,
name,
clientOperationId,
creationTimestamp,
description,
endTime,
error,
getVersionOperationMetadata,
httpErrorMessage,
httpErrorStatusCode,
insertTime,
instancesBulkInsertOperationMetadata,
kind,
operationGroupId,
operationType,
progress,
region,
selfLink,
setCommonInstanceMetadataOperationMetadata,
startTime,
status,
statusMessage,
targetId,
targetLink,
user,
warnings,
zone;
Patches Named Set
UPDATE google.compute.routers
SET
data__description = '{{ description }}',
data__name = '{{ name }}',
data__type = '{{ type }}',
data__elements = '{{ elements }}',
data__fingerprint = '{{ fingerprint }}'
WHERE
project = '{{ project }}' --required
AND region = '{{ region }}' --required
AND router = '{{ router }}' --required
AND requestId = '{{ requestId}}'
RETURNING
id,
name,
clientOperationId,
creationTimestamp,
description,
endTime,
error,
getVersionOperationMetadata,
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__description = '{{ description }}',
data__terms = '{{ terms }}',
data__type = '{{ type }}',
data__fingerprint = '{{ fingerprint }}'
WHERE
project = '{{ project }}' --required
AND region = '{{ region }}' --required
AND router = '{{ router }}' --required
AND requestId = '{{ requestId}}'
RETURNING
id,
name,
clientOperationId,
creationTimestamp,
description,
endTime,
error,
getVersionOperationMetadata,
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 toPUT 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__bgp = '{{ bgp }}',
data__region = '{{ region }}',
data__md5AuthenticationKeys = '{{ md5AuthenticationKeys }}',
data__network = '{{ network }}',
data__params = '{{ params }}',
data__bgpPeers = '{{ bgpPeers }}',
data__name = '{{ name }}',
data__interfaces = '{{ interfaces }}',
data__nccGateway = '{{ nccGateway }}',
data__description = '{{ description }}',
data__nats = '{{ nats }}',
data__selfLink = '{{ selfLink }}',
data__id = '{{ id }}',
data__encryptedInterconnectRouter = {{ encryptedInterconnectRouter }}
WHERE
project = '{{ project }}' --required
AND region = '{{ region }}' --required
AND router = '{{ router }}' --required
AND requestId = '{{ requestId}}'
RETURNING
id,
name,
clientOperationId,
creationTimestamp,
description,
endTime,
error,
getVersionOperationMetadata,
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 andupdate 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=
'{
"bgp": "{{ bgp }}",
"region": "{{ region }}",
"md5AuthenticationKeys": "{{ md5AuthenticationKeys }}",
"network": "{{ network }}",
"params": "{{ params }}",
"bgpPeers": "{{ bgpPeers }}",
"name": "{{ name }}",
"interfaces": "{{ interfaces }}",
"nccGateway": "{{ nccGateway }}",
"description": "{{ description }}",
"nats": "{{ nats }}",
"selfLink": "{{ selfLink }}",
"id": "{{ id }}",
"encryptedInterconnectRouter": {{ encryptedInterconnectRouter }}
}'
;