diff --git a/docs/resources/google_compute_disk.md b/docs/resources/google_compute_disk.md index 4aca7ef57..e1c0bb2ae 100644 --- a/docs/resources/google_compute_disk.md +++ b/docs/resources/google_compute_disk.md @@ -56,6 +56,8 @@ Properties that can be accessed from the `google_compute_disk` resource: * `users`: Links to the users of the disk (attached instances) in form: project/zones/zone/instances/instance + * `physical_block_size_bytes`: Physical block size of the persistent disk, in bytes. If not present in a request, a default value is used. Currently supported sizes are 4096 and 16384, 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. + * `type`: URL of the disk type resource describing which disk type to use to create the disk. Provide this when creating the disk. * `source_image`: The source image used to create this disk. If the source image is deleted, this field will not be set. To create a disk with one of the public operating system images, specify the image by its family name. For example, specify family/debian-8 to use the latest Debian 8 image: projects/debian-cloud/global/images/family/debian-8 Alternatively, use a specific version of a public operating system image: projects/debian-cloud/global/images/debian-8-jessie-vYYYYMMDD To create a disk with a private image that you created, specify the image name in the following format: global/images/my-private-image You can also specify a private image by its image family, which returns the latest version of the image in that family. Replace the image name with family/family-name: global/images/family/my-private-family diff --git a/docs/resources/google_compute_disks.md b/docs/resources/google_compute_disks.md index f6a5d8cbd..d6cf171bf 100644 --- a/docs/resources/google_compute_disks.md +++ b/docs/resources/google_compute_disks.md @@ -31,6 +31,7 @@ See [google_compute_disk.md](google_compute_disk.md) for more detailed informati * `names`: an array of `google_compute_disk` name * `size_gbs`: an array of `google_compute_disk` size_gb * `users`: an array of `google_compute_disk` users + * `physical_block_size_bytes`: an array of `google_compute_disk` physical_block_size_bytes * `types`: an array of `google_compute_disk` type * `source_images`: an array of `google_compute_disk` source_image * `zones`: an array of `google_compute_disk` zone diff --git a/libraries/google_compute_disk.rb b/libraries/google_compute_disk.rb index 9dae4cc58..f0770012c 100644 --- a/libraries/google_compute_disk.rb +++ b/libraries/google_compute_disk.rb @@ -35,6 +35,7 @@ class Disk < GcpResourceBase attr_reader :name attr_reader :size_gb attr_reader :users + attr_reader :physical_block_size_bytes attr_reader :type attr_reader :source_image attr_reader :zone @@ -63,6 +64,7 @@ def parse @name = @fetched['name'] @size_gb = @fetched['sizeGb'] @users = @fetched['users'] + @physical_block_size_bytes = @fetched['physicalBlockSizeBytes'] @type = @fetched['type'] @source_image = @fetched['sourceImage'] @zone = @fetched['zone'] diff --git a/libraries/google_compute_disks.rb b/libraries/google_compute_disks.rb index ece34ca12..3d978a351 100644 --- a/libraries/google_compute_disks.rb +++ b/libraries/google_compute_disks.rb @@ -34,6 +34,7 @@ class Disks < GcpResourceBase filter_table_config.add(:names, field: :name) filter_table_config.add(:size_gbs, field: :size_gb) filter_table_config.add(:users, field: :users) + filter_table_config.add(:physical_block_size_bytes, field: :physical_block_size_bytes) filter_table_config.add(:types, field: :type) filter_table_config.add(:source_images, field: :source_image) filter_table_config.add(:zones, field: :zone) @@ -93,6 +94,7 @@ def transformers 'name' => ->(obj) { return :name, obj['name'] }, 'sizeGb' => ->(obj) { return :size_gb, obj['sizeGb'] }, 'users' => ->(obj) { return :users, obj['users'] }, + 'physicalBlockSizeBytes' => ->(obj) { return :physical_block_size_bytes, obj['physicalBlockSizeBytes'] }, 'type' => ->(obj) { return :type, obj['type'] }, 'sourceImage' => ->(obj) { return :source_image, obj['sourceImage'] }, 'zone' => ->(obj) { return :zone, obj['zone'] },