Method: instances.updateNetworkInterface

Updates an instance's network interface. This method can only update an interface's alias IP range and attached network. See Modifying alias IP ranges for an existing instance for instructions on changing alias IP ranges. See Migrating a VM between networks for instructions on migrating an interface. This method follows PATCH semantics.

HTTP request

PATCH https://compute.googleapis.com/compute/v1/projects/{project}/zones/{zone}/instances/{resourceId}/updateNetworkInterface

The URL uses gRPC Transcoding syntax.

Path parameters

Parameters
project

string

Project ID for this request.

zone

string

The name of the zone for this request.

resourceId

string

The instance name for this request.

Query parameters

Parameters
requestId

string

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 (00000000-0000-0000-0000-000000000000).

networkInterface

string

The name of the network interface to update.

Request body

The request body contains data with the following structure:

JSON representation
{
  "network": string,
  "subnetwork": string,
  "networkIP": string,
  "ipv6Address": string,
  "name": string,
  "accessConfigs": [
    {
      "type": enum,
      "name": string,
      "natIP": string,
      "externalIpv6": string,
      "externalIpv6PrefixLength": integer,
      "setPublicPtr": boolean,
      "publicPtrDomainName": string,
      "networkTier": enum,
      "kind": string
    }
  ],
  "ipv6AccessConfigs": [
    {
      "type": enum,
      "name": string,
      "natIP": string,
      "externalIpv6": string,
      "externalIpv6PrefixLength": integer,
      "setPublicPtr": boolean,
      "publicPtrDomainName": string,
      "networkTier": enum,
      "kind": string
    }
  ],
  "aliasIpRanges": [
    {
      "ipCidrRange": string,
      "subnetworkRangeName": string
    }
  ],
  "fingerprint": string,
  "stackType": enum,
  "ipv6AccessType": enum,
  "queueCount": integer,
  "nicType": enum,
  "kind": string
}
Fields
network

string

URL of the network resource for this instance. When creating an instance, if neither the network nor the subnetwork is specified, the default network global/networks/default is used; if the network is not specified but the subnetwork is specified, the network is inferred.

If you specify this property, you can specify the network as a full or partial URL. For example, the following are all valid URLs:

subnetwork

string

The URL of the Subnetwork resource for this instance. If the network resource is in legacy mode, do not specify this field. If the network is in auto subnet mode, specifying the subnetwork is optional. If the network is in custom subnet mode, specifying the subnetwork is required. If you specify this field, you can specify the subnetwork as a full or partial URL. For example, the following are all valid URLs: