Skip to main content

network_attachments

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

Overview

Namenetwork_attachments
TypeResource
Idgoogle.compute.network_attachments

Fields

NameDatatypeDescription
idstring[Output Only] The unique identifier for the resource type. The server generates this identifier.
namestringName of the resource. Provided by the client when the resource is created. The name must be 1-63 characters long, and comply with RFC1035. Specifically, the name must be 1-63 characters long and match the regular expression [a-z]([-a-z0-9]*[a-z0-9])? which means the first character must be a lowercase letter, and all following characters must be a dash, lowercase letter, or digit, except the last character, which cannot be a dash.
descriptionstringAn optional description of this resource. Provide this property when you create the resource.
connectionEndpointsarray[Output Only] An array of connections for all the producers connected to this network attachment.
connectionPreferencestring
creationTimestampstring[Output Only] Creation timestamp in RFC3339 text format.
fingerprintstringFingerprint of this resource. A hash of the contents stored in this object. This field is used in optimistic locking. An up-to-date fingerprint must be provided in order to patch.
kindstring[Output Only] Type of the resource.
networkstring[Output Only] The URL of the network which the Network Attachment belongs to. Practically it is inferred by fetching the network of the first subnetwork associated. Because it is required that all the subnetworks must be from the same network, it is assured that the Network Attachment belongs to the same network as all the subnetworks.
producerAcceptListsarrayProjects that are allowed to connect to this network attachment. The project can be specified using its id or number.
producerRejectListsarrayProjects that are not allowed to connect to this network attachment. The project can be specified using its id or number.
regionstring[Output Only] URL of the region where the network attachment resides. This field applies only to the region resource. You must specify this field as part of the HTTP request URL. It is not settable as a field in the request body.
selfLinkstring[Output Only] Server-defined URL for the resource.
selfLinkWithIdstring[Output Only] Server-defined URL for this resource's resource id.
subnetworksarrayAn array of URLs where each entry is the URL of a subnet provided by the service consumer to use for endpoints in the producers that connect to this network attachment.

Methods

NameAccessible byRequired ParamsDescription
aggregated_listSELECTprojectRetrieves the list of all NetworkAttachment resources, regional and global, available to the specified project. To prevent failure, Google recommends that you set the returnPartialSuccess parameter to true.
getSELECTnetworkAttachment, project, regionReturns the specified NetworkAttachment resource in the given scope.
listSELECTproject, regionLists the NetworkAttachments for a project in the given scope.
insertINSERTproject, regionCreates a NetworkAttachment in the specified project in the given scope using the parameters that are included in the request.
deleteDELETEnetworkAttachment, project, regionDeletes the specified NetworkAttachment in the given scope
patchUPDATEnetworkAttachment, project, regionPatches the specified NetworkAttachment resource with the data included in the request. This method supports PATCH semantics and uses JSON merge patch format and processing rules.

SELECT examples

Retrieves the list of all NetworkAttachment resources, regional and global, available to the specified project. To prevent failure, Google recommends that you set the returnPartialSuccess parameter to true.

SELECT
id,
name,
description,
connectionEndpoints,
connectionPreference,
creationTimestamp,
fingerprint,
kind,
network,
producerAcceptLists,
producerRejectLists,
region,
selfLink,
selfLinkWithId,
subnetworks
FROM google.compute.network_attachments
WHERE project = '{{ project }}';

INSERT example

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

/*+ create */
INSERT INTO google.compute.network_attachments (
project,
region,
name,
description,
region,
connectionPreference,
connectionEndpoints,
subnetworks,
producerRejectLists,
producerAcceptLists,
fingerprint,
network
)
SELECT
'{{ project }}',
'{{ region }}',
'{{ name }}',
'{{ description }}',
'{{ region }}',
'{{ connectionPreference }}',
'{{ connectionEndpoints }}',
'{{ subnetworks }}',
'{{ producerRejectLists }}',
'{{ producerAcceptLists }}',
'{{ fingerprint }}',
'{{ network }}'
;

UPDATE example

Updates a network_attachments resource.

/*+ update */
UPDATE google.compute.network_attachments
SET
name = '{{ name }}',
description = '{{ description }}',
region = '{{ region }}',
connectionPreference = '{{ connectionPreference }}',
connectionEndpoints = '{{ connectionEndpoints }}',
subnetworks = '{{ subnetworks }}',
producerRejectLists = '{{ producerRejectLists }}',
producerAcceptLists = '{{ producerAcceptLists }}',
fingerprint = '{{ fingerprint }}',
network = '{{ network }}'
WHERE
networkAttachment = '{{ networkAttachment }}'
AND project = '{{ project }}'
AND region = '{{ region }}';

DELETE example

Deletes the specified network_attachments resource.

/*+ delete */
DELETE FROM google.compute.network_attachments
WHERE networkAttachment = '{{ networkAttachment }}'
AND project = '{{ project }}'
AND region = '{{ region }}';