Subnetworks

For a list of methods for this resource, see the end of this page.

Resource representations

A Subnetwork resource.

{
  "kind": "compute#subnetwork",
  "id": unsigned long,
  "creationTimestamp": string,
  "name": string,
  "description": string,
  "network": string,
  "ipCidrRange": string,
  "gatewayAddress": string,
  "region": string,
  "selfLink": string,
  "privateIpGoogleAccess": boolean,
  "secondaryIpRanges": [
    {
      "rangeName": string,
      "ipCidrRange": string
    }
  ]
}
Property name Value Description Notes
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. 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. This field can be set only at resource creation time.
id unsigned long [Output Only] The unique identifier for the resource. This identifier is defined by the server.
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.
kind string [Output Only] Type of the resource. Always compute#subnetwork for Subnetwork resources.
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.
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.
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.
region string URL of the region where the Subnetwork resides. This field can be set only at resource creation time.
secondaryIpRanges[] list 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[].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.
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.

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. Get a list of available subnetworks list() request.
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.
setPrivateIpGoogleAccess
Set whether VMs in this subnet can access Google services without assigning external IP addresses through Private Google Access.

Monitor your resources on the go

Get the Google Cloud Console app to help you manage your projects.

Send feedback about...

Compute Engine