Method: networks.get

Returns the specified network. Gets a list of available networks by making a list() request.

HTTP request

GET https://compute.googleapis.com/compute/beta/projects/{project}/global/networks/{resourceId}

The URL uses gRPC Transcoding syntax.

Path parameters

Parameters
project

string

Project ID for this request.

resourceId

string

Name of the network 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 VPC Network resource.

Networks connect resources to each other and to the internet. For more information, read Virtual Private Cloud (VPC) Network.

JSON representation
{
  "id": string,
  "creationTimestamp": string,
  "name": string,
  "description": string,
  "IPv4Range": string,
  "gatewayIPv4": string,
  "selfLink": string,
  "autoCreateSubnetworks": boolean,
  "subnetworks": [
    string
  ],
  "peerings": [
    {
      "name": string,
      "network": string,
      "state": enum,
      "stateDetails": string,
      "autoCreateRoutes": boolean,
      "exportCustomRoutes": boolean,
      "importCustomRoutes": boolean,
      "exchangeSubnetRoutes": boolean,
      "exportSubnetRoutesWithPublicIp": boolean,
      "importSubnetRoutesWithPublicIp": boolean,
      "peerMtu": integer
    }
  ],
  "routingConfig": {
    "routingMode": enum
  },
  "mtu": integer,
  "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

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 [a-z]([-a-z0-9]*[a-z0-9])?. The first character must be a lowercase letter, and all following characters (except for the last character) must be a dash, lowercase letter, or digit. The last character must be a lowercase letter or digit.

description

string

An optional description of this resource. Provide this field when you create the resource.

IPv4Range
(deprecated)

string

Deprecated in favor of subnet mode networks. The range of internal addresses that are legal on this network. This range is a CIDR specification, for example: 192.168.0.0/16. Provided by the client when the network is created.

gatewayIPv4

string

[Output Only] The gateway address for default routing out of the network, selected by GCP.

autoCreateSubnetworks

boolean

Must be set to create a VPC network. If not set, a legacy network is created.

When set to true, the VPC network is created in auto mode. When set to false, the VPC network is created in custom mode.

An auto mode VPC network starts with one subnet per region. Each subnet has a predetermined range as described in Auto mode VPC network IP ranges.

For custom mode VPC networks, you can add subnets using the subnetworks insert method.

subnetworks[]

string

[Output Only] Server-defined fully-qualified URLs for all subnetworks in this VPC network.

peerings[]

object

[Output Only] A list of network peerings for the resource.

peerings[].name

string