Reference documentation and code samples for the Compute V1 Client class UsableSubnetwork.
Subnetwork which the current user has compute.subnetworks.use permission on.
Generated from protobuf messagegoogle.cloud.compute.v1.UsableSubnetwork
Namespace
Google \ Cloud \ Compute \ V1
Methods
__construct
Constructor.
Parameters
Name
Description
data
array
Optional. Data for populating the Message object.
↳ external_ipv6_prefix
string
[Output Only] The external IPv6 address range that is assigned to this subnetwork.
↳ internal_ipv6_prefix
string
[Output Only] The internal IPv6 address range that is assigned to this subnetwork.
↳ ip_cidr_range
string
The range of internal addresses that are owned by this subnetwork.
↳ ipv6_access_type
string
The access type of IPv6 address this subnet holds. It's immutable and can only be specified during creation or the first time the subnet is updated into IPV4_IPV6 dual stack. Check the Ipv6AccessType enum for the list of possible values.
↳ network
string
Network URL.
↳ purpose
string
Check the Purpose enum for the list of possible values.
↳ role
string
The role of subnetwork. Currently, this field is only used when purpose is set to GLOBAL_MANAGED_PROXY or REGIONAL_MANAGED_PROXY. The value can be set to ACTIVE or BACKUP. An ACTIVE subnetwork is one that is currently being used for Envoy-based load balancers in a region. A BACKUP subnetwork is one that is ready to be promoted to ACTIVE or is currently draining. This field can be updated with a patch request. Check the Role enum for the list of possible values.
The stack type for the subnet. If set to IPV4_ONLY, new VMs in the subnet are assigned IPv4 addresses only. If set to IPV4_IPV6, new VMs in the subnet can be assigned both IPv4 and IPv6 addresses. If not specified, IPV4_ONLY is used. This field can be both set at resource creation time and updated using patch. Check the StackType enum for the list of possible values.
↳ subnetwork
string
Subnetwork URL.
getExternalIpv6Prefix
[Output Only] The external IPv6 address range that is assigned to this subnetwork.
Returns
Type
Description
string
hasExternalIpv6Prefix
clearExternalIpv6Prefix
setExternalIpv6Prefix
[Output Only] The external IPv6 address range that is assigned to this subnetwork.
Parameter
Name
Description
var
string
Returns
Type
Description
$this
getInternalIpv6Prefix
[Output Only] The internal IPv6 address range that is assigned to this subnetwork.
Returns
Type
Description
string
hasInternalIpv6Prefix
clearInternalIpv6Prefix
setInternalIpv6Prefix
[Output Only] The internal IPv6 address range that is assigned to this subnetwork.
Parameter
Name
Description
var
string
Returns
Type
Description
$this
getIpCidrRange
The range of internal addresses that are owned by this subnetwork.
Returns
Type
Description
string
hasIpCidrRange
clearIpCidrRange
setIpCidrRange
The range of internal addresses that are owned by this subnetwork.
Parameter
Name
Description
var
string
Returns
Type
Description
$this
getIpv6AccessType
The access type of IPv6 address this subnet holds. It's immutable and can only be specified during creation or the first time the subnet is updated into IPV4_IPV6 dual stack.
Check the Ipv6AccessType enum for the list of possible values.
Returns
Type
Description
string
hasIpv6AccessType
clearIpv6AccessType
setIpv6AccessType
The access type of IPv6 address this subnet holds. It's immutable and can only be specified during creation or the first time the subnet is updated into IPV4_IPV6 dual stack.
Check the Ipv6AccessType enum for the list of possible values.
Parameter
Name
Description
var
string
Returns
Type
Description
$this
getNetwork
Network URL.
Returns
Type
Description
string
hasNetwork
clearNetwork
setNetwork
Network URL.
Parameter
Name
Description
var
string
Returns
Type
Description
$this
getPurpose
Check the Purpose enum for the list of possible values.
Returns
Type
Description
string
hasPurpose
clearPurpose
setPurpose
Check the Purpose enum for the list of possible values.
Parameter
Name
Description
var
string
Returns
Type
Description
$this
getRole
The role of subnetwork. Currently, this field is only used when purpose is set to GLOBAL_MANAGED_PROXY or REGIONAL_MANAGED_PROXY. The value can be set to ACTIVE or BACKUP. An ACTIVE subnetwork is one that is currently being used for Envoy-based load balancers in a region. A BACKUP subnetwork is one that is ready to be promoted to ACTIVE or is currently draining. This field can be updated with a patch request.
Check the Role enum for the list of possible values.
Returns
Type
Description
string
hasRole
clearRole
setRole
The role of subnetwork. Currently, this field is only used when purpose is set to GLOBAL_MANAGED_PROXY or REGIONAL_MANAGED_PROXY. The value can be set to ACTIVE or BACKUP. An ACTIVE subnetwork is one that is currently being used for Envoy-based load balancers in a region. A BACKUP subnetwork is one that is ready to be promoted to ACTIVE or is currently draining. This field can be updated with a patch request.
Check the Role enum for the list of possible values.
The stack type for the subnet. If set to IPV4_ONLY, new VMs in the subnet are assigned IPv4 addresses only. If set to IPV4_IPV6, new VMs in the subnet can be assigned both IPv4 and IPv6 addresses. If not specified, IPV4_ONLY is used. This field can be both set at resource creation time and updated using patch.
Check the StackType enum for the list of possible values.
Returns
Type
Description
string
hasStackType
clearStackType
setStackType
The stack type for the subnet. If set to IPV4_ONLY, new VMs in the subnet are assigned IPv4 addresses only. If set to IPV4_IPV6, new VMs in the subnet can be assigned both IPv4 and IPv6 addresses. If not specified, IPV4_ONLY is used. This field can be both set at resource creation time and updated using patch.
Check the StackType enum for the list of possible values.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Hard to understand","hardToUnderstand","thumb-down"],["Incorrect information or sample code","incorrectInformationOrSampleCode","thumb-down"],["Missing the information/samples I need","missingTheInformationSamplesINeed","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-09-04 UTC."],[],[],null,["# Compute V1 Client - Class UsableSubnetwork (1.35.0)\n\nVersion latestkeyboard_arrow_down\n\n- [1.35.0 (latest)](/php/docs/reference/cloud-compute/latest/V1.UsableSubnetwork)\n- [1.34.0](/php/docs/reference/cloud-compute/1.34.0/V1.UsableSubnetwork)\n- [1.33.0](/php/docs/reference/cloud-compute/1.33.0/V1.UsableSubnetwork)\n- [1.32.0](/php/docs/reference/cloud-compute/1.32.0/V1.UsableSubnetwork)\n- [1.31.0](/php/docs/reference/cloud-compute/1.31.0/V1.UsableSubnetwork)\n- [1.30.0](/php/docs/reference/cloud-compute/1.30.0/V1.UsableSubnetwork)\n- [1.29.0](/php/docs/reference/cloud-compute/1.29.0/V1.UsableSubnetwork)\n- [1.28.0](/php/docs/reference/cloud-compute/1.28.0/V1.UsableSubnetwork)\n- [1.27.0](/php/docs/reference/cloud-compute/1.27.0/V1.UsableSubnetwork)\n- [1.26.0](/php/docs/reference/cloud-compute/1.26.0/V1.UsableSubnetwork)\n- [1.25.0](/php/docs/reference/cloud-compute/1.25.0/V1.UsableSubnetwork)\n- [1.24.0](/php/docs/reference/cloud-compute/1.24.0/V1.UsableSubnetwork)\n- [1.23.0](/php/docs/reference/cloud-compute/1.23.0/V1.UsableSubnetwork)\n- [1.22.1](/php/docs/reference/cloud-compute/1.22.1/V1.UsableSubnetwork)\n- [1.21.0](/php/docs/reference/cloud-compute/1.21.0/V1.UsableSubnetwork)\n- [1.20.0](/php/docs/reference/cloud-compute/1.20.0/V1.UsableSubnetwork)\n- [1.19.0](/php/docs/reference/cloud-compute/1.19.0/V1.UsableSubnetwork)\n- [1.18.1](/php/docs/reference/cloud-compute/1.18.1/V1.UsableSubnetwork)\n- [1.17.0](/php/docs/reference/cloud-compute/1.17.0/V1.UsableSubnetwork)\n- [1.16.2](/php/docs/reference/cloud-compute/1.16.2/V1.UsableSubnetwork)\n- [1.14.0](/php/docs/reference/cloud-compute/1.14.0/V1.UsableSubnetwork)\n- [1.13.0](/php/docs/reference/cloud-compute/1.13.0/V1.UsableSubnetwork)\n- [1.12.1](/php/docs/reference/cloud-compute/1.12.1/V1.UsableSubnetwork)\n- [1.11.1](/php/docs/reference/cloud-compute/1.11.1/V1.UsableSubnetwork)\n- [1.10.1](/php/docs/reference/cloud-compute/1.10.1/V1.UsableSubnetwork)\n- [1.9.1](/php/docs/reference/cloud-compute/1.9.1/V1.UsableSubnetwork)\n- [1.8.3](/php/docs/reference/cloud-compute/1.8.3/V1.UsableSubnetwork)\n- [1.7.1](/php/docs/reference/cloud-compute/1.7.1/V1.UsableSubnetwork)\n- [1.6.1](/php/docs/reference/cloud-compute/1.6.1/V1.UsableSubnetwork)\n- [1.5.0](/php/docs/reference/cloud-compute/1.5.0/V1.UsableSubnetwork) \nReference documentation and code samples for the Compute V1 Client class UsableSubnetwork.\n\nSubnetwork which the current user has compute.subnetworks.use permission on.\n\nGenerated from protobuf message `google.cloud.compute.v1.UsableSubnetwork`\n\nNamespace\n---------\n\nGoogle \\\\ Cloud \\\\ Compute \\\\ V1\n\nMethods\n-------\n\n### __construct\n\nConstructor.\n\n### getExternalIpv6Prefix\n\n\\[Output Only\\] The external IPv6 address range that is assigned to this subnetwork.\n\n### hasExternalIpv6Prefix\n\n### clearExternalIpv6Prefix\n\n### setExternalIpv6Prefix\n\n\\[Output Only\\] The external IPv6 address range that is assigned to this subnetwork.\n\n### getInternalIpv6Prefix\n\n\\[Output Only\\] The internal IPv6 address range that is assigned to this subnetwork.\n\n### hasInternalIpv6Prefix\n\n### clearInternalIpv6Prefix\n\n### setInternalIpv6Prefix\n\n\\[Output Only\\] The internal IPv6 address range that is assigned to this subnetwork.\n\n### getIpCidrRange\n\nThe range of internal addresses that are owned by this subnetwork.\n\n### hasIpCidrRange\n\n### clearIpCidrRange\n\n### setIpCidrRange\n\nThe range of internal addresses that are owned by this subnetwork.\n\n### getIpv6AccessType\n\nThe access type of IPv6 address this subnet holds. It's immutable and can only be specified during creation or the first time the subnet is updated into IPV4_IPV6 dual stack.\n\nCheck the Ipv6AccessType enum for the list of possible values.\n\n### hasIpv6AccessType\n\n### clearIpv6AccessType\n\n### setIpv6AccessType\n\nThe access type of IPv6 address this subnet holds. It's immutable and can only be specified during creation or the first time the subnet is updated into IPV4_IPV6 dual stack.\n\nCheck the Ipv6AccessType enum for the list of possible values.\n\n### getNetwork\n\nNetwork URL.\n\n### hasNetwork\n\n### clearNetwork\n\n### setNetwork\n\nNetwork URL.\n\n### getPurpose\n\nCheck the Purpose enum for the list of possible values.\n\n### hasPurpose\n\n### clearPurpose\n\n### setPurpose\n\nCheck the Purpose enum for the list of possible values.\n\n### getRole\n\nThe role of subnetwork. Currently, this field is only used when purpose is set to GLOBAL_MANAGED_PROXY or REGIONAL_MANAGED_PROXY. The value can be set to ACTIVE or BACKUP. An ACTIVE subnetwork is one that is currently being used for Envoy-based load balancers in a region. A BACKUP subnetwork is one that is ready to be promoted to ACTIVE or is currently draining. This field can be updated with a patch request.\n\nCheck the Role enum for the list of possible values.\n\n### hasRole\n\n### clearRole\n\n### setRole\n\nThe role of subnetwork. Currently, this field is only used when purpose is set to GLOBAL_MANAGED_PROXY or REGIONAL_MANAGED_PROXY. The value can be set to ACTIVE or BACKUP. An ACTIVE subnetwork is one that is currently being used for Envoy-based load balancers in a region. A BACKUP subnetwork is one that is ready to be promoted to ACTIVE or is currently draining. This field can be updated with a patch request.\n\nCheck the Role enum for the list of possible values.\n\n### getSecondaryIpRanges\n\nSecondary IP ranges.\n\n### setSecondaryIpRanges\n\nSecondary IP ranges.\n\n### getStackType\n\nThe stack type for the subnet. If set to IPV4_ONLY, new VMs in the subnet are assigned IPv4 addresses only. If set to IPV4_IPV6, new VMs in the subnet can be assigned both IPv4 and IPv6 addresses. If not specified, IPV4_ONLY is used. This field can be both set at resource creation time and updated using patch.\n\nCheck the StackType enum for the list of possible values.\n\n### hasStackType\n\n### clearStackType\n\n### setStackType\n\nThe stack type for the subnet. If set to IPV4_ONLY, new VMs in the subnet are assigned IPv4 addresses only. If set to IPV4_IPV6, new VMs in the subnet can be assigned both IPv4 and IPv6 addresses. If not specified, IPV4_ONLY is used. This field can be both set at resource creation time and updated using patch.\n\nCheck the StackType enum for the list of possible values.\n\n### getSubnetwork\n\nSubnetwork URL.\n\n### hasSubnetwork\n\n### clearSubnetwork\n\n### setSubnetwork\n\nSubnetwork URL."]]