-
Notifications
You must be signed in to change notification settings - Fork 1.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
updated storage_pool #9229
updated storage_pool #9229
Changes from 2 commits
ac6d4f0
4fa0c96
cc4d924
40fc3ca
ad79d45
b0f9dac
34b7f51
3391ac4
8b1dff1
4a8cf61
0bdc597
6d4be14
d88b23a
a70eb9e
381d908
3b5930f
83dc848
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
# Copyright 2018 Google Inc. | ||
# Licensed under the Apache License, Version 2.0 (the "License"); | ||
# you may not use this file except in compliance with the License. | ||
# You may obtain a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, | ||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
# See the License for the specific language governing permissions and | ||
# limitations under the License. | ||
--- !ruby/object:Api::Product | ||
name: Netapp | ||
display_name: Netapp | ||
versions: | ||
- !ruby/object:Api::Product::Version | ||
name: ga | ||
base_url: https://netapp.googleapis.com/v1/ | ||
- !ruby/object:Api::Product::Version | ||
name: beta | ||
base_url: https://netapp.googleapis.com/v1beta1/ | ||
scopes: | ||
- https://www.googleapis.com/auth/cloud-platform | ||
apis_required: | ||
- !ruby/object:Api::Product::ApiReference | ||
name: Cloud Volume API | ||
url: https://console.cloud.google.com/apis/library/cloudvolumesgcp-api.netapp.com |
Original file line number | Diff line number | Diff line change | ||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|
@@ -0,0 +1,227 @@ | ||||||||||||
# Copyright 2023 Google Inc. | ||||||||||||
# Licensed under the Apache License, Version 2.0 (the "License"); | ||||||||||||
# you may not use this file except in compliance with the License. | ||||||||||||
# You may obtain a copy of the License at | ||||||||||||
# | ||||||||||||
# http://www.apache.org/licenses/LICENSE-2.0 | ||||||||||||
# | ||||||||||||
# Unless required by applicable law or agreed to in writing, software | ||||||||||||
# distributed under the License is distributed on an "AS IS" BASIS, | ||||||||||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||||||||||||
# See the License for the specific language governing permissions and | ||||||||||||
# limitations under the License. | ||||||||||||
|
||||||||||||
--- !ruby/object:Api::Resource | ||||||||||||
# API resource name | ||||||||||||
name: 'storagePool' | ||||||||||||
# Resource description for the provider documentation. | ||||||||||||
description: | | ||||||||||||
StoragePool is a container for volumes with a service level and capacity. | ||||||||||||
Volumes can be created in a pool of sufficient available capacity. StoragePool capacity is what you are billed for. | ||||||||||||
references: !ruby/object:Api::Resource::ReferenceLinks | ||||||||||||
guides: | ||||||||||||
'QUICKSTART_TITLE': 'https://cloud.google.com/netapp/volumes/docs/reference/rest/v1/projects.locations.storagePools' | ||||||||||||
# Link to the REST API reference for the resource. For example, | ||||||||||||
api: 'https://cloud.google.com/netapp/volumes/docs/reference/rest/v1/projects.locations.storagePools' | ||||||||||||
# Marks the resource as beta-only. Ensure a beta version block is present in | ||||||||||||
# provider.yaml. | ||||||||||||
# min_version: beta | ||||||||||||
|
||||||||||||
# Inserts styled markdown into the header of the resource's page in the | ||||||||||||
# provider documentation. | ||||||||||||
# docs: !ruby/object:Provider::Terraform::Docs | ||||||||||||
# warning: | | ||||||||||||
# MULTILINE_WARNING_MARKDOWN | ||||||||||||
# note: | | ||||||||||||
# MULTILINE_NOTE_MARKDOWN | ||||||||||||
|
||||||||||||
# URL for the resource's standard List method. https://google.aip.dev/132 | ||||||||||||
# Terraform field names enclosed in double curly braces are replaced with | ||||||||||||
# the field values from the resource at runtime. | ||||||||||||
base_url: projects/{{project}}/locations/{{location}}/storagePools | ||||||||||||
# URL for the resource's standard Get method. https://google.aip.dev/131 | ||||||||||||
# Terraform field names enclosed in double curly braces are replaced with | ||||||||||||
# the field values from the resource at runtime. | ||||||||||||
self_link: projects/{{project}}/locations/{{location}}/storagePools/{{storage_pool_id}} | ||||||||||||
|
||||||||||||
# If true, the resource and all its fields are considered immutable - that is, | ||||||||||||
# only creatable, not updatable. Individual fields can override this if they | ||||||||||||
# have a custom update method in the API. | ||||||||||||
# immutable: true | ||||||||||||
|
||||||||||||
# Overrides one or more timeouts, in minutes. All timeouts default to 20. | ||||||||||||
# timeouts: !ruby/object:Api::Timeouts | ||||||||||||
# insert_minutes: 20 | ||||||||||||
# update_minutes: 20 | ||||||||||||
# delete_minutes: 20 | ||||||||||||
|
||||||||||||
# URL for the resource's standard Create method, including query parameters. | ||||||||||||
# https://google.aip.dev/133 | ||||||||||||
# Terraform field names enclosed in double curly braces are replaced with | ||||||||||||
# the field values from the resource at runtime. | ||||||||||||
create_url: projects/{{project}}/locations/{{location}}/storagePools?storagePoolId={{storage_pool_id}} | ||||||||||||
# Overrides the HTTP verb used to create a new resource. | ||||||||||||
# Allowed values: :POST, :PUT, :PATCH. Default: :POST | ||||||||||||
create_verb: :POST | ||||||||||||
|
||||||||||||
# Overrides the URL for the resource's standard Update method. (If unset, the | ||||||||||||
# self_link URL is used by default.) https://google.aip.dev/134 | ||||||||||||
# Terraform field names enclosed in double curly braces are replaced with | ||||||||||||
# the field values from the resource at runtime. | ||||||||||||
update_url: projects/{{project}}/locations/{{location}}/storagePools/{{storage_pool_id}} | ||||||||||||
# The HTTP verb used to update a resource. Allowed values: :POST, :PUT, :PATCH. Default: :PUT. | ||||||||||||
update_verb: :PATCH | ||||||||||||
# If true, the resource sets an `updateMask` query parameter listing modified | ||||||||||||
# fields when updating the resource. If false, it does not. | ||||||||||||
update_mask: true | ||||||||||||
|
||||||||||||
# Overrides the URL for the resource's standard Delete method. (If unset, the | ||||||||||||
# self_link URL is used by default.) https://google.aip.dev/135 | ||||||||||||
# Terraform field names enclosed in double curly braces are replaced with | ||||||||||||
# the field values from the resource at runtime. | ||||||||||||
delete_url: projects/{{project}}/locations/{{location}}/storagePools/{{storage_pool_id}} | ||||||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||||||||
# Overrides the HTTP verb used to delete a resource. | ||||||||||||
# Allowed values: :POST, :PUT, :PATCH, :DELETE. Default: :DELETE | ||||||||||||
delete_verb: :DELETE | ||||||||||||
|
||||||||||||
# If true, code for handling long-running operations is generated along with | ||||||||||||
# the resource. If false, that code is not generated. | ||||||||||||
autogen_async: true | ||||||||||||
# Sets parameters for handling operations returned by the API. | ||||||||||||
async: !ruby/object:Api::OpAsync | ||||||||||||
# Overrides which API calls return operations. Default: ['create', | ||||||||||||
# 'update', 'delete'] | ||||||||||||
# actions: ['create', 'update', 'delete'] | ||||||||||||
operation: !ruby/object:Api::OpAsync::Operation | ||||||||||||
base_url: '{{op_id}}' | ||||||||||||
|
||||||||||||
# If true, the provider sets the resource's Terraform ID after the resource is created, | ||||||||||||
# taking into account values that are set by the API at create time. This is only possible | ||||||||||||
# when the completed operation's JSON includes the created resource in the "response" field. | ||||||||||||
# If false (or unset), the provider sets the resource's Terraform ID before the resource is | ||||||||||||
# created, based only on the resource configuration. | ||||||||||||
# result: !ruby/object:Api::OpAsync::Result | ||||||||||||
# resource_inside_response: true | ||||||||||||
|
||||||||||||
# All resources (of all kinds) that share a mutex value block rather than | ||||||||||||
# executing concurrent API requests. | ||||||||||||
# Terraform field names enclosed in double curly braces are replaced with | ||||||||||||
# the field values from the resource at runtime. | ||||||||||||
# mutex: RESOURCE_NAME/{{name}} | ||||||||||||
|
||||||||||||
parameters: | ||||||||||||
- !ruby/object:Api::Type::String | ||||||||||||
name: 'location' | ||||||||||||
required: true | ||||||||||||
immutable: true | ||||||||||||
url_param_only: true | ||||||||||||
description: | | ||||||||||||
LOCATION_DESCRIPTION | ||||||||||||
- !ruby/object:Api::Type::String | ||||||||||||
name: 'storage_pool_id' | ||||||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||||||||
description: | ||||||||||||
'The unique name of the storage pool | ||||||||||||
`[_a-zA-Z0-9][-_.a-zA-Z0-9]*`.' | ||||||||||||
required: true | ||||||||||||
immutable: true | ||||||||||||
url_param_only: true | ||||||||||||
examples: | ||||||||||||
- !ruby/object:Provider::Terraform::Examples | ||||||||||||
name: 'Storage_pool_create' | ||||||||||||
primary_resource_id: 'test_pool' | ||||||||||||
vars: | ||||||||||||
pool_name: 'test-pool' | ||||||||||||
properties: | ||||||||||||
# Fields go here | ||||||||||||
- !ruby/object:Api::Type::String | ||||||||||||
name: name | ||||||||||||
output: true | ||||||||||||
description: | | ||||||||||||
Name of the storage pool | ||||||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
If users want to the long form identifier, they can use |
||||||||||||
- !ruby/object:Api::Type::Enum | ||||||||||||
name: 'serviceLevel' | ||||||||||||
G-NamanGupta marked this conversation as resolved.
Show resolved
Hide resolved
|
||||||||||||
description: | | ||||||||||||
Service level of the storage pool | ||||||||||||
values: | ||||||||||||
- :PREMIUM | ||||||||||||
- :EXTREME | ||||||||||||
- :STANDARD | ||||||||||||
- !ruby/object:Api::Type::String | ||||||||||||
name: 'capacityGib' | ||||||||||||
G-NamanGupta marked this conversation as resolved.
Show resolved
Hide resolved
|
||||||||||||
description: | | ||||||||||||
Capacity in GIB of the pool | ||||||||||||
- !ruby/object:Api::Type::String | ||||||||||||
name: 'volumeCapacityGib' | ||||||||||||
description: | | ||||||||||||
Allocated size of all volumes in GIB in the storage pool | ||||||||||||
output: true | ||||||||||||
- !ruby/object:Api::Type::Integer | ||||||||||||
name: 'volumeCount' | ||||||||||||
description: | | ||||||||||||
Volume count of the storage pool | ||||||||||||
output: true | ||||||||||||
- !ruby/object:Api::Type::Enum | ||||||||||||
name: 'State' | ||||||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Usually fields like There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Removed the above fields from yaml. |
||||||||||||
description: | | ||||||||||||
State of the storage pool | ||||||||||||
values: | ||||||||||||
- :STATE_UNSPECIFIED | ||||||||||||
- :CREATING | ||||||||||||
- :RESTORING | ||||||||||||
- :UPDATING | ||||||||||||
- :DELETING | ||||||||||||
- :DISABLED | ||||||||||||
- :READY | ||||||||||||
output: true | ||||||||||||
- !ruby/object:Api::Type::String | ||||||||||||
name: 'stateDetails' | ||||||||||||
description: | | ||||||||||||
State details of the storage pool | ||||||||||||
output: true | ||||||||||||
- !ruby/object:Api::Type::String | ||||||||||||
name: 'createTime' | ||||||||||||
description: | | ||||||||||||
Create time of the storage pool | ||||||||||||
output: true | ||||||||||||
- !ruby/object:Api::Type::String | ||||||||||||
name: 'description' | ||||||||||||
description: | | ||||||||||||
Description of the storage pool | ||||||||||||
- !ruby/object:Api::Type::KeyValuePairs | ||||||||||||
G-NamanGupta marked this conversation as resolved.
Show resolved
Hide resolved
|
||||||||||||
name: labels | ||||||||||||
description: | | ||||||||||||
Labels as key value pairs.An object containing a list of "key": value pairs. Example: { "name": "wrench", "mass": "1.3kg", "count": "3" }. | ||||||||||||
- !ruby/object:Api::Type::String | ||||||||||||
name: 'network' | ||||||||||||
G-NamanGupta marked this conversation as resolved.
Show resolved
Hide resolved
|
||||||||||||
description: | | ||||||||||||
VPC Network name. Format: projects/{project}/global/networks/{network} | ||||||||||||
diff_suppress_func: tpgresource.ProjectNumberDiffSuppress | ||||||||||||
shuyama1 marked this conversation as resolved.
Show resolved
Hide resolved
|
||||||||||||
- !ruby/object:Api::Type::String | ||||||||||||
name: 'activeDirectory' | ||||||||||||
description: | | ||||||||||||
Specifies the Active Directory to be used for creating a SMB volume. | ||||||||||||
- !ruby/object:Api::Type::String | ||||||||||||
name: 'kmsConfig' | ||||||||||||
description: | | ||||||||||||
Specifies the KMS config to be used for volume encryption. | ||||||||||||
- !ruby/object:Api::Type::Boolean | ||||||||||||
name: 'ldapEnabled' | ||||||||||||
description: | | ||||||||||||
Flag indicating if the pool is NFS LDAP enabled or not. | ||||||||||||
- !ruby/object:Api::Type::String | ||||||||||||
name: 'psaRange' | ||||||||||||
description: | | ||||||||||||
Name of the Private Service Access allocated range. If not provided, any available range will be chosen. | ||||||||||||
- !ruby/object:Api::Type::Enum | ||||||||||||
name: 'encryptionType' | ||||||||||||
description: | | ||||||||||||
Specifies the current pool encryption key source. | ||||||||||||
values: | ||||||||||||
- :ENCRYPTION_TYPE_UNSPECIFIED | ||||||||||||
- :SERVICE_MANAGED | ||||||||||||
- :CLOUD_KMS | ||||||||||||
output: true | ||||||||||||
- !ruby/object:Api::Type::Boolean | ||||||||||||
name: 'globalAccessAllowed' | ||||||||||||
description: | | ||||||||||||
Allows SO pool to access AD or DNS server from other regions. |
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
@@ -0,0 +1,37 @@ | ||||||
|
||||||
resource "google_compute_network" "peering_network" { | ||||||
name = "peering-network" | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. for identifiers of resources in the tests, generally There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Updated the field to take value from a variable from yaml file. |
||||||
} | ||||||
|
||||||
# Create an IP address | ||||||
resource "google_compute_global_address" "private_ip_alloc" { | ||||||
name = "private-ip-alloc" | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. same here There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Updated the field to take value from a variable from yaml file. |
||||||
purpose = "VPC_PEERING" | ||||||
address_type = "INTERNAL" | ||||||
prefix_length = 16 | ||||||
network = google_compute_network.peering_network.id | ||||||
} | ||||||
|
||||||
# Create a private connection | ||||||
resource "google_service_networking_connection" "default" { | ||||||
network = google_compute_network.peering_network.id | ||||||
service = "netapp.servicenetworking.goog" | ||||||
reserved_peering_ranges = [google_compute_global_address.private_ip_alloc.name] | ||||||
} | ||||||
|
||||||
resource "google_netapp_storage_pool" "test_pool" { | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Added the suggestion. |
||||||
storage_pool_id = "testpool1" | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Added the suggestion. |
||||||
location = "us-central1" | ||||||
service_level = "PREMIUM" | ||||||
capacity_gib = "2048" | ||||||
network = google_compute_network.peering_network.id | ||||||
active_directory = "" | ||||||
description = "" | ||||||
global_access_allowed = false | ||||||
kms_config = "" | ||||||
labels = {} | ||||||
ldap_enabled = false | ||||||
psa_range = "" | ||||||
shuyama1 marked this conversation as resolved.
Show resolved
Hide resolved
|
||||||
|
||||||
} | ||||||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For all the default ones, I think we can omit them from this file.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Deleted the Create/Delete verb. Update verb was not default, hence keeping it.