-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
Netapp volumes: Add restoreParameters #9918
Changes from all commits
c26e36b
10c647f
cbf790f
e785eb8
7c1ed3f
8937f05
3d9e0fd
d540112
4d23511
9f0011d
7114826
bc6bfd8
aa9f798
0cdf2c7
9b852a9
2e66ef2
1b9f077
7a0b658
50c53e6
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 |
---|---|---|
|
@@ -53,7 +53,7 @@ parameters: | |
url_param_only: true | ||
examples: | ||
- !ruby/object:Provider::Terraform::Examples | ||
name: 'volume_basic' | ||
name: 'netapp_volume_basic' | ||
primary_resource_id: 'test_volume' | ||
vars: | ||
volume_name: 'test-volume' | ||
|
@@ -64,6 +64,30 @@ examples: | |
test_vars_overrides: | ||
network_name: 'acctest.BootstrapSharedServiceNetworkingConnection(t, "gcnv-network-config-1", acctest.ServiceNetworkWithParentService("netapp.servicenetworking.goog"))' | ||
properties: | ||
- !ruby/object:Api::Type::Enum | ||
name: 'state' | ||
description: | | ||
State of the volume. | ||
values: | ||
- STATE_UNSPECIFIED | ||
- READY | ||
- CREATING | ||
- DELETING | ||
- UPDATING | ||
- RESTORING | ||
- DISABLED | ||
- ERROR | ||
output: true | ||
- !ruby/object:Api::Type::String | ||
name: 'stateDetails' | ||
description: | | ||
State details of the volume. | ||
output: true | ||
- !ruby/object:Api::Type::String | ||
name: 'createTime' | ||
description: | | ||
Create time of the volume. A timestamp in RFC3339 UTC "Zulu" format. Examples: "2023-06-22T09:13:01.617Z". | ||
output: true | ||
- !ruby/object:Api::Type::String | ||
name: 'shareName' | ||
description: | | ||
|
@@ -205,11 +229,11 @@ properties: | |
name: 'description' | ||
description: | | ||
An optional description of this resource. | ||
# Use of snapReserve is depricated. We don't expose it intentially. | ||
# Use of snapReserve is deprecated. Here as a comment to express intention. | ||
# - !ruby/object:Api::Type::Integer | ||
# name: 'snapReserve' | ||
# description: | | ||
# Snap_reserve specifies percentage of volume storage reserved for snapshot storage. Default is 0 percent. Use is deprecated. | ||
# `snap_reserve` specifies percentage of volume storage reserved for snapshot storage. Default is 0 percent. Use is deprecated. | ||
- !ruby/object:Api::Type::Boolean | ||
name: 'snapshotDirectory' | ||
description: | | ||
|
@@ -245,6 +269,34 @@ properties: | |
description: | | ||
Reports the resource name of the Active Directory policy being used. Inherited from storage pool. | ||
output: true | ||
- !ruby/object:Api::Type::NestedObject | ||
name: 'restoreParameters' | ||
description: |- | ||
Used to create this volume from a snapshot (= cloning) or an backup. | ||
immutable: true | ||
# This parameter is only used at CREATE. READs will omit it. | ||
ignore_read: true | ||
properties: | ||
- !ruby/object:Api::Type::String | ||
name: 'sourceSnapshot' | ||
description: |- | ||
Full name of the snapshot to use for creating this volume. | ||
`source_snapshot` and `source_backup` cannot be used simultaneously. | ||
Format: `projects/{{project}}/locations/{{location}}/volumes/{{volume}}/snapshots/{{snapshot}}`. | ||
exactly_one_of: | ||
- restore_parameters.0.source_backup | ||
- restore_parameters.0.source_snapshot | ||
immutable: true | ||
- !ruby/object:Api::Type::String | ||
name: 'sourceBackup' | ||
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. Can we set this in a test? 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. Not yet. We don't have a backup resource yet to create backups to restore from. Back to this one: We currently cannot test it. I can remove it for now, but voted to keep it in, since the TF interaction is pretty simple. Specify an valid URN for a backup. There isn't too much which can go wrong in TF here, right? 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. Sorry for the late reply. 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. I tested it and it works as expected. They only fact worth mentioning: The API triggers the restore. The LRO returns after the restore job is set up. The new volume resource is being created with state==RESTORING, which will eventually (after minutes/hours/days, depending on the amount of data to restore) will transition to state=READY. |
||
description: |- | ||
Full name of the snapshot to use for creating this volume. | ||
`source_snapshot` and `source_backup` cannot be used simultaneously. | ||
Format: `projects/{{project}}/locations/{{location}}/backupVaults/{{backupVaultId}}/backups/{{backup}}`. | ||
exactly_one_of: | ||
- restore_parameters.0.source_backup | ||
- restore_parameters.0.source_snapshot | ||
immutable: true | ||
- !ruby/object:Api::Type::String | ||
name: 'kmsConfig' | ||
description: | | ||
|
@@ -405,17 +457,6 @@ properties: | |
description: |- | ||
Set the day or days of the month to make a snapshot (1-31). Accepts a comma separated number of days. Defaults to '1'. | ||
default_value: '1' | ||
# This is disabled until we have support for backup resource and can test it. | ||
# - !ruby/object:Api::Type::NestedObject | ||
# name: restoreParameters | ||
# description: Specifies the source information to create a volume from. | ||
# immutable: true | ||
# properties: | ||
# - !ruby/object:Api::Type::String | ||
# name: 'sourceSnapshot' | ||
# description: |- | ||
# Full name of the snapshot resource. Format: `projects/{{project}}/locations/{{location}}/volumes/{{volume}}/snapshots/{{snapshot}}`. | ||
# required: true | ||
virtual_fields: | ||
- !ruby/object:Api::Type::Enum | ||
name: 'deletion_policy' | ||
|
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.
Any specific reason that we want to change this name + handwritten test names?
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.
That's the inner Monk in me. I don't like the fact that the example isn't prefixed with netapp_volume to make clear where it belongs too. Having that prefix makes the content of the example folder more tidy, move the example file closer to other netapp_volume resources in the folder listing and tells anyone looking at the file name to which resource it belongs too.
So basically this is cleanup. Is this causing other problems I don't see?
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.
No big issues. It's just we run integration tests nightly and changing name may lose history of test results. So just want to make sure this change is intended