Skip to main content

instances

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

Overview

Nameinstances
TypeResource
Idgoogle.file.instances

Fields

NameDatatypeDescription
namestringOutput only. The resource name of the instance, in the format projects/{project}/locations/{location}/instances/{instance}.
descriptionstringThe description of the instance (2048 characters or less).
configurablePerformanceEnabledbooleanOutput only. Indicates whether this instance's performance is configurable. If enabled, adjust it using the 'performance_config' field.
createTimestringOutput only. The time when the instance was created.
deletionProtectionEnabledbooleanOptional. Indicates whether the instance is protected against deletion.
deletionProtectionReasonstringOptional. The reason for enabling deletion protection.
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.
networksarrayVPC networks to which the instance is connected. For this version, only a single network is supported.
performanceConfigobjectUsed for setting the performance configuration. If the user doesn't specify PerformanceConfig, automatically provision the default performance settings as described in https://cloud.google.com/filestore/docs/performance. Larger instances will be linearly set to more IOPS. If the instance's capacity is increased or decreased, its performance will be automatically adjusted upwards or downwards accordingly (respectively).
performanceLimitsobjectThe enforced performance limits, calculated from the instance's performance configuration.
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.
replicationobjectReplication specifications.
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 are bound to this resource. For example: "123/environment": "production", "123/costCenter": "marketing"
tierstringThe service tier of the instance.

Methods

NameAccessible byRequired ParamsDescription
getSELECTinstancesId, locationsId, projectsIdGets the details of a specific instance.
listSELECTlocationsId, projectsIdLists all instances in a project for either a specified location or for all locations.
createINSERTlocationsId, projectsIdCreates 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).
deleteDELETEinstancesId, locationsId, projectsIdDeletes an instance.
patchUPDATEinstancesId, locationsId, projectsIdUpdates the settings of a specific instance.
promote_replicaEXECinstancesId, locationsId, projectsIdPromote the standby instance (replica).
restoreEXECinstancesId, locationsId, projectsIdRestores 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).
revertEXECinstancesId, locationsId, projectsIdRevert an existing instance's file system to a specified snapshot.

SELECT examples

Lists all instances in a project for either a specified location or for all locations.

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

INSERT example

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

/*+ create */
INSERT INTO google.file.instances (
locationsId,
projectsId,
description,
tier,
labels,
fileShares,
networks,
etag,
kmsKeyName,
replication,
tags,
protocol,
performanceConfig,
deletionProtectionEnabled,
deletionProtectionReason
)
SELECT
'{{ locationsId }}',
'{{ projectsId }}',
'{{ description }}',
'{{ tier }}',
'{{ labels }}',
'{{ fileShares }}',
'{{ networks }}',
'{{ etag }}',
'{{ kmsKeyName }}',
'{{ replication }}',
'{{ tags }}',
'{{ protocol }}',
'{{ performanceConfig }}',
{{ deletionProtectionEnabled }},
'{{ deletionProtectionReason }}'
;

UPDATE example

Updates a instances resource.

/*+ update */
UPDATE google.file.instances
SET
description = '{{ description }}',
tier = '{{ tier }}',
labels = '{{ labels }}',
fileShares = '{{ fileShares }}',
networks = '{{ networks }}',
etag = '{{ etag }}',
kmsKeyName = '{{ kmsKeyName }}',
replication = '{{ replication }}',
tags = '{{ tags }}',
protocol = '{{ protocol }}',
performanceConfig = '{{ performanceConfig }}',
deletionProtectionEnabled = true|false,
deletionProtectionReason = '{{ deletionProtectionReason }}'
WHERE
instancesId = '{{ instancesId }}'
AND locationsId = '{{ locationsId }}'
AND projectsId = '{{ projectsId }}';

DELETE example

Deletes the specified instances resource.

/*+ delete */
DELETE FROM google.file.instances
WHERE instancesId = '{{ instancesId }}'
AND locationsId = '{{ locationsId }}'
AND projectsId = '{{ projectsId }}';