Skip to main content

nfs_shares

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

Overview

Namenfs_shares
TypeResource
Idgoogle.baremetalsolution.nfs_shares

Fields

The following fields are returned by SELECT queries:

Successful response

NameDatatypeDescription
idstringOutput only. An identifier for the NFS share, generated by the backend. This is the same value as nfs_share_id and will replace it in the future.
namestringImmutable. The name of the NFS share.
allowedClientsarrayList of allowed access points.
labelsobjectLabels as key value pairs.
nfsShareIdstringOutput only. An identifier for the NFS share, generated by the backend. This field will be deprecated in the future, use id instead.
podstringImmutable. Pod name. Pod is an independent part of infrastructure. NFSShare can only be connected to the assets (networks, instances) allocated in the same pod.
requestedSizeGibstring (int64)The requested size, in GiB.
statestringOutput only. The state of the NFS share.
storageTypestringImmutable. The storage type of the underlying volume.
volumestringOutput only. The underlying volume of the share. Created automatically during provisioning.

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
getselectprojectsId, locationsId, nfsSharesIdGet details of a single NFS share.
listselectprojectsId, locationsIdpageSize, pageToken, filterList NFS shares.
createinsertprojectsId, locationsIdCreate an NFS share.
patchupdateprojectsId, locationsId, nfsSharesIdupdateMaskUpdate details of a single NFS share.
deletedeleteprojectsId, locationsId, nfsSharesIdDelete an NFS share. The underlying volume is automatically deleted.
renameexecprojectsId, locationsId, nfsSharesIdRenameNfsShare sets a new name for an nfsshare. 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
nfsSharesIdstring
projectsIdstring
filterstring
pageSizeinteger (int32)
pageTokenstring
updateMaskstring (google-fieldmask)

SELECT examples

Get details of a single NFS share.

SELECT
id,
name,
allowedClients,
labels,
nfsShareId,
pod,
requestedSizeGib,
state,
storageType,
volume
FROM google.baremetalsolution.nfs_shares
WHERE projectsId = '{{ projectsId }}' -- required
AND locationsId = '{{ locationsId }}' -- required
AND nfsSharesId = '{{ nfsSharesId }}' -- required;

INSERT examples

Create an NFS share.

INSERT INTO google.baremetalsolution.nfs_shares (
data__name,
data__allowedClients,
data__labels,
data__requestedSizeGib,
data__storageType,
data__pod,
projectsId,
locationsId
)
SELECT
'{{ name }}',
'{{ allowedClients }}',
'{{ labels }}',
'{{ requestedSizeGib }}',
'{{ storageType }}',
'{{ pod }}',
'{{ projectsId }}',
'{{ locationsId }}'
RETURNING
name,
done,
error,
metadata,
response
;

UPDATE examples

Update details of a single NFS share.

UPDATE google.baremetalsolution.nfs_shares
SET
data__name = '{{ name }}',
data__allowedClients = '{{ allowedClients }}',
data__labels = '{{ labels }}',
data__requestedSizeGib = '{{ requestedSizeGib }}',
data__storageType = '{{ storageType }}',
data__pod = '{{ pod }}'
WHERE
projectsId = '{{ projectsId }}' --required
AND locationsId = '{{ locationsId }}' --required
AND nfsSharesId = '{{ nfsSharesId }}' --required
AND updateMask = '{{ updateMask}}'
RETURNING
name,
done,
error,
metadata,
response;

DELETE examples

Delete an NFS share. The underlying volume is automatically deleted.

DELETE FROM google.baremetalsolution.nfs_shares
WHERE projectsId = '{{ projectsId }}' --required
AND locationsId = '{{ locationsId }}' --required
AND nfsSharesId = '{{ nfsSharesId }}' --required;

Lifecycle Methods

RenameNfsShare sets a new name for an nfsshare. Use with caution, previous names become immediately invalidated.

EXEC google.baremetalsolution.nfs_shares.rename 
@projectsId='{{ projectsId }}' --required,
@locationsId='{{ locationsId }}' --required,
@nfsSharesId='{{ nfsSharesId }}' --required
@@json=
'{
"newNfsshareId": "{{ newNfsshareId }}"
}';