Skip to main content

instances

Creates, updates, deletes, gets or lists an instances resource.

Overview

Nameinstances
TypeResource
Idgoogle.file.instances

Fields

The following fields are returned by SELECT queries:

Successful response

NameDatatypeDescription
namestringOutput only. The resource name of the instance, in the format projects/{project}/locations/{location}/instances/{instance}.
capacityStepSizeGbstring (int64)Output only. The increase/decrease capacity step size in GB.
createTimestring (google-datetime)Output only. The time when the instance was created.
customPerformanceSupportedbooleanOutput only. Indicates whether this instance supports configuring its performance. If true, the user can configure the instance's performance by using the 'performance_config' field.
deletionProtectionEnabledbooleanOptional. Indicates whether the instance is protected against deletion.
deletionProtectionReasonstringOptional. The reason for enabling deletion protection.
descriptionstringThe description of the instance (2048 characters or less).
etagstringServer-specified ETag for the instance resource to prevent simultaneous updates from overwriting each other.
fileSharesarrayFile system shares on the instance. For this version, only a single file share is supported.
kmsKeyNamestringKMS key name used for data encryption.
labelsobjectResource labels to represent user provided metadata.
maxCapacityGbstring (int64)Output only. The max capacity of the instance in GB.
minCapacityGbstring (int64)Output only. The min capacity of the instance in GB.
networksarrayVPC networks to which the instance is connected. For this version, only a single network is supported.
performanceConfigobjectOptional. Used to configure performance. (id: PerformanceConfig)
performanceLimitsobjectOutput only. Used for getting performance limits. (id: PerformanceLimits)
protocolstringImmutable. The protocol indicates the access protocol for all shares in the instance. This field is immutable and it cannot be changed after the instance has been created. Default value: NFS_V3.
replicationobjectOptional. Replication configuration. (id: Replication)
satisfiesPzibooleanOutput only. Reserved for future use.
satisfiesPzsbooleanOutput only. Reserved for future use.
statestringOutput only. The instance state.
statusMessagestringOutput only. Additional information about the instance state, if available.
suspensionReasonsarrayOutput only. Field indicates all the reasons the instance is in "SUSPENDED" state.
tagsobjectOptional. Input only. Immutable. Tag key-value pairs bound to this resource. Each key must be a namespaced name and each value a short name. Example: "123456789012/environment" : "production", "123456789013/costCenter" : "marketing" See the documentation for more information: - Namespaced name: https://cloud.google.com/resource-manager/docs/tags/tags-creating-and-managing#retrieving_tag_key - Short name: https://cloud.google.com/resource-manager/docs/tags/tags-creating-and-managing#retrieving_tag_value
tierstringThe service tier of the instance.

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
getselectprojectsId, locationsId, instancesIdGets the details of a specific instance.
listselectprojectsId, locationsIdpageSize, pageToken, orderBy, filterLists all instances in a project for either a specified location or for all locations.
createinsertprojectsId, locationsIdinstanceIdCreates an instance. When creating from a backup, the capacity of the new instance needs to be equal to or larger than the capacity of the backup (and also equal to or larger than the minimum capacity of the tier).
patchupdateprojectsId, locationsId, instancesIdupdateMaskUpdates the settings of a specific instance.
deletedeleteprojectsId, locationsId, instancesIdforceDeletes an instance.
restoreexecprojectsId, locationsId, instancesIdRestores an existing instance's file share from a backup. The capacity of the instance needs to be equal to or larger than the capacity of the backup (and also equal to or larger than the minimum capacity of the tier).
revertexecprojectsId, locationsId, instancesIdRevert an existing instance's file system to a specified snapshot.
promote_replicaexecprojectsId, locationsId, instancesIdPromote the standby instance (replica).

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
instancesIdstring
locationsIdstring
projectsIdstring
filterstring
forceboolean
instanceIdstring
orderBystring
pageSizeinteger (int32)
pageTokenstring
updateMaskstring (google-fieldmask)

SELECT examples

Gets the details of a specific instance.

SELECT
name,
capacityStepSizeGb,
createTime,
customPerformanceSupported,
deletionProtectionEnabled,
deletionProtectionReason,
description,
etag,
fileShares,
kmsKeyName,
labels,
maxCapacityGb,
minCapacityGb,
networks,
performanceConfig,
performanceLimits,
protocol,
replication,
satisfiesPzi,
satisfiesPzs,
state,
statusMessage,
suspensionReasons,
tags,
tier
FROM google.file.instances
WHERE projectsId = '{{ projectsId }}' -- required
AND locationsId = '{{ locationsId }}' -- required
AND instancesId = '{{ instancesId }}' -- required;

INSERT examples

Creates an instance. When creating from a backup, the capacity of the new instance needs to be equal to or larger than the capacity of the backup (and also equal to or larger than the minimum capacity of the tier).

INSERT INTO google.file.instances (
data__description,
data__tier,
data__labels,
data__fileShares,
data__networks,
data__etag,
data__kmsKeyName,
data__replication,
data__tags,
data__protocol,
data__performanceConfig,
data__deletionProtectionEnabled,
data__deletionProtectionReason,
projectsId,
locationsId,
instanceId
)
SELECT
'{{ description }}',
'{{ tier }}',
'{{ labels }}',
'{{ fileShares }}',
'{{ networks }}',
'{{ etag }}',
'{{ kmsKeyName }}',
'{{ replication }}',
'{{ tags }}',
'{{ protocol }}',
'{{ performanceConfig }}',
{{ deletionProtectionEnabled }},
'{{ deletionProtectionReason }}',
'{{ projectsId }}',
'{{ locationsId }}',
'{{ instanceId }}'
RETURNING
name,
done,
error,
metadata,
response
;

UPDATE examples

Updates the settings of a specific instance.

UPDATE google.file.instances
SET
data__description = '{{ description }}',
data__tier = '{{ tier }}',
data__labels = '{{ labels }}',
data__fileShares = '{{ fileShares }}',
data__networks = '{{ networks }}',
data__etag = '{{ etag }}',
data__kmsKeyName = '{{ kmsKeyName }}',
data__replication = '{{ replication }}',
data__tags = '{{ tags }}',
data__protocol = '{{ protocol }}',
data__performanceConfig = '{{ performanceConfig }}',
data__deletionProtectionEnabled = {{ deletionProtectionEnabled }},
data__deletionProtectionReason = '{{ deletionProtectionReason }}'
WHERE
projectsId = '{{ projectsId }}' --required
AND locationsId = '{{ locationsId }}' --required
AND instancesId = '{{ instancesId }}' --required
AND updateMask = '{{ updateMask}}'
RETURNING
name,
done,
error,
metadata,
response;

DELETE examples

Deletes an instance.

DELETE FROM google.file.instances
WHERE projectsId = '{{ projectsId }}' --required
AND locationsId = '{{ locationsId }}' --required
AND instancesId = '{{ instancesId }}' --required
AND force = '{{ force }}';

Lifecycle Methods

Restores an existing instance's file share from a backup. The capacity of the instance needs to be equal to or larger than the capacity of the backup (and also equal to or larger than the minimum capacity of the tier).

EXEC google.file.instances.restore 
@projectsId='{{ projectsId }}' --required,
@locationsId='{{ locationsId }}' --required,
@instancesId='{{ instancesId }}' --required
@@json=
'{
"fileShare": "{{ fileShare }}",
"sourceBackup": "{{ sourceBackup }}"
}';