network_policies
Creates, updates, deletes, gets or lists a network_policies
resource.
Overview
Name | network_policies |
Type | Resource |
Id | google.vmwareengine.network_policies |
Fields
The following fields are returned by SELECT
queries:
- get
- list
Successful response
Name | Datatype | Description |
---|---|---|
name | string | Output 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 |
createTime | string (google-datetime) | Output only. Creation time of this resource. |
description | string | Optional. User-provided description for this network policy. |
edgeServicesCidr | string | Required. 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. |
externalIp | object | Network 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) |
internetAccess | object | Network service that allows VMware workloads to access the internet. (id: NetworkService) |
uid | string | Output only. System-generated unique identifier for the resource. |
updateTime | string (google-datetime) | Output only. Last update time of this resource. |
vmwareEngineNetwork | string | Optional. 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. |
vmwareEngineNetworkCanonical | string | Output only. The canonical name of the VMware Engine network in the form: projects/{project_number}/locations/{location}/vmwareEngineNetworks/{vmware_engine_network_id} |
Successful response
Name | Datatype | Description |
---|---|---|
name | string | Output 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 |
createTime | string (google-datetime) | Output only. Creation time of this resource. |
description | string | Optional. User-provided description for this network policy. |
edgeServicesCidr | string | Required. 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. |
externalIp | object | Network 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) |
internetAccess | object | Network service that allows VMware workloads to access the internet. (id: NetworkService) |
uid | string | Output only. System-generated unique identifier for the resource. |
updateTime | string (google-datetime) | Output only. Last update time of this resource. |
vmwareEngineNetwork | string | Optional. 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. |
vmwareEngineNetworkCanonical | string | Output 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:
Name | Accessible by | Required Params | Optional Params | Description |
---|---|---|---|---|
get | select | projectsId , locationsId , networkPoliciesId | Retrieves a NetworkPolicy resource by its resource name. | |
list | select | projectsId , locationsId | pageSize , pageToken , filter , orderBy | Lists NetworkPolicy resources in a specified project and location. |
create | insert | projectsId , locationsId | networkPolicyId , requestId | 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. |
patch | update | projectsId , locationsId , networkPoliciesId | updateMask , requestId | 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. |
delete | delete | projectsId , locationsId , networkPoliciesId | requestId | 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. |
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.
Name | Datatype | Description |
---|---|---|
locationsId | string | |
networkPoliciesId | string | |
projectsId | string | |
filter | string | |
networkPolicyId | string | |
orderBy | string | |
pageSize | integer (int32) | |
pageToken | string | |
requestId | string | |
updateMask | string (google-fieldmask) |
SELECT
examples
- get
- list
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;
Lists NetworkPolicy
resources in a specified project and location.
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 pageSize = '{{ pageSize }}'
AND pageToken = '{{ pageToken }}'
AND filter = '{{ filter }}'
AND orderBy = '{{ orderBy }}';
INSERT
examples
- create
- Manifest
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
;
# Description fields are for documentation purposes
- name: network_policies
props:
- name: projectsId
value: string
description: Required parameter for the network_policies resource.
- name: locationsId
value: string
description: Required parameter for the network_policies resource.
- name: internetAccess
value: object
description: >
Network service that allows VMware workloads to access the internet.
- name: externalIp
value: object
description: >
Network service that allows External IP addresses to be assigned to VMware workloads. This service can only be enabled when `internet_access` is also enabled.
- name: edgeServicesCidr
value: string
description: >
Required. 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.
- name: vmwareEngineNetwork
value: string
description: >
Optional. 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.
- name: description
value: string
description: >
Optional. User-provided description for this network policy.
- name: networkPolicyId
value: string
- name: requestId
value: string
UPDATE
examples
- patch
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
- delete
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 }}';