REST Resource: subnetworks

Resource: Subnetwork

A Subnetwork resource.

JSON representation
{
  "id": string,
  "creationTimestamp": string,
  "name": string,
  "description": string,
  "network": string,
  "ipCidrRange": string,
  "gatewayAddress": string,
  "region": string,
  "selfLink": string,
  "privateIpGoogleAccess": boolean,
  "secondaryIpRanges": [
    {
      "rangeName": string,
      "ipCidrRange": string
    }
  ],
  "fingerprint": string,
  "enableFlowLogs": boolean,
  "kind": string
}
Fields
id

string (fixed64 format)

[Output Only] The unique identifier for the resource. This identifier is defined by the server.

creationTimestamp

string

[Output Only] Creation timestamp in RFC3339 text format.

name

string

The name of the resource, provided by the client when initially creating the resource. 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.

description

string

An optional description of this resource. Provide this property when you create the resource. This field can be set only at resource creation time.

network

string

The URL of the network to which this subnetwork belongs, provided by the client when initially creating the subnetwork. Only networks that are in the distributed mode can have subnetworks. This field can be set only at resource creation time.

ipCidrRange

string

The range of internal addresses that are owned by this subnetwork. Provide this property when you create the subnetwork. For example, 10.0.0.0/8 or 192.168.0.0/16. Ranges must be unique and non-overlapping within a network. Only IPv4 is supported. This field can be set only at resource creation time.

gatewayAddress

string

[Output Only] The gateway address for default routes to reach destination addresses outside this subnetwork.

region

string

URL of the region where the Subnetwork resides. This field can be set only at resource creation time.

privateIpGoogleAccess

boolean

Whether the VMs in this subnet can access Google services without assigned external IP addresses. This field can be both set at resource creation time and updated using setPrivateIpGoogleAccess.

secondaryIpRanges[]

object

An array of configurations for secondary IP ranges for VM instances contained in this subnetwork. The primary IP of such VM must belong to the primary ipCidrRange of the subnetwork. The alias IPs may belong to either primary or secondary ranges.

secondaryIpRanges[].rangeName

string

The name associated with this subnetwork secondary range, used when adding an alias IP range to a VM instance. The name must be 1-63 characters long, and comply with RFC1035. The name must be unique within the subnetwork.

secondaryIpRanges[].ipCidrRange

string

The range of IP addresses belonging to this subnetwork secondary range. Provide this property when you create the subnetwork. Ranges must be unique and non-overlapping with all primary and secondary IP ranges within a network. Only IPv4 is supported.

fingerprint

string (bytes format)

Fingerprint of this resource. A hash of the contents stored in this object. This field is used in optimistic locking. This field will be ignored when inserting a Subnetwork. An up-to-date fingerprint must be provided in order to update the Subnetwork.

To see the latest fingerprint, make a get() request to retrieve a Subnetwork.

A base64-encoded string.

enableFlowLogs

boolean

Whether to enable flow logging for this subnetwork.

kind

string

[Output Only] Type of the resource. Always compute#subnetwork for Subnetwork resources.

Methods

aggregatedList

Retrieves an aggregated list of subnetworks.

delete

Deletes the specified subnetwork.

expandIpCidrRange

Expands the IP CIDR range of the subnetwork to a specified value.

get

Returns the specified subnetwork.

insert

Creates a subnetwork in the specified project using the data included in the request.

list

Retrieves a list of subnetworks available to the specified project.

listUsable

Retrieves an aggregated list of usable subnetworks.

patch

Patches the specified subnetwork with the data included in the request.

setPrivateIpGoogleAccess

Set whether VMs in this subnet can access Google services without assigning external IP addresses through Private Google Access.
Was this page helpful? Let us know how we did:

Send feedback about...

Compute Engine