Method: subnetworks.get

Returns the specified subnetwork. Gets a list of available subnetworks list() request.

HTTP request

GET https://compute.googleapis.com/compute/beta/projects/{project}/regions/{region}/subnetworks/{resourceId}

The URL uses gRPC Transcoding syntax.

Path parameters

Parameters
project

string

Project ID for this request.

region

string

Name of the region scoping this request.

resourceId

string

Name of the Subnetwork resource to return.

Request body

The request body must be empty.

Response body

If successful, the response body contains data with the following structure:

Represents a Subnetwork resource.

A subnetwork (also known as a subnet) is a logical partition of a Virtual Private Cloud network with one primary IP range and zero or more secondary IP ranges. For more information, read Virtual Private Cloud (VPC) Network.

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,
  "allowSubnetCidrRoutesOverlap": boolean,
  "enableFlowLogs": boolean,
  "privateIpv6GoogleAccess": enum,
  "ipv6CidrRange": string,
  "externalIpv6Prefix": string,
  "purpose": enum,
  "role": enum,
  "state": enum,
  "logConfig": {
    "enable": boolean,
    "aggregationInterval": enum,
    "flowSampling": number,
    "metadata": enum,
    "metadataFields": [
      string
    ],
    "filterExpr": string
  },
  "stackType": enum,
  "ipv6AccessType": enum,
  "kind": string
}
Fields
id

string (uint64 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. 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 100.64.0.0/10. Ranges must be unique and non-overlapping within a network. Only IPv4 is supported. This field is set at resource creation time. The range can be any range listed in the Valid ranges list. The range can be expanded after creation using expandIpCidrRange.

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