network_attachments
Creates, updates, deletes, gets or lists a network_attachments resource.
Overview
| Name | network_attachments |
| Type | Resource |
| Id | google.compute.network_attachments |
Fields
The following fields are returned by SELECT queries:
- get
- list
- aggregated_list
| Name | Datatype | Description |
|---|---|---|
id | string (uint64) | Output only. [Output Only] The unique identifier for the resource type. The server generates this identifier. |
name | string | Name of the resource. Provided by the client when the resource is created. The name must be 1-63 characters long, and comply withRFC1035. 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. (pattern: [a-z](?:[-a-z0-9]{0,61}[a-z0-9])?) |
connectionEndpoints | array | Output only. [Output Only] An array of connections for all the producers connected to this network attachment. |
connectionPreference | string | (ACCEPT_AUTOMATIC, ACCEPT_MANUAL, INVALID) |
creationTimestamp | string | Output only. [Output Only] Creation timestamp inRFC3339 text format. |
description | string | An optional description of this resource. Provide this property when you create the resource. |
fingerprint | string (byte) | Fingerprint 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. |
kind | string | Output only. [Output Only] Type of the resource. (default: compute#networkAttachment) |
network | string | Output only. [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. |
producerAcceptLists | array | Projects or service class ids that are allowed to connect to this network attachment. The project can be specified using its id or number. Service class id can be specified as "serviceclasses/{service_class_id}". |
producerRejectLists | array | Projects or service class ids that are not allowed to connect to this network attachment. The project can be specified using its id or number. Service class id can be specified as "serviceclasses/{service_class_id}". |
region | string | Output only. [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. |
selfLink | string | Output only. [Output Only] Server-defined URL for the resource. |
selfLinkWithId | string | Output only. [Output Only] Server-defined URL for this resource's resource id. |
subnetworks | array | An 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. |
| Name | Datatype | Description |
|---|---|---|
id | string | [Output Only] Unique identifier for the resource; defined by the server. |
items | array | A list of NetworkAttachment resources. |
kind | string | (default: compute#networkAttachmentList) |
nextPageToken | string | [Output Only] This token allows you to get the next page of results for list requests. If the number of results is larger thanmaxResults, use the nextPageToken as a value for the query parameter pageToken in the next list request. Subsequent list requests will have their own nextPageToken to continue paging through the results. |
selfLink | string | [Output Only] Server-defined URL for this resource. |
warning | object | [Output Only] Informational warning message. |
| Name | Datatype | Description |
|---|---|---|
id | string (uint64) | Output only. [Output Only] The unique identifier for the resource type. The server generates this identifier. |
name | string | Name of the resource. Provided by the client when the resource is created. The name must be 1-63 characters long, and comply withRFC1035. 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. (pattern: [a-z](?:[-a-z0-9]{0,61}[a-z0-9])?) |
connectionEndpoints | array | Output only. [Output Only] An array of connections for all the producers connected to this network attachment. |
connectionPreference | string | (ACCEPT_AUTOMATIC, ACCEPT_MANUAL, INVALID) |
creationTimestamp | string | Output only. [Output Only] Creation timestamp inRFC3339 text format. |
description | string | An optional description of this resource. Provide this property when you create the resource. |
fingerprint | string (byte) | Fingerprint 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. |
kind | string | Output only. [Output Only] Type of the resource. (default: compute#networkAttachment) |
network | string | Output only. [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. |
producerAcceptLists | array | Projects or service class ids that are allowed to connect to this network attachment. The project can be specified using its id or number. Service class id can be specified as "serviceclasses/{service_class_id}". |
producerRejectLists | array | Projects or service class ids that are not allowed to connect to this network attachment. The project can be specified using its id or number. Service class id can be specified as "serviceclasses/{service_class_id}". |
region | string | Output only. [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. |
selfLink | string | Output only. [Output Only] Server-defined URL for the resource. |
selfLinkWithId | string | Output only. [Output Only] Server-defined URL for this resource's resource id. |
subnetworks | array | An 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
The following methods are available for this resource:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
get | select | project, region, networkAttachment | Returns the specified NetworkAttachment resource in the given scope. | |
list | select | project, region | filter, maxResults, pageToken, orderBy, returnPartialSuccess | Lists the NetworkAttachments for a project in the given scope. |
aggregated_list | select | project | includeAllScopes, orderBy, filter, serviceProjectNumber, maxResults, pageToken, returnPartialSuccess | 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. |
insert | insert | project, region | requestId | Creates a NetworkAttachment in the specified project in the given scope using the parameters that are included in the request. |
patch | update | project, region, networkAttachment | requestId | Patches the specified NetworkAttachment resource with the data included in the request. This method supports PATCH semantics and usesJSON merge patch format and processing rules. |
delete | delete | project, region, networkAttachment | requestId | Deletes the specified NetworkAttachment in the given scope |
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 |
|---|---|---|
networkAttachment | string | |
project | string | |
region | string | |
filter | string | |
includeAllScopes | boolean | |
maxResults | integer (uint32) | |
orderBy | string | |
pageToken | string | |
requestId | string | |
returnPartialSuccess | boolean | |
serviceProjectNumber | string (int64) |
SELECT examples
- get
- list
- aggregated_list
Returns the specified NetworkAttachment resource in the given scope.
SELECT
id,
name,
connectionEndpoints,
connectionPreference,
creationTimestamp,
description,
fingerprint,
kind,
network,
producerAcceptLists,
producerRejectLists,
region,
selfLink,
selfLinkWithId,
subnetworks
FROM google.compute.network_attachments
WHERE project = '{{ project }}' -- required
AND region = '{{ region }}' -- required
AND networkAttachment = '{{ networkAttachment }}' -- required
;
Lists the NetworkAttachments for a project in the given scope.
SELECT
id,
items,
kind,
nextPageToken,
selfLink,
warning
FROM google.compute.network_attachments
WHERE project = '{{ project }}' -- required
AND region = '{{ region }}' -- required
AND filter = '{{ filter }}'
AND maxResults = '{{ maxResults }}'
AND pageToken = '{{ pageToken }}'
AND orderBy = '{{ orderBy }}'
AND returnPartialSuccess = '{{ returnPartialSuccess }}'
;
Retrieves the list of all NetworkAttachment resources,
regional and global, available to the specified project.
To prevent failure, Google recommends that you set thereturnPartialSuccess parameter to true.
SELECT
id,
name,
connectionEndpoints,
connectionPreference,
creationTimestamp,
description,
fingerprint,
kind,
network,
producerAcceptLists,
producerRejectLists,
region,
selfLink,
selfLinkWithId,
subnetworks
FROM google.compute.network_attachments
WHERE project = '{{ project }}' -- required
AND includeAllScopes = '{{ includeAllScopes }}'
AND orderBy = '{{ orderBy }}'
AND filter = '{{ filter }}'
AND serviceProjectNumber = '{{ serviceProjectNumber }}'
AND maxResults = '{{ maxResults }}'
AND pageToken = '{{ pageToken }}'
AND returnPartialSuccess = '{{ returnPartialSuccess }}'
;
INSERT examples
- insert
- Manifest
Creates a NetworkAttachment in the specified project in the given scope
using the parameters that are included in the request.
INSERT INTO google.compute.network_attachments (
data__subnetworks,
data__fingerprint,
data__producerRejectLists,
data__description,
data__connectionPreference,
data__producerAcceptLists,
data__name,
project,
region,
requestId
)
SELECT
'{{ subnetworks }}',
'{{ fingerprint }}',
'{{ producerRejectLists }}',
'{{ description }}',
'{{ connectionPreference }}',
'{{ producerAcceptLists }}',
'{{ name }}',
'{{ project }}',
'{{ region }}',
'{{ 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: network_attachments
props:
- name: project
value: "{{ project }}"
description: Required parameter for the network_attachments resource.
- name: region
value: "{{ region }}"
description: Required parameter for the network_attachments resource.
- name: subnetworks
value:
- "{{ subnetworks }}"
description: |
An 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.
- name: fingerprint
value: "{{ fingerprint }}"
description: |
Fingerprint 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.
- name: producerRejectLists
value:
- "{{ producerRejectLists }}"
description: |
Projects or service class ids that are not allowed to connect to this
network attachment. The project can be specified using its id or number.
Service class id can be specified as "serviceclasses/{service_class_id}".
- name: description
value: "{{ description }}"
description: |
An optional description of this resource. Provide this property when you
create the resource.
- name: connectionPreference
value: "{{ connectionPreference }}"
valid_values: ['ACCEPT_AUTOMATIC', 'ACCEPT_MANUAL', 'INVALID']
- name: producerAcceptLists
value:
- "{{ producerAcceptLists }}"
description: |
Projects or service class ids that are allowed to connect to this network
attachment. The project can be specified using its id or number. Service
class id can be specified as "serviceclasses/{service_class_id}".
- name: name
value: "{{ name }}"
description: |
Name of the resource. Provided by the client when the resource is created.
The name must be 1-63 characters long, and comply withRFC1035.
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.
- name: requestId
value: "{{ requestId }}"
UPDATE examples
- patch
Patches the specified NetworkAttachment resource with the data included in
the request. This method supports PATCH
semantics and usesJSON merge
patch format and processing rules.
UPDATE google.compute.network_attachments
SET
data__subnetworks = '{{ subnetworks }}',
data__fingerprint = '{{ fingerprint }}',
data__producerRejectLists = '{{ producerRejectLists }}',
data__description = '{{ description }}',
data__connectionPreference = '{{ connectionPreference }}',
data__producerAcceptLists = '{{ producerAcceptLists }}',
data__name = '{{ name }}'
WHERE
project = '{{ project }}' --required
AND region = '{{ region }}' --required
AND networkAttachment = '{{ networkAttachment }}' --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
- delete
Deletes the specified NetworkAttachment in the given scope
DELETE FROM google.compute.network_attachments
WHERE project = '{{ project }}' --required
AND region = '{{ region }}' --required
AND networkAttachment = '{{ networkAttachment }}' --required
AND requestId = '{{ requestId }}'
;