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

NameDatatypeDescription
namestringOutput only. 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
descriptionstringOptional. User-provided description for this network policy.
createTimestringOutput only. Creation time of this resource.
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.
externalIpobjectRepresents a network service that is managed by a NetworkPolicy resource. A network service provides a way to control an aspect of external access to VMware workloads. For example, whether the VMware workloads in the private clouds governed by a network policy can access or be accessed from the internet.
internetAccessobjectRepresents a network service that is managed by a NetworkPolicy resource. A network service provides a way to control an aspect of external access to VMware workloads. For example, whether the VMware workloads in the private clouds governed by a network policy can access or be accessed from the internet.
uidstringOutput only. System-generated unique identifier for the resource.
updateTimestringOutput 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

NameAccessible byRequired ParamsDescription
getSELECTlocationsId, networkPoliciesId, projectsIdRetrieves a NetworkPolicy resource by its resource name.
listSELECTlocationsId, projectsIdLists NetworkPolicy resources in a specified project and location.
createINSERTlocationsId, projectsIdCreates 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.
deleteDELETElocationsId, networkPoliciesId, projectsIdDeletes 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.
patchUPDATElocationsId, networkPoliciesId, projectsIdModifies 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.

SELECT examples

Lists NetworkPolicy resources in a specified project and location.

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

INSERT example

Use the following StackQL query and manifest file to create a new network_policies resource.

/*+ create */
INSERT INTO google.vmwareengine.network_policies (
locationsId,
projectsId,
internetAccess,
externalIp,
edgeServicesCidr,
vmwareEngineNetwork,
description
)
SELECT
'{{ locationsId }}',
'{{ projectsId }}',
'{{ internetAccess }}',
'{{ externalIp }}',
'{{ edgeServicesCidr }}',
'{{ vmwareEngineNetwork }}',
'{{ description }}'
;

UPDATE example

Updates a network_policies resource.

/*+ update */
UPDATE google.vmwareengine.network_policies
SET
internetAccess = '{{ internetAccess }}',
externalIp = '{{ externalIp }}',
edgeServicesCidr = '{{ edgeServicesCidr }}',
vmwareEngineNetwork = '{{ vmwareEngineNetwork }}',
description = '{{ description }}'
WHERE
locationsId = '{{ locationsId }}'
AND networkPoliciesId = '{{ networkPoliciesId }}'
AND projectsId = '{{ projectsId }}';

DELETE example

Deletes the specified network_policies resource.

/*+ delete */
DELETE FROM google.vmwareengine.network_policies
WHERE locationsId = '{{ locationsId }}'
AND networkPoliciesId = '{{ networkPoliciesId }}'
AND projectsId = '{{ projectsId }}';