Disk class
Represents a Persistent Disk resource.
Google Compute Engine has two Disk resources:
- [Zonal](/compute/docs/reference/rest/v1/disks)
- [Regional](/compute/docs/reference/rest/v1/regionDisks)
Persistent disks are required for running your VM instances. Create both boot and non-boot (data) persistent disks.
For more information, read Persistent Disks. For more storage options, read Storage options.
The disks resource represents a zonal persistent disk. For more information, readZonal persistent disks.
The regionDisks resource represents a regional persistent disk. For more information, read Regional resources.
Constructors
-
Disk({String? accessMode, String? architecture, DiskAsyncReplication? asyncPrimaryDisk, Map<
String, DiskAsyncReplicationList> ? asyncSecondaryDisks, String? creationTimestamp, String? description, CustomerEncryptionKey? diskEncryptionKey, bool? enableConfidentialCompute, List<GuestOsFeature> ? guestOsFeatures, String? id, String? kind, String? labelFingerprint, Map<String, String> ? labels, String? lastAttachTimestamp, String? lastDetachTimestamp, List<String> ? licenseCodes, List<String> ? licenses, String? locationHint, String? name, String? options, DiskParams? params, String? physicalBlockSizeBytes, String? provisionedIops, String? provisionedThroughput, String? region, List<String> ? replicaZones, List<String> ? resourcePolicies, DiskResourceStatus? resourceStatus, bool? satisfiesPzi, bool? satisfiesPzs, String? selfLink, String? sizeGb, String? sourceConsistencyGroupPolicy, String? sourceConsistencyGroupPolicyId, String? sourceDisk, String? sourceDiskId, String? sourceImage, CustomerEncryptionKey? sourceImageEncryptionKey, String? sourceImageId, String? sourceInstantSnapshot, String? sourceInstantSnapshotId, String? sourceSnapshot, CustomerEncryptionKey? sourceSnapshotEncryptionKey, String? sourceSnapshotId, String? sourceStorageObject, String? status, String? storagePool, String? type, List<String> ? users, String? zone}) - Disk.fromJson(Map json_)
Properties
- accessMode ↔ String?
-
The access mode of the disk.
getter/setter pair
- architecture ↔ String?
-
The architecture of the disk.
getter/setter pair
- asyncPrimaryDisk ↔ DiskAsyncReplication?
-
Disk asynchronously replicated into this disk.
getter/setter pair
-
asyncSecondaryDisks
↔ Map<
String, DiskAsyncReplicationList> ? -
A list of disks this disk is asynchronously replicated to.
getter/setter pair
- creationTimestamp ↔ String?
-
Creation timestamp inRFC3339
text format.
getter/setter pair
- description ↔ String?
-
An optional description of this resource.
getter/setter pair
- diskEncryptionKey ↔ CustomerEncryptionKey?
-
Encrypts the disk using a
customer-supplied encryption key or a
customer-managed encryption key.
getter/setter pair
- enableConfidentialCompute ↔ bool?
-
Whether this disk is using confidential compute mode.
getter/setter pair
-
guestOsFeatures
↔ List<
GuestOsFeature> ? -
A list of features to enable on the guest operating system.
getter/setter pair
- hashCode → int
-
The hash code for this object.
no setterinherited
- id ↔ String?
-
The unique identifier for the resource.
getter/setter pair
- kind ↔ String?
-
Type of the resource.
getter/setter pair
- labelFingerprint ↔ String?
-
A fingerprint for the labels being applied to this disk, which is
essentially a hash of the labels set used for optimistic locking.
getter/setter pair
-
labelFingerprintAsBytes
↔ List<
int> -
getter/setter pair
-
labels
↔ Map<
String, String> ? -
Labels to apply to this disk.
getter/setter pair
- lastAttachTimestamp ↔ String?
-
Last attach timestamp inRFC3339
text format.
getter/setter pair
- lastDetachTimestamp ↔ String?
-
Last detach timestamp inRFC3339
text format.
getter/setter pair
-
licenseCodes
↔ List<
String> ? -
Integer license codes indicating which licenses are attached to this disk.
getter/setter pair
-
licenses
↔ List<
String> ? -
A list of publicly visible licenses.
getter/setter pair
- locationHint ↔ String?
-
An opaque location hint used to place the disk close to other resources.
This field is for use by internal tools that use the public API.
getter/setter pair
- name ↔ String?
-
Name of the resource.
getter/setter pair
- options ↔ String?
-
Internal use only.
getter/setter pair
- params ↔ DiskParams?
-
Input only.
getter/setter pair
- physicalBlockSizeBytes ↔ String?
-
Physical block size of the persistent disk, in bytes.
If not present in a request, a default value is used.
The currently supported size is 4096, other sizes may be added in
the future.
If an unsupported value is requested, the error message will list
the supported values for the caller's project.
getter/setter pair
- provisionedIops ↔ String?
-
Indicates how many IOPS to provision for the disk.
getter/setter pair
- provisionedThroughput ↔ String?
-
Indicates how much throughput to provision for the disk.
getter/setter pair
- region ↔ String?
-
URL of the region where the disk resides.
getter/setter pair
-
replicaZones
↔ List<
String> ? -
URLs of the zones where the disk should be replicated to.
getter/setter pair
-
resourcePolicies
↔ List<
String> ? -
Resource policies applied to this disk for automatic snapshot creations.
getter/setter pair
- resourceStatus ↔ DiskResourceStatus?
-
Status information for the disk resource.
getter/setter pair
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- satisfiesPzi ↔ bool?
-
Reserved for future use.
getter/setter pair
- satisfiesPzs ↔ bool?
-
Reserved for future use.
getter/setter pair
- selfLink ↔ String?
-
Server-defined fully-qualified URL for this resource.
getter/setter pair
- sizeGb ↔ String?
-
Size, in GB, of the persistent disk.
getter/setter pair
- sourceConsistencyGroupPolicy ↔ String?
-
URL of the DiskConsistencyGroupPolicy for a secondary disk
that was created using a consistency group.
getter/setter pair
- sourceConsistencyGroupPolicyId ↔ String?
-
ID of the DiskConsistencyGroupPolicy for a secondary disk
that was created using a consistency group.
getter/setter pair
- sourceDisk ↔ String?
-
The source disk used to create this disk.
getter/setter pair
- sourceDiskId ↔ String?
-
The unique ID of the disk used to create this disk.
getter/setter pair
- sourceImage ↔ String?
-
The source image used to create this disk.
getter/setter pair
- sourceImageEncryptionKey ↔ CustomerEncryptionKey?
-
Thecustomer-supplied
encryption key of the source image.
getter/setter pair
- sourceImageId ↔ String?
-
The ID value of the image used to create this disk.
getter/setter pair
- sourceInstantSnapshot ↔ String?
-
The source instant snapshot used to create this disk.
getter/setter pair
- sourceInstantSnapshotId ↔ String?
-
The unique ID of the instant snapshot used to create this
disk.
getter/setter pair
- sourceSnapshot ↔ String?
-
The source snapshot used to create this disk.
getter/setter pair
- sourceSnapshotEncryptionKey ↔ CustomerEncryptionKey?
-
Thecustomer-supplied
encryption key of the source snapshot.
getter/setter pair
- sourceSnapshotId ↔ String?
-
The unique ID of the snapshot used to create this disk.
getter/setter pair
- sourceStorageObject ↔ String?
-
The full Google Cloud Storage URI where the disk image is stored.
getter/setter pair
- status ↔ String?
-
The status of disk creation.
getter/setter pair
- storagePool ↔ String?
-
The storage pool in which the new disk is created.
getter/setter pair
- type ↔ String?
-
URL of the disk type resource describing which disk type to use to create
the disk.
getter/setter pair
-
users
↔ List<
String> ? -
Links to the users of the disk (attached instances)
in form:projects/project/zones/zone/instances/instance
getter/setter pair
- zone ↔ String?
-
URL of the zone where the disk resides.
You must specify this field as part of the HTTP request URL.
getter/setter pair
Methods
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toJson(
) → Map< String, dynamic> -
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited