networks_peering
Creates, updates, deletes, gets or lists a networks_peering resource.
Overview
| Name | networks_peering |
| Type | Resource |
| Id | google.compute.networks_peering |
Fields
The following fields are returned by SELECT queries:
SELECT not supported for this resource, use SHOW METHODS to view available operations for the resource.
Methods
The following methods are available for this resource:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
add_peering | insert | project, network | requestId | Adds a peering to the specified network. |
update_peering | update | project, network | requestId | Updates the specified network peering with the data included in the request. You can only modify the NetworkPeering.export_custom_routes field and the NetworkPeering.import_custom_routes field. |
remove_peering | delete | project, network | requestId | Removes a peering from the specified network. |
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 |
|---|---|---|
network | string | |
project | string | |
requestId | string |
INSERT examples
- add_peering
- Manifest
Adds a peering to the specified network.
INSERT INTO google.compute.networks_peering (
data__peerNetwork,
data__networkPeering,
data__name,
data__autoCreateRoutes,
project,
network,
requestId
)
SELECT
'{{ peerNetwork }}',
'{{ networkPeering }}',
'{{ name }}',
{{ autoCreateRoutes }},
'{{ project }}',
'{{ network }}',
'{{ requestId }}'
RETURNING
id,
name,
clientOperationId,
creationTimestamp,
description,
endTime,
error,
getVersionOperationMetadata,
httpErrorMessage,
httpErrorStatusCode,
insertTime,
instancesBulkInsertOperationMetadata,
kind,
operationGroupId,
operationType,
progress,
region,
selfLink,
setCommonInstanceMetadataOperationMetadata,
startTime,
status,
statusMessage,
targetId,
targetLink,
user,
warnings,
zone
;
# Description fields are for documentation purposes
- name: networks_peering
props:
- name: project
value: "{{ project }}"
description: Required parameter for the networks_peering resource.
- name: network
value: "{{ network }}"
description: Required parameter for the networks_peering resource.
- name: peerNetwork
value: "{{ peerNetwork }}"
description: |
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.
- name: networkPeering
description: |
A network peering attached to a network resource. The message includes the
peering name, peer network, peering state, and a flag indicating whether
Google Compute Engine should automatically create routes for the peering.
value:
exchangeSubnetRoutes: {{ exchangeSubnetRoutes }}
exportSubnetRoutesWithPublicIp: {{ exportSubnetRoutesWithPublicIp }}
state: "{{ state }}"
updateStrategy: "{{ updateStrategy }}"
autoCreateRoutes: {{ autoCreateRoutes }}
importSubnetRoutesWithPublicIp: {{ importSubnetRoutesWithPublicIp }}
name: "{{ name }}"
exportCustomRoutes: {{ exportCustomRoutes }}
stateDetails: "{{ stateDetails }}"
network: "{{ network }}"
stackType: "{{ stackType }}"
importCustomRoutes: {{ importCustomRoutes }}
connectionStatus:
trafficConfiguration:
exportCustomRoutesToPeer: {{ exportCustomRoutesToPeer }}
importSubnetRoutesWithPublicIpFromPeer: {{ importSubnetRoutesWithPublicIpFromPeer }}
importCustomRoutesFromPeer: {{ importCustomRoutesFromPeer }}
stackType: "{{ stackType }}"
exportSubnetRoutesWithPublicIpToPeer: {{ exportSubnetRoutesWithPublicIpToPeer }}
consensusState:
deleteStatus: "{{ deleteStatus }}"
updateStatus: "{{ updateStatus }}"
updateStrategy: "{{ updateStrategy }}"
peerMtu: {{ peerMtu }}
- name: name
value: "{{ name }}"
description: |
Name of the peering, which should conform to RFC1035.
- name: autoCreateRoutes
value: {{ autoCreateRoutes }}
description: |
This field will be deprecated soon. Useexchange_subnet_routes in network_peering
instead.
Indicates whether full mesh connectivity is created and managed
automatically between peered networks. Currently this field should always
be true since Google Compute Engine will automatically create and manage
subnetwork routes between two networks when peering state isACTIVE.
- name: requestId
value: "{{ requestId }}"
UPDATE examples
- update_peering
Updates the specified network peering with the data included in the
request. You can only modify the NetworkPeering.export_custom_routes field
and the NetworkPeering.import_custom_routes field.
UPDATE google.compute.networks_peering
SET
data__networkPeering = '{{ networkPeering }}'
WHERE
project = '{{ project }}' --required
AND network = '{{ network }}' --required
AND requestId = '{{ requestId}}'
RETURNING
id,
name,
clientOperationId,
creationTimestamp,
description,
endTime,
error,
getVersionOperationMetadata,
httpErrorMessage,
httpErrorStatusCode,
insertTime,
instancesBulkInsertOperationMetadata,
kind,
operationGroupId,
operationType,
progress,
region,
selfLink,
setCommonInstanceMetadataOperationMetadata,
startTime,
status,
statusMessage,
targetId,
targetLink,
user,
warnings,
zone;
DELETE examples
- remove_peering
Removes a peering from the specified network.
DELETE FROM google.compute.networks_peering
WHERE project = '{{ project }}' --required
AND network = '{{ network }}' --required
AND requestId = '{{ requestId }}'
;