Skip to content

Commit

Permalink
Merge pull request #187 from NetApp/integration/main
Browse files Browse the repository at this point in the history
Integration/main
  • Loading branch information
wenjun666 authored Feb 13, 2024
2 parents 2ee1ed9 + e988598 commit 93014e3
Show file tree
Hide file tree
Showing 5 changed files with 34 additions and 7 deletions.
7 changes: 6 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,12 @@
## 24.1.0
NEW ENHANCEMENTS:
* resource/cvo_gcp: fix typo on vpc3_firewall_rule_tag_name.
* add logging to API calls.


## 23.11.0
*ENHANCEMENTS: add retries when http returns >200 status code in getWorkingEnvironmentProperties.


## 23.10.0
BUG FIXES:
* resource/aws_fsx: handling for a situation in which the status does not exist yet.
Expand Down
4 changes: 3 additions & 1 deletion cloudmanager/cloudmanager/restapi/client.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package restapi

import (
"bytes"
"errors"
"io/ioutil"
"log"
Expand Down Expand Up @@ -51,11 +52,11 @@ func (c *Client) Do(baseURL string, hostType string, token string, paramsNil boo
host = c.GCPCompute
gcpType = true
}

httpReq, err := req.BuildHTTPReq(host, token, c.Audience, baseURL, paramsNil, accountID, clientID, gcpType, simulator)
if err != nil {
return statusCode, res, onCloudRequestID, err
}
log.Printf("Sending HTTP request: %s %s %#v", httpReq.Method, httpReq.URL.String(), map[string]interface{}{"body": req.Params})
httpRes, err := c.httpClient.Do(httpReq)
if err != nil {
log.Print("HTTP req failed")
Expand All @@ -80,5 +81,6 @@ func (c *Client) Do(baseURL string, hostType string, token string, paramsNil boo
}

statusCode = httpRes.StatusCode
log.Printf("received: %s %s %d %#v", req.Method, httpReq.URL.String(), statusCode, bytes.NewBuffer(res).String())
return statusCode, res, onCloudRequestID, nil
}
1 change: 0 additions & 1 deletion cloudmanager/cvo_gcp.go
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,6 @@ func (c *Client) deleteCVOGCP(id string, isHA bool, clientID string) error {
baseURL := getAPIRootForWorkingEnvironment(isHA, id)

hostType := "CloudManagerHost"

statusCode, response, onCloudRequestID, err := c.CallAPIMethod("DELETE", baseURL, nil, c.Token, hostType, clientID)
if err != nil {
log.Printf("deleteCVO %s request failed %#v", id, statusCode)
Expand Down
3 changes: 1 addition & 2 deletions cloudmanager/resource_netapp_cloudmanager_cvo_gcp.go
Original file line number Diff line number Diff line change
Expand Up @@ -337,7 +337,7 @@ func resourceCVOGCP() *schema.Resource {
Optional: true,
ForceNew: true,
},
"vpc3_firewall_rule_ntag_ame": {
"vpc3_firewall_rule_tag_name": {
Type: schema.TypeString,
Optional: true,
ForceNew: true,
Expand Down Expand Up @@ -678,7 +678,6 @@ func resourceCVOGCPDelete(d *schema.ResourceData, meta interface{}) error {
id := d.Id()
clientID := d.Get("client_id").(string)
isHA := d.Get("is_ha").(bool)

deleteErr := client.deleteCVOGCP(id, isHA, clientID)
if deleteErr != nil {
log.Print("Error deleting cvo")
Expand Down
26 changes: 24 additions & 2 deletions website/docs/r/cvo_volume.html.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@ resource "netapp-cloudmanager_volume" "cvo-volume-nfs" {
export_policy_type = "custom"
export_policy_ip = ["0.0.0.0/0"]
export_policy_nfs_version = ["nfs4"]
export_policy_rule_access_control = "readwrite"
export_policy_rule_super_user = true
snapshot_policy_name = "sp1"
snapshot_policy {
schedule {
Expand Down Expand Up @@ -83,6 +85,23 @@ resource "netapp-cloudmanager_volume" "cvo-volume-iscsi" {
}
```

**Create netapp-cloudmanager_volume on OnPrem:**

```
resource "netapp-cloudmanager_volume" "cvo-volume-onprem" {
provider = netapp-cloudmanager
name = "onprem_test_vol"
volume_protocol = "nfs"
provider_volume_type = "onprem"
size = 10
unit = "GB"
export_policy_type = "custom"
export_policy_ip = ["0.0.0.0/0"]
svm_name = "test_onprem"
working_environment_name = "cvo-name"
client_id = netapp-cloudmanager_connector_gcp.cm-gcp.client_id
}
```

## Argument Reference

Expand All @@ -97,15 +116,18 @@ The following arguments are supported:
* `enable_thin_provisioning` - (Optional) Enable thin provisioning.
* `enable_compression` - (Optional) Enable compression.
* `enable_deduplication` - (Optional) Enable deduplication.
* `aggregate_name ` - (Optional) The aggregate in which the volume will be created. If not provided, Cloud Manager chooses the best aggregate for you.
* `aggregate_name ` - (Optional) The aggregate in which the volume will be created. If not provided, Cloud Manager chooses the best aggregate for you. For OnPrem, aggregate input is required.
* `volume_protocol` - (Optional) The protocol for the volume: ['nfs', 'cifs', 'iscsi']. This affects the provided parameters. The default is 'nfs'
* `working_environment_id` - (Optional) The public ID of the working environment where the volume will be created. The ID can be optional if working_environment_name is provided. You can find the ID from the previous create Cloud Volumes ONTAP action as shown in the example, or from the Information page of the Cloud Volumes ONTAP working environment on [https://console.bluexp.netapp.com/](https://console.bluexp.netapp.com/).
* `working_environment_name` - (Optional) The working environment name where the aggregate will be created. It will be ignored if working_environment_id is provided.
* `capacity_tier` - (Optional) The volume's capacity tier for tiering cold data to object storage: ['S3', 'Blob', 'cloudStorage']. The default values for each cloud provider are as follows: Amazon => 'S3', Azure => 'Blob', GCP => 'cloudStorage'. If none, the capacity tier won't be set on volume creation.
* `export_policy_name` - (Optional) The export policy name. (NFS protocol parameters)
* `export__policy_type` - (Optional) The export policy type. (NFS protocol parameters)
* `export_policy_ip` - (Optional) Custom export policy list of IPs. (NFS protocol parameters)
* `export_policy_ip` - (Optional) Custom export policy list of IPs. Order matters. (NFS protocol parameters)
* `export_policy_nfs_version` - (Optional) Export policy protocol. (NFS protocol parameters)
* `export_policy_rule_access_control` (Optional) Choice of 'readonly', 'readwrite', 'none'. (NFS protocol parameters)
* `export_policy_rule_super_user` - (Optional) Boolean option to sepecify super user or not. (NFS protocol parameters)
`export__policy_type`, `export_policy_ip`, `export_policy_nfs_version`, `export_policy_nfs_version` and `export_policy_rule_super_user` are required together for export policy.
* `snapshot_policy_name` - (Optional) Snapshot policy name. The default is 'default'. (NFS protocol parameters)
* `iops` - (Optional) Provisioned IOPS. Needed only when 'provider_volume_type' is 'io1' or 'gp3'
* `throughput` - (Optional) Required only when 'provider_volume_type' is 'gp3'.
Expand Down

0 comments on commit 93014e3

Please sign in to comment.