Skip to main content

networks

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

Overview

Namenetworks
TypeResource
Idgoogle.baremetalsolution.networks

Fields

The following fields are returned by SELECT queries:

Successful response

NameDatatypeDescription
idstringAn identifier for the Network, generated by the backend.
namestringOutput only. The resource name of this Network. Resource names are schemeless URIs that follow the conventions in https://cloud.google.com/apis/design/resource_names. Format: projects/{project}/locations/{location}/networks/{network}
cidrstringThe cidr of the Network.
gatewayIpstringOutput only. Gateway ip address.
ipAddressstringIP address configured.
jumboFramesEnabledbooleanWhether network uses standard frames or jumbo ones.
labelsobjectLabels as key value pairs.
macAddressarrayList of physical interfaces.
mountPointsarrayInput only. List of mount points to attach the network to.
podstringImmutable. Pod name. Pod is an independent part of infrastructure. Network can only be connected to the assets (instances, nfsshares) allocated in the same pod.
reservationsarrayList of IP address reservations in this network. When updating this field, an error will be generated if a reservation conflicts with an IP address already allocated to a physical server.
servicesCidrstringIP range for reserved for services (e.g. NFS).
statestringThe Network state.
typestringThe type of this network.
vlanIdstringThe vlan id of the Network.
vrfobjectThe Vrf for the Network. Use this only if a new Vrf needs to be created. (id: VRF)
vrfAttachmentstringOptional. The name of a pre-existing Vrf that the network should be attached to. Format is vrfs/{vrf}.

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
getselectprojectsId, locationsId, networksIdGet details of a single network.
listselectprojectsId, locationsIdpageSize, pageToken, filterList network in a given project and location.
patchupdateprojectsId, locationsId, networksIdupdateMaskUpdate details of a single network.
renameexecprojectsId, locationsId, networksIdRenameNetwork sets a new name for a network. Use with caution, previous names become immediately invalidated.

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.

NameDatatypeDescription
locationsIdstring
networksIdstring
projectsIdstring
filterstring
pageSizeinteger (int32)
pageTokenstring
updateMaskstring (google-fieldmask)

SELECT examples

Get details of a single network.

SELECT
id,
name,
cidr,
gatewayIp,
ipAddress,
jumboFramesEnabled,
labels,
macAddress,
mountPoints,
pod,
reservations,
servicesCidr,
state,
type,
vlanId,
vrf,
vrfAttachment
FROM google.baremetalsolution.networks
WHERE projectsId = '{{ projectsId }}' -- required
AND locationsId = '{{ locationsId }}' -- required
AND networksId = '{{ networksId }}' -- required;

UPDATE examples

Update details of a single network.

UPDATE google.baremetalsolution.networks
SET
data__id = '{{ id }}',
data__type = '{{ type }}',
data__ipAddress = '{{ ipAddress }}',
data__macAddress = '{{ macAddress }}',
data__state = '{{ state }}',
data__vlanId = '{{ vlanId }}',
data__cidr = '{{ cidr }}',
data__vrf = '{{ vrf }}',
data__vrfAttachment = '{{ vrfAttachment }}',
data__labels = '{{ labels }}',
data__servicesCidr = '{{ servicesCidr }}',
data__reservations = '{{ reservations }}',
data__pod = '{{ pod }}',
data__mountPoints = '{{ mountPoints }}',
data__jumboFramesEnabled = {{ jumboFramesEnabled }}
WHERE
projectsId = '{{ projectsId }}' --required
AND locationsId = '{{ locationsId }}' --required
AND networksId = '{{ networksId }}' --required
AND updateMask = '{{ updateMask}}'
RETURNING
name,
done,
error,
metadata,
response;

Lifecycle Methods

RenameNetwork sets a new name for a network. Use with caution, previous names become immediately invalidated.

EXEC google.baremetalsolution.networks.rename 
@projectsId='{{ projectsId }}' --required,
@locationsId='{{ locationsId }}' --required,
@networksId='{{ networksId }}' --required
@@json=
'{
"newNetworkId": "{{ newNetworkId }}"
}';