Skip to content

Commit dd9a69e

Browse files
authored
Merge branch 'integration/main' into main
2 parents 5de5884 + 4efb9ef commit dd9a69e

36 files changed

Lines changed: 1338 additions & 942 deletions

CHANGELOG.md

Lines changed: 21 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,20 @@
1+
## 26.0.0
2+
BREAKING CHANGE:
3+
* resource/aggregate: `number_of_disks` and `disk_size_size` default value is removed.
4+
5+
IMPROVEMENTS:
6+
* resource/connector_gcp: replaced GCP Deployment Manager API with individual GCP Compute Engine APIs for VM and disk management.
7+
8+
NEW FEATURES:
9+
* resource/aggregate: added option `increase_capacity_size` and `increase_capacity_unit` to support increase capacity for EBS Elastic Volumes aggregate.
10+
* resource/aggregate: added option `initial_ev_aggregate_size` and `initial_ev_aggregate_unit` to support initial capacity for EBS Elastic Volumes aggregate.
11+
* resource/snapmirror: now supports import.
12+
* resource/snapmirror: add `delete_destination_volume` option to automatically delete destination volume when destroying snapmirror relationships.
13+
14+
ENHANCEMENTS:
15+
* Update all the resources documenation by adding `Forces new resource` if the modification is not supported.
16+
* resource/cvo_aws and resource/cvo_azure: add `open_security_group` option to open security group to all IP ranges
17+
118
## 25.3.0
219
NEW FEATURES:
320
* resource/volume supports import.
@@ -96,7 +113,7 @@ BUG FIXES:
96113
## 23.8.0
97114
BUG FIXES:
98115
* resource/volume: fix documentation name for volume and add an example for creating on_prem volume.
99-
* ressource/cvo_aws, cvo_azure, cvo_gcp: remove force new from `retries`.
116+
* resource/cvo_aws, cvo_azure, cvo_gcp: remove force new from `retries`.
100117

101118
NEW ENHANCEMENTS:
102119
* resource/cvo_aws and cvo_gcp: add `saas_subscription_id`.
@@ -198,12 +215,12 @@ NEW FEATURES:
198215
* resource/cvo_aws: add `retries` parameter to increase wait time when creating CVO.
199216
* resource/cvo_azure: add `retries` parameter to increase wait time when creating CVO.
200217
* resource/cvo_gcp: add `retries` parameter to increase wait time when creating CVO.
201-
* resoruce/cvs for AWS, AZURE and GCP: add `svm_name` an optional parameter. The modification is supported.
218+
* resource/cvs for AWS, AZURE and GCP: add `svm_name` an optional parameter. The modification is supported.
202219

203220
NEW ENHANCEMENTS:
204221
* resource/connector_azure: display the deployed virtual machine principal_id in state file on the connector azure creation.
205222
* resource/cvo_azure: add `availability_zone_node1` and `availability_zone_node2` to support HA deployment.
206-
* resoruce/cvo_azure: add new support value "Premium_ZRS" in parameter `storage_type`.
223+
* resource/cvo_azure: add new support value "Premium_ZRS" in parameter `storage_type`.
207224

208225
## 22.9.1
209226
NEW FEATURES:
@@ -302,7 +319,7 @@ ENHANCEMENTS:
302319
NEW FEATURES:
303320

304321
* resource/aws_fsx_volume: create, update and delete FSx volume.
305-
* resource/cvo_onnprem: This can be used to register an onprem ONTAP system into CloudManager.
322+
* resource/cvo_onprem: This can be used to register an onprem ONTAP system into CloudManager.
306323

307324
## 21.11.1
308325
ENHANCEMENTS:

cloudmanager/aggregate.go

Lines changed: 63 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -13,15 +13,16 @@ import (
1313

1414
// createAggregateRequest the users input for creating an Aggregate
1515
type createAggregateRequest struct {
16-
Name string `structs:"name"`
17-
WorkingEnvironmentID string `structs:"workingEnvironmentId"`
18-
NumberOfDisks int `structs:"numberOfDisks"`
19-
DiskSize diskSize `structs:"diskSize"`
20-
HomeNode string `structs:"homeNode,omitempty"`
21-
ProviderVolumeType string `structs:"providerVolumeType,omitempty"`
22-
CapacityTier string `structs:"capacityTier,omitempty"`
23-
Iops int `structs:"iops,omitempty"`
24-
Throughput int `structs:"throughput,omitempty"`
16+
Name string `structs:"name"`
17+
WorkingEnvironmentID string `structs:"workingEnvironmentId"`
18+
NumberOfDisks int `structs:"numberOfDisks,omitempty"`
19+
DiskSize diskSize `structs:"diskSize,omitempty"`
20+
HomeNode string `structs:"homeNode,omitempty"`
21+
ProviderVolumeType string `structs:"providerVolumeType,omitempty"`
22+
CapacityTier string `structs:"capacityTier,omitempty"`
23+
Iops int `structs:"iops,omitempty"`
24+
Throughput int `structs:"throughput,omitempty"`
25+
InitialEvAggregateSize diskSize `structs:"initialEvAggregateSize,omitempty"`
2526
}
2627

2728
// diskSize struct
@@ -107,6 +108,12 @@ type updateAggregateRequest struct {
107108
NumberOfDisks int `structs:"numberOfDisks"`
108109
}
109110

111+
type increaseAggregateCapacityRequest struct {
112+
WorkingEnvironmentID string `structs:"workingEnvironmentId"`
113+
AggregateName string `structs:"aggregateName"`
114+
CapacityToAdd diskSize `structs:"capacityToAdd"`
115+
}
116+
110117
// get aggregate by workingEnvironmentId+aggregate name
111118
func (c *Client) getAggregate(request aggregateRequest, name string, sourceWorkingEnvironmentType string, clientID string, isSaaS bool, connectorIP string) (aggregateResult, error) {
112119
log.Printf("getAggregate %s", name)
@@ -311,6 +318,53 @@ func (c *Client) updateAggregate(request updateAggregateRequest, clientID string
311318
return err
312319
}
313320

321+
// increaseAggregateCapacity increases the capacity of an aggregate using Amazon EBS Elastic Volumes
322+
func (c *Client) increaseAggregateCapacity(request increaseAggregateCapacityRequest, clientID string, isSaaS bool, connectorIP string) error {
323+
log.Printf("increaseAggregateCapacity for aggregate %s by %d %s", request.AggregateName, request.CapacityToAdd.Size, request.CapacityToAdd.Unit)
324+
325+
params := structs.Map(request)
326+
hostType := "CloudManagerHost"
327+
if !isSaaS {
328+
hostType = "http://" + connectorIP
329+
}
330+
331+
var baseURL string
332+
rootURL, cloudProviderName, err := c.getAPIRoot(request.WorkingEnvironmentID, clientID, isSaaS, connectorIP)
333+
334+
if err != nil {
335+
log.Print("increaseAggregateCapacity: Cannot get API root.")
336+
return err
337+
}
338+
339+
// Only AWS supports aggregate capacity increase
340+
if cloudProviderName != "Amazon" {
341+
return fmt.Errorf("aggregate capacity increase is currently only supported for AWS")
342+
}
343+
344+
// Build the API endpoint using the root URL from getAPIRoot
345+
baseURL = fmt.Sprintf("%s/aggregates/%s/%s/add-capacity", rootURL, request.WorkingEnvironmentID, request.AggregateName)
346+
347+
statusCode, response, onCloudRequestID, err := c.CallAPIMethod("POST", baseURL, params, c.Token, hostType, clientID)
348+
if err != nil {
349+
log.Print("increaseAggregateCapacity request failed")
350+
return err
351+
}
352+
353+
responseError := apiResponseChecker(statusCode, response, "increaseAggregateCapacity")
354+
if responseError != nil {
355+
return responseError
356+
}
357+
358+
log.Print("Wait for aggregate capacity increase.")
359+
if isSaaS {
360+
err = c.waitOnCompletion(onCloudRequestID, "Aggregate", "increase capacity", 15, 60, clientID)
361+
} else {
362+
err = c.waitOnCompletionForNotSaas(onCloudRequestID, "Aggregate", "increase capacity", 15, 60, clientID, connectorIP)
363+
}
364+
365+
return err
366+
}
367+
314368
// flattenCapacity: convert struct size + unit
315369
func flattenCapacity(c capacity) interface{} {
316370
flattened := make(map[string]interface{})

cloudmanager/cbs.go

Lines changed: 9 additions & 56 deletions
Original file line numberDiff line numberDiff line change
@@ -10,22 +10,19 @@ import (
1010
)
1111

1212
type cbsRequest struct {
13-
Provider string `structs:"provider"`
14-
Region string `structs:"region"`
15-
Aws awsDetails `structs:"aws,omitempty"`
16-
Azure azureDetails `structs:"azure,omitempty"`
17-
Gcp gcpDetails `structs:"gcp,omitempty"`
18-
// Sgws
19-
// ontap-s3
13+
Provider string `structs:"provider"`
14+
Region string `structs:"region"`
15+
Aws awsDetails `structs:"aws,omitempty"`
16+
Azure azureDetails `structs:"azure,omitempty"`
17+
Gcp gcpDetails `structs:"gcp,omitempty"`
2018
Bucket string `structs:"bucket,omitempty"`
2119
IPSpace string `structs:"ip-space,omitempty"`
2220
BackupPolicy backupPolicy `structs:"backup-policy"`
23-
AutoBackupEnabled bool `structs:"auto-backup-enabled,omitempty"`
21+
AutoBackupEnabled bool `structs:"auto-backup-enabled"`
2422
MaxTransferRate int `structs:"max-transfer-rate,omitempty"`
25-
ExportExistingSnapshots bool `structs:"export-existing-snapshots,omitempty"`
26-
27-
WorkingEnvironmentID string `structs:"workingEnvironmentId"`
28-
AccountID string `structs:"account-id"`
23+
ExportExistingSnapshots bool `structs:"export-existing-snapshots"`
24+
WorkingEnvironmentID string `structs:"workingEnvironmentId"`
25+
AccountID string `structs:"account-id"`
2926
}
3027

3128
type cbsVolumeRequest struct {
@@ -162,41 +159,6 @@ type fileDetails struct {
162159
FileMtime int `json:"mtime"`
163160
}
164161

165-
// cbsStatusResult for creating a cbs
166-
type cbsStatusResult struct {
167-
Name string `json:"name"`
168-
ID string `json:"id"`
169-
Region string `json:"region"`
170-
Status string `json:"status"`
171-
OntapVersion string `json:"ontap-version"`
172-
BackupEnablementStatus string `json:"backup-enablement-status"`
173-
CBSType string `json:"type"`
174-
CloudProvider string `json:"provider"`
175-
ProviderAccountID string `json:"provider-account-id"`
176-
ProviderAccountName string `json:"provider-account-name"`
177-
Bucket string `json:"bucket"`
178-
ArchiveStorageClass string `json:"archive-storage-class"`
179-
ResourceGroup string `json:"resource-group"`
180-
StorageAccount string `json:"storage-account"`
181-
StorageServer string `json:"storage-server"`
182-
UsedCapacityGb string `json:"used-capacity-gb"`
183-
ChargingCapacity string `json:"charging-capacity"`
184-
LogicalUsedSize string `json:"logical-used-size"`
185-
BackedUpVolumeCount string `json:"backed-up-volume-count"`
186-
TotalVolumesCount string `json:"total-volumes-count"`
187-
BackupPolicyCount string `json:"backup-policy-count"`
188-
FailedBackupVolumeCount string `json:"failed-backup-volume-count"`
189-
CatalogEnabled bool `json:"catalog-enabled"`
190-
AutoBackupEnabled bool `json:"auto-backup-enabled"`
191-
BackupPolicy backupPolicyResult `json:"backup-policy"`
192-
PrivateEndpointRequired bool `json:"private-endpoint-required"`
193-
License licenseResult `json:"license"`
194-
IPSpace string `json:"ip-space"`
195-
ProviderAccessKey string `json:"provider-access-key"`
196-
DeleteYearlySnapshots bool `json:"delete-yearly-snapshots"`
197-
ExportExistingSnapshots bool `json:"export-existing-snapshots"`
198-
}
199-
200162
type backupPolicyResult struct {
201163
Name string `json:"name"`
202164
Rules []ruleResult `json:"rule"`
@@ -262,15 +224,6 @@ type cbsVolumeResult struct {
262224
SnapshotCount string `json:"snapshot-count"`
263225
}
264226

265-
type cbsGetSnapshotVolumeResult struct {
266-
Snapshot []cbsSnapshotVolumeResult `json:"snapshot"`
267-
}
268-
269-
type cbsSnapshotVolumeResult struct {
270-
Name string `json:"name"`
271-
ID string `json:"id"`
272-
}
273-
274227
// Create working environment cloud backup
275228
func (c *Client) createCBS(cbs cbsRequest, clientID string) (cbsAPICallResult, error) {
276229
log.Print("createCBS...")

cloudmanager/cvo_aws.go

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@ type createCVOAWSDetails struct {
4444
BackupVolumesToCbs bool `structs:"backupVolumesToCbs"`
4545
EnableCompliance bool `structs:"enableCompliance"`
4646
EnableMonitoring bool `structs:"enableMonitoring"`
47+
OpenSecurityGroup bool `structs:"openSecurityGroup"`
4748
AwsEncryptionParameters awsEncryptionParameters `structs:"awsEncryptionParameters,omitempty"`
4849
AwsTags []userTags `structs:"awsTags,omitempty"`
4950
IsHA bool
@@ -64,7 +65,7 @@ type haParamsAWS struct {
6465
PlatformSerialNumberNode1 string `structs:"platformSerialNumberNode1,omitempty"`
6566
PlatformSerialNumberNode2 string `structs:"platformSerialNumberNode2,omitempty"`
6667
MediatorInstanceProfileName string `structs:"mediatorInstanceProfileName,omitempty"`
67-
MediatorAssignPublicIP bool `structs:"mediatorAssignPublicIP,omitempty"`
68+
MediatorAssignPublicIP bool `structs:"mediatorAssignPublicIP"`
6869
MediatorSecurityGroupID string `structs:"mediatorSecurityGroupId,omitempty"`
6970
RouteTableIds []string `structs:"routeTableIds,omitempty"`
7071
AssumeRoleArn string `structs:"assumeRoleArn,omitempty"`
@@ -364,7 +365,7 @@ func (c *Client) deleteCVO(id string, isHA bool, clientID string) error {
364365

365366
// validateCVOParams validates params
366367
func validateCVOParams(cvoDetails createCVOAWSDetails) error {
367-
if cvoDetails.VsaMetadata.UseLatestVersion == true && cvoDetails.VsaMetadata.OntapVersion != "latest" {
368+
if cvoDetails.VsaMetadata.UseLatestVersion && cvoDetails.VsaMetadata.OntapVersion != "latest" {
368369
return fmt.Errorf("ontap_version parameter not required when having use_latest_version as true")
369370
}
370371

@@ -374,14 +375,14 @@ func validateCVOParams(cvoDetails createCVOAWSDetails) error {
374375
}
375376

376377
// by Node byol license for existing customers
377-
if cvoDetails.IsHA == true && cvoDetails.VsaMetadata.LicenseType == "ha-cot-premium-byol" {
378+
if cvoDetails.IsHA && cvoDetails.VsaMetadata.LicenseType == "ha-cot-premium-byol" {
378379
if cvoDetails.HAParams.PlatformSerialNumberNode1 == "" || cvoDetails.HAParams.PlatformSerialNumberNode2 == "" {
379380
return fmt.Errorf("both platform_serial_number_node1 and platform_serial_number_node2 parameters are required when having ha type as true and license_type as ha-cot-premium-byol")
380381
}
381382
}
382383

383384
// by Node byol license for existing customers
384-
if cvoDetails.IsHA == false && (cvoDetails.HAParams.PlatformSerialNumberNode1 != "" || cvoDetails.HAParams.PlatformSerialNumberNode2 != "") {
385+
if !cvoDetails.IsHA && (cvoDetails.HAParams.PlatformSerialNumberNode1 != "" || cvoDetails.HAParams.PlatformSerialNumberNode2 != "") {
385386
return fmt.Errorf("both platform_serial_number_node1 and platform_serial_number_node2 parameters are only required when having ha type as true and license_type as ha-cot-premium-byol")
386387
}
387388

@@ -397,17 +398,17 @@ func validateCVOParams(cvoDetails createCVOAWSDetails) error {
397398
return fmt.Errorf("throughput parameter required when ebs_volume_type is gp3")
398399
}
399400

400-
if cvoDetails.IsHA == true && cvoDetails.SubnetID != "" {
401+
if cvoDetails.IsHA && cvoDetails.SubnetID != "" {
401402
return fmt.Errorf("subnet_id not required when having ha as true")
402403
}
403404

404405
// by Capacity license
405406
if cvoDetails.VsaMetadata.CapacityPackageName != "" {
406407
log.Print("Verify cvo parameter capacity_package_name is not empty")
407-
if cvoDetails.IsHA == true && cvoDetails.VsaMetadata.LicenseType != "ha-capacity-paygo" {
408+
if cvoDetails.IsHA && cvoDetails.VsaMetadata.LicenseType != "ha-capacity-paygo" {
408409
return fmt.Errorf("license_type must be ha-capacity-paygo")
409410
}
410-
if cvoDetails.IsHA == false && cvoDetails.VsaMetadata.LicenseType != "capacity-paygo" {
411+
if !cvoDetails.IsHA && cvoDetails.VsaMetadata.LicenseType != "capacity-paygo" {
411412
return fmt.Errorf("license_type must be capacity-paygo")
412413
}
413414
}

cloudmanager/cvo_azure.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,8 @@ type createCVOAzureDetails struct {
4343
BackupVolumesToCbs bool `structs:"backupVolumesToCbs"`
4444
EnableCompliance bool `structs:"enableCompliance"`
4545
EnableMonitoring bool `structs:"enableMonitoring"`
46-
AllowDeployInExistingRg bool `structs:"allowDeployInExistingRg,omitempty"`
46+
AllowDeployInExistingRg bool `structs:"allowDeployInExistingRg"`
47+
OpenSecurityGroup bool `structs:"openSecurityGroup"`
4748
AzureTags []userTags `structs:"azureTags,omitempty"`
4849
IsHA bool
4950
ResourceGroup string `structs:"resourceGroup,omitempty"`

cloudmanager/data_source_netapp_cloudmanager_aws_fsx.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@ func dataSourceAWSFSX() *schema.Resource {
1818
"id": {
1919
Type: schema.TypeString,
2020
Required: true,
21-
ForceNew: true,
2221
},
2322
"status": {
2423
Type: schema.TypeString,

cloudmanager/data_source_netapp_cloudmanager_nss_account.go

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,17 +15,14 @@ func dataSourceCVONssAccount() *schema.Resource {
1515
"username": {
1616
Type: schema.TypeString,
1717
Required: true,
18-
ForceNew: true,
1918
},
2019
"password": {
2120
Type: schema.TypeString,
2221
Optional: true,
23-
ForceNew: true,
2422
},
2523
"client_id": {
2624
Type: schema.TypeString,
2725
Required: true,
28-
ForceNew: true,
2926
},
3027
},
3128
}

cloudmanager/gcp_volume.go

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ type gcpVolumeResponse struct {
7070
LifeCycleStateDetails string `json:"lifeCycleStateDetails"`
7171
Zone string `json:"zone,omitempty"`
7272
StorageClass string `json:"storageClass,omitempty"`
73-
TypeDP bool `json:"isDataProtection,omitempty"`
73+
TypeDP bool `json:"isDataProtection"`
7474
MountPoints []mountPoints `json:"mountPoints,omitempty"`
7575
}
7676

@@ -264,7 +264,6 @@ func expandExportPolicy(set *schema.Set) []exportPolicyRule {
264264
log.Printf("here here here here : %#v", v)
265265
rules := v.(map[string]interface{})
266266
ruleSet := rules["rule"].(*schema.Set).List()
267-
ruleConfigs := make([]exportPolicyRule, 0, len(ruleSet))
268267
for _, x := range ruleSet {
269268
exportPolicyRule := exportPolicyRule{}
270269
ruleConfig := x.(map[string]interface{})
@@ -274,7 +273,6 @@ func expandExportPolicy(set *schema.Set) []exportPolicyRule {
274273
exportPolicyRule.UnixReadWrite = ruleConfig["unix_read_write"].(bool)
275274
exportPolicyRule.Nfsv3 = ruleConfig["nfsv3"].(bool)
276275
exportPolicyRule.Nfsv4 = ruleConfig["nfsv4"].(bool)
277-
ruleConfigs = append(ruleConfigs, exportPolicyRule)
278276
exportPolicy.Rules = append(exportPolicy.Rules, exportPolicyRule)
279277
}
280278
}

0 commit comments

Comments
 (0)