Skip to main content

network_policies

Creates, updates, deletes, gets or lists a network_policies resource.

Overview

Namenetwork_policies
TypeResource
Idgoogle.vmwareengine.network_policies

Fields

The following fields are returned by SELECT queries:

Successful response

NameDatatypeDescription
namestringOutput only. Identifier. The resource name of this network policy. Resource names are schemeless URIs that follow the conventions in https://cloud.google.com/apis/design/resource_names. For example: projects/my-project/locations/us-central1/networkPolicies/my-network-policy
createTimestring (google-datetime)Output only. Creation time of this resource.
descriptionstringOptional. User-provided description for this network policy.
edgeServicesCidrstringRequired. IP address range in CIDR notation used to create internet access and external IP access. An RFC 1918 CIDR block, with a "/26" prefix, is required. The range cannot overlap with any prefixes either in the consumer VPC network or in use by the private clouds attached to that VPC network.
externalIpobjectNetwork service that allows External IP addresses to be assigned to VMware workloads. This service can only be enabled when internet_access is also enabled. (id: NetworkService)
internetAccessobjectNetwork service that allows VMware workloads to access the internet. (id: NetworkService)
uidstringOutput only. System-generated unique identifier for the resource.
updateTimestring (google-datetime)Output only. Last update time of this resource.
vmwareEngineNetworkstringOptional. The relative resource name of the VMware Engine network. Specify the name in the following form: projects/{project}/locations/{location}/vmwareEngineNetworks/{vmware_engine_network_id} where {project} can either be a project number or a project ID.
vmwareEngineNetworkCanonicalstringOutput only. The canonical name of the VMware Engine network in the form: projects/{project_number}/locations/{location}/vmwareEngineNetworks/{vmware_engine_network_id}

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
getselectprojectsId, locationsId, networkPoliciesIdRetrieves a NetworkPolicy resource by its resource name.
listselectprojectsId, locationsIdpageSize, pageToken, filter, orderByLists NetworkPolicy resources in a specified project and location.
createinsertprojectsId, locationsIdnetworkPolicyId, requestIdCreates a new network policy in a given VMware Engine network of a project and location (region). A new network policy cannot be created if another network policy already exists in the same scope.
patchupdateprojectsId, locationsId, networkPoliciesIdupdateMask, requestIdModifies a NetworkPolicy resource. Only the following fields can be updated: internet_access, external_ip, edge_services_cidr. Only fields specified in updateMask are applied. When updating a network policy, the external IP network service can only be disabled if there are no external IP addresses present in the scope of the policy. Also, a NetworkService cannot be updated when NetworkService.state is set to RECONCILING. During operation processing, the resource is temporarily in the ACTIVE state before the operation fully completes. For that period of time, you can't update the resource. Use the operation status to determine when the processing fully completes.
deletedeleteprojectsId, locationsId, networkPoliciesIdrequestIdDeletes a NetworkPolicy resource. A network policy cannot be deleted when NetworkService.state is set to RECONCILING for either its external IP or internet access service.

Parameters

Parameters can be passed in the WHERE clause of a query. Check the Methods section to see which parameters are required or optional for each operation.

NameDatatypeDescription
locationsIdstring
networkPoliciesIdstring
projectsIdstring
filterstring
networkPolicyIdstring
orderBystring
pageSizeinteger (int32)
pageTokenstring
requestIdstring
updateMaskstring (google-fieldmask)

SELECT examples

Retrieves a NetworkPolicy resource by its resource name.

SELECT
name,
createTime,
description,
edgeServicesCidr,
externalIp,
internetAccess,
uid,
updateTime,
vmwareEngineNetwork,
vmwareEngineNetworkCanonical
FROM google.vmwareengine.network_policies
WHERE projectsId = '{{ projectsId }}' -- required
AND locationsId = '{{ locationsId }}' -- required
AND networkPoliciesId = '{{ networkPoliciesId }}' -- required;

INSERT examples

Creates a new network policy in a given VMware Engine network of a project and location (region). A new network policy cannot be created if another network policy already exists in the same scope.

INSERT INTO google.vmwareengine.network_policies (
data__internetAccess,
data__externalIp,
data__edgeServicesCidr,
data__vmwareEngineNetwork,
data__description,
projectsId,
locationsId,
networkPolicyId,
requestId
)
SELECT
'{{ internetAccess }}',
'{{ externalIp }}',
'{{ edgeServicesCidr }}',
'{{ vmwareEngineNetwork }}',
'{{ description }}',
'{{ projectsId }}',
'{{ locationsId }}',
'{{ networkPolicyId }}',
'{{ requestId }}'
RETURNING
name,
done,
error,
metadata,
response
;

UPDATE examples

Modifies a NetworkPolicy resource. Only the following fields can be updated: internet_access, external_ip, edge_services_cidr. Only fields specified in updateMask are applied. When updating a network policy, the external IP network service can only be disabled if there are no external IP addresses present in the scope of the policy. Also, a NetworkService cannot be updated when NetworkService.state is set to RECONCILING. During operation processing, the resource is temporarily in the ACTIVE state before the operation fully completes. For that period of time, you can't update the resource. Use the operation status to determine when the processing fully completes.

UPDATE google.vmwareengine.network_policies
SET
data__internetAccess = '{{ internetAccess }}',
data__externalIp = '{{ externalIp }}',
data__edgeServicesCidr = '{{ edgeServicesCidr }}',
data__vmwareEngineNetwork = '{{ vmwareEngineNetwork }}',
data__description = '{{ description }}'
WHERE
projectsId = '{{ projectsId }}' --required
AND locationsId = '{{ locationsId }}' --required
AND networkPoliciesId = '{{ networkPoliciesId }}' --required
AND updateMask = '{{ updateMask}}'
AND requestId = '{{ requestId}}'
RETURNING
name,
done,
error,
metadata,
response;

DELETE examples

Deletes a NetworkPolicy resource. A network policy cannot be deleted when NetworkService.state is set to RECONCILING for either its external IP or internet access service.

DELETE FROM google.vmwareengine.network_policies
WHERE projectsId = '{{ projectsId }}' --required
AND locationsId = '{{ locationsId }}' --required
AND networkPoliciesId = '{{ networkPoliciesId }}' --required
AND requestId = '{{ requestId }}';