Skip to content
This repository has been archived by the owner on Nov 14, 2024. It is now read-only.

Commit

Permalink
add interface attribute to google_compute_disk (#4116) (#458)
Browse files Browse the repository at this point in the history
Signed-off-by: Modular Magician <magic-modules@google.com>
  • Loading branch information
modular-magician authored Oct 16, 2020
1 parent f25a0f6 commit d59eef7
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 0 deletions.
5 changes: 5 additions & 0 deletions docs/resources/google_compute_disk.md
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,11 @@ Properties that can be accessed from the `google_compute_disk` resource:

* `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.

* `interface`: (Beta only) Specifies the disk interface to use for attaching this disk, which is either SCSI or NVME. The default is SCSI.
Possible values:
* SCSI
* NVME

* `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-9 to use the latest Debian 9 image: projects/debian-cloud/global/images/family/debian-9 Alternatively, use a specific version of a public operating system image: projects/debian-cloud/global/images/debian-9-stretch-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
Expand Down
1 change: 1 addition & 0 deletions docs/resources/google_compute_disks.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ See [google_compute_disk.md](google_compute_disk.md) for more detailed informati
* `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
* `interfaces`: (Beta only) an array of `google_compute_disk` interface
* `types`: an array of `google_compute_disk` type
* `source_images`: an array of `google_compute_disk` source_image
* `resource_policies`: (Beta only) an array of `google_compute_disk` resource_policies
Expand Down
2 changes: 2 additions & 0 deletions libraries/google_compute_disk.rb
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ class ComputeDisk < GcpResourceBase
attr_reader :size_gb
attr_reader :users
attr_reader :physical_block_size_bytes
attr_reader :interface
attr_reader :type
attr_reader :source_image
attr_reader :resource_policies
Expand Down Expand Up @@ -68,6 +69,7 @@ def parse
@size_gb = @fetched['sizeGb']
@users = @fetched['users']
@physical_block_size_bytes = @fetched['physicalBlockSizeBytes']
@interface = @fetched['interface']
@type = @fetched['type']
@source_image = @fetched['sourceImage']
@resource_policies = @fetched['resourcePolicies']
Expand Down
2 changes: 2 additions & 0 deletions libraries/google_compute_disks.rb
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ class ComputeDisks < GcpResourceBase
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(:interfaces, field: :interface)
filter_table_config.add(:types, field: :type)
filter_table_config.add(:source_images, field: :source_image)
filter_table_config.add(:resource_policies, field: :resource_policies)
Expand Down Expand Up @@ -96,6 +97,7 @@ def transformers
'sizeGb' => ->(obj) { return :size_gb, obj['sizeGb'] },
'users' => ->(obj) { return :users, obj['users'] },
'physicalBlockSizeBytes' => ->(obj) { return :physical_block_size_bytes, obj['physicalBlockSizeBytes'] },
'interface' => ->(obj) { return :interface, obj['interface'] },
'type' => ->(obj) { return :type, obj['type'] },
'sourceImage' => ->(obj) { return :source_image, obj['sourceImage'] },
'resourcePolicies' => ->(obj) { return :resource_policies, obj['resourcePolicies'] },
Expand Down

0 comments on commit d59eef7

Please sign in to comment.