- HTTP request
- Path parameters
- Query parameters
- Request body
- Response body
- Authorization Scopes
- IAM Permissions
- Examples
- Try it!
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.
HTTP request
PATCH https://compute.googleapis.com/compute/v1/projects/{project}/regions/{region}/routers/{resourceId}
The URL uses gRPC Transcoding syntax.
Path parameters
Parameters | |
---|---|
project |
Project ID for this request. |
region |
Name of the region for this request. |
resourceId |
Name of the Router resource to patch. |
Query parameters
Parameters | |
---|---|
requestId |
An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported ( |
Request body
The request body contains data with the following structure:
JSON representation | |
---|---|
{ "id": string, "creationTimestamp": string, "name": string, "description": string, "region": string, "network": string, "interfaces": [ { "name": string, "linkedVpnTunnel": string, "linkedInterconnectAttachment": string, "ipRange": string, "managementType": enum } ], "bgpPeers": [ { "name": string, "interfaceName": string, "ipAddress": string, "peerIpAddress": string, "peerAsn": integer, "advertisedRoutePriority": integer, "advertiseMode": enum, "advertisedGroups": [ enum ], "advertisedIpRanges": [ { "range": string, "description": string } ], "managementType": enum } ], "bgp": { "asn": integer, "advertiseMode": enum, "advertisedGroups": [ enum ], "advertisedIpRanges": [ { "range": string, "description": string } ] }, "selfLink": string, "nats": [ { "name": string, "sourceSubnetworkIpRangesToNat": enum, "subnetworks": [ { "name": string, "sourceIpRangesToNat": [ enum ], "secondaryIpRangeNames": [ string ] } ], "natIps": [ string ], "drainNatIps": [ string ], "natIpAllocateOption": enum, "minPortsPerVm": integer, "udpIdleTimeoutSec": integer, "icmpIdleTimeoutSec": integer, "tcpEstablishedIdleTimeoutSec": integer, "tcpTransitoryIdleTimeoutSec": integer, "logConfig": { "enable": boolean, "filter": enum }, "enableEndpointIndependentMapping": boolean } ], "encryptedInterconnectRouter": boolean, "kind": string } |
Fields | |
---|---|
id |
[Output Only] The unique identifier for the resource. This identifier is defined by the server. |
creationTimestamp |
[Output Only] Creation timestamp in RFC3339 text format. |
name |
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 |
description |
An optional description of this resource. Provide this property when you create the resource. |
region |
[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. |
network |
URI of the network to which this router belongs. Authorization requires the following IAM permission on the specified resource
|
interfaces[] |
Router interfaces. Each interface requires either one linked resource, (for example, linkedVpnTunnel), or IP address and IP address range (for example, ipRange), or both. |
interfaces[].name |
Name of this interface entry. 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 |
interfaces[].linkedVpnTunnel |
URI of the linked VPN tunnel, which must be in the same region as the router. Each interface can have one linked resource, which can be a VPN tunnel, an Interconnect attachment, or a virtual machine instance. |
interfaces[].linkedInterconnectAttachment |
URI of the linked Interconnect attachment. It must be in the same region as the router. Each interface can have one linked resource, which can be a VPN tunnel, an Interconnect attachment, or a virtual machine instance. |
interfaces[].ipRange |
IP address and range of the interface. The IP range must be in the RFC3927 link-local IP address space. The value must be a CIDR-formatted string, for example: |
interfaces[].managementType |
[Output Only] The resource that configures and manages this interface.
|
bgpPeers[] |
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. |
bgpPeers[].name |
Name of this BGP peer. 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 |
bgpPeers[].interfaceName |
Name of the interface the BGP peer is associated with. |
bgpPeers[].ipAddress |
IP address of the interface inside Google Cloud Platform. Only IPv4 is supported. |
bgpPeers[].peerIpAddress |
IP address of the BGP interface outside Google Cloud Platform. Only IPv4 is supported. |
bgpPeers[].peerAsn |
Peer BGP Autonomous System Number (ASN). Each BGP interface may use a different value. |
bgpPeers[].advertisedRoutePriority |
The priority of routes advertised to this BGP peer. Where there is more than one matching route of maximum length, the routes with the lowest priority value win. |
bgpPeers[].advertiseMode |
User-specified flag to indicate which mode to use for advertisement. |
bgpPeers[].advertisedGroups[] |
User-specified list of prefix groups to advertise in custom mode, which can take one of the following options:
|
bgpPeers[].advertisedIpRanges[] |
User-specified list of individual IP ranges to advertise in custom mode. This field can only be populated if advertiseMode is CUSTOM and overrides the list defined for the router (in the "bgp" message). These IP ranges are advertised in addition to any specified groups. Leave this field blank to advertise no custom IP ranges. |
bgpPeers[].advertisedIpRanges[].range |
The IP range to advertise. The value must be a CIDR-formatted string. |
bgpPeers[].advertisedIpRanges[].description |
User-specified description for the IP range. |
bgpPeers[].managementType |
[Output Only] The resource that configures and manages this BGP peer.
|
bgp |
BGP information specific to this router. |
bgp.asn |
Local BGP Autonomous System Number (ASN). Must be an RFC6996 private ASN, either 16-bit or 32-bit. The value will be fixed for this router resource. All VPN tunnels that link to this router will have the same local ASN. |
bgp.advertiseMode |
User-specified flag to indicate which mode to use for advertisement. The options are DEFAULT or CUSTOM. |
bgp.advertisedGroups[] |
User-specified list of prefix groups to advertise in custom mode. This field can only be populated if advertiseMode is CUSTOM and is advertised to all peers of the router. These groups will be advertised in addition to any specified prefixes. Leave this field blank to advertise no custom groups. |
bgp.advertisedIpRanges[] |
User-specified list of individual IP ranges to advertise in custom mode. This field can only be populated if advertiseMode is CUSTOM and is advertised to all peers of the router. These IP ranges will be advertised in addition to any specified groups. Leave this field blank to advertise no custom IP ranges. |
bgp.advertisedIpRanges[].range |
The IP range to advertise. The value must be a CIDR-formatted string. |
bgp.advertisedIpRanges[].description |
User-specified description for the IP range. |
selfLink |
[Output Only] Server-defined URL for the resource. |
nats[] |
A list of NAT services created in this router. |
nats[].name |
Unique name of this Nat service. The name must be 1-63 characters long and comply with RFC1035. |
nats[].sourceSubnetworkIpRangesToNat |
Specify the Nat option, which can take one of the following values:
|
nats[].subnetworks[] |
A list of Subnetwork resources whose traffic should be translated by NAT Gateway. It is used only when LIST_OF_SUBNETWORKS is selected for the SubnetworkIpRangeToNatOption above. |
nats[].subnetworks[].name |
URL for the subnetwork resource that will use NAT. |
nats[].subnetworks[].sourceIpRangesToNat[] |
Specify the options for NAT ranges in the Subnetwork. All options of a single value are valid except NAT_IP_RANGE_OPTION_UNSPECIFIED. The only valid option with multiple values is: ["PRIMARY_IP_RANGE", "LIST_OF_SECONDARY_IP_RANGES"] Default: [ALL_IP_RANGES] |
nats[].subnetworks[].secondaryIpRangeNames[] |
A list of the secondary ranges of the Subnetwork that are allowed to use NAT. This can be populated only if "LIST_OF_SECONDARY_IP_RANGES" is one of the values in sourceIpRangesToNat. |
nats[].natIps[] |
A list of URLs of the IP resources used for this Nat service. These IP addresses must be valid static external IP addresses assigned to the project. |
nats[].drainNatIps[] |
A list of URLs of the IP resources to be drained. These IPs must be valid static external IPs that have been assigned to the NAT. These IPs should be used for updating/patching a NAT only. |
nats[].natIpAllocateOption |
Specify the NatIpAllocateOption, which can take one of the following values:
|
nats[].minPortsPerVm |
Minimum number of ports allocated to a VM from this NAT config. If not set, a default number of ports is allocated to a VM. This is rounded up to the nearest power of 2. For example, if the value of this field is 50, at least 64 ports are allocated to a VM. |
nats[].udpIdleTimeoutSec |
Timeout (in seconds) for UDP connections. Defaults to 30s if not set. |
nats[].icmpIdleTimeoutSec |
Timeout (in seconds) for ICMP connections. Defaults to 30s if not set. |
nats[].tcpEstablishedIdleTimeoutSec |
Timeout (in seconds) for TCP established connections. Defaults to 1200s if not set. |
nats[].tcpTransitoryIdleTimeoutSec |
Timeout (in seconds) for TCP transitory connections. Defaults to 30s if not set. |
nats[].logConfig |
Configure logging on this NAT. |
nats[].logConfig.enable |
Indicates whether or not to export logs. This is false by default. |
nats[].logConfig.filter |
Specify the desired filtering of logs on this NAT. If unspecified, logs are exported for all connections handled by this NAT. This option can take one of the following values:
|
nats[].enableEndpointIndependentMapping |
|
encryptedInterconnectRouter |
Field to indicate if a router is dedicated to use with encrypted Interconnect Attachment (IPsec-encrypted Cloud Interconnect feature). Not currently available in all Interconnect locations. |
kind |
[Output Only] Type of resource. Always |
Response body
If successful, the response body contains data with the following structure:
JSON representation | |
---|---|
{ "id": string, "creationTimestamp": string, "name": string, "zone": string, "clientOperationId": string, "operationType": string, "targetLink": string, "targetId": string, "status": enum, "statusMessage": string, "user": string, "progress": integer, "insertTime": string, "startTime": string, "endTime": string, "error": { "errors": [ { "code": string, "location": string, "message": string } ] }, "warnings": [ { "code": enum, "message": string, "data": [ { "key": string, "value": string } ] } ], "httpErrorStatusCode": integer, "httpErrorMessage": string, "selfLink": string, "region": string, "description": string, "operationGroupId": string, "kind": string } |
Fields | |
---|---|
id |
[Output Only] The unique identifier for the operation. This identifier is defined by the server. |
creationTimestamp |
[Deprecated] This field is deprecated. |
name |
[Output Only] Name of the operation. |
zone |
[Output Only] The URL of the zone where the operation resides. Only applicable when performing per-zone operations. |
clientOperationId |
[Output Only] The value of |
operationType |
[Output Only] The type of operation, such as |
targetLink |
[Output Only] The URL of the resource that the operation modifies. For operations related to creating a snapshot, this points to the persistent disk that the snapshot was created from. |
targetId |
[Output Only] The unique target ID, which identifies a specific incarnation of the target resource. |
status |
[Output Only] The status of the operation, which can be one of the following: |
statusMessage |
[Output Only] An optional textual description of the current status of the operation. |
user |
[Output Only] User who requested the operation, for example: |
progress |
[Output Only] An optional progress indicator that ranges from 0 to 100. There is no requirement that this be linear or support any granularity of operations. This should not be used to guess when the operation will be complete. This number should monotonically increase as the operation progresses. |
insertTime |
[Output Only] The time that this operation was requested. This value is in RFC3339 text format. |
startTime |
[Output Only] The time that this operation was started by the server. This value is in RFC3339 text format. |
endTime |
[Output Only] The time that this operation was completed. This value is in RFC3339 text format. |
error |
[Output Only] If errors are generated during processing of the operation, this field will be populated. |
error.errors[] |
[Output Only] The array of errors encountered while processing this operation. |
error.errors[].code |
[Output Only] The error type identifier for this error. |
error.errors[].location |
[Output Only] Indicates the field in the request that caused the error. This property is optional. |
error.errors[].message |
[Output Only] An optional, human-readable error message. |
warnings[] |
[Output Only] If warning messages are generated during processing of the operation, this field will be populated. |
warnings[].code |
[Output Only] A warning code, if applicable. For example, Compute Engine returns |
warnings[].message |
[Output Only] A human-readable description of the warning code. |
warnings[].data[] |
[Output Only] Metadata about this warning in "data": [ { "key": "scope", "value": "zones/us-east1-d" } |
warnings[].data[].key |
[Output Only] A key that provides more detail on the warning being returned. For example, for warnings where there are no results in a list request for a particular zone, this key might be |
warnings[].data[].value |
[Output Only] A warning data value corresponding to the key. |
httpErrorStatusCode |
[Output Only] If the operation fails, this field contains the HTTP error status code that was returned. For example, a |
httpErrorMessage |
[Output Only] If the operation fails, this field contains the HTTP error message that was returned, such as |
selfLink |
[Output Only] Server-defined URL for the resource. |
region |
[Output Only] The URL of the region where the operation resides. Only applicable when performing regional operations. |
description |
[Output Only] A textual description of the operation, which is set when the operation is created. |
operationGroupId |
[Output Only] An ID that represents a group of operations, such as when a group of operations results from a |
kind |
[Output Only] Type of the resource. Always |
Authorization Scopes
Requires one of the following OAuth scopes:
https://www.googleapis.com/auth/compute
https://www.googleapis.com/auth/cloud-platform
For more information, see the Authentication Overview.
IAM Permissions
In addition to any permissions specified on the fields above, authorization requires one or more of the following IAM permissions:
compute.routers.get
compute.routers.update
To find predefined roles that contain those permissions, see Compute Engine IAM Roles.