Method: networks.get

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

HTTP request

GET https://www.googleapis.com/compute/v1/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 Network resource. Read Virtual Private Cloud (VPC) Network Overview for more information.

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
    }
  ],
  "routingConfig": {
    "routingMode": enum
  },
  "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

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])? 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.

IPv4Range

string

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. This value is read only and is selected by GCP.

autoCreateSubnetworks

boolean

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.

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

Name of this peering. Provided by the client when the peering is created. The name must comply with RFC1035. Specifically, the name must be 1-63 characters long and match regular expression [a-z]([-a-z0-9]*[a-z0-9])? which means the first character must be a lowercase letter, and all the following characters must be a dash, lowercase letter, or digit, except the last character, which cannot be a dash.

peerings[].network

string

The URL of the peer network. It can be either full URL or partial URL. The peer network may belong to a different project. If the partial URL does not contain project, it is assumed that the peer network is in the same project as the current network.

peerings[].state

enum

[Output Only] State for the peering.

peerings[].stateDetails

string

[Output Only] Details about the current state of the peering.

peerings[].autoCreateRoutes

boolean

Whether full mesh connectivity is created and managed automatically. When it is set to true, Google Compute Engine will automatically create and manage the routes between two networks when the state is ACTIVE. Otherwise, user needs to create routes manually to route packets to peer network.

routingConfig

object

The network-level routing configuration for this network. Used by Cloud Router to determine what type of network-wide routing behavior to enforce.

routingConfig.routingMode

enum

The network-wide routing mode to use. If set to REGIONAL, this network's cloud routers will only advertise routes with subnets of this network in the same region as the router. If set to GLOBAL, this network's cloud routers will advertise routes with all subnets of this network, across regions.

kind

string

[Output Only] Type of the resource. Always compute#network for networks.

Authorization Scopes

Requires one of the following OAuth scopes:

  • https://www.googleapis.com/auth/compute
  • https://www.googleapis.com/auth/cloud-platform

For more information, see the Authentication Overview.

IAM Permissions

In addition to any permissions specified on the fields above, authorization requires one or more of the following Google IAM permissions:

  • compute.networks.get
Was this page helpful? Let us know how we did:

Send feedback about...

Compute Engine