diff --git a/services/netapp/mgmt/2019-05-01/netapp/CHANGELOG.md b/services/netapp/mgmt/2019-05-01/netapp/CHANGELOG.md
index 52911e4cc5e4..a1ecf841edb0 100644
--- a/services/netapp/mgmt/2019-05-01/netapp/CHANGELOG.md
+++ b/services/netapp/mgmt/2019-05-01/netapp/CHANGELOG.md
@@ -1,2 +1,2 @@
-# Change History
+# Unreleased
diff --git a/services/netapp/mgmt/2019-05-01/netapp/_meta.json b/services/netapp/mgmt/2019-05-01/netapp/_meta.json
index 90e99d6f3951..2270be500234 100644
--- a/services/netapp/mgmt/2019-05-01/netapp/_meta.json
+++ b/services/netapp/mgmt/2019-05-01/netapp/_meta.json
@@ -1,5 +1,5 @@
{
- "commit": "3c764635e7d442b3e74caf593029fcd440b3ef82",
+ "commit": "ed4b29fbceaea3cc48f039826db5a92360bc7c56",
"readme": "/_/azure-rest-api-specs/specification/netapp/resource-manager/readme.md",
"tag": "package-netapp-2019-05-01",
"use": "@microsoft.azure/autorest.go@2.1.187",
diff --git a/services/netapp/mgmt/2019-05-01/netapp/accounts.go b/services/netapp/mgmt/2019-05-01/netapp/accounts.go
index 95086c33a2c4..e9d1c5c7336e 100644
--- a/services/netapp/mgmt/2019-05-01/netapp/accounts.go
+++ b/services/netapp/mgmt/2019-05-01/netapp/accounts.go
@@ -15,7 +15,7 @@ import (
"net/http"
)
-// AccountsClient is the microsoft NetApp Azure Resource Provider specification
+// AccountsClient is the microsoft NetApp Files Azure Resource Provider specification
type AccountsClient struct {
BaseClient
}
diff --git a/services/netapp/mgmt/2019-05-01/netapp/client.go b/services/netapp/mgmt/2019-05-01/netapp/client.go
index 2ea4dc4ae0eb..0410b80ec1b9 100644
--- a/services/netapp/mgmt/2019-05-01/netapp/client.go
+++ b/services/netapp/mgmt/2019-05-01/netapp/client.go
@@ -1,6 +1,6 @@
// Package netapp implements the Azure ARM Netapp service API version 2019-05-01.
//
-// Microsoft NetApp Azure Resource Provider specification
+// Microsoft NetApp Files Azure Resource Provider specification
package netapp
// Copyright (c) Microsoft Corporation. All rights reserved.
diff --git a/services/netapp/mgmt/2019-05-01/netapp/mounttargets.go b/services/netapp/mgmt/2019-05-01/netapp/mounttargets.go
index 610ce6ea0cc7..d37f5e32d264 100644
--- a/services/netapp/mgmt/2019-05-01/netapp/mounttargets.go
+++ b/services/netapp/mgmt/2019-05-01/netapp/mounttargets.go
@@ -15,7 +15,7 @@ import (
"net/http"
)
-// MountTargetsClient is the microsoft NetApp Azure Resource Provider specification
+// MountTargetsClient is the microsoft NetApp Files Azure Resource Provider specification
type MountTargetsClient struct {
BaseClient
}
diff --git a/services/netapp/mgmt/2019-05-01/netapp/operations.go b/services/netapp/mgmt/2019-05-01/netapp/operations.go
index e85c2a74f37d..1195087e58b4 100644
--- a/services/netapp/mgmt/2019-05-01/netapp/operations.go
+++ b/services/netapp/mgmt/2019-05-01/netapp/operations.go
@@ -14,7 +14,7 @@ import (
"net/http"
)
-// OperationsClient is the microsoft NetApp Azure Resource Provider specification
+// OperationsClient is the microsoft NetApp Files Azure Resource Provider specification
type OperationsClient struct {
BaseClient
}
diff --git a/services/netapp/mgmt/2019-05-01/netapp/pools.go b/services/netapp/mgmt/2019-05-01/netapp/pools.go
index df8470723cc9..ffb0500aa8d1 100644
--- a/services/netapp/mgmt/2019-05-01/netapp/pools.go
+++ b/services/netapp/mgmt/2019-05-01/netapp/pools.go
@@ -15,7 +15,7 @@ import (
"net/http"
)
-// PoolsClient is the microsoft NetApp Azure Resource Provider specification
+// PoolsClient is the microsoft NetApp Files Azure Resource Provider specification
type PoolsClient struct {
BaseClient
}
diff --git a/services/netapp/mgmt/2019-05-01/netapp/snapshots.go b/services/netapp/mgmt/2019-05-01/netapp/snapshots.go
index 9fef84f2cd4d..b75ca24ae13d 100644
--- a/services/netapp/mgmt/2019-05-01/netapp/snapshots.go
+++ b/services/netapp/mgmt/2019-05-01/netapp/snapshots.go
@@ -15,7 +15,7 @@ import (
"net/http"
)
-// SnapshotsClient is the microsoft NetApp Azure Resource Provider specification
+// SnapshotsClient is the microsoft NetApp Files Azure Resource Provider specification
type SnapshotsClient struct {
BaseClient
}
@@ -38,7 +38,7 @@ func NewSnapshotsClientWithBaseURI(baseURI string, subscriptionID string) Snapsh
// accountName - the name of the NetApp account
// poolName - the name of the capacity pool
// volumeName - the name of the volume
-// snapshotName - the name of the mount target
+// snapshotName - the name of the snapshot
func (client SnapshotsClient) Create(ctx context.Context, body Snapshot, resourceGroupName string, accountName string, poolName string, volumeName string, snapshotName string) (result SnapshotsCreateFuture, err error) {
if tracing.IsEnabled() {
ctx = tracing.StartSpan(ctx, fqdn+"/SnapshotsClient.Create")
@@ -150,7 +150,7 @@ func (client SnapshotsClient) CreateResponder(resp *http.Response) (result Snaps
// accountName - the name of the NetApp account
// poolName - the name of the capacity pool
// volumeName - the name of the volume
-// snapshotName - the name of the mount target
+// snapshotName - the name of the snapshot
func (client SnapshotsClient) Delete(ctx context.Context, resourceGroupName string, accountName string, poolName string, volumeName string, snapshotName string) (result SnapshotsDeleteFuture, err error) {
if tracing.IsEnabled() {
ctx = tracing.StartSpan(ctx, fqdn+"/SnapshotsClient.Delete")
@@ -242,7 +242,7 @@ func (client SnapshotsClient) DeleteResponder(resp *http.Response) (result autor
// accountName - the name of the NetApp account
// poolName - the name of the capacity pool
// volumeName - the name of the volume
-// snapshotName - the name of the mount target
+// snapshotName - the name of the snapshot
func (client SnapshotsClient) Get(ctx context.Context, resourceGroupName string, accountName string, poolName string, volumeName string, snapshotName string) (result Snapshot, err error) {
if tracing.IsEnabled() {
ctx = tracing.StartSpan(ctx, fqdn+"/SnapshotsClient.Get")
@@ -421,7 +421,7 @@ func (client SnapshotsClient) ListResponder(resp *http.Response) (result Snapsho
// accountName - the name of the NetApp account
// poolName - the name of the capacity pool
// volumeName - the name of the volume
-// snapshotName - the name of the mount target
+// snapshotName - the name of the snapshot
func (client SnapshotsClient) Update(ctx context.Context, body SnapshotPatch, resourceGroupName string, accountName string, poolName string, volumeName string, snapshotName string) (result Snapshot, err error) {
if tracing.IsEnabled() {
ctx = tracing.StartSpan(ctx, fqdn+"/SnapshotsClient.Update")
diff --git a/services/netapp/mgmt/2019-05-01/netapp/volumes.go b/services/netapp/mgmt/2019-05-01/netapp/volumes.go
index baf2e26497e6..cf27d0eff4dc 100644
--- a/services/netapp/mgmt/2019-05-01/netapp/volumes.go
+++ b/services/netapp/mgmt/2019-05-01/netapp/volumes.go
@@ -15,7 +15,7 @@ import (
"net/http"
)
-// VolumesClient is the microsoft NetApp Azure Resource Provider specification
+// VolumesClient is the microsoft NetApp Files Azure Resource Provider specification
type VolumesClient struct {
BaseClient
}
diff --git a/services/netapp/mgmt/2019-06-01/netapp/CHANGELOG.md b/services/netapp/mgmt/2019-06-01/netapp/CHANGELOG.md
index 52911e4cc5e4..a1ecf841edb0 100644
--- a/services/netapp/mgmt/2019-06-01/netapp/CHANGELOG.md
+++ b/services/netapp/mgmt/2019-06-01/netapp/CHANGELOG.md
@@ -1,2 +1,2 @@
-# Change History
+# Unreleased
diff --git a/services/netapp/mgmt/2019-06-01/netapp/_meta.json b/services/netapp/mgmt/2019-06-01/netapp/_meta.json
index 9328948f1f9a..56f4bdebfbd9 100644
--- a/services/netapp/mgmt/2019-06-01/netapp/_meta.json
+++ b/services/netapp/mgmt/2019-06-01/netapp/_meta.json
@@ -1,5 +1,5 @@
{
- "commit": "3c764635e7d442b3e74caf593029fcd440b3ef82",
+ "commit": "ed4b29fbceaea3cc48f039826db5a92360bc7c56",
"readme": "/_/azure-rest-api-specs/specification/netapp/resource-manager/readme.md",
"tag": "package-netapp-2019-06-01",
"use": "@microsoft.azure/autorest.go@2.1.187",
diff --git a/services/netapp/mgmt/2019-06-01/netapp/accounts.go b/services/netapp/mgmt/2019-06-01/netapp/accounts.go
index aa1abc6a1348..e3405eac2224 100644
--- a/services/netapp/mgmt/2019-06-01/netapp/accounts.go
+++ b/services/netapp/mgmt/2019-06-01/netapp/accounts.go
@@ -15,7 +15,7 @@ import (
"net/http"
)
-// AccountsClient is the microsoft NetApp Azure Resource Provider specification
+// AccountsClient is the microsoft NetApp Files Azure Resource Provider specification
type AccountsClient struct {
BaseClient
}
diff --git a/services/netapp/mgmt/2019-06-01/netapp/client.go b/services/netapp/mgmt/2019-06-01/netapp/client.go
index bba5908f9189..63cad3c6467d 100644
--- a/services/netapp/mgmt/2019-06-01/netapp/client.go
+++ b/services/netapp/mgmt/2019-06-01/netapp/client.go
@@ -1,6 +1,6 @@
// Package netapp implements the Azure ARM Netapp service API version 2019-06-01.
//
-// Microsoft NetApp Azure Resource Provider specification
+// Microsoft NetApp Files Azure Resource Provider specification
package netapp
// Copyright (c) Microsoft Corporation. All rights reserved.
diff --git a/services/netapp/mgmt/2019-06-01/netapp/models.go b/services/netapp/mgmt/2019-06-01/netapp/models.go
index 71b0b7ad9b92..9bebfca7b748 100644
--- a/services/netapp/mgmt/2019-06-01/netapp/models.go
+++ b/services/netapp/mgmt/2019-06-01/netapp/models.go
@@ -1452,7 +1452,7 @@ type VolumeProperties struct {
BaremetalTenantID *string `json:"baremetalTenantId,omitempty"`
// SubnetID - The Azure Resource URI for a delegated subnet. Must have the delegation Microsoft.NetApp/volumes
SubnetID *string `json:"subnetId,omitempty"`
- // MountTargets - List of mount targets
+ // MountTargets - READ-ONLY; List of mount targets
MountTargets *[]MountTargetProperties `json:"mountTargets,omitempty"`
}
@@ -1480,9 +1480,6 @@ func (vp VolumeProperties) MarshalJSON() ([]byte, error) {
if vp.SubnetID != nil {
objectMap["subnetId"] = vp.SubnetID
}
- if vp.MountTargets != nil {
- objectMap["mountTargets"] = vp.MountTargets
- }
return json.Marshal(objectMap)
}
diff --git a/services/netapp/mgmt/2019-06-01/netapp/mounttargets.go b/services/netapp/mgmt/2019-06-01/netapp/mounttargets.go
index 296270151a38..43db2e1cee64 100644
--- a/services/netapp/mgmt/2019-06-01/netapp/mounttargets.go
+++ b/services/netapp/mgmt/2019-06-01/netapp/mounttargets.go
@@ -15,7 +15,7 @@ import (
"net/http"
)
-// MountTargetsClient is the microsoft NetApp Azure Resource Provider specification
+// MountTargetsClient is the microsoft NetApp Files Azure Resource Provider specification
type MountTargetsClient struct {
BaseClient
}
diff --git a/services/netapp/mgmt/2019-06-01/netapp/operations.go b/services/netapp/mgmt/2019-06-01/netapp/operations.go
index b1003c592906..5a398085f7fa 100644
--- a/services/netapp/mgmt/2019-06-01/netapp/operations.go
+++ b/services/netapp/mgmt/2019-06-01/netapp/operations.go
@@ -14,7 +14,7 @@ import (
"net/http"
)
-// OperationsClient is the microsoft NetApp Azure Resource Provider specification
+// OperationsClient is the microsoft NetApp Files Azure Resource Provider specification
type OperationsClient struct {
BaseClient
}
diff --git a/services/netapp/mgmt/2019-06-01/netapp/pools.go b/services/netapp/mgmt/2019-06-01/netapp/pools.go
index 20b6018cd215..1a78c5e75a9f 100644
--- a/services/netapp/mgmt/2019-06-01/netapp/pools.go
+++ b/services/netapp/mgmt/2019-06-01/netapp/pools.go
@@ -15,7 +15,7 @@ import (
"net/http"
)
-// PoolsClient is the microsoft NetApp Azure Resource Provider specification
+// PoolsClient is the microsoft NetApp Files Azure Resource Provider specification
type PoolsClient struct {
BaseClient
}
diff --git a/services/netapp/mgmt/2019-06-01/netapp/snapshots.go b/services/netapp/mgmt/2019-06-01/netapp/snapshots.go
index 49400c26d92c..176f34664087 100644
--- a/services/netapp/mgmt/2019-06-01/netapp/snapshots.go
+++ b/services/netapp/mgmt/2019-06-01/netapp/snapshots.go
@@ -15,7 +15,7 @@ import (
"net/http"
)
-// SnapshotsClient is the microsoft NetApp Azure Resource Provider specification
+// SnapshotsClient is the microsoft NetApp Files Azure Resource Provider specification
type SnapshotsClient struct {
BaseClient
}
@@ -38,7 +38,7 @@ func NewSnapshotsClientWithBaseURI(baseURI string, subscriptionID string) Snapsh
// accountName - the name of the NetApp account
// poolName - the name of the capacity pool
// volumeName - the name of the volume
-// snapshotName - the name of the mount target
+// snapshotName - the name of the snapshot
func (client SnapshotsClient) Create(ctx context.Context, body Snapshot, resourceGroupName string, accountName string, poolName string, volumeName string, snapshotName string) (result SnapshotsCreateFuture, err error) {
if tracing.IsEnabled() {
ctx = tracing.StartSpan(ctx, fqdn+"/SnapshotsClient.Create")
@@ -150,7 +150,7 @@ func (client SnapshotsClient) CreateResponder(resp *http.Response) (result Snaps
// accountName - the name of the NetApp account
// poolName - the name of the capacity pool
// volumeName - the name of the volume
-// snapshotName - the name of the mount target
+// snapshotName - the name of the snapshot
func (client SnapshotsClient) Delete(ctx context.Context, resourceGroupName string, accountName string, poolName string, volumeName string, snapshotName string) (result SnapshotsDeleteFuture, err error) {
if tracing.IsEnabled() {
ctx = tracing.StartSpan(ctx, fqdn+"/SnapshotsClient.Delete")
@@ -242,7 +242,7 @@ func (client SnapshotsClient) DeleteResponder(resp *http.Response) (result autor
// accountName - the name of the NetApp account
// poolName - the name of the capacity pool
// volumeName - the name of the volume
-// snapshotName - the name of the mount target
+// snapshotName - the name of the snapshot
func (client SnapshotsClient) Get(ctx context.Context, resourceGroupName string, accountName string, poolName string, volumeName string, snapshotName string) (result Snapshot, err error) {
if tracing.IsEnabled() {
ctx = tracing.StartSpan(ctx, fqdn+"/SnapshotsClient.Get")
@@ -421,7 +421,7 @@ func (client SnapshotsClient) ListResponder(resp *http.Response) (result Snapsho
// accountName - the name of the NetApp account
// poolName - the name of the capacity pool
// volumeName - the name of the volume
-// snapshotName - the name of the mount target
+// snapshotName - the name of the snapshot
func (client SnapshotsClient) Update(ctx context.Context, body SnapshotPatch, resourceGroupName string, accountName string, poolName string, volumeName string, snapshotName string) (result Snapshot, err error) {
if tracing.IsEnabled() {
ctx = tracing.StartSpan(ctx, fqdn+"/SnapshotsClient.Update")
diff --git a/services/netapp/mgmt/2019-06-01/netapp/volumes.go b/services/netapp/mgmt/2019-06-01/netapp/volumes.go
index 3e7514db0a46..4dfba1723acb 100644
--- a/services/netapp/mgmt/2019-06-01/netapp/volumes.go
+++ b/services/netapp/mgmt/2019-06-01/netapp/volumes.go
@@ -15,7 +15,7 @@ import (
"net/http"
)
-// VolumesClient is the microsoft NetApp Azure Resource Provider specification
+// VolumesClient is the microsoft NetApp Files Azure Resource Provider specification
type VolumesClient struct {
BaseClient
}
diff --git a/services/netapp/mgmt/2019-07-01/netapp/CHANGELOG.md b/services/netapp/mgmt/2019-07-01/netapp/CHANGELOG.md
index 52911e4cc5e4..a1ecf841edb0 100644
--- a/services/netapp/mgmt/2019-07-01/netapp/CHANGELOG.md
+++ b/services/netapp/mgmt/2019-07-01/netapp/CHANGELOG.md
@@ -1,2 +1,2 @@
-# Change History
+# Unreleased
diff --git a/services/netapp/mgmt/2019-07-01/netapp/_meta.json b/services/netapp/mgmt/2019-07-01/netapp/_meta.json
index 0b36cc63df60..97dd83a36945 100644
--- a/services/netapp/mgmt/2019-07-01/netapp/_meta.json
+++ b/services/netapp/mgmt/2019-07-01/netapp/_meta.json
@@ -1,5 +1,5 @@
{
- "commit": "3c764635e7d442b3e74caf593029fcd440b3ef82",
+ "commit": "ed4b29fbceaea3cc48f039826db5a92360bc7c56",
"readme": "/_/azure-rest-api-specs/specification/netapp/resource-manager/readme.md",
"tag": "package-netapp-2019-07-01",
"use": "@microsoft.azure/autorest.go@2.1.187",
diff --git a/services/netapp/mgmt/2019-07-01/netapp/accounts.go b/services/netapp/mgmt/2019-07-01/netapp/accounts.go
index 0b159b0f9290..4789ea1d02a8 100644
--- a/services/netapp/mgmt/2019-07-01/netapp/accounts.go
+++ b/services/netapp/mgmt/2019-07-01/netapp/accounts.go
@@ -15,7 +15,7 @@ import (
"net/http"
)
-// AccountsClient is the microsoft NetApp Azure Resource Provider specification
+// AccountsClient is the microsoft NetApp Files Azure Resource Provider specification
type AccountsClient struct {
BaseClient
}
diff --git a/services/netapp/mgmt/2019-07-01/netapp/client.go b/services/netapp/mgmt/2019-07-01/netapp/client.go
index 758159223918..9ec496cf80e1 100644
--- a/services/netapp/mgmt/2019-07-01/netapp/client.go
+++ b/services/netapp/mgmt/2019-07-01/netapp/client.go
@@ -1,6 +1,6 @@
// Package netapp implements the Azure ARM Netapp service API version 2019-07-01.
//
-// Microsoft NetApp Azure Resource Provider specification
+// Microsoft NetApp Files Azure Resource Provider specification
package netapp
// Copyright (c) Microsoft Corporation. All rights reserved.
diff --git a/services/netapp/mgmt/2019-07-01/netapp/models.go b/services/netapp/mgmt/2019-07-01/netapp/models.go
index 0d855edb1712..6ea92ee6e9cd 100644
--- a/services/netapp/mgmt/2019-07-01/netapp/models.go
+++ b/services/netapp/mgmt/2019-07-01/netapp/models.go
@@ -1442,7 +1442,7 @@ type VolumeProperties struct {
UsageThreshold *int64 `json:"usageThreshold,omitempty"`
// ExportPolicy - Set of export policy rules
ExportPolicy *VolumePropertiesExportPolicy `json:"exportPolicy,omitempty"`
- // ProtocolTypes - Set of protocol types
+ // ProtocolTypes - Set of protocol types, default NFSv3, CIFS fro SMB protocol
ProtocolTypes *[]string `json:"protocolTypes,omitempty"`
// ProvisioningState - READ-ONLY; Azure lifecycle management
ProvisioningState *string `json:"provisioningState,omitempty"`
@@ -1452,7 +1452,7 @@ type VolumeProperties struct {
BaremetalTenantID *string `json:"baremetalTenantId,omitempty"`
// SubnetID - The Azure Resource URI for a delegated subnet. Must have the delegation Microsoft.NetApp/volumes
SubnetID *string `json:"subnetId,omitempty"`
- // MountTargets - List of mount targets
+ // MountTargets - READ-ONLY; List of mount targets
MountTargets *[]MountTargetProperties `json:"mountTargets,omitempty"`
}
@@ -1480,9 +1480,6 @@ func (vp VolumeProperties) MarshalJSON() ([]byte, error) {
if vp.SubnetID != nil {
objectMap["subnetId"] = vp.SubnetID
}
- if vp.MountTargets != nil {
- objectMap["mountTargets"] = vp.MountTargets
- }
return json.Marshal(objectMap)
}
diff --git a/services/netapp/mgmt/2019-07-01/netapp/mounttargets.go b/services/netapp/mgmt/2019-07-01/netapp/mounttargets.go
index 695ea6879de7..ac64629af906 100644
--- a/services/netapp/mgmt/2019-07-01/netapp/mounttargets.go
+++ b/services/netapp/mgmt/2019-07-01/netapp/mounttargets.go
@@ -15,7 +15,7 @@ import (
"net/http"
)
-// MountTargetsClient is the microsoft NetApp Azure Resource Provider specification
+// MountTargetsClient is the microsoft NetApp Files Azure Resource Provider specification
type MountTargetsClient struct {
BaseClient
}
diff --git a/services/netapp/mgmt/2019-07-01/netapp/operations.go b/services/netapp/mgmt/2019-07-01/netapp/operations.go
index 27c1e837f8c6..a079d9e6984b 100644
--- a/services/netapp/mgmt/2019-07-01/netapp/operations.go
+++ b/services/netapp/mgmt/2019-07-01/netapp/operations.go
@@ -14,7 +14,7 @@ import (
"net/http"
)
-// OperationsClient is the microsoft NetApp Azure Resource Provider specification
+// OperationsClient is the microsoft NetApp Files Azure Resource Provider specification
type OperationsClient struct {
BaseClient
}
diff --git a/services/netapp/mgmt/2019-07-01/netapp/pools.go b/services/netapp/mgmt/2019-07-01/netapp/pools.go
index 620679f41ea6..fabd345fd4b9 100644
--- a/services/netapp/mgmt/2019-07-01/netapp/pools.go
+++ b/services/netapp/mgmt/2019-07-01/netapp/pools.go
@@ -15,7 +15,7 @@ import (
"net/http"
)
-// PoolsClient is the microsoft NetApp Azure Resource Provider specification
+// PoolsClient is the microsoft NetApp Files Azure Resource Provider specification
type PoolsClient struct {
BaseClient
}
diff --git a/services/netapp/mgmt/2019-07-01/netapp/snapshots.go b/services/netapp/mgmt/2019-07-01/netapp/snapshots.go
index 0fb75eeca7ab..b9807088f6a6 100644
--- a/services/netapp/mgmt/2019-07-01/netapp/snapshots.go
+++ b/services/netapp/mgmt/2019-07-01/netapp/snapshots.go
@@ -15,7 +15,7 @@ import (
"net/http"
)
-// SnapshotsClient is the microsoft NetApp Azure Resource Provider specification
+// SnapshotsClient is the microsoft NetApp Files Azure Resource Provider specification
type SnapshotsClient struct {
BaseClient
}
@@ -38,7 +38,7 @@ func NewSnapshotsClientWithBaseURI(baseURI string, subscriptionID string) Snapsh
// accountName - the name of the NetApp account
// poolName - the name of the capacity pool
// volumeName - the name of the volume
-// snapshotName - the name of the mount target
+// snapshotName - the name of the snapshot
func (client SnapshotsClient) Create(ctx context.Context, body Snapshot, resourceGroupName string, accountName string, poolName string, volumeName string, snapshotName string) (result SnapshotsCreateFuture, err error) {
if tracing.IsEnabled() {
ctx = tracing.StartSpan(ctx, fqdn+"/SnapshotsClient.Create")
@@ -150,7 +150,7 @@ func (client SnapshotsClient) CreateResponder(resp *http.Response) (result Snaps
// accountName - the name of the NetApp account
// poolName - the name of the capacity pool
// volumeName - the name of the volume
-// snapshotName - the name of the mount target
+// snapshotName - the name of the snapshot
func (client SnapshotsClient) Delete(ctx context.Context, resourceGroupName string, accountName string, poolName string, volumeName string, snapshotName string) (result SnapshotsDeleteFuture, err error) {
if tracing.IsEnabled() {
ctx = tracing.StartSpan(ctx, fqdn+"/SnapshotsClient.Delete")
@@ -242,7 +242,7 @@ func (client SnapshotsClient) DeleteResponder(resp *http.Response) (result autor
// accountName - the name of the NetApp account
// poolName - the name of the capacity pool
// volumeName - the name of the volume
-// snapshotName - the name of the mount target
+// snapshotName - the name of the snapshot
func (client SnapshotsClient) Get(ctx context.Context, resourceGroupName string, accountName string, poolName string, volumeName string, snapshotName string) (result Snapshot, err error) {
if tracing.IsEnabled() {
ctx = tracing.StartSpan(ctx, fqdn+"/SnapshotsClient.Get")
@@ -421,7 +421,7 @@ func (client SnapshotsClient) ListResponder(resp *http.Response) (result Snapsho
// accountName - the name of the NetApp account
// poolName - the name of the capacity pool
// volumeName - the name of the volume
-// snapshotName - the name of the mount target
+// snapshotName - the name of the snapshot
func (client SnapshotsClient) Update(ctx context.Context, body SnapshotPatch, resourceGroupName string, accountName string, poolName string, volumeName string, snapshotName string) (result Snapshot, err error) {
if tracing.IsEnabled() {
ctx = tracing.StartSpan(ctx, fqdn+"/SnapshotsClient.Update")
diff --git a/services/netapp/mgmt/2019-07-01/netapp/volumes.go b/services/netapp/mgmt/2019-07-01/netapp/volumes.go
index 2d44b01b22e4..b009b27bd4f3 100644
--- a/services/netapp/mgmt/2019-07-01/netapp/volumes.go
+++ b/services/netapp/mgmt/2019-07-01/netapp/volumes.go
@@ -15,7 +15,7 @@ import (
"net/http"
)
-// VolumesClient is the microsoft NetApp Azure Resource Provider specification
+// VolumesClient is the microsoft NetApp Files Azure Resource Provider specification
type VolumesClient struct {
BaseClient
}
diff --git a/services/netapp/mgmt/2019-08-01/netapp/CHANGELOG.md b/services/netapp/mgmt/2019-08-01/netapp/CHANGELOG.md
index 52911e4cc5e4..aee6a0bcc1e2 100644
--- a/services/netapp/mgmt/2019-08-01/netapp/CHANGELOG.md
+++ b/services/netapp/mgmt/2019-08-01/netapp/CHANGELOG.md
@@ -1,2 +1,9 @@
-# Change History
+# Unreleased
+## Additive Changes
+
+### Struct Changes
+
+#### New Struct Fields
+
+1. VolumeProperties.UsedBytes
diff --git a/services/netapp/mgmt/2019-08-01/netapp/_meta.json b/services/netapp/mgmt/2019-08-01/netapp/_meta.json
index 580e9fd000ba..6c0476d8d76b 100644
--- a/services/netapp/mgmt/2019-08-01/netapp/_meta.json
+++ b/services/netapp/mgmt/2019-08-01/netapp/_meta.json
@@ -1,5 +1,5 @@
{
- "commit": "3c764635e7d442b3e74caf593029fcd440b3ef82",
+ "commit": "ed4b29fbceaea3cc48f039826db5a92360bc7c56",
"readme": "/_/azure-rest-api-specs/specification/netapp/resource-manager/readme.md",
"tag": "package-netapp-2019-08-01",
"use": "@microsoft.azure/autorest.go@2.1.187",
diff --git a/services/netapp/mgmt/2019-08-01/netapp/accounts.go b/services/netapp/mgmt/2019-08-01/netapp/accounts.go
index 1b65ddd1e0d1..73e5b46889fe 100644
--- a/services/netapp/mgmt/2019-08-01/netapp/accounts.go
+++ b/services/netapp/mgmt/2019-08-01/netapp/accounts.go
@@ -15,7 +15,7 @@ import (
"net/http"
)
-// AccountsClient is the microsoft NetApp Azure Resource Provider specification
+// AccountsClient is the microsoft NetApp Files Azure Resource Provider specification
type AccountsClient struct {
BaseClient
}
diff --git a/services/netapp/mgmt/2019-08-01/netapp/client.go b/services/netapp/mgmt/2019-08-01/netapp/client.go
index a1ddf97db477..b4a078b259b1 100644
--- a/services/netapp/mgmt/2019-08-01/netapp/client.go
+++ b/services/netapp/mgmt/2019-08-01/netapp/client.go
@@ -1,6 +1,6 @@
// Package netapp implements the Azure ARM Netapp service API version 2019-08-01.
//
-// Microsoft NetApp Azure Resource Provider specification
+// Microsoft NetApp Files Azure Resource Provider specification
package netapp
// Copyright (c) Microsoft Corporation. All rights reserved.
diff --git a/services/netapp/mgmt/2019-08-01/netapp/models.go b/services/netapp/mgmt/2019-08-01/netapp/models.go
index 37910d44eb15..b9dbbe9d4133 100644
--- a/services/netapp/mgmt/2019-08-01/netapp/models.go
+++ b/services/netapp/mgmt/2019-08-01/netapp/models.go
@@ -1472,6 +1472,8 @@ type VolumeProperties struct {
ServiceLevel ServiceLevel `json:"serviceLevel,omitempty"`
// UsageThreshold - Maximum storage quota allowed for a file system in bytes. This is a soft quota used for alerting only. Minimum size is 100 GiB. Upper limit is 100TiB. Specified in bytes.
UsageThreshold *int64 `json:"usageThreshold,omitempty"`
+ // UsedBytes - READ-ONLY; Resource size in bytes, current storage usage for the volume in bytes
+ UsedBytes *int64 `json:"usedBytes,omitempty"`
// ExportPolicy - Set of export policy rules
ExportPolicy *VolumePropertiesExportPolicy `json:"exportPolicy,omitempty"`
// ProtocolTypes - Set of protocol types
diff --git a/services/netapp/mgmt/2019-08-01/netapp/mounttargets.go b/services/netapp/mgmt/2019-08-01/netapp/mounttargets.go
index 2c3a032c3799..2f7613af436a 100644
--- a/services/netapp/mgmt/2019-08-01/netapp/mounttargets.go
+++ b/services/netapp/mgmt/2019-08-01/netapp/mounttargets.go
@@ -15,7 +15,7 @@ import (
"net/http"
)
-// MountTargetsClient is the microsoft NetApp Azure Resource Provider specification
+// MountTargetsClient is the microsoft NetApp Files Azure Resource Provider specification
type MountTargetsClient struct {
BaseClient
}
diff --git a/services/netapp/mgmt/2019-08-01/netapp/operations.go b/services/netapp/mgmt/2019-08-01/netapp/operations.go
index aec5f7db6c1b..9042bdb504f8 100644
--- a/services/netapp/mgmt/2019-08-01/netapp/operations.go
+++ b/services/netapp/mgmt/2019-08-01/netapp/operations.go
@@ -14,7 +14,7 @@ import (
"net/http"
)
-// OperationsClient is the microsoft NetApp Azure Resource Provider specification
+// OperationsClient is the microsoft NetApp Files Azure Resource Provider specification
type OperationsClient struct {
BaseClient
}
diff --git a/services/netapp/mgmt/2019-08-01/netapp/pools.go b/services/netapp/mgmt/2019-08-01/netapp/pools.go
index b97f696f7430..ae004e3acc00 100644
--- a/services/netapp/mgmt/2019-08-01/netapp/pools.go
+++ b/services/netapp/mgmt/2019-08-01/netapp/pools.go
@@ -15,7 +15,7 @@ import (
"net/http"
)
-// PoolsClient is the microsoft NetApp Azure Resource Provider specification
+// PoolsClient is the microsoft NetApp Files Azure Resource Provider specification
type PoolsClient struct {
BaseClient
}
diff --git a/services/netapp/mgmt/2019-08-01/netapp/resource.go b/services/netapp/mgmt/2019-08-01/netapp/resource.go
index b4505e57602e..74a08555fa77 100644
--- a/services/netapp/mgmt/2019-08-01/netapp/resource.go
+++ b/services/netapp/mgmt/2019-08-01/netapp/resource.go
@@ -15,7 +15,7 @@ import (
"net/http"
)
-// ResourceClient is the microsoft NetApp Azure Resource Provider specification
+// ResourceClient is the microsoft NetApp Files Azure Resource Provider specification
type ResourceClient struct {
BaseClient
}
diff --git a/services/netapp/mgmt/2019-08-01/netapp/snapshots.go b/services/netapp/mgmt/2019-08-01/netapp/snapshots.go
index ae256bc08608..e1ce10a9a8c3 100644
--- a/services/netapp/mgmt/2019-08-01/netapp/snapshots.go
+++ b/services/netapp/mgmt/2019-08-01/netapp/snapshots.go
@@ -15,7 +15,7 @@ import (
"net/http"
)
-// SnapshotsClient is the microsoft NetApp Azure Resource Provider specification
+// SnapshotsClient is the microsoft NetApp Files Azure Resource Provider specification
type SnapshotsClient struct {
BaseClient
}
@@ -38,7 +38,7 @@ func NewSnapshotsClientWithBaseURI(baseURI string, subscriptionID string) Snapsh
// accountName - the name of the NetApp account
// poolName - the name of the capacity pool
// volumeName - the name of the volume
-// snapshotName - the name of the mount target
+// snapshotName - the name of the snapshot
func (client SnapshotsClient) Create(ctx context.Context, body Snapshot, resourceGroupName string, accountName string, poolName string, volumeName string, snapshotName string) (result SnapshotsCreateFuture, err error) {
if tracing.IsEnabled() {
ctx = tracing.StartSpan(ctx, fqdn+"/SnapshotsClient.Create")
@@ -150,7 +150,7 @@ func (client SnapshotsClient) CreateResponder(resp *http.Response) (result Snaps
// accountName - the name of the NetApp account
// poolName - the name of the capacity pool
// volumeName - the name of the volume
-// snapshotName - the name of the mount target
+// snapshotName - the name of the snapshot
func (client SnapshotsClient) Delete(ctx context.Context, resourceGroupName string, accountName string, poolName string, volumeName string, snapshotName string) (result SnapshotsDeleteFuture, err error) {
if tracing.IsEnabled() {
ctx = tracing.StartSpan(ctx, fqdn+"/SnapshotsClient.Delete")
@@ -242,7 +242,7 @@ func (client SnapshotsClient) DeleteResponder(resp *http.Response) (result autor
// accountName - the name of the NetApp account
// poolName - the name of the capacity pool
// volumeName - the name of the volume
-// snapshotName - the name of the mount target
+// snapshotName - the name of the snapshot
func (client SnapshotsClient) Get(ctx context.Context, resourceGroupName string, accountName string, poolName string, volumeName string, snapshotName string) (result Snapshot, err error) {
if tracing.IsEnabled() {
ctx = tracing.StartSpan(ctx, fqdn+"/SnapshotsClient.Get")
@@ -421,7 +421,7 @@ func (client SnapshotsClient) ListResponder(resp *http.Response) (result Snapsho
// accountName - the name of the NetApp account
// poolName - the name of the capacity pool
// volumeName - the name of the volume
-// snapshotName - the name of the mount target
+// snapshotName - the name of the snapshot
func (client SnapshotsClient) Update(ctx context.Context, body SnapshotPatch, resourceGroupName string, accountName string, poolName string, volumeName string, snapshotName string) (result Snapshot, err error) {
if tracing.IsEnabled() {
ctx = tracing.StartSpan(ctx, fqdn+"/SnapshotsClient.Update")
diff --git a/services/netapp/mgmt/2019-08-01/netapp/volumes.go b/services/netapp/mgmt/2019-08-01/netapp/volumes.go
index 36635c314979..7a362a56607a 100644
--- a/services/netapp/mgmt/2019-08-01/netapp/volumes.go
+++ b/services/netapp/mgmt/2019-08-01/netapp/volumes.go
@@ -15,7 +15,7 @@ import (
"net/http"
)
-// VolumesClient is the microsoft NetApp Azure Resource Provider specification
+// VolumesClient is the microsoft NetApp Files Azure Resource Provider specification
type VolumesClient struct {
BaseClient
}
diff --git a/services/netapp/mgmt/2019-10-01/netapp/CHANGELOG.md b/services/netapp/mgmt/2019-10-01/netapp/CHANGELOG.md
index 52911e4cc5e4..aee6a0bcc1e2 100644
--- a/services/netapp/mgmt/2019-10-01/netapp/CHANGELOG.md
+++ b/services/netapp/mgmt/2019-10-01/netapp/CHANGELOG.md
@@ -1,2 +1,9 @@
-# Change History
+# Unreleased
+## Additive Changes
+
+### Struct Changes
+
+#### New Struct Fields
+
+1. VolumeProperties.UsedBytes
diff --git a/services/netapp/mgmt/2019-10-01/netapp/_meta.json b/services/netapp/mgmt/2019-10-01/netapp/_meta.json
index 6a1e5e312d64..8c264ab46996 100644
--- a/services/netapp/mgmt/2019-10-01/netapp/_meta.json
+++ b/services/netapp/mgmt/2019-10-01/netapp/_meta.json
@@ -1,5 +1,5 @@
{
- "commit": "3c764635e7d442b3e74caf593029fcd440b3ef82",
+ "commit": "ed4b29fbceaea3cc48f039826db5a92360bc7c56",
"readme": "/_/azure-rest-api-specs/specification/netapp/resource-manager/readme.md",
"tag": "package-netapp-2019-10-01",
"use": "@microsoft.azure/autorest.go@2.1.187",
diff --git a/services/netapp/mgmt/2019-10-01/netapp/accounts.go b/services/netapp/mgmt/2019-10-01/netapp/accounts.go
index d6da756210a8..13cc468aa28b 100644
--- a/services/netapp/mgmt/2019-10-01/netapp/accounts.go
+++ b/services/netapp/mgmt/2019-10-01/netapp/accounts.go
@@ -15,7 +15,7 @@ import (
"net/http"
)
-// AccountsClient is the microsoft NetApp Azure Resource Provider specification
+// AccountsClient is the microsoft NetApp Files Azure Resource Provider specification
type AccountsClient struct {
BaseClient
}
diff --git a/services/netapp/mgmt/2019-10-01/netapp/client.go b/services/netapp/mgmt/2019-10-01/netapp/client.go
index 14a4de2ff1ec..0d8c688c5efe 100644
--- a/services/netapp/mgmt/2019-10-01/netapp/client.go
+++ b/services/netapp/mgmt/2019-10-01/netapp/client.go
@@ -1,6 +1,6 @@
// Package netapp implements the Azure ARM Netapp service API version 2019-10-01.
//
-// Microsoft NetApp Azure Resource Provider specification
+// Microsoft NetApp Files Azure Resource Provider specification
package netapp
// Copyright (c) Microsoft Corporation. All rights reserved.
diff --git a/services/netapp/mgmt/2019-10-01/netapp/models.go b/services/netapp/mgmt/2019-10-01/netapp/models.go
index e1484680658a..ff0e4f475901 100644
--- a/services/netapp/mgmt/2019-10-01/netapp/models.go
+++ b/services/netapp/mgmt/2019-10-01/netapp/models.go
@@ -1495,9 +1495,11 @@ type VolumeProperties struct {
ServiceLevel ServiceLevel `json:"serviceLevel,omitempty"`
// UsageThreshold - Maximum storage quota allowed for a file system in bytes. This is a soft quota used for alerting only. Minimum size is 100 GiB. Upper limit is 100TiB. Specified in bytes.
UsageThreshold *int64 `json:"usageThreshold,omitempty"`
+ // UsedBytes - READ-ONLY; Resource size in bytes, current storage usage for the volume in bytes
+ UsedBytes *int64 `json:"usedBytes,omitempty"`
// ExportPolicy - Set of export policy rules
ExportPolicy *VolumePropertiesExportPolicy `json:"exportPolicy,omitempty"`
- // ProtocolTypes - Set of protocol types
+ // ProtocolTypes - Set of protocol types, default NFSv3, CIFS for SMB protocol
ProtocolTypes *[]string `json:"protocolTypes,omitempty"`
// ProvisioningState - READ-ONLY; Azure lifecycle management
ProvisioningState *string `json:"provisioningState,omitempty"`
@@ -1507,7 +1509,7 @@ type VolumeProperties struct {
BaremetalTenantID *string `json:"baremetalTenantId,omitempty"`
// SubnetID - The Azure Resource URI for a delegated subnet. Must have the delegation Microsoft.NetApp/volumes
SubnetID *string `json:"subnetId,omitempty"`
- // MountTargets - List of mount targets
+ // MountTargets - READ-ONLY; List of mount targets
MountTargets *[]MountTargetProperties `json:"mountTargets,omitempty"`
// VolumeType - What type of volume is this
VolumeType *string `json:"volumeType,omitempty"`
@@ -1541,9 +1543,6 @@ func (vp VolumeProperties) MarshalJSON() ([]byte, error) {
if vp.SubnetID != nil {
objectMap["subnetId"] = vp.SubnetID
}
- if vp.MountTargets != nil {
- objectMap["mountTargets"] = vp.MountTargets
- }
if vp.VolumeType != nil {
objectMap["volumeType"] = vp.VolumeType
}
diff --git a/services/netapp/mgmt/2019-10-01/netapp/mounttargets.go b/services/netapp/mgmt/2019-10-01/netapp/mounttargets.go
index d2aee7963f9e..d9c3421e74b6 100644
--- a/services/netapp/mgmt/2019-10-01/netapp/mounttargets.go
+++ b/services/netapp/mgmt/2019-10-01/netapp/mounttargets.go
@@ -15,7 +15,7 @@ import (
"net/http"
)
-// MountTargetsClient is the microsoft NetApp Azure Resource Provider specification
+// MountTargetsClient is the microsoft NetApp Files Azure Resource Provider specification
type MountTargetsClient struct {
BaseClient
}
diff --git a/services/netapp/mgmt/2019-10-01/netapp/operations.go b/services/netapp/mgmt/2019-10-01/netapp/operations.go
index 3b3854834a29..a323337d4896 100644
--- a/services/netapp/mgmt/2019-10-01/netapp/operations.go
+++ b/services/netapp/mgmt/2019-10-01/netapp/operations.go
@@ -14,7 +14,7 @@ import (
"net/http"
)
-// OperationsClient is the microsoft NetApp Azure Resource Provider specification
+// OperationsClient is the microsoft NetApp Files Azure Resource Provider specification
type OperationsClient struct {
BaseClient
}
diff --git a/services/netapp/mgmt/2019-10-01/netapp/pools.go b/services/netapp/mgmt/2019-10-01/netapp/pools.go
index f1c8519bc25a..6c501725ab76 100644
--- a/services/netapp/mgmt/2019-10-01/netapp/pools.go
+++ b/services/netapp/mgmt/2019-10-01/netapp/pools.go
@@ -15,7 +15,7 @@ import (
"net/http"
)
-// PoolsClient is the microsoft NetApp Azure Resource Provider specification
+// PoolsClient is the microsoft NetApp Files Azure Resource Provider specification
type PoolsClient struct {
BaseClient
}
diff --git a/services/netapp/mgmt/2019-10-01/netapp/resource.go b/services/netapp/mgmt/2019-10-01/netapp/resource.go
index 64fc218968f2..558ff182184b 100644
--- a/services/netapp/mgmt/2019-10-01/netapp/resource.go
+++ b/services/netapp/mgmt/2019-10-01/netapp/resource.go
@@ -15,7 +15,7 @@ import (
"net/http"
)
-// ResourceClient is the microsoft NetApp Azure Resource Provider specification
+// ResourceClient is the microsoft NetApp Files Azure Resource Provider specification
type ResourceClient struct {
BaseClient
}
diff --git a/services/netapp/mgmt/2019-10-01/netapp/snapshots.go b/services/netapp/mgmt/2019-10-01/netapp/snapshots.go
index 12058086f80d..72d8ff83790d 100644
--- a/services/netapp/mgmt/2019-10-01/netapp/snapshots.go
+++ b/services/netapp/mgmt/2019-10-01/netapp/snapshots.go
@@ -15,7 +15,7 @@ import (
"net/http"
)
-// SnapshotsClient is the microsoft NetApp Azure Resource Provider specification
+// SnapshotsClient is the microsoft NetApp Files Azure Resource Provider specification
type SnapshotsClient struct {
BaseClient
}
@@ -38,7 +38,7 @@ func NewSnapshotsClientWithBaseURI(baseURI string, subscriptionID string) Snapsh
// accountName - the name of the NetApp account
// poolName - the name of the capacity pool
// volumeName - the name of the volume
-// snapshotName - the name of the mount target
+// snapshotName - the name of the snapshot
func (client SnapshotsClient) Create(ctx context.Context, body Snapshot, resourceGroupName string, accountName string, poolName string, volumeName string, snapshotName string) (result SnapshotsCreateFuture, err error) {
if tracing.IsEnabled() {
ctx = tracing.StartSpan(ctx, fqdn+"/SnapshotsClient.Create")
@@ -150,7 +150,7 @@ func (client SnapshotsClient) CreateResponder(resp *http.Response) (result Snaps
// accountName - the name of the NetApp account
// poolName - the name of the capacity pool
// volumeName - the name of the volume
-// snapshotName - the name of the mount target
+// snapshotName - the name of the snapshot
func (client SnapshotsClient) Delete(ctx context.Context, resourceGroupName string, accountName string, poolName string, volumeName string, snapshotName string) (result SnapshotsDeleteFuture, err error) {
if tracing.IsEnabled() {
ctx = tracing.StartSpan(ctx, fqdn+"/SnapshotsClient.Delete")
@@ -242,7 +242,7 @@ func (client SnapshotsClient) DeleteResponder(resp *http.Response) (result autor
// accountName - the name of the NetApp account
// poolName - the name of the capacity pool
// volumeName - the name of the volume
-// snapshotName - the name of the mount target
+// snapshotName - the name of the snapshot
func (client SnapshotsClient) Get(ctx context.Context, resourceGroupName string, accountName string, poolName string, volumeName string, snapshotName string) (result Snapshot, err error) {
if tracing.IsEnabled() {
ctx = tracing.StartSpan(ctx, fqdn+"/SnapshotsClient.Get")
@@ -421,7 +421,7 @@ func (client SnapshotsClient) ListResponder(resp *http.Response) (result Snapsho
// accountName - the name of the NetApp account
// poolName - the name of the capacity pool
// volumeName - the name of the volume
-// snapshotName - the name of the mount target
+// snapshotName - the name of the snapshot
func (client SnapshotsClient) Update(ctx context.Context, body SnapshotPatch, resourceGroupName string, accountName string, poolName string, volumeName string, snapshotName string) (result Snapshot, err error) {
if tracing.IsEnabled() {
ctx = tracing.StartSpan(ctx, fqdn+"/SnapshotsClient.Update")
diff --git a/services/netapp/mgmt/2019-10-01/netapp/volumes.go b/services/netapp/mgmt/2019-10-01/netapp/volumes.go
index ccf3c8ef5b63..daf92aa6a982 100644
--- a/services/netapp/mgmt/2019-10-01/netapp/volumes.go
+++ b/services/netapp/mgmt/2019-10-01/netapp/volumes.go
@@ -15,7 +15,7 @@ import (
"net/http"
)
-// VolumesClient is the microsoft NetApp Azure Resource Provider specification
+// VolumesClient is the microsoft NetApp Files Azure Resource Provider specification
type VolumesClient struct {
BaseClient
}
@@ -775,7 +775,7 @@ func (client VolumesClient) ReplicationStatusMethodResponder(resp *http.Response
}
// ResyncReplication resync the connection on the destination volume. If the operation is ran on the source volume it
-// will reverse-resync the connection and sync from source to destination.
+// will reverse-resync the connection and sync from destination to source.
// Parameters:
// resourceGroupName - the name of the resource group.
// accountName - the name of the NetApp account
diff --git a/services/netapp/mgmt/2019-11-01/netapp/CHANGELOG.md b/services/netapp/mgmt/2019-11-01/netapp/CHANGELOG.md
index 52911e4cc5e4..aee6a0bcc1e2 100644
--- a/services/netapp/mgmt/2019-11-01/netapp/CHANGELOG.md
+++ b/services/netapp/mgmt/2019-11-01/netapp/CHANGELOG.md
@@ -1,2 +1,9 @@
-# Change History
+# Unreleased
+## Additive Changes
+
+### Struct Changes
+
+#### New Struct Fields
+
+1. VolumeProperties.UsedBytes
diff --git a/services/netapp/mgmt/2019-11-01/netapp/_meta.json b/services/netapp/mgmt/2019-11-01/netapp/_meta.json
index 92c7484d618a..0fa745be7d1e 100644
--- a/services/netapp/mgmt/2019-11-01/netapp/_meta.json
+++ b/services/netapp/mgmt/2019-11-01/netapp/_meta.json
@@ -1,5 +1,5 @@
{
- "commit": "3c764635e7d442b3e74caf593029fcd440b3ef82",
+ "commit": "ed4b29fbceaea3cc48f039826db5a92360bc7c56",
"readme": "/_/azure-rest-api-specs/specification/netapp/resource-manager/readme.md",
"tag": "package-netapp-2019-11-01",
"use": "@microsoft.azure/autorest.go@2.1.187",
diff --git a/services/netapp/mgmt/2019-11-01/netapp/accounts.go b/services/netapp/mgmt/2019-11-01/netapp/accounts.go
index f6795e31271f..a99b773007b5 100644
--- a/services/netapp/mgmt/2019-11-01/netapp/accounts.go
+++ b/services/netapp/mgmt/2019-11-01/netapp/accounts.go
@@ -15,7 +15,7 @@ import (
"net/http"
)
-// AccountsClient is the microsoft NetApp Azure Resource Provider specification
+// AccountsClient is the microsoft NetApp Files Azure Resource Provider specification
type AccountsClient struct {
BaseClient
}
diff --git a/services/netapp/mgmt/2019-11-01/netapp/client.go b/services/netapp/mgmt/2019-11-01/netapp/client.go
index eab2a2a5a124..084b67febde1 100644
--- a/services/netapp/mgmt/2019-11-01/netapp/client.go
+++ b/services/netapp/mgmt/2019-11-01/netapp/client.go
@@ -1,6 +1,6 @@
// Package netapp implements the Azure ARM Netapp service API version 2019-11-01.
//
-// Microsoft NetApp Azure Resource Provider specification
+// Microsoft NetApp Files Azure Resource Provider specification
package netapp
// Copyright (c) Microsoft Corporation. All rights reserved.
diff --git a/services/netapp/mgmt/2019-11-01/netapp/models.go b/services/netapp/mgmt/2019-11-01/netapp/models.go
index d55cf8940a1e..5e64b0d1d914 100644
--- a/services/netapp/mgmt/2019-11-01/netapp/models.go
+++ b/services/netapp/mgmt/2019-11-01/netapp/models.go
@@ -1544,9 +1544,11 @@ type VolumeProperties struct {
ServiceLevel ServiceLevel `json:"serviceLevel,omitempty"`
// UsageThreshold - Maximum storage quota allowed for a file system in bytes. This is a soft quota used for alerting only. Minimum size is 100 GiB. Upper limit is 100TiB. Specified in bytes.
UsageThreshold *int64 `json:"usageThreshold,omitempty"`
+ // UsedBytes - READ-ONLY; Resource size in bytes, current storage usage for the volume in bytes
+ UsedBytes *int64 `json:"usedBytes,omitempty"`
// ExportPolicy - Set of export policy rules
ExportPolicy *VolumePropertiesExportPolicy `json:"exportPolicy,omitempty"`
- // ProtocolTypes - Set of protocol types
+ // ProtocolTypes - Set of protocol types, default NFSv3, CIFS for SMB protocol
ProtocolTypes *[]string `json:"protocolTypes,omitempty"`
// ProvisioningState - READ-ONLY; Azure lifecycle management
ProvisioningState *string `json:"provisioningState,omitempty"`
@@ -1556,7 +1558,7 @@ type VolumeProperties struct {
BaremetalTenantID *string `json:"baremetalTenantId,omitempty"`
// SubnetID - The Azure Resource URI for a delegated subnet. Must have the delegation Microsoft.NetApp/volumes
SubnetID *string `json:"subnetId,omitempty"`
- // MountTargets - List of mount targets
+ // MountTargets - READ-ONLY; List of mount targets
MountTargets *[]MountTargetProperties `json:"mountTargets,omitempty"`
// VolumeType - What type of volume is this
VolumeType *string `json:"volumeType,omitempty"`
@@ -1590,9 +1592,6 @@ func (vp VolumeProperties) MarshalJSON() ([]byte, error) {
if vp.SubnetID != nil {
objectMap["subnetId"] = vp.SubnetID
}
- if vp.MountTargets != nil {
- objectMap["mountTargets"] = vp.MountTargets
- }
if vp.VolumeType != nil {
objectMap["volumeType"] = vp.VolumeType
}
diff --git a/services/netapp/mgmt/2019-11-01/netapp/operations.go b/services/netapp/mgmt/2019-11-01/netapp/operations.go
index 105b6d8f0dda..f2dcc3f2478d 100644
--- a/services/netapp/mgmt/2019-11-01/netapp/operations.go
+++ b/services/netapp/mgmt/2019-11-01/netapp/operations.go
@@ -14,7 +14,7 @@ import (
"net/http"
)
-// OperationsClient is the microsoft NetApp Azure Resource Provider specification
+// OperationsClient is the microsoft NetApp Files Azure Resource Provider specification
type OperationsClient struct {
BaseClient
}
diff --git a/services/netapp/mgmt/2019-11-01/netapp/pools.go b/services/netapp/mgmt/2019-11-01/netapp/pools.go
index c83b6d4726a6..ced8bb028c7f 100644
--- a/services/netapp/mgmt/2019-11-01/netapp/pools.go
+++ b/services/netapp/mgmt/2019-11-01/netapp/pools.go
@@ -15,7 +15,7 @@ import (
"net/http"
)
-// PoolsClient is the microsoft NetApp Azure Resource Provider specification
+// PoolsClient is the microsoft NetApp Files Azure Resource Provider specification
type PoolsClient struct {
BaseClient
}
diff --git a/services/netapp/mgmt/2019-11-01/netapp/resource.go b/services/netapp/mgmt/2019-11-01/netapp/resource.go
index 8ebb0f0ce6b7..7ba8a77909f2 100644
--- a/services/netapp/mgmt/2019-11-01/netapp/resource.go
+++ b/services/netapp/mgmt/2019-11-01/netapp/resource.go
@@ -15,7 +15,7 @@ import (
"net/http"
)
-// ResourceClient is the microsoft NetApp Azure Resource Provider specification
+// ResourceClient is the microsoft NetApp Files Azure Resource Provider specification
type ResourceClient struct {
BaseClient
}
diff --git a/services/netapp/mgmt/2019-11-01/netapp/snapshots.go b/services/netapp/mgmt/2019-11-01/netapp/snapshots.go
index 7de25b0ccefe..b5efa2efb82a 100644
--- a/services/netapp/mgmt/2019-11-01/netapp/snapshots.go
+++ b/services/netapp/mgmt/2019-11-01/netapp/snapshots.go
@@ -15,7 +15,7 @@ import (
"net/http"
)
-// SnapshotsClient is the microsoft NetApp Azure Resource Provider specification
+// SnapshotsClient is the microsoft NetApp Files Azure Resource Provider specification
type SnapshotsClient struct {
BaseClient
}
@@ -38,7 +38,7 @@ func NewSnapshotsClientWithBaseURI(baseURI string, subscriptionID string) Snapsh
// accountName - the name of the NetApp account
// poolName - the name of the capacity pool
// volumeName - the name of the volume
-// snapshotName - the name of the mount target
+// snapshotName - the name of the snapshot
func (client SnapshotsClient) Create(ctx context.Context, body Snapshot, resourceGroupName string, accountName string, poolName string, volumeName string, snapshotName string) (result SnapshotsCreateFuture, err error) {
if tracing.IsEnabled() {
ctx = tracing.StartSpan(ctx, fqdn+"/SnapshotsClient.Create")
@@ -158,7 +158,7 @@ func (client SnapshotsClient) CreateResponder(resp *http.Response) (result Snaps
// accountName - the name of the NetApp account
// poolName - the name of the capacity pool
// volumeName - the name of the volume
-// snapshotName - the name of the mount target
+// snapshotName - the name of the snapshot
func (client SnapshotsClient) Delete(ctx context.Context, resourceGroupName string, accountName string, poolName string, volumeName string, snapshotName string) (result SnapshotsDeleteFuture, err error) {
if tracing.IsEnabled() {
ctx = tracing.StartSpan(ctx, fqdn+"/SnapshotsClient.Delete")
@@ -258,7 +258,7 @@ func (client SnapshotsClient) DeleteResponder(resp *http.Response) (result autor
// accountName - the name of the NetApp account
// poolName - the name of the capacity pool
// volumeName - the name of the volume
-// snapshotName - the name of the mount target
+// snapshotName - the name of the snapshot
func (client SnapshotsClient) Get(ctx context.Context, resourceGroupName string, accountName string, poolName string, volumeName string, snapshotName string) (result Snapshot, err error) {
if tracing.IsEnabled() {
ctx = tracing.StartSpan(ctx, fqdn+"/SnapshotsClient.Get")
@@ -453,7 +453,7 @@ func (client SnapshotsClient) ListResponder(resp *http.Response) (result Snapsho
// accountName - the name of the NetApp account
// poolName - the name of the capacity pool
// volumeName - the name of the volume
-// snapshotName - the name of the mount target
+// snapshotName - the name of the snapshot
func (client SnapshotsClient) Update(ctx context.Context, body interface{}, resourceGroupName string, accountName string, poolName string, volumeName string, snapshotName string) (result SnapshotsUpdateFuture, err error) {
if tracing.IsEnabled() {
ctx = tracing.StartSpan(ctx, fqdn+"/SnapshotsClient.Update")
diff --git a/services/netapp/mgmt/2019-11-01/netapp/volumes.go b/services/netapp/mgmt/2019-11-01/netapp/volumes.go
index b846d09bd0f2..fc440a3599ea 100644
--- a/services/netapp/mgmt/2019-11-01/netapp/volumes.go
+++ b/services/netapp/mgmt/2019-11-01/netapp/volumes.go
@@ -15,7 +15,7 @@ import (
"net/http"
)
-// VolumesClient is the microsoft NetApp Azure Resource Provider specification
+// VolumesClient is the microsoft NetApp Files Azure Resource Provider specification
type VolumesClient struct {
BaseClient
}
@@ -848,7 +848,7 @@ func (client VolumesClient) ReplicationStatusMethodResponder(resp *http.Response
}
// ResyncReplication resync the connection on the destination volume. If the operation is ran on the source volume it
-// will reverse-resync the connection and sync from source to destination.
+// will reverse-resync the connection and sync from from destination to source.
// Parameters:
// resourceGroupName - the name of the resource group.
// accountName - the name of the NetApp account
diff --git a/services/netapp/mgmt/2020-02-01/netapp/CHANGELOG.md b/services/netapp/mgmt/2020-02-01/netapp/CHANGELOG.md
index 52911e4cc5e4..aee6a0bcc1e2 100644
--- a/services/netapp/mgmt/2020-02-01/netapp/CHANGELOG.md
+++ b/services/netapp/mgmt/2020-02-01/netapp/CHANGELOG.md
@@ -1,2 +1,9 @@
-# Change History
+# Unreleased
+## Additive Changes
+
+### Struct Changes
+
+#### New Struct Fields
+
+1. VolumeProperties.UsedBytes
diff --git a/services/netapp/mgmt/2020-02-01/netapp/_meta.json b/services/netapp/mgmt/2020-02-01/netapp/_meta.json
index a9b2ddc00463..e738e1554c68 100644
--- a/services/netapp/mgmt/2020-02-01/netapp/_meta.json
+++ b/services/netapp/mgmt/2020-02-01/netapp/_meta.json
@@ -1,5 +1,5 @@
{
- "commit": "3c764635e7d442b3e74caf593029fcd440b3ef82",
+ "commit": "ed4b29fbceaea3cc48f039826db5a92360bc7c56",
"readme": "/_/azure-rest-api-specs/specification/netapp/resource-manager/readme.md",
"tag": "package-netapp-2020-02-01",
"use": "@microsoft.azure/autorest.go@2.1.187",
diff --git a/services/netapp/mgmt/2020-02-01/netapp/accounts.go b/services/netapp/mgmt/2020-02-01/netapp/accounts.go
index 27a66106a188..2aca253353df 100644
--- a/services/netapp/mgmt/2020-02-01/netapp/accounts.go
+++ b/services/netapp/mgmt/2020-02-01/netapp/accounts.go
@@ -15,7 +15,7 @@ import (
"net/http"
)
-// AccountsClient is the microsoft NetApp Azure Resource Provider specification
+// AccountsClient is the microsoft NetApp Files Azure Resource Provider specification
type AccountsClient struct {
BaseClient
}
diff --git a/services/netapp/mgmt/2020-02-01/netapp/client.go b/services/netapp/mgmt/2020-02-01/netapp/client.go
index 4550404c9dde..921c055ba4ab 100644
--- a/services/netapp/mgmt/2020-02-01/netapp/client.go
+++ b/services/netapp/mgmt/2020-02-01/netapp/client.go
@@ -1,6 +1,6 @@
// Package netapp implements the Azure ARM Netapp service API version 2020-02-01.
//
-// Microsoft NetApp Azure Resource Provider specification
+// Microsoft NetApp Files Azure Resource Provider specification
package netapp
// Copyright (c) Microsoft Corporation. All rights reserved.
diff --git a/services/netapp/mgmt/2020-02-01/netapp/models.go b/services/netapp/mgmt/2020-02-01/netapp/models.go
index 34cb8b26c2da..1f71eb7cf254 100644
--- a/services/netapp/mgmt/2020-02-01/netapp/models.go
+++ b/services/netapp/mgmt/2020-02-01/netapp/models.go
@@ -1584,9 +1584,11 @@ type VolumeProperties struct {
ServiceLevel VolumeServiceLevel `json:"serviceLevel,omitempty"`
// UsageThreshold - Maximum storage quota allowed for a file system in bytes. This is a soft quota used for alerting only. Minimum size is 100 GiB. Upper limit is 100TiB. Specified in bytes.
UsageThreshold *int64 `json:"usageThreshold,omitempty"`
+ // UsedBytes - READ-ONLY; Resource size in bytes, current storage usage for the volume in bytes
+ UsedBytes *int64 `json:"usedBytes,omitempty"`
// ExportPolicy - Set of export policy rules
ExportPolicy *VolumePropertiesExportPolicy `json:"exportPolicy,omitempty"`
- // ProtocolTypes - Set of protocol types
+ // ProtocolTypes - Set of protocol types, default NFSv3, CIFS for SMB protocol
ProtocolTypes *[]string `json:"protocolTypes,omitempty"`
// ProvisioningState - READ-ONLY; Azure lifecycle management
ProvisioningState *string `json:"provisioningState,omitempty"`
@@ -1596,7 +1598,7 @@ type VolumeProperties struct {
BaremetalTenantID *string `json:"baremetalTenantId,omitempty"`
// SubnetID - The Azure Resource URI for a delegated subnet. Must have the delegation Microsoft.NetApp/volumes
SubnetID *string `json:"subnetId,omitempty"`
- // MountTargets - List of mount targets
+ // MountTargets - READ-ONLY; List of mount targets
MountTargets *[]MountTargetProperties `json:"mountTargets,omitempty"`
// VolumeType - What type of volume is this
VolumeType *string `json:"volumeType,omitempty"`
@@ -1632,9 +1634,6 @@ func (vp VolumeProperties) MarshalJSON() ([]byte, error) {
if vp.SubnetID != nil {
objectMap["subnetId"] = vp.SubnetID
}
- if vp.MountTargets != nil {
- objectMap["mountTargets"] = vp.MountTargets
- }
if vp.VolumeType != nil {
objectMap["volumeType"] = vp.VolumeType
}
diff --git a/services/netapp/mgmt/2020-02-01/netapp/operations.go b/services/netapp/mgmt/2020-02-01/netapp/operations.go
index 7eda55e1e906..0bf9d6f134ef 100644
--- a/services/netapp/mgmt/2020-02-01/netapp/operations.go
+++ b/services/netapp/mgmt/2020-02-01/netapp/operations.go
@@ -14,7 +14,7 @@ import (
"net/http"
)
-// OperationsClient is the microsoft NetApp Azure Resource Provider specification
+// OperationsClient is the microsoft NetApp Files Azure Resource Provider specification
type OperationsClient struct {
BaseClient
}
diff --git a/services/netapp/mgmt/2020-02-01/netapp/pools.go b/services/netapp/mgmt/2020-02-01/netapp/pools.go
index 21b4a6cf16c5..fb6ea0b929b3 100644
--- a/services/netapp/mgmt/2020-02-01/netapp/pools.go
+++ b/services/netapp/mgmt/2020-02-01/netapp/pools.go
@@ -15,7 +15,7 @@ import (
"net/http"
)
-// PoolsClient is the microsoft NetApp Azure Resource Provider specification
+// PoolsClient is the microsoft NetApp Files Azure Resource Provider specification
type PoolsClient struct {
BaseClient
}
diff --git a/services/netapp/mgmt/2020-02-01/netapp/resource.go b/services/netapp/mgmt/2020-02-01/netapp/resource.go
index d4a458228219..67237cc65676 100644
--- a/services/netapp/mgmt/2020-02-01/netapp/resource.go
+++ b/services/netapp/mgmt/2020-02-01/netapp/resource.go
@@ -15,7 +15,7 @@ import (
"net/http"
)
-// ResourceClient is the microsoft NetApp Azure Resource Provider specification
+// ResourceClient is the microsoft NetApp Files Azure Resource Provider specification
type ResourceClient struct {
BaseClient
}
diff --git a/services/netapp/mgmt/2020-02-01/netapp/snapshots.go b/services/netapp/mgmt/2020-02-01/netapp/snapshots.go
index e802086cdf7a..b6912a92d0c5 100644
--- a/services/netapp/mgmt/2020-02-01/netapp/snapshots.go
+++ b/services/netapp/mgmt/2020-02-01/netapp/snapshots.go
@@ -15,7 +15,7 @@ import (
"net/http"
)
-// SnapshotsClient is the microsoft NetApp Azure Resource Provider specification
+// SnapshotsClient is the microsoft NetApp Files Azure Resource Provider specification
type SnapshotsClient struct {
BaseClient
}
@@ -38,7 +38,7 @@ func NewSnapshotsClientWithBaseURI(baseURI string, subscriptionID string) Snapsh
// accountName - the name of the NetApp account
// poolName - the name of the capacity pool
// volumeName - the name of the volume
-// snapshotName - the name of the mount target
+// snapshotName - the name of the snapshot
func (client SnapshotsClient) Create(ctx context.Context, body Snapshot, resourceGroupName string, accountName string, poolName string, volumeName string, snapshotName string) (result SnapshotsCreateFuture, err error) {
if tracing.IsEnabled() {
ctx = tracing.StartSpan(ctx, fqdn+"/SnapshotsClient.Create")
@@ -153,7 +153,7 @@ func (client SnapshotsClient) CreateResponder(resp *http.Response) (result Snaps
// accountName - the name of the NetApp account
// poolName - the name of the capacity pool
// volumeName - the name of the volume
-// snapshotName - the name of the mount target
+// snapshotName - the name of the snapshot
func (client SnapshotsClient) Delete(ctx context.Context, resourceGroupName string, accountName string, poolName string, volumeName string, snapshotName string) (result SnapshotsDeleteFuture, err error) {
if tracing.IsEnabled() {
ctx = tracing.StartSpan(ctx, fqdn+"/SnapshotsClient.Delete")
@@ -253,7 +253,7 @@ func (client SnapshotsClient) DeleteResponder(resp *http.Response) (result autor
// accountName - the name of the NetApp account
// poolName - the name of the capacity pool
// volumeName - the name of the volume
-// snapshotName - the name of the mount target
+// snapshotName - the name of the snapshot
func (client SnapshotsClient) Get(ctx context.Context, resourceGroupName string, accountName string, poolName string, volumeName string, snapshotName string) (result Snapshot, err error) {
if tracing.IsEnabled() {
ctx = tracing.StartSpan(ctx, fqdn+"/SnapshotsClient.Get")
@@ -448,7 +448,7 @@ func (client SnapshotsClient) ListResponder(resp *http.Response) (result Snapsho
// accountName - the name of the NetApp account
// poolName - the name of the capacity pool
// volumeName - the name of the volume
-// snapshotName - the name of the mount target
+// snapshotName - the name of the snapshot
func (client SnapshotsClient) Update(ctx context.Context, body interface{}, resourceGroupName string, accountName string, poolName string, volumeName string, snapshotName string) (result SnapshotsUpdateFuture, err error) {
if tracing.IsEnabled() {
ctx = tracing.StartSpan(ctx, fqdn+"/SnapshotsClient.Update")
diff --git a/services/netapp/mgmt/2020-02-01/netapp/volumes.go b/services/netapp/mgmt/2020-02-01/netapp/volumes.go
index fbe9b95fd737..2e8ac2c35a9c 100644
--- a/services/netapp/mgmt/2020-02-01/netapp/volumes.go
+++ b/services/netapp/mgmt/2020-02-01/netapp/volumes.go
@@ -15,7 +15,7 @@ import (
"net/http"
)
-// VolumesClient is the microsoft NetApp Azure Resource Provider specification
+// VolumesClient is the microsoft NetApp Files Azure Resource Provider specification
type VolumesClient struct {
BaseClient
}
@@ -848,7 +848,7 @@ func (client VolumesClient) ReplicationStatusMethodResponder(resp *http.Response
}
// ResyncReplication resync the connection on the destination volume. If the operation is ran on the source volume it
-// will reverse-resync the connection and sync from source to destination.
+// will reverse-resync the connection and sync from destination to source.
// Parameters:
// resourceGroupName - the name of the resource group.
// accountName - the name of the NetApp account
diff --git a/services/netapp/mgmt/2020-03-01/netapp/CHANGELOG.md b/services/netapp/mgmt/2020-03-01/netapp/CHANGELOG.md
index 52911e4cc5e4..a1ecf841edb0 100644
--- a/services/netapp/mgmt/2020-03-01/netapp/CHANGELOG.md
+++ b/services/netapp/mgmt/2020-03-01/netapp/CHANGELOG.md
@@ -1,2 +1,2 @@
-# Change History
+# Unreleased
diff --git a/services/netapp/mgmt/2020-03-01/netapp/_meta.json b/services/netapp/mgmt/2020-03-01/netapp/_meta.json
index 7a0e4327eca2..8bc271e3dfd9 100644
--- a/services/netapp/mgmt/2020-03-01/netapp/_meta.json
+++ b/services/netapp/mgmt/2020-03-01/netapp/_meta.json
@@ -1,5 +1,5 @@
{
- "commit": "3c764635e7d442b3e74caf593029fcd440b3ef82",
+ "commit": "ed4b29fbceaea3cc48f039826db5a92360bc7c56",
"readme": "/_/azure-rest-api-specs/specification/netapp/resource-manager/readme.md",
"tag": "package-netapp-2020-03-01",
"use": "@microsoft.azure/autorest.go@2.1.187",
diff --git a/services/netapp/mgmt/2020-03-01/netapp/accounts.go b/services/netapp/mgmt/2020-03-01/netapp/accounts.go
index 96b86926fc63..fc731eeac387 100644
--- a/services/netapp/mgmt/2020-03-01/netapp/accounts.go
+++ b/services/netapp/mgmt/2020-03-01/netapp/accounts.go
@@ -15,7 +15,7 @@ import (
"net/http"
)
-// AccountsClient is the microsoft NetApp Azure Resource Provider specification
+// AccountsClient is the microsoft NetApp Files Azure Resource Provider specification
type AccountsClient struct {
BaseClient
}
diff --git a/services/netapp/mgmt/2020-03-01/netapp/client.go b/services/netapp/mgmt/2020-03-01/netapp/client.go
index 3a2009c90771..fa34b5eafd89 100644
--- a/services/netapp/mgmt/2020-03-01/netapp/client.go
+++ b/services/netapp/mgmt/2020-03-01/netapp/client.go
@@ -1,6 +1,6 @@
// Package netapp implements the Azure ARM Netapp service API version 2020-03-01.
//
-// Microsoft NetApp Azure Resource Provider specification
+// Microsoft NetApp Files Azure Resource Provider specification
package netapp
// Copyright (c) Microsoft Corporation. All rights reserved.
diff --git a/services/netapp/mgmt/2020-03-01/netapp/models.go b/services/netapp/mgmt/2020-03-01/netapp/models.go
index 22507610d980..6f1e6212fb2f 100644
--- a/services/netapp/mgmt/2020-03-01/netapp/models.go
+++ b/services/netapp/mgmt/2020-03-01/netapp/models.go
@@ -1586,7 +1586,7 @@ type VolumeProperties struct {
UsageThreshold *int64 `json:"usageThreshold,omitempty"`
// ExportPolicy - Set of export policy rules
ExportPolicy *VolumePropertiesExportPolicy `json:"exportPolicy,omitempty"`
- // ProtocolTypes - Set of protocol types
+ // ProtocolTypes - Set of protocol types, default NFSv3, CIFS for SMB protocol
ProtocolTypes *[]string `json:"protocolTypes,omitempty"`
// ProvisioningState - READ-ONLY; Azure lifecycle management
ProvisioningState *string `json:"provisioningState,omitempty"`
@@ -1596,7 +1596,7 @@ type VolumeProperties struct {
BaremetalTenantID *string `json:"baremetalTenantId,omitempty"`
// SubnetID - The Azure Resource URI for a delegated subnet. Must have the delegation Microsoft.NetApp/volumes
SubnetID *string `json:"subnetId,omitempty"`
- // MountTargets - List of mount targets
+ // MountTargets - READ-ONLY; List of mount targets
MountTargets *[]MountTargetProperties `json:"mountTargets,omitempty"`
// VolumeType - What type of volume is this
VolumeType *string `json:"volumeType,omitempty"`
@@ -1632,9 +1632,6 @@ func (vp VolumeProperties) MarshalJSON() ([]byte, error) {
if vp.SubnetID != nil {
objectMap["subnetId"] = vp.SubnetID
}
- if vp.MountTargets != nil {
- objectMap["mountTargets"] = vp.MountTargets
- }
if vp.VolumeType != nil {
objectMap["volumeType"] = vp.VolumeType
}
diff --git a/services/netapp/mgmt/2020-03-01/netapp/operations.go b/services/netapp/mgmt/2020-03-01/netapp/operations.go
index acbb0da59dd5..375187c3f869 100644
--- a/services/netapp/mgmt/2020-03-01/netapp/operations.go
+++ b/services/netapp/mgmt/2020-03-01/netapp/operations.go
@@ -14,7 +14,7 @@ import (
"net/http"
)
-// OperationsClient is the microsoft NetApp Azure Resource Provider specification
+// OperationsClient is the microsoft NetApp Files Azure Resource Provider specification
type OperationsClient struct {
BaseClient
}
diff --git a/services/netapp/mgmt/2020-03-01/netapp/pools.go b/services/netapp/mgmt/2020-03-01/netapp/pools.go
index dbffa0d6c1dc..29ed39f1e45e 100644
--- a/services/netapp/mgmt/2020-03-01/netapp/pools.go
+++ b/services/netapp/mgmt/2020-03-01/netapp/pools.go
@@ -15,7 +15,7 @@ import (
"net/http"
)
-// PoolsClient is the microsoft NetApp Azure Resource Provider specification
+// PoolsClient is the microsoft NetApp Files Azure Resource Provider specification
type PoolsClient struct {
BaseClient
}
diff --git a/services/netapp/mgmt/2020-03-01/netapp/resource.go b/services/netapp/mgmt/2020-03-01/netapp/resource.go
index 1050fadbc1e6..d28af7b1222f 100644
--- a/services/netapp/mgmt/2020-03-01/netapp/resource.go
+++ b/services/netapp/mgmt/2020-03-01/netapp/resource.go
@@ -15,7 +15,7 @@ import (
"net/http"
)
-// ResourceClient is the microsoft NetApp Azure Resource Provider specification
+// ResourceClient is the microsoft NetApp Files Azure Resource Provider specification
type ResourceClient struct {
BaseClient
}
diff --git a/services/netapp/mgmt/2020-03-01/netapp/snapshots.go b/services/netapp/mgmt/2020-03-01/netapp/snapshots.go
index f68f5c429650..f20043d1678b 100644
--- a/services/netapp/mgmt/2020-03-01/netapp/snapshots.go
+++ b/services/netapp/mgmt/2020-03-01/netapp/snapshots.go
@@ -15,7 +15,7 @@ import (
"net/http"
)
-// SnapshotsClient is the microsoft NetApp Azure Resource Provider specification
+// SnapshotsClient is the microsoft NetApp Files Azure Resource Provider specification
type SnapshotsClient struct {
BaseClient
}
@@ -38,7 +38,7 @@ func NewSnapshotsClientWithBaseURI(baseURI string, subscriptionID string) Snapsh
// accountName - the name of the NetApp account
// poolName - the name of the capacity pool
// volumeName - the name of the volume
-// snapshotName - the name of the mount target
+// snapshotName - the name of the snapshot
func (client SnapshotsClient) Create(ctx context.Context, body Snapshot, resourceGroupName string, accountName string, poolName string, volumeName string, snapshotName string) (result SnapshotsCreateFuture, err error) {
if tracing.IsEnabled() {
ctx = tracing.StartSpan(ctx, fqdn+"/SnapshotsClient.Create")
@@ -153,7 +153,7 @@ func (client SnapshotsClient) CreateResponder(resp *http.Response) (result Snaps
// accountName - the name of the NetApp account
// poolName - the name of the capacity pool
// volumeName - the name of the volume
-// snapshotName - the name of the mount target
+// snapshotName - the name of the snapshot
func (client SnapshotsClient) Delete(ctx context.Context, resourceGroupName string, accountName string, poolName string, volumeName string, snapshotName string) (result SnapshotsDeleteFuture, err error) {
if tracing.IsEnabled() {
ctx = tracing.StartSpan(ctx, fqdn+"/SnapshotsClient.Delete")
@@ -253,7 +253,7 @@ func (client SnapshotsClient) DeleteResponder(resp *http.Response) (result autor
// accountName - the name of the NetApp account
// poolName - the name of the capacity pool
// volumeName - the name of the volume
-// snapshotName - the name of the mount target
+// snapshotName - the name of the snapshot
func (client SnapshotsClient) Get(ctx context.Context, resourceGroupName string, accountName string, poolName string, volumeName string, snapshotName string) (result Snapshot, err error) {
if tracing.IsEnabled() {
ctx = tracing.StartSpan(ctx, fqdn+"/SnapshotsClient.Get")
@@ -448,7 +448,7 @@ func (client SnapshotsClient) ListResponder(resp *http.Response) (result Snapsho
// accountName - the name of the NetApp account
// poolName - the name of the capacity pool
// volumeName - the name of the volume
-// snapshotName - the name of the mount target
+// snapshotName - the name of the snapshot
func (client SnapshotsClient) Update(ctx context.Context, body interface{}, resourceGroupName string, accountName string, poolName string, volumeName string, snapshotName string) (result SnapshotsUpdateFuture, err error) {
if tracing.IsEnabled() {
ctx = tracing.StartSpan(ctx, fqdn+"/SnapshotsClient.Update")
diff --git a/services/netapp/mgmt/2020-03-01/netapp/volumes.go b/services/netapp/mgmt/2020-03-01/netapp/volumes.go
index 68d29f7db7fd..014ee69febf6 100644
--- a/services/netapp/mgmt/2020-03-01/netapp/volumes.go
+++ b/services/netapp/mgmt/2020-03-01/netapp/volumes.go
@@ -15,7 +15,7 @@ import (
"net/http"
)
-// VolumesClient is the microsoft NetApp Azure Resource Provider specification
+// VolumesClient is the microsoft NetApp Files Azure Resource Provider specification
type VolumesClient struct {
BaseClient
}
@@ -848,7 +848,7 @@ func (client VolumesClient) ReplicationStatusMethodResponder(resp *http.Response
}
// ResyncReplication resync the connection on the destination volume. If the operation is ran on the source volume it
-// will reverse-resync the connection and sync from source to destination.
+// will reverse-resync the connection and sync from destination to source.
// Parameters:
// resourceGroupName - the name of the resource group.
// accountName - the name of the NetApp account
diff --git a/services/netapp/mgmt/2020-05-01/netapp/CHANGELOG.md b/services/netapp/mgmt/2020-05-01/netapp/CHANGELOG.md
index 52911e4cc5e4..e719af10d065 100644
--- a/services/netapp/mgmt/2020-05-01/netapp/CHANGELOG.md
+++ b/services/netapp/mgmt/2020-05-01/netapp/CHANGELOG.md
@@ -1,2 +1,20 @@
-# Change History
+# Unreleased
+## Breaking Changes
+
+### Signature Changes
+
+#### Struct Fields
+
+1. BackupProperties.BackupType changed type from *string to BackupType
+
+## Additive Changes
+
+### New Constants
+
+1. BackupType.Manual
+1. BackupType.Scheduled
+
+### New Funcs
+
+1. PossibleBackupTypeValues() []BackupType
diff --git a/services/netapp/mgmt/2020-05-01/netapp/_meta.json b/services/netapp/mgmt/2020-05-01/netapp/_meta.json
index 893a7c148052..2ffaca61b4bd 100644
--- a/services/netapp/mgmt/2020-05-01/netapp/_meta.json
+++ b/services/netapp/mgmt/2020-05-01/netapp/_meta.json
@@ -1,5 +1,5 @@
{
- "commit": "3c764635e7d442b3e74caf593029fcd440b3ef82",
+ "commit": "ed4b29fbceaea3cc48f039826db5a92360bc7c56",
"readme": "/_/azure-rest-api-specs/specification/netapp/resource-manager/readme.md",
"tag": "package-netapp-2020-05-01",
"use": "@microsoft.azure/autorest.go@2.1.187",
diff --git a/services/netapp/mgmt/2020-05-01/netapp/accountbackups.go b/services/netapp/mgmt/2020-05-01/netapp/accountbackups.go
index b107ee32358b..7125d5cf2ef0 100644
--- a/services/netapp/mgmt/2020-05-01/netapp/accountbackups.go
+++ b/services/netapp/mgmt/2020-05-01/netapp/accountbackups.go
@@ -15,7 +15,7 @@ import (
"net/http"
)
-// AccountBackupsClient is the microsoft NetApp Azure Resource Provider specification
+// AccountBackupsClient is the microsoft NetApp Files Azure Resource Provider specification
type AccountBackupsClient struct {
BaseClient
}
diff --git a/services/netapp/mgmt/2020-05-01/netapp/accounts.go b/services/netapp/mgmt/2020-05-01/netapp/accounts.go
index 717e228071d0..ace583dbec6e 100644
--- a/services/netapp/mgmt/2020-05-01/netapp/accounts.go
+++ b/services/netapp/mgmt/2020-05-01/netapp/accounts.go
@@ -15,7 +15,7 @@ import (
"net/http"
)
-// AccountsClient is the microsoft NetApp Azure Resource Provider specification
+// AccountsClient is the microsoft NetApp Files Azure Resource Provider specification
type AccountsClient struct {
BaseClient
}
diff --git a/services/netapp/mgmt/2020-05-01/netapp/backuppolicies.go b/services/netapp/mgmt/2020-05-01/netapp/backuppolicies.go
index d3ac6b9c2b85..a7f656b8ef2f 100644
--- a/services/netapp/mgmt/2020-05-01/netapp/backuppolicies.go
+++ b/services/netapp/mgmt/2020-05-01/netapp/backuppolicies.go
@@ -15,7 +15,7 @@ import (
"net/http"
)
-// BackupPoliciesClient is the microsoft NetApp Azure Resource Provider specification
+// BackupPoliciesClient is the microsoft NetApp Files Azure Resource Provider specification
type BackupPoliciesClient struct {
BaseClient
}
diff --git a/services/netapp/mgmt/2020-05-01/netapp/backups.go b/services/netapp/mgmt/2020-05-01/netapp/backups.go
index ffe3e06f07c7..921d292b5fa1 100644
--- a/services/netapp/mgmt/2020-05-01/netapp/backups.go
+++ b/services/netapp/mgmt/2020-05-01/netapp/backups.go
@@ -15,7 +15,7 @@ import (
"net/http"
)
-// BackupsClient is the microsoft NetApp Azure Resource Provider specification
+// BackupsClient is the microsoft NetApp Files Azure Resource Provider specification
type BackupsClient struct {
BaseClient
}
diff --git a/services/netapp/mgmt/2020-05-01/netapp/client.go b/services/netapp/mgmt/2020-05-01/netapp/client.go
index 0b5edf65f1f9..6b5938951781 100644
--- a/services/netapp/mgmt/2020-05-01/netapp/client.go
+++ b/services/netapp/mgmt/2020-05-01/netapp/client.go
@@ -1,6 +1,6 @@
// Package netapp implements the Azure ARM Netapp service API version 2020-05-01.
//
-// Microsoft NetApp Azure Resource Provider specification
+// Microsoft NetApp Files Azure Resource Provider specification
package netapp
// Copyright (c) Microsoft Corporation. All rights reserved.
diff --git a/services/netapp/mgmt/2020-05-01/netapp/enums.go b/services/netapp/mgmt/2020-05-01/netapp/enums.go
index de929b93ddac..7ae108a54cb3 100644
--- a/services/netapp/mgmt/2020-05-01/netapp/enums.go
+++ b/services/netapp/mgmt/2020-05-01/netapp/enums.go
@@ -6,6 +6,21 @@ package netapp
// Code generated by Microsoft (R) AutoRest Code Generator.
// Changes may cause incorrect behavior and will be lost if the code is regenerated.
+// BackupType enumerates the values for backup type.
+type BackupType string
+
+const (
+ // Manual Manual backup
+ Manual BackupType = "Manual"
+ // Scheduled Scheduled backup
+ Scheduled BackupType = "Scheduled"
+)
+
+// PossibleBackupTypeValues returns an array of possible values for the BackupType const type.
+func PossibleBackupTypeValues() []BackupType {
+ return []BackupType{Manual, Scheduled}
+}
+
// CheckNameResourceTypes enumerates the values for check name resource types.
type CheckNameResourceTypes string
diff --git a/services/netapp/mgmt/2020-05-01/netapp/models.go b/services/netapp/mgmt/2020-05-01/netapp/models.go
index 7c895154bbd0..9d776d03d4b7 100644
--- a/services/netapp/mgmt/2020-05-01/netapp/models.go
+++ b/services/netapp/mgmt/2020-05-01/netapp/models.go
@@ -977,8 +977,8 @@ type BackupProperties struct {
Size *int64 `json:"size,omitempty"`
// Label - Label for backup
Label *string `json:"label,omitempty"`
- // BackupType - READ-ONLY; Type of backup adhoc or scheduled
- BackupType *string `json:"backupType,omitempty"`
+ // BackupType - READ-ONLY; Type of backup Manual or Scheduled. Possible values include: 'Manual', 'Scheduled'
+ BackupType BackupType `json:"backupType,omitempty"`
}
// MarshalJSON is the custom marshaler for BackupProperties.
@@ -2835,7 +2835,7 @@ type VolumeProperties struct {
UsageThreshold *int64 `json:"usageThreshold,omitempty"`
// ExportPolicy - Set of export policy rules
ExportPolicy *VolumePropertiesExportPolicy `json:"exportPolicy,omitempty"`
- // ProtocolTypes - Set of protocol types
+ // ProtocolTypes - Set of protocol types, default NFSv3, CIFS for SMB protocol
ProtocolTypes *[]string `json:"protocolTypes,omitempty"`
// ProvisioningState - READ-ONLY; Azure lifecycle management
ProvisioningState *string `json:"provisioningState,omitempty"`
@@ -2847,7 +2847,7 @@ type VolumeProperties struct {
BaremetalTenantID *string `json:"baremetalTenantId,omitempty"`
// SubnetID - The Azure Resource URI for a delegated subnet. Must have the delegation Microsoft.NetApp/volumes
SubnetID *string `json:"subnetId,omitempty"`
- // MountTargets - List of mount targets
+ // MountTargets - READ-ONLY; List of mount targets
MountTargets *[]MountTargetProperties `json:"mountTargets,omitempty"`
// VolumeType - What type of volume is this
VolumeType *string `json:"volumeType,omitempty"`
@@ -2888,9 +2888,6 @@ func (vp VolumeProperties) MarshalJSON() ([]byte, error) {
if vp.SubnetID != nil {
objectMap["subnetId"] = vp.SubnetID
}
- if vp.MountTargets != nil {
- objectMap["mountTargets"] = vp.MountTargets
- }
if vp.VolumeType != nil {
objectMap["volumeType"] = vp.VolumeType
}
diff --git a/services/netapp/mgmt/2020-05-01/netapp/operations.go b/services/netapp/mgmt/2020-05-01/netapp/operations.go
index fbf82938974e..221dc09ecd58 100644
--- a/services/netapp/mgmt/2020-05-01/netapp/operations.go
+++ b/services/netapp/mgmt/2020-05-01/netapp/operations.go
@@ -14,7 +14,7 @@ import (
"net/http"
)
-// OperationsClient is the microsoft NetApp Azure Resource Provider specification
+// OperationsClient is the microsoft NetApp Files Azure Resource Provider specification
type OperationsClient struct {
BaseClient
}
diff --git a/services/netapp/mgmt/2020-05-01/netapp/pools.go b/services/netapp/mgmt/2020-05-01/netapp/pools.go
index 560d58db46b1..b1edc74ee0d6 100644
--- a/services/netapp/mgmt/2020-05-01/netapp/pools.go
+++ b/services/netapp/mgmt/2020-05-01/netapp/pools.go
@@ -15,7 +15,7 @@ import (
"net/http"
)
-// PoolsClient is the microsoft NetApp Azure Resource Provider specification
+// PoolsClient is the microsoft NetApp Files Azure Resource Provider specification
type PoolsClient struct {
BaseClient
}
diff --git a/services/netapp/mgmt/2020-05-01/netapp/resource.go b/services/netapp/mgmt/2020-05-01/netapp/resource.go
index 5b75b4d51a80..fa428e67072e 100644
--- a/services/netapp/mgmt/2020-05-01/netapp/resource.go
+++ b/services/netapp/mgmt/2020-05-01/netapp/resource.go
@@ -15,7 +15,7 @@ import (
"net/http"
)
-// ResourceClient is the microsoft NetApp Azure Resource Provider specification
+// ResourceClient is the microsoft NetApp Files Azure Resource Provider specification
type ResourceClient struct {
BaseClient
}
diff --git a/services/netapp/mgmt/2020-05-01/netapp/snapshotpolicies.go b/services/netapp/mgmt/2020-05-01/netapp/snapshotpolicies.go
index fe466dc12b53..78a7200cb7a5 100644
--- a/services/netapp/mgmt/2020-05-01/netapp/snapshotpolicies.go
+++ b/services/netapp/mgmt/2020-05-01/netapp/snapshotpolicies.go
@@ -15,7 +15,7 @@ import (
"net/http"
)
-// SnapshotPoliciesClient is the microsoft NetApp Azure Resource Provider specification
+// SnapshotPoliciesClient is the microsoft NetApp Files Azure Resource Provider specification
type SnapshotPoliciesClient struct {
BaseClient
}
@@ -37,7 +37,7 @@ func NewSnapshotPoliciesClientWithBaseURI(baseURI string, subscriptionID string)
// body - snapshot policy object supplied in the body of the operation.
// resourceGroupName - the name of the resource group.
// accountName - the name of the NetApp account
-// snapshotPolicyName - the name of the snapshot policy target
+// snapshotPolicyName - the name of the snapshot policy
func (client SnapshotPoliciesClient) Create(ctx context.Context, body SnapshotPolicy, resourceGroupName string, accountName string, snapshotPolicyName string) (result SnapshotPolicy, err error) {
if tracing.IsEnabled() {
ctx = tracing.StartSpan(ctx, fqdn+"/SnapshotPoliciesClient.Create")
@@ -131,7 +131,7 @@ func (client SnapshotPoliciesClient) CreateResponder(resp *http.Response) (resul
// Parameters:
// resourceGroupName - the name of the resource group.
// accountName - the name of the NetApp account
-// snapshotPolicyName - the name of the snapshot policy target
+// snapshotPolicyName - the name of the snapshot policy
func (client SnapshotPoliciesClient) Delete(ctx context.Context, resourceGroupName string, accountName string, snapshotPolicyName string) (result SnapshotPoliciesDeleteFuture, err error) {
if tracing.IsEnabled() {
ctx = tracing.StartSpan(ctx, fqdn+"/SnapshotPoliciesClient.Delete")
@@ -219,7 +219,7 @@ func (client SnapshotPoliciesClient) DeleteResponder(resp *http.Response) (resul
// Parameters:
// resourceGroupName - the name of the resource group.
// accountName - the name of the NetApp account
-// snapshotPolicyName - the name of the snapshot policy target
+// snapshotPolicyName - the name of the snapshot policy
func (client SnapshotPoliciesClient) Get(ctx context.Context, resourceGroupName string, accountName string, snapshotPolicyName string) (result SnapshotPolicy, err error) {
if tracing.IsEnabled() {
ctx = tracing.StartSpan(ctx, fqdn+"/SnapshotPoliciesClient.Get")
@@ -389,7 +389,7 @@ func (client SnapshotPoliciesClient) ListResponder(resp *http.Response) (result
// Parameters:
// resourceGroupName - the name of the resource group.
// accountName - the name of the NetApp account
-// snapshotPolicyName - the name of the snapshot policy target
+// snapshotPolicyName - the name of the snapshot policy
func (client SnapshotPoliciesClient) ListVolumes(ctx context.Context, resourceGroupName string, accountName string, snapshotPolicyName string) (result SnapshotPolicyVolumeList, err error) {
if tracing.IsEnabled() {
ctx = tracing.StartSpan(ctx, fqdn+"/SnapshotPoliciesClient.ListVolumes")
@@ -476,7 +476,7 @@ func (client SnapshotPoliciesClient) ListVolumesResponder(resp *http.Response) (
// body - snapshot policy object supplied in the body of the operation.
// resourceGroupName - the name of the resource group.
// accountName - the name of the NetApp account
-// snapshotPolicyName - the name of the snapshot policy target
+// snapshotPolicyName - the name of the snapshot policy
func (client SnapshotPoliciesClient) Update(ctx context.Context, body SnapshotPolicyPatch, resourceGroupName string, accountName string, snapshotPolicyName string) (result SnapshotPolicy, err error) {
if tracing.IsEnabled() {
ctx = tracing.StartSpan(ctx, fqdn+"/SnapshotPoliciesClient.Update")
diff --git a/services/netapp/mgmt/2020-05-01/netapp/snapshots.go b/services/netapp/mgmt/2020-05-01/netapp/snapshots.go
index d036a3df14c0..87bec73409ab 100644
--- a/services/netapp/mgmt/2020-05-01/netapp/snapshots.go
+++ b/services/netapp/mgmt/2020-05-01/netapp/snapshots.go
@@ -15,7 +15,7 @@ import (
"net/http"
)
-// SnapshotsClient is the microsoft NetApp Azure Resource Provider specification
+// SnapshotsClient is the microsoft NetApp Files Azure Resource Provider specification
type SnapshotsClient struct {
BaseClient
}
@@ -38,7 +38,7 @@ func NewSnapshotsClientWithBaseURI(baseURI string, subscriptionID string) Snapsh
// accountName - the name of the NetApp account
// poolName - the name of the capacity pool
// volumeName - the name of the volume
-// snapshotName - the name of the mount target
+// snapshotName - the name of the snapshot
func (client SnapshotsClient) Create(ctx context.Context, body Snapshot, resourceGroupName string, accountName string, poolName string, volumeName string, snapshotName string) (result SnapshotsCreateFuture, err error) {
if tracing.IsEnabled() {
ctx = tracing.StartSpan(ctx, fqdn+"/SnapshotsClient.Create")
@@ -153,7 +153,7 @@ func (client SnapshotsClient) CreateResponder(resp *http.Response) (result Snaps
// accountName - the name of the NetApp account
// poolName - the name of the capacity pool
// volumeName - the name of the volume
-// snapshotName - the name of the mount target
+// snapshotName - the name of the snapshot
func (client SnapshotsClient) Delete(ctx context.Context, resourceGroupName string, accountName string, poolName string, volumeName string, snapshotName string) (result SnapshotsDeleteFuture, err error) {
if tracing.IsEnabled() {
ctx = tracing.StartSpan(ctx, fqdn+"/SnapshotsClient.Delete")
@@ -253,7 +253,7 @@ func (client SnapshotsClient) DeleteResponder(resp *http.Response) (result autor
// accountName - the name of the NetApp account
// poolName - the name of the capacity pool
// volumeName - the name of the volume
-// snapshotName - the name of the mount target
+// snapshotName - the name of the snapshot
func (client SnapshotsClient) Get(ctx context.Context, resourceGroupName string, accountName string, poolName string, volumeName string, snapshotName string) (result Snapshot, err error) {
if tracing.IsEnabled() {
ctx = tracing.StartSpan(ctx, fqdn+"/SnapshotsClient.Get")
@@ -448,7 +448,7 @@ func (client SnapshotsClient) ListResponder(resp *http.Response) (result Snapsho
// accountName - the name of the NetApp account
// poolName - the name of the capacity pool
// volumeName - the name of the volume
-// snapshotName - the name of the mount target
+// snapshotName - the name of the snapshot
func (client SnapshotsClient) Update(ctx context.Context, body interface{}, resourceGroupName string, accountName string, poolName string, volumeName string, snapshotName string) (result SnapshotsUpdateFuture, err error) {
if tracing.IsEnabled() {
ctx = tracing.StartSpan(ctx, fqdn+"/SnapshotsClient.Update")
diff --git a/services/netapp/mgmt/2020-05-01/netapp/vaults.go b/services/netapp/mgmt/2020-05-01/netapp/vaults.go
index c9d45dc3bb1d..23ef0d102997 100644
--- a/services/netapp/mgmt/2020-05-01/netapp/vaults.go
+++ b/services/netapp/mgmt/2020-05-01/netapp/vaults.go
@@ -15,7 +15,7 @@ import (
"net/http"
)
-// VaultsClient is the microsoft NetApp Azure Resource Provider specification
+// VaultsClient is the microsoft NetApp Files Azure Resource Provider specification
type VaultsClient struct {
BaseClient
}
diff --git a/services/netapp/mgmt/2020-05-01/netapp/volumes.go b/services/netapp/mgmt/2020-05-01/netapp/volumes.go
index bc758a9062ab..1497e7750c62 100644
--- a/services/netapp/mgmt/2020-05-01/netapp/volumes.go
+++ b/services/netapp/mgmt/2020-05-01/netapp/volumes.go
@@ -15,7 +15,7 @@ import (
"net/http"
)
-// VolumesClient is the microsoft NetApp Azure Resource Provider specification
+// VolumesClient is the microsoft NetApp Files Azure Resource Provider specification
type VolumesClient struct {
BaseClient
}
@@ -1060,7 +1060,7 @@ func (client VolumesClient) ReplicationStatusMethodResponder(resp *http.Response
}
// ResyncReplication resync the connection on the destination volume. If the operation is ran on the source volume it
-// will reverse-resync the connection and sync from source to destination.
+// will reverse-resync the connection and sync from destination to source.
// Parameters:
// resourceGroupName - the name of the resource group.
// accountName - the name of the NetApp account
diff --git a/services/netapp/mgmt/2020-06-01/netapp/CHANGELOG.md b/services/netapp/mgmt/2020-06-01/netapp/CHANGELOG.md
index 52911e4cc5e4..a5415c33a3a9 100644
--- a/services/netapp/mgmt/2020-06-01/netapp/CHANGELOG.md
+++ b/services/netapp/mgmt/2020-06-01/netapp/CHANGELOG.md
@@ -1,2 +1,29 @@
-# Change History
+# Unreleased
+## Breaking Changes
+
+### Removed Constants
+
+1. QosType.Auto
+
+### Signature Changes
+
+#### Const Types
+
+1. Manual changed type from QosType to BackupType
+
+#### Struct Fields
+
+1. BackupProperties.BackupType changed type from *string to BackupType
+
+## Additive Changes
+
+### New Constants
+
+1. BackupType.Scheduled
+1. QosType.QosTypeAuto
+1. QosType.QosTypeManual
+
+### New Funcs
+
+1. PossibleBackupTypeValues() []BackupType
diff --git a/services/netapp/mgmt/2020-06-01/netapp/_meta.json b/services/netapp/mgmt/2020-06-01/netapp/_meta.json
index 403c62181266..9244d7be025e 100644
--- a/services/netapp/mgmt/2020-06-01/netapp/_meta.json
+++ b/services/netapp/mgmt/2020-06-01/netapp/_meta.json
@@ -1,5 +1,5 @@
{
- "commit": "3c764635e7d442b3e74caf593029fcd440b3ef82",
+ "commit": "ed4b29fbceaea3cc48f039826db5a92360bc7c56",
"readme": "/_/azure-rest-api-specs/specification/netapp/resource-manager/readme.md",
"tag": "package-netapp-2020-06-01",
"use": "@microsoft.azure/autorest.go@2.1.187",
diff --git a/services/netapp/mgmt/2020-06-01/netapp/accountbackups.go b/services/netapp/mgmt/2020-06-01/netapp/accountbackups.go
index f3cb0a26ff52..458e3789c91a 100644
--- a/services/netapp/mgmt/2020-06-01/netapp/accountbackups.go
+++ b/services/netapp/mgmt/2020-06-01/netapp/accountbackups.go
@@ -15,7 +15,7 @@ import (
"net/http"
)
-// AccountBackupsClient is the microsoft NetApp Azure Resource Provider specification
+// AccountBackupsClient is the microsoft NetApp Files Azure Resource Provider specification
type AccountBackupsClient struct {
BaseClient
}
diff --git a/services/netapp/mgmt/2020-06-01/netapp/accounts.go b/services/netapp/mgmt/2020-06-01/netapp/accounts.go
index cecc4f9e9af0..4f7f23ac2127 100644
--- a/services/netapp/mgmt/2020-06-01/netapp/accounts.go
+++ b/services/netapp/mgmt/2020-06-01/netapp/accounts.go
@@ -15,7 +15,7 @@ import (
"net/http"
)
-// AccountsClient is the microsoft NetApp Azure Resource Provider specification
+// AccountsClient is the microsoft NetApp Files Azure Resource Provider specification
type AccountsClient struct {
BaseClient
}
diff --git a/services/netapp/mgmt/2020-06-01/netapp/backuppolicies.go b/services/netapp/mgmt/2020-06-01/netapp/backuppolicies.go
index 8a1bca92831a..1e238fba523c 100644
--- a/services/netapp/mgmt/2020-06-01/netapp/backuppolicies.go
+++ b/services/netapp/mgmt/2020-06-01/netapp/backuppolicies.go
@@ -15,7 +15,7 @@ import (
"net/http"
)
-// BackupPoliciesClient is the microsoft NetApp Azure Resource Provider specification
+// BackupPoliciesClient is the microsoft NetApp Files Azure Resource Provider specification
type BackupPoliciesClient struct {
BaseClient
}
diff --git a/services/netapp/mgmt/2020-06-01/netapp/backups.go b/services/netapp/mgmt/2020-06-01/netapp/backups.go
index 2d76d6d3cc3d..2008f57a8e50 100644
--- a/services/netapp/mgmt/2020-06-01/netapp/backups.go
+++ b/services/netapp/mgmt/2020-06-01/netapp/backups.go
@@ -15,7 +15,7 @@ import (
"net/http"
)
-// BackupsClient is the microsoft NetApp Azure Resource Provider specification
+// BackupsClient is the microsoft NetApp Files Azure Resource Provider specification
type BackupsClient struct {
BaseClient
}
diff --git a/services/netapp/mgmt/2020-06-01/netapp/client.go b/services/netapp/mgmt/2020-06-01/netapp/client.go
index 6b2c03785d53..b6ea6aa88de4 100644
--- a/services/netapp/mgmt/2020-06-01/netapp/client.go
+++ b/services/netapp/mgmt/2020-06-01/netapp/client.go
@@ -1,6 +1,6 @@
// Package netapp implements the Azure ARM Netapp service API version 2020-06-01.
//
-// Microsoft NetApp Azure Resource Provider specification
+// Microsoft NetApp Files Azure Resource Provider specification
package netapp
// Copyright (c) Microsoft Corporation. All rights reserved.
diff --git a/services/netapp/mgmt/2020-06-01/netapp/enums.go b/services/netapp/mgmt/2020-06-01/netapp/enums.go
index d9a077191155..42e74827d9c3 100644
--- a/services/netapp/mgmt/2020-06-01/netapp/enums.go
+++ b/services/netapp/mgmt/2020-06-01/netapp/enums.go
@@ -27,6 +27,21 @@ func PossibleActiveDirectoryStatusValues() []ActiveDirectoryStatus {
return []ActiveDirectoryStatus{Created, Deleted, Error, InUse, Updating}
}
+// BackupType enumerates the values for backup type.
+type BackupType string
+
+const (
+ // Manual Manual backup
+ Manual BackupType = "Manual"
+ // Scheduled Scheduled backup
+ Scheduled BackupType = "Scheduled"
+)
+
+// PossibleBackupTypeValues returns an array of possible values for the BackupType const type.
+func PossibleBackupTypeValues() []BackupType {
+ return []BackupType{Manual, Scheduled}
+}
+
// CheckNameResourceTypes enumerates the values for check name resource types.
type CheckNameResourceTypes string
@@ -116,15 +131,15 @@ func PossibleMirrorStateValues() []MirrorState {
type QosType string
const (
- // Auto qos type Auto
- Auto QosType = "Auto"
- // Manual qos type Manual
- Manual QosType = "Manual"
+ // QosTypeAuto qos type Auto
+ QosTypeAuto QosType = "Auto"
+ // QosTypeManual qos type Manual
+ QosTypeManual QosType = "Manual"
)
// PossibleQosTypeValues returns an array of possible values for the QosType const type.
func PossibleQosTypeValues() []QosType {
- return []QosType{Auto, Manual}
+ return []QosType{QosTypeAuto, QosTypeManual}
}
// RelationshipStatus enumerates the values for relationship status.
diff --git a/services/netapp/mgmt/2020-06-01/netapp/models.go b/services/netapp/mgmt/2020-06-01/netapp/models.go
index 13f586b91d5a..a2725e0fbdfe 100644
--- a/services/netapp/mgmt/2020-06-01/netapp/models.go
+++ b/services/netapp/mgmt/2020-06-01/netapp/models.go
@@ -1025,8 +1025,8 @@ type BackupProperties struct {
Size *int64 `json:"size,omitempty"`
// Label - Label for backup
Label *string `json:"label,omitempty"`
- // BackupType - READ-ONLY; Type of backup adhoc or scheduled
- BackupType *string `json:"backupType,omitempty"`
+ // BackupType - READ-ONLY; Type of backup Manual or Scheduled. Possible values include: 'Manual', 'Scheduled'
+ BackupType BackupType `json:"backupType,omitempty"`
}
// MarshalJSON is the custom marshaler for BackupProperties.
@@ -1689,7 +1689,7 @@ type PoolChangeRequest struct {
type PoolPatchProperties struct {
// Size - Provisioned size of the pool (in bytes). Allowed values are in 4TiB chunks (value must be multiply of 4398046511104).
Size *int64 `json:"size,omitempty"`
- // QosType - The qos type of the pool. Possible values include: 'Auto', 'Manual'
+ // QosType - The qos type of the pool. Possible values include: 'QosTypeAuto', 'QosTypeManual'
QosType QosType `json:"qosType,omitempty"`
}
@@ -1707,7 +1707,7 @@ type PoolProperties struct {
TotalThroughputMibps *float64 `json:"totalThroughputMibps,omitempty"`
// UtilizedThroughputMibps - READ-ONLY; Utilized throughput of pool in Mibps
UtilizedThroughputMibps *float64 `json:"utilizedThroughputMibps,omitempty"`
- // QosType - The qos type of the pool. Possible values include: 'Auto', 'Manual'
+ // QosType - The qos type of the pool. Possible values include: 'QosTypeAuto', 'QosTypeManual'
QosType QosType `json:"qosType,omitempty"`
}
@@ -2893,7 +2893,7 @@ type VolumeProperties struct {
UsageThreshold *int64 `json:"usageThreshold,omitempty"`
// ExportPolicy - Set of export policy rules
ExportPolicy *VolumePropertiesExportPolicy `json:"exportPolicy,omitempty"`
- // ProtocolTypes - Set of protocol types
+ // ProtocolTypes - Set of protocol types, default NFSv3, CIFS for SMB protocol
ProtocolTypes *[]string `json:"protocolTypes,omitempty"`
// ProvisioningState - READ-ONLY; Azure lifecycle management
ProvisioningState *string `json:"provisioningState,omitempty"`
@@ -2905,7 +2905,7 @@ type VolumeProperties struct {
BaremetalTenantID *string `json:"baremetalTenantId,omitempty"`
// SubnetID - The Azure Resource URI for a delegated subnet. Must have the delegation Microsoft.NetApp/volumes
SubnetID *string `json:"subnetId,omitempty"`
- // MountTargets - List of mount targets
+ // MountTargets - READ-ONLY; List of mount targets
MountTargets *[]MountTargetProperties `json:"mountTargets,omitempty"`
// VolumeType - What type of volume is this
VolumeType *string `json:"volumeType,omitempty"`
@@ -2917,7 +2917,7 @@ type VolumeProperties struct {
SnapshotDirectoryVisible *bool `json:"snapshotDirectoryVisible,omitempty"`
// KerberosEnabled - Describe if a volume is KerberosEnabled. To be use with swagger version 2020-05-01 or later
KerberosEnabled *bool `json:"kerberosEnabled,omitempty"`
- // SecurityStyle - The security style of volume. Possible values include: 'Ntfs', 'Unix'
+ // SecurityStyle - The security style of volume, default unix, defaults to ntfs for dual protocol or CIFS protocol. Possible values include: 'Ntfs', 'Unix'
SecurityStyle SecurityStyle `json:"securityStyle,omitempty"`
ThroughputMibps *float64 `json:"throughputMibps,omitempty"`
}
@@ -2949,9 +2949,6 @@ func (vp VolumeProperties) MarshalJSON() ([]byte, error) {
if vp.SubnetID != nil {
objectMap["subnetId"] = vp.SubnetID
}
- if vp.MountTargets != nil {
- objectMap["mountTargets"] = vp.MountTargets
- }
if vp.VolumeType != nil {
objectMap["volumeType"] = vp.VolumeType
}
diff --git a/services/netapp/mgmt/2020-06-01/netapp/operations.go b/services/netapp/mgmt/2020-06-01/netapp/operations.go
index 9256ad902b0a..22744f8e67be 100644
--- a/services/netapp/mgmt/2020-06-01/netapp/operations.go
+++ b/services/netapp/mgmt/2020-06-01/netapp/operations.go
@@ -14,7 +14,7 @@ import (
"net/http"
)
-// OperationsClient is the microsoft NetApp Azure Resource Provider specification
+// OperationsClient is the microsoft NetApp Files Azure Resource Provider specification
type OperationsClient struct {
BaseClient
}
diff --git a/services/netapp/mgmt/2020-06-01/netapp/pools.go b/services/netapp/mgmt/2020-06-01/netapp/pools.go
index 5e6ba10d67d2..423bbfe77be3 100644
--- a/services/netapp/mgmt/2020-06-01/netapp/pools.go
+++ b/services/netapp/mgmt/2020-06-01/netapp/pools.go
@@ -15,7 +15,7 @@ import (
"net/http"
)
-// PoolsClient is the microsoft NetApp Azure Resource Provider specification
+// PoolsClient is the microsoft NetApp Files Azure Resource Provider specification
type PoolsClient struct {
BaseClient
}
diff --git a/services/netapp/mgmt/2020-06-01/netapp/resource.go b/services/netapp/mgmt/2020-06-01/netapp/resource.go
index 3a40f15944d5..775354c89072 100644
--- a/services/netapp/mgmt/2020-06-01/netapp/resource.go
+++ b/services/netapp/mgmt/2020-06-01/netapp/resource.go
@@ -15,7 +15,7 @@ import (
"net/http"
)
-// ResourceClient is the microsoft NetApp Azure Resource Provider specification
+// ResourceClient is the microsoft NetApp Files Azure Resource Provider specification
type ResourceClient struct {
BaseClient
}
diff --git a/services/netapp/mgmt/2020-06-01/netapp/snapshotpolicies.go b/services/netapp/mgmt/2020-06-01/netapp/snapshotpolicies.go
index 2077e0b98a47..3f5d8f73cc01 100644
--- a/services/netapp/mgmt/2020-06-01/netapp/snapshotpolicies.go
+++ b/services/netapp/mgmt/2020-06-01/netapp/snapshotpolicies.go
@@ -15,7 +15,7 @@ import (
"net/http"
)
-// SnapshotPoliciesClient is the microsoft NetApp Azure Resource Provider specification
+// SnapshotPoliciesClient is the microsoft NetApp Files Azure Resource Provider specification
type SnapshotPoliciesClient struct {
BaseClient
}
@@ -37,7 +37,7 @@ func NewSnapshotPoliciesClientWithBaseURI(baseURI string, subscriptionID string)
// body - snapshot policy object supplied in the body of the operation.
// resourceGroupName - the name of the resource group.
// accountName - the name of the NetApp account
-// snapshotPolicyName - the name of the snapshot policy target
+// snapshotPolicyName - the name of the snapshot policy
func (client SnapshotPoliciesClient) Create(ctx context.Context, body SnapshotPolicy, resourceGroupName string, accountName string, snapshotPolicyName string) (result SnapshotPolicy, err error) {
if tracing.IsEnabled() {
ctx = tracing.StartSpan(ctx, fqdn+"/SnapshotPoliciesClient.Create")
@@ -131,7 +131,7 @@ func (client SnapshotPoliciesClient) CreateResponder(resp *http.Response) (resul
// Parameters:
// resourceGroupName - the name of the resource group.
// accountName - the name of the NetApp account
-// snapshotPolicyName - the name of the snapshot policy target
+// snapshotPolicyName - the name of the snapshot policy
func (client SnapshotPoliciesClient) Delete(ctx context.Context, resourceGroupName string, accountName string, snapshotPolicyName string) (result SnapshotPoliciesDeleteFuture, err error) {
if tracing.IsEnabled() {
ctx = tracing.StartSpan(ctx, fqdn+"/SnapshotPoliciesClient.Delete")
@@ -219,7 +219,7 @@ func (client SnapshotPoliciesClient) DeleteResponder(resp *http.Response) (resul
// Parameters:
// resourceGroupName - the name of the resource group.
// accountName - the name of the NetApp account
-// snapshotPolicyName - the name of the snapshot policy target
+// snapshotPolicyName - the name of the snapshot policy
func (client SnapshotPoliciesClient) Get(ctx context.Context, resourceGroupName string, accountName string, snapshotPolicyName string) (result SnapshotPolicy, err error) {
if tracing.IsEnabled() {
ctx = tracing.StartSpan(ctx, fqdn+"/SnapshotPoliciesClient.Get")
@@ -389,7 +389,7 @@ func (client SnapshotPoliciesClient) ListResponder(resp *http.Response) (result
// Parameters:
// resourceGroupName - the name of the resource group.
// accountName - the name of the NetApp account
-// snapshotPolicyName - the name of the snapshot policy target
+// snapshotPolicyName - the name of the snapshot policy
func (client SnapshotPoliciesClient) ListVolumes(ctx context.Context, resourceGroupName string, accountName string, snapshotPolicyName string) (result SnapshotPolicyVolumeList, err error) {
if tracing.IsEnabled() {
ctx = tracing.StartSpan(ctx, fqdn+"/SnapshotPoliciesClient.ListVolumes")
@@ -476,7 +476,7 @@ func (client SnapshotPoliciesClient) ListVolumesResponder(resp *http.Response) (
// body - snapshot policy object supplied in the body of the operation.
// resourceGroupName - the name of the resource group.
// accountName - the name of the NetApp account
-// snapshotPolicyName - the name of the snapshot policy target
+// snapshotPolicyName - the name of the snapshot policy
func (client SnapshotPoliciesClient) Update(ctx context.Context, body SnapshotPolicyPatch, resourceGroupName string, accountName string, snapshotPolicyName string) (result SnapshotPolicy, err error) {
if tracing.IsEnabled() {
ctx = tracing.StartSpan(ctx, fqdn+"/SnapshotPoliciesClient.Update")
diff --git a/services/netapp/mgmt/2020-06-01/netapp/snapshots.go b/services/netapp/mgmt/2020-06-01/netapp/snapshots.go
index e608ce1f7fbe..ab4255463f62 100644
--- a/services/netapp/mgmt/2020-06-01/netapp/snapshots.go
+++ b/services/netapp/mgmt/2020-06-01/netapp/snapshots.go
@@ -15,7 +15,7 @@ import (
"net/http"
)
-// SnapshotsClient is the microsoft NetApp Azure Resource Provider specification
+// SnapshotsClient is the microsoft NetApp Files Azure Resource Provider specification
type SnapshotsClient struct {
BaseClient
}
@@ -38,7 +38,7 @@ func NewSnapshotsClientWithBaseURI(baseURI string, subscriptionID string) Snapsh
// accountName - the name of the NetApp account
// poolName - the name of the capacity pool
// volumeName - the name of the volume
-// snapshotName - the name of the mount target
+// snapshotName - the name of the snapshot
func (client SnapshotsClient) Create(ctx context.Context, body Snapshot, resourceGroupName string, accountName string, poolName string, volumeName string, snapshotName string) (result SnapshotsCreateFuture, err error) {
if tracing.IsEnabled() {
ctx = tracing.StartSpan(ctx, fqdn+"/SnapshotsClient.Create")
@@ -153,7 +153,7 @@ func (client SnapshotsClient) CreateResponder(resp *http.Response) (result Snaps
// accountName - the name of the NetApp account
// poolName - the name of the capacity pool
// volumeName - the name of the volume
-// snapshotName - the name of the mount target
+// snapshotName - the name of the snapshot
func (client SnapshotsClient) Delete(ctx context.Context, resourceGroupName string, accountName string, poolName string, volumeName string, snapshotName string) (result SnapshotsDeleteFuture, err error) {
if tracing.IsEnabled() {
ctx = tracing.StartSpan(ctx, fqdn+"/SnapshotsClient.Delete")
@@ -253,7 +253,7 @@ func (client SnapshotsClient) DeleteResponder(resp *http.Response) (result autor
// accountName - the name of the NetApp account
// poolName - the name of the capacity pool
// volumeName - the name of the volume
-// snapshotName - the name of the mount target
+// snapshotName - the name of the snapshot
func (client SnapshotsClient) Get(ctx context.Context, resourceGroupName string, accountName string, poolName string, volumeName string, snapshotName string) (result Snapshot, err error) {
if tracing.IsEnabled() {
ctx = tracing.StartSpan(ctx, fqdn+"/SnapshotsClient.Get")
@@ -448,7 +448,7 @@ func (client SnapshotsClient) ListResponder(resp *http.Response) (result Snapsho
// accountName - the name of the NetApp account
// poolName - the name of the capacity pool
// volumeName - the name of the volume
-// snapshotName - the name of the mount target
+// snapshotName - the name of the snapshot
func (client SnapshotsClient) Update(ctx context.Context, body interface{}, resourceGroupName string, accountName string, poolName string, volumeName string, snapshotName string) (result SnapshotsUpdateFuture, err error) {
if tracing.IsEnabled() {
ctx = tracing.StartSpan(ctx, fqdn+"/SnapshotsClient.Update")
diff --git a/services/netapp/mgmt/2020-06-01/netapp/vaults.go b/services/netapp/mgmt/2020-06-01/netapp/vaults.go
index c308b6d86675..bce0b7f68f01 100644
--- a/services/netapp/mgmt/2020-06-01/netapp/vaults.go
+++ b/services/netapp/mgmt/2020-06-01/netapp/vaults.go
@@ -15,7 +15,7 @@ import (
"net/http"
)
-// VaultsClient is the microsoft NetApp Azure Resource Provider specification
+// VaultsClient is the microsoft NetApp Files Azure Resource Provider specification
type VaultsClient struct {
BaseClient
}
diff --git a/services/netapp/mgmt/2020-06-01/netapp/volumes.go b/services/netapp/mgmt/2020-06-01/netapp/volumes.go
index 48d962368910..13ad86252ffe 100644
--- a/services/netapp/mgmt/2020-06-01/netapp/volumes.go
+++ b/services/netapp/mgmt/2020-06-01/netapp/volumes.go
@@ -15,7 +15,7 @@ import (
"net/http"
)
-// VolumesClient is the microsoft NetApp Azure Resource Provider specification
+// VolumesClient is the microsoft NetApp Files Azure Resource Provider specification
type VolumesClient struct {
BaseClient
}
@@ -294,7 +294,7 @@ func (client VolumesClient) CreateOrUpdate(ctx context.Context, body Volume, res
}},
{Target: "body.VolumeProperties.ThroughputMibps", Name: validation.Null, Rule: false,
Chain: []validation.Constraint{{Target: "body.VolumeProperties.ThroughputMibps", Name: validation.InclusiveMaximum, Rule: float64(4500), Chain: nil},
- {Target: "body.VolumeProperties.ThroughputMibps", Name: validation.InclusiveMinimum, Rule: float64(1), Chain: nil},
+ {Target: "body.VolumeProperties.ThroughputMibps", Name: validation.InclusiveMinimum, Rule: float64(0), Chain: nil},
{Target: "body.VolumeProperties.ThroughputMibps", Name: validation.MultipleOf, Rule: 0.001, Chain: nil},
}},
}}}},
@@ -1065,7 +1065,7 @@ func (client VolumesClient) ReplicationStatusMethodResponder(resp *http.Response
}
// ResyncReplication resync the connection on the destination volume. If the operation is ran on the source volume it
-// will reverse-resync the connection and sync from source to destination.
+// will reverse-resync the connection and sync from destination to source.
// Parameters:
// resourceGroupName - the name of the resource group.
// accountName - the name of the NetApp account
diff --git a/services/netapp/mgmt/2020-07-01/netapp/CHANGELOG.md b/services/netapp/mgmt/2020-07-01/netapp/CHANGELOG.md
index 52911e4cc5e4..a5415c33a3a9 100644
--- a/services/netapp/mgmt/2020-07-01/netapp/CHANGELOG.md
+++ b/services/netapp/mgmt/2020-07-01/netapp/CHANGELOG.md
@@ -1,2 +1,29 @@
-# Change History
+# Unreleased
+## Breaking Changes
+
+### Removed Constants
+
+1. QosType.Auto
+
+### Signature Changes
+
+#### Const Types
+
+1. Manual changed type from QosType to BackupType
+
+#### Struct Fields
+
+1. BackupProperties.BackupType changed type from *string to BackupType
+
+## Additive Changes
+
+### New Constants
+
+1. BackupType.Scheduled
+1. QosType.QosTypeAuto
+1. QosType.QosTypeManual
+
+### New Funcs
+
+1. PossibleBackupTypeValues() []BackupType
diff --git a/services/netapp/mgmt/2020-07-01/netapp/_meta.json b/services/netapp/mgmt/2020-07-01/netapp/_meta.json
index f0df3b4f0fc1..47a40b2282bb 100644
--- a/services/netapp/mgmt/2020-07-01/netapp/_meta.json
+++ b/services/netapp/mgmt/2020-07-01/netapp/_meta.json
@@ -1,5 +1,5 @@
{
- "commit": "3c764635e7d442b3e74caf593029fcd440b3ef82",
+ "commit": "ed4b29fbceaea3cc48f039826db5a92360bc7c56",
"readme": "/_/azure-rest-api-specs/specification/netapp/resource-manager/readme.md",
"tag": "package-netapp-2020-07-01",
"use": "@microsoft.azure/autorest.go@2.1.187",
diff --git a/services/netapp/mgmt/2020-07-01/netapp/accountbackups.go b/services/netapp/mgmt/2020-07-01/netapp/accountbackups.go
index 78f46d192e3a..3657f07bbb29 100644
--- a/services/netapp/mgmt/2020-07-01/netapp/accountbackups.go
+++ b/services/netapp/mgmt/2020-07-01/netapp/accountbackups.go
@@ -15,7 +15,7 @@ import (
"net/http"
)
-// AccountBackupsClient is the microsoft NetApp Azure Resource Provider specification
+// AccountBackupsClient is the microsoft NetApp Files Azure Resource Provider specification
type AccountBackupsClient struct {
BaseClient
}
diff --git a/services/netapp/mgmt/2020-07-01/netapp/accounts.go b/services/netapp/mgmt/2020-07-01/netapp/accounts.go
index 2fe2ccd8c004..a345e90082a1 100644
--- a/services/netapp/mgmt/2020-07-01/netapp/accounts.go
+++ b/services/netapp/mgmt/2020-07-01/netapp/accounts.go
@@ -15,7 +15,7 @@ import (
"net/http"
)
-// AccountsClient is the microsoft NetApp Azure Resource Provider specification
+// AccountsClient is the microsoft NetApp Files Azure Resource Provider specification
type AccountsClient struct {
BaseClient
}
diff --git a/services/netapp/mgmt/2020-07-01/netapp/backuppolicies.go b/services/netapp/mgmt/2020-07-01/netapp/backuppolicies.go
index d1bf6d54152f..74369f311ee1 100644
--- a/services/netapp/mgmt/2020-07-01/netapp/backuppolicies.go
+++ b/services/netapp/mgmt/2020-07-01/netapp/backuppolicies.go
@@ -15,7 +15,7 @@ import (
"net/http"
)
-// BackupPoliciesClient is the microsoft NetApp Azure Resource Provider specification
+// BackupPoliciesClient is the microsoft NetApp Files Azure Resource Provider specification
type BackupPoliciesClient struct {
BaseClient
}
diff --git a/services/netapp/mgmt/2020-07-01/netapp/backups.go b/services/netapp/mgmt/2020-07-01/netapp/backups.go
index a9f7671828f7..6176973132b4 100644
--- a/services/netapp/mgmt/2020-07-01/netapp/backups.go
+++ b/services/netapp/mgmt/2020-07-01/netapp/backups.go
@@ -15,7 +15,7 @@ import (
"net/http"
)
-// BackupsClient is the microsoft NetApp Azure Resource Provider specification
+// BackupsClient is the microsoft NetApp Files Azure Resource Provider specification
type BackupsClient struct {
BaseClient
}
diff --git a/services/netapp/mgmt/2020-07-01/netapp/client.go b/services/netapp/mgmt/2020-07-01/netapp/client.go
index a0ae054469a1..5a6893197b54 100644
--- a/services/netapp/mgmt/2020-07-01/netapp/client.go
+++ b/services/netapp/mgmt/2020-07-01/netapp/client.go
@@ -1,6 +1,6 @@
// Package netapp implements the Azure ARM Netapp service API version 2020-07-01.
//
-// Microsoft NetApp Azure Resource Provider specification
+// Microsoft NetApp Files Azure Resource Provider specification
package netapp
// Copyright (c) Microsoft Corporation. All rights reserved.
diff --git a/services/netapp/mgmt/2020-07-01/netapp/enums.go b/services/netapp/mgmt/2020-07-01/netapp/enums.go
index d9a077191155..42e74827d9c3 100644
--- a/services/netapp/mgmt/2020-07-01/netapp/enums.go
+++ b/services/netapp/mgmt/2020-07-01/netapp/enums.go
@@ -27,6 +27,21 @@ func PossibleActiveDirectoryStatusValues() []ActiveDirectoryStatus {
return []ActiveDirectoryStatus{Created, Deleted, Error, InUse, Updating}
}
+// BackupType enumerates the values for backup type.
+type BackupType string
+
+const (
+ // Manual Manual backup
+ Manual BackupType = "Manual"
+ // Scheduled Scheduled backup
+ Scheduled BackupType = "Scheduled"
+)
+
+// PossibleBackupTypeValues returns an array of possible values for the BackupType const type.
+func PossibleBackupTypeValues() []BackupType {
+ return []BackupType{Manual, Scheduled}
+}
+
// CheckNameResourceTypes enumerates the values for check name resource types.
type CheckNameResourceTypes string
@@ -116,15 +131,15 @@ func PossibleMirrorStateValues() []MirrorState {
type QosType string
const (
- // Auto qos type Auto
- Auto QosType = "Auto"
- // Manual qos type Manual
- Manual QosType = "Manual"
+ // QosTypeAuto qos type Auto
+ QosTypeAuto QosType = "Auto"
+ // QosTypeManual qos type Manual
+ QosTypeManual QosType = "Manual"
)
// PossibleQosTypeValues returns an array of possible values for the QosType const type.
func PossibleQosTypeValues() []QosType {
- return []QosType{Auto, Manual}
+ return []QosType{QosTypeAuto, QosTypeManual}
}
// RelationshipStatus enumerates the values for relationship status.
diff --git a/services/netapp/mgmt/2020-07-01/netapp/models.go b/services/netapp/mgmt/2020-07-01/netapp/models.go
index b9d239662b86..3ec73a4b4f0b 100644
--- a/services/netapp/mgmt/2020-07-01/netapp/models.go
+++ b/services/netapp/mgmt/2020-07-01/netapp/models.go
@@ -1082,8 +1082,8 @@ type BackupProperties struct {
Size *int64 `json:"size,omitempty"`
// Label - Label for backup
Label *string `json:"label,omitempty"`
- // BackupType - READ-ONLY; Type of backup adhoc or scheduled
- BackupType *string `json:"backupType,omitempty"`
+ // BackupType - READ-ONLY; Type of backup Manual or Scheduled. Possible values include: 'Manual', 'Scheduled'
+ BackupType BackupType `json:"backupType,omitempty"`
}
// MarshalJSON is the custom marshaler for BackupProperties.
@@ -1746,7 +1746,7 @@ type PoolChangeRequest struct {
type PoolPatchProperties struct {
// Size - Provisioned size of the pool (in bytes). Allowed values are in 4TiB chunks (value must be multiply of 4398046511104).
Size *int64 `json:"size,omitempty"`
- // QosType - The qos type of the pool. Possible values include: 'Auto', 'Manual'
+ // QosType - The qos type of the pool. Possible values include: 'QosTypeAuto', 'QosTypeManual'
QosType QosType `json:"qosType,omitempty"`
}
@@ -1764,7 +1764,7 @@ type PoolProperties struct {
TotalThroughputMibps *float64 `json:"totalThroughputMibps,omitempty"`
// UtilizedThroughputMibps - READ-ONLY; Utilized throughput of pool in Mibps
UtilizedThroughputMibps *float64 `json:"utilizedThroughputMibps,omitempty"`
- // QosType - The qos type of the pool. Possible values include: 'Auto', 'Manual'
+ // QosType - The qos type of the pool. Possible values include: 'QosTypeAuto', 'QosTypeManual'
QosType QosType `json:"qosType,omitempty"`
}
@@ -2950,7 +2950,7 @@ type VolumeProperties struct {
UsageThreshold *int64 `json:"usageThreshold,omitempty"`
// ExportPolicy - Set of export policy rules
ExportPolicy *VolumePropertiesExportPolicy `json:"exportPolicy,omitempty"`
- // ProtocolTypes - Set of protocol types
+ // ProtocolTypes - Set of protocol types, default NFSv3, CIFS for SMB protocol
ProtocolTypes *[]string `json:"protocolTypes,omitempty"`
// ProvisioningState - READ-ONLY; Azure lifecycle management
ProvisioningState *string `json:"provisioningState,omitempty"`
@@ -2962,7 +2962,7 @@ type VolumeProperties struct {
BaremetalTenantID *string `json:"baremetalTenantId,omitempty"`
// SubnetID - The Azure Resource URI for a delegated subnet. Must have the delegation Microsoft.NetApp/volumes
SubnetID *string `json:"subnetId,omitempty"`
- // MountTargets - List of mount targets
+ // MountTargets - READ-ONLY; List of mount targets
MountTargets *[]MountTargetProperties `json:"mountTargets,omitempty"`
// VolumeType - What type of volume is this
VolumeType *string `json:"volumeType,omitempty"`
@@ -2974,7 +2974,7 @@ type VolumeProperties struct {
SnapshotDirectoryVisible *bool `json:"snapshotDirectoryVisible,omitempty"`
// KerberosEnabled - Describe if a volume is KerberosEnabled. To be use with swagger version 2020-05-01 or later
KerberosEnabled *bool `json:"kerberosEnabled,omitempty"`
- // SecurityStyle - The security style of volume. Possible values include: 'Ntfs', 'Unix'
+ // SecurityStyle - The security style of volume, default unix, ntfs for dual protocol or CIFS protocol. Possible values include: 'Ntfs', 'Unix'
SecurityStyle SecurityStyle `json:"securityStyle,omitempty"`
ThroughputMibps *float64 `json:"throughputMibps,omitempty"`
}
@@ -3006,9 +3006,6 @@ func (vp VolumeProperties) MarshalJSON() ([]byte, error) {
if vp.SubnetID != nil {
objectMap["subnetId"] = vp.SubnetID
}
- if vp.MountTargets != nil {
- objectMap["mountTargets"] = vp.MountTargets
- }
if vp.VolumeType != nil {
objectMap["volumeType"] = vp.VolumeType
}
diff --git a/services/netapp/mgmt/2020-07-01/netapp/operations.go b/services/netapp/mgmt/2020-07-01/netapp/operations.go
index 26ee654839fd..2cf7c028e920 100644
--- a/services/netapp/mgmt/2020-07-01/netapp/operations.go
+++ b/services/netapp/mgmt/2020-07-01/netapp/operations.go
@@ -14,7 +14,7 @@ import (
"net/http"
)
-// OperationsClient is the microsoft NetApp Azure Resource Provider specification
+// OperationsClient is the microsoft NetApp Files Azure Resource Provider specification
type OperationsClient struct {
BaseClient
}
diff --git a/services/netapp/mgmt/2020-07-01/netapp/pools.go b/services/netapp/mgmt/2020-07-01/netapp/pools.go
index 022a7206b046..fbb07c1cb110 100644
--- a/services/netapp/mgmt/2020-07-01/netapp/pools.go
+++ b/services/netapp/mgmt/2020-07-01/netapp/pools.go
@@ -15,7 +15,7 @@ import (
"net/http"
)
-// PoolsClient is the microsoft NetApp Azure Resource Provider specification
+// PoolsClient is the microsoft NetApp Files Azure Resource Provider specification
type PoolsClient struct {
BaseClient
}
diff --git a/services/netapp/mgmt/2020-07-01/netapp/resource.go b/services/netapp/mgmt/2020-07-01/netapp/resource.go
index ff34c4d8a8e3..891ef423127c 100644
--- a/services/netapp/mgmt/2020-07-01/netapp/resource.go
+++ b/services/netapp/mgmt/2020-07-01/netapp/resource.go
@@ -15,7 +15,7 @@ import (
"net/http"
)
-// ResourceClient is the microsoft NetApp Azure Resource Provider specification
+// ResourceClient is the microsoft NetApp Files Azure Resource Provider specification
type ResourceClient struct {
BaseClient
}
diff --git a/services/netapp/mgmt/2020-07-01/netapp/snapshotpolicies.go b/services/netapp/mgmt/2020-07-01/netapp/snapshotpolicies.go
index 4a6c0d2a4a44..8e5cf0711413 100644
--- a/services/netapp/mgmt/2020-07-01/netapp/snapshotpolicies.go
+++ b/services/netapp/mgmt/2020-07-01/netapp/snapshotpolicies.go
@@ -15,7 +15,7 @@ import (
"net/http"
)
-// SnapshotPoliciesClient is the microsoft NetApp Azure Resource Provider specification
+// SnapshotPoliciesClient is the microsoft NetApp Files Azure Resource Provider specification
type SnapshotPoliciesClient struct {
BaseClient
}
@@ -37,7 +37,7 @@ func NewSnapshotPoliciesClientWithBaseURI(baseURI string, subscriptionID string)
// body - snapshot policy object supplied in the body of the operation.
// resourceGroupName - the name of the resource group.
// accountName - the name of the NetApp account
-// snapshotPolicyName - the name of the snapshot policy target
+// snapshotPolicyName - the name of the snapshot policy
func (client SnapshotPoliciesClient) Create(ctx context.Context, body SnapshotPolicy, resourceGroupName string, accountName string, snapshotPolicyName string) (result SnapshotPolicy, err error) {
if tracing.IsEnabled() {
ctx = tracing.StartSpan(ctx, fqdn+"/SnapshotPoliciesClient.Create")
@@ -131,7 +131,7 @@ func (client SnapshotPoliciesClient) CreateResponder(resp *http.Response) (resul
// Parameters:
// resourceGroupName - the name of the resource group.
// accountName - the name of the NetApp account
-// snapshotPolicyName - the name of the snapshot policy target
+// snapshotPolicyName - the name of the snapshot policy
func (client SnapshotPoliciesClient) Delete(ctx context.Context, resourceGroupName string, accountName string, snapshotPolicyName string) (result SnapshotPoliciesDeleteFuture, err error) {
if tracing.IsEnabled() {
ctx = tracing.StartSpan(ctx, fqdn+"/SnapshotPoliciesClient.Delete")
@@ -219,7 +219,7 @@ func (client SnapshotPoliciesClient) DeleteResponder(resp *http.Response) (resul
// Parameters:
// resourceGroupName - the name of the resource group.
// accountName - the name of the NetApp account
-// snapshotPolicyName - the name of the snapshot policy target
+// snapshotPolicyName - the name of the snapshot policy
func (client SnapshotPoliciesClient) Get(ctx context.Context, resourceGroupName string, accountName string, snapshotPolicyName string) (result SnapshotPolicy, err error) {
if tracing.IsEnabled() {
ctx = tracing.StartSpan(ctx, fqdn+"/SnapshotPoliciesClient.Get")
@@ -389,7 +389,7 @@ func (client SnapshotPoliciesClient) ListResponder(resp *http.Response) (result
// Parameters:
// resourceGroupName - the name of the resource group.
// accountName - the name of the NetApp account
-// snapshotPolicyName - the name of the snapshot policy target
+// snapshotPolicyName - the name of the snapshot policy
func (client SnapshotPoliciesClient) ListVolumes(ctx context.Context, resourceGroupName string, accountName string, snapshotPolicyName string) (result SnapshotPolicyVolumeList, err error) {
if tracing.IsEnabled() {
ctx = tracing.StartSpan(ctx, fqdn+"/SnapshotPoliciesClient.ListVolumes")
@@ -476,7 +476,7 @@ func (client SnapshotPoliciesClient) ListVolumesResponder(resp *http.Response) (
// body - snapshot policy object supplied in the body of the operation.
// resourceGroupName - the name of the resource group.
// accountName - the name of the NetApp account
-// snapshotPolicyName - the name of the snapshot policy target
+// snapshotPolicyName - the name of the snapshot policy
func (client SnapshotPoliciesClient) Update(ctx context.Context, body SnapshotPolicyPatch, resourceGroupName string, accountName string, snapshotPolicyName string) (result SnapshotPolicy, err error) {
if tracing.IsEnabled() {
ctx = tracing.StartSpan(ctx, fqdn+"/SnapshotPoliciesClient.Update")
diff --git a/services/netapp/mgmt/2020-07-01/netapp/snapshots.go b/services/netapp/mgmt/2020-07-01/netapp/snapshots.go
index c114e8eeff34..ad0a901bfd21 100644
--- a/services/netapp/mgmt/2020-07-01/netapp/snapshots.go
+++ b/services/netapp/mgmt/2020-07-01/netapp/snapshots.go
@@ -15,7 +15,7 @@ import (
"net/http"
)
-// SnapshotsClient is the microsoft NetApp Azure Resource Provider specification
+// SnapshotsClient is the microsoft NetApp Files Azure Resource Provider specification
type SnapshotsClient struct {
BaseClient
}
@@ -38,7 +38,7 @@ func NewSnapshotsClientWithBaseURI(baseURI string, subscriptionID string) Snapsh
// accountName - the name of the NetApp account
// poolName - the name of the capacity pool
// volumeName - the name of the volume
-// snapshotName - the name of the mount target
+// snapshotName - the name of the snapshot
func (client SnapshotsClient) Create(ctx context.Context, body Snapshot, resourceGroupName string, accountName string, poolName string, volumeName string, snapshotName string) (result SnapshotsCreateFuture, err error) {
if tracing.IsEnabled() {
ctx = tracing.StartSpan(ctx, fqdn+"/SnapshotsClient.Create")
@@ -153,7 +153,7 @@ func (client SnapshotsClient) CreateResponder(resp *http.Response) (result Snaps
// accountName - the name of the NetApp account
// poolName - the name of the capacity pool
// volumeName - the name of the volume
-// snapshotName - the name of the mount target
+// snapshotName - the name of the snapshot
func (client SnapshotsClient) Delete(ctx context.Context, resourceGroupName string, accountName string, poolName string, volumeName string, snapshotName string) (result SnapshotsDeleteFuture, err error) {
if tracing.IsEnabled() {
ctx = tracing.StartSpan(ctx, fqdn+"/SnapshotsClient.Delete")
@@ -253,7 +253,7 @@ func (client SnapshotsClient) DeleteResponder(resp *http.Response) (result autor
// accountName - the name of the NetApp account
// poolName - the name of the capacity pool
// volumeName - the name of the volume
-// snapshotName - the name of the mount target
+// snapshotName - the name of the snapshot
func (client SnapshotsClient) Get(ctx context.Context, resourceGroupName string, accountName string, poolName string, volumeName string, snapshotName string) (result Snapshot, err error) {
if tracing.IsEnabled() {
ctx = tracing.StartSpan(ctx, fqdn+"/SnapshotsClient.Get")
@@ -448,7 +448,7 @@ func (client SnapshotsClient) ListResponder(resp *http.Response) (result Snapsho
// accountName - the name of the NetApp account
// poolName - the name of the capacity pool
// volumeName - the name of the volume
-// snapshotName - the name of the mount target
+// snapshotName - the name of the snapshot
func (client SnapshotsClient) Update(ctx context.Context, body interface{}, resourceGroupName string, accountName string, poolName string, volumeName string, snapshotName string) (result SnapshotsUpdateFuture, err error) {
if tracing.IsEnabled() {
ctx = tracing.StartSpan(ctx, fqdn+"/SnapshotsClient.Update")
diff --git a/services/netapp/mgmt/2020-07-01/netapp/vaults.go b/services/netapp/mgmt/2020-07-01/netapp/vaults.go
index 0a15202a2515..6ac627de1be2 100644
--- a/services/netapp/mgmt/2020-07-01/netapp/vaults.go
+++ b/services/netapp/mgmt/2020-07-01/netapp/vaults.go
@@ -15,7 +15,7 @@ import (
"net/http"
)
-// VaultsClient is the microsoft NetApp Azure Resource Provider specification
+// VaultsClient is the microsoft NetApp Files Azure Resource Provider specification
type VaultsClient struct {
BaseClient
}
diff --git a/services/netapp/mgmt/2020-07-01/netapp/volumes.go b/services/netapp/mgmt/2020-07-01/netapp/volumes.go
index 0455daff10c5..709300346502 100644
--- a/services/netapp/mgmt/2020-07-01/netapp/volumes.go
+++ b/services/netapp/mgmt/2020-07-01/netapp/volumes.go
@@ -15,7 +15,7 @@ import (
"net/http"
)
-// VolumesClient is the microsoft NetApp Azure Resource Provider specification
+// VolumesClient is the microsoft NetApp Files Azure Resource Provider specification
type VolumesClient struct {
BaseClient
}
@@ -289,7 +289,7 @@ func (client VolumesClient) CreateOrUpdate(ctx context.Context, body Volume, res
}},
{Target: "body.VolumeProperties.ThroughputMibps", Name: validation.Null, Rule: false,
Chain: []validation.Constraint{{Target: "body.VolumeProperties.ThroughputMibps", Name: validation.InclusiveMaximum, Rule: float64(4500), Chain: nil},
- {Target: "body.VolumeProperties.ThroughputMibps", Name: validation.InclusiveMinimum, Rule: float64(1), Chain: nil},
+ {Target: "body.VolumeProperties.ThroughputMibps", Name: validation.InclusiveMinimum, Rule: float64(0), Chain: nil},
{Target: "body.VolumeProperties.ThroughputMibps", Name: validation.MultipleOf, Rule: 0.001, Chain: nil},
}},
}}}},
@@ -1060,7 +1060,7 @@ func (client VolumesClient) ReplicationStatusMethodResponder(resp *http.Response
}
// ResyncReplication resync the connection on the destination volume. If the operation is ran on the source volume it
-// will reverse-resync the connection and sync from source to destination.
+// will reverse-resync the connection and sync from destination to source.
// Parameters:
// resourceGroupName - the name of the resource group.
// accountName - the name of the NetApp account
diff --git a/services/netapp/mgmt/2020-08-01/netapp/CHANGELOG.md b/services/netapp/mgmt/2020-08-01/netapp/CHANGELOG.md
index 52911e4cc5e4..a5415c33a3a9 100644
--- a/services/netapp/mgmt/2020-08-01/netapp/CHANGELOG.md
+++ b/services/netapp/mgmt/2020-08-01/netapp/CHANGELOG.md
@@ -1,2 +1,29 @@
-# Change History
+# Unreleased
+## Breaking Changes
+
+### Removed Constants
+
+1. QosType.Auto
+
+### Signature Changes
+
+#### Const Types
+
+1. Manual changed type from QosType to BackupType
+
+#### Struct Fields
+
+1. BackupProperties.BackupType changed type from *string to BackupType
+
+## Additive Changes
+
+### New Constants
+
+1. BackupType.Scheduled
+1. QosType.QosTypeAuto
+1. QosType.QosTypeManual
+
+### New Funcs
+
+1. PossibleBackupTypeValues() []BackupType
diff --git a/services/netapp/mgmt/2020-08-01/netapp/_meta.json b/services/netapp/mgmt/2020-08-01/netapp/_meta.json
index 6b959d84c86e..945e7fa2de00 100644
--- a/services/netapp/mgmt/2020-08-01/netapp/_meta.json
+++ b/services/netapp/mgmt/2020-08-01/netapp/_meta.json
@@ -1,5 +1,5 @@
{
- "commit": "3c764635e7d442b3e74caf593029fcd440b3ef82",
+ "commit": "ed4b29fbceaea3cc48f039826db5a92360bc7c56",
"readme": "/_/azure-rest-api-specs/specification/netapp/resource-manager/readme.md",
"tag": "package-netapp-2020-08-01",
"use": "@microsoft.azure/autorest.go@2.1.187",
diff --git a/services/netapp/mgmt/2020-08-01/netapp/accountbackups.go b/services/netapp/mgmt/2020-08-01/netapp/accountbackups.go
index 2843c245c672..727726926735 100644
--- a/services/netapp/mgmt/2020-08-01/netapp/accountbackups.go
+++ b/services/netapp/mgmt/2020-08-01/netapp/accountbackups.go
@@ -15,7 +15,7 @@ import (
"net/http"
)
-// AccountBackupsClient is the microsoft NetApp Azure Resource Provider specification
+// AccountBackupsClient is the microsoft NetApp Files Azure Resource Provider specification
type AccountBackupsClient struct {
BaseClient
}
diff --git a/services/netapp/mgmt/2020-08-01/netapp/accounts.go b/services/netapp/mgmt/2020-08-01/netapp/accounts.go
index dcd65b3af8a7..f348e232cb18 100644
--- a/services/netapp/mgmt/2020-08-01/netapp/accounts.go
+++ b/services/netapp/mgmt/2020-08-01/netapp/accounts.go
@@ -15,7 +15,7 @@ import (
"net/http"
)
-// AccountsClient is the microsoft NetApp Azure Resource Provider specification
+// AccountsClient is the microsoft NetApp Files Azure Resource Provider specification
type AccountsClient struct {
BaseClient
}
diff --git a/services/netapp/mgmt/2020-08-01/netapp/backuppolicies.go b/services/netapp/mgmt/2020-08-01/netapp/backuppolicies.go
index 783e2a59e4ee..7629073afa89 100644
--- a/services/netapp/mgmt/2020-08-01/netapp/backuppolicies.go
+++ b/services/netapp/mgmt/2020-08-01/netapp/backuppolicies.go
@@ -15,7 +15,7 @@ import (
"net/http"
)
-// BackupPoliciesClient is the microsoft NetApp Azure Resource Provider specification
+// BackupPoliciesClient is the microsoft NetApp Files Azure Resource Provider specification
type BackupPoliciesClient struct {
BaseClient
}
diff --git a/services/netapp/mgmt/2020-08-01/netapp/backups.go b/services/netapp/mgmt/2020-08-01/netapp/backups.go
index bc581eb2c263..c78e7591229c 100644
--- a/services/netapp/mgmt/2020-08-01/netapp/backups.go
+++ b/services/netapp/mgmt/2020-08-01/netapp/backups.go
@@ -15,7 +15,7 @@ import (
"net/http"
)
-// BackupsClient is the microsoft NetApp Azure Resource Provider specification
+// BackupsClient is the microsoft NetApp Files Azure Resource Provider specification
type BackupsClient struct {
BaseClient
}
diff --git a/services/netapp/mgmt/2020-08-01/netapp/client.go b/services/netapp/mgmt/2020-08-01/netapp/client.go
index e57641d72fae..d023e93825f7 100644
--- a/services/netapp/mgmt/2020-08-01/netapp/client.go
+++ b/services/netapp/mgmt/2020-08-01/netapp/client.go
@@ -1,6 +1,6 @@
// Package netapp implements the Azure ARM Netapp service API version 2020-08-01.
//
-// Microsoft NetApp Azure Resource Provider specification
+// Microsoft NetApp Files Azure Resource Provider specification
package netapp
// Copyright (c) Microsoft Corporation. All rights reserved.
diff --git a/services/netapp/mgmt/2020-08-01/netapp/enums.go b/services/netapp/mgmt/2020-08-01/netapp/enums.go
index d9a077191155..42e74827d9c3 100644
--- a/services/netapp/mgmt/2020-08-01/netapp/enums.go
+++ b/services/netapp/mgmt/2020-08-01/netapp/enums.go
@@ -27,6 +27,21 @@ func PossibleActiveDirectoryStatusValues() []ActiveDirectoryStatus {
return []ActiveDirectoryStatus{Created, Deleted, Error, InUse, Updating}
}
+// BackupType enumerates the values for backup type.
+type BackupType string
+
+const (
+ // Manual Manual backup
+ Manual BackupType = "Manual"
+ // Scheduled Scheduled backup
+ Scheduled BackupType = "Scheduled"
+)
+
+// PossibleBackupTypeValues returns an array of possible values for the BackupType const type.
+func PossibleBackupTypeValues() []BackupType {
+ return []BackupType{Manual, Scheduled}
+}
+
// CheckNameResourceTypes enumerates the values for check name resource types.
type CheckNameResourceTypes string
@@ -116,15 +131,15 @@ func PossibleMirrorStateValues() []MirrorState {
type QosType string
const (
- // Auto qos type Auto
- Auto QosType = "Auto"
- // Manual qos type Manual
- Manual QosType = "Manual"
+ // QosTypeAuto qos type Auto
+ QosTypeAuto QosType = "Auto"
+ // QosTypeManual qos type Manual
+ QosTypeManual QosType = "Manual"
)
// PossibleQosTypeValues returns an array of possible values for the QosType const type.
func PossibleQosTypeValues() []QosType {
- return []QosType{Auto, Manual}
+ return []QosType{QosTypeAuto, QosTypeManual}
}
// RelationshipStatus enumerates the values for relationship status.
diff --git a/services/netapp/mgmt/2020-08-01/netapp/models.go b/services/netapp/mgmt/2020-08-01/netapp/models.go
index 9a764f7ea009..451a5808f6f2 100644
--- a/services/netapp/mgmt/2020-08-01/netapp/models.go
+++ b/services/netapp/mgmt/2020-08-01/netapp/models.go
@@ -1082,8 +1082,8 @@ type BackupProperties struct {
Size *int64 `json:"size,omitempty"`
// Label - Label for backup
Label *string `json:"label,omitempty"`
- // BackupType - READ-ONLY; Type of backup adhoc or scheduled
- BackupType *string `json:"backupType,omitempty"`
+ // BackupType - READ-ONLY; Type of backup Manual or Scheduled. Possible values include: 'Manual', 'Scheduled'
+ BackupType BackupType `json:"backupType,omitempty"`
}
// MarshalJSON is the custom marshaler for BackupProperties.
@@ -1746,7 +1746,7 @@ type PoolChangeRequest struct {
type PoolPatchProperties struct {
// Size - Provisioned size of the pool (in bytes). Allowed values are in 4TiB chunks (value must be multiply of 4398046511104).
Size *int64 `json:"size,omitempty"`
- // QosType - The qos type of the pool. Possible values include: 'Auto', 'Manual'
+ // QosType - The qos type of the pool. Possible values include: 'QosTypeAuto', 'QosTypeManual'
QosType QosType `json:"qosType,omitempty"`
}
@@ -1764,7 +1764,7 @@ type PoolProperties struct {
TotalThroughputMibps *float64 `json:"totalThroughputMibps,omitempty"`
// UtilizedThroughputMibps - READ-ONLY; Utilized throughput of pool in Mibps
UtilizedThroughputMibps *float64 `json:"utilizedThroughputMibps,omitempty"`
- // QosType - The qos type of the pool. Possible values include: 'Auto', 'Manual'
+ // QosType - The qos type of the pool. Possible values include: 'QosTypeAuto', 'QosTypeManual'
QosType QosType `json:"qosType,omitempty"`
}
@@ -2950,7 +2950,7 @@ type VolumeProperties struct {
UsageThreshold *int64 `json:"usageThreshold,omitempty"`
// ExportPolicy - Set of export policy rules
ExportPolicy *VolumePropertiesExportPolicy `json:"exportPolicy,omitempty"`
- // ProtocolTypes - Set of protocol types
+ // ProtocolTypes - Set of protocol types, default NFSv3, CIFS for SMB protocol
ProtocolTypes *[]string `json:"protocolTypes,omitempty"`
// ProvisioningState - READ-ONLY; Azure lifecycle management
ProvisioningState *string `json:"provisioningState,omitempty"`
@@ -2962,7 +2962,7 @@ type VolumeProperties struct {
BaremetalTenantID *string `json:"baremetalTenantId,omitempty"`
// SubnetID - The Azure Resource URI for a delegated subnet. Must have the delegation Microsoft.NetApp/volumes
SubnetID *string `json:"subnetId,omitempty"`
- // MountTargets - List of mount targets
+ // MountTargets - READ-ONLY; List of mount targets
MountTargets *[]MountTargetProperties `json:"mountTargets,omitempty"`
// VolumeType - What type of volume is this
VolumeType *string `json:"volumeType,omitempty"`
@@ -2974,7 +2974,7 @@ type VolumeProperties struct {
SnapshotDirectoryVisible *bool `json:"snapshotDirectoryVisible,omitempty"`
// KerberosEnabled - Describe if a volume is KerberosEnabled. To be use with swagger version 2020-05-01 or later
KerberosEnabled *bool `json:"kerberosEnabled,omitempty"`
- // SecurityStyle - The security style of volume. Possible values include: 'Ntfs', 'Unix'
+ // SecurityStyle - The security style of volume, default unix, ntfs for dual protocol or CIFS protocol. Possible values include: 'Ntfs', 'Unix'
SecurityStyle SecurityStyle `json:"securityStyle,omitempty"`
ThroughputMibps *float64 `json:"throughputMibps,omitempty"`
}
@@ -3006,9 +3006,6 @@ func (vp VolumeProperties) MarshalJSON() ([]byte, error) {
if vp.SubnetID != nil {
objectMap["subnetId"] = vp.SubnetID
}
- if vp.MountTargets != nil {
- objectMap["mountTargets"] = vp.MountTargets
- }
if vp.VolumeType != nil {
objectMap["volumeType"] = vp.VolumeType
}
diff --git a/services/netapp/mgmt/2020-08-01/netapp/operations.go b/services/netapp/mgmt/2020-08-01/netapp/operations.go
index a78ad44b22ef..a040d103bb9f 100644
--- a/services/netapp/mgmt/2020-08-01/netapp/operations.go
+++ b/services/netapp/mgmt/2020-08-01/netapp/operations.go
@@ -14,7 +14,7 @@ import (
"net/http"
)
-// OperationsClient is the microsoft NetApp Azure Resource Provider specification
+// OperationsClient is the microsoft NetApp Files Azure Resource Provider specification
type OperationsClient struct {
BaseClient
}
diff --git a/services/netapp/mgmt/2020-08-01/netapp/pools.go b/services/netapp/mgmt/2020-08-01/netapp/pools.go
index 9fc8ca2cb410..60ba82a43ecd 100644
--- a/services/netapp/mgmt/2020-08-01/netapp/pools.go
+++ b/services/netapp/mgmt/2020-08-01/netapp/pools.go
@@ -15,7 +15,7 @@ import (
"net/http"
)
-// PoolsClient is the microsoft NetApp Azure Resource Provider specification
+// PoolsClient is the microsoft NetApp Files Azure Resource Provider specification
type PoolsClient struct {
BaseClient
}
diff --git a/services/netapp/mgmt/2020-08-01/netapp/resource.go b/services/netapp/mgmt/2020-08-01/netapp/resource.go
index 8bcc741d0134..cfc2e81ec147 100644
--- a/services/netapp/mgmt/2020-08-01/netapp/resource.go
+++ b/services/netapp/mgmt/2020-08-01/netapp/resource.go
@@ -15,7 +15,7 @@ import (
"net/http"
)
-// ResourceClient is the microsoft NetApp Azure Resource Provider specification
+// ResourceClient is the microsoft NetApp Files Azure Resource Provider specification
type ResourceClient struct {
BaseClient
}
diff --git a/services/netapp/mgmt/2020-08-01/netapp/snapshotpolicies.go b/services/netapp/mgmt/2020-08-01/netapp/snapshotpolicies.go
index bbaed5880d0b..5a9ad4d9e1fa 100644
--- a/services/netapp/mgmt/2020-08-01/netapp/snapshotpolicies.go
+++ b/services/netapp/mgmt/2020-08-01/netapp/snapshotpolicies.go
@@ -15,7 +15,7 @@ import (
"net/http"
)
-// SnapshotPoliciesClient is the microsoft NetApp Azure Resource Provider specification
+// SnapshotPoliciesClient is the microsoft NetApp Files Azure Resource Provider specification
type SnapshotPoliciesClient struct {
BaseClient
}
@@ -37,7 +37,7 @@ func NewSnapshotPoliciesClientWithBaseURI(baseURI string, subscriptionID string)
// body - snapshot policy object supplied in the body of the operation.
// resourceGroupName - the name of the resource group.
// accountName - the name of the NetApp account
-// snapshotPolicyName - the name of the snapshot policy target
+// snapshotPolicyName - the name of the snapshot policy
func (client SnapshotPoliciesClient) Create(ctx context.Context, body SnapshotPolicy, resourceGroupName string, accountName string, snapshotPolicyName string) (result SnapshotPolicy, err error) {
if tracing.IsEnabled() {
ctx = tracing.StartSpan(ctx, fqdn+"/SnapshotPoliciesClient.Create")
@@ -131,7 +131,7 @@ func (client SnapshotPoliciesClient) CreateResponder(resp *http.Response) (resul
// Parameters:
// resourceGroupName - the name of the resource group.
// accountName - the name of the NetApp account
-// snapshotPolicyName - the name of the snapshot policy target
+// snapshotPolicyName - the name of the snapshot policy
func (client SnapshotPoliciesClient) Delete(ctx context.Context, resourceGroupName string, accountName string, snapshotPolicyName string) (result SnapshotPoliciesDeleteFuture, err error) {
if tracing.IsEnabled() {
ctx = tracing.StartSpan(ctx, fqdn+"/SnapshotPoliciesClient.Delete")
@@ -219,7 +219,7 @@ func (client SnapshotPoliciesClient) DeleteResponder(resp *http.Response) (resul
// Parameters:
// resourceGroupName - the name of the resource group.
// accountName - the name of the NetApp account
-// snapshotPolicyName - the name of the snapshot policy target
+// snapshotPolicyName - the name of the snapshot policy
func (client SnapshotPoliciesClient) Get(ctx context.Context, resourceGroupName string, accountName string, snapshotPolicyName string) (result SnapshotPolicy, err error) {
if tracing.IsEnabled() {
ctx = tracing.StartSpan(ctx, fqdn+"/SnapshotPoliciesClient.Get")
@@ -389,7 +389,7 @@ func (client SnapshotPoliciesClient) ListResponder(resp *http.Response) (result
// Parameters:
// resourceGroupName - the name of the resource group.
// accountName - the name of the NetApp account
-// snapshotPolicyName - the name of the snapshot policy target
+// snapshotPolicyName - the name of the snapshot policy
func (client SnapshotPoliciesClient) ListVolumes(ctx context.Context, resourceGroupName string, accountName string, snapshotPolicyName string) (result SnapshotPolicyVolumeList, err error) {
if tracing.IsEnabled() {
ctx = tracing.StartSpan(ctx, fqdn+"/SnapshotPoliciesClient.ListVolumes")
@@ -476,7 +476,7 @@ func (client SnapshotPoliciesClient) ListVolumesResponder(resp *http.Response) (
// body - snapshot policy object supplied in the body of the operation.
// resourceGroupName - the name of the resource group.
// accountName - the name of the NetApp account
-// snapshotPolicyName - the name of the snapshot policy target
+// snapshotPolicyName - the name of the snapshot policy
func (client SnapshotPoliciesClient) Update(ctx context.Context, body SnapshotPolicyPatch, resourceGroupName string, accountName string, snapshotPolicyName string) (result SnapshotPolicy, err error) {
if tracing.IsEnabled() {
ctx = tracing.StartSpan(ctx, fqdn+"/SnapshotPoliciesClient.Update")
diff --git a/services/netapp/mgmt/2020-08-01/netapp/snapshots.go b/services/netapp/mgmt/2020-08-01/netapp/snapshots.go
index a46020542b9f..33613168e32f 100644
--- a/services/netapp/mgmt/2020-08-01/netapp/snapshots.go
+++ b/services/netapp/mgmt/2020-08-01/netapp/snapshots.go
@@ -15,7 +15,7 @@ import (
"net/http"
)
-// SnapshotsClient is the microsoft NetApp Azure Resource Provider specification
+// SnapshotsClient is the microsoft NetApp Files Azure Resource Provider specification
type SnapshotsClient struct {
BaseClient
}
@@ -38,7 +38,7 @@ func NewSnapshotsClientWithBaseURI(baseURI string, subscriptionID string) Snapsh
// accountName - the name of the NetApp account
// poolName - the name of the capacity pool
// volumeName - the name of the volume
-// snapshotName - the name of the mount target
+// snapshotName - the name of the snapshot
func (client SnapshotsClient) Create(ctx context.Context, body Snapshot, resourceGroupName string, accountName string, poolName string, volumeName string, snapshotName string) (result SnapshotsCreateFuture, err error) {
if tracing.IsEnabled() {
ctx = tracing.StartSpan(ctx, fqdn+"/SnapshotsClient.Create")
@@ -153,7 +153,7 @@ func (client SnapshotsClient) CreateResponder(resp *http.Response) (result Snaps
// accountName - the name of the NetApp account
// poolName - the name of the capacity pool
// volumeName - the name of the volume
-// snapshotName - the name of the mount target
+// snapshotName - the name of the snapshot
func (client SnapshotsClient) Delete(ctx context.Context, resourceGroupName string, accountName string, poolName string, volumeName string, snapshotName string) (result SnapshotsDeleteFuture, err error) {
if tracing.IsEnabled() {
ctx = tracing.StartSpan(ctx, fqdn+"/SnapshotsClient.Delete")
@@ -253,7 +253,7 @@ func (client SnapshotsClient) DeleteResponder(resp *http.Response) (result autor
// accountName - the name of the NetApp account
// poolName - the name of the capacity pool
// volumeName - the name of the volume
-// snapshotName - the name of the mount target
+// snapshotName - the name of the snapshot
func (client SnapshotsClient) Get(ctx context.Context, resourceGroupName string, accountName string, poolName string, volumeName string, snapshotName string) (result Snapshot, err error) {
if tracing.IsEnabled() {
ctx = tracing.StartSpan(ctx, fqdn+"/SnapshotsClient.Get")
@@ -448,7 +448,7 @@ func (client SnapshotsClient) ListResponder(resp *http.Response) (result Snapsho
// accountName - the name of the NetApp account
// poolName - the name of the capacity pool
// volumeName - the name of the volume
-// snapshotName - the name of the mount target
+// snapshotName - the name of the snapshot
func (client SnapshotsClient) Update(ctx context.Context, body interface{}, resourceGroupName string, accountName string, poolName string, volumeName string, snapshotName string) (result SnapshotsUpdateFuture, err error) {
if tracing.IsEnabled() {
ctx = tracing.StartSpan(ctx, fqdn+"/SnapshotsClient.Update")
diff --git a/services/netapp/mgmt/2020-08-01/netapp/vaults.go b/services/netapp/mgmt/2020-08-01/netapp/vaults.go
index 8d7f0f07645c..dbf0af197196 100644
--- a/services/netapp/mgmt/2020-08-01/netapp/vaults.go
+++ b/services/netapp/mgmt/2020-08-01/netapp/vaults.go
@@ -15,7 +15,7 @@ import (
"net/http"
)
-// VaultsClient is the microsoft NetApp Azure Resource Provider specification
+// VaultsClient is the microsoft NetApp Files Azure Resource Provider specification
type VaultsClient struct {
BaseClient
}
diff --git a/services/netapp/mgmt/2020-08-01/netapp/volumes.go b/services/netapp/mgmt/2020-08-01/netapp/volumes.go
index 67d5c26912cc..878f072da70d 100644
--- a/services/netapp/mgmt/2020-08-01/netapp/volumes.go
+++ b/services/netapp/mgmt/2020-08-01/netapp/volumes.go
@@ -15,7 +15,7 @@ import (
"net/http"
)
-// VolumesClient is the microsoft NetApp Azure Resource Provider specification
+// VolumesClient is the microsoft NetApp Files Azure Resource Provider specification
type VolumesClient struct {
BaseClient
}
@@ -289,7 +289,7 @@ func (client VolumesClient) CreateOrUpdate(ctx context.Context, body Volume, res
}},
{Target: "body.VolumeProperties.ThroughputMibps", Name: validation.Null, Rule: false,
Chain: []validation.Constraint{{Target: "body.VolumeProperties.ThroughputMibps", Name: validation.InclusiveMaximum, Rule: float64(4500), Chain: nil},
- {Target: "body.VolumeProperties.ThroughputMibps", Name: validation.InclusiveMinimum, Rule: float64(1), Chain: nil},
+ {Target: "body.VolumeProperties.ThroughputMibps", Name: validation.InclusiveMinimum, Rule: float64(0), Chain: nil},
{Target: "body.VolumeProperties.ThroughputMibps", Name: validation.MultipleOf, Rule: 0.001, Chain: nil},
}},
}}}},
@@ -1060,7 +1060,7 @@ func (client VolumesClient) ReplicationStatusMethodResponder(resp *http.Response
}
// ResyncReplication resync the connection on the destination volume. If the operation is ran on the source volume it
-// will reverse-resync the connection and sync from source to destination.
+// will reverse-resync the connection and sync from destination to source.
// Parameters:
// resourceGroupName - the name of the resource group.
// accountName - the name of the NetApp account
diff --git a/services/netapp/mgmt/2020-09-01/netapp/CHANGELOG.md b/services/netapp/mgmt/2020-09-01/netapp/CHANGELOG.md
index 52911e4cc5e4..a5415c33a3a9 100644
--- a/services/netapp/mgmt/2020-09-01/netapp/CHANGELOG.md
+++ b/services/netapp/mgmt/2020-09-01/netapp/CHANGELOG.md
@@ -1,2 +1,29 @@
-# Change History
+# Unreleased
+## Breaking Changes
+
+### Removed Constants
+
+1. QosType.Auto
+
+### Signature Changes
+
+#### Const Types
+
+1. Manual changed type from QosType to BackupType
+
+#### Struct Fields
+
+1. BackupProperties.BackupType changed type from *string to BackupType
+
+## Additive Changes
+
+### New Constants
+
+1. BackupType.Scheduled
+1. QosType.QosTypeAuto
+1. QosType.QosTypeManual
+
+### New Funcs
+
+1. PossibleBackupTypeValues() []BackupType
diff --git a/services/netapp/mgmt/2020-09-01/netapp/_meta.json b/services/netapp/mgmt/2020-09-01/netapp/_meta.json
index 25adfb8cd21c..59196c8aacc3 100644
--- a/services/netapp/mgmt/2020-09-01/netapp/_meta.json
+++ b/services/netapp/mgmt/2020-09-01/netapp/_meta.json
@@ -1,5 +1,5 @@
{
- "commit": "b08824e05817297a4b2874d8db5e6fc8c29349c9",
+ "commit": "ed4b29fbceaea3cc48f039826db5a92360bc7c56",
"readme": "/_/azure-rest-api-specs/specification/netapp/resource-manager/readme.md",
"tag": "package-netapp-2020-09-01",
"use": "@microsoft.azure/autorest.go@2.1.187",
diff --git a/services/netapp/mgmt/2020-09-01/netapp/accountbackups.go b/services/netapp/mgmt/2020-09-01/netapp/accountbackups.go
index 7944fc88ced8..943ea02c78e8 100644
--- a/services/netapp/mgmt/2020-09-01/netapp/accountbackups.go
+++ b/services/netapp/mgmt/2020-09-01/netapp/accountbackups.go
@@ -15,7 +15,7 @@ import (
"net/http"
)
-// AccountBackupsClient is the microsoft NetApp Azure Resource Provider specification
+// AccountBackupsClient is the microsoft NetApp Files Azure Resource Provider specification
type AccountBackupsClient struct {
BaseClient
}
diff --git a/services/netapp/mgmt/2020-09-01/netapp/accounts.go b/services/netapp/mgmt/2020-09-01/netapp/accounts.go
index cd7c0c149e46..35e3bfe0dd04 100644
--- a/services/netapp/mgmt/2020-09-01/netapp/accounts.go
+++ b/services/netapp/mgmt/2020-09-01/netapp/accounts.go
@@ -15,7 +15,7 @@ import (
"net/http"
)
-// AccountsClient is the microsoft NetApp Azure Resource Provider specification
+// AccountsClient is the microsoft NetApp Files Azure Resource Provider specification
type AccountsClient struct {
BaseClient
}
diff --git a/services/netapp/mgmt/2020-09-01/netapp/backuppolicies.go b/services/netapp/mgmt/2020-09-01/netapp/backuppolicies.go
index 145de424e19b..f1fbf15d2b41 100644
--- a/services/netapp/mgmt/2020-09-01/netapp/backuppolicies.go
+++ b/services/netapp/mgmt/2020-09-01/netapp/backuppolicies.go
@@ -15,7 +15,7 @@ import (
"net/http"
)
-// BackupPoliciesClient is the microsoft NetApp Azure Resource Provider specification
+// BackupPoliciesClient is the microsoft NetApp Files Azure Resource Provider specification
type BackupPoliciesClient struct {
BaseClient
}
diff --git a/services/netapp/mgmt/2020-09-01/netapp/backups.go b/services/netapp/mgmt/2020-09-01/netapp/backups.go
index c112ba80624d..2943c1af69bc 100644
--- a/services/netapp/mgmt/2020-09-01/netapp/backups.go
+++ b/services/netapp/mgmt/2020-09-01/netapp/backups.go
@@ -15,7 +15,7 @@ import (
"net/http"
)
-// BackupsClient is the microsoft NetApp Azure Resource Provider specification
+// BackupsClient is the microsoft NetApp Files Azure Resource Provider specification
type BackupsClient struct {
BaseClient
}
diff --git a/services/netapp/mgmt/2020-09-01/netapp/client.go b/services/netapp/mgmt/2020-09-01/netapp/client.go
index 70baabe7df6a..9b2d2d98789e 100644
--- a/services/netapp/mgmt/2020-09-01/netapp/client.go
+++ b/services/netapp/mgmt/2020-09-01/netapp/client.go
@@ -1,6 +1,6 @@
// Package netapp implements the Azure ARM Netapp service API version 2020-09-01.
//
-// Microsoft NetApp Azure Resource Provider specification
+// Microsoft NetApp Files Azure Resource Provider specification
package netapp
// Copyright (c) Microsoft Corporation. All rights reserved.
diff --git a/services/netapp/mgmt/2020-09-01/netapp/enums.go b/services/netapp/mgmt/2020-09-01/netapp/enums.go
index d9a077191155..42e74827d9c3 100644
--- a/services/netapp/mgmt/2020-09-01/netapp/enums.go
+++ b/services/netapp/mgmt/2020-09-01/netapp/enums.go
@@ -27,6 +27,21 @@ func PossibleActiveDirectoryStatusValues() []ActiveDirectoryStatus {
return []ActiveDirectoryStatus{Created, Deleted, Error, InUse, Updating}
}
+// BackupType enumerates the values for backup type.
+type BackupType string
+
+const (
+ // Manual Manual backup
+ Manual BackupType = "Manual"
+ // Scheduled Scheduled backup
+ Scheduled BackupType = "Scheduled"
+)
+
+// PossibleBackupTypeValues returns an array of possible values for the BackupType const type.
+func PossibleBackupTypeValues() []BackupType {
+ return []BackupType{Manual, Scheduled}
+}
+
// CheckNameResourceTypes enumerates the values for check name resource types.
type CheckNameResourceTypes string
@@ -116,15 +131,15 @@ func PossibleMirrorStateValues() []MirrorState {
type QosType string
const (
- // Auto qos type Auto
- Auto QosType = "Auto"
- // Manual qos type Manual
- Manual QosType = "Manual"
+ // QosTypeAuto qos type Auto
+ QosTypeAuto QosType = "Auto"
+ // QosTypeManual qos type Manual
+ QosTypeManual QosType = "Manual"
)
// PossibleQosTypeValues returns an array of possible values for the QosType const type.
func PossibleQosTypeValues() []QosType {
- return []QosType{Auto, Manual}
+ return []QosType{QosTypeAuto, QosTypeManual}
}
// RelationshipStatus enumerates the values for relationship status.
diff --git a/services/netapp/mgmt/2020-09-01/netapp/models.go b/services/netapp/mgmt/2020-09-01/netapp/models.go
index 49c21090b397..41757b49fd86 100644
--- a/services/netapp/mgmt/2020-09-01/netapp/models.go
+++ b/services/netapp/mgmt/2020-09-01/netapp/models.go
@@ -1089,8 +1089,8 @@ type BackupProperties struct {
Size *int64 `json:"size,omitempty"`
// Label - Label for backup
Label *string `json:"label,omitempty"`
- // BackupType - READ-ONLY; Type of backup adhoc or scheduled
- BackupType *string `json:"backupType,omitempty"`
+ // BackupType - READ-ONLY; Type of backup Manual or Scheduled. Possible values include: 'Manual', 'Scheduled'
+ BackupType BackupType `json:"backupType,omitempty"`
}
// MarshalJSON is the custom marshaler for BackupProperties.
@@ -1753,7 +1753,7 @@ type PoolChangeRequest struct {
type PoolPatchProperties struct {
// Size - Provisioned size of the pool (in bytes). Allowed values are in 4TiB chunks (value must be multiply of 4398046511104).
Size *int64 `json:"size,omitempty"`
- // QosType - The qos type of the pool. Possible values include: 'Auto', 'Manual'
+ // QosType - The qos type of the pool. Possible values include: 'QosTypeAuto', 'QosTypeManual'
QosType QosType `json:"qosType,omitempty"`
}
@@ -1771,7 +1771,7 @@ type PoolProperties struct {
TotalThroughputMibps *float64 `json:"totalThroughputMibps,omitempty"`
// UtilizedThroughputMibps - READ-ONLY; Utilized throughput of pool in Mibps
UtilizedThroughputMibps *float64 `json:"utilizedThroughputMibps,omitempty"`
- // QosType - The qos type of the pool. Possible values include: 'Auto', 'Manual'
+ // QosType - The qos type of the pool. Possible values include: 'QosTypeAuto', 'QosTypeManual'
QosType QosType `json:"qosType,omitempty"`
}
@@ -3109,7 +3109,7 @@ type VolumeProperties struct {
UsageThreshold *int64 `json:"usageThreshold,omitempty"`
// ExportPolicy - Set of export policy rules
ExportPolicy *VolumePropertiesExportPolicy `json:"exportPolicy,omitempty"`
- // ProtocolTypes - Set of protocol types
+ // ProtocolTypes - Set of protocol types, default NFSv3, CIFS for SMB protocol
ProtocolTypes *[]string `json:"protocolTypes,omitempty"`
// ProvisioningState - READ-ONLY; Azure lifecycle management
ProvisioningState *string `json:"provisioningState,omitempty"`
@@ -3121,7 +3121,7 @@ type VolumeProperties struct {
BaremetalTenantID *string `json:"baremetalTenantId,omitempty"`
// SubnetID - The Azure Resource URI for a delegated subnet. Must have the delegation Microsoft.NetApp/volumes
SubnetID *string `json:"subnetId,omitempty"`
- // MountTargets - List of mount targets
+ // MountTargets - READ-ONLY; List of mount targets
MountTargets *[]MountTargetProperties `json:"mountTargets,omitempty"`
// VolumeType - What type of volume is this
VolumeType *string `json:"volumeType,omitempty"`
@@ -3133,7 +3133,7 @@ type VolumeProperties struct {
SnapshotDirectoryVisible *bool `json:"snapshotDirectoryVisible,omitempty"`
// KerberosEnabled - Describe if a volume is KerberosEnabled. To be use with swagger version 2020-05-01 or later
KerberosEnabled *bool `json:"kerberosEnabled,omitempty"`
- // SecurityStyle - The security style of volume. Possible values include: 'Ntfs', 'Unix'
+ // SecurityStyle - The security style of volume, default unix, ntfs for dual protocol or CIFS protocol. Possible values include: 'Ntfs', 'Unix'
SecurityStyle SecurityStyle `json:"securityStyle,omitempty"`
// SmbEncryption - Enables encryption for in-flight smb3 data. Only applicable for SMB/DualProtocol volume. To be used with swagger version 2020-08-01 or later
SmbEncryption *bool `json:"smbEncryption,omitempty"`
@@ -3169,9 +3169,6 @@ func (vp VolumeProperties) MarshalJSON() ([]byte, error) {
if vp.SubnetID != nil {
objectMap["subnetId"] = vp.SubnetID
}
- if vp.MountTargets != nil {
- objectMap["mountTargets"] = vp.MountTargets
- }
if vp.VolumeType != nil {
objectMap["volumeType"] = vp.VolumeType
}
diff --git a/services/netapp/mgmt/2020-09-01/netapp/operations.go b/services/netapp/mgmt/2020-09-01/netapp/operations.go
index 94a8a88f7f23..6d283e78e7c4 100644
--- a/services/netapp/mgmt/2020-09-01/netapp/operations.go
+++ b/services/netapp/mgmt/2020-09-01/netapp/operations.go
@@ -14,7 +14,7 @@ import (
"net/http"
)
-// OperationsClient is the microsoft NetApp Azure Resource Provider specification
+// OperationsClient is the microsoft NetApp Files Azure Resource Provider specification
type OperationsClient struct {
BaseClient
}
diff --git a/services/netapp/mgmt/2020-09-01/netapp/pools.go b/services/netapp/mgmt/2020-09-01/netapp/pools.go
index 487687af7ceb..42de51a538f4 100644
--- a/services/netapp/mgmt/2020-09-01/netapp/pools.go
+++ b/services/netapp/mgmt/2020-09-01/netapp/pools.go
@@ -15,7 +15,7 @@ import (
"net/http"
)
-// PoolsClient is the microsoft NetApp Azure Resource Provider specification
+// PoolsClient is the microsoft NetApp Files Azure Resource Provider specification
type PoolsClient struct {
BaseClient
}
diff --git a/services/netapp/mgmt/2020-09-01/netapp/resource.go b/services/netapp/mgmt/2020-09-01/netapp/resource.go
index 016f74f4d613..fe74a48cb465 100644
--- a/services/netapp/mgmt/2020-09-01/netapp/resource.go
+++ b/services/netapp/mgmt/2020-09-01/netapp/resource.go
@@ -15,7 +15,7 @@ import (
"net/http"
)
-// ResourceClient is the microsoft NetApp Azure Resource Provider specification
+// ResourceClient is the microsoft NetApp Files Azure Resource Provider specification
type ResourceClient struct {
BaseClient
}
diff --git a/services/netapp/mgmt/2020-09-01/netapp/snapshotpolicies.go b/services/netapp/mgmt/2020-09-01/netapp/snapshotpolicies.go
index 2a76321616f9..3dd4f7d090d7 100644
--- a/services/netapp/mgmt/2020-09-01/netapp/snapshotpolicies.go
+++ b/services/netapp/mgmt/2020-09-01/netapp/snapshotpolicies.go
@@ -15,7 +15,7 @@ import (
"net/http"
)
-// SnapshotPoliciesClient is the microsoft NetApp Azure Resource Provider specification
+// SnapshotPoliciesClient is the microsoft NetApp Files Azure Resource Provider specification
type SnapshotPoliciesClient struct {
BaseClient
}
@@ -37,7 +37,7 @@ func NewSnapshotPoliciesClientWithBaseURI(baseURI string, subscriptionID string)
// body - snapshot policy object supplied in the body of the operation.
// resourceGroupName - the name of the resource group.
// accountName - the name of the NetApp account
-// snapshotPolicyName - the name of the snapshot policy target
+// snapshotPolicyName - the name of the snapshot policy
func (client SnapshotPoliciesClient) Create(ctx context.Context, body SnapshotPolicy, resourceGroupName string, accountName string, snapshotPolicyName string) (result SnapshotPolicy, err error) {
if tracing.IsEnabled() {
ctx = tracing.StartSpan(ctx, fqdn+"/SnapshotPoliciesClient.Create")
@@ -131,7 +131,7 @@ func (client SnapshotPoliciesClient) CreateResponder(resp *http.Response) (resul
// Parameters:
// resourceGroupName - the name of the resource group.
// accountName - the name of the NetApp account
-// snapshotPolicyName - the name of the snapshot policy target
+// snapshotPolicyName - the name of the snapshot policy
func (client SnapshotPoliciesClient) Delete(ctx context.Context, resourceGroupName string, accountName string, snapshotPolicyName string) (result SnapshotPoliciesDeleteFuture, err error) {
if tracing.IsEnabled() {
ctx = tracing.StartSpan(ctx, fqdn+"/SnapshotPoliciesClient.Delete")
@@ -219,7 +219,7 @@ func (client SnapshotPoliciesClient) DeleteResponder(resp *http.Response) (resul
// Parameters:
// resourceGroupName - the name of the resource group.
// accountName - the name of the NetApp account
-// snapshotPolicyName - the name of the snapshot policy target
+// snapshotPolicyName - the name of the snapshot policy
func (client SnapshotPoliciesClient) Get(ctx context.Context, resourceGroupName string, accountName string, snapshotPolicyName string) (result SnapshotPolicy, err error) {
if tracing.IsEnabled() {
ctx = tracing.StartSpan(ctx, fqdn+"/SnapshotPoliciesClient.Get")
@@ -389,7 +389,7 @@ func (client SnapshotPoliciesClient) ListResponder(resp *http.Response) (result
// Parameters:
// resourceGroupName - the name of the resource group.
// accountName - the name of the NetApp account
-// snapshotPolicyName - the name of the snapshot policy target
+// snapshotPolicyName - the name of the snapshot policy
func (client SnapshotPoliciesClient) ListVolumes(ctx context.Context, resourceGroupName string, accountName string, snapshotPolicyName string) (result SnapshotPolicyVolumeList, err error) {
if tracing.IsEnabled() {
ctx = tracing.StartSpan(ctx, fqdn+"/SnapshotPoliciesClient.ListVolumes")
@@ -476,7 +476,7 @@ func (client SnapshotPoliciesClient) ListVolumesResponder(resp *http.Response) (
// body - snapshot policy object supplied in the body of the operation.
// resourceGroupName - the name of the resource group.
// accountName - the name of the NetApp account
-// snapshotPolicyName - the name of the snapshot policy target
+// snapshotPolicyName - the name of the snapshot policy
func (client SnapshotPoliciesClient) Update(ctx context.Context, body SnapshotPolicyPatch, resourceGroupName string, accountName string, snapshotPolicyName string) (result SnapshotPolicy, err error) {
if tracing.IsEnabled() {
ctx = tracing.StartSpan(ctx, fqdn+"/SnapshotPoliciesClient.Update")
diff --git a/services/netapp/mgmt/2020-09-01/netapp/snapshots.go b/services/netapp/mgmt/2020-09-01/netapp/snapshots.go
index ebfb21bfe7da..355bf85fd976 100644
--- a/services/netapp/mgmt/2020-09-01/netapp/snapshots.go
+++ b/services/netapp/mgmt/2020-09-01/netapp/snapshots.go
@@ -15,7 +15,7 @@ import (
"net/http"
)
-// SnapshotsClient is the microsoft NetApp Azure Resource Provider specification
+// SnapshotsClient is the microsoft NetApp Files Azure Resource Provider specification
type SnapshotsClient struct {
BaseClient
}
@@ -38,7 +38,7 @@ func NewSnapshotsClientWithBaseURI(baseURI string, subscriptionID string) Snapsh
// accountName - the name of the NetApp account
// poolName - the name of the capacity pool
// volumeName - the name of the volume
-// snapshotName - the name of the mount target
+// snapshotName - the name of the snapshot
func (client SnapshotsClient) Create(ctx context.Context, body Snapshot, resourceGroupName string, accountName string, poolName string, volumeName string, snapshotName string) (result SnapshotsCreateFuture, err error) {
if tracing.IsEnabled() {
ctx = tracing.StartSpan(ctx, fqdn+"/SnapshotsClient.Create")
@@ -153,7 +153,7 @@ func (client SnapshotsClient) CreateResponder(resp *http.Response) (result Snaps
// accountName - the name of the NetApp account
// poolName - the name of the capacity pool
// volumeName - the name of the volume
-// snapshotName - the name of the mount target
+// snapshotName - the name of the snapshot
func (client SnapshotsClient) Delete(ctx context.Context, resourceGroupName string, accountName string, poolName string, volumeName string, snapshotName string) (result SnapshotsDeleteFuture, err error) {
if tracing.IsEnabled() {
ctx = tracing.StartSpan(ctx, fqdn+"/SnapshotsClient.Delete")
@@ -253,7 +253,7 @@ func (client SnapshotsClient) DeleteResponder(resp *http.Response) (result autor
// accountName - the name of the NetApp account
// poolName - the name of the capacity pool
// volumeName - the name of the volume
-// snapshotName - the name of the mount target
+// snapshotName - the name of the snapshot
func (client SnapshotsClient) Get(ctx context.Context, resourceGroupName string, accountName string, poolName string, volumeName string, snapshotName string) (result Snapshot, err error) {
if tracing.IsEnabled() {
ctx = tracing.StartSpan(ctx, fqdn+"/SnapshotsClient.Get")
@@ -448,7 +448,7 @@ func (client SnapshotsClient) ListResponder(resp *http.Response) (result Snapsho
// accountName - the name of the NetApp account
// poolName - the name of the capacity pool
// volumeName - the name of the volume
-// snapshotName - the name of the mount target
+// snapshotName - the name of the snapshot
func (client SnapshotsClient) Update(ctx context.Context, body interface{}, resourceGroupName string, accountName string, poolName string, volumeName string, snapshotName string) (result SnapshotsUpdateFuture, err error) {
if tracing.IsEnabled() {
ctx = tracing.StartSpan(ctx, fqdn+"/SnapshotsClient.Update")
diff --git a/services/netapp/mgmt/2020-09-01/netapp/vaults.go b/services/netapp/mgmt/2020-09-01/netapp/vaults.go
index 70a1d2872500..63c32086de3b 100644
--- a/services/netapp/mgmt/2020-09-01/netapp/vaults.go
+++ b/services/netapp/mgmt/2020-09-01/netapp/vaults.go
@@ -15,7 +15,7 @@ import (
"net/http"
)
-// VaultsClient is the microsoft NetApp Azure Resource Provider specification
+// VaultsClient is the microsoft NetApp Files Azure Resource Provider specification
type VaultsClient struct {
BaseClient
}
diff --git a/services/netapp/mgmt/2020-09-01/netapp/volumes.go b/services/netapp/mgmt/2020-09-01/netapp/volumes.go
index 88362917d184..4c9046eaf033 100644
--- a/services/netapp/mgmt/2020-09-01/netapp/volumes.go
+++ b/services/netapp/mgmt/2020-09-01/netapp/volumes.go
@@ -15,7 +15,7 @@ import (
"net/http"
)
-// VolumesClient is the microsoft NetApp Azure Resource Provider specification
+// VolumesClient is the microsoft NetApp Files Azure Resource Provider specification
type VolumesClient struct {
BaseClient
}
@@ -289,7 +289,7 @@ func (client VolumesClient) CreateOrUpdate(ctx context.Context, body Volume, res
}},
{Target: "body.VolumeProperties.ThroughputMibps", Name: validation.Null, Rule: false,
Chain: []validation.Constraint{{Target: "body.VolumeProperties.ThroughputMibps", Name: validation.InclusiveMaximum, Rule: float64(4500), Chain: nil},
- {Target: "body.VolumeProperties.ThroughputMibps", Name: validation.InclusiveMinimum, Rule: float64(1), Chain: nil},
+ {Target: "body.VolumeProperties.ThroughputMibps", Name: validation.InclusiveMinimum, Rule: float64(0), Chain: nil},
{Target: "body.VolumeProperties.ThroughputMibps", Name: validation.MultipleOf, Rule: 0.001, Chain: nil},
}},
}}}},
diff --git a/services/netapp/mgmt/2020-11-01/netapp/CHANGELOG.md b/services/netapp/mgmt/2020-11-01/netapp/CHANGELOG.md
index 52911e4cc5e4..a5415c33a3a9 100644
--- a/services/netapp/mgmt/2020-11-01/netapp/CHANGELOG.md
+++ b/services/netapp/mgmt/2020-11-01/netapp/CHANGELOG.md
@@ -1,2 +1,29 @@
-# Change History
+# Unreleased
+## Breaking Changes
+
+### Removed Constants
+
+1. QosType.Auto
+
+### Signature Changes
+
+#### Const Types
+
+1. Manual changed type from QosType to BackupType
+
+#### Struct Fields
+
+1. BackupProperties.BackupType changed type from *string to BackupType
+
+## Additive Changes
+
+### New Constants
+
+1. BackupType.Scheduled
+1. QosType.QosTypeAuto
+1. QosType.QosTypeManual
+
+### New Funcs
+
+1. PossibleBackupTypeValues() []BackupType
diff --git a/services/netapp/mgmt/2020-11-01/netapp/_meta.json b/services/netapp/mgmt/2020-11-01/netapp/_meta.json
index 6b032016db4a..15774b8f4ff4 100644
--- a/services/netapp/mgmt/2020-11-01/netapp/_meta.json
+++ b/services/netapp/mgmt/2020-11-01/netapp/_meta.json
@@ -1,5 +1,5 @@
{
- "commit": "92ab22b49bd085116af0c61fada2c6c360702e9e",
+ "commit": "ed4b29fbceaea3cc48f039826db5a92360bc7c56",
"readme": "/_/azure-rest-api-specs/specification/netapp/resource-manager/readme.md",
"tag": "package-netapp-2020-11-01",
"use": "@microsoft.azure/autorest.go@2.1.187",
diff --git a/services/netapp/mgmt/2020-11-01/netapp/enums.go b/services/netapp/mgmt/2020-11-01/netapp/enums.go
index ccffe9b76e48..ba8e7a005b75 100644
--- a/services/netapp/mgmt/2020-11-01/netapp/enums.go
+++ b/services/netapp/mgmt/2020-11-01/netapp/enums.go
@@ -27,6 +27,21 @@ func PossibleActiveDirectoryStatusValues() []ActiveDirectoryStatus {
return []ActiveDirectoryStatus{Created, Deleted, Error, InUse, Updating}
}
+// BackupType enumerates the values for backup type.
+type BackupType string
+
+const (
+ // Manual Manual backup
+ Manual BackupType = "Manual"
+ // Scheduled Scheduled backup
+ Scheduled BackupType = "Scheduled"
+)
+
+// PossibleBackupTypeValues returns an array of possible values for the BackupType const type.
+func PossibleBackupTypeValues() []BackupType {
+ return []BackupType{Manual, Scheduled}
+}
+
// CheckNameResourceTypes enumerates the values for check name resource types.
type CheckNameResourceTypes string
@@ -148,15 +163,15 @@ func PossibleMirrorStateValues() []MirrorState {
type QosType string
const (
- // Auto qos type Auto
- Auto QosType = "Auto"
- // Manual qos type Manual
- Manual QosType = "Manual"
+ // QosTypeAuto qos type Auto
+ QosTypeAuto QosType = "Auto"
+ // QosTypeManual qos type Manual
+ QosTypeManual QosType = "Manual"
)
// PossibleQosTypeValues returns an array of possible values for the QosType const type.
func PossibleQosTypeValues() []QosType {
- return []QosType{Auto, Manual}
+ return []QosType{QosTypeAuto, QosTypeManual}
}
// RelationshipStatus enumerates the values for relationship status.
diff --git a/services/netapp/mgmt/2020-11-01/netapp/models.go b/services/netapp/mgmt/2020-11-01/netapp/models.go
index 133f62399830..cdda849eee41 100644
--- a/services/netapp/mgmt/2020-11-01/netapp/models.go
+++ b/services/netapp/mgmt/2020-11-01/netapp/models.go
@@ -1268,8 +1268,8 @@ type BackupProperties struct {
Size *int64 `json:"size,omitempty"`
// Label - Label for backup
Label *string `json:"label,omitempty"`
- // BackupType - READ-ONLY; Type of backup adhoc or scheduled
- BackupType *string `json:"backupType,omitempty"`
+ // BackupType - READ-ONLY; Type of backup Manual or Scheduled. Possible values include: 'Manual', 'Scheduled'
+ BackupType BackupType `json:"backupType,omitempty"`
// FailureReason - READ-ONLY; Failure reason
FailureReason *string `json:"failureReason,omitempty"`
}
@@ -2143,7 +2143,7 @@ type PoolChangeRequest struct {
type PoolPatchProperties struct {
// Size - Provisioned size of the pool (in bytes). Allowed values are in 4TiB chunks (value must be multiply of 4398046511104).
Size *int64 `json:"size,omitempty"`
- // QosType - The qos type of the pool. Possible values include: 'Auto', 'Manual'
+ // QosType - The qos type of the pool. Possible values include: 'QosTypeAuto', 'QosTypeManual'
QosType QosType `json:"qosType,omitempty"`
}
@@ -2161,7 +2161,7 @@ type PoolProperties struct {
TotalThroughputMibps *float64 `json:"totalThroughputMibps,omitempty"`
// UtilizedThroughputMibps - READ-ONLY; Utilized throughput of pool in Mibps
UtilizedThroughputMibps *float64 `json:"utilizedThroughputMibps,omitempty"`
- // QosType - The qos type of the pool. Possible values include: 'Auto', 'Manual'
+ // QosType - The qos type of the pool. Possible values include: 'QosTypeAuto', 'QosTypeManual'
QosType QosType `json:"qosType,omitempty"`
}
@@ -3558,7 +3558,7 @@ type VolumeProperties struct {
UsageThreshold *int64 `json:"usageThreshold,omitempty"`
// ExportPolicy - Set of export policy rules
ExportPolicy *VolumePropertiesExportPolicy `json:"exportPolicy,omitempty"`
- // ProtocolTypes - Set of protocol types, default NFSv3, CIFS fro SMB protocol
+ // ProtocolTypes - Set of protocol types, default NFSv3, CIFS for SMB protocol
ProtocolTypes *[]string `json:"protocolTypes,omitempty"`
// ProvisioningState - READ-ONLY; Azure lifecycle management
ProvisioningState *string `json:"provisioningState,omitempty"`
diff --git a/services/netapp/mgmt/2020-11-01/netapp/snapshotpolicies.go b/services/netapp/mgmt/2020-11-01/netapp/snapshotpolicies.go
index 9503ec0140a7..0ff52c187263 100644
--- a/services/netapp/mgmt/2020-11-01/netapp/snapshotpolicies.go
+++ b/services/netapp/mgmt/2020-11-01/netapp/snapshotpolicies.go
@@ -37,7 +37,7 @@ func NewSnapshotPoliciesClientWithBaseURI(baseURI string, subscriptionID string)
// body - snapshot policy object supplied in the body of the operation.
// resourceGroupName - the name of the resource group.
// accountName - the name of the NetApp account
-// snapshotPolicyName - the name of the snapshot policy target
+// snapshotPolicyName - the name of the snapshot policy
func (client SnapshotPoliciesClient) Create(ctx context.Context, body SnapshotPolicy, resourceGroupName string, accountName string, snapshotPolicyName string) (result SnapshotPolicy, err error) {
if tracing.IsEnabled() {
ctx = tracing.StartSpan(ctx, fqdn+"/SnapshotPoliciesClient.Create")
@@ -131,7 +131,7 @@ func (client SnapshotPoliciesClient) CreateResponder(resp *http.Response) (resul
// Parameters:
// resourceGroupName - the name of the resource group.
// accountName - the name of the NetApp account
-// snapshotPolicyName - the name of the snapshot policy target
+// snapshotPolicyName - the name of the snapshot policy
func (client SnapshotPoliciesClient) Delete(ctx context.Context, resourceGroupName string, accountName string, snapshotPolicyName string) (result SnapshotPoliciesDeleteFuture, err error) {
if tracing.IsEnabled() {
ctx = tracing.StartSpan(ctx, fqdn+"/SnapshotPoliciesClient.Delete")
@@ -219,7 +219,7 @@ func (client SnapshotPoliciesClient) DeleteResponder(resp *http.Response) (resul
// Parameters:
// resourceGroupName - the name of the resource group.
// accountName - the name of the NetApp account
-// snapshotPolicyName - the name of the snapshot policy target
+// snapshotPolicyName - the name of the snapshot policy
func (client SnapshotPoliciesClient) Get(ctx context.Context, resourceGroupName string, accountName string, snapshotPolicyName string) (result SnapshotPolicy, err error) {
if tracing.IsEnabled() {
ctx = tracing.StartSpan(ctx, fqdn+"/SnapshotPoliciesClient.Get")
@@ -389,7 +389,7 @@ func (client SnapshotPoliciesClient) ListResponder(resp *http.Response) (result
// Parameters:
// resourceGroupName - the name of the resource group.
// accountName - the name of the NetApp account
-// snapshotPolicyName - the name of the snapshot policy target
+// snapshotPolicyName - the name of the snapshot policy
func (client SnapshotPoliciesClient) ListVolumes(ctx context.Context, resourceGroupName string, accountName string, snapshotPolicyName string) (result SnapshotPolicyVolumeList, err error) {
if tracing.IsEnabled() {
ctx = tracing.StartSpan(ctx, fqdn+"/SnapshotPoliciesClient.ListVolumes")
@@ -476,7 +476,7 @@ func (client SnapshotPoliciesClient) ListVolumesResponder(resp *http.Response) (
// body - snapshot policy object supplied in the body of the operation.
// resourceGroupName - the name of the resource group.
// accountName - the name of the NetApp account
-// snapshotPolicyName - the name of the snapshot policy target
+// snapshotPolicyName - the name of the snapshot policy
func (client SnapshotPoliciesClient) Update(ctx context.Context, body SnapshotPolicyPatch, resourceGroupName string, accountName string, snapshotPolicyName string) (result SnapshotPoliciesUpdateFuture, err error) {
if tracing.IsEnabled() {
ctx = tracing.StartSpan(ctx, fqdn+"/SnapshotPoliciesClient.Update")
diff --git a/services/netapp/mgmt/2020-11-01/netapp/snapshots.go b/services/netapp/mgmt/2020-11-01/netapp/snapshots.go
index caa46dbdf233..db46607a4477 100644
--- a/services/netapp/mgmt/2020-11-01/netapp/snapshots.go
+++ b/services/netapp/mgmt/2020-11-01/netapp/snapshots.go
@@ -38,7 +38,7 @@ func NewSnapshotsClientWithBaseURI(baseURI string, subscriptionID string) Snapsh
// accountName - the name of the NetApp account
// poolName - the name of the capacity pool
// volumeName - the name of the volume
-// snapshotName - the name of the mount target
+// snapshotName - the name of the snapshot
func (client SnapshotsClient) Create(ctx context.Context, body Snapshot, resourceGroupName string, accountName string, poolName string, volumeName string, snapshotName string) (result SnapshotsCreateFuture, err error) {
if tracing.IsEnabled() {
ctx = tracing.StartSpan(ctx, fqdn+"/SnapshotsClient.Create")
@@ -153,7 +153,7 @@ func (client SnapshotsClient) CreateResponder(resp *http.Response) (result Snaps
// accountName - the name of the NetApp account
// poolName - the name of the capacity pool
// volumeName - the name of the volume
-// snapshotName - the name of the mount target
+// snapshotName - the name of the snapshot
func (client SnapshotsClient) Delete(ctx context.Context, resourceGroupName string, accountName string, poolName string, volumeName string, snapshotName string) (result SnapshotsDeleteFuture, err error) {
if tracing.IsEnabled() {
ctx = tracing.StartSpan(ctx, fqdn+"/SnapshotsClient.Delete")
@@ -253,7 +253,7 @@ func (client SnapshotsClient) DeleteResponder(resp *http.Response) (result autor
// accountName - the name of the NetApp account
// poolName - the name of the capacity pool
// volumeName - the name of the volume
-// snapshotName - the name of the mount target
+// snapshotName - the name of the snapshot
func (client SnapshotsClient) Get(ctx context.Context, resourceGroupName string, accountName string, poolName string, volumeName string, snapshotName string) (result Snapshot, err error) {
if tracing.IsEnabled() {
ctx = tracing.StartSpan(ctx, fqdn+"/SnapshotsClient.Get")
@@ -448,7 +448,7 @@ func (client SnapshotsClient) ListResponder(resp *http.Response) (result Snapsho
// accountName - the name of the NetApp account
// poolName - the name of the capacity pool
// volumeName - the name of the volume
-// snapshotName - the name of the mount target
+// snapshotName - the name of the snapshot
func (client SnapshotsClient) Update(ctx context.Context, body interface{}, resourceGroupName string, accountName string, poolName string, volumeName string, snapshotName string) (result SnapshotsUpdateFuture, err error) {
if tracing.IsEnabled() {
ctx = tracing.StartSpan(ctx, fqdn+"/SnapshotsClient.Update")
diff --git a/services/netapp/mgmt/2020-12-01/netapp/CHANGELOG.md b/services/netapp/mgmt/2020-12-01/netapp/CHANGELOG.md
index 52911e4cc5e4..a5415c33a3a9 100644
--- a/services/netapp/mgmt/2020-12-01/netapp/CHANGELOG.md
+++ b/services/netapp/mgmt/2020-12-01/netapp/CHANGELOG.md
@@ -1,2 +1,29 @@
-# Change History
+# Unreleased
+## Breaking Changes
+
+### Removed Constants
+
+1. QosType.Auto
+
+### Signature Changes
+
+#### Const Types
+
+1. Manual changed type from QosType to BackupType
+
+#### Struct Fields
+
+1. BackupProperties.BackupType changed type from *string to BackupType
+
+## Additive Changes
+
+### New Constants
+
+1. BackupType.Scheduled
+1. QosType.QosTypeAuto
+1. QosType.QosTypeManual
+
+### New Funcs
+
+1. PossibleBackupTypeValues() []BackupType
diff --git a/services/netapp/mgmt/2020-12-01/netapp/_meta.json b/services/netapp/mgmt/2020-12-01/netapp/_meta.json
index 88bc812e44c1..158c8ae88bcf 100644
--- a/services/netapp/mgmt/2020-12-01/netapp/_meta.json
+++ b/services/netapp/mgmt/2020-12-01/netapp/_meta.json
@@ -1,5 +1,5 @@
{
- "commit": "8d3b22458da4bb9309c0207c2ebc1903de741249",
+ "commit": "ed4b29fbceaea3cc48f039826db5a92360bc7c56",
"readme": "/_/azure-rest-api-specs/specification/netapp/resource-manager/readme.md",
"tag": "package-netapp-2020-12-01",
"use": "@microsoft.azure/autorest.go@2.1.187",
diff --git a/services/netapp/mgmt/2020-12-01/netapp/enums.go b/services/netapp/mgmt/2020-12-01/netapp/enums.go
index 93a16e69c14e..62c786f1aa7b 100644
--- a/services/netapp/mgmt/2020-12-01/netapp/enums.go
+++ b/services/netapp/mgmt/2020-12-01/netapp/enums.go
@@ -27,6 +27,21 @@ func PossibleActiveDirectoryStatusValues() []ActiveDirectoryStatus {
return []ActiveDirectoryStatus{Created, Deleted, Error, InUse, Updating}
}
+// BackupType enumerates the values for backup type.
+type BackupType string
+
+const (
+ // Manual Manual backup
+ Manual BackupType = "Manual"
+ // Scheduled Scheduled backup
+ Scheduled BackupType = "Scheduled"
+)
+
+// PossibleBackupTypeValues returns an array of possible values for the BackupType const type.
+func PossibleBackupTypeValues() []BackupType {
+ return []BackupType{Manual, Scheduled}
+}
+
// CheckNameResourceTypes enumerates the values for check name resource types.
type CheckNameResourceTypes string
@@ -135,15 +150,15 @@ func PossibleMirrorStateValues() []MirrorState {
type QosType string
const (
- // Auto qos type Auto
- Auto QosType = "Auto"
- // Manual qos type Manual
- Manual QosType = "Manual"
+ // QosTypeAuto qos type Auto
+ QosTypeAuto QosType = "Auto"
+ // QosTypeManual qos type Manual
+ QosTypeManual QosType = "Manual"
)
// PossibleQosTypeValues returns an array of possible values for the QosType const type.
func PossibleQosTypeValues() []QosType {
- return []QosType{Auto, Manual}
+ return []QosType{QosTypeAuto, QosTypeManual}
}
// RelationshipStatus enumerates the values for relationship status.
diff --git a/services/netapp/mgmt/2020-12-01/netapp/models.go b/services/netapp/mgmt/2020-12-01/netapp/models.go
index 9cae52cffc35..ee52bb3f4dbd 100644
--- a/services/netapp/mgmt/2020-12-01/netapp/models.go
+++ b/services/netapp/mgmt/2020-12-01/netapp/models.go
@@ -1273,8 +1273,8 @@ type BackupProperties struct {
Size *int64 `json:"size,omitempty"`
// Label - Label for backup
Label *string `json:"label,omitempty"`
- // BackupType - READ-ONLY; Type of backup adhoc or scheduled
- BackupType *string `json:"backupType,omitempty"`
+ // BackupType - READ-ONLY; Type of backup Manual or Scheduled. Possible values include: 'Manual', 'Scheduled'
+ BackupType BackupType `json:"backupType,omitempty"`
// FailureReason - READ-ONLY; Failure reason
FailureReason *string `json:"failureReason,omitempty"`
// VolumeName - READ-ONLY; Volume name
@@ -2171,7 +2171,7 @@ type PoolChangeRequest struct {
type PoolPatchProperties struct {
// Size - Provisioned size of the pool (in bytes). Allowed values are in 4TiB chunks (value must be multiply of 4398046511104).
Size *int64 `json:"size,omitempty"`
- // QosType - The qos type of the pool. Possible values include: 'Auto', 'Manual'
+ // QosType - The qos type of the pool. Possible values include: 'QosTypeAuto', 'QosTypeManual'
QosType QosType `json:"qosType,omitempty"`
}
@@ -2189,7 +2189,7 @@ type PoolProperties struct {
TotalThroughputMibps *float64 `json:"totalThroughputMibps,omitempty"`
// UtilizedThroughputMibps - READ-ONLY; Utilized throughput of pool in Mibps
UtilizedThroughputMibps *float64 `json:"utilizedThroughputMibps,omitempty"`
- // QosType - The qos type of the pool. Possible values include: 'Auto', 'Manual'
+ // QosType - The qos type of the pool. Possible values include: 'QosTypeAuto', 'QosTypeManual'
QosType QosType `json:"qosType,omitempty"`
}
@@ -3603,7 +3603,7 @@ type VolumeProperties struct {
UsageThreshold *int64 `json:"usageThreshold,omitempty"`
// ExportPolicy - Set of export policy rules
ExportPolicy *VolumePropertiesExportPolicy `json:"exportPolicy,omitempty"`
- // ProtocolTypes - Set of protocol types, default NFSv3, CIFS fro SMB protocol
+ // ProtocolTypes - Set of protocol types, default NFSv3, CIFS for SMB protocol
ProtocolTypes *[]string `json:"protocolTypes,omitempty"`
// ProvisioningState - READ-ONLY; Azure lifecycle management
ProvisioningState *string `json:"provisioningState,omitempty"`
diff --git a/services/netapp/mgmt/2020-12-01/netapp/snapshotpolicies.go b/services/netapp/mgmt/2020-12-01/netapp/snapshotpolicies.go
index 97a23a3eaea4..37ad264721d5 100644
--- a/services/netapp/mgmt/2020-12-01/netapp/snapshotpolicies.go
+++ b/services/netapp/mgmt/2020-12-01/netapp/snapshotpolicies.go
@@ -37,7 +37,7 @@ func NewSnapshotPoliciesClientWithBaseURI(baseURI string, subscriptionID string)
// body - snapshot policy object supplied in the body of the operation.
// resourceGroupName - the name of the resource group.
// accountName - the name of the NetApp account
-// snapshotPolicyName - the name of the snapshot policy target
+// snapshotPolicyName - the name of the snapshot policy
func (client SnapshotPoliciesClient) Create(ctx context.Context, body SnapshotPolicy, resourceGroupName string, accountName string, snapshotPolicyName string) (result SnapshotPolicy, err error) {
if tracing.IsEnabled() {
ctx = tracing.StartSpan(ctx, fqdn+"/SnapshotPoliciesClient.Create")
@@ -131,7 +131,7 @@ func (client SnapshotPoliciesClient) CreateResponder(resp *http.Response) (resul
// Parameters:
// resourceGroupName - the name of the resource group.
// accountName - the name of the NetApp account
-// snapshotPolicyName - the name of the snapshot policy target
+// snapshotPolicyName - the name of the snapshot policy
func (client SnapshotPoliciesClient) Delete(ctx context.Context, resourceGroupName string, accountName string, snapshotPolicyName string) (result SnapshotPoliciesDeleteFuture, err error) {
if tracing.IsEnabled() {
ctx = tracing.StartSpan(ctx, fqdn+"/SnapshotPoliciesClient.Delete")
@@ -219,7 +219,7 @@ func (client SnapshotPoliciesClient) DeleteResponder(resp *http.Response) (resul
// Parameters:
// resourceGroupName - the name of the resource group.
// accountName - the name of the NetApp account
-// snapshotPolicyName - the name of the snapshot policy target
+// snapshotPolicyName - the name of the snapshot policy
func (client SnapshotPoliciesClient) Get(ctx context.Context, resourceGroupName string, accountName string, snapshotPolicyName string) (result SnapshotPolicy, err error) {
if tracing.IsEnabled() {
ctx = tracing.StartSpan(ctx, fqdn+"/SnapshotPoliciesClient.Get")
@@ -389,7 +389,7 @@ func (client SnapshotPoliciesClient) ListResponder(resp *http.Response) (result
// Parameters:
// resourceGroupName - the name of the resource group.
// accountName - the name of the NetApp account
-// snapshotPolicyName - the name of the snapshot policy target
+// snapshotPolicyName - the name of the snapshot policy
func (client SnapshotPoliciesClient) ListVolumes(ctx context.Context, resourceGroupName string, accountName string, snapshotPolicyName string) (result SnapshotPolicyVolumeList, err error) {
if tracing.IsEnabled() {
ctx = tracing.StartSpan(ctx, fqdn+"/SnapshotPoliciesClient.ListVolumes")
@@ -476,7 +476,7 @@ func (client SnapshotPoliciesClient) ListVolumesResponder(resp *http.Response) (
// body - snapshot policy object supplied in the body of the operation.
// resourceGroupName - the name of the resource group.
// accountName - the name of the NetApp account
-// snapshotPolicyName - the name of the snapshot policy target
+// snapshotPolicyName - the name of the snapshot policy
func (client SnapshotPoliciesClient) Update(ctx context.Context, body SnapshotPolicyPatch, resourceGroupName string, accountName string, snapshotPolicyName string) (result SnapshotPoliciesUpdateFuture, err error) {
if tracing.IsEnabled() {
ctx = tracing.StartSpan(ctx, fqdn+"/SnapshotPoliciesClient.Update")
diff --git a/services/netapp/mgmt/2020-12-01/netapp/snapshots.go b/services/netapp/mgmt/2020-12-01/netapp/snapshots.go
index 0c8c3759bc29..ea888fab8ca8 100644
--- a/services/netapp/mgmt/2020-12-01/netapp/snapshots.go
+++ b/services/netapp/mgmt/2020-12-01/netapp/snapshots.go
@@ -38,7 +38,7 @@ func NewSnapshotsClientWithBaseURI(baseURI string, subscriptionID string) Snapsh
// accountName - the name of the NetApp account
// poolName - the name of the capacity pool
// volumeName - the name of the volume
-// snapshotName - the name of the mount target
+// snapshotName - the name of the snapshot
func (client SnapshotsClient) Create(ctx context.Context, body Snapshot, resourceGroupName string, accountName string, poolName string, volumeName string, snapshotName string) (result SnapshotsCreateFuture, err error) {
if tracing.IsEnabled() {
ctx = tracing.StartSpan(ctx, fqdn+"/SnapshotsClient.Create")
@@ -153,7 +153,7 @@ func (client SnapshotsClient) CreateResponder(resp *http.Response) (result Snaps
// accountName - the name of the NetApp account
// poolName - the name of the capacity pool
// volumeName - the name of the volume
-// snapshotName - the name of the mount target
+// snapshotName - the name of the snapshot
func (client SnapshotsClient) Delete(ctx context.Context, resourceGroupName string, accountName string, poolName string, volumeName string, snapshotName string) (result SnapshotsDeleteFuture, err error) {
if tracing.IsEnabled() {
ctx = tracing.StartSpan(ctx, fqdn+"/SnapshotsClient.Delete")
@@ -253,7 +253,7 @@ func (client SnapshotsClient) DeleteResponder(resp *http.Response) (result autor
// accountName - the name of the NetApp account
// poolName - the name of the capacity pool
// volumeName - the name of the volume
-// snapshotName - the name of the mount target
+// snapshotName - the name of the snapshot
func (client SnapshotsClient) Get(ctx context.Context, resourceGroupName string, accountName string, poolName string, volumeName string, snapshotName string) (result Snapshot, err error) {
if tracing.IsEnabled() {
ctx = tracing.StartSpan(ctx, fqdn+"/SnapshotsClient.Get")
@@ -448,7 +448,7 @@ func (client SnapshotsClient) ListResponder(resp *http.Response) (result Snapsho
// accountName - the name of the NetApp account
// poolName - the name of the capacity pool
// volumeName - the name of the volume
-// snapshotName - the name of the mount target
+// snapshotName - the name of the snapshot
func (client SnapshotsClient) Update(ctx context.Context, body interface{}, resourceGroupName string, accountName string, poolName string, volumeName string, snapshotName string) (result SnapshotsUpdateFuture, err error) {
if tracing.IsEnabled() {
ctx = tracing.StartSpan(ctx, fqdn+"/SnapshotsClient.Update")
diff --git a/services/netapp/mgmt/2021-02-01/netapp/CHANGELOG.md b/services/netapp/mgmt/2021-02-01/netapp/CHANGELOG.md
index 52911e4cc5e4..a1ecf841edb0 100644
--- a/services/netapp/mgmt/2021-02-01/netapp/CHANGELOG.md
+++ b/services/netapp/mgmt/2021-02-01/netapp/CHANGELOG.md
@@ -1,2 +1,2 @@
-# Change History
+# Unreleased
diff --git a/services/netapp/mgmt/2021-02-01/netapp/_meta.json b/services/netapp/mgmt/2021-02-01/netapp/_meta.json
index 481c78c17ada..c276ab2c0b32 100644
--- a/services/netapp/mgmt/2021-02-01/netapp/_meta.json
+++ b/services/netapp/mgmt/2021-02-01/netapp/_meta.json
@@ -1,5 +1,5 @@
{
- "commit": "e6ee3d4f6a29f081eddada399bd1cb373133af02",
+ "commit": "ed4b29fbceaea3cc48f039826db5a92360bc7c56",
"readme": "/_/azure-rest-api-specs/specification/netapp/resource-manager/readme.md",
"tag": "package-netapp-2021-02-01",
"use": "@microsoft.azure/autorest.go@2.1.187",
diff --git a/services/netapp/mgmt/2021-02-01/netapp/snapshotpolicies.go b/services/netapp/mgmt/2021-02-01/netapp/snapshotpolicies.go
index 686466997bb2..4e8fd032838e 100644
--- a/services/netapp/mgmt/2021-02-01/netapp/snapshotpolicies.go
+++ b/services/netapp/mgmt/2021-02-01/netapp/snapshotpolicies.go
@@ -37,7 +37,7 @@ func NewSnapshotPoliciesClientWithBaseURI(baseURI string, subscriptionID string)
// body - snapshot policy object supplied in the body of the operation.
// resourceGroupName - the name of the resource group.
// accountName - the name of the NetApp account
-// snapshotPolicyName - the name of the snapshot policy target
+// snapshotPolicyName - the name of the snapshot policy
func (client SnapshotPoliciesClient) Create(ctx context.Context, body SnapshotPolicy, resourceGroupName string, accountName string, snapshotPolicyName string) (result SnapshotPolicy, err error) {
if tracing.IsEnabled() {
ctx = tracing.StartSpan(ctx, fqdn+"/SnapshotPoliciesClient.Create")
@@ -131,7 +131,7 @@ func (client SnapshotPoliciesClient) CreateResponder(resp *http.Response) (resul
// Parameters:
// resourceGroupName - the name of the resource group.
// accountName - the name of the NetApp account
-// snapshotPolicyName - the name of the snapshot policy target
+// snapshotPolicyName - the name of the snapshot policy
func (client SnapshotPoliciesClient) Delete(ctx context.Context, resourceGroupName string, accountName string, snapshotPolicyName string) (result SnapshotPoliciesDeleteFuture, err error) {
if tracing.IsEnabled() {
ctx = tracing.StartSpan(ctx, fqdn+"/SnapshotPoliciesClient.Delete")
@@ -219,7 +219,7 @@ func (client SnapshotPoliciesClient) DeleteResponder(resp *http.Response) (resul
// Parameters:
// resourceGroupName - the name of the resource group.
// accountName - the name of the NetApp account
-// snapshotPolicyName - the name of the snapshot policy target
+// snapshotPolicyName - the name of the snapshot policy
func (client SnapshotPoliciesClient) Get(ctx context.Context, resourceGroupName string, accountName string, snapshotPolicyName string) (result SnapshotPolicy, err error) {
if tracing.IsEnabled() {
ctx = tracing.StartSpan(ctx, fqdn+"/SnapshotPoliciesClient.Get")
@@ -389,7 +389,7 @@ func (client SnapshotPoliciesClient) ListResponder(resp *http.Response) (result
// Parameters:
// resourceGroupName - the name of the resource group.
// accountName - the name of the NetApp account
-// snapshotPolicyName - the name of the snapshot policy target
+// snapshotPolicyName - the name of the snapshot policy
func (client SnapshotPoliciesClient) ListVolumes(ctx context.Context, resourceGroupName string, accountName string, snapshotPolicyName string) (result SnapshotPolicyVolumeList, err error) {
if tracing.IsEnabled() {
ctx = tracing.StartSpan(ctx, fqdn+"/SnapshotPoliciesClient.ListVolumes")
@@ -476,7 +476,7 @@ func (client SnapshotPoliciesClient) ListVolumesResponder(resp *http.Response) (
// body - snapshot policy object supplied in the body of the operation.
// resourceGroupName - the name of the resource group.
// accountName - the name of the NetApp account
-// snapshotPolicyName - the name of the snapshot policy target
+// snapshotPolicyName - the name of the snapshot policy
func (client SnapshotPoliciesClient) Update(ctx context.Context, body SnapshotPolicyPatch, resourceGroupName string, accountName string, snapshotPolicyName string) (result SnapshotPoliciesUpdateFuture, err error) {
if tracing.IsEnabled() {
ctx = tracing.StartSpan(ctx, fqdn+"/SnapshotPoliciesClient.Update")
diff --git a/services/netapp/mgmt/2021-02-01/netapp/snapshots.go b/services/netapp/mgmt/2021-02-01/netapp/snapshots.go
index 4b0a1fa6f5c3..ae51a8a5c308 100644
--- a/services/netapp/mgmt/2021-02-01/netapp/snapshots.go
+++ b/services/netapp/mgmt/2021-02-01/netapp/snapshots.go
@@ -38,7 +38,7 @@ func NewSnapshotsClientWithBaseURI(baseURI string, subscriptionID string) Snapsh
// accountName - the name of the NetApp account
// poolName - the name of the capacity pool
// volumeName - the name of the volume
-// snapshotName - the name of the mount target
+// snapshotName - the name of the snapshot
func (client SnapshotsClient) Create(ctx context.Context, body Snapshot, resourceGroupName string, accountName string, poolName string, volumeName string, snapshotName string) (result SnapshotsCreateFuture, err error) {
if tracing.IsEnabled() {
ctx = tracing.StartSpan(ctx, fqdn+"/SnapshotsClient.Create")
@@ -153,7 +153,7 @@ func (client SnapshotsClient) CreateResponder(resp *http.Response) (result Snaps
// accountName - the name of the NetApp account
// poolName - the name of the capacity pool
// volumeName - the name of the volume
-// snapshotName - the name of the mount target
+// snapshotName - the name of the snapshot
func (client SnapshotsClient) Delete(ctx context.Context, resourceGroupName string, accountName string, poolName string, volumeName string, snapshotName string) (result SnapshotsDeleteFuture, err error) {
if tracing.IsEnabled() {
ctx = tracing.StartSpan(ctx, fqdn+"/SnapshotsClient.Delete")
@@ -253,7 +253,7 @@ func (client SnapshotsClient) DeleteResponder(resp *http.Response) (result autor
// accountName - the name of the NetApp account
// poolName - the name of the capacity pool
// volumeName - the name of the volume
-// snapshotName - the name of the mount target
+// snapshotName - the name of the snapshot
func (client SnapshotsClient) Get(ctx context.Context, resourceGroupName string, accountName string, poolName string, volumeName string, snapshotName string) (result Snapshot, err error) {
if tracing.IsEnabled() {
ctx = tracing.StartSpan(ctx, fqdn+"/SnapshotsClient.Get")
@@ -448,7 +448,7 @@ func (client SnapshotsClient) ListResponder(resp *http.Response) (result Snapsho
// accountName - the name of the NetApp account
// poolName - the name of the capacity pool
// volumeName - the name of the volume
-// snapshotName - the name of the mount target
+// snapshotName - the name of the snapshot
func (client SnapshotsClient) Update(ctx context.Context, body interface{}, resourceGroupName string, accountName string, poolName string, volumeName string, snapshotName string) (result SnapshotsUpdateFuture, err error) {
if tracing.IsEnabled() {
ctx = tracing.StartSpan(ctx, fqdn+"/SnapshotsClient.Update")
diff --git a/services/netapp/mgmt/2021-04-01/netapp/CHANGELOG.md b/services/netapp/mgmt/2021-04-01/netapp/CHANGELOG.md
index 52911e4cc5e4..26b331bced96 100644
--- a/services/netapp/mgmt/2021-04-01/netapp/CHANGELOG.md
+++ b/services/netapp/mgmt/2021-04-01/netapp/CHANGELOG.md
@@ -1,2 +1,45 @@
-# Change History
+# Unreleased
+## Additive Changes
+
+### New Constants
+
+1. EncryptionType.EncryptionTypeDouble
+1. EncryptionType.EncryptionTypeSingle
+1. MetricAggregationType.MetricAggregationTypeAverage
+
+### New Funcs
+
+1. AccountsClient.ListBySubscription(context.Context) (AccountListPage, error)
+1. AccountsClient.ListBySubscriptionComplete(context.Context) (AccountListIterator, error)
+1. AccountsClient.ListBySubscriptionPreparer(context.Context) (*http.Request, error)
+1. AccountsClient.ListBySubscriptionResponder(*http.Response) (AccountList, error)
+1. AccountsClient.ListBySubscriptionSender(*http.Request) (*http.Response, error)
+1. PossibleEncryptionTypeValues() []EncryptionType
+1. PossibleMetricAggregationTypeValues() []MetricAggregationType
+
+### Struct Changes
+
+#### New Structs
+
+1. LogSpecification
+
+#### New Struct Fields
+
+1. Account.Etag
+1. Backup.SystemData
+1. BackupPolicy.Etag
+1. BackupPolicy.SystemData
+1. BackupPolicyProperties.BackupPolicyID
+1. CapacityPool.Etag
+1. MetricSpecification.EnableRegionalMdmAccount
+1. MetricSpecification.InternalMetricName
+1. MetricSpecification.IsInternal
+1. MetricSpecification.SourceMdmAccount
+1. MetricSpecification.SourceMdmNamespace
+1. MetricSpecification.SupportedAggregationTypes
+1. MetricSpecification.SupportedTimeGrainTypes
+1. PoolProperties.EncryptionType
+1. ServiceSpecification.LogSpecifications
+1. SnapshotPolicy.Etag
+1. Volume.Etag
diff --git a/services/netapp/mgmt/2021-04-01/netapp/_meta.json b/services/netapp/mgmt/2021-04-01/netapp/_meta.json
index 899cc14cc6c8..81473e037215 100644
--- a/services/netapp/mgmt/2021-04-01/netapp/_meta.json
+++ b/services/netapp/mgmt/2021-04-01/netapp/_meta.json
@@ -1,5 +1,5 @@
{
- "commit": "ef7ffaa1ae68ab17dba86d8e0be5fd1fb615ef64",
+ "commit": "ed4b29fbceaea3cc48f039826db5a92360bc7c56",
"readme": "/_/azure-rest-api-specs/specification/netapp/resource-manager/readme.md",
"tag": "package-netapp-2021-04-01",
"use": "@microsoft.azure/autorest.go@2.1.187",
diff --git a/services/netapp/mgmt/2021-04-01/netapp/accounts.go b/services/netapp/mgmt/2021-04-01/netapp/accounts.go
index edf769d8186b..41a638763290 100644
--- a/services/netapp/mgmt/2021-04-01/netapp/accounts.go
+++ b/services/netapp/mgmt/2021-04-01/netapp/accounts.go
@@ -87,6 +87,7 @@ func (client AccountsClient) CreateOrUpdatePreparer(ctx context.Context, body Ac
body.ID = nil
body.Name = nil
+ body.Etag = nil
body.Type = nil
body.SystemData = nil
preparer := autorest.CreatePreparer(
@@ -421,6 +422,119 @@ func (client AccountsClient) ListComplete(ctx context.Context, resourceGroupName
return
}
+// ListBySubscription list and describe all NetApp accounts in the subscription.
+func (client AccountsClient) ListBySubscription(ctx context.Context) (result AccountListPage, err error) {
+ if tracing.IsEnabled() {
+ ctx = tracing.StartSpan(ctx, fqdn+"/AccountsClient.ListBySubscription")
+ defer func() {
+ sc := -1
+ if result.al.Response.Response != nil {
+ sc = result.al.Response.Response.StatusCode
+ }
+ tracing.EndSpan(ctx, sc, err)
+ }()
+ }
+ result.fn = client.listBySubscriptionNextResults
+ req, err := client.ListBySubscriptionPreparer(ctx)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "netapp.AccountsClient", "ListBySubscription", nil, "Failure preparing request")
+ return
+ }
+
+ resp, err := client.ListBySubscriptionSender(req)
+ if err != nil {
+ result.al.Response = autorest.Response{Response: resp}
+ err = autorest.NewErrorWithError(err, "netapp.AccountsClient", "ListBySubscription", resp, "Failure sending request")
+ return
+ }
+
+ result.al, err = client.ListBySubscriptionResponder(resp)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "netapp.AccountsClient", "ListBySubscription", resp, "Failure responding to request")
+ return
+ }
+ if result.al.hasNextLink() && result.al.IsEmpty() {
+ err = result.NextWithContext(ctx)
+ return
+ }
+
+ return
+}
+
+// ListBySubscriptionPreparer prepares the ListBySubscription request.
+func (client AccountsClient) ListBySubscriptionPreparer(ctx context.Context) (*http.Request, error) {
+ pathParameters := map[string]interface{}{
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
+ }
+
+ const APIVersion = "2021-04-01"
+ queryParameters := map[string]interface{}{
+ "api-version": APIVersion,
+ }
+
+ preparer := autorest.CreatePreparer(
+ autorest.AsGet(),
+ autorest.WithBaseURL(client.BaseURI),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.NetApp/netAppAccounts", pathParameters),
+ autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare((&http.Request{}).WithContext(ctx))
+}
+
+// ListBySubscriptionSender sends the ListBySubscription request. The method will close the
+// http.Response Body if it receives an error.
+func (client AccountsClient) ListBySubscriptionSender(req *http.Request) (*http.Response, error) {
+ return client.Send(req, azure.DoRetryWithRegistration(client.Client))
+}
+
+// ListBySubscriptionResponder handles the response to the ListBySubscription request. The method always
+// closes the http.Response Body.
+func (client AccountsClient) ListBySubscriptionResponder(resp *http.Response) (result AccountList, err error) {
+ err = autorest.Respond(
+ resp,
+ azure.WithErrorUnlessStatusCode(http.StatusOK),
+ autorest.ByUnmarshallingJSON(&result),
+ autorest.ByClosing())
+ result.Response = autorest.Response{Response: resp}
+ return
+}
+
+// listBySubscriptionNextResults retrieves the next set of results, if any.
+func (client AccountsClient) listBySubscriptionNextResults(ctx context.Context, lastResults AccountList) (result AccountList, err error) {
+ req, err := lastResults.accountListPreparer(ctx)
+ if err != nil {
+ return result, autorest.NewErrorWithError(err, "netapp.AccountsClient", "listBySubscriptionNextResults", nil, "Failure preparing next results request")
+ }
+ if req == nil {
+ return
+ }
+ resp, err := client.ListBySubscriptionSender(req)
+ if err != nil {
+ result.Response = autorest.Response{Response: resp}
+ return result, autorest.NewErrorWithError(err, "netapp.AccountsClient", "listBySubscriptionNextResults", resp, "Failure sending next results request")
+ }
+ result, err = client.ListBySubscriptionResponder(resp)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "netapp.AccountsClient", "listBySubscriptionNextResults", resp, "Failure responding to next results request")
+ }
+ return
+}
+
+// ListBySubscriptionComplete enumerates all values, automatically crossing page boundaries as required.
+func (client AccountsClient) ListBySubscriptionComplete(ctx context.Context) (result AccountListIterator, err error) {
+ if tracing.IsEnabled() {
+ ctx = tracing.StartSpan(ctx, fqdn+"/AccountsClient.ListBySubscription")
+ defer func() {
+ sc := -1
+ if result.Response().Response.Response != nil {
+ sc = result.page.Response().Response.Response.StatusCode
+ }
+ tracing.EndSpan(ctx, sc, err)
+ }()
+ }
+ result.page, err = client.ListBySubscription(ctx)
+ return
+}
+
// Update patch the specified NetApp account
// Parameters:
// body - netApp Account object supplied in the body of the operation.
diff --git a/services/netapp/mgmt/2021-04-01/netapp/backuppolicies.go b/services/netapp/mgmt/2021-04-01/netapp/backuppolicies.go
index e08dd6476653..7eca23e6a9e6 100644
--- a/services/netapp/mgmt/2021-04-01/netapp/backuppolicies.go
+++ b/services/netapp/mgmt/2021-04-01/netapp/backuppolicies.go
@@ -90,7 +90,9 @@ func (client BackupPoliciesClient) CreatePreparer(ctx context.Context, resourceG
body.ID = nil
body.Name = nil
+ body.Etag = nil
body.Type = nil
+ body.SystemData = nil
preparer := autorest.CreatePreparer(
autorest.AsContentType("application/json; charset=utf-8"),
autorest.AsPut(),
diff --git a/services/netapp/mgmt/2021-04-01/netapp/backups.go b/services/netapp/mgmt/2021-04-01/netapp/backups.go
index c2e423d3cff3..687884eadcda 100644
--- a/services/netapp/mgmt/2021-04-01/netapp/backups.go
+++ b/services/netapp/mgmt/2021-04-01/netapp/backups.go
@@ -109,6 +109,7 @@ func (client BackupsClient) CreatePreparer(ctx context.Context, resourceGroupNam
body.ID = nil
body.Name = nil
body.Type = nil
+ body.SystemData = nil
preparer := autorest.CreatePreparer(
autorest.AsContentType("application/json; charset=utf-8"),
autorest.AsPut(),
diff --git a/services/netapp/mgmt/2021-04-01/netapp/enums.go b/services/netapp/mgmt/2021-04-01/netapp/enums.go
index 57dfe91ca31e..291e571c70db 100644
--- a/services/netapp/mgmt/2021-04-01/netapp/enums.go
+++ b/services/netapp/mgmt/2021-04-01/netapp/enums.go
@@ -114,6 +114,21 @@ func PossibleCreatedByTypeValues() []CreatedByType {
return []CreatedByType{CreatedByTypeApplication, CreatedByTypeKey, CreatedByTypeManagedIdentity, CreatedByTypeUser}
}
+// EncryptionType enumerates the values for encryption type.
+type EncryptionType string
+
+const (
+ // EncryptionTypeDouble EncryptionType Double, volumes will use double encryption at rest
+ EncryptionTypeDouble EncryptionType = "Double"
+ // EncryptionTypeSingle EncryptionType Single, volumes will use single encryption at rest
+ EncryptionTypeSingle EncryptionType = "Single"
+)
+
+// PossibleEncryptionTypeValues returns an array of possible values for the EncryptionType const type.
+func PossibleEncryptionTypeValues() []EncryptionType {
+ return []EncryptionType{EncryptionTypeDouble, EncryptionTypeSingle}
+}
+
// EndpointType enumerates the values for endpoint type.
type EndpointType string
@@ -144,6 +159,19 @@ func PossibleInAvailabilityReasonTypeValues() []InAvailabilityReasonType {
return []InAvailabilityReasonType{InAvailabilityReasonTypeAlreadyExists, InAvailabilityReasonTypeInvalid}
}
+// MetricAggregationType enumerates the values for metric aggregation type.
+type MetricAggregationType string
+
+const (
+ // MetricAggregationTypeAverage ...
+ MetricAggregationTypeAverage MetricAggregationType = "Average"
+)
+
+// PossibleMetricAggregationTypeValues returns an array of possible values for the MetricAggregationType const type.
+func PossibleMetricAggregationTypeValues() []MetricAggregationType {
+ return []MetricAggregationType{MetricAggregationTypeAverage}
+}
+
// MirrorState enumerates the values for mirror state.
type MirrorState string
diff --git a/services/netapp/mgmt/2021-04-01/netapp/models.go b/services/netapp/mgmt/2021-04-01/netapp/models.go
index 64186d558e7a..89115f5574c8 100644
--- a/services/netapp/mgmt/2021-04-01/netapp/models.go
+++ b/services/netapp/mgmt/2021-04-01/netapp/models.go
@@ -29,6 +29,8 @@ type Account struct {
ID *string `json:"id,omitempty"`
// Name - READ-ONLY; Resource name
Name *string `json:"name,omitempty"`
+ // Etag - READ-ONLY; A unique read-only string that changes whenever the resource is updated.
+ Etag *string `json:"etag,omitempty"`
// Type - READ-ONLY; Resource type
Type *string `json:"type,omitempty"`
// Tags - Resource tags
@@ -90,6 +92,15 @@ func (a *Account) UnmarshalJSON(body []byte) error {
}
a.Name = &name
}
+ case "etag":
+ if v != nil {
+ var etag string
+ err = json.Unmarshal(*v, &etag)
+ if err != nil {
+ return err
+ }
+ a.Etag = &etag
+ }
case "type":
if v != nil {
var typeVar string
@@ -702,6 +713,8 @@ type Backup struct {
Type *string `json:"type,omitempty"`
// BackupProperties - Backup Properties
*BackupProperties `json:"properties,omitempty"`
+ // SystemData - READ-ONLY; The system meta data relating to this resource.
+ SystemData *SystemData `json:"systemData,omitempty"`
}
// MarshalJSON is the custom marshaler for Backup.
@@ -770,6 +783,15 @@ func (b *Backup) UnmarshalJSON(body []byte) error {
}
b.BackupProperties = &backupProperties
}
+ case "systemData":
+ if v != nil {
+ var systemData SystemData
+ err = json.Unmarshal(*v, &systemData)
+ if err != nil {
+ return err
+ }
+ b.SystemData = &systemData
+ }
}
}
@@ -968,10 +990,14 @@ type BackupPolicy struct {
ID *string `json:"id,omitempty"`
// Name - READ-ONLY; Resource name
Name *string `json:"name,omitempty"`
+ // Etag - READ-ONLY; A unique read-only string that changes whenever the resource is updated.
+ Etag *string `json:"etag,omitempty"`
// Type - READ-ONLY; Resource type
Type *string `json:"type,omitempty"`
// Tags - Resource tags
Tags map[string]*string `json:"tags"`
+ // SystemData - READ-ONLY; The system meta data relating to this resource.
+ SystemData *SystemData `json:"systemData,omitempty"`
// BackupPolicyProperties - Backup policy Properties
*BackupPolicyProperties `json:"properties,omitempty"`
}
@@ -1027,6 +1053,15 @@ func (bp *BackupPolicy) UnmarshalJSON(body []byte) error {
}
bp.Name = &name
}
+ case "etag":
+ if v != nil {
+ var etag string
+ err = json.Unmarshal(*v, &etag)
+ if err != nil {
+ return err
+ }
+ bp.Etag = &etag
+ }
case "type":
if v != nil {
var typeVar string
@@ -1045,6 +1080,15 @@ func (bp *BackupPolicy) UnmarshalJSON(body []byte) error {
}
bp.Tags = tags
}
+ case "systemData":
+ if v != nil {
+ var systemData SystemData
+ err = json.Unmarshal(*v, &systemData)
+ if err != nil {
+ return err
+ }
+ bp.SystemData = &systemData
+ }
case "properties":
if v != nil {
var backupPolicyProperties BackupPolicyProperties
@@ -1264,6 +1308,8 @@ func (bpp *BackupPolicyPatch) UnmarshalJSON(body []byte) error {
type BackupPolicyProperties struct {
// Name - READ-ONLY; Name of backup policy
Name *string `json:"name,omitempty"`
+ // BackupPolicyID - READ-ONLY; Backup Policy Resource ID
+ BackupPolicyID *string `json:"backupPolicyId,omitempty"`
// ProvisioningState - READ-ONLY; Azure lifecycle management
ProvisioningState *string `json:"provisioningState,omitempty"`
// DailyBackupsToKeep - Daily backups count to keep
@@ -1515,6 +1561,8 @@ type CapacityPool struct {
ID *string `json:"id,omitempty"`
// Name - READ-ONLY; Resource name
Name *string `json:"name,omitempty"`
+ // Etag - READ-ONLY; A unique read-only string that changes whenever the resource is updated.
+ Etag *string `json:"etag,omitempty"`
// Type - READ-ONLY; Resource type
Type *string `json:"type,omitempty"`
// Tags - Resource tags
@@ -1574,6 +1622,15 @@ func (cp *CapacityPool) UnmarshalJSON(body []byte) error {
}
cp.Name = &name
}
+ case "etag":
+ if v != nil {
+ var etag string
+ err = json.Unmarshal(*v, &etag)
+ if err != nil {
+ return err
+ }
+ cp.Etag = &etag
+ }
case "type":
if v != nil {
var typeVar string
@@ -1964,6 +2021,14 @@ type HourlySchedule struct {
UsedBytes *int64 `json:"usedBytes,omitempty"`
}
+// LogSpecification log Definition of a single resource metric.
+type LogSpecification struct {
+ // Name - Name of log specification.
+ Name *string `json:"name,omitempty"`
+ // DisplayName - Display name of log specification.
+ DisplayName *string `json:"displayName,omitempty"`
+}
+
// MetricSpecification metric specification of operation.
type MetricSpecification struct {
// Name - Name of metric specification.
@@ -1974,6 +2039,18 @@ type MetricSpecification struct {
DisplayDescription *string `json:"displayDescription,omitempty"`
// Unit - Unit could be Bytes or Count.
Unit *string `json:"unit,omitempty"`
+ // SupportedAggregationTypes - Support metric aggregation type.
+ SupportedAggregationTypes *[]MetricAggregationType `json:"supportedAggregationTypes,omitempty"`
+ // SupportedTimeGrainTypes - The supported time grain types for the metrics.
+ SupportedTimeGrainTypes *[]string `json:"supportedTimeGrainTypes,omitempty"`
+ // InternalMetricName - The internal metric name.
+ InternalMetricName *string `json:"internalMetricName,omitempty"`
+ // EnableRegionalMdmAccount - Whether or not the service is using regional MDM accounts.
+ EnableRegionalMdmAccount *bool `json:"enableRegionalMdmAccount,omitempty"`
+ // SourceMdmAccount - The source MDM account.
+ SourceMdmAccount *string `json:"sourceMdmAccount,omitempty"`
+ // SourceMdmNamespace - The source MDM namespace.
+ SourceMdmNamespace *string `json:"sourceMdmNamespace,omitempty"`
// Dimensions - Dimensions of blobs, including blob type and access tier.
Dimensions *[]Dimension `json:"dimensions,omitempty"`
// AggregationType - Aggregation type could be Average.
@@ -1984,6 +2061,8 @@ type MetricSpecification struct {
Category *string `json:"category,omitempty"`
// ResourceIDDimensionNameOverride - Account Resource Id.
ResourceIDDimensionNameOverride *string `json:"resourceIdDimensionNameOverride,omitempty"`
+ // IsInternal - Whether the metric is internal.
+ IsInternal *bool `json:"isInternal,omitempty"`
}
// MonthlySchedule monthly Schedule properties
@@ -2263,6 +2342,8 @@ type PoolProperties struct {
QosType QosType `json:"qosType,omitempty"`
// CoolAccess - If enabled (true) the pool can contain cool Access enabled volumes.
CoolAccess *bool `json:"coolAccess,omitempty"`
+ // EncryptionType - Encryption type of the capacity pool, set encryption type for data at rest for this pool and all volumes in it. This value can only be set when creating new pool. Possible values include: 'EncryptionTypeSingle', 'EncryptionTypeDouble'
+ EncryptionType EncryptionType `json:"encryptionType,omitempty"`
}
// MarshalJSON is the custom marshaler for PoolProperties.
@@ -2280,6 +2361,9 @@ func (pp PoolProperties) MarshalJSON() ([]byte, error) {
if pp.CoolAccess != nil {
objectMap["coolAccess"] = pp.CoolAccess
}
+ if pp.EncryptionType != "" {
+ objectMap["encryptionType"] = pp.EncryptionType
+ }
return json.Marshal(objectMap)
}
@@ -2499,6 +2583,8 @@ func (rs RestoreStatus) MarshalJSON() ([]byte, error) {
type ServiceSpecification struct {
// MetricSpecifications - Metric specifications of operation.
MetricSpecifications *[]MetricSpecification `json:"metricSpecifications,omitempty"`
+ // LogSpecifications - Log specification of operation.
+ LogSpecifications *[]LogSpecification `json:"logSpecifications,omitempty"`
}
// Snapshot snapshot of a Volume
@@ -2684,6 +2770,8 @@ type SnapshotPolicy struct {
ID *string `json:"id,omitempty"`
// Name - READ-ONLY; Resource name
Name *string `json:"name,omitempty"`
+ // Etag - READ-ONLY; A unique read-only string that changes whenever the resource is updated.
+ Etag *string `json:"etag,omitempty"`
// Type - READ-ONLY; Resource type
Type *string `json:"type,omitempty"`
// Tags - Resource tags
@@ -2743,6 +2831,15 @@ func (sp *SnapshotPolicy) UnmarshalJSON(body []byte) error {
}
sp.Name = &name
}
+ case "etag":
+ if v != nil {
+ var etag string
+ err = json.Unmarshal(*v, &etag)
+ if err != nil {
+ return err
+ }
+ sp.Etag = &etag
+ }
case "type":
if v != nil {
var typeVar string
@@ -3290,6 +3387,8 @@ type Volume struct {
ID *string `json:"id,omitempty"`
// Name - READ-ONLY; Resource name
Name *string `json:"name,omitempty"`
+ // Etag - READ-ONLY; A unique read-only string that changes whenever the resource is updated.
+ Etag *string `json:"etag,omitempty"`
// Type - READ-ONLY; Resource type
Type *string `json:"type,omitempty"`
// Tags - Resource tags
@@ -3349,6 +3448,15 @@ func (vVar *Volume) UnmarshalJSON(body []byte) error {
}
vVar.Name = &name
}
+ case "etag":
+ if v != nil {
+ var etag string
+ err = json.Unmarshal(*v, &etag)
+ if err != nil {
+ return err
+ }
+ vVar.Etag = &etag
+ }
case "type":
if v != nil {
var typeVar string
@@ -3717,7 +3825,7 @@ type VolumeProperties struct {
SubnetID *string `json:"subnetId,omitempty"`
// MountTargets - READ-ONLY; List of mount targets
MountTargets *[]MountTargetProperties `json:"mountTargets,omitempty"`
- // VolumeType - What type of volume is this
+ // VolumeType - What type of volume is this. For destination volumes in Cross Region Replication, set type to DataProtection
VolumeType *string `json:"volumeType,omitempty"`
// DataProtection - DataProtection type volumes include an object containing details of the replication
DataProtection *VolumePropertiesDataProtection `json:"dataProtection,omitempty"`
diff --git a/services/netapp/mgmt/2021-04-01/netapp/netappapi/interfaces.go b/services/netapp/mgmt/2021-04-01/netapp/netappapi/interfaces.go
index a382863cbe64..f68c80733957 100644
--- a/services/netapp/mgmt/2021-04-01/netapp/netappapi/interfaces.go
+++ b/services/netapp/mgmt/2021-04-01/netapp/netappapi/interfaces.go
@@ -34,6 +34,8 @@ type AccountsClientAPI interface {
Get(ctx context.Context, resourceGroupName string, accountName string) (result netapp.Account, err error)
List(ctx context.Context, resourceGroupName string) (result netapp.AccountListPage, err error)
ListComplete(ctx context.Context, resourceGroupName string) (result netapp.AccountListIterator, err error)
+ ListBySubscription(ctx context.Context) (result netapp.AccountListPage, err error)
+ ListBySubscriptionComplete(ctx context.Context) (result netapp.AccountListIterator, err error)
Update(ctx context.Context, body netapp.AccountPatch, resourceGroupName string, accountName string) (result netapp.AccountsUpdateFuture, err error)
}
diff --git a/services/netapp/mgmt/2021-04-01/netapp/pools.go b/services/netapp/mgmt/2021-04-01/netapp/pools.go
index 02d4b05f0b16..96c86f921889 100644
--- a/services/netapp/mgmt/2021-04-01/netapp/pools.go
+++ b/services/netapp/mgmt/2021-04-01/netapp/pools.go
@@ -104,6 +104,7 @@ func (client PoolsClient) CreateOrUpdatePreparer(ctx context.Context, body Capac
body.ID = nil
body.Name = nil
+ body.Etag = nil
body.Type = nil
preparer := autorest.CreatePreparer(
autorest.AsContentType("application/json; charset=utf-8"),
diff --git a/services/netapp/mgmt/2021-04-01/netapp/snapshotpolicies.go b/services/netapp/mgmt/2021-04-01/netapp/snapshotpolicies.go
index a4ce98004ad3..30bc45898b64 100644
--- a/services/netapp/mgmt/2021-04-01/netapp/snapshotpolicies.go
+++ b/services/netapp/mgmt/2021-04-01/netapp/snapshotpolicies.go
@@ -37,7 +37,7 @@ func NewSnapshotPoliciesClientWithBaseURI(baseURI string, subscriptionID string)
// body - snapshot policy object supplied in the body of the operation.
// resourceGroupName - the name of the resource group.
// accountName - the name of the NetApp account
-// snapshotPolicyName - the name of the snapshot policy target
+// snapshotPolicyName - the name of the snapshot policy
func (client SnapshotPoliciesClient) Create(ctx context.Context, body SnapshotPolicy, resourceGroupName string, accountName string, snapshotPolicyName string) (result SnapshotPolicy, err error) {
if tracing.IsEnabled() {
ctx = tracing.StartSpan(ctx, fqdn+"/SnapshotPoliciesClient.Create")
@@ -98,6 +98,7 @@ func (client SnapshotPoliciesClient) CreatePreparer(ctx context.Context, body Sn
body.ID = nil
body.Name = nil
+ body.Etag = nil
body.Type = nil
preparer := autorest.CreatePreparer(
autorest.AsContentType("application/json; charset=utf-8"),
@@ -131,7 +132,7 @@ func (client SnapshotPoliciesClient) CreateResponder(resp *http.Response) (resul
// Parameters:
// resourceGroupName - the name of the resource group.
// accountName - the name of the NetApp account
-// snapshotPolicyName - the name of the snapshot policy target
+// snapshotPolicyName - the name of the snapshot policy
func (client SnapshotPoliciesClient) Delete(ctx context.Context, resourceGroupName string, accountName string, snapshotPolicyName string) (result SnapshotPoliciesDeleteFuture, err error) {
if tracing.IsEnabled() {
ctx = tracing.StartSpan(ctx, fqdn+"/SnapshotPoliciesClient.Delete")
@@ -219,7 +220,7 @@ func (client SnapshotPoliciesClient) DeleteResponder(resp *http.Response) (resul
// Parameters:
// resourceGroupName - the name of the resource group.
// accountName - the name of the NetApp account
-// snapshotPolicyName - the name of the snapshot policy target
+// snapshotPolicyName - the name of the snapshot policy
func (client SnapshotPoliciesClient) Get(ctx context.Context, resourceGroupName string, accountName string, snapshotPolicyName string) (result SnapshotPolicy, err error) {
if tracing.IsEnabled() {
ctx = tracing.StartSpan(ctx, fqdn+"/SnapshotPoliciesClient.Get")
@@ -389,7 +390,7 @@ func (client SnapshotPoliciesClient) ListResponder(resp *http.Response) (result
// Parameters:
// resourceGroupName - the name of the resource group.
// accountName - the name of the NetApp account
-// snapshotPolicyName - the name of the snapshot policy target
+// snapshotPolicyName - the name of the snapshot policy
func (client SnapshotPoliciesClient) ListVolumes(ctx context.Context, resourceGroupName string, accountName string, snapshotPolicyName string) (result SnapshotPolicyVolumeList, err error) {
if tracing.IsEnabled() {
ctx = tracing.StartSpan(ctx, fqdn+"/SnapshotPoliciesClient.ListVolumes")
@@ -476,7 +477,7 @@ func (client SnapshotPoliciesClient) ListVolumesResponder(resp *http.Response) (
// body - snapshot policy object supplied in the body of the operation.
// resourceGroupName - the name of the resource group.
// accountName - the name of the NetApp account
-// snapshotPolicyName - the name of the snapshot policy target
+// snapshotPolicyName - the name of the snapshot policy
func (client SnapshotPoliciesClient) Update(ctx context.Context, body SnapshotPolicyPatch, resourceGroupName string, accountName string, snapshotPolicyName string) (result SnapshotPoliciesUpdateFuture, err error) {
if tracing.IsEnabled() {
ctx = tracing.StartSpan(ctx, fqdn+"/SnapshotPoliciesClient.Update")
diff --git a/services/netapp/mgmt/2021-04-01/netapp/snapshots.go b/services/netapp/mgmt/2021-04-01/netapp/snapshots.go
index e73bdd785fcc..03775bab5235 100644
--- a/services/netapp/mgmt/2021-04-01/netapp/snapshots.go
+++ b/services/netapp/mgmt/2021-04-01/netapp/snapshots.go
@@ -38,7 +38,7 @@ func NewSnapshotsClientWithBaseURI(baseURI string, subscriptionID string) Snapsh
// accountName - the name of the NetApp account
// poolName - the name of the capacity pool
// volumeName - the name of the volume
-// snapshotName - the name of the mount target
+// snapshotName - the name of the snapshot
func (client SnapshotsClient) Create(ctx context.Context, body Snapshot, resourceGroupName string, accountName string, poolName string, volumeName string, snapshotName string) (result SnapshotsCreateFuture, err error) {
if tracing.IsEnabled() {
ctx = tracing.StartSpan(ctx, fqdn+"/SnapshotsClient.Create")
@@ -153,7 +153,7 @@ func (client SnapshotsClient) CreateResponder(resp *http.Response) (result Snaps
// accountName - the name of the NetApp account
// poolName - the name of the capacity pool
// volumeName - the name of the volume
-// snapshotName - the name of the mount target
+// snapshotName - the name of the snapshot
func (client SnapshotsClient) Delete(ctx context.Context, resourceGroupName string, accountName string, poolName string, volumeName string, snapshotName string) (result SnapshotsDeleteFuture, err error) {
if tracing.IsEnabled() {
ctx = tracing.StartSpan(ctx, fqdn+"/SnapshotsClient.Delete")
@@ -253,7 +253,7 @@ func (client SnapshotsClient) DeleteResponder(resp *http.Response) (result autor
// accountName - the name of the NetApp account
// poolName - the name of the capacity pool
// volumeName - the name of the volume
-// snapshotName - the name of the mount target
+// snapshotName - the name of the snapshot
func (client SnapshotsClient) Get(ctx context.Context, resourceGroupName string, accountName string, poolName string, volumeName string, snapshotName string) (result Snapshot, err error) {
if tracing.IsEnabled() {
ctx = tracing.StartSpan(ctx, fqdn+"/SnapshotsClient.Get")
@@ -448,7 +448,7 @@ func (client SnapshotsClient) ListResponder(resp *http.Response) (result Snapsho
// accountName - the name of the NetApp account
// poolName - the name of the capacity pool
// volumeName - the name of the volume
-// snapshotName - the name of the mount target
+// snapshotName - the name of the snapshot
func (client SnapshotsClient) Update(ctx context.Context, body interface{}, resourceGroupName string, accountName string, poolName string, volumeName string, snapshotName string) (result SnapshotsUpdateFuture, err error) {
if tracing.IsEnabled() {
ctx = tracing.StartSpan(ctx, fqdn+"/SnapshotsClient.Update")
diff --git a/services/netapp/mgmt/2021-04-01/netapp/volumes.go b/services/netapp/mgmt/2021-04-01/netapp/volumes.go
index d6db694e963b..a7fd94fef103 100644
--- a/services/netapp/mgmt/2021-04-01/netapp/volumes.go
+++ b/services/netapp/mgmt/2021-04-01/netapp/volumes.go
@@ -347,6 +347,7 @@ func (client VolumesClient) CreateOrUpdatePreparer(ctx context.Context, body Vol
body.ID = nil
body.Name = nil
+ body.Etag = nil
body.Type = nil
preparer := autorest.CreatePreparer(
autorest.AsContentType("application/json; charset=utf-8"),
diff --git a/services/netapp/mgmt/2021-06-01/netapp/CHANGELOG.md b/services/netapp/mgmt/2021-06-01/netapp/CHANGELOG.md
index fc0d66e3e9f8..d9f628b47e8e 100644
--- a/services/netapp/mgmt/2021-06-01/netapp/CHANGELOG.md
+++ b/services/netapp/mgmt/2021-06-01/netapp/CHANGELOG.md
@@ -1,56 +1,9 @@
-# Change History
+# Unreleased
-## Additive Changes
-
-### New Constants
-
-1. NetworkFeatures.NetworkFeaturesBasic
-1. NetworkFeatures.NetworkFeaturesStandard
-1. VolumeStorageToNetworkProximity.VolumeStorageToNetworkProximityDefault
-1. VolumeStorageToNetworkProximity.VolumeStorageToNetworkProximityT1
-1. VolumeStorageToNetworkProximity.VolumeStorageToNetworkProximityT2
-
-### New Funcs
-
-1. *SubscriptionQuotaItem.UnmarshalJSON([]byte) error
-1. AzureEntityResource.MarshalJSON() ([]byte, error)
-1. NewResourceQuotaLimitsClient(string) ResourceQuotaLimitsClient
-1. NewResourceQuotaLimitsClientWithBaseURI(string, string) ResourceQuotaLimitsClient
-1. PossibleNetworkFeaturesValues() []NetworkFeatures
-1. PossibleVolumeStorageToNetworkProximityValues() []VolumeStorageToNetworkProximity
-1. ProxyResource.MarshalJSON() ([]byte, error)
-1. Resource.MarshalJSON() ([]byte, error)
-1. ResourceQuotaLimitsClient.Get(context.Context, string, string) (SubscriptionQuotaItem, error)
-1. ResourceQuotaLimitsClient.GetPreparer(context.Context, string, string) (*http.Request, error)
-1. ResourceQuotaLimitsClient.GetResponder(*http.Response) (SubscriptionQuotaItem, error)
-1. ResourceQuotaLimitsClient.GetSender(*http.Request) (*http.Response, error)
-1. ResourceQuotaLimitsClient.List(context.Context, string) (SubscriptionQuotaItemList, error)
-1. ResourceQuotaLimitsClient.ListPreparer(context.Context, string) (*http.Request, error)
-1. ResourceQuotaLimitsClient.ListResponder(*http.Response) (SubscriptionQuotaItemList, error)
-1. ResourceQuotaLimitsClient.ListSender(*http.Request) (*http.Response, error)
-1. SubscriptionQuotaItem.MarshalJSON() ([]byte, error)
-1. SubscriptionQuotaItemProperties.MarshalJSON() ([]byte, error)
-1. TrackedResource.MarshalJSON() ([]byte, error)
+## Breaking Changes
### Struct Changes
-#### New Structs
-
-1. AzureEntityResource
-1. LogSpecification
-1. ProxyResource
-1. Resource
-1. ResourceQuotaLimitsClient
-1. SubscriptionQuotaItem
-1. SubscriptionQuotaItemList
-1. SubscriptionQuotaItemProperties
-1. TrackedResource
-
-#### New Struct Fields
+#### Removed Struct Fields
-1. MetricSpecification.EnableRegionalMdmAccount
-1. MetricSpecification.IsInternal
-1. ServiceSpecification.LogSpecifications
-1. VolumeProperties.NetworkFeatures
-1. VolumeProperties.NetworkSiblingSetID
-1. VolumeProperties.StorageToNetworkProximity
+1. SubscriptionQuotaItemProperties.Name
diff --git a/services/netapp/mgmt/2021-06-01/netapp/_meta.json b/services/netapp/mgmt/2021-06-01/netapp/_meta.json
index e7cfc268a08b..c4a5f3fbafee 100644
--- a/services/netapp/mgmt/2021-06-01/netapp/_meta.json
+++ b/services/netapp/mgmt/2021-06-01/netapp/_meta.json
@@ -1,5 +1,5 @@
{
- "commit": "a95079cdd7a60c5af0417360b1ee56c8ae845cc4",
+ "commit": "ed4b29fbceaea3cc48f039826db5a92360bc7c56",
"readme": "/_/azure-rest-api-specs/specification/netapp/resource-manager/readme.md",
"tag": "package-netapp-2021-06-01",
"use": "@microsoft.azure/autorest.go@2.1.187",
diff --git a/services/netapp/mgmt/2021-06-01/netapp/models.go b/services/netapp/mgmt/2021-06-01/netapp/models.go
index 39fac048638a..5b54e14337dd 100644
--- a/services/netapp/mgmt/2021-06-01/netapp/models.go
+++ b/services/netapp/mgmt/2021-06-01/netapp/models.go
@@ -2008,7 +2008,9 @@ type HourlySchedule struct {
// LogSpecification log Definition of a single resource metric.
type LogSpecification struct {
- Name *string `json:"name,omitempty"`
+ // Name - Name of log specification.
+ Name *string `json:"name,omitempty"`
+ // DisplayName - Display name of log specification.
DisplayName *string `json:"displayName,omitempty"`
}
@@ -2599,7 +2601,8 @@ func (rs RestoreStatus) MarshalJSON() ([]byte, error) {
type ServiceSpecification struct {
// MetricSpecifications - Metric specifications of operation.
MetricSpecifications *[]MetricSpecification `json:"metricSpecifications,omitempty"`
- LogSpecifications *[]LogSpecification `json:"logSpecifications,omitempty"`
+ // LogSpecifications - Log specification of operation.
+ LogSpecifications *[]LogSpecification `json:"logSpecifications,omitempty"`
}
// Snapshot snapshot of a Volume
@@ -3371,8 +3374,6 @@ type SubscriptionQuotaItemList struct {
// SubscriptionQuotaItemProperties subscriptionQuotaItem Properties
type SubscriptionQuotaItemProperties struct {
- // Name - READ-ONLY; Quota Item name
- Name *string `json:"name,omitempty"`
// Current - READ-ONLY; The current quota value.
Current *int32 `json:"current,omitempty"`
// Default - READ-ONLY; The default quota value.
diff --git a/services/netapp/mgmt/2021-06-01/netapp/volumes.go b/services/netapp/mgmt/2021-06-01/netapp/volumes.go
index aaf8f13212f5..b555037fe792 100644
--- a/services/netapp/mgmt/2021-06-01/netapp/volumes.go
+++ b/services/netapp/mgmt/2021-06-01/netapp/volumes.go
@@ -292,10 +292,6 @@ func (client VolumesClient) CreateOrUpdate(ctx context.Context, body Volume, res
Chain: []validation.Constraint{{Target: "body.VolumeProperties.DataProtection.Replication", Name: validation.Null, Rule: false,
Chain: []validation.Constraint{{Target: "body.VolumeProperties.DataProtection.Replication.RemoteVolumeResourceID", Name: validation.Null, Rule: true, Chain: nil}}},
}},
- {Target: "body.VolumeProperties.ThroughputMibps", Name: validation.Null, Rule: false,
- Chain: []validation.Constraint{{Target: "body.VolumeProperties.ThroughputMibps", Name: validation.InclusiveMaximum, Rule: float64(4500), Chain: nil},
- {Target: "body.VolumeProperties.ThroughputMibps", Name: validation.InclusiveMinimum, Rule: float64(0), Chain: nil},
- }},
{Target: "body.VolumeProperties.CoolnessPeriod", Name: validation.Null, Rule: false,
Chain: []validation.Constraint{{Target: "body.VolumeProperties.CoolnessPeriod", Name: validation.InclusiveMaximum, Rule: int64(63), Chain: nil},
{Target: "body.VolumeProperties.CoolnessPeriod", Name: validation.InclusiveMinimum, Rule: int64(7), Chain: nil},
diff --git a/services/netapp/mgmt/2021-08-01/netapp/CHANGELOG.md b/services/netapp/mgmt/2021-08-01/netapp/CHANGELOG.md
index 52911e4cc5e4..a1ecf841edb0 100644
--- a/services/netapp/mgmt/2021-08-01/netapp/CHANGELOG.md
+++ b/services/netapp/mgmt/2021-08-01/netapp/CHANGELOG.md
@@ -1,2 +1,2 @@
-# Change History
+# Unreleased
diff --git a/services/netapp/mgmt/2021-08-01/netapp/_meta.json b/services/netapp/mgmt/2021-08-01/netapp/_meta.json
index f1883ce15e7d..4ae0206c321d 100644
--- a/services/netapp/mgmt/2021-08-01/netapp/_meta.json
+++ b/services/netapp/mgmt/2021-08-01/netapp/_meta.json
@@ -1,5 +1,5 @@
{
- "commit": "3c5135f8325eaf79be7b137cae363bdcba028c17",
+ "commit": "ed4b29fbceaea3cc48f039826db5a92360bc7c56",
"readme": "/_/azure-rest-api-specs/specification/netapp/resource-manager/readme.md",
"tag": "package-netapp-2021-08-01",
"use": "@microsoft.azure/autorest.go@2.1.187",
diff --git a/services/netapp/mgmt/2021-10-01/netapp/CHANGELOG.md b/services/netapp/mgmt/2021-10-01/netapp/CHANGELOG.md
new file mode 100644
index 000000000000..a1ecf841edb0
--- /dev/null
+++ b/services/netapp/mgmt/2021-10-01/netapp/CHANGELOG.md
@@ -0,0 +1,2 @@
+# Unreleased
+
diff --git a/services/netapp/mgmt/2021-10-01/netapp/_meta.json b/services/netapp/mgmt/2021-10-01/netapp/_meta.json
new file mode 100644
index 000000000000..2cfa4a940c49
--- /dev/null
+++ b/services/netapp/mgmt/2021-10-01/netapp/_meta.json
@@ -0,0 +1,11 @@
+{
+ "commit": "ed4b29fbceaea3cc48f039826db5a92360bc7c56",
+ "readme": "/_/azure-rest-api-specs/specification/netapp/resource-manager/readme.md",
+ "tag": "package-netapp-2021-10-01",
+ "use": "@microsoft.azure/autorest.go@2.1.187",
+ "repository_url": "https://github.com/Azure/azure-rest-api-specs.git",
+ "autorest_command": "autorest --use=@microsoft.azure/autorest.go@2.1.187 --tag=package-netapp-2021-10-01 --go-sdk-folder=/_/azure-sdk-for-go --go --verbose --use-onever --version=2.0.4421 --go.license-header=MICROSOFT_MIT_NO_VERSION /_/azure-rest-api-specs/specification/netapp/resource-manager/readme.md",
+ "additional_properties": {
+ "additional_options": "--go --verbose --use-onever --version=2.0.4421 --go.license-header=MICROSOFT_MIT_NO_VERSION"
+ }
+}
\ No newline at end of file
diff --git a/services/netapp/mgmt/2021-10-01/netapp/accountbackups.go b/services/netapp/mgmt/2021-10-01/netapp/accountbackups.go
new file mode 100644
index 000000000000..0c1f8bb6327c
--- /dev/null
+++ b/services/netapp/mgmt/2021-10-01/netapp/accountbackups.go
@@ -0,0 +1,290 @@
+package netapp
+
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License. See License.txt in the project root for license information.
+//
+// Code generated by Microsoft (R) AutoRest Code Generator.
+// Changes may cause incorrect behavior and will be lost if the code is regenerated.
+
+import (
+ "context"
+ "github.com/Azure/go-autorest/autorest"
+ "github.com/Azure/go-autorest/autorest/azure"
+ "github.com/Azure/go-autorest/autorest/validation"
+ "github.com/Azure/go-autorest/tracing"
+ "net/http"
+)
+
+// AccountBackupsClient is the microsoft NetApp Files Azure Resource Provider specification
+type AccountBackupsClient struct {
+ BaseClient
+}
+
+// NewAccountBackupsClient creates an instance of the AccountBackupsClient client.
+func NewAccountBackupsClient(subscriptionID string) AccountBackupsClient {
+ return NewAccountBackupsClientWithBaseURI(DefaultBaseURI, subscriptionID)
+}
+
+// NewAccountBackupsClientWithBaseURI creates an instance of the AccountBackupsClient client using a custom endpoint.
+// Use this when interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure stack).
+func NewAccountBackupsClientWithBaseURI(baseURI string, subscriptionID string) AccountBackupsClient {
+ return AccountBackupsClient{NewWithBaseURI(baseURI, subscriptionID)}
+}
+
+// Delete delete the specified Backup for a Netapp Account
+// Parameters:
+// resourceGroupName - the name of the resource group.
+// accountName - the name of the NetApp account
+// backupName - the name of the backup
+func (client AccountBackupsClient) Delete(ctx context.Context, resourceGroupName string, accountName string, backupName string) (result AccountBackupsDeleteFuture, err error) {
+ if tracing.IsEnabled() {
+ ctx = tracing.StartSpan(ctx, fqdn+"/AccountBackupsClient.Delete")
+ defer func() {
+ sc := -1
+ if result.FutureAPI != nil && result.FutureAPI.Response() != nil {
+ sc = result.FutureAPI.Response().StatusCode
+ }
+ tracing.EndSpan(ctx, sc, err)
+ }()
+ }
+ if err := validation.Validate([]validation.Validation{
+ {TargetValue: resourceGroupName,
+ Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil},
+ {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil},
+ {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}}); err != nil {
+ return result, validation.NewError("netapp.AccountBackupsClient", "Delete", err.Error())
+ }
+
+ req, err := client.DeletePreparer(ctx, resourceGroupName, accountName, backupName)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "netapp.AccountBackupsClient", "Delete", nil, "Failure preparing request")
+ return
+ }
+
+ result, err = client.DeleteSender(req)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "netapp.AccountBackupsClient", "Delete", result.Response(), "Failure sending request")
+ return
+ }
+
+ return
+}
+
+// DeletePreparer prepares the Delete request.
+func (client AccountBackupsClient) DeletePreparer(ctx context.Context, resourceGroupName string, accountName string, backupName string) (*http.Request, error) {
+ pathParameters := map[string]interface{}{
+ "accountName": autorest.Encode("path", accountName),
+ "backupName": autorest.Encode("path", backupName),
+ "resourceGroupName": autorest.Encode("path", resourceGroupName),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
+ }
+
+ const APIVersion = "2021-10-01"
+ queryParameters := map[string]interface{}{
+ "api-version": APIVersion,
+ }
+
+ preparer := autorest.CreatePreparer(
+ autorest.AsDelete(),
+ autorest.WithBaseURL(client.BaseURI),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/accountBackups/{backupName}", pathParameters),
+ autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare((&http.Request{}).WithContext(ctx))
+}
+
+// DeleteSender sends the Delete request. The method will close the
+// http.Response Body if it receives an error.
+func (client AccountBackupsClient) DeleteSender(req *http.Request) (future AccountBackupsDeleteFuture, err error) {
+ var resp *http.Response
+ future.FutureAPI = &azure.Future{}
+ resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client))
+ if err != nil {
+ return
+ }
+ var azf azure.Future
+ azf, err = azure.NewFutureFromResponse(resp)
+ future.FutureAPI = &azf
+ future.Result = future.result
+ return
+}
+
+// DeleteResponder handles the response to the Delete request. The method always
+// closes the http.Response Body.
+func (client AccountBackupsClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) {
+ err = autorest.Respond(
+ resp,
+ azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent),
+ autorest.ByClosing())
+ result.Response = resp
+ return
+}
+
+// Get gets the specified backup for a Netapp Account
+// Parameters:
+// resourceGroupName - the name of the resource group.
+// accountName - the name of the NetApp account
+// backupName - the name of the backup
+func (client AccountBackupsClient) Get(ctx context.Context, resourceGroupName string, accountName string, backupName string) (result Backup, err error) {
+ if tracing.IsEnabled() {
+ ctx = tracing.StartSpan(ctx, fqdn+"/AccountBackupsClient.Get")
+ defer func() {
+ sc := -1
+ if result.Response.Response != nil {
+ sc = result.Response.Response.StatusCode
+ }
+ tracing.EndSpan(ctx, sc, err)
+ }()
+ }
+ if err := validation.Validate([]validation.Validation{
+ {TargetValue: resourceGroupName,
+ Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil},
+ {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil},
+ {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}}); err != nil {
+ return result, validation.NewError("netapp.AccountBackupsClient", "Get", err.Error())
+ }
+
+ req, err := client.GetPreparer(ctx, resourceGroupName, accountName, backupName)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "netapp.AccountBackupsClient", "Get", nil, "Failure preparing request")
+ return
+ }
+
+ resp, err := client.GetSender(req)
+ if err != nil {
+ result.Response = autorest.Response{Response: resp}
+ err = autorest.NewErrorWithError(err, "netapp.AccountBackupsClient", "Get", resp, "Failure sending request")
+ return
+ }
+
+ result, err = client.GetResponder(resp)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "netapp.AccountBackupsClient", "Get", resp, "Failure responding to request")
+ return
+ }
+
+ return
+}
+
+// GetPreparer prepares the Get request.
+func (client AccountBackupsClient) GetPreparer(ctx context.Context, resourceGroupName string, accountName string, backupName string) (*http.Request, error) {
+ pathParameters := map[string]interface{}{
+ "accountName": autorest.Encode("path", accountName),
+ "backupName": autorest.Encode("path", backupName),
+ "resourceGroupName": autorest.Encode("path", resourceGroupName),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
+ }
+
+ const APIVersion = "2021-10-01"
+ queryParameters := map[string]interface{}{
+ "api-version": APIVersion,
+ }
+
+ preparer := autorest.CreatePreparer(
+ autorest.AsGet(),
+ autorest.WithBaseURL(client.BaseURI),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/accountBackups/{backupName}", pathParameters),
+ autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare((&http.Request{}).WithContext(ctx))
+}
+
+// GetSender sends the Get request. The method will close the
+// http.Response Body if it receives an error.
+func (client AccountBackupsClient) GetSender(req *http.Request) (*http.Response, error) {
+ return client.Send(req, azure.DoRetryWithRegistration(client.Client))
+}
+
+// GetResponder handles the response to the Get request. The method always
+// closes the http.Response Body.
+func (client AccountBackupsClient) GetResponder(resp *http.Response) (result Backup, err error) {
+ err = autorest.Respond(
+ resp,
+ azure.WithErrorUnlessStatusCode(http.StatusOK),
+ autorest.ByUnmarshallingJSON(&result),
+ autorest.ByClosing())
+ result.Response = autorest.Response{Response: resp}
+ return
+}
+
+// List list all Backups for a Netapp Account
+// Parameters:
+// resourceGroupName - the name of the resource group.
+// accountName - the name of the NetApp account
+func (client AccountBackupsClient) List(ctx context.Context, resourceGroupName string, accountName string) (result BackupsList, err error) {
+ if tracing.IsEnabled() {
+ ctx = tracing.StartSpan(ctx, fqdn+"/AccountBackupsClient.List")
+ defer func() {
+ sc := -1
+ if result.Response.Response != nil {
+ sc = result.Response.Response.StatusCode
+ }
+ tracing.EndSpan(ctx, sc, err)
+ }()
+ }
+ if err := validation.Validate([]validation.Validation{
+ {TargetValue: resourceGroupName,
+ Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil},
+ {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil},
+ {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}}); err != nil {
+ return result, validation.NewError("netapp.AccountBackupsClient", "List", err.Error())
+ }
+
+ req, err := client.ListPreparer(ctx, resourceGroupName, accountName)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "netapp.AccountBackupsClient", "List", nil, "Failure preparing request")
+ return
+ }
+
+ resp, err := client.ListSender(req)
+ if err != nil {
+ result.Response = autorest.Response{Response: resp}
+ err = autorest.NewErrorWithError(err, "netapp.AccountBackupsClient", "List", resp, "Failure sending request")
+ return
+ }
+
+ result, err = client.ListResponder(resp)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "netapp.AccountBackupsClient", "List", resp, "Failure responding to request")
+ return
+ }
+
+ return
+}
+
+// ListPreparer prepares the List request.
+func (client AccountBackupsClient) ListPreparer(ctx context.Context, resourceGroupName string, accountName string) (*http.Request, error) {
+ pathParameters := map[string]interface{}{
+ "accountName": autorest.Encode("path", accountName),
+ "resourceGroupName": autorest.Encode("path", resourceGroupName),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
+ }
+
+ const APIVersion = "2021-10-01"
+ queryParameters := map[string]interface{}{
+ "api-version": APIVersion,
+ }
+
+ preparer := autorest.CreatePreparer(
+ autorest.AsGet(),
+ autorest.WithBaseURL(client.BaseURI),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/accountBackups", pathParameters),
+ autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare((&http.Request{}).WithContext(ctx))
+}
+
+// ListSender sends the List request. The method will close the
+// http.Response Body if it receives an error.
+func (client AccountBackupsClient) ListSender(req *http.Request) (*http.Response, error) {
+ return client.Send(req, azure.DoRetryWithRegistration(client.Client))
+}
+
+// ListResponder handles the response to the List request. The method always
+// closes the http.Response Body.
+func (client AccountBackupsClient) ListResponder(resp *http.Response) (result BackupsList, err error) {
+ err = autorest.Respond(
+ resp,
+ azure.WithErrorUnlessStatusCode(http.StatusOK),
+ autorest.ByUnmarshallingJSON(&result),
+ autorest.ByClosing())
+ result.Response = autorest.Response{Response: resp}
+ return
+}
diff --git a/services/netapp/mgmt/2021-10-01/netapp/accounts.go b/services/netapp/mgmt/2021-10-01/netapp/accounts.go
new file mode 100644
index 000000000000..2e1934acc518
--- /dev/null
+++ b/services/netapp/mgmt/2021-10-01/netapp/accounts.go
@@ -0,0 +1,629 @@
+package netapp
+
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License. See License.txt in the project root for license information.
+//
+// Code generated by Microsoft (R) AutoRest Code Generator.
+// Changes may cause incorrect behavior and will be lost if the code is regenerated.
+
+import (
+ "context"
+ "github.com/Azure/go-autorest/autorest"
+ "github.com/Azure/go-autorest/autorest/azure"
+ "github.com/Azure/go-autorest/autorest/validation"
+ "github.com/Azure/go-autorest/tracing"
+ "net/http"
+)
+
+// AccountsClient is the microsoft NetApp Files Azure Resource Provider specification
+type AccountsClient struct {
+ BaseClient
+}
+
+// NewAccountsClient creates an instance of the AccountsClient client.
+func NewAccountsClient(subscriptionID string) AccountsClient {
+ return NewAccountsClientWithBaseURI(DefaultBaseURI, subscriptionID)
+}
+
+// NewAccountsClientWithBaseURI creates an instance of the AccountsClient client using a custom endpoint. Use this
+// when interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure stack).
+func NewAccountsClientWithBaseURI(baseURI string, subscriptionID string) AccountsClient {
+ return AccountsClient{NewWithBaseURI(baseURI, subscriptionID)}
+}
+
+// CreateOrUpdate create or update the specified NetApp account within the resource group
+// Parameters:
+// body - netApp Account object supplied in the body of the operation.
+// resourceGroupName - the name of the resource group.
+// accountName - the name of the NetApp account
+func (client AccountsClient) CreateOrUpdate(ctx context.Context, body Account, resourceGroupName string, accountName string) (result AccountsCreateOrUpdateFuture, err error) {
+ if tracing.IsEnabled() {
+ ctx = tracing.StartSpan(ctx, fqdn+"/AccountsClient.CreateOrUpdate")
+ defer func() {
+ sc := -1
+ if result.FutureAPI != nil && result.FutureAPI.Response() != nil {
+ sc = result.FutureAPI.Response().StatusCode
+ }
+ tracing.EndSpan(ctx, sc, err)
+ }()
+ }
+ if err := validation.Validate([]validation.Validation{
+ {TargetValue: body,
+ Constraints: []validation.Constraint{{Target: "body.Location", Name: validation.Null, Rule: true, Chain: nil}}},
+ {TargetValue: resourceGroupName,
+ Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil},
+ {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil},
+ {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}}); err != nil {
+ return result, validation.NewError("netapp.AccountsClient", "CreateOrUpdate", err.Error())
+ }
+
+ req, err := client.CreateOrUpdatePreparer(ctx, body, resourceGroupName, accountName)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "netapp.AccountsClient", "CreateOrUpdate", nil, "Failure preparing request")
+ return
+ }
+
+ result, err = client.CreateOrUpdateSender(req)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "netapp.AccountsClient", "CreateOrUpdate", result.Response(), "Failure sending request")
+ return
+ }
+
+ return
+}
+
+// CreateOrUpdatePreparer prepares the CreateOrUpdate request.
+func (client AccountsClient) CreateOrUpdatePreparer(ctx context.Context, body Account, resourceGroupName string, accountName string) (*http.Request, error) {
+ pathParameters := map[string]interface{}{
+ "accountName": autorest.Encode("path", accountName),
+ "resourceGroupName": autorest.Encode("path", resourceGroupName),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
+ }
+
+ const APIVersion = "2021-10-01"
+ queryParameters := map[string]interface{}{
+ "api-version": APIVersion,
+ }
+
+ body.ID = nil
+ body.Name = nil
+ body.Etag = nil
+ body.Type = nil
+ body.SystemData = nil
+ preparer := autorest.CreatePreparer(
+ autorest.AsContentType("application/json; charset=utf-8"),
+ autorest.AsPut(),
+ autorest.WithBaseURL(client.BaseURI),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}", pathParameters),
+ autorest.WithJSON(body),
+ autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare((&http.Request{}).WithContext(ctx))
+}
+
+// CreateOrUpdateSender sends the CreateOrUpdate request. The method will close the
+// http.Response Body if it receives an error.
+func (client AccountsClient) CreateOrUpdateSender(req *http.Request) (future AccountsCreateOrUpdateFuture, err error) {
+ var resp *http.Response
+ future.FutureAPI = &azure.Future{}
+ resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client))
+ if err != nil {
+ return
+ }
+ var azf azure.Future
+ azf, err = azure.NewFutureFromResponse(resp)
+ future.FutureAPI = &azf
+ future.Result = future.result
+ return
+}
+
+// CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always
+// closes the http.Response Body.
+func (client AccountsClient) CreateOrUpdateResponder(resp *http.Response) (result Account, err error) {
+ err = autorest.Respond(
+ resp,
+ azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated),
+ autorest.ByUnmarshallingJSON(&result),
+ autorest.ByClosing())
+ result.Response = autorest.Response{Response: resp}
+ return
+}
+
+// Delete delete the specified NetApp account
+// Parameters:
+// resourceGroupName - the name of the resource group.
+// accountName - the name of the NetApp account
+func (client AccountsClient) Delete(ctx context.Context, resourceGroupName string, accountName string) (result AccountsDeleteFuture, err error) {
+ if tracing.IsEnabled() {
+ ctx = tracing.StartSpan(ctx, fqdn+"/AccountsClient.Delete")
+ defer func() {
+ sc := -1
+ if result.FutureAPI != nil && result.FutureAPI.Response() != nil {
+ sc = result.FutureAPI.Response().StatusCode
+ }
+ tracing.EndSpan(ctx, sc, err)
+ }()
+ }
+ if err := validation.Validate([]validation.Validation{
+ {TargetValue: resourceGroupName,
+ Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil},
+ {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil},
+ {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}}); err != nil {
+ return result, validation.NewError("netapp.AccountsClient", "Delete", err.Error())
+ }
+
+ req, err := client.DeletePreparer(ctx, resourceGroupName, accountName)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "netapp.AccountsClient", "Delete", nil, "Failure preparing request")
+ return
+ }
+
+ result, err = client.DeleteSender(req)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "netapp.AccountsClient", "Delete", result.Response(), "Failure sending request")
+ return
+ }
+
+ return
+}
+
+// DeletePreparer prepares the Delete request.
+func (client AccountsClient) DeletePreparer(ctx context.Context, resourceGroupName string, accountName string) (*http.Request, error) {
+ pathParameters := map[string]interface{}{
+ "accountName": autorest.Encode("path", accountName),
+ "resourceGroupName": autorest.Encode("path", resourceGroupName),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
+ }
+
+ const APIVersion = "2021-10-01"
+ queryParameters := map[string]interface{}{
+ "api-version": APIVersion,
+ }
+
+ preparer := autorest.CreatePreparer(
+ autorest.AsDelete(),
+ autorest.WithBaseURL(client.BaseURI),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}", pathParameters),
+ autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare((&http.Request{}).WithContext(ctx))
+}
+
+// DeleteSender sends the Delete request. The method will close the
+// http.Response Body if it receives an error.
+func (client AccountsClient) DeleteSender(req *http.Request) (future AccountsDeleteFuture, err error) {
+ var resp *http.Response
+ future.FutureAPI = &azure.Future{}
+ resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client))
+ if err != nil {
+ return
+ }
+ var azf azure.Future
+ azf, err = azure.NewFutureFromResponse(resp)
+ future.FutureAPI = &azf
+ future.Result = future.result
+ return
+}
+
+// DeleteResponder handles the response to the Delete request. The method always
+// closes the http.Response Body.
+func (client AccountsClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) {
+ err = autorest.Respond(
+ resp,
+ azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent),
+ autorest.ByClosing())
+ result.Response = resp
+ return
+}
+
+// Get get the NetApp account
+// Parameters:
+// resourceGroupName - the name of the resource group.
+// accountName - the name of the NetApp account
+func (client AccountsClient) Get(ctx context.Context, resourceGroupName string, accountName string) (result Account, err error) {
+ if tracing.IsEnabled() {
+ ctx = tracing.StartSpan(ctx, fqdn+"/AccountsClient.Get")
+ defer func() {
+ sc := -1
+ if result.Response.Response != nil {
+ sc = result.Response.Response.StatusCode
+ }
+ tracing.EndSpan(ctx, sc, err)
+ }()
+ }
+ if err := validation.Validate([]validation.Validation{
+ {TargetValue: resourceGroupName,
+ Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil},
+ {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil},
+ {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}}); err != nil {
+ return result, validation.NewError("netapp.AccountsClient", "Get", err.Error())
+ }
+
+ req, err := client.GetPreparer(ctx, resourceGroupName, accountName)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "netapp.AccountsClient", "Get", nil, "Failure preparing request")
+ return
+ }
+
+ resp, err := client.GetSender(req)
+ if err != nil {
+ result.Response = autorest.Response{Response: resp}
+ err = autorest.NewErrorWithError(err, "netapp.AccountsClient", "Get", resp, "Failure sending request")
+ return
+ }
+
+ result, err = client.GetResponder(resp)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "netapp.AccountsClient", "Get", resp, "Failure responding to request")
+ return
+ }
+
+ return
+}
+
+// GetPreparer prepares the Get request.
+func (client AccountsClient) GetPreparer(ctx context.Context, resourceGroupName string, accountName string) (*http.Request, error) {
+ pathParameters := map[string]interface{}{
+ "accountName": autorest.Encode("path", accountName),
+ "resourceGroupName": autorest.Encode("path", resourceGroupName),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
+ }
+
+ const APIVersion = "2021-10-01"
+ queryParameters := map[string]interface{}{
+ "api-version": APIVersion,
+ }
+
+ preparer := autorest.CreatePreparer(
+ autorest.AsGet(),
+ autorest.WithBaseURL(client.BaseURI),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}", pathParameters),
+ autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare((&http.Request{}).WithContext(ctx))
+}
+
+// GetSender sends the Get request. The method will close the
+// http.Response Body if it receives an error.
+func (client AccountsClient) GetSender(req *http.Request) (*http.Response, error) {
+ return client.Send(req, azure.DoRetryWithRegistration(client.Client))
+}
+
+// GetResponder handles the response to the Get request. The method always
+// closes the http.Response Body.
+func (client AccountsClient) GetResponder(resp *http.Response) (result Account, err error) {
+ err = autorest.Respond(
+ resp,
+ azure.WithErrorUnlessStatusCode(http.StatusOK),
+ autorest.ByUnmarshallingJSON(&result),
+ autorest.ByClosing())
+ result.Response = autorest.Response{Response: resp}
+ return
+}
+
+// List list and describe all NetApp accounts in the resource group.
+// Parameters:
+// resourceGroupName - the name of the resource group.
+func (client AccountsClient) List(ctx context.Context, resourceGroupName string) (result AccountListPage, err error) {
+ if tracing.IsEnabled() {
+ ctx = tracing.StartSpan(ctx, fqdn+"/AccountsClient.List")
+ defer func() {
+ sc := -1
+ if result.al.Response.Response != nil {
+ sc = result.al.Response.Response.StatusCode
+ }
+ tracing.EndSpan(ctx, sc, err)
+ }()
+ }
+ if err := validation.Validate([]validation.Validation{
+ {TargetValue: resourceGroupName,
+ Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil},
+ {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil},
+ {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}}); err != nil {
+ return result, validation.NewError("netapp.AccountsClient", "List", err.Error())
+ }
+
+ result.fn = client.listNextResults
+ req, err := client.ListPreparer(ctx, resourceGroupName)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "netapp.AccountsClient", "List", nil, "Failure preparing request")
+ return
+ }
+
+ resp, err := client.ListSender(req)
+ if err != nil {
+ result.al.Response = autorest.Response{Response: resp}
+ err = autorest.NewErrorWithError(err, "netapp.AccountsClient", "List", resp, "Failure sending request")
+ return
+ }
+
+ result.al, err = client.ListResponder(resp)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "netapp.AccountsClient", "List", resp, "Failure responding to request")
+ return
+ }
+ if result.al.hasNextLink() && result.al.IsEmpty() {
+ err = result.NextWithContext(ctx)
+ return
+ }
+
+ return
+}
+
+// ListPreparer prepares the List request.
+func (client AccountsClient) ListPreparer(ctx context.Context, resourceGroupName string) (*http.Request, error) {
+ pathParameters := map[string]interface{}{
+ "resourceGroupName": autorest.Encode("path", resourceGroupName),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
+ }
+
+ const APIVersion = "2021-10-01"
+ queryParameters := map[string]interface{}{
+ "api-version": APIVersion,
+ }
+
+ preparer := autorest.CreatePreparer(
+ autorest.AsGet(),
+ autorest.WithBaseURL(client.BaseURI),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts", pathParameters),
+ autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare((&http.Request{}).WithContext(ctx))
+}
+
+// ListSender sends the List request. The method will close the
+// http.Response Body if it receives an error.
+func (client AccountsClient) ListSender(req *http.Request) (*http.Response, error) {
+ return client.Send(req, azure.DoRetryWithRegistration(client.Client))
+}
+
+// ListResponder handles the response to the List request. The method always
+// closes the http.Response Body.
+func (client AccountsClient) ListResponder(resp *http.Response) (result AccountList, err error) {
+ err = autorest.Respond(
+ resp,
+ azure.WithErrorUnlessStatusCode(http.StatusOK),
+ autorest.ByUnmarshallingJSON(&result),
+ autorest.ByClosing())
+ result.Response = autorest.Response{Response: resp}
+ return
+}
+
+// listNextResults retrieves the next set of results, if any.
+func (client AccountsClient) listNextResults(ctx context.Context, lastResults AccountList) (result AccountList, err error) {
+ req, err := lastResults.accountListPreparer(ctx)
+ if err != nil {
+ return result, autorest.NewErrorWithError(err, "netapp.AccountsClient", "listNextResults", nil, "Failure preparing next results request")
+ }
+ if req == nil {
+ return
+ }
+ resp, err := client.ListSender(req)
+ if err != nil {
+ result.Response = autorest.Response{Response: resp}
+ return result, autorest.NewErrorWithError(err, "netapp.AccountsClient", "listNextResults", resp, "Failure sending next results request")
+ }
+ result, err = client.ListResponder(resp)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "netapp.AccountsClient", "listNextResults", resp, "Failure responding to next results request")
+ }
+ return
+}
+
+// ListComplete enumerates all values, automatically crossing page boundaries as required.
+func (client AccountsClient) ListComplete(ctx context.Context, resourceGroupName string) (result AccountListIterator, err error) {
+ if tracing.IsEnabled() {
+ ctx = tracing.StartSpan(ctx, fqdn+"/AccountsClient.List")
+ defer func() {
+ sc := -1
+ if result.Response().Response.Response != nil {
+ sc = result.page.Response().Response.Response.StatusCode
+ }
+ tracing.EndSpan(ctx, sc, err)
+ }()
+ }
+ result.page, err = client.List(ctx, resourceGroupName)
+ return
+}
+
+// ListBySubscription list and describe all NetApp accounts in the subscription.
+func (client AccountsClient) ListBySubscription(ctx context.Context) (result AccountListPage, err error) {
+ if tracing.IsEnabled() {
+ ctx = tracing.StartSpan(ctx, fqdn+"/AccountsClient.ListBySubscription")
+ defer func() {
+ sc := -1
+ if result.al.Response.Response != nil {
+ sc = result.al.Response.Response.StatusCode
+ }
+ tracing.EndSpan(ctx, sc, err)
+ }()
+ }
+ result.fn = client.listBySubscriptionNextResults
+ req, err := client.ListBySubscriptionPreparer(ctx)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "netapp.AccountsClient", "ListBySubscription", nil, "Failure preparing request")
+ return
+ }
+
+ resp, err := client.ListBySubscriptionSender(req)
+ if err != nil {
+ result.al.Response = autorest.Response{Response: resp}
+ err = autorest.NewErrorWithError(err, "netapp.AccountsClient", "ListBySubscription", resp, "Failure sending request")
+ return
+ }
+
+ result.al, err = client.ListBySubscriptionResponder(resp)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "netapp.AccountsClient", "ListBySubscription", resp, "Failure responding to request")
+ return
+ }
+ if result.al.hasNextLink() && result.al.IsEmpty() {
+ err = result.NextWithContext(ctx)
+ return
+ }
+
+ return
+}
+
+// ListBySubscriptionPreparer prepares the ListBySubscription request.
+func (client AccountsClient) ListBySubscriptionPreparer(ctx context.Context) (*http.Request, error) {
+ pathParameters := map[string]interface{}{
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
+ }
+
+ const APIVersion = "2021-10-01"
+ queryParameters := map[string]interface{}{
+ "api-version": APIVersion,
+ }
+
+ preparer := autorest.CreatePreparer(
+ autorest.AsGet(),
+ autorest.WithBaseURL(client.BaseURI),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.NetApp/netAppAccounts", pathParameters),
+ autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare((&http.Request{}).WithContext(ctx))
+}
+
+// ListBySubscriptionSender sends the ListBySubscription request. The method will close the
+// http.Response Body if it receives an error.
+func (client AccountsClient) ListBySubscriptionSender(req *http.Request) (*http.Response, error) {
+ return client.Send(req, azure.DoRetryWithRegistration(client.Client))
+}
+
+// ListBySubscriptionResponder handles the response to the ListBySubscription request. The method always
+// closes the http.Response Body.
+func (client AccountsClient) ListBySubscriptionResponder(resp *http.Response) (result AccountList, err error) {
+ err = autorest.Respond(
+ resp,
+ azure.WithErrorUnlessStatusCode(http.StatusOK),
+ autorest.ByUnmarshallingJSON(&result),
+ autorest.ByClosing())
+ result.Response = autorest.Response{Response: resp}
+ return
+}
+
+// listBySubscriptionNextResults retrieves the next set of results, if any.
+func (client AccountsClient) listBySubscriptionNextResults(ctx context.Context, lastResults AccountList) (result AccountList, err error) {
+ req, err := lastResults.accountListPreparer(ctx)
+ if err != nil {
+ return result, autorest.NewErrorWithError(err, "netapp.AccountsClient", "listBySubscriptionNextResults", nil, "Failure preparing next results request")
+ }
+ if req == nil {
+ return
+ }
+ resp, err := client.ListBySubscriptionSender(req)
+ if err != nil {
+ result.Response = autorest.Response{Response: resp}
+ return result, autorest.NewErrorWithError(err, "netapp.AccountsClient", "listBySubscriptionNextResults", resp, "Failure sending next results request")
+ }
+ result, err = client.ListBySubscriptionResponder(resp)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "netapp.AccountsClient", "listBySubscriptionNextResults", resp, "Failure responding to next results request")
+ }
+ return
+}
+
+// ListBySubscriptionComplete enumerates all values, automatically crossing page boundaries as required.
+func (client AccountsClient) ListBySubscriptionComplete(ctx context.Context) (result AccountListIterator, err error) {
+ if tracing.IsEnabled() {
+ ctx = tracing.StartSpan(ctx, fqdn+"/AccountsClient.ListBySubscription")
+ defer func() {
+ sc := -1
+ if result.Response().Response.Response != nil {
+ sc = result.page.Response().Response.Response.StatusCode
+ }
+ tracing.EndSpan(ctx, sc, err)
+ }()
+ }
+ result.page, err = client.ListBySubscription(ctx)
+ return
+}
+
+// Update patch the specified NetApp account
+// Parameters:
+// body - netApp Account object supplied in the body of the operation.
+// resourceGroupName - the name of the resource group.
+// accountName - the name of the NetApp account
+func (client AccountsClient) Update(ctx context.Context, body AccountPatch, resourceGroupName string, accountName string) (result AccountsUpdateFuture, err error) {
+ if tracing.IsEnabled() {
+ ctx = tracing.StartSpan(ctx, fqdn+"/AccountsClient.Update")
+ defer func() {
+ sc := -1
+ if result.FutureAPI != nil && result.FutureAPI.Response() != nil {
+ sc = result.FutureAPI.Response().StatusCode
+ }
+ tracing.EndSpan(ctx, sc, err)
+ }()
+ }
+ if err := validation.Validate([]validation.Validation{
+ {TargetValue: resourceGroupName,
+ Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil},
+ {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil},
+ {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}}); err != nil {
+ return result, validation.NewError("netapp.AccountsClient", "Update", err.Error())
+ }
+
+ req, err := client.UpdatePreparer(ctx, body, resourceGroupName, accountName)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "netapp.AccountsClient", "Update", nil, "Failure preparing request")
+ return
+ }
+
+ result, err = client.UpdateSender(req)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "netapp.AccountsClient", "Update", result.Response(), "Failure sending request")
+ return
+ }
+
+ return
+}
+
+// UpdatePreparer prepares the Update request.
+func (client AccountsClient) UpdatePreparer(ctx context.Context, body AccountPatch, resourceGroupName string, accountName string) (*http.Request, error) {
+ pathParameters := map[string]interface{}{
+ "accountName": autorest.Encode("path", accountName),
+ "resourceGroupName": autorest.Encode("path", resourceGroupName),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
+ }
+
+ const APIVersion = "2021-10-01"
+ queryParameters := map[string]interface{}{
+ "api-version": APIVersion,
+ }
+
+ body.ID = nil
+ body.Name = nil
+ body.Type = nil
+ preparer := autorest.CreatePreparer(
+ autorest.AsContentType("application/json; charset=utf-8"),
+ autorest.AsPatch(),
+ autorest.WithBaseURL(client.BaseURI),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}", pathParameters),
+ autorest.WithJSON(body),
+ autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare((&http.Request{}).WithContext(ctx))
+}
+
+// UpdateSender sends the Update request. The method will close the
+// http.Response Body if it receives an error.
+func (client AccountsClient) UpdateSender(req *http.Request) (future AccountsUpdateFuture, err error) {
+ var resp *http.Response
+ future.FutureAPI = &azure.Future{}
+ resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client))
+ if err != nil {
+ return
+ }
+ var azf azure.Future
+ azf, err = azure.NewFutureFromResponse(resp)
+ future.FutureAPI = &azf
+ future.Result = future.result
+ return
+}
+
+// UpdateResponder handles the response to the Update request. The method always
+// closes the http.Response Body.
+func (client AccountsClient) UpdateResponder(resp *http.Response) (result Account, err error) {
+ err = autorest.Respond(
+ resp,
+ azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted),
+ autorest.ByUnmarshallingJSON(&result),
+ autorest.ByClosing())
+ result.Response = autorest.Response{Response: resp}
+ return
+}
diff --git a/services/netapp/mgmt/2021-10-01/netapp/backuppolicies.go b/services/netapp/mgmt/2021-10-01/netapp/backuppolicies.go
new file mode 100644
index 000000000000..2073c2dd3d49
--- /dev/null
+++ b/services/netapp/mgmt/2021-10-01/netapp/backuppolicies.go
@@ -0,0 +1,485 @@
+package netapp
+
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License. See License.txt in the project root for license information.
+//
+// Code generated by Microsoft (R) AutoRest Code Generator.
+// Changes may cause incorrect behavior and will be lost if the code is regenerated.
+
+import (
+ "context"
+ "github.com/Azure/go-autorest/autorest"
+ "github.com/Azure/go-autorest/autorest/azure"
+ "github.com/Azure/go-autorest/autorest/validation"
+ "github.com/Azure/go-autorest/tracing"
+ "net/http"
+)
+
+// BackupPoliciesClient is the microsoft NetApp Files Azure Resource Provider specification
+type BackupPoliciesClient struct {
+ BaseClient
+}
+
+// NewBackupPoliciesClient creates an instance of the BackupPoliciesClient client.
+func NewBackupPoliciesClient(subscriptionID string) BackupPoliciesClient {
+ return NewBackupPoliciesClientWithBaseURI(DefaultBaseURI, subscriptionID)
+}
+
+// NewBackupPoliciesClientWithBaseURI creates an instance of the BackupPoliciesClient client using a custom endpoint.
+// Use this when interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure stack).
+func NewBackupPoliciesClientWithBaseURI(baseURI string, subscriptionID string) BackupPoliciesClient {
+ return BackupPoliciesClient{NewWithBaseURI(baseURI, subscriptionID)}
+}
+
+// Create create a backup policy for Netapp Account
+// Parameters:
+// resourceGroupName - the name of the resource group.
+// accountName - the name of the NetApp account
+// backupPolicyName - backup policy Name which uniquely identify backup policy.
+// body - backup policy object supplied in the body of the operation.
+func (client BackupPoliciesClient) Create(ctx context.Context, resourceGroupName string, accountName string, backupPolicyName string, body BackupPolicy) (result BackupPoliciesCreateFuture, err error) {
+ if tracing.IsEnabled() {
+ ctx = tracing.StartSpan(ctx, fqdn+"/BackupPoliciesClient.Create")
+ defer func() {
+ sc := -1
+ if result.FutureAPI != nil && result.FutureAPI.Response() != nil {
+ sc = result.FutureAPI.Response().StatusCode
+ }
+ tracing.EndSpan(ctx, sc, err)
+ }()
+ }
+ if err := validation.Validate([]validation.Validation{
+ {TargetValue: resourceGroupName,
+ Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil},
+ {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil},
+ {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}},
+ {TargetValue: body,
+ Constraints: []validation.Constraint{{Target: "body.Location", Name: validation.Null, Rule: true, Chain: nil},
+ {Target: "body.BackupPolicyProperties", Name: validation.Null, Rule: true, Chain: nil}}}}); err != nil {
+ return result, validation.NewError("netapp.BackupPoliciesClient", "Create", err.Error())
+ }
+
+ req, err := client.CreatePreparer(ctx, resourceGroupName, accountName, backupPolicyName, body)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "netapp.BackupPoliciesClient", "Create", nil, "Failure preparing request")
+ return
+ }
+
+ result, err = client.CreateSender(req)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "netapp.BackupPoliciesClient", "Create", result.Response(), "Failure sending request")
+ return
+ }
+
+ return
+}
+
+// CreatePreparer prepares the Create request.
+func (client BackupPoliciesClient) CreatePreparer(ctx context.Context, resourceGroupName string, accountName string, backupPolicyName string, body BackupPolicy) (*http.Request, error) {
+ pathParameters := map[string]interface{}{
+ "accountName": autorest.Encode("path", accountName),
+ "backupPolicyName": autorest.Encode("path", backupPolicyName),
+ "resourceGroupName": autorest.Encode("path", resourceGroupName),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
+ }
+
+ const APIVersion = "2021-10-01"
+ queryParameters := map[string]interface{}{
+ "api-version": APIVersion,
+ }
+
+ body.ID = nil
+ body.Name = nil
+ body.Etag = nil
+ body.Type = nil
+ body.SystemData = nil
+ preparer := autorest.CreatePreparer(
+ autorest.AsContentType("application/json; charset=utf-8"),
+ autorest.AsPut(),
+ autorest.WithBaseURL(client.BaseURI),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/backupPolicies/{backupPolicyName}", pathParameters),
+ autorest.WithJSON(body),
+ autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare((&http.Request{}).WithContext(ctx))
+}
+
+// CreateSender sends the Create request. The method will close the
+// http.Response Body if it receives an error.
+func (client BackupPoliciesClient) CreateSender(req *http.Request) (future BackupPoliciesCreateFuture, err error) {
+ var resp *http.Response
+ future.FutureAPI = &azure.Future{}
+ resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client))
+ if err != nil {
+ return
+ }
+ var azf azure.Future
+ azf, err = azure.NewFutureFromResponse(resp)
+ future.FutureAPI = &azf
+ future.Result = future.result
+ return
+}
+
+// CreateResponder handles the response to the Create request. The method always
+// closes the http.Response Body.
+func (client BackupPoliciesClient) CreateResponder(resp *http.Response) (result BackupPolicy, err error) {
+ err = autorest.Respond(
+ resp,
+ azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated, http.StatusAccepted),
+ autorest.ByUnmarshallingJSON(&result),
+ autorest.ByClosing())
+ result.Response = autorest.Response{Response: resp}
+ return
+}
+
+// Delete delete backup policy
+// Parameters:
+// resourceGroupName - the name of the resource group.
+// accountName - the name of the NetApp account
+// backupPolicyName - backup policy Name which uniquely identify backup policy.
+func (client BackupPoliciesClient) Delete(ctx context.Context, resourceGroupName string, accountName string, backupPolicyName string) (result BackupPoliciesDeleteFuture, err error) {
+ if tracing.IsEnabled() {
+ ctx = tracing.StartSpan(ctx, fqdn+"/BackupPoliciesClient.Delete")
+ defer func() {
+ sc := -1
+ if result.FutureAPI != nil && result.FutureAPI.Response() != nil {
+ sc = result.FutureAPI.Response().StatusCode
+ }
+ tracing.EndSpan(ctx, sc, err)
+ }()
+ }
+ if err := validation.Validate([]validation.Validation{
+ {TargetValue: resourceGroupName,
+ Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil},
+ {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil},
+ {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}}); err != nil {
+ return result, validation.NewError("netapp.BackupPoliciesClient", "Delete", err.Error())
+ }
+
+ req, err := client.DeletePreparer(ctx, resourceGroupName, accountName, backupPolicyName)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "netapp.BackupPoliciesClient", "Delete", nil, "Failure preparing request")
+ return
+ }
+
+ result, err = client.DeleteSender(req)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "netapp.BackupPoliciesClient", "Delete", result.Response(), "Failure sending request")
+ return
+ }
+
+ return
+}
+
+// DeletePreparer prepares the Delete request.
+func (client BackupPoliciesClient) DeletePreparer(ctx context.Context, resourceGroupName string, accountName string, backupPolicyName string) (*http.Request, error) {
+ pathParameters := map[string]interface{}{
+ "accountName": autorest.Encode("path", accountName),
+ "backupPolicyName": autorest.Encode("path", backupPolicyName),
+ "resourceGroupName": autorest.Encode("path", resourceGroupName),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
+ }
+
+ const APIVersion = "2021-10-01"
+ queryParameters := map[string]interface{}{
+ "api-version": APIVersion,
+ }
+
+ preparer := autorest.CreatePreparer(
+ autorest.AsDelete(),
+ autorest.WithBaseURL(client.BaseURI),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/backupPolicies/{backupPolicyName}", pathParameters),
+ autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare((&http.Request{}).WithContext(ctx))
+}
+
+// DeleteSender sends the Delete request. The method will close the
+// http.Response Body if it receives an error.
+func (client BackupPoliciesClient) DeleteSender(req *http.Request) (future BackupPoliciesDeleteFuture, err error) {
+ var resp *http.Response
+ future.FutureAPI = &azure.Future{}
+ resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client))
+ if err != nil {
+ return
+ }
+ var azf azure.Future
+ azf, err = azure.NewFutureFromResponse(resp)
+ future.FutureAPI = &azf
+ future.Result = future.result
+ return
+}
+
+// DeleteResponder handles the response to the Delete request. The method always
+// closes the http.Response Body.
+func (client BackupPoliciesClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) {
+ err = autorest.Respond(
+ resp,
+ azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent),
+ autorest.ByClosing())
+ result.Response = resp
+ return
+}
+
+// Get get a particular backup Policy
+// Parameters:
+// resourceGroupName - the name of the resource group.
+// accountName - the name of the NetApp account
+// backupPolicyName - backup policy Name which uniquely identify backup policy.
+func (client BackupPoliciesClient) Get(ctx context.Context, resourceGroupName string, accountName string, backupPolicyName string) (result BackupPolicy, err error) {
+ if tracing.IsEnabled() {
+ ctx = tracing.StartSpan(ctx, fqdn+"/BackupPoliciesClient.Get")
+ defer func() {
+ sc := -1
+ if result.Response.Response != nil {
+ sc = result.Response.Response.StatusCode
+ }
+ tracing.EndSpan(ctx, sc, err)
+ }()
+ }
+ if err := validation.Validate([]validation.Validation{
+ {TargetValue: resourceGroupName,
+ Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil},
+ {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil},
+ {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}}); err != nil {
+ return result, validation.NewError("netapp.BackupPoliciesClient", "Get", err.Error())
+ }
+
+ req, err := client.GetPreparer(ctx, resourceGroupName, accountName, backupPolicyName)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "netapp.BackupPoliciesClient", "Get", nil, "Failure preparing request")
+ return
+ }
+
+ resp, err := client.GetSender(req)
+ if err != nil {
+ result.Response = autorest.Response{Response: resp}
+ err = autorest.NewErrorWithError(err, "netapp.BackupPoliciesClient", "Get", resp, "Failure sending request")
+ return
+ }
+
+ result, err = client.GetResponder(resp)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "netapp.BackupPoliciesClient", "Get", resp, "Failure responding to request")
+ return
+ }
+
+ return
+}
+
+// GetPreparer prepares the Get request.
+func (client BackupPoliciesClient) GetPreparer(ctx context.Context, resourceGroupName string, accountName string, backupPolicyName string) (*http.Request, error) {
+ pathParameters := map[string]interface{}{
+ "accountName": autorest.Encode("path", accountName),
+ "backupPolicyName": autorest.Encode("path", backupPolicyName),
+ "resourceGroupName": autorest.Encode("path", resourceGroupName),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
+ }
+
+ const APIVersion = "2021-10-01"
+ queryParameters := map[string]interface{}{
+ "api-version": APIVersion,
+ }
+
+ preparer := autorest.CreatePreparer(
+ autorest.AsGet(),
+ autorest.WithBaseURL(client.BaseURI),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/backupPolicies/{backupPolicyName}", pathParameters),
+ autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare((&http.Request{}).WithContext(ctx))
+}
+
+// GetSender sends the Get request. The method will close the
+// http.Response Body if it receives an error.
+func (client BackupPoliciesClient) GetSender(req *http.Request) (*http.Response, error) {
+ return client.Send(req, azure.DoRetryWithRegistration(client.Client))
+}
+
+// GetResponder handles the response to the Get request. The method always
+// closes the http.Response Body.
+func (client BackupPoliciesClient) GetResponder(resp *http.Response) (result BackupPolicy, err error) {
+ err = autorest.Respond(
+ resp,
+ azure.WithErrorUnlessStatusCode(http.StatusOK),
+ autorest.ByUnmarshallingJSON(&result),
+ autorest.ByClosing())
+ result.Response = autorest.Response{Response: resp}
+ return
+}
+
+// List list backup policies for Netapp Account
+// Parameters:
+// resourceGroupName - the name of the resource group.
+// accountName - the name of the NetApp account
+func (client BackupPoliciesClient) List(ctx context.Context, resourceGroupName string, accountName string) (result BackupPoliciesList, err error) {
+ if tracing.IsEnabled() {
+ ctx = tracing.StartSpan(ctx, fqdn+"/BackupPoliciesClient.List")
+ defer func() {
+ sc := -1
+ if result.Response.Response != nil {
+ sc = result.Response.Response.StatusCode
+ }
+ tracing.EndSpan(ctx, sc, err)
+ }()
+ }
+ if err := validation.Validate([]validation.Validation{
+ {TargetValue: resourceGroupName,
+ Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil},
+ {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil},
+ {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}}); err != nil {
+ return result, validation.NewError("netapp.BackupPoliciesClient", "List", err.Error())
+ }
+
+ req, err := client.ListPreparer(ctx, resourceGroupName, accountName)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "netapp.BackupPoliciesClient", "List", nil, "Failure preparing request")
+ return
+ }
+
+ resp, err := client.ListSender(req)
+ if err != nil {
+ result.Response = autorest.Response{Response: resp}
+ err = autorest.NewErrorWithError(err, "netapp.BackupPoliciesClient", "List", resp, "Failure sending request")
+ return
+ }
+
+ result, err = client.ListResponder(resp)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "netapp.BackupPoliciesClient", "List", resp, "Failure responding to request")
+ return
+ }
+
+ return
+}
+
+// ListPreparer prepares the List request.
+func (client BackupPoliciesClient) ListPreparer(ctx context.Context, resourceGroupName string, accountName string) (*http.Request, error) {
+ pathParameters := map[string]interface{}{
+ "accountName": autorest.Encode("path", accountName),
+ "resourceGroupName": autorest.Encode("path", resourceGroupName),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
+ }
+
+ const APIVersion = "2021-10-01"
+ queryParameters := map[string]interface{}{
+ "api-version": APIVersion,
+ }
+
+ preparer := autorest.CreatePreparer(
+ autorest.AsGet(),
+ autorest.WithBaseURL(client.BaseURI),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/backupPolicies", pathParameters),
+ autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare((&http.Request{}).WithContext(ctx))
+}
+
+// ListSender sends the List request. The method will close the
+// http.Response Body if it receives an error.
+func (client BackupPoliciesClient) ListSender(req *http.Request) (*http.Response, error) {
+ return client.Send(req, azure.DoRetryWithRegistration(client.Client))
+}
+
+// ListResponder handles the response to the List request. The method always
+// closes the http.Response Body.
+func (client BackupPoliciesClient) ListResponder(resp *http.Response) (result BackupPoliciesList, err error) {
+ err = autorest.Respond(
+ resp,
+ azure.WithErrorUnlessStatusCode(http.StatusOK),
+ autorest.ByUnmarshallingJSON(&result),
+ autorest.ByClosing())
+ result.Response = autorest.Response{Response: resp}
+ return
+}
+
+// Update patch a backup policy for Netapp Account
+// Parameters:
+// resourceGroupName - the name of the resource group.
+// accountName - the name of the NetApp account
+// backupPolicyName - backup policy Name which uniquely identify backup policy.
+// body - backup policy object supplied in the body of the operation.
+func (client BackupPoliciesClient) Update(ctx context.Context, resourceGroupName string, accountName string, backupPolicyName string, body BackupPolicyPatch) (result BackupPoliciesUpdateFuture, err error) {
+ if tracing.IsEnabled() {
+ ctx = tracing.StartSpan(ctx, fqdn+"/BackupPoliciesClient.Update")
+ defer func() {
+ sc := -1
+ if result.FutureAPI != nil && result.FutureAPI.Response() != nil {
+ sc = result.FutureAPI.Response().StatusCode
+ }
+ tracing.EndSpan(ctx, sc, err)
+ }()
+ }
+ if err := validation.Validate([]validation.Validation{
+ {TargetValue: resourceGroupName,
+ Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil},
+ {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil},
+ {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}}); err != nil {
+ return result, validation.NewError("netapp.BackupPoliciesClient", "Update", err.Error())
+ }
+
+ req, err := client.UpdatePreparer(ctx, resourceGroupName, accountName, backupPolicyName, body)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "netapp.BackupPoliciesClient", "Update", nil, "Failure preparing request")
+ return
+ }
+
+ result, err = client.UpdateSender(req)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "netapp.BackupPoliciesClient", "Update", result.Response(), "Failure sending request")
+ return
+ }
+
+ return
+}
+
+// UpdatePreparer prepares the Update request.
+func (client BackupPoliciesClient) UpdatePreparer(ctx context.Context, resourceGroupName string, accountName string, backupPolicyName string, body BackupPolicyPatch) (*http.Request, error) {
+ pathParameters := map[string]interface{}{
+ "accountName": autorest.Encode("path", accountName),
+ "backupPolicyName": autorest.Encode("path", backupPolicyName),
+ "resourceGroupName": autorest.Encode("path", resourceGroupName),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
+ }
+
+ const APIVersion = "2021-10-01"
+ queryParameters := map[string]interface{}{
+ "api-version": APIVersion,
+ }
+
+ body.ID = nil
+ body.Name = nil
+ body.Type = nil
+ preparer := autorest.CreatePreparer(
+ autorest.AsContentType("application/json; charset=utf-8"),
+ autorest.AsPatch(),
+ autorest.WithBaseURL(client.BaseURI),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/backupPolicies/{backupPolicyName}", pathParameters),
+ autorest.WithJSON(body),
+ autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare((&http.Request{}).WithContext(ctx))
+}
+
+// UpdateSender sends the Update request. The method will close the
+// http.Response Body if it receives an error.
+func (client BackupPoliciesClient) UpdateSender(req *http.Request) (future BackupPoliciesUpdateFuture, err error) {
+ var resp *http.Response
+ future.FutureAPI = &azure.Future{}
+ resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client))
+ if err != nil {
+ return
+ }
+ var azf azure.Future
+ azf, err = azure.NewFutureFromResponse(resp)
+ future.FutureAPI = &azf
+ future.Result = future.result
+ return
+}
+
+// UpdateResponder handles the response to the Update request. The method always
+// closes the http.Response Body.
+func (client BackupPoliciesClient) UpdateResponder(resp *http.Response) (result BackupPolicy, err error) {
+ err = autorest.Respond(
+ resp,
+ azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted),
+ autorest.ByUnmarshallingJSON(&result),
+ autorest.ByClosing())
+ result.Response = autorest.Response{Response: resp}
+ return
+}
diff --git a/services/netapp/mgmt/2021-10-01/netapp/backups.go b/services/netapp/mgmt/2021-10-01/netapp/backups.go
new file mode 100644
index 000000000000..e430721365de
--- /dev/null
+++ b/services/netapp/mgmt/2021-10-01/netapp/backups.go
@@ -0,0 +1,741 @@
+package netapp
+
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License. See License.txt in the project root for license information.
+//
+// Code generated by Microsoft (R) AutoRest Code Generator.
+// Changes may cause incorrect behavior and will be lost if the code is regenerated.
+
+import (
+ "context"
+ "github.com/Azure/go-autorest/autorest"
+ "github.com/Azure/go-autorest/autorest/azure"
+ "github.com/Azure/go-autorest/autorest/validation"
+ "github.com/Azure/go-autorest/tracing"
+ "net/http"
+)
+
+// BackupsClient is the microsoft NetApp Files Azure Resource Provider specification
+type BackupsClient struct {
+ BaseClient
+}
+
+// NewBackupsClient creates an instance of the BackupsClient client.
+func NewBackupsClient(subscriptionID string) BackupsClient {
+ return NewBackupsClientWithBaseURI(DefaultBaseURI, subscriptionID)
+}
+
+// NewBackupsClientWithBaseURI creates an instance of the BackupsClient client using a custom endpoint. Use this when
+// interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure stack).
+func NewBackupsClientWithBaseURI(baseURI string, subscriptionID string) BackupsClient {
+ return BackupsClient{NewWithBaseURI(baseURI, subscriptionID)}
+}
+
+// Create create a backup for the volume
+// Parameters:
+// resourceGroupName - the name of the resource group.
+// accountName - the name of the NetApp account
+// poolName - the name of the capacity pool
+// volumeName - the name of the volume
+// backupName - the name of the backup
+// body - backup object supplied in the body of the operation.
+func (client BackupsClient) Create(ctx context.Context, resourceGroupName string, accountName string, poolName string, volumeName string, backupName string, body Backup) (result BackupsCreateFuture, err error) {
+ if tracing.IsEnabled() {
+ ctx = tracing.StartSpan(ctx, fqdn+"/BackupsClient.Create")
+ defer func() {
+ sc := -1
+ if result.FutureAPI != nil && result.FutureAPI.Response() != nil {
+ sc = result.FutureAPI.Response().StatusCode
+ }
+ tracing.EndSpan(ctx, sc, err)
+ }()
+ }
+ if err := validation.Validate([]validation.Validation{
+ {TargetValue: resourceGroupName,
+ Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil},
+ {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil},
+ {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}},
+ {TargetValue: poolName,
+ Constraints: []validation.Constraint{{Target: "poolName", Name: validation.MaxLength, Rule: 64, Chain: nil},
+ {Target: "poolName", Name: validation.MinLength, Rule: 1, Chain: nil},
+ {Target: "poolName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9][a-zA-Z0-9\-_]{0,63}$`, Chain: nil}}},
+ {TargetValue: volumeName,
+ Constraints: []validation.Constraint{{Target: "volumeName", Name: validation.MaxLength, Rule: 64, Chain: nil},
+ {Target: "volumeName", Name: validation.MinLength, Rule: 1, Chain: nil},
+ {Target: "volumeName", Name: validation.Pattern, Rule: `^[a-zA-Z][a-zA-Z0-9\-_]{0,63}$`, Chain: nil}}},
+ {TargetValue: body,
+ Constraints: []validation.Constraint{{Target: "body.Location", Name: validation.Null, Rule: true, Chain: nil},
+ {Target: "body.BackupProperties", Name: validation.Null, Rule: true,
+ Chain: []validation.Constraint{{Target: "body.BackupProperties.BackupID", Name: validation.Null, Rule: false,
+ Chain: []validation.Constraint{{Target: "body.BackupProperties.BackupID", Name: validation.MaxLength, Rule: 36, Chain: nil},
+ {Target: "body.BackupProperties.BackupID", Name: validation.MinLength, Rule: 36, Chain: nil},
+ {Target: "body.BackupProperties.BackupID", Name: validation.Pattern, Rule: `^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$`, Chain: nil},
+ }},
+ }}}}}); err != nil {
+ return result, validation.NewError("netapp.BackupsClient", "Create", err.Error())
+ }
+
+ req, err := client.CreatePreparer(ctx, resourceGroupName, accountName, poolName, volumeName, backupName, body)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "netapp.BackupsClient", "Create", nil, "Failure preparing request")
+ return
+ }
+
+ result, err = client.CreateSender(req)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "netapp.BackupsClient", "Create", result.Response(), "Failure sending request")
+ return
+ }
+
+ return
+}
+
+// CreatePreparer prepares the Create request.
+func (client BackupsClient) CreatePreparer(ctx context.Context, resourceGroupName string, accountName string, poolName string, volumeName string, backupName string, body Backup) (*http.Request, error) {
+ pathParameters := map[string]interface{}{
+ "accountName": autorest.Encode("path", accountName),
+ "backupName": autorest.Encode("path", backupName),
+ "poolName": autorest.Encode("path", poolName),
+ "resourceGroupName": autorest.Encode("path", resourceGroupName),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
+ "volumeName": autorest.Encode("path", volumeName),
+ }
+
+ const APIVersion = "2021-10-01"
+ queryParameters := map[string]interface{}{
+ "api-version": APIVersion,
+ }
+
+ body.ID = nil
+ body.Name = nil
+ body.Type = nil
+ preparer := autorest.CreatePreparer(
+ autorest.AsContentType("application/json; charset=utf-8"),
+ autorest.AsPut(),
+ autorest.WithBaseURL(client.BaseURI),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/capacityPools/{poolName}/volumes/{volumeName}/backups/{backupName}", pathParameters),
+ autorest.WithJSON(body),
+ autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare((&http.Request{}).WithContext(ctx))
+}
+
+// CreateSender sends the Create request. The method will close the
+// http.Response Body if it receives an error.
+func (client BackupsClient) CreateSender(req *http.Request) (future BackupsCreateFuture, err error) {
+ var resp *http.Response
+ future.FutureAPI = &azure.Future{}
+ resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client))
+ if err != nil {
+ return
+ }
+ var azf azure.Future
+ azf, err = azure.NewFutureFromResponse(resp)
+ future.FutureAPI = &azf
+ future.Result = future.result
+ return
+}
+
+// CreateResponder handles the response to the Create request. The method always
+// closes the http.Response Body.
+func (client BackupsClient) CreateResponder(resp *http.Response) (result Backup, err error) {
+ err = autorest.Respond(
+ resp,
+ azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated, http.StatusAccepted),
+ autorest.ByUnmarshallingJSON(&result),
+ autorest.ByClosing())
+ result.Response = autorest.Response{Response: resp}
+ return
+}
+
+// Delete delete a backup of the volume
+// Parameters:
+// resourceGroupName - the name of the resource group.
+// accountName - the name of the NetApp account
+// poolName - the name of the capacity pool
+// volumeName - the name of the volume
+// backupName - the name of the backup
+func (client BackupsClient) Delete(ctx context.Context, resourceGroupName string, accountName string, poolName string, volumeName string, backupName string) (result BackupsDeleteFuture, err error) {
+ if tracing.IsEnabled() {
+ ctx = tracing.StartSpan(ctx, fqdn+"/BackupsClient.Delete")
+ defer func() {
+ sc := -1
+ if result.FutureAPI != nil && result.FutureAPI.Response() != nil {
+ sc = result.FutureAPI.Response().StatusCode
+ }
+ tracing.EndSpan(ctx, sc, err)
+ }()
+ }
+ if err := validation.Validate([]validation.Validation{
+ {TargetValue: resourceGroupName,
+ Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil},
+ {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil},
+ {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}},
+ {TargetValue: poolName,
+ Constraints: []validation.Constraint{{Target: "poolName", Name: validation.MaxLength, Rule: 64, Chain: nil},
+ {Target: "poolName", Name: validation.MinLength, Rule: 1, Chain: nil},
+ {Target: "poolName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9][a-zA-Z0-9\-_]{0,63}$`, Chain: nil}}},
+ {TargetValue: volumeName,
+ Constraints: []validation.Constraint{{Target: "volumeName", Name: validation.MaxLength, Rule: 64, Chain: nil},
+ {Target: "volumeName", Name: validation.MinLength, Rule: 1, Chain: nil},
+ {Target: "volumeName", Name: validation.Pattern, Rule: `^[a-zA-Z][a-zA-Z0-9\-_]{0,63}$`, Chain: nil}}}}); err != nil {
+ return result, validation.NewError("netapp.BackupsClient", "Delete", err.Error())
+ }
+
+ req, err := client.DeletePreparer(ctx, resourceGroupName, accountName, poolName, volumeName, backupName)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "netapp.BackupsClient", "Delete", nil, "Failure preparing request")
+ return
+ }
+
+ result, err = client.DeleteSender(req)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "netapp.BackupsClient", "Delete", result.Response(), "Failure sending request")
+ return
+ }
+
+ return
+}
+
+// DeletePreparer prepares the Delete request.
+func (client BackupsClient) DeletePreparer(ctx context.Context, resourceGroupName string, accountName string, poolName string, volumeName string, backupName string) (*http.Request, error) {
+ pathParameters := map[string]interface{}{
+ "accountName": autorest.Encode("path", accountName),
+ "backupName": autorest.Encode("path", backupName),
+ "poolName": autorest.Encode("path", poolName),
+ "resourceGroupName": autorest.Encode("path", resourceGroupName),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
+ "volumeName": autorest.Encode("path", volumeName),
+ }
+
+ const APIVersion = "2021-10-01"
+ queryParameters := map[string]interface{}{
+ "api-version": APIVersion,
+ }
+
+ preparer := autorest.CreatePreparer(
+ autorest.AsDelete(),
+ autorest.WithBaseURL(client.BaseURI),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/capacityPools/{poolName}/volumes/{volumeName}/backups/{backupName}", pathParameters),
+ autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare((&http.Request{}).WithContext(ctx))
+}
+
+// DeleteSender sends the Delete request. The method will close the
+// http.Response Body if it receives an error.
+func (client BackupsClient) DeleteSender(req *http.Request) (future BackupsDeleteFuture, err error) {
+ var resp *http.Response
+ future.FutureAPI = &azure.Future{}
+ resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client))
+ if err != nil {
+ return
+ }
+ var azf azure.Future
+ azf, err = azure.NewFutureFromResponse(resp)
+ future.FutureAPI = &azf
+ future.Result = future.result
+ return
+}
+
+// DeleteResponder handles the response to the Delete request. The method always
+// closes the http.Response Body.
+func (client BackupsClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) {
+ err = autorest.Respond(
+ resp,
+ azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent),
+ autorest.ByClosing())
+ result.Response = resp
+ return
+}
+
+// Get gets the specified backup of the volume
+// Parameters:
+// resourceGroupName - the name of the resource group.
+// accountName - the name of the NetApp account
+// poolName - the name of the capacity pool
+// volumeName - the name of the volume
+// backupName - the name of the backup
+func (client BackupsClient) Get(ctx context.Context, resourceGroupName string, accountName string, poolName string, volumeName string, backupName string) (result Backup, err error) {
+ if tracing.IsEnabled() {
+ ctx = tracing.StartSpan(ctx, fqdn+"/BackupsClient.Get")
+ defer func() {
+ sc := -1
+ if result.Response.Response != nil {
+ sc = result.Response.Response.StatusCode
+ }
+ tracing.EndSpan(ctx, sc, err)
+ }()
+ }
+ if err := validation.Validate([]validation.Validation{
+ {TargetValue: resourceGroupName,
+ Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil},
+ {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil},
+ {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}},
+ {TargetValue: poolName,
+ Constraints: []validation.Constraint{{Target: "poolName", Name: validation.MaxLength, Rule: 64, Chain: nil},
+ {Target: "poolName", Name: validation.MinLength, Rule: 1, Chain: nil},
+ {Target: "poolName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9][a-zA-Z0-9\-_]{0,63}$`, Chain: nil}}},
+ {TargetValue: volumeName,
+ Constraints: []validation.Constraint{{Target: "volumeName", Name: validation.MaxLength, Rule: 64, Chain: nil},
+ {Target: "volumeName", Name: validation.MinLength, Rule: 1, Chain: nil},
+ {Target: "volumeName", Name: validation.Pattern, Rule: `^[a-zA-Z][a-zA-Z0-9\-_]{0,63}$`, Chain: nil}}}}); err != nil {
+ return result, validation.NewError("netapp.BackupsClient", "Get", err.Error())
+ }
+
+ req, err := client.GetPreparer(ctx, resourceGroupName, accountName, poolName, volumeName, backupName)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "netapp.BackupsClient", "Get", nil, "Failure preparing request")
+ return
+ }
+
+ resp, err := client.GetSender(req)
+ if err != nil {
+ result.Response = autorest.Response{Response: resp}
+ err = autorest.NewErrorWithError(err, "netapp.BackupsClient", "Get", resp, "Failure sending request")
+ return
+ }
+
+ result, err = client.GetResponder(resp)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "netapp.BackupsClient", "Get", resp, "Failure responding to request")
+ return
+ }
+
+ return
+}
+
+// GetPreparer prepares the Get request.
+func (client BackupsClient) GetPreparer(ctx context.Context, resourceGroupName string, accountName string, poolName string, volumeName string, backupName string) (*http.Request, error) {
+ pathParameters := map[string]interface{}{
+ "accountName": autorest.Encode("path", accountName),
+ "backupName": autorest.Encode("path", backupName),
+ "poolName": autorest.Encode("path", poolName),
+ "resourceGroupName": autorest.Encode("path", resourceGroupName),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
+ "volumeName": autorest.Encode("path", volumeName),
+ }
+
+ const APIVersion = "2021-10-01"
+ queryParameters := map[string]interface{}{
+ "api-version": APIVersion,
+ }
+
+ preparer := autorest.CreatePreparer(
+ autorest.AsGet(),
+ autorest.WithBaseURL(client.BaseURI),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/capacityPools/{poolName}/volumes/{volumeName}/backups/{backupName}", pathParameters),
+ autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare((&http.Request{}).WithContext(ctx))
+}
+
+// GetSender sends the Get request. The method will close the
+// http.Response Body if it receives an error.
+func (client BackupsClient) GetSender(req *http.Request) (*http.Response, error) {
+ return client.Send(req, azure.DoRetryWithRegistration(client.Client))
+}
+
+// GetResponder handles the response to the Get request. The method always
+// closes the http.Response Body.
+func (client BackupsClient) GetResponder(resp *http.Response) (result Backup, err error) {
+ err = autorest.Respond(
+ resp,
+ azure.WithErrorUnlessStatusCode(http.StatusOK),
+ autorest.ByUnmarshallingJSON(&result),
+ autorest.ByClosing())
+ result.Response = autorest.Response{Response: resp}
+ return
+}
+
+// GetStatus get the status of the backup for a volume
+// Parameters:
+// resourceGroupName - the name of the resource group.
+// accountName - the name of the NetApp account
+// poolName - the name of the capacity pool
+// volumeName - the name of the volume
+func (client BackupsClient) GetStatus(ctx context.Context, resourceGroupName string, accountName string, poolName string, volumeName string) (result BackupStatus, err error) {
+ if tracing.IsEnabled() {
+ ctx = tracing.StartSpan(ctx, fqdn+"/BackupsClient.GetStatus")
+ defer func() {
+ sc := -1
+ if result.Response.Response != nil {
+ sc = result.Response.Response.StatusCode
+ }
+ tracing.EndSpan(ctx, sc, err)
+ }()
+ }
+ if err := validation.Validate([]validation.Validation{
+ {TargetValue: resourceGroupName,
+ Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil},
+ {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil},
+ {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}},
+ {TargetValue: poolName,
+ Constraints: []validation.Constraint{{Target: "poolName", Name: validation.MaxLength, Rule: 64, Chain: nil},
+ {Target: "poolName", Name: validation.MinLength, Rule: 1, Chain: nil},
+ {Target: "poolName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9][a-zA-Z0-9\-_]{0,63}$`, Chain: nil}}},
+ {TargetValue: volumeName,
+ Constraints: []validation.Constraint{{Target: "volumeName", Name: validation.MaxLength, Rule: 64, Chain: nil},
+ {Target: "volumeName", Name: validation.MinLength, Rule: 1, Chain: nil},
+ {Target: "volumeName", Name: validation.Pattern, Rule: `^[a-zA-Z][a-zA-Z0-9\-_]{0,63}$`, Chain: nil}}}}); err != nil {
+ return result, validation.NewError("netapp.BackupsClient", "GetStatus", err.Error())
+ }
+
+ req, err := client.GetStatusPreparer(ctx, resourceGroupName, accountName, poolName, volumeName)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "netapp.BackupsClient", "GetStatus", nil, "Failure preparing request")
+ return
+ }
+
+ resp, err := client.GetStatusSender(req)
+ if err != nil {
+ result.Response = autorest.Response{Response: resp}
+ err = autorest.NewErrorWithError(err, "netapp.BackupsClient", "GetStatus", resp, "Failure sending request")
+ return
+ }
+
+ result, err = client.GetStatusResponder(resp)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "netapp.BackupsClient", "GetStatus", resp, "Failure responding to request")
+ return
+ }
+
+ return
+}
+
+// GetStatusPreparer prepares the GetStatus request.
+func (client BackupsClient) GetStatusPreparer(ctx context.Context, resourceGroupName string, accountName string, poolName string, volumeName string) (*http.Request, error) {
+ pathParameters := map[string]interface{}{
+ "accountName": autorest.Encode("path", accountName),
+ "poolName": autorest.Encode("path", poolName),
+ "resourceGroupName": autorest.Encode("path", resourceGroupName),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
+ "volumeName": autorest.Encode("path", volumeName),
+ }
+
+ const APIVersion = "2021-10-01"
+ queryParameters := map[string]interface{}{
+ "api-version": APIVersion,
+ }
+
+ preparer := autorest.CreatePreparer(
+ autorest.AsGet(),
+ autorest.WithBaseURL(client.BaseURI),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/capacityPools/{poolName}/volumes/{volumeName}/backupStatus", pathParameters),
+ autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare((&http.Request{}).WithContext(ctx))
+}
+
+// GetStatusSender sends the GetStatus request. The method will close the
+// http.Response Body if it receives an error.
+func (client BackupsClient) GetStatusSender(req *http.Request) (*http.Response, error) {
+ return client.Send(req, azure.DoRetryWithRegistration(client.Client))
+}
+
+// GetStatusResponder handles the response to the GetStatus request. The method always
+// closes the http.Response Body.
+func (client BackupsClient) GetStatusResponder(resp *http.Response) (result BackupStatus, err error) {
+ err = autorest.Respond(
+ resp,
+ azure.WithErrorUnlessStatusCode(http.StatusOK),
+ autorest.ByUnmarshallingJSON(&result),
+ autorest.ByClosing())
+ result.Response = autorest.Response{Response: resp}
+ return
+}
+
+// GetVolumeRestoreStatus get the status of the restore for a volume
+// Parameters:
+// resourceGroupName - the name of the resource group.
+// accountName - the name of the NetApp account
+// poolName - the name of the capacity pool
+// volumeName - the name of the volume
+func (client BackupsClient) GetVolumeRestoreStatus(ctx context.Context, resourceGroupName string, accountName string, poolName string, volumeName string) (result RestoreStatus, err error) {
+ if tracing.IsEnabled() {
+ ctx = tracing.StartSpan(ctx, fqdn+"/BackupsClient.GetVolumeRestoreStatus")
+ defer func() {
+ sc := -1
+ if result.Response.Response != nil {
+ sc = result.Response.Response.StatusCode
+ }
+ tracing.EndSpan(ctx, sc, err)
+ }()
+ }
+ if err := validation.Validate([]validation.Validation{
+ {TargetValue: resourceGroupName,
+ Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil},
+ {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil},
+ {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}},
+ {TargetValue: poolName,
+ Constraints: []validation.Constraint{{Target: "poolName", Name: validation.MaxLength, Rule: 64, Chain: nil},
+ {Target: "poolName", Name: validation.MinLength, Rule: 1, Chain: nil},
+ {Target: "poolName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9][a-zA-Z0-9\-_]{0,63}$`, Chain: nil}}},
+ {TargetValue: volumeName,
+ Constraints: []validation.Constraint{{Target: "volumeName", Name: validation.MaxLength, Rule: 64, Chain: nil},
+ {Target: "volumeName", Name: validation.MinLength, Rule: 1, Chain: nil},
+ {Target: "volumeName", Name: validation.Pattern, Rule: `^[a-zA-Z][a-zA-Z0-9\-_]{0,63}$`, Chain: nil}}}}); err != nil {
+ return result, validation.NewError("netapp.BackupsClient", "GetVolumeRestoreStatus", err.Error())
+ }
+
+ req, err := client.GetVolumeRestoreStatusPreparer(ctx, resourceGroupName, accountName, poolName, volumeName)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "netapp.BackupsClient", "GetVolumeRestoreStatus", nil, "Failure preparing request")
+ return
+ }
+
+ resp, err := client.GetVolumeRestoreStatusSender(req)
+ if err != nil {
+ result.Response = autorest.Response{Response: resp}
+ err = autorest.NewErrorWithError(err, "netapp.BackupsClient", "GetVolumeRestoreStatus", resp, "Failure sending request")
+ return
+ }
+
+ result, err = client.GetVolumeRestoreStatusResponder(resp)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "netapp.BackupsClient", "GetVolumeRestoreStatus", resp, "Failure responding to request")
+ return
+ }
+
+ return
+}
+
+// GetVolumeRestoreStatusPreparer prepares the GetVolumeRestoreStatus request.
+func (client BackupsClient) GetVolumeRestoreStatusPreparer(ctx context.Context, resourceGroupName string, accountName string, poolName string, volumeName string) (*http.Request, error) {
+ pathParameters := map[string]interface{}{
+ "accountName": autorest.Encode("path", accountName),
+ "poolName": autorest.Encode("path", poolName),
+ "resourceGroupName": autorest.Encode("path", resourceGroupName),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
+ "volumeName": autorest.Encode("path", volumeName),
+ }
+
+ const APIVersion = "2021-10-01"
+ queryParameters := map[string]interface{}{
+ "api-version": APIVersion,
+ }
+
+ preparer := autorest.CreatePreparer(
+ autorest.AsGet(),
+ autorest.WithBaseURL(client.BaseURI),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/capacityPools/{poolName}/volumes/{volumeName}/restoreStatus", pathParameters),
+ autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare((&http.Request{}).WithContext(ctx))
+}
+
+// GetVolumeRestoreStatusSender sends the GetVolumeRestoreStatus request. The method will close the
+// http.Response Body if it receives an error.
+func (client BackupsClient) GetVolumeRestoreStatusSender(req *http.Request) (*http.Response, error) {
+ return client.Send(req, azure.DoRetryWithRegistration(client.Client))
+}
+
+// GetVolumeRestoreStatusResponder handles the response to the GetVolumeRestoreStatus request. The method always
+// closes the http.Response Body.
+func (client BackupsClient) GetVolumeRestoreStatusResponder(resp *http.Response) (result RestoreStatus, err error) {
+ err = autorest.Respond(
+ resp,
+ azure.WithErrorUnlessStatusCode(http.StatusOK),
+ autorest.ByUnmarshallingJSON(&result),
+ autorest.ByClosing())
+ result.Response = autorest.Response{Response: resp}
+ return
+}
+
+// List list all backups for a volume
+// Parameters:
+// resourceGroupName - the name of the resource group.
+// accountName - the name of the NetApp account
+// poolName - the name of the capacity pool
+// volumeName - the name of the volume
+func (client BackupsClient) List(ctx context.Context, resourceGroupName string, accountName string, poolName string, volumeName string) (result BackupsList, err error) {
+ if tracing.IsEnabled() {
+ ctx = tracing.StartSpan(ctx, fqdn+"/BackupsClient.List")
+ defer func() {
+ sc := -1
+ if result.Response.Response != nil {
+ sc = result.Response.Response.StatusCode
+ }
+ tracing.EndSpan(ctx, sc, err)
+ }()
+ }
+ if err := validation.Validate([]validation.Validation{
+ {TargetValue: resourceGroupName,
+ Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil},
+ {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil},
+ {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}},
+ {TargetValue: poolName,
+ Constraints: []validation.Constraint{{Target: "poolName", Name: validation.MaxLength, Rule: 64, Chain: nil},
+ {Target: "poolName", Name: validation.MinLength, Rule: 1, Chain: nil},
+ {Target: "poolName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9][a-zA-Z0-9\-_]{0,63}$`, Chain: nil}}},
+ {TargetValue: volumeName,
+ Constraints: []validation.Constraint{{Target: "volumeName", Name: validation.MaxLength, Rule: 64, Chain: nil},
+ {Target: "volumeName", Name: validation.MinLength, Rule: 1, Chain: nil},
+ {Target: "volumeName", Name: validation.Pattern, Rule: `^[a-zA-Z][a-zA-Z0-9\-_]{0,63}$`, Chain: nil}}}}); err != nil {
+ return result, validation.NewError("netapp.BackupsClient", "List", err.Error())
+ }
+
+ req, err := client.ListPreparer(ctx, resourceGroupName, accountName, poolName, volumeName)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "netapp.BackupsClient", "List", nil, "Failure preparing request")
+ return
+ }
+
+ resp, err := client.ListSender(req)
+ if err != nil {
+ result.Response = autorest.Response{Response: resp}
+ err = autorest.NewErrorWithError(err, "netapp.BackupsClient", "List", resp, "Failure sending request")
+ return
+ }
+
+ result, err = client.ListResponder(resp)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "netapp.BackupsClient", "List", resp, "Failure responding to request")
+ return
+ }
+
+ return
+}
+
+// ListPreparer prepares the List request.
+func (client BackupsClient) ListPreparer(ctx context.Context, resourceGroupName string, accountName string, poolName string, volumeName string) (*http.Request, error) {
+ pathParameters := map[string]interface{}{
+ "accountName": autorest.Encode("path", accountName),
+ "poolName": autorest.Encode("path", poolName),
+ "resourceGroupName": autorest.Encode("path", resourceGroupName),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
+ "volumeName": autorest.Encode("path", volumeName),
+ }
+
+ const APIVersion = "2021-10-01"
+ queryParameters := map[string]interface{}{
+ "api-version": APIVersion,
+ }
+
+ preparer := autorest.CreatePreparer(
+ autorest.AsGet(),
+ autorest.WithBaseURL(client.BaseURI),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/capacityPools/{poolName}/volumes/{volumeName}/backups", pathParameters),
+ autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare((&http.Request{}).WithContext(ctx))
+}
+
+// ListSender sends the List request. The method will close the
+// http.Response Body if it receives an error.
+func (client BackupsClient) ListSender(req *http.Request) (*http.Response, error) {
+ return client.Send(req, azure.DoRetryWithRegistration(client.Client))
+}
+
+// ListResponder handles the response to the List request. The method always
+// closes the http.Response Body.
+func (client BackupsClient) ListResponder(resp *http.Response) (result BackupsList, err error) {
+ err = autorest.Respond(
+ resp,
+ azure.WithErrorUnlessStatusCode(http.StatusOK),
+ autorest.ByUnmarshallingJSON(&result),
+ autorest.ByClosing())
+ result.Response = autorest.Response{Response: resp}
+ return
+}
+
+// Update patch a backup for the volume
+// Parameters:
+// resourceGroupName - the name of the resource group.
+// accountName - the name of the NetApp account
+// poolName - the name of the capacity pool
+// volumeName - the name of the volume
+// backupName - the name of the backup
+// body - backup object supplied in the body of the operation.
+func (client BackupsClient) Update(ctx context.Context, resourceGroupName string, accountName string, poolName string, volumeName string, backupName string, body *BackupPatch) (result BackupsUpdateFuture, err error) {
+ if tracing.IsEnabled() {
+ ctx = tracing.StartSpan(ctx, fqdn+"/BackupsClient.Update")
+ defer func() {
+ sc := -1
+ if result.FutureAPI != nil && result.FutureAPI.Response() != nil {
+ sc = result.FutureAPI.Response().StatusCode
+ }
+ tracing.EndSpan(ctx, sc, err)
+ }()
+ }
+ if err := validation.Validate([]validation.Validation{
+ {TargetValue: resourceGroupName,
+ Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil},
+ {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil},
+ {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}},
+ {TargetValue: poolName,
+ Constraints: []validation.Constraint{{Target: "poolName", Name: validation.MaxLength, Rule: 64, Chain: nil},
+ {Target: "poolName", Name: validation.MinLength, Rule: 1, Chain: nil},
+ {Target: "poolName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9][a-zA-Z0-9\-_]{0,63}$`, Chain: nil}}},
+ {TargetValue: volumeName,
+ Constraints: []validation.Constraint{{Target: "volumeName", Name: validation.MaxLength, Rule: 64, Chain: nil},
+ {Target: "volumeName", Name: validation.MinLength, Rule: 1, Chain: nil},
+ {Target: "volumeName", Name: validation.Pattern, Rule: `^[a-zA-Z][a-zA-Z0-9\-_]{0,63}$`, Chain: nil}}}}); err != nil {
+ return result, validation.NewError("netapp.BackupsClient", "Update", err.Error())
+ }
+
+ req, err := client.UpdatePreparer(ctx, resourceGroupName, accountName, poolName, volumeName, backupName, body)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "netapp.BackupsClient", "Update", nil, "Failure preparing request")
+ return
+ }
+
+ result, err = client.UpdateSender(req)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "netapp.BackupsClient", "Update", result.Response(), "Failure sending request")
+ return
+ }
+
+ return
+}
+
+// UpdatePreparer prepares the Update request.
+func (client BackupsClient) UpdatePreparer(ctx context.Context, resourceGroupName string, accountName string, poolName string, volumeName string, backupName string, body *BackupPatch) (*http.Request, error) {
+ pathParameters := map[string]interface{}{
+ "accountName": autorest.Encode("path", accountName),
+ "backupName": autorest.Encode("path", backupName),
+ "poolName": autorest.Encode("path", poolName),
+ "resourceGroupName": autorest.Encode("path", resourceGroupName),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
+ "volumeName": autorest.Encode("path", volumeName),
+ }
+
+ const APIVersion = "2021-10-01"
+ queryParameters := map[string]interface{}{
+ "api-version": APIVersion,
+ }
+
+ preparer := autorest.CreatePreparer(
+ autorest.AsContentType("application/json; charset=utf-8"),
+ autorest.AsPatch(),
+ autorest.WithBaseURL(client.BaseURI),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/capacityPools/{poolName}/volumes/{volumeName}/backups/{backupName}", pathParameters),
+ autorest.WithQueryParameters(queryParameters))
+ if body != nil {
+ preparer = autorest.DecoratePreparer(preparer,
+ autorest.WithJSON(body))
+ }
+ return preparer.Prepare((&http.Request{}).WithContext(ctx))
+}
+
+// UpdateSender sends the Update request. The method will close the
+// http.Response Body if it receives an error.
+func (client BackupsClient) UpdateSender(req *http.Request) (future BackupsUpdateFuture, err error) {
+ var resp *http.Response
+ future.FutureAPI = &azure.Future{}
+ resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client))
+ if err != nil {
+ return
+ }
+ var azf azure.Future
+ azf, err = azure.NewFutureFromResponse(resp)
+ future.FutureAPI = &azf
+ future.Result = future.result
+ return
+}
+
+// UpdateResponder handles the response to the Update request. The method always
+// closes the http.Response Body.
+func (client BackupsClient) UpdateResponder(resp *http.Response) (result Backup, err error) {
+ err = autorest.Respond(
+ resp,
+ azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted),
+ autorest.ByUnmarshallingJSON(&result),
+ autorest.ByClosing())
+ result.Response = autorest.Response{Response: resp}
+ return
+}
diff --git a/services/netapp/mgmt/2021-10-01/netapp/client.go b/services/netapp/mgmt/2021-10-01/netapp/client.go
new file mode 100644
index 000000000000..780c3590d75f
--- /dev/null
+++ b/services/netapp/mgmt/2021-10-01/netapp/client.go
@@ -0,0 +1,41 @@
+// Package netapp implements the Azure ARM Netapp service API version 2021-10-01.
+//
+// Microsoft NetApp Files Azure Resource Provider specification
+package netapp
+
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License. See License.txt in the project root for license information.
+//
+// Code generated by Microsoft (R) AutoRest Code Generator.
+// Changes may cause incorrect behavior and will be lost if the code is regenerated.
+
+import (
+ "github.com/Azure/go-autorest/autorest"
+)
+
+const (
+ // DefaultBaseURI is the default URI used for the service Netapp
+ DefaultBaseURI = "https://management.azure.com"
+)
+
+// BaseClient is the base client for Netapp.
+type BaseClient struct {
+ autorest.Client
+ BaseURI string
+ SubscriptionID string
+}
+
+// New creates an instance of the BaseClient client.
+func New(subscriptionID string) BaseClient {
+ return NewWithBaseURI(DefaultBaseURI, subscriptionID)
+}
+
+// NewWithBaseURI creates an instance of the BaseClient client using a custom endpoint. Use this when interacting with
+// an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure stack).
+func NewWithBaseURI(baseURI string, subscriptionID string) BaseClient {
+ return BaseClient{
+ Client: autorest.NewClientWithUserAgent(UserAgent()),
+ BaseURI: baseURI,
+ SubscriptionID: subscriptionID,
+ }
+}
diff --git a/services/netapp/mgmt/2021-10-01/netapp/enums.go b/services/netapp/mgmt/2021-10-01/netapp/enums.go
new file mode 100644
index 000000000000..fbf1e31d2b5b
--- /dev/null
+++ b/services/netapp/mgmt/2021-10-01/netapp/enums.go
@@ -0,0 +1,346 @@
+package netapp
+
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License. See License.txt in the project root for license information.
+//
+// Code generated by Microsoft (R) AutoRest Code Generator.
+// Changes may cause incorrect behavior and will be lost if the code is regenerated.
+
+// ActiveDirectoryStatus enumerates the values for active directory status.
+type ActiveDirectoryStatus string
+
+const (
+ // Created Active Directory created but not in use
+ Created ActiveDirectoryStatus = "Created"
+ // Deleted Active Directory Deleted
+ Deleted ActiveDirectoryStatus = "Deleted"
+ // Error Error with the Active Directory
+ Error ActiveDirectoryStatus = "Error"
+ // InUse Active Directory in use by SMB Volume
+ InUse ActiveDirectoryStatus = "InUse"
+ // Updating Active Directory Updating
+ Updating ActiveDirectoryStatus = "Updating"
+)
+
+// PossibleActiveDirectoryStatusValues returns an array of possible values for the ActiveDirectoryStatus const type.
+func PossibleActiveDirectoryStatusValues() []ActiveDirectoryStatus {
+ return []ActiveDirectoryStatus{Created, Deleted, Error, InUse, Updating}
+}
+
+// ApplicationType enumerates the values for application type.
+type ApplicationType string
+
+const (
+ // SAPHANA ...
+ SAPHANA ApplicationType = "SAP-HANA"
+)
+
+// PossibleApplicationTypeValues returns an array of possible values for the ApplicationType const type.
+func PossibleApplicationTypeValues() []ApplicationType {
+ return []ApplicationType{SAPHANA}
+}
+
+// AvsDataStore enumerates the values for avs data store.
+type AvsDataStore string
+
+const (
+ // Disabled avsDataStore is disabled
+ Disabled AvsDataStore = "Disabled"
+ // Enabled avsDataStore is enabled
+ Enabled AvsDataStore = "Enabled"
+)
+
+// PossibleAvsDataStoreValues returns an array of possible values for the AvsDataStore const type.
+func PossibleAvsDataStoreValues() []AvsDataStore {
+ return []AvsDataStore{Disabled, Enabled}
+}
+
+// BackupType enumerates the values for backup type.
+type BackupType string
+
+const (
+ // Manual Manual backup
+ Manual BackupType = "Manual"
+ // Scheduled Scheduled backup
+ Scheduled BackupType = "Scheduled"
+)
+
+// PossibleBackupTypeValues returns an array of possible values for the BackupType const type.
+func PossibleBackupTypeValues() []BackupType {
+ return []BackupType{Manual, Scheduled}
+}
+
+// CheckNameResourceTypes enumerates the values for check name resource types.
+type CheckNameResourceTypes string
+
+const (
+ // MicrosoftNetAppnetAppAccounts ...
+ MicrosoftNetAppnetAppAccounts CheckNameResourceTypes = "Microsoft.NetApp/netAppAccounts"
+ // MicrosoftNetAppnetAppAccountscapacityPools ...
+ MicrosoftNetAppnetAppAccountscapacityPools CheckNameResourceTypes = "Microsoft.NetApp/netAppAccounts/capacityPools"
+ // MicrosoftNetAppnetAppAccountscapacityPoolsvolumes ...
+ MicrosoftNetAppnetAppAccountscapacityPoolsvolumes CheckNameResourceTypes = "Microsoft.NetApp/netAppAccounts/capacityPools/volumes"
+ // MicrosoftNetAppnetAppAccountscapacityPoolsvolumessnapshots ...
+ MicrosoftNetAppnetAppAccountscapacityPoolsvolumessnapshots CheckNameResourceTypes = "Microsoft.NetApp/netAppAccounts/capacityPools/volumes/snapshots"
+)
+
+// PossibleCheckNameResourceTypesValues returns an array of possible values for the CheckNameResourceTypes const type.
+func PossibleCheckNameResourceTypesValues() []CheckNameResourceTypes {
+ return []CheckNameResourceTypes{MicrosoftNetAppnetAppAccounts, MicrosoftNetAppnetAppAccountscapacityPools, MicrosoftNetAppnetAppAccountscapacityPoolsvolumes, MicrosoftNetAppnetAppAccountscapacityPoolsvolumessnapshots}
+}
+
+// CheckQuotaNameResourceTypes enumerates the values for check quota name resource types.
+type CheckQuotaNameResourceTypes string
+
+const (
+ // CheckQuotaNameResourceTypesMicrosoftNetAppnetAppAccounts ...
+ CheckQuotaNameResourceTypesMicrosoftNetAppnetAppAccounts CheckQuotaNameResourceTypes = "Microsoft.NetApp/netAppAccounts"
+ // CheckQuotaNameResourceTypesMicrosoftNetAppnetAppAccountscapacityPools ...
+ CheckQuotaNameResourceTypesMicrosoftNetAppnetAppAccountscapacityPools CheckQuotaNameResourceTypes = "Microsoft.NetApp/netAppAccounts/capacityPools"
+ // CheckQuotaNameResourceTypesMicrosoftNetAppnetAppAccountscapacityPoolsvolumes ...
+ CheckQuotaNameResourceTypesMicrosoftNetAppnetAppAccountscapacityPoolsvolumes CheckQuotaNameResourceTypes = "Microsoft.NetApp/netAppAccounts/capacityPools/volumes"
+ // CheckQuotaNameResourceTypesMicrosoftNetAppnetAppAccountscapacityPoolsvolumessnapshots ...
+ CheckQuotaNameResourceTypesMicrosoftNetAppnetAppAccountscapacityPoolsvolumessnapshots CheckQuotaNameResourceTypes = "Microsoft.NetApp/netAppAccounts/capacityPools/volumes/snapshots"
+)
+
+// PossibleCheckQuotaNameResourceTypesValues returns an array of possible values for the CheckQuotaNameResourceTypes const type.
+func PossibleCheckQuotaNameResourceTypesValues() []CheckQuotaNameResourceTypes {
+ return []CheckQuotaNameResourceTypes{CheckQuotaNameResourceTypesMicrosoftNetAppnetAppAccounts, CheckQuotaNameResourceTypesMicrosoftNetAppnetAppAccountscapacityPools, CheckQuotaNameResourceTypesMicrosoftNetAppnetAppAccountscapacityPoolsvolumes, CheckQuotaNameResourceTypesMicrosoftNetAppnetAppAccountscapacityPoolsvolumessnapshots}
+}
+
+// ChownMode enumerates the values for chown mode.
+type ChownMode string
+
+const (
+ // Restricted ...
+ Restricted ChownMode = "Restricted"
+ // Unrestricted ...
+ Unrestricted ChownMode = "Unrestricted"
+)
+
+// PossibleChownModeValues returns an array of possible values for the ChownMode const type.
+func PossibleChownModeValues() []ChownMode {
+ return []ChownMode{Restricted, Unrestricted}
+}
+
+// CreatedByType enumerates the values for created by type.
+type CreatedByType string
+
+const (
+ // Application ...
+ Application CreatedByType = "Application"
+ // Key ...
+ Key CreatedByType = "Key"
+ // ManagedIdentity ...
+ ManagedIdentity CreatedByType = "ManagedIdentity"
+ // User ...
+ User CreatedByType = "User"
+)
+
+// PossibleCreatedByTypeValues returns an array of possible values for the CreatedByType const type.
+func PossibleCreatedByTypeValues() []CreatedByType {
+ return []CreatedByType{Application, Key, ManagedIdentity, User}
+}
+
+// EnableSubvolumes enumerates the values for enable subvolumes.
+type EnableSubvolumes string
+
+const (
+ // EnableSubvolumesDisabled subvolumes are not enabled
+ EnableSubvolumesDisabled EnableSubvolumes = "Disabled"
+ // EnableSubvolumesEnabled subvolumes are enabled
+ EnableSubvolumesEnabled EnableSubvolumes = "Enabled"
+)
+
+// PossibleEnableSubvolumesValues returns an array of possible values for the EnableSubvolumes const type.
+func PossibleEnableSubvolumesValues() []EnableSubvolumes {
+ return []EnableSubvolumes{EnableSubvolumesDisabled, EnableSubvolumesEnabled}
+}
+
+// EncryptionType enumerates the values for encryption type.
+type EncryptionType string
+
+const (
+ // Double EncryptionType Double, volumes will use double encryption at rest
+ Double EncryptionType = "Double"
+ // Single EncryptionType Single, volumes will use single encryption at rest
+ Single EncryptionType = "Single"
+)
+
+// PossibleEncryptionTypeValues returns an array of possible values for the EncryptionType const type.
+func PossibleEncryptionTypeValues() []EncryptionType {
+ return []EncryptionType{Double, Single}
+}
+
+// EndpointType enumerates the values for endpoint type.
+type EndpointType string
+
+const (
+ // Dst ...
+ Dst EndpointType = "dst"
+ // Src ...
+ Src EndpointType = "src"
+)
+
+// PossibleEndpointTypeValues returns an array of possible values for the EndpointType const type.
+func PossibleEndpointTypeValues() []EndpointType {
+ return []EndpointType{Dst, Src}
+}
+
+// InAvailabilityReasonType enumerates the values for in availability reason type.
+type InAvailabilityReasonType string
+
+const (
+ // AlreadyExists ...
+ AlreadyExists InAvailabilityReasonType = "AlreadyExists"
+ // Invalid ...
+ Invalid InAvailabilityReasonType = "Invalid"
+)
+
+// PossibleInAvailabilityReasonTypeValues returns an array of possible values for the InAvailabilityReasonType const type.
+func PossibleInAvailabilityReasonTypeValues() []InAvailabilityReasonType {
+ return []InAvailabilityReasonType{AlreadyExists, Invalid}
+}
+
+// MetricAggregationType enumerates the values for metric aggregation type.
+type MetricAggregationType string
+
+const (
+ // Average ...
+ Average MetricAggregationType = "Average"
+)
+
+// PossibleMetricAggregationTypeValues returns an array of possible values for the MetricAggregationType const type.
+func PossibleMetricAggregationTypeValues() []MetricAggregationType {
+ return []MetricAggregationType{Average}
+}
+
+// MirrorState enumerates the values for mirror state.
+type MirrorState string
+
+const (
+ // Broken ...
+ Broken MirrorState = "Broken"
+ // Mirrored ...
+ Mirrored MirrorState = "Mirrored"
+ // Uninitialized ...
+ Uninitialized MirrorState = "Uninitialized"
+)
+
+// PossibleMirrorStateValues returns an array of possible values for the MirrorState const type.
+func PossibleMirrorStateValues() []MirrorState {
+ return []MirrorState{Broken, Mirrored, Uninitialized}
+}
+
+// NetworkFeatures enumerates the values for network features.
+type NetworkFeatures string
+
+const (
+ // Basic Basic network feature.
+ Basic NetworkFeatures = "Basic"
+ // Standard Standard network feature.
+ Standard NetworkFeatures = "Standard"
+)
+
+// PossibleNetworkFeaturesValues returns an array of possible values for the NetworkFeatures const type.
+func PossibleNetworkFeaturesValues() []NetworkFeatures {
+ return []NetworkFeatures{Basic, Standard}
+}
+
+// QosType enumerates the values for qos type.
+type QosType string
+
+const (
+ // QosTypeAuto qos type Auto
+ QosTypeAuto QosType = "Auto"
+ // QosTypeManual qos type Manual
+ QosTypeManual QosType = "Manual"
+)
+
+// PossibleQosTypeValues returns an array of possible values for the QosType const type.
+func PossibleQosTypeValues() []QosType {
+ return []QosType{QosTypeAuto, QosTypeManual}
+}
+
+// RelationshipStatus enumerates the values for relationship status.
+type RelationshipStatus string
+
+const (
+ // Idle ...
+ Idle RelationshipStatus = "Idle"
+ // Transferring ...
+ Transferring RelationshipStatus = "Transferring"
+)
+
+// PossibleRelationshipStatusValues returns an array of possible values for the RelationshipStatus const type.
+func PossibleRelationshipStatusValues() []RelationshipStatus {
+ return []RelationshipStatus{Idle, Transferring}
+}
+
+// ReplicationSchedule enumerates the values for replication schedule.
+type ReplicationSchedule string
+
+const (
+ // OneZerominutely ...
+ OneZerominutely ReplicationSchedule = "_10minutely"
+ // Daily ...
+ Daily ReplicationSchedule = "daily"
+ // Hourly ...
+ Hourly ReplicationSchedule = "hourly"
+)
+
+// PossibleReplicationScheduleValues returns an array of possible values for the ReplicationSchedule const type.
+func PossibleReplicationScheduleValues() []ReplicationSchedule {
+ return []ReplicationSchedule{OneZerominutely, Daily, Hourly}
+}
+
+// SecurityStyle enumerates the values for security style.
+type SecurityStyle string
+
+const (
+ // Ntfs ...
+ Ntfs SecurityStyle = "ntfs"
+ // Unix ...
+ Unix SecurityStyle = "unix"
+)
+
+// PossibleSecurityStyleValues returns an array of possible values for the SecurityStyle const type.
+func PossibleSecurityStyleValues() []SecurityStyle {
+ return []SecurityStyle{Ntfs, Unix}
+}
+
+// ServiceLevel enumerates the values for service level.
+type ServiceLevel string
+
+const (
+ // ServiceLevelPremium Premium service level
+ ServiceLevelPremium ServiceLevel = "Premium"
+ // ServiceLevelStandard Standard service level
+ ServiceLevelStandard ServiceLevel = "Standard"
+ // ServiceLevelStandardZRS Zone redundant storage service level
+ ServiceLevelStandardZRS ServiceLevel = "StandardZRS"
+ // ServiceLevelUltra Ultra service level
+ ServiceLevelUltra ServiceLevel = "Ultra"
+)
+
+// PossibleServiceLevelValues returns an array of possible values for the ServiceLevel const type.
+func PossibleServiceLevelValues() []ServiceLevel {
+ return []ServiceLevel{ServiceLevelPremium, ServiceLevelStandard, ServiceLevelStandardZRS, ServiceLevelUltra}
+}
+
+// VolumeStorageToNetworkProximity enumerates the values for volume storage to network proximity.
+type VolumeStorageToNetworkProximity string
+
+const (
+ // Default Basic storage to network connectivity.
+ Default VolumeStorageToNetworkProximity = "Default"
+ // T1 Standard T1 storage to network connectivity.
+ T1 VolumeStorageToNetworkProximity = "T1"
+ // T2 Standard T2 storage to network connectivity.
+ T2 VolumeStorageToNetworkProximity = "T2"
+)
+
+// PossibleVolumeStorageToNetworkProximityValues returns an array of possible values for the VolumeStorageToNetworkProximity const type.
+func PossibleVolumeStorageToNetworkProximityValues() []VolumeStorageToNetworkProximity {
+ return []VolumeStorageToNetworkProximity{Default, T1, T2}
+}
diff --git a/services/netapp/mgmt/2021-10-01/netapp/models.go b/services/netapp/mgmt/2021-10-01/netapp/models.go
new file mode 100644
index 000000000000..49e7ba2c32e8
--- /dev/null
+++ b/services/netapp/mgmt/2021-10-01/netapp/models.go
@@ -0,0 +1,5721 @@
+package netapp
+
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License. See License.txt in the project root for license information.
+//
+// Code generated by Microsoft (R) AutoRest Code Generator.
+// Changes may cause incorrect behavior and will be lost if the code is regenerated.
+
+import (
+ "context"
+ "encoding/json"
+ "github.com/Azure/go-autorest/autorest"
+ "github.com/Azure/go-autorest/autorest/azure"
+ "github.com/Azure/go-autorest/autorest/date"
+ "github.com/Azure/go-autorest/autorest/to"
+ "github.com/Azure/go-autorest/tracing"
+ "net/http"
+)
+
+// The package's fully qualified name.
+const fqdn = "github.com/Azure/azure-sdk-for-go/services/netapp/mgmt/2021-10-01/netapp"
+
+// Account netApp account resource
+type Account struct {
+ autorest.Response `json:"-"`
+ // Location - Resource location
+ Location *string `json:"location,omitempty"`
+ // ID - READ-ONLY; Resource Id
+ ID *string `json:"id,omitempty"`
+ // Name - READ-ONLY; Resource name
+ Name *string `json:"name,omitempty"`
+ // Etag - READ-ONLY; A unique read-only string that changes whenever the resource is updated.
+ Etag *string `json:"etag,omitempty"`
+ // Type - READ-ONLY; Resource type
+ Type *string `json:"type,omitempty"`
+ // Tags - Resource tags
+ Tags map[string]*string `json:"tags"`
+ // AccountProperties - NetApp Account properties
+ *AccountProperties `json:"properties,omitempty"`
+ // SystemData - READ-ONLY; The system meta data relating to this resource.
+ SystemData *SystemData `json:"systemData,omitempty"`
+}
+
+// MarshalJSON is the custom marshaler for Account.
+func (a Account) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]interface{})
+ if a.Location != nil {
+ objectMap["location"] = a.Location
+ }
+ if a.Tags != nil {
+ objectMap["tags"] = a.Tags
+ }
+ if a.AccountProperties != nil {
+ objectMap["properties"] = a.AccountProperties
+ }
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON is the custom unmarshaler for Account struct.
+func (a *Account) UnmarshalJSON(body []byte) error {
+ var m map[string]*json.RawMessage
+ err := json.Unmarshal(body, &m)
+ if err != nil {
+ return err
+ }
+ for k, v := range m {
+ switch k {
+ case "location":
+ if v != nil {
+ var location string
+ err = json.Unmarshal(*v, &location)
+ if err != nil {
+ return err
+ }
+ a.Location = &location
+ }
+ case "id":
+ if v != nil {
+ var ID string
+ err = json.Unmarshal(*v, &ID)
+ if err != nil {
+ return err
+ }
+ a.ID = &ID
+ }
+ case "name":
+ if v != nil {
+ var name string
+ err = json.Unmarshal(*v, &name)
+ if err != nil {
+ return err
+ }
+ a.Name = &name
+ }
+ case "etag":
+ if v != nil {
+ var etag string
+ err = json.Unmarshal(*v, &etag)
+ if err != nil {
+ return err
+ }
+ a.Etag = &etag
+ }
+ case "type":
+ if v != nil {
+ var typeVar string
+ err = json.Unmarshal(*v, &typeVar)
+ if err != nil {
+ return err
+ }
+ a.Type = &typeVar
+ }
+ case "tags":
+ if v != nil {
+ var tags map[string]*string
+ err = json.Unmarshal(*v, &tags)
+ if err != nil {
+ return err
+ }
+ a.Tags = tags
+ }
+ case "properties":
+ if v != nil {
+ var accountProperties AccountProperties
+ err = json.Unmarshal(*v, &accountProperties)
+ if err != nil {
+ return err
+ }
+ a.AccountProperties = &accountProperties
+ }
+ case "systemData":
+ if v != nil {
+ var systemData SystemData
+ err = json.Unmarshal(*v, &systemData)
+ if err != nil {
+ return err
+ }
+ a.SystemData = &systemData
+ }
+ }
+ }
+
+ return nil
+}
+
+// AccountBackupsDeleteFuture an abstraction for monitoring and retrieving the results of a long-running
+// operation.
+type AccountBackupsDeleteFuture struct {
+ azure.FutureAPI
+ // Result returns the result of the asynchronous operation.
+ // If the operation has not completed it will return an error.
+ Result func(AccountBackupsClient) (autorest.Response, error)
+}
+
+// UnmarshalJSON is the custom unmarshaller for CreateFuture.
+func (future *AccountBackupsDeleteFuture) UnmarshalJSON(body []byte) error {
+ var azFuture azure.Future
+ if err := json.Unmarshal(body, &azFuture); err != nil {
+ return err
+ }
+ future.FutureAPI = &azFuture
+ future.Result = future.result
+ return nil
+}
+
+// result is the default implementation for AccountBackupsDeleteFuture.Result.
+func (future *AccountBackupsDeleteFuture) result(client AccountBackupsClient) (ar autorest.Response, err error) {
+ var done bool
+ done, err = future.DoneWithContext(context.Background(), client)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "netapp.AccountBackupsDeleteFuture", "Result", future.Response(), "Polling failure")
+ return
+ }
+ if !done {
+ ar.Response = future.Response()
+ err = azure.NewAsyncOpIncompleteError("netapp.AccountBackupsDeleteFuture")
+ return
+ }
+ ar.Response = future.Response()
+ return
+}
+
+// AccountEncryption encryption settings
+type AccountEncryption struct {
+ // KeySource - Encryption Key Source. Possible values are: 'Microsoft.NetApp'.
+ KeySource *string `json:"keySource,omitempty"`
+}
+
+// AccountList list of NetApp account resources
+type AccountList struct {
+ autorest.Response `json:"-"`
+ // Value - Multiple NetApp accounts
+ Value *[]Account `json:"value,omitempty"`
+ // NextLink - URL to get the next set of results.
+ NextLink *string `json:"nextLink,omitempty"`
+}
+
+// AccountListIterator provides access to a complete listing of Account values.
+type AccountListIterator struct {
+ i int
+ page AccountListPage
+}
+
+// NextWithContext advances to the next value. If there was an error making
+// the request the iterator does not advance and the error is returned.
+func (iter *AccountListIterator) NextWithContext(ctx context.Context) (err error) {
+ if tracing.IsEnabled() {
+ ctx = tracing.StartSpan(ctx, fqdn+"/AccountListIterator.NextWithContext")
+ defer func() {
+ sc := -1
+ if iter.Response().Response.Response != nil {
+ sc = iter.Response().Response.Response.StatusCode
+ }
+ tracing.EndSpan(ctx, sc, err)
+ }()
+ }
+ iter.i++
+ if iter.i < len(iter.page.Values()) {
+ return nil
+ }
+ err = iter.page.NextWithContext(ctx)
+ if err != nil {
+ iter.i--
+ return err
+ }
+ iter.i = 0
+ return nil
+}
+
+// Next advances to the next value. If there was an error making
+// the request the iterator does not advance and the error is returned.
+// Deprecated: Use NextWithContext() instead.
+func (iter *AccountListIterator) Next() error {
+ return iter.NextWithContext(context.Background())
+}
+
+// NotDone returns true if the enumeration should be started or is not yet complete.
+func (iter AccountListIterator) NotDone() bool {
+ return iter.page.NotDone() && iter.i < len(iter.page.Values())
+}
+
+// Response returns the raw server response from the last page request.
+func (iter AccountListIterator) Response() AccountList {
+ return iter.page.Response()
+}
+
+// Value returns the current value or a zero-initialized value if the
+// iterator has advanced beyond the end of the collection.
+func (iter AccountListIterator) Value() Account {
+ if !iter.page.NotDone() {
+ return Account{}
+ }
+ return iter.page.Values()[iter.i]
+}
+
+// Creates a new instance of the AccountListIterator type.
+func NewAccountListIterator(page AccountListPage) AccountListIterator {
+ return AccountListIterator{page: page}
+}
+
+// IsEmpty returns true if the ListResult contains no values.
+func (al AccountList) IsEmpty() bool {
+ return al.Value == nil || len(*al.Value) == 0
+}
+
+// hasNextLink returns true if the NextLink is not empty.
+func (al AccountList) hasNextLink() bool {
+ return al.NextLink != nil && len(*al.NextLink) != 0
+}
+
+// accountListPreparer prepares a request to retrieve the next set of results.
+// It returns nil if no more results exist.
+func (al AccountList) accountListPreparer(ctx context.Context) (*http.Request, error) {
+ if !al.hasNextLink() {
+ return nil, nil
+ }
+ return autorest.Prepare((&http.Request{}).WithContext(ctx),
+ autorest.AsJSON(),
+ autorest.AsGet(),
+ autorest.WithBaseURL(to.String(al.NextLink)))
+}
+
+// AccountListPage contains a page of Account values.
+type AccountListPage struct {
+ fn func(context.Context, AccountList) (AccountList, error)
+ al AccountList
+}
+
+// NextWithContext advances to the next page of values. If there was an error making
+// the request the page does not advance and the error is returned.
+func (page *AccountListPage) NextWithContext(ctx context.Context) (err error) {
+ if tracing.IsEnabled() {
+ ctx = tracing.StartSpan(ctx, fqdn+"/AccountListPage.NextWithContext")
+ defer func() {
+ sc := -1
+ if page.Response().Response.Response != nil {
+ sc = page.Response().Response.Response.StatusCode
+ }
+ tracing.EndSpan(ctx, sc, err)
+ }()
+ }
+ for {
+ next, err := page.fn(ctx, page.al)
+ if err != nil {
+ return err
+ }
+ page.al = next
+ if !next.hasNextLink() || !next.IsEmpty() {
+ break
+ }
+ }
+ return nil
+}
+
+// Next advances to the next page of values. If there was an error making
+// the request the page does not advance and the error is returned.
+// Deprecated: Use NextWithContext() instead.
+func (page *AccountListPage) Next() error {
+ return page.NextWithContext(context.Background())
+}
+
+// NotDone returns true if the page enumeration should be started or is not yet complete.
+func (page AccountListPage) NotDone() bool {
+ return !page.al.IsEmpty()
+}
+
+// Response returns the raw server response from the last page request.
+func (page AccountListPage) Response() AccountList {
+ return page.al
+}
+
+// Values returns the slice of values for the current page or nil if there are no values.
+func (page AccountListPage) Values() []Account {
+ if page.al.IsEmpty() {
+ return nil
+ }
+ return *page.al.Value
+}
+
+// Creates a new instance of the AccountListPage type.
+func NewAccountListPage(cur AccountList, getNextPage func(context.Context, AccountList) (AccountList, error)) AccountListPage {
+ return AccountListPage{
+ fn: getNextPage,
+ al: cur,
+ }
+}
+
+// AccountPatch netApp account patch resource
+type AccountPatch struct {
+ // Location - Resource location
+ Location *string `json:"location,omitempty"`
+ // ID - READ-ONLY; Resource Id
+ ID *string `json:"id,omitempty"`
+ // Name - READ-ONLY; Resource name
+ Name *string `json:"name,omitempty"`
+ // Type - READ-ONLY; Resource type
+ Type *string `json:"type,omitempty"`
+ // Tags - Resource tags
+ Tags map[string]*string `json:"tags"`
+ // AccountProperties - NetApp Account properties
+ *AccountProperties `json:"properties,omitempty"`
+}
+
+// MarshalJSON is the custom marshaler for AccountPatch.
+func (ap AccountPatch) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]interface{})
+ if ap.Location != nil {
+ objectMap["location"] = ap.Location
+ }
+ if ap.Tags != nil {
+ objectMap["tags"] = ap.Tags
+ }
+ if ap.AccountProperties != nil {
+ objectMap["properties"] = ap.AccountProperties
+ }
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON is the custom unmarshaler for AccountPatch struct.
+func (ap *AccountPatch) UnmarshalJSON(body []byte) error {
+ var m map[string]*json.RawMessage
+ err := json.Unmarshal(body, &m)
+ if err != nil {
+ return err
+ }
+ for k, v := range m {
+ switch k {
+ case "location":
+ if v != nil {
+ var location string
+ err = json.Unmarshal(*v, &location)
+ if err != nil {
+ return err
+ }
+ ap.Location = &location
+ }
+ case "id":
+ if v != nil {
+ var ID string
+ err = json.Unmarshal(*v, &ID)
+ if err != nil {
+ return err
+ }
+ ap.ID = &ID
+ }
+ case "name":
+ if v != nil {
+ var name string
+ err = json.Unmarshal(*v, &name)
+ if err != nil {
+ return err
+ }
+ ap.Name = &name
+ }
+ case "type":
+ if v != nil {
+ var typeVar string
+ err = json.Unmarshal(*v, &typeVar)
+ if err != nil {
+ return err
+ }
+ ap.Type = &typeVar
+ }
+ case "tags":
+ if v != nil {
+ var tags map[string]*string
+ err = json.Unmarshal(*v, &tags)
+ if err != nil {
+ return err
+ }
+ ap.Tags = tags
+ }
+ case "properties":
+ if v != nil {
+ var accountProperties AccountProperties
+ err = json.Unmarshal(*v, &accountProperties)
+ if err != nil {
+ return err
+ }
+ ap.AccountProperties = &accountProperties
+ }
+ }
+ }
+
+ return nil
+}
+
+// AccountProperties netApp account properties
+type AccountProperties struct {
+ // ProvisioningState - READ-ONLY; Azure lifecycle management
+ ProvisioningState *string `json:"provisioningState,omitempty"`
+ // ActiveDirectories - Active Directories
+ ActiveDirectories *[]ActiveDirectory `json:"activeDirectories,omitempty"`
+ // Encryption - Encryption settings
+ Encryption *AccountEncryption `json:"encryption,omitempty"`
+}
+
+// MarshalJSON is the custom marshaler for AccountProperties.
+func (ap AccountProperties) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]interface{})
+ if ap.ActiveDirectories != nil {
+ objectMap["activeDirectories"] = ap.ActiveDirectories
+ }
+ if ap.Encryption != nil {
+ objectMap["encryption"] = ap.Encryption
+ }
+ return json.Marshal(objectMap)
+}
+
+// AccountsCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a long-running
+// operation.
+type AccountsCreateOrUpdateFuture struct {
+ azure.FutureAPI
+ // Result returns the result of the asynchronous operation.
+ // If the operation has not completed it will return an error.
+ Result func(AccountsClient) (Account, error)
+}
+
+// UnmarshalJSON is the custom unmarshaller for CreateFuture.
+func (future *AccountsCreateOrUpdateFuture) UnmarshalJSON(body []byte) error {
+ var azFuture azure.Future
+ if err := json.Unmarshal(body, &azFuture); err != nil {
+ return err
+ }
+ future.FutureAPI = &azFuture
+ future.Result = future.result
+ return nil
+}
+
+// result is the default implementation for AccountsCreateOrUpdateFuture.Result.
+func (future *AccountsCreateOrUpdateFuture) result(client AccountsClient) (a Account, err error) {
+ var done bool
+ done, err = future.DoneWithContext(context.Background(), client)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "netapp.AccountsCreateOrUpdateFuture", "Result", future.Response(), "Polling failure")
+ return
+ }
+ if !done {
+ a.Response.Response = future.Response()
+ err = azure.NewAsyncOpIncompleteError("netapp.AccountsCreateOrUpdateFuture")
+ return
+ }
+ sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
+ if a.Response.Response, err = future.GetResult(sender); err == nil && a.Response.Response.StatusCode != http.StatusNoContent {
+ a, err = client.CreateOrUpdateResponder(a.Response.Response)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "netapp.AccountsCreateOrUpdateFuture", "Result", a.Response.Response, "Failure responding to request")
+ }
+ }
+ return
+}
+
+// AccountsDeleteFuture an abstraction for monitoring and retrieving the results of a long-running
+// operation.
+type AccountsDeleteFuture struct {
+ azure.FutureAPI
+ // Result returns the result of the asynchronous operation.
+ // If the operation has not completed it will return an error.
+ Result func(AccountsClient) (autorest.Response, error)
+}
+
+// UnmarshalJSON is the custom unmarshaller for CreateFuture.
+func (future *AccountsDeleteFuture) UnmarshalJSON(body []byte) error {
+ var azFuture azure.Future
+ if err := json.Unmarshal(body, &azFuture); err != nil {
+ return err
+ }
+ future.FutureAPI = &azFuture
+ future.Result = future.result
+ return nil
+}
+
+// result is the default implementation for AccountsDeleteFuture.Result.
+func (future *AccountsDeleteFuture) result(client AccountsClient) (ar autorest.Response, err error) {
+ var done bool
+ done, err = future.DoneWithContext(context.Background(), client)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "netapp.AccountsDeleteFuture", "Result", future.Response(), "Polling failure")
+ return
+ }
+ if !done {
+ ar.Response = future.Response()
+ err = azure.NewAsyncOpIncompleteError("netapp.AccountsDeleteFuture")
+ return
+ }
+ ar.Response = future.Response()
+ return
+}
+
+// AccountsUpdateFuture an abstraction for monitoring and retrieving the results of a long-running
+// operation.
+type AccountsUpdateFuture struct {
+ azure.FutureAPI
+ // Result returns the result of the asynchronous operation.
+ // If the operation has not completed it will return an error.
+ Result func(AccountsClient) (Account, error)
+}
+
+// UnmarshalJSON is the custom unmarshaller for CreateFuture.
+func (future *AccountsUpdateFuture) UnmarshalJSON(body []byte) error {
+ var azFuture azure.Future
+ if err := json.Unmarshal(body, &azFuture); err != nil {
+ return err
+ }
+ future.FutureAPI = &azFuture
+ future.Result = future.result
+ return nil
+}
+
+// result is the default implementation for AccountsUpdateFuture.Result.
+func (future *AccountsUpdateFuture) result(client AccountsClient) (a Account, err error) {
+ var done bool
+ done, err = future.DoneWithContext(context.Background(), client)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "netapp.AccountsUpdateFuture", "Result", future.Response(), "Polling failure")
+ return
+ }
+ if !done {
+ a.Response.Response = future.Response()
+ err = azure.NewAsyncOpIncompleteError("netapp.AccountsUpdateFuture")
+ return
+ }
+ sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
+ if a.Response.Response, err = future.GetResult(sender); err == nil && a.Response.Response.StatusCode != http.StatusNoContent {
+ a, err = client.UpdateResponder(a.Response.Response)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "netapp.AccountsUpdateFuture", "Result", a.Response.Response, "Failure responding to request")
+ }
+ }
+ return
+}
+
+// ActiveDirectory active Directory
+type ActiveDirectory struct {
+ // ActiveDirectoryID - Id of the Active Directory
+ ActiveDirectoryID *string `json:"activeDirectoryId,omitempty"`
+ // Username - Username of Active Directory domain administrator
+ Username *string `json:"username,omitempty"`
+ // Password - Plain text password of Active Directory domain administrator, value is masked in the response
+ Password *string `json:"password,omitempty"`
+ // Domain - Name of the Active Directory domain
+ Domain *string `json:"domain,omitempty"`
+ // DNS - Comma separated list of DNS server IP addresses (IPv4 only) for the Active Directory domain
+ DNS *string `json:"dns,omitempty"`
+ // Status - READ-ONLY; Status of the Active Directory. Possible values include: 'Created', 'InUse', 'Deleted', 'Error', 'Updating'
+ Status ActiveDirectoryStatus `json:"status,omitempty"`
+ // StatusDetails - READ-ONLY; Any details in regards to the Status of the Active Directory
+ StatusDetails *string `json:"statusDetails,omitempty"`
+ // SmbServerName - NetBIOS name of the SMB server. This name will be registered as a computer account in the AD and used to mount volumes
+ SmbServerName *string `json:"smbServerName,omitempty"`
+ // OrganizationalUnit - The Organizational Unit (OU) within the Windows Active Directory
+ OrganizationalUnit *string `json:"organizationalUnit,omitempty"`
+ // Site - The Active Directory site the service will limit Domain Controller discovery to
+ Site *string `json:"site,omitempty"`
+ // BackupOperators - Users to be added to the Built-in Backup Operator active directory group. A list of unique usernames without domain specifier
+ BackupOperators *[]string `json:"backupOperators,omitempty"`
+ // Administrators - Users to be added to the Built-in Administrators active directory group. A list of unique usernames without domain specifier
+ Administrators *[]string `json:"administrators,omitempty"`
+ // KdcIP - kdc server IP addresses for the active directory machine. This optional parameter is used only while creating kerberos volume.
+ KdcIP *string `json:"kdcIP,omitempty"`
+ // AdName - Name of the active directory machine. This optional parameter is used only while creating kerberos volume
+ AdName *string `json:"adName,omitempty"`
+ // ServerRootCACertificate - When LDAP over SSL/TLS is enabled, the LDAP client is required to have base64 encoded Active Directory Certificate Service's self-signed root CA certificate, this optional parameter is used only for dual protocol with LDAP user-mapping volumes.
+ ServerRootCACertificate *string `json:"serverRootCACertificate,omitempty"`
+ // AesEncryption - If enabled, AES encryption will be enabled for SMB communication.
+ AesEncryption *bool `json:"aesEncryption,omitempty"`
+ // LdapSigning - Specifies whether or not the LDAP traffic needs to be signed.
+ LdapSigning *bool `json:"ldapSigning,omitempty"`
+ // SecurityOperators - Domain Users in the Active directory to be given SeSecurityPrivilege privilege (Needed for SMB Continuously available shares for SQL). A list of unique usernames without domain specifier
+ SecurityOperators *[]string `json:"securityOperators,omitempty"`
+ // LdapOverTLS - Specifies whether or not the LDAP traffic needs to be secured via TLS.
+ LdapOverTLS *bool `json:"ldapOverTLS,omitempty"`
+ // AllowLocalNfsUsersWithLdap - If enabled, NFS client local users can also (in addition to LDAP users) access the NFS volumes.
+ AllowLocalNfsUsersWithLdap *bool `json:"allowLocalNfsUsersWithLdap,omitempty"`
+ // EncryptDCConnections - If enabled, Traffic between the SMB server to Domain Controller (DC) will be encrypted.
+ EncryptDCConnections *bool `json:"encryptDCConnections,omitempty"`
+ // LdapSearchScope - LDAP Search scope options
+ LdapSearchScope *LdapSearchScopeOpt `json:"ldapSearchScope,omitempty"`
+}
+
+// MarshalJSON is the custom marshaler for ActiveDirectory.
+func (ad ActiveDirectory) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]interface{})
+ if ad.ActiveDirectoryID != nil {
+ objectMap["activeDirectoryId"] = ad.ActiveDirectoryID
+ }
+ if ad.Username != nil {
+ objectMap["username"] = ad.Username
+ }
+ if ad.Password != nil {
+ objectMap["password"] = ad.Password
+ }
+ if ad.Domain != nil {
+ objectMap["domain"] = ad.Domain
+ }
+ if ad.DNS != nil {
+ objectMap["dns"] = ad.DNS
+ }
+ if ad.SmbServerName != nil {
+ objectMap["smbServerName"] = ad.SmbServerName
+ }
+ if ad.OrganizationalUnit != nil {
+ objectMap["organizationalUnit"] = ad.OrganizationalUnit
+ }
+ if ad.Site != nil {
+ objectMap["site"] = ad.Site
+ }
+ if ad.BackupOperators != nil {
+ objectMap["backupOperators"] = ad.BackupOperators
+ }
+ if ad.Administrators != nil {
+ objectMap["administrators"] = ad.Administrators
+ }
+ if ad.KdcIP != nil {
+ objectMap["kdcIP"] = ad.KdcIP
+ }
+ if ad.AdName != nil {
+ objectMap["adName"] = ad.AdName
+ }
+ if ad.ServerRootCACertificate != nil {
+ objectMap["serverRootCACertificate"] = ad.ServerRootCACertificate
+ }
+ if ad.AesEncryption != nil {
+ objectMap["aesEncryption"] = ad.AesEncryption
+ }
+ if ad.LdapSigning != nil {
+ objectMap["ldapSigning"] = ad.LdapSigning
+ }
+ if ad.SecurityOperators != nil {
+ objectMap["securityOperators"] = ad.SecurityOperators
+ }
+ if ad.LdapOverTLS != nil {
+ objectMap["ldapOverTLS"] = ad.LdapOverTLS
+ }
+ if ad.AllowLocalNfsUsersWithLdap != nil {
+ objectMap["allowLocalNfsUsersWithLdap"] = ad.AllowLocalNfsUsersWithLdap
+ }
+ if ad.EncryptDCConnections != nil {
+ objectMap["encryptDCConnections"] = ad.EncryptDCConnections
+ }
+ if ad.LdapSearchScope != nil {
+ objectMap["ldapSearchScope"] = ad.LdapSearchScope
+ }
+ return json.Marshal(objectMap)
+}
+
+// AuthorizeRequest authorize request
+type AuthorizeRequest struct {
+ // RemoteVolumeResourceID - Resource id of the remote volume
+ RemoteVolumeResourceID *string `json:"remoteVolumeResourceId,omitempty"`
+}
+
+// AzureEntityResource the resource model definition for an Azure Resource Manager resource with an etag.
+type AzureEntityResource struct {
+ // Etag - READ-ONLY; Resource Etag.
+ Etag *string `json:"etag,omitempty"`
+ // ID - READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}
+ ID *string `json:"id,omitempty"`
+ // Name - READ-ONLY; The name of the resource
+ Name *string `json:"name,omitempty"`
+ // Type - READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts"
+ Type *string `json:"type,omitempty"`
+}
+
+// MarshalJSON is the custom marshaler for AzureEntityResource.
+func (aer AzureEntityResource) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]interface{})
+ return json.Marshal(objectMap)
+}
+
+// Backup backup of a Volume
+type Backup struct {
+ autorest.Response `json:"-"`
+ // Location - Resource location
+ Location *string `json:"location,omitempty"`
+ // ID - READ-ONLY; Resource Id
+ ID *string `json:"id,omitempty"`
+ // Name - READ-ONLY; Resource name
+ Name *string `json:"name,omitempty"`
+ // Type - READ-ONLY; Resource type
+ Type *string `json:"type,omitempty"`
+ // BackupProperties - Backup Properties
+ *BackupProperties `json:"properties,omitempty"`
+}
+
+// MarshalJSON is the custom marshaler for Backup.
+func (b Backup) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]interface{})
+ if b.Location != nil {
+ objectMap["location"] = b.Location
+ }
+ if b.BackupProperties != nil {
+ objectMap["properties"] = b.BackupProperties
+ }
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON is the custom unmarshaler for Backup struct.
+func (b *Backup) UnmarshalJSON(body []byte) error {
+ var m map[string]*json.RawMessage
+ err := json.Unmarshal(body, &m)
+ if err != nil {
+ return err
+ }
+ for k, v := range m {
+ switch k {
+ case "location":
+ if v != nil {
+ var location string
+ err = json.Unmarshal(*v, &location)
+ if err != nil {
+ return err
+ }
+ b.Location = &location
+ }
+ case "id":
+ if v != nil {
+ var ID string
+ err = json.Unmarshal(*v, &ID)
+ if err != nil {
+ return err
+ }
+ b.ID = &ID
+ }
+ case "name":
+ if v != nil {
+ var name string
+ err = json.Unmarshal(*v, &name)
+ if err != nil {
+ return err
+ }
+ b.Name = &name
+ }
+ case "type":
+ if v != nil {
+ var typeVar string
+ err = json.Unmarshal(*v, &typeVar)
+ if err != nil {
+ return err
+ }
+ b.Type = &typeVar
+ }
+ case "properties":
+ if v != nil {
+ var backupProperties BackupProperties
+ err = json.Unmarshal(*v, &backupProperties)
+ if err != nil {
+ return err
+ }
+ b.BackupProperties = &backupProperties
+ }
+ }
+ }
+
+ return nil
+}
+
+// BackupPatch backup patch
+type BackupPatch struct {
+ // Tags - Resource tags
+ Tags map[string]*string `json:"tags"`
+ // BackupProperties - Backup Properties
+ *BackupProperties `json:"properties,omitempty"`
+}
+
+// MarshalJSON is the custom marshaler for BackupPatch.
+func (bp BackupPatch) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]interface{})
+ if bp.Tags != nil {
+ objectMap["tags"] = bp.Tags
+ }
+ if bp.BackupProperties != nil {
+ objectMap["properties"] = bp.BackupProperties
+ }
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON is the custom unmarshaler for BackupPatch struct.
+func (bp *BackupPatch) UnmarshalJSON(body []byte) error {
+ var m map[string]*json.RawMessage
+ err := json.Unmarshal(body, &m)
+ if err != nil {
+ return err
+ }
+ for k, v := range m {
+ switch k {
+ case "tags":
+ if v != nil {
+ var tags map[string]*string
+ err = json.Unmarshal(*v, &tags)
+ if err != nil {
+ return err
+ }
+ bp.Tags = tags
+ }
+ case "properties":
+ if v != nil {
+ var backupProperties BackupProperties
+ err = json.Unmarshal(*v, &backupProperties)
+ if err != nil {
+ return err
+ }
+ bp.BackupProperties = &backupProperties
+ }
+ }
+ }
+
+ return nil
+}
+
+// BackupPoliciesCreateFuture an abstraction for monitoring and retrieving the results of a long-running
+// operation.
+type BackupPoliciesCreateFuture struct {
+ azure.FutureAPI
+ // Result returns the result of the asynchronous operation.
+ // If the operation has not completed it will return an error.
+ Result func(BackupPoliciesClient) (BackupPolicy, error)
+}
+
+// UnmarshalJSON is the custom unmarshaller for CreateFuture.
+func (future *BackupPoliciesCreateFuture) UnmarshalJSON(body []byte) error {
+ var azFuture azure.Future
+ if err := json.Unmarshal(body, &azFuture); err != nil {
+ return err
+ }
+ future.FutureAPI = &azFuture
+ future.Result = future.result
+ return nil
+}
+
+// result is the default implementation for BackupPoliciesCreateFuture.Result.
+func (future *BackupPoliciesCreateFuture) result(client BackupPoliciesClient) (bp BackupPolicy, err error) {
+ var done bool
+ done, err = future.DoneWithContext(context.Background(), client)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "netapp.BackupPoliciesCreateFuture", "Result", future.Response(), "Polling failure")
+ return
+ }
+ if !done {
+ bp.Response.Response = future.Response()
+ err = azure.NewAsyncOpIncompleteError("netapp.BackupPoliciesCreateFuture")
+ return
+ }
+ sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
+ if bp.Response.Response, err = future.GetResult(sender); err == nil && bp.Response.Response.StatusCode != http.StatusNoContent {
+ bp, err = client.CreateResponder(bp.Response.Response)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "netapp.BackupPoliciesCreateFuture", "Result", bp.Response.Response, "Failure responding to request")
+ }
+ }
+ return
+}
+
+// BackupPoliciesDeleteFuture an abstraction for monitoring and retrieving the results of a long-running
+// operation.
+type BackupPoliciesDeleteFuture struct {
+ azure.FutureAPI
+ // Result returns the result of the asynchronous operation.
+ // If the operation has not completed it will return an error.
+ Result func(BackupPoliciesClient) (autorest.Response, error)
+}
+
+// UnmarshalJSON is the custom unmarshaller for CreateFuture.
+func (future *BackupPoliciesDeleteFuture) UnmarshalJSON(body []byte) error {
+ var azFuture azure.Future
+ if err := json.Unmarshal(body, &azFuture); err != nil {
+ return err
+ }
+ future.FutureAPI = &azFuture
+ future.Result = future.result
+ return nil
+}
+
+// result is the default implementation for BackupPoliciesDeleteFuture.Result.
+func (future *BackupPoliciesDeleteFuture) result(client BackupPoliciesClient) (ar autorest.Response, err error) {
+ var done bool
+ done, err = future.DoneWithContext(context.Background(), client)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "netapp.BackupPoliciesDeleteFuture", "Result", future.Response(), "Polling failure")
+ return
+ }
+ if !done {
+ ar.Response = future.Response()
+ err = azure.NewAsyncOpIncompleteError("netapp.BackupPoliciesDeleteFuture")
+ return
+ }
+ ar.Response = future.Response()
+ return
+}
+
+// BackupPoliciesList list of Backup Policies
+type BackupPoliciesList struct {
+ autorest.Response `json:"-"`
+ // Value - A list of backup policies
+ Value *[]BackupPolicy `json:"value,omitempty"`
+}
+
+// BackupPoliciesUpdateFuture an abstraction for monitoring and retrieving the results of a long-running
+// operation.
+type BackupPoliciesUpdateFuture struct {
+ azure.FutureAPI
+ // Result returns the result of the asynchronous operation.
+ // If the operation has not completed it will return an error.
+ Result func(BackupPoliciesClient) (BackupPolicy, error)
+}
+
+// UnmarshalJSON is the custom unmarshaller for CreateFuture.
+func (future *BackupPoliciesUpdateFuture) UnmarshalJSON(body []byte) error {
+ var azFuture azure.Future
+ if err := json.Unmarshal(body, &azFuture); err != nil {
+ return err
+ }
+ future.FutureAPI = &azFuture
+ future.Result = future.result
+ return nil
+}
+
+// result is the default implementation for BackupPoliciesUpdateFuture.Result.
+func (future *BackupPoliciesUpdateFuture) result(client BackupPoliciesClient) (bp BackupPolicy, err error) {
+ var done bool
+ done, err = future.DoneWithContext(context.Background(), client)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "netapp.BackupPoliciesUpdateFuture", "Result", future.Response(), "Polling failure")
+ return
+ }
+ if !done {
+ bp.Response.Response = future.Response()
+ err = azure.NewAsyncOpIncompleteError("netapp.BackupPoliciesUpdateFuture")
+ return
+ }
+ sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
+ if bp.Response.Response, err = future.GetResult(sender); err == nil && bp.Response.Response.StatusCode != http.StatusNoContent {
+ bp, err = client.UpdateResponder(bp.Response.Response)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "netapp.BackupPoliciesUpdateFuture", "Result", bp.Response.Response, "Failure responding to request")
+ }
+ }
+ return
+}
+
+// BackupPolicy backup policy information
+type BackupPolicy struct {
+ autorest.Response `json:"-"`
+ // Location - Resource location
+ Location *string `json:"location,omitempty"`
+ // ID - READ-ONLY; Resource Id
+ ID *string `json:"id,omitempty"`
+ // Name - READ-ONLY; Resource name
+ Name *string `json:"name,omitempty"`
+ // Etag - READ-ONLY; A unique read-only string that changes whenever the resource is updated.
+ Etag *string `json:"etag,omitempty"`
+ // Type - READ-ONLY; Resource type
+ Type *string `json:"type,omitempty"`
+ // Tags - Resource tags
+ Tags map[string]*string `json:"tags"`
+ // BackupPolicyProperties - Backup policy Properties
+ *BackupPolicyProperties `json:"properties,omitempty"`
+ // SystemData - READ-ONLY; The system meta data relating to this resource.
+ SystemData *SystemData `json:"systemData,omitempty"`
+}
+
+// MarshalJSON is the custom marshaler for BackupPolicy.
+func (bp BackupPolicy) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]interface{})
+ if bp.Location != nil {
+ objectMap["location"] = bp.Location
+ }
+ if bp.Tags != nil {
+ objectMap["tags"] = bp.Tags
+ }
+ if bp.BackupPolicyProperties != nil {
+ objectMap["properties"] = bp.BackupPolicyProperties
+ }
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON is the custom unmarshaler for BackupPolicy struct.
+func (bp *BackupPolicy) UnmarshalJSON(body []byte) error {
+ var m map[string]*json.RawMessage
+ err := json.Unmarshal(body, &m)
+ if err != nil {
+ return err
+ }
+ for k, v := range m {
+ switch k {
+ case "location":
+ if v != nil {
+ var location string
+ err = json.Unmarshal(*v, &location)
+ if err != nil {
+ return err
+ }
+ bp.Location = &location
+ }
+ case "id":
+ if v != nil {
+ var ID string
+ err = json.Unmarshal(*v, &ID)
+ if err != nil {
+ return err
+ }
+ bp.ID = &ID
+ }
+ case "name":
+ if v != nil {
+ var name string
+ err = json.Unmarshal(*v, &name)
+ if err != nil {
+ return err
+ }
+ bp.Name = &name
+ }
+ case "etag":
+ if v != nil {
+ var etag string
+ err = json.Unmarshal(*v, &etag)
+ if err != nil {
+ return err
+ }
+ bp.Etag = &etag
+ }
+ case "type":
+ if v != nil {
+ var typeVar string
+ err = json.Unmarshal(*v, &typeVar)
+ if err != nil {
+ return err
+ }
+ bp.Type = &typeVar
+ }
+ case "tags":
+ if v != nil {
+ var tags map[string]*string
+ err = json.Unmarshal(*v, &tags)
+ if err != nil {
+ return err
+ }
+ bp.Tags = tags
+ }
+ case "properties":
+ if v != nil {
+ var backupPolicyProperties BackupPolicyProperties
+ err = json.Unmarshal(*v, &backupPolicyProperties)
+ if err != nil {
+ return err
+ }
+ bp.BackupPolicyProperties = &backupPolicyProperties
+ }
+ case "systemData":
+ if v != nil {
+ var systemData SystemData
+ err = json.Unmarshal(*v, &systemData)
+ if err != nil {
+ return err
+ }
+ bp.SystemData = &systemData
+ }
+ }
+ }
+
+ return nil
+}
+
+// BackupPolicyDetails backup policy properties
+type BackupPolicyDetails struct {
+ // Location - Resource location
+ Location *string `json:"location,omitempty"`
+ // ID - READ-ONLY; Resource Id
+ ID *string `json:"id,omitempty"`
+ // Name - READ-ONLY; Resource name
+ Name *string `json:"name,omitempty"`
+ // Type - READ-ONLY; Resource type
+ Type *string `json:"type,omitempty"`
+ // Tags - Resource tags
+ Tags map[string]*string `json:"tags"`
+ // BackupPolicyProperties - Backup policy Properties
+ *BackupPolicyProperties `json:"properties,omitempty"`
+}
+
+// MarshalJSON is the custom marshaler for BackupPolicyDetails.
+func (bpd BackupPolicyDetails) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]interface{})
+ if bpd.Location != nil {
+ objectMap["location"] = bpd.Location
+ }
+ if bpd.Tags != nil {
+ objectMap["tags"] = bpd.Tags
+ }
+ if bpd.BackupPolicyProperties != nil {
+ objectMap["properties"] = bpd.BackupPolicyProperties
+ }
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON is the custom unmarshaler for BackupPolicyDetails struct.
+func (bpd *BackupPolicyDetails) UnmarshalJSON(body []byte) error {
+ var m map[string]*json.RawMessage
+ err := json.Unmarshal(body, &m)
+ if err != nil {
+ return err
+ }
+ for k, v := range m {
+ switch k {
+ case "location":
+ if v != nil {
+ var location string
+ err = json.Unmarshal(*v, &location)
+ if err != nil {
+ return err
+ }
+ bpd.Location = &location
+ }
+ case "id":
+ if v != nil {
+ var ID string
+ err = json.Unmarshal(*v, &ID)
+ if err != nil {
+ return err
+ }
+ bpd.ID = &ID
+ }
+ case "name":
+ if v != nil {
+ var name string
+ err = json.Unmarshal(*v, &name)
+ if err != nil {
+ return err
+ }
+ bpd.Name = &name
+ }
+ case "type":
+ if v != nil {
+ var typeVar string
+ err = json.Unmarshal(*v, &typeVar)
+ if err != nil {
+ return err
+ }
+ bpd.Type = &typeVar
+ }
+ case "tags":
+ if v != nil {
+ var tags map[string]*string
+ err = json.Unmarshal(*v, &tags)
+ if err != nil {
+ return err
+ }
+ bpd.Tags = tags
+ }
+ case "properties":
+ if v != nil {
+ var backupPolicyProperties BackupPolicyProperties
+ err = json.Unmarshal(*v, &backupPolicyProperties)
+ if err != nil {
+ return err
+ }
+ bpd.BackupPolicyProperties = &backupPolicyProperties
+ }
+ }
+ }
+
+ return nil
+}
+
+// BackupPolicyPatch backup policy Details for create and update
+type BackupPolicyPatch struct {
+ // Location - Resource location
+ Location *string `json:"location,omitempty"`
+ // ID - READ-ONLY; Resource Id
+ ID *string `json:"id,omitempty"`
+ // Name - READ-ONLY; Resource name
+ Name *string `json:"name,omitempty"`
+ // Type - READ-ONLY; Resource type
+ Type *string `json:"type,omitempty"`
+ // Tags - Resource tags
+ Tags map[string]*string `json:"tags"`
+ // BackupPolicyProperties - Backup policy Properties
+ *BackupPolicyProperties `json:"properties,omitempty"`
+}
+
+// MarshalJSON is the custom marshaler for BackupPolicyPatch.
+func (bpp BackupPolicyPatch) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]interface{})
+ if bpp.Location != nil {
+ objectMap["location"] = bpp.Location
+ }
+ if bpp.Tags != nil {
+ objectMap["tags"] = bpp.Tags
+ }
+ if bpp.BackupPolicyProperties != nil {
+ objectMap["properties"] = bpp.BackupPolicyProperties
+ }
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON is the custom unmarshaler for BackupPolicyPatch struct.
+func (bpp *BackupPolicyPatch) UnmarshalJSON(body []byte) error {
+ var m map[string]*json.RawMessage
+ err := json.Unmarshal(body, &m)
+ if err != nil {
+ return err
+ }
+ for k, v := range m {
+ switch k {
+ case "location":
+ if v != nil {
+ var location string
+ err = json.Unmarshal(*v, &location)
+ if err != nil {
+ return err
+ }
+ bpp.Location = &location
+ }
+ case "id":
+ if v != nil {
+ var ID string
+ err = json.Unmarshal(*v, &ID)
+ if err != nil {
+ return err
+ }
+ bpp.ID = &ID
+ }
+ case "name":
+ if v != nil {
+ var name string
+ err = json.Unmarshal(*v, &name)
+ if err != nil {
+ return err
+ }
+ bpp.Name = &name
+ }
+ case "type":
+ if v != nil {
+ var typeVar string
+ err = json.Unmarshal(*v, &typeVar)
+ if err != nil {
+ return err
+ }
+ bpp.Type = &typeVar
+ }
+ case "tags":
+ if v != nil {
+ var tags map[string]*string
+ err = json.Unmarshal(*v, &tags)
+ if err != nil {
+ return err
+ }
+ bpp.Tags = tags
+ }
+ case "properties":
+ if v != nil {
+ var backupPolicyProperties BackupPolicyProperties
+ err = json.Unmarshal(*v, &backupPolicyProperties)
+ if err != nil {
+ return err
+ }
+ bpp.BackupPolicyProperties = &backupPolicyProperties
+ }
+ }
+ }
+
+ return nil
+}
+
+// BackupPolicyProperties backup policy properties
+type BackupPolicyProperties struct {
+ // BackupPolicyID - READ-ONLY; Backup Policy Resource ID
+ BackupPolicyID *string `json:"backupPolicyId,omitempty"`
+ // ProvisioningState - READ-ONLY; Azure lifecycle management
+ ProvisioningState *string `json:"provisioningState,omitempty"`
+ // DailyBackupsToKeep - Daily backups count to keep
+ DailyBackupsToKeep *int32 `json:"dailyBackupsToKeep,omitempty"`
+ // WeeklyBackupsToKeep - Weekly backups count to keep
+ WeeklyBackupsToKeep *int32 `json:"weeklyBackupsToKeep,omitempty"`
+ // MonthlyBackupsToKeep - Monthly backups count to keep
+ MonthlyBackupsToKeep *int32 `json:"monthlyBackupsToKeep,omitempty"`
+ // VolumesAssigned - READ-ONLY; Volumes using current backup policy
+ VolumesAssigned *int32 `json:"volumesAssigned,omitempty"`
+ // Enabled - The property to decide policy is enabled or not
+ Enabled *bool `json:"enabled,omitempty"`
+ // VolumeBackups - READ-ONLY; A list of volumes assigned to this policy
+ VolumeBackups *[]VolumeBackups `json:"volumeBackups,omitempty"`
+}
+
+// MarshalJSON is the custom marshaler for BackupPolicyProperties.
+func (bpp BackupPolicyProperties) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]interface{})
+ if bpp.DailyBackupsToKeep != nil {
+ objectMap["dailyBackupsToKeep"] = bpp.DailyBackupsToKeep
+ }
+ if bpp.WeeklyBackupsToKeep != nil {
+ objectMap["weeklyBackupsToKeep"] = bpp.WeeklyBackupsToKeep
+ }
+ if bpp.MonthlyBackupsToKeep != nil {
+ objectMap["monthlyBackupsToKeep"] = bpp.MonthlyBackupsToKeep
+ }
+ if bpp.Enabled != nil {
+ objectMap["enabled"] = bpp.Enabled
+ }
+ return json.Marshal(objectMap)
+}
+
+// BackupProperties backup properties
+type BackupProperties struct {
+ // BackupID - READ-ONLY; UUID v4 used to identify the Backup
+ BackupID *string `json:"backupId,omitempty"`
+ // CreationDate - READ-ONLY; The creation date of the backup
+ CreationDate *date.Time `json:"creationDate,omitempty"`
+ // ProvisioningState - READ-ONLY; Azure lifecycle management
+ ProvisioningState *string `json:"provisioningState,omitempty"`
+ // Size - READ-ONLY; Size of backup
+ Size *int64 `json:"size,omitempty"`
+ // Label - Label for backup
+ Label *string `json:"label,omitempty"`
+ // BackupType - READ-ONLY; Type of backup Manual or Scheduled. Possible values include: 'Manual', 'Scheduled'
+ BackupType BackupType `json:"backupType,omitempty"`
+ // FailureReason - READ-ONLY; Failure reason
+ FailureReason *string `json:"failureReason,omitempty"`
+ // VolumeName - READ-ONLY; Volume name
+ VolumeName *string `json:"volumeName,omitempty"`
+ // UseExistingSnapshot - Manual backup an already existing snapshot. This will always be false for scheduled backups and true/false for manual backups
+ UseExistingSnapshot *bool `json:"useExistingSnapshot,omitempty"`
+}
+
+// MarshalJSON is the custom marshaler for BackupProperties.
+func (bp BackupProperties) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]interface{})
+ if bp.Label != nil {
+ objectMap["label"] = bp.Label
+ }
+ if bp.UseExistingSnapshot != nil {
+ objectMap["useExistingSnapshot"] = bp.UseExistingSnapshot
+ }
+ return json.Marshal(objectMap)
+}
+
+// BackupsCreateFuture an abstraction for monitoring and retrieving the results of a long-running
+// operation.
+type BackupsCreateFuture struct {
+ azure.FutureAPI
+ // Result returns the result of the asynchronous operation.
+ // If the operation has not completed it will return an error.
+ Result func(BackupsClient) (Backup, error)
+}
+
+// UnmarshalJSON is the custom unmarshaller for CreateFuture.
+func (future *BackupsCreateFuture) UnmarshalJSON(body []byte) error {
+ var azFuture azure.Future
+ if err := json.Unmarshal(body, &azFuture); err != nil {
+ return err
+ }
+ future.FutureAPI = &azFuture
+ future.Result = future.result
+ return nil
+}
+
+// result is the default implementation for BackupsCreateFuture.Result.
+func (future *BackupsCreateFuture) result(client BackupsClient) (b Backup, err error) {
+ var done bool
+ done, err = future.DoneWithContext(context.Background(), client)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "netapp.BackupsCreateFuture", "Result", future.Response(), "Polling failure")
+ return
+ }
+ if !done {
+ b.Response.Response = future.Response()
+ err = azure.NewAsyncOpIncompleteError("netapp.BackupsCreateFuture")
+ return
+ }
+ sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
+ if b.Response.Response, err = future.GetResult(sender); err == nil && b.Response.Response.StatusCode != http.StatusNoContent {
+ b, err = client.CreateResponder(b.Response.Response)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "netapp.BackupsCreateFuture", "Result", b.Response.Response, "Failure responding to request")
+ }
+ }
+ return
+}
+
+// BackupsDeleteFuture an abstraction for monitoring and retrieving the results of a long-running
+// operation.
+type BackupsDeleteFuture struct {
+ azure.FutureAPI
+ // Result returns the result of the asynchronous operation.
+ // If the operation has not completed it will return an error.
+ Result func(BackupsClient) (autorest.Response, error)
+}
+
+// UnmarshalJSON is the custom unmarshaller for CreateFuture.
+func (future *BackupsDeleteFuture) UnmarshalJSON(body []byte) error {
+ var azFuture azure.Future
+ if err := json.Unmarshal(body, &azFuture); err != nil {
+ return err
+ }
+ future.FutureAPI = &azFuture
+ future.Result = future.result
+ return nil
+}
+
+// result is the default implementation for BackupsDeleteFuture.Result.
+func (future *BackupsDeleteFuture) result(client BackupsClient) (ar autorest.Response, err error) {
+ var done bool
+ done, err = future.DoneWithContext(context.Background(), client)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "netapp.BackupsDeleteFuture", "Result", future.Response(), "Polling failure")
+ return
+ }
+ if !done {
+ ar.Response = future.Response()
+ err = azure.NewAsyncOpIncompleteError("netapp.BackupsDeleteFuture")
+ return
+ }
+ ar.Response = future.Response()
+ return
+}
+
+// BackupsList list of Backups
+type BackupsList struct {
+ autorest.Response `json:"-"`
+ // Value - A list of Backups
+ Value *[]Backup `json:"value,omitempty"`
+}
+
+// BackupStatus backup status
+type BackupStatus struct {
+ autorest.Response `json:"-"`
+ // Healthy - READ-ONLY; Backup health status
+ Healthy *bool `json:"healthy,omitempty"`
+ // RelationshipStatus - READ-ONLY; Status of the backup mirror relationship. Possible values include: 'Idle', 'Transferring'
+ RelationshipStatus RelationshipStatus `json:"relationshipStatus,omitempty"`
+ // MirrorState - READ-ONLY; The status of the backup. Possible values include: 'Uninitialized', 'Mirrored', 'Broken'
+ MirrorState MirrorState `json:"mirrorState,omitempty"`
+ // UnhealthyReason - READ-ONLY; Reason for the unhealthy backup relationship
+ UnhealthyReason *string `json:"unhealthyReason,omitempty"`
+ // ErrorMessage - READ-ONLY; Displays error message if the backup is in an error state
+ ErrorMessage *string `json:"errorMessage,omitempty"`
+ // LastTransferSize - READ-ONLY; Displays the last transfer size
+ LastTransferSize *int64 `json:"lastTransferSize,omitempty"`
+ // LastTransferType - READ-ONLY; Displays the last transfer type
+ LastTransferType *string `json:"lastTransferType,omitempty"`
+ // TotalTransferBytes - READ-ONLY; Displays the total bytes transferred
+ TotalTransferBytes *int64 `json:"totalTransferBytes,omitempty"`
+}
+
+// MarshalJSON is the custom marshaler for BackupStatus.
+func (bs BackupStatus) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]interface{})
+ return json.Marshal(objectMap)
+}
+
+// BackupsUpdateFuture an abstraction for monitoring and retrieving the results of a long-running
+// operation.
+type BackupsUpdateFuture struct {
+ azure.FutureAPI
+ // Result returns the result of the asynchronous operation.
+ // If the operation has not completed it will return an error.
+ Result func(BackupsClient) (Backup, error)
+}
+
+// UnmarshalJSON is the custom unmarshaller for CreateFuture.
+func (future *BackupsUpdateFuture) UnmarshalJSON(body []byte) error {
+ var azFuture azure.Future
+ if err := json.Unmarshal(body, &azFuture); err != nil {
+ return err
+ }
+ future.FutureAPI = &azFuture
+ future.Result = future.result
+ return nil
+}
+
+// result is the default implementation for BackupsUpdateFuture.Result.
+func (future *BackupsUpdateFuture) result(client BackupsClient) (b Backup, err error) {
+ var done bool
+ done, err = future.DoneWithContext(context.Background(), client)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "netapp.BackupsUpdateFuture", "Result", future.Response(), "Polling failure")
+ return
+ }
+ if !done {
+ b.Response.Response = future.Response()
+ err = azure.NewAsyncOpIncompleteError("netapp.BackupsUpdateFuture")
+ return
+ }
+ sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
+ if b.Response.Response, err = future.GetResult(sender); err == nil && b.Response.Response.StatusCode != http.StatusNoContent {
+ b, err = client.UpdateResponder(b.Response.Response)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "netapp.BackupsUpdateFuture", "Result", b.Response.Response, "Failure responding to request")
+ }
+ }
+ return
+}
+
+// BreakReplicationRequest break replication request
+type BreakReplicationRequest struct {
+ // ForceBreakReplication - If replication is in status transferring and you want to force break the replication, set to true
+ ForceBreakReplication *bool `json:"forceBreakReplication,omitempty"`
+}
+
+// CapacityPool capacity pool resource
+type CapacityPool struct {
+ autorest.Response `json:"-"`
+ // Location - Resource location
+ Location *string `json:"location,omitempty"`
+ // ID - READ-ONLY; Resource Id
+ ID *string `json:"id,omitempty"`
+ // Name - READ-ONLY; Resource name
+ Name *string `json:"name,omitempty"`
+ // Etag - READ-ONLY; A unique read-only string that changes whenever the resource is updated.
+ Etag *string `json:"etag,omitempty"`
+ // Type - READ-ONLY; Resource type
+ Type *string `json:"type,omitempty"`
+ // Tags - Resource tags
+ Tags map[string]*string `json:"tags"`
+ // PoolProperties - Capacity pool properties
+ *PoolProperties `json:"properties,omitempty"`
+ // SystemData - READ-ONLY; The system meta data relating to this resource.
+ SystemData *SystemData `json:"systemData,omitempty"`
+}
+
+// MarshalJSON is the custom marshaler for CapacityPool.
+func (cp CapacityPool) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]interface{})
+ if cp.Location != nil {
+ objectMap["location"] = cp.Location
+ }
+ if cp.Tags != nil {
+ objectMap["tags"] = cp.Tags
+ }
+ if cp.PoolProperties != nil {
+ objectMap["properties"] = cp.PoolProperties
+ }
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON is the custom unmarshaler for CapacityPool struct.
+func (cp *CapacityPool) UnmarshalJSON(body []byte) error {
+ var m map[string]*json.RawMessage
+ err := json.Unmarshal(body, &m)
+ if err != nil {
+ return err
+ }
+ for k, v := range m {
+ switch k {
+ case "location":
+ if v != nil {
+ var location string
+ err = json.Unmarshal(*v, &location)
+ if err != nil {
+ return err
+ }
+ cp.Location = &location
+ }
+ case "id":
+ if v != nil {
+ var ID string
+ err = json.Unmarshal(*v, &ID)
+ if err != nil {
+ return err
+ }
+ cp.ID = &ID
+ }
+ case "name":
+ if v != nil {
+ var name string
+ err = json.Unmarshal(*v, &name)
+ if err != nil {
+ return err
+ }
+ cp.Name = &name
+ }
+ case "etag":
+ if v != nil {
+ var etag string
+ err = json.Unmarshal(*v, &etag)
+ if err != nil {
+ return err
+ }
+ cp.Etag = &etag
+ }
+ case "type":
+ if v != nil {
+ var typeVar string
+ err = json.Unmarshal(*v, &typeVar)
+ if err != nil {
+ return err
+ }
+ cp.Type = &typeVar
+ }
+ case "tags":
+ if v != nil {
+ var tags map[string]*string
+ err = json.Unmarshal(*v, &tags)
+ if err != nil {
+ return err
+ }
+ cp.Tags = tags
+ }
+ case "properties":
+ if v != nil {
+ var poolProperties PoolProperties
+ err = json.Unmarshal(*v, &poolProperties)
+ if err != nil {
+ return err
+ }
+ cp.PoolProperties = &poolProperties
+ }
+ case "systemData":
+ if v != nil {
+ var systemData SystemData
+ err = json.Unmarshal(*v, &systemData)
+ if err != nil {
+ return err
+ }
+ cp.SystemData = &systemData
+ }
+ }
+ }
+
+ return nil
+}
+
+// CapacityPoolList list of capacity pool resources
+type CapacityPoolList struct {
+ autorest.Response `json:"-"`
+ // Value - List of Capacity pools
+ Value *[]CapacityPool `json:"value,omitempty"`
+ // NextLink - URL to get the next set of results.
+ NextLink *string `json:"nextLink,omitempty"`
+}
+
+// CapacityPoolListIterator provides access to a complete listing of CapacityPool values.
+type CapacityPoolListIterator struct {
+ i int
+ page CapacityPoolListPage
+}
+
+// NextWithContext advances to the next value. If there was an error making
+// the request the iterator does not advance and the error is returned.
+func (iter *CapacityPoolListIterator) NextWithContext(ctx context.Context) (err error) {
+ if tracing.IsEnabled() {
+ ctx = tracing.StartSpan(ctx, fqdn+"/CapacityPoolListIterator.NextWithContext")
+ defer func() {
+ sc := -1
+ if iter.Response().Response.Response != nil {
+ sc = iter.Response().Response.Response.StatusCode
+ }
+ tracing.EndSpan(ctx, sc, err)
+ }()
+ }
+ iter.i++
+ if iter.i < len(iter.page.Values()) {
+ return nil
+ }
+ err = iter.page.NextWithContext(ctx)
+ if err != nil {
+ iter.i--
+ return err
+ }
+ iter.i = 0
+ return nil
+}
+
+// Next advances to the next value. If there was an error making
+// the request the iterator does not advance and the error is returned.
+// Deprecated: Use NextWithContext() instead.
+func (iter *CapacityPoolListIterator) Next() error {
+ return iter.NextWithContext(context.Background())
+}
+
+// NotDone returns true if the enumeration should be started or is not yet complete.
+func (iter CapacityPoolListIterator) NotDone() bool {
+ return iter.page.NotDone() && iter.i < len(iter.page.Values())
+}
+
+// Response returns the raw server response from the last page request.
+func (iter CapacityPoolListIterator) Response() CapacityPoolList {
+ return iter.page.Response()
+}
+
+// Value returns the current value or a zero-initialized value if the
+// iterator has advanced beyond the end of the collection.
+func (iter CapacityPoolListIterator) Value() CapacityPool {
+ if !iter.page.NotDone() {
+ return CapacityPool{}
+ }
+ return iter.page.Values()[iter.i]
+}
+
+// Creates a new instance of the CapacityPoolListIterator type.
+func NewCapacityPoolListIterator(page CapacityPoolListPage) CapacityPoolListIterator {
+ return CapacityPoolListIterator{page: page}
+}
+
+// IsEmpty returns true if the ListResult contains no values.
+func (cpl CapacityPoolList) IsEmpty() bool {
+ return cpl.Value == nil || len(*cpl.Value) == 0
+}
+
+// hasNextLink returns true if the NextLink is not empty.
+func (cpl CapacityPoolList) hasNextLink() bool {
+ return cpl.NextLink != nil && len(*cpl.NextLink) != 0
+}
+
+// capacityPoolListPreparer prepares a request to retrieve the next set of results.
+// It returns nil if no more results exist.
+func (cpl CapacityPoolList) capacityPoolListPreparer(ctx context.Context) (*http.Request, error) {
+ if !cpl.hasNextLink() {
+ return nil, nil
+ }
+ return autorest.Prepare((&http.Request{}).WithContext(ctx),
+ autorest.AsJSON(),
+ autorest.AsGet(),
+ autorest.WithBaseURL(to.String(cpl.NextLink)))
+}
+
+// CapacityPoolListPage contains a page of CapacityPool values.
+type CapacityPoolListPage struct {
+ fn func(context.Context, CapacityPoolList) (CapacityPoolList, error)
+ cpl CapacityPoolList
+}
+
+// NextWithContext advances to the next page of values. If there was an error making
+// the request the page does not advance and the error is returned.
+func (page *CapacityPoolListPage) NextWithContext(ctx context.Context) (err error) {
+ if tracing.IsEnabled() {
+ ctx = tracing.StartSpan(ctx, fqdn+"/CapacityPoolListPage.NextWithContext")
+ defer func() {
+ sc := -1
+ if page.Response().Response.Response != nil {
+ sc = page.Response().Response.Response.StatusCode
+ }
+ tracing.EndSpan(ctx, sc, err)
+ }()
+ }
+ for {
+ next, err := page.fn(ctx, page.cpl)
+ if err != nil {
+ return err
+ }
+ page.cpl = next
+ if !next.hasNextLink() || !next.IsEmpty() {
+ break
+ }
+ }
+ return nil
+}
+
+// Next advances to the next page of values. If there was an error making
+// the request the page does not advance and the error is returned.
+// Deprecated: Use NextWithContext() instead.
+func (page *CapacityPoolListPage) Next() error {
+ return page.NextWithContext(context.Background())
+}
+
+// NotDone returns true if the page enumeration should be started or is not yet complete.
+func (page CapacityPoolListPage) NotDone() bool {
+ return !page.cpl.IsEmpty()
+}
+
+// Response returns the raw server response from the last page request.
+func (page CapacityPoolListPage) Response() CapacityPoolList {
+ return page.cpl
+}
+
+// Values returns the slice of values for the current page or nil if there are no values.
+func (page CapacityPoolListPage) Values() []CapacityPool {
+ if page.cpl.IsEmpty() {
+ return nil
+ }
+ return *page.cpl.Value
+}
+
+// Creates a new instance of the CapacityPoolListPage type.
+func NewCapacityPoolListPage(cur CapacityPoolList, getNextPage func(context.Context, CapacityPoolList) (CapacityPoolList, error)) CapacityPoolListPage {
+ return CapacityPoolListPage{
+ fn: getNextPage,
+ cpl: cur,
+ }
+}
+
+// CapacityPoolPatch capacity pool patch resource
+type CapacityPoolPatch struct {
+ // Location - Resource location
+ Location *string `json:"location,omitempty"`
+ // ID - READ-ONLY; Resource Id
+ ID *string `json:"id,omitempty"`
+ // Name - READ-ONLY; Resource name
+ Name *string `json:"name,omitempty"`
+ // Type - READ-ONLY; Resource type
+ Type *string `json:"type,omitempty"`
+ // Tags - Resource tags
+ Tags map[string]*string `json:"tags"`
+ // PoolPatchProperties - Capacity pool properties
+ *PoolPatchProperties `json:"properties,omitempty"`
+}
+
+// MarshalJSON is the custom marshaler for CapacityPoolPatch.
+func (cpp CapacityPoolPatch) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]interface{})
+ if cpp.Location != nil {
+ objectMap["location"] = cpp.Location
+ }
+ if cpp.Tags != nil {
+ objectMap["tags"] = cpp.Tags
+ }
+ if cpp.PoolPatchProperties != nil {
+ objectMap["properties"] = cpp.PoolPatchProperties
+ }
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON is the custom unmarshaler for CapacityPoolPatch struct.
+func (cpp *CapacityPoolPatch) UnmarshalJSON(body []byte) error {
+ var m map[string]*json.RawMessage
+ err := json.Unmarshal(body, &m)
+ if err != nil {
+ return err
+ }
+ for k, v := range m {
+ switch k {
+ case "location":
+ if v != nil {
+ var location string
+ err = json.Unmarshal(*v, &location)
+ if err != nil {
+ return err
+ }
+ cpp.Location = &location
+ }
+ case "id":
+ if v != nil {
+ var ID string
+ err = json.Unmarshal(*v, &ID)
+ if err != nil {
+ return err
+ }
+ cpp.ID = &ID
+ }
+ case "name":
+ if v != nil {
+ var name string
+ err = json.Unmarshal(*v, &name)
+ if err != nil {
+ return err
+ }
+ cpp.Name = &name
+ }
+ case "type":
+ if v != nil {
+ var typeVar string
+ err = json.Unmarshal(*v, &typeVar)
+ if err != nil {
+ return err
+ }
+ cpp.Type = &typeVar
+ }
+ case "tags":
+ if v != nil {
+ var tags map[string]*string
+ err = json.Unmarshal(*v, &tags)
+ if err != nil {
+ return err
+ }
+ cpp.Tags = tags
+ }
+ case "properties":
+ if v != nil {
+ var poolPatchProperties PoolPatchProperties
+ err = json.Unmarshal(*v, &poolPatchProperties)
+ if err != nil {
+ return err
+ }
+ cpp.PoolPatchProperties = &poolPatchProperties
+ }
+ }
+ }
+
+ return nil
+}
+
+// CheckAvailabilityResponse information regarding availability of a resource.
+type CheckAvailabilityResponse struct {
+ autorest.Response `json:"-"`
+ // IsAvailable - true
indicates name is valid and available. false
indicates the name is invalid, unavailable, or both.
+ IsAvailable *bool `json:"isAvailable,omitempty"`
+ // Reason - Invalid
indicates the name provided does not match Azure App Service naming requirements. AlreadyExists
indicates that the name is already in use and is therefore unavailable. Possible values include: 'Invalid', 'AlreadyExists'
+ Reason InAvailabilityReasonType `json:"reason,omitempty"`
+ // Message - If reason == invalid, provide the user with the reason why the given name is invalid, and provide the resource naming requirements so that the user can select a valid name. If reason == AlreadyExists, explain that resource name is already in use, and direct them to select a different name.
+ Message *string `json:"message,omitempty"`
+}
+
+// CloudError an error response from the service.
+type CloudError struct {
+ // Error - Cloud error body.
+ Error *CloudErrorBody `json:"error,omitempty"`
+}
+
+// CloudErrorBody an error response from the service.
+type CloudErrorBody struct {
+ // Code - An identifier for the error. Codes are invariant and are intended to be consumed programmatically.
+ Code *string `json:"code,omitempty"`
+ // Message - A message describing the error, intended to be suitable for display in a user interface.
+ Message *string `json:"message,omitempty"`
+}
+
+// DailySchedule daily Schedule properties
+type DailySchedule struct {
+ // SnapshotsToKeep - Daily snapshot count to keep
+ SnapshotsToKeep *int32 `json:"snapshotsToKeep,omitempty"`
+ // Hour - Indicates which hour in UTC timezone a snapshot should be taken
+ Hour *int32 `json:"hour,omitempty"`
+ // Minute - Indicates which minute snapshot should be taken
+ Minute *int32 `json:"minute,omitempty"`
+ // UsedBytes - Resource size in bytes, current storage usage for the volume in bytes
+ UsedBytes *int64 `json:"usedBytes,omitempty"`
+}
+
+// Dimension dimension of blobs, possibly be blob type or access tier.
+type Dimension struct {
+ // Name - Display name of dimension.
+ Name *string `json:"name,omitempty"`
+ // DisplayName - Display name of dimension.
+ DisplayName *string `json:"displayName,omitempty"`
+}
+
+// ExportPolicyRule volume Export Policy Rule
+type ExportPolicyRule struct {
+ // RuleIndex - Order index
+ RuleIndex *int32 `json:"ruleIndex,omitempty"`
+ // UnixReadOnly - Read only access
+ UnixReadOnly *bool `json:"unixReadOnly,omitempty"`
+ // UnixReadWrite - Read and write access
+ UnixReadWrite *bool `json:"unixReadWrite,omitempty"`
+ // Kerberos5ReadOnly - Kerberos5 Read only access. To be use with swagger version 2020-05-01 or later
+ Kerberos5ReadOnly *bool `json:"kerberos5ReadOnly,omitempty"`
+ // Kerberos5ReadWrite - Kerberos5 Read and write access. To be use with swagger version 2020-05-01 or later
+ Kerberos5ReadWrite *bool `json:"kerberos5ReadWrite,omitempty"`
+ // Kerberos5iReadOnly - Kerberos5i Read only access. To be use with swagger version 2020-05-01 or later
+ Kerberos5iReadOnly *bool `json:"kerberos5iReadOnly,omitempty"`
+ // Kerberos5iReadWrite - Kerberos5i Read and write access. To be use with swagger version 2020-05-01 or later
+ Kerberos5iReadWrite *bool `json:"kerberos5iReadWrite,omitempty"`
+ // Kerberos5pReadOnly - Kerberos5p Read only access. To be use with swagger version 2020-05-01 or later
+ Kerberos5pReadOnly *bool `json:"kerberos5pReadOnly,omitempty"`
+ // Kerberos5pReadWrite - Kerberos5p Read and write access. To be use with swagger version 2020-05-01 or later
+ Kerberos5pReadWrite *bool `json:"kerberos5pReadWrite,omitempty"`
+ // Cifs - Allows CIFS protocol
+ Cifs *bool `json:"cifs,omitempty"`
+ // Nfsv3 - Allows NFSv3 protocol. Enable only for NFSv3 type volumes
+ Nfsv3 *bool `json:"nfsv3,omitempty"`
+ // Nfsv41 - Allows NFSv4.1 protocol. Enable only for NFSv4.1 type volumes
+ Nfsv41 *bool `json:"nfsv41,omitempty"`
+ // AllowedClients - Client ingress specification as comma separated string with IPv4 CIDRs, IPv4 host addresses and host names
+ AllowedClients *string `json:"allowedClients,omitempty"`
+ // HasRootAccess - Has root access to volume
+ HasRootAccess *bool `json:"hasRootAccess,omitempty"`
+ // ChownMode - This parameter specifies who is authorized to change the ownership of a file. restricted - Only root user can change the ownership of the file. unrestricted - Non-root users can change ownership of files that they own. Possible values include: 'Restricted', 'Unrestricted'
+ ChownMode ChownMode `json:"chownMode,omitempty"`
+}
+
+// FilePathAvailabilityRequest file path availability request content - availability is based on the name
+// and the subnetId.
+type FilePathAvailabilityRequest struct {
+ // Name - File path to verify.
+ Name *string `json:"name,omitempty"`
+ // SubnetID - The Azure Resource URI for a delegated subnet. Must have the delegation Microsoft.NetApp/volumes
+ SubnetID *string `json:"subnetId,omitempty"`
+}
+
+// HourlySchedule hourly Schedule properties
+type HourlySchedule struct {
+ // SnapshotsToKeep - Hourly snapshot count to keep
+ SnapshotsToKeep *int32 `json:"snapshotsToKeep,omitempty"`
+ // Minute - Indicates which minute snapshot should be taken
+ Minute *int32 `json:"minute,omitempty"`
+ // UsedBytes - Resource size in bytes, current storage usage for the volume in bytes
+ UsedBytes *int64 `json:"usedBytes,omitempty"`
+}
+
+// LdapSearchScopeOpt LDAP search scope
+type LdapSearchScopeOpt struct {
+ // UserDN - This specifies the user DN, which overrides the base DN for user lookups.
+ UserDN *string `json:"userDN,omitempty"`
+ // GroupDN - This specifies the group DN, which overrides the base DN for group lookups.
+ GroupDN *string `json:"groupDN,omitempty"`
+ // GroupMembershipFilter - This specifies the custom LDAP search filter to be used when looking up group membership from LDAP server.
+ GroupMembershipFilter *string `json:"groupMembershipFilter,omitempty"`
+}
+
+// LogSpecification log Definition of a single resource metric.
+type LogSpecification struct {
+ // Name - Name of log specification.
+ Name *string `json:"name,omitempty"`
+ // DisplayName - Display name of log specification.
+ DisplayName *string `json:"displayName,omitempty"`
+}
+
+// MetricSpecification metric specification of operation.
+type MetricSpecification struct {
+ // Name - Name of metric specification.
+ Name *string `json:"name,omitempty"`
+ // DisplayName - Display name of metric specification.
+ DisplayName *string `json:"displayName,omitempty"`
+ // DisplayDescription - Display description of metric specification.
+ DisplayDescription *string `json:"displayDescription,omitempty"`
+ // Unit - Unit could be Bytes or Count.
+ Unit *string `json:"unit,omitempty"`
+ // SupportedAggregationTypes - Support metric aggregation type.
+ SupportedAggregationTypes *[]MetricAggregationType `json:"supportedAggregationTypes,omitempty"`
+ // SupportedTimeGrainTypes - The supported time grain types for the metrics.
+ SupportedTimeGrainTypes *[]string `json:"supportedTimeGrainTypes,omitempty"`
+ // InternalMetricName - The internal metric name.
+ InternalMetricName *string `json:"internalMetricName,omitempty"`
+ // EnableRegionalMdmAccount - Whether or not the service is using regional MDM accounts.
+ EnableRegionalMdmAccount *bool `json:"enableRegionalMdmAccount,omitempty"`
+ // SourceMdmAccount - The source MDM account.
+ SourceMdmAccount *string `json:"sourceMdmAccount,omitempty"`
+ // SourceMdmNamespace - The source MDM namespace.
+ SourceMdmNamespace *string `json:"sourceMdmNamespace,omitempty"`
+ // Dimensions - Dimensions of blobs, including blob type and access tier.
+ Dimensions *[]Dimension `json:"dimensions,omitempty"`
+ // AggregationType - Aggregation type could be Average.
+ AggregationType *string `json:"aggregationType,omitempty"`
+ // FillGapWithZero - The property to decide fill gap with zero or not.
+ FillGapWithZero *bool `json:"fillGapWithZero,omitempty"`
+ // Category - The category this metric specification belong to, could be Capacity.
+ Category *string `json:"category,omitempty"`
+ // ResourceIDDimensionNameOverride - Account Resource Id.
+ ResourceIDDimensionNameOverride *string `json:"resourceIdDimensionNameOverride,omitempty"`
+ // IsInternal - Whether the metric is internal.
+ IsInternal *bool `json:"isInternal,omitempty"`
+}
+
+// MonthlySchedule monthly Schedule properties
+type MonthlySchedule struct {
+ // SnapshotsToKeep - Monthly snapshot count to keep
+ SnapshotsToKeep *int32 `json:"snapshotsToKeep,omitempty"`
+ // DaysOfMonth - Indicates which days of the month snapshot should be taken. A comma delimited string.
+ DaysOfMonth *string `json:"daysOfMonth,omitempty"`
+ // Hour - Indicates which hour in UTC timezone a snapshot should be taken
+ Hour *int32 `json:"hour,omitempty"`
+ // Minute - Indicates which minute snapshot should be taken
+ Minute *int32 `json:"minute,omitempty"`
+ // UsedBytes - Resource size in bytes, current storage usage for the volume in bytes
+ UsedBytes *int64 `json:"usedBytes,omitempty"`
+}
+
+// MountTarget mount Target
+type MountTarget struct {
+ // Location - Resource location
+ Location *string `json:"location,omitempty"`
+ // ID - READ-ONLY; Resource Id
+ ID *string `json:"id,omitempty"`
+ // Name - READ-ONLY; Resource name
+ Name *string `json:"name,omitempty"`
+ // Type - READ-ONLY; Resource type
+ Type *string `json:"type,omitempty"`
+ // Tags - Resource tags
+ Tags map[string]*string `json:"tags"`
+ // MountTargetProperties - Mount Target Properties
+ *MountTargetProperties `json:"properties,omitempty"`
+}
+
+// MarshalJSON is the custom marshaler for MountTarget.
+func (mt MountTarget) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]interface{})
+ if mt.Location != nil {
+ objectMap["location"] = mt.Location
+ }
+ if mt.Tags != nil {
+ objectMap["tags"] = mt.Tags
+ }
+ if mt.MountTargetProperties != nil {
+ objectMap["properties"] = mt.MountTargetProperties
+ }
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON is the custom unmarshaler for MountTarget struct.
+func (mt *MountTarget) UnmarshalJSON(body []byte) error {
+ var m map[string]*json.RawMessage
+ err := json.Unmarshal(body, &m)
+ if err != nil {
+ return err
+ }
+ for k, v := range m {
+ switch k {
+ case "location":
+ if v != nil {
+ var location string
+ err = json.Unmarshal(*v, &location)
+ if err != nil {
+ return err
+ }
+ mt.Location = &location
+ }
+ case "id":
+ if v != nil {
+ var ID string
+ err = json.Unmarshal(*v, &ID)
+ if err != nil {
+ return err
+ }
+ mt.ID = &ID
+ }
+ case "name":
+ if v != nil {
+ var name string
+ err = json.Unmarshal(*v, &name)
+ if err != nil {
+ return err
+ }
+ mt.Name = &name
+ }
+ case "type":
+ if v != nil {
+ var typeVar string
+ err = json.Unmarshal(*v, &typeVar)
+ if err != nil {
+ return err
+ }
+ mt.Type = &typeVar
+ }
+ case "tags":
+ if v != nil {
+ var tags map[string]*string
+ err = json.Unmarshal(*v, &tags)
+ if err != nil {
+ return err
+ }
+ mt.Tags = tags
+ }
+ case "properties":
+ if v != nil {
+ var mountTargetProperties MountTargetProperties
+ err = json.Unmarshal(*v, &mountTargetProperties)
+ if err != nil {
+ return err
+ }
+ mt.MountTargetProperties = &mountTargetProperties
+ }
+ }
+ }
+
+ return nil
+}
+
+// MountTargetProperties mount target properties
+type MountTargetProperties struct {
+ // MountTargetID - READ-ONLY; UUID v4 used to identify the MountTarget
+ MountTargetID *string `json:"mountTargetId,omitempty"`
+ // FileSystemID - UUID v4 used to identify the MountTarget
+ FileSystemID *string `json:"fileSystemId,omitempty"`
+ // IPAddress - READ-ONLY; The mount target's IPv4 address
+ IPAddress *string `json:"ipAddress,omitempty"`
+ // SmbServerFqdn - The SMB server's Fully Qualified Domain Name, FQDN
+ SmbServerFqdn *string `json:"smbServerFqdn,omitempty"`
+}
+
+// MarshalJSON is the custom marshaler for MountTargetProperties.
+func (mtp MountTargetProperties) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]interface{})
+ if mtp.FileSystemID != nil {
+ objectMap["fileSystemId"] = mtp.FileSystemID
+ }
+ if mtp.SmbServerFqdn != nil {
+ objectMap["smbServerFqdn"] = mtp.SmbServerFqdn
+ }
+ return json.Marshal(objectMap)
+}
+
+// Operation microsoft.NetApp REST API operation definition.
+type Operation struct {
+ // Name - Operation name: {provider}/{resource}/{operation}
+ Name *string `json:"name,omitempty"`
+ // Display - Display metadata associated with the operation.
+ Display *OperationDisplay `json:"display,omitempty"`
+ // Origin - The origin of operations.
+ Origin *string `json:"origin,omitempty"`
+ // OperationProperties - Properties of operation, include metric specifications.
+ *OperationProperties `json:"properties,omitempty"`
+}
+
+// MarshalJSON is the custom marshaler for Operation.
+func (o Operation) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]interface{})
+ if o.Name != nil {
+ objectMap["name"] = o.Name
+ }
+ if o.Display != nil {
+ objectMap["display"] = o.Display
+ }
+ if o.Origin != nil {
+ objectMap["origin"] = o.Origin
+ }
+ if o.OperationProperties != nil {
+ objectMap["properties"] = o.OperationProperties
+ }
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON is the custom unmarshaler for Operation struct.
+func (o *Operation) UnmarshalJSON(body []byte) error {
+ var m map[string]*json.RawMessage
+ err := json.Unmarshal(body, &m)
+ if err != nil {
+ return err
+ }
+ for k, v := range m {
+ switch k {
+ case "name":
+ if v != nil {
+ var name string
+ err = json.Unmarshal(*v, &name)
+ if err != nil {
+ return err
+ }
+ o.Name = &name
+ }
+ case "display":
+ if v != nil {
+ var display OperationDisplay
+ err = json.Unmarshal(*v, &display)
+ if err != nil {
+ return err
+ }
+ o.Display = &display
+ }
+ case "origin":
+ if v != nil {
+ var origin string
+ err = json.Unmarshal(*v, &origin)
+ if err != nil {
+ return err
+ }
+ o.Origin = &origin
+ }
+ case "properties":
+ if v != nil {
+ var operationProperties OperationProperties
+ err = json.Unmarshal(*v, &operationProperties)
+ if err != nil {
+ return err
+ }
+ o.OperationProperties = &operationProperties
+ }
+ }
+ }
+
+ return nil
+}
+
+// OperationDisplay display metadata associated with the operation.
+type OperationDisplay struct {
+ // Provider - Service provider: Microsoft NetApp.
+ Provider *string `json:"provider,omitempty"`
+ // Resource - Resource on which the operation is performed etc.
+ Resource *string `json:"resource,omitempty"`
+ // Operation - Type of operation: get, read, delete, etc.
+ Operation *string `json:"operation,omitempty"`
+ // Description - Operation description.
+ Description *string `json:"description,omitempty"`
+}
+
+// OperationListResult result of the request to list Cloud Volume operations. It contains a list of
+// operations and a URL link to get the next set of results.
+type OperationListResult struct {
+ autorest.Response `json:"-"`
+ // Value - List of Storage operations supported by the Storage resource provider.
+ Value *[]Operation `json:"value,omitempty"`
+}
+
+// OperationProperties properties of operation, include metric specifications.
+type OperationProperties struct {
+ // ServiceSpecification - One property of operation, include metric specifications.
+ ServiceSpecification *ServiceSpecification `json:"serviceSpecification,omitempty"`
+}
+
+// PlacementKeyValuePairs application specific parameters for the placement of volumes in the volume group
+type PlacementKeyValuePairs struct {
+ // Key - Key for an application specific parameter for the placement of volumes in the volume group
+ Key *string `json:"key,omitempty"`
+ // Value - Value for an application specific parameter for the placement of volumes in the volume group
+ Value *string `json:"value,omitempty"`
+}
+
+// PoolChangeRequest pool change request
+type PoolChangeRequest struct {
+ // NewPoolResourceID - Resource id of the pool to move volume to
+ NewPoolResourceID *string `json:"newPoolResourceId,omitempty"`
+}
+
+// PoolPatchProperties patchable pool properties
+type PoolPatchProperties struct {
+ // Size - Provisioned size of the pool (in bytes). Allowed values are in 1TiB chunks (value must be multiply of 4398046511104).
+ Size *int64 `json:"size,omitempty"`
+ // QosType - The qos type of the pool. Possible values include: 'QosTypeAuto', 'QosTypeManual'
+ QosType QosType `json:"qosType,omitempty"`
+}
+
+// PoolProperties pool properties
+type PoolProperties struct {
+ // PoolID - READ-ONLY; UUID v4 used to identify the Pool
+ PoolID *string `json:"poolId,omitempty"`
+ // Size - Provisioned size of the pool (in bytes). Allowed values are in 1TiB chunks (value must be multiply of 4398046511104).
+ Size *int64 `json:"size,omitempty"`
+ // ServiceLevel - Possible values include: 'ServiceLevelStandard', 'ServiceLevelPremium', 'ServiceLevelUltra', 'ServiceLevelStandardZRS'
+ ServiceLevel ServiceLevel `json:"serviceLevel,omitempty"`
+ // ProvisioningState - READ-ONLY; Azure lifecycle management
+ ProvisioningState *string `json:"provisioningState,omitempty"`
+ // TotalThroughputMibps - READ-ONLY; Total throughput of pool in Mibps
+ TotalThroughputMibps *float64 `json:"totalThroughputMibps,omitempty"`
+ // UtilizedThroughputMibps - READ-ONLY; Utilized throughput of pool in Mibps
+ UtilizedThroughputMibps *float64 `json:"utilizedThroughputMibps,omitempty"`
+ // QosType - The qos type of the pool. Possible values include: 'QosTypeAuto', 'QosTypeManual'
+ QosType QosType `json:"qosType,omitempty"`
+ // CoolAccess - If enabled (true) the pool can contain cool Access enabled volumes.
+ CoolAccess *bool `json:"coolAccess,omitempty"`
+ // EncryptionType - Encryption type of the capacity pool, set encryption type for data at rest for this pool and all volumes in it. This value can only be set when creating new pool. Possible values include: 'Single', 'Double'
+ EncryptionType EncryptionType `json:"encryptionType,omitempty"`
+}
+
+// MarshalJSON is the custom marshaler for PoolProperties.
+func (pp PoolProperties) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]interface{})
+ if pp.Size != nil {
+ objectMap["size"] = pp.Size
+ }
+ if pp.ServiceLevel != "" {
+ objectMap["serviceLevel"] = pp.ServiceLevel
+ }
+ if pp.QosType != "" {
+ objectMap["qosType"] = pp.QosType
+ }
+ if pp.CoolAccess != nil {
+ objectMap["coolAccess"] = pp.CoolAccess
+ }
+ if pp.EncryptionType != "" {
+ objectMap["encryptionType"] = pp.EncryptionType
+ }
+ return json.Marshal(objectMap)
+}
+
+// PoolsCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a long-running
+// operation.
+type PoolsCreateOrUpdateFuture struct {
+ azure.FutureAPI
+ // Result returns the result of the asynchronous operation.
+ // If the operation has not completed it will return an error.
+ Result func(PoolsClient) (CapacityPool, error)
+}
+
+// UnmarshalJSON is the custom unmarshaller for CreateFuture.
+func (future *PoolsCreateOrUpdateFuture) UnmarshalJSON(body []byte) error {
+ var azFuture azure.Future
+ if err := json.Unmarshal(body, &azFuture); err != nil {
+ return err
+ }
+ future.FutureAPI = &azFuture
+ future.Result = future.result
+ return nil
+}
+
+// result is the default implementation for PoolsCreateOrUpdateFuture.Result.
+func (future *PoolsCreateOrUpdateFuture) result(client PoolsClient) (cp CapacityPool, err error) {
+ var done bool
+ done, err = future.DoneWithContext(context.Background(), client)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "netapp.PoolsCreateOrUpdateFuture", "Result", future.Response(), "Polling failure")
+ return
+ }
+ if !done {
+ cp.Response.Response = future.Response()
+ err = azure.NewAsyncOpIncompleteError("netapp.PoolsCreateOrUpdateFuture")
+ return
+ }
+ sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
+ if cp.Response.Response, err = future.GetResult(sender); err == nil && cp.Response.Response.StatusCode != http.StatusNoContent {
+ cp, err = client.CreateOrUpdateResponder(cp.Response.Response)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "netapp.PoolsCreateOrUpdateFuture", "Result", cp.Response.Response, "Failure responding to request")
+ }
+ }
+ return
+}
+
+// PoolsDeleteFuture an abstraction for monitoring and retrieving the results of a long-running operation.
+type PoolsDeleteFuture struct {
+ azure.FutureAPI
+ // Result returns the result of the asynchronous operation.
+ // If the operation has not completed it will return an error.
+ Result func(PoolsClient) (autorest.Response, error)
+}
+
+// UnmarshalJSON is the custom unmarshaller for CreateFuture.
+func (future *PoolsDeleteFuture) UnmarshalJSON(body []byte) error {
+ var azFuture azure.Future
+ if err := json.Unmarshal(body, &azFuture); err != nil {
+ return err
+ }
+ future.FutureAPI = &azFuture
+ future.Result = future.result
+ return nil
+}
+
+// result is the default implementation for PoolsDeleteFuture.Result.
+func (future *PoolsDeleteFuture) result(client PoolsClient) (ar autorest.Response, err error) {
+ var done bool
+ done, err = future.DoneWithContext(context.Background(), client)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "netapp.PoolsDeleteFuture", "Result", future.Response(), "Polling failure")
+ return
+ }
+ if !done {
+ ar.Response = future.Response()
+ err = azure.NewAsyncOpIncompleteError("netapp.PoolsDeleteFuture")
+ return
+ }
+ ar.Response = future.Response()
+ return
+}
+
+// PoolsUpdateFuture an abstraction for monitoring and retrieving the results of a long-running operation.
+type PoolsUpdateFuture struct {
+ azure.FutureAPI
+ // Result returns the result of the asynchronous operation.
+ // If the operation has not completed it will return an error.
+ Result func(PoolsClient) (CapacityPool, error)
+}
+
+// UnmarshalJSON is the custom unmarshaller for CreateFuture.
+func (future *PoolsUpdateFuture) UnmarshalJSON(body []byte) error {
+ var azFuture azure.Future
+ if err := json.Unmarshal(body, &azFuture); err != nil {
+ return err
+ }
+ future.FutureAPI = &azFuture
+ future.Result = future.result
+ return nil
+}
+
+// result is the default implementation for PoolsUpdateFuture.Result.
+func (future *PoolsUpdateFuture) result(client PoolsClient) (cp CapacityPool, err error) {
+ var done bool
+ done, err = future.DoneWithContext(context.Background(), client)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "netapp.PoolsUpdateFuture", "Result", future.Response(), "Polling failure")
+ return
+ }
+ if !done {
+ cp.Response.Response = future.Response()
+ err = azure.NewAsyncOpIncompleteError("netapp.PoolsUpdateFuture")
+ return
+ }
+ sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
+ if cp.Response.Response, err = future.GetResult(sender); err == nil && cp.Response.Response.StatusCode != http.StatusNoContent {
+ cp, err = client.UpdateResponder(cp.Response.Response)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "netapp.PoolsUpdateFuture", "Result", cp.Response.Response, "Failure responding to request")
+ }
+ }
+ return
+}
+
+// ProxyResource the resource model definition for a Azure Resource Manager proxy resource. It will not
+// have tags and a location
+type ProxyResource struct {
+ // ID - READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}
+ ID *string `json:"id,omitempty"`
+ // Name - READ-ONLY; The name of the resource
+ Name *string `json:"name,omitempty"`
+ // Type - READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts"
+ Type *string `json:"type,omitempty"`
+}
+
+// MarshalJSON is the custom marshaler for ProxyResource.
+func (pr ProxyResource) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]interface{})
+ return json.Marshal(objectMap)
+}
+
+// QuotaAvailabilityRequest quota availability request content.
+type QuotaAvailabilityRequest struct {
+ // Name - Name of the resource to verify.
+ Name *string `json:"name,omitempty"`
+ // Type - Resource type used for verification. Possible values include: 'CheckQuotaNameResourceTypesMicrosoftNetAppnetAppAccounts', 'CheckQuotaNameResourceTypesMicrosoftNetAppnetAppAccountscapacityPools', 'CheckQuotaNameResourceTypesMicrosoftNetAppnetAppAccountscapacityPoolsvolumes', 'CheckQuotaNameResourceTypesMicrosoftNetAppnetAppAccountscapacityPoolsvolumessnapshots'
+ Type CheckQuotaNameResourceTypes `json:"type,omitempty"`
+ // ResourceGroup - Resource group name.
+ ResourceGroup *string `json:"resourceGroup,omitempty"`
+}
+
+// ReplicationObject replication properties
+type ReplicationObject struct {
+ // ReplicationID - Id
+ ReplicationID *string `json:"replicationId,omitempty"`
+ // EndpointType - Indicates whether the local volume is the source or destination for the Volume Replication. Possible values include: 'Src', 'Dst'
+ EndpointType EndpointType `json:"endpointType,omitempty"`
+ // ReplicationSchedule - Schedule. Possible values include: '10minutely', 'Hourly', 'Daily'
+ ReplicationSchedule ReplicationSchedule `json:"replicationSchedule,omitempty"`
+ // RemoteVolumeResourceID - The resource ID of the remote volume.
+ RemoteVolumeResourceID *string `json:"remoteVolumeResourceId,omitempty"`
+ // RemoteVolumeRegion - The remote region for the other end of the Volume Replication.
+ RemoteVolumeRegion *string `json:"remoteVolumeRegion,omitempty"`
+}
+
+// ReplicationStatus replication status
+type ReplicationStatus struct {
+ autorest.Response `json:"-"`
+ // Healthy - Replication health check
+ Healthy *bool `json:"healthy,omitempty"`
+ // RelationshipStatus - Status of the mirror relationship. Possible values include: 'Idle', 'Transferring'
+ RelationshipStatus RelationshipStatus `json:"relationshipStatus,omitempty"`
+ // MirrorState - The status of the replication. Possible values include: 'Uninitialized', 'Mirrored', 'Broken'
+ MirrorState MirrorState `json:"mirrorState,omitempty"`
+ // TotalProgress - The progress of the replication
+ TotalProgress *string `json:"totalProgress,omitempty"`
+ // ErrorMessage - Displays error message if the replication is in an error state
+ ErrorMessage *string `json:"errorMessage,omitempty"`
+}
+
+// Resource common fields that are returned in the response for all Azure Resource Manager resources
+type Resource struct {
+ // ID - READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}
+ ID *string `json:"id,omitempty"`
+ // Name - READ-ONLY; The name of the resource
+ Name *string `json:"name,omitempty"`
+ // Type - READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts"
+ Type *string `json:"type,omitempty"`
+}
+
+// MarshalJSON is the custom marshaler for Resource.
+func (r Resource) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]interface{})
+ return json.Marshal(objectMap)
+}
+
+// ResourceIdentity identity for the resource.
+type ResourceIdentity struct {
+ // PrincipalID - READ-ONLY; Object id of the identity resource
+ PrincipalID *string `json:"principalId,omitempty"`
+ // TenantID - READ-ONLY; The tenant id of the resource
+ TenantID *string `json:"tenantId,omitempty"`
+ // Type - Type of Identity. Supported values are: 'None', 'SystemAssigned'
+ Type *string `json:"type,omitempty"`
+}
+
+// MarshalJSON is the custom marshaler for ResourceIdentity.
+func (ri ResourceIdentity) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]interface{})
+ if ri.Type != nil {
+ objectMap["type"] = ri.Type
+ }
+ return json.Marshal(objectMap)
+}
+
+// ResourceNameAvailabilityRequest resource name availability request content.
+type ResourceNameAvailabilityRequest struct {
+ // Name - Resource name to verify.
+ Name *string `json:"name,omitempty"`
+ // Type - Resource type used for verification. Possible values include: 'MicrosoftNetAppnetAppAccounts', 'MicrosoftNetAppnetAppAccountscapacityPools', 'MicrosoftNetAppnetAppAccountscapacityPoolsvolumes', 'MicrosoftNetAppnetAppAccountscapacityPoolsvolumessnapshots'
+ Type CheckNameResourceTypes `json:"type,omitempty"`
+ // ResourceGroup - Resource group name.
+ ResourceGroup *string `json:"resourceGroup,omitempty"`
+}
+
+// RestoreStatus restore status
+type RestoreStatus struct {
+ autorest.Response `json:"-"`
+ // Healthy - READ-ONLY; Restore health status
+ Healthy *bool `json:"healthy,omitempty"`
+ // RelationshipStatus - READ-ONLY; Status of the restore SnapMirror relationship. Possible values include: 'Idle', 'Transferring'
+ RelationshipStatus RelationshipStatus `json:"relationshipStatus,omitempty"`
+ // MirrorState - READ-ONLY; The status of the restore. Possible values include: 'Uninitialized', 'Mirrored', 'Broken'
+ MirrorState MirrorState `json:"mirrorState,omitempty"`
+ // UnhealthyReason - READ-ONLY; Reason for the unhealthy restore relationship
+ UnhealthyReason *string `json:"unhealthyReason,omitempty"`
+ // ErrorMessage - READ-ONLY; Displays error message if the restore is in an error state
+ ErrorMessage *string `json:"errorMessage,omitempty"`
+ // TotalTransferBytes - READ-ONLY; Displays the total bytes transferred
+ TotalTransferBytes *int64 `json:"totalTransferBytes,omitempty"`
+}
+
+// MarshalJSON is the custom marshaler for RestoreStatus.
+func (rs RestoreStatus) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]interface{})
+ return json.Marshal(objectMap)
+}
+
+// ServiceSpecification one property of operation, include metric specifications.
+type ServiceSpecification struct {
+ // MetricSpecifications - Metric specifications of operation.
+ MetricSpecifications *[]MetricSpecification `json:"metricSpecifications,omitempty"`
+ // LogSpecifications - Log specification of operation.
+ LogSpecifications *[]LogSpecification `json:"logSpecifications,omitempty"`
+}
+
+// Snapshot snapshot of a Volume
+type Snapshot struct {
+ autorest.Response `json:"-"`
+ // Location - Resource location
+ Location *string `json:"location,omitempty"`
+ // ID - READ-ONLY; Resource Id
+ ID *string `json:"id,omitempty"`
+ // Name - READ-ONLY; Resource name
+ Name *string `json:"name,omitempty"`
+ // Type - READ-ONLY; Resource type
+ Type *string `json:"type,omitempty"`
+ // SnapshotProperties - Snapshot Properties
+ *SnapshotProperties `json:"properties,omitempty"`
+}
+
+// MarshalJSON is the custom marshaler for Snapshot.
+func (s Snapshot) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]interface{})
+ if s.Location != nil {
+ objectMap["location"] = s.Location
+ }
+ if s.SnapshotProperties != nil {
+ objectMap["properties"] = s.SnapshotProperties
+ }
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON is the custom unmarshaler for Snapshot struct.
+func (s *Snapshot) UnmarshalJSON(body []byte) error {
+ var m map[string]*json.RawMessage
+ err := json.Unmarshal(body, &m)
+ if err != nil {
+ return err
+ }
+ for k, v := range m {
+ switch k {
+ case "location":
+ if v != nil {
+ var location string
+ err = json.Unmarshal(*v, &location)
+ if err != nil {
+ return err
+ }
+ s.Location = &location
+ }
+ case "id":
+ if v != nil {
+ var ID string
+ err = json.Unmarshal(*v, &ID)
+ if err != nil {
+ return err
+ }
+ s.ID = &ID
+ }
+ case "name":
+ if v != nil {
+ var name string
+ err = json.Unmarshal(*v, &name)
+ if err != nil {
+ return err
+ }
+ s.Name = &name
+ }
+ case "type":
+ if v != nil {
+ var typeVar string
+ err = json.Unmarshal(*v, &typeVar)
+ if err != nil {
+ return err
+ }
+ s.Type = &typeVar
+ }
+ case "properties":
+ if v != nil {
+ var snapshotProperties SnapshotProperties
+ err = json.Unmarshal(*v, &snapshotProperties)
+ if err != nil {
+ return err
+ }
+ s.SnapshotProperties = &snapshotProperties
+ }
+ }
+ }
+
+ return nil
+}
+
+// SnapshotPoliciesDeleteFuture an abstraction for monitoring and retrieving the results of a long-running
+// operation.
+type SnapshotPoliciesDeleteFuture struct {
+ azure.FutureAPI
+ // Result returns the result of the asynchronous operation.
+ // If the operation has not completed it will return an error.
+ Result func(SnapshotPoliciesClient) (autorest.Response, error)
+}
+
+// UnmarshalJSON is the custom unmarshaller for CreateFuture.
+func (future *SnapshotPoliciesDeleteFuture) UnmarshalJSON(body []byte) error {
+ var azFuture azure.Future
+ if err := json.Unmarshal(body, &azFuture); err != nil {
+ return err
+ }
+ future.FutureAPI = &azFuture
+ future.Result = future.result
+ return nil
+}
+
+// result is the default implementation for SnapshotPoliciesDeleteFuture.Result.
+func (future *SnapshotPoliciesDeleteFuture) result(client SnapshotPoliciesClient) (ar autorest.Response, err error) {
+ var done bool
+ done, err = future.DoneWithContext(context.Background(), client)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "netapp.SnapshotPoliciesDeleteFuture", "Result", future.Response(), "Polling failure")
+ return
+ }
+ if !done {
+ ar.Response = future.Response()
+ err = azure.NewAsyncOpIncompleteError("netapp.SnapshotPoliciesDeleteFuture")
+ return
+ }
+ ar.Response = future.Response()
+ return
+}
+
+// SnapshotPoliciesList list of Snapshot Policies
+type SnapshotPoliciesList struct {
+ autorest.Response `json:"-"`
+ // Value - A list of snapshot policies
+ Value *[]SnapshotPolicy `json:"value,omitempty"`
+}
+
+// SnapshotPoliciesUpdateFuture an abstraction for monitoring and retrieving the results of a long-running
+// operation.
+type SnapshotPoliciesUpdateFuture struct {
+ azure.FutureAPI
+ // Result returns the result of the asynchronous operation.
+ // If the operation has not completed it will return an error.
+ Result func(SnapshotPoliciesClient) (SnapshotPolicy, error)
+}
+
+// UnmarshalJSON is the custom unmarshaller for CreateFuture.
+func (future *SnapshotPoliciesUpdateFuture) UnmarshalJSON(body []byte) error {
+ var azFuture azure.Future
+ if err := json.Unmarshal(body, &azFuture); err != nil {
+ return err
+ }
+ future.FutureAPI = &azFuture
+ future.Result = future.result
+ return nil
+}
+
+// result is the default implementation for SnapshotPoliciesUpdateFuture.Result.
+func (future *SnapshotPoliciesUpdateFuture) result(client SnapshotPoliciesClient) (sp SnapshotPolicy, err error) {
+ var done bool
+ done, err = future.DoneWithContext(context.Background(), client)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "netapp.SnapshotPoliciesUpdateFuture", "Result", future.Response(), "Polling failure")
+ return
+ }
+ if !done {
+ sp.Response.Response = future.Response()
+ err = azure.NewAsyncOpIncompleteError("netapp.SnapshotPoliciesUpdateFuture")
+ return
+ }
+ sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
+ if sp.Response.Response, err = future.GetResult(sender); err == nil && sp.Response.Response.StatusCode != http.StatusNoContent {
+ sp, err = client.UpdateResponder(sp.Response.Response)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "netapp.SnapshotPoliciesUpdateFuture", "Result", sp.Response.Response, "Failure responding to request")
+ }
+ }
+ return
+}
+
+// SnapshotPolicy snapshot policy information
+type SnapshotPolicy struct {
+ autorest.Response `json:"-"`
+ // Location - Resource location
+ Location *string `json:"location,omitempty"`
+ // ID - READ-ONLY; Resource Id
+ ID *string `json:"id,omitempty"`
+ // Name - READ-ONLY; Resource name
+ Name *string `json:"name,omitempty"`
+ // Etag - READ-ONLY; A unique read-only string that changes whenever the resource is updated.
+ Etag *string `json:"etag,omitempty"`
+ // Type - READ-ONLY; Resource type
+ Type *string `json:"type,omitempty"`
+ // Tags - Resource tags
+ Tags map[string]*string `json:"tags"`
+ // SnapshotPolicyProperties - Snapshot policy Properties
+ *SnapshotPolicyProperties `json:"properties,omitempty"`
+ // SystemData - READ-ONLY; The system meta data relating to this resource.
+ SystemData *SystemData `json:"systemData,omitempty"`
+}
+
+// MarshalJSON is the custom marshaler for SnapshotPolicy.
+func (sp SnapshotPolicy) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]interface{})
+ if sp.Location != nil {
+ objectMap["location"] = sp.Location
+ }
+ if sp.Tags != nil {
+ objectMap["tags"] = sp.Tags
+ }
+ if sp.SnapshotPolicyProperties != nil {
+ objectMap["properties"] = sp.SnapshotPolicyProperties
+ }
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON is the custom unmarshaler for SnapshotPolicy struct.
+func (sp *SnapshotPolicy) UnmarshalJSON(body []byte) error {
+ var m map[string]*json.RawMessage
+ err := json.Unmarshal(body, &m)
+ if err != nil {
+ return err
+ }
+ for k, v := range m {
+ switch k {
+ case "location":
+ if v != nil {
+ var location string
+ err = json.Unmarshal(*v, &location)
+ if err != nil {
+ return err
+ }
+ sp.Location = &location
+ }
+ case "id":
+ if v != nil {
+ var ID string
+ err = json.Unmarshal(*v, &ID)
+ if err != nil {
+ return err
+ }
+ sp.ID = &ID
+ }
+ case "name":
+ if v != nil {
+ var name string
+ err = json.Unmarshal(*v, &name)
+ if err != nil {
+ return err
+ }
+ sp.Name = &name
+ }
+ case "etag":
+ if v != nil {
+ var etag string
+ err = json.Unmarshal(*v, &etag)
+ if err != nil {
+ return err
+ }
+ sp.Etag = &etag
+ }
+ case "type":
+ if v != nil {
+ var typeVar string
+ err = json.Unmarshal(*v, &typeVar)
+ if err != nil {
+ return err
+ }
+ sp.Type = &typeVar
+ }
+ case "tags":
+ if v != nil {
+ var tags map[string]*string
+ err = json.Unmarshal(*v, &tags)
+ if err != nil {
+ return err
+ }
+ sp.Tags = tags
+ }
+ case "properties":
+ if v != nil {
+ var snapshotPolicyProperties SnapshotPolicyProperties
+ err = json.Unmarshal(*v, &snapshotPolicyProperties)
+ if err != nil {
+ return err
+ }
+ sp.SnapshotPolicyProperties = &snapshotPolicyProperties
+ }
+ case "systemData":
+ if v != nil {
+ var systemData SystemData
+ err = json.Unmarshal(*v, &systemData)
+ if err != nil {
+ return err
+ }
+ sp.SystemData = &systemData
+ }
+ }
+ }
+
+ return nil
+}
+
+// SnapshotPolicyDetails snapshot policy properties
+type SnapshotPolicyDetails struct {
+ // Location - Resource location
+ Location *string `json:"location,omitempty"`
+ // ID - READ-ONLY; Resource Id
+ ID *string `json:"id,omitempty"`
+ // Name - READ-ONLY; Resource name
+ Name *string `json:"name,omitempty"`
+ // Type - READ-ONLY; Resource type
+ Type *string `json:"type,omitempty"`
+ // Tags - Resource tags
+ Tags map[string]*string `json:"tags"`
+ // SnapshotPolicyProperties - Snapshot policy Properties
+ *SnapshotPolicyProperties `json:"properties,omitempty"`
+}
+
+// MarshalJSON is the custom marshaler for SnapshotPolicyDetails.
+func (spd SnapshotPolicyDetails) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]interface{})
+ if spd.Location != nil {
+ objectMap["location"] = spd.Location
+ }
+ if spd.Tags != nil {
+ objectMap["tags"] = spd.Tags
+ }
+ if spd.SnapshotPolicyProperties != nil {
+ objectMap["properties"] = spd.SnapshotPolicyProperties
+ }
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON is the custom unmarshaler for SnapshotPolicyDetails struct.
+func (spd *SnapshotPolicyDetails) UnmarshalJSON(body []byte) error {
+ var m map[string]*json.RawMessage
+ err := json.Unmarshal(body, &m)
+ if err != nil {
+ return err
+ }
+ for k, v := range m {
+ switch k {
+ case "location":
+ if v != nil {
+ var location string
+ err = json.Unmarshal(*v, &location)
+ if err != nil {
+ return err
+ }
+ spd.Location = &location
+ }
+ case "id":
+ if v != nil {
+ var ID string
+ err = json.Unmarshal(*v, &ID)
+ if err != nil {
+ return err
+ }
+ spd.ID = &ID
+ }
+ case "name":
+ if v != nil {
+ var name string
+ err = json.Unmarshal(*v, &name)
+ if err != nil {
+ return err
+ }
+ spd.Name = &name
+ }
+ case "type":
+ if v != nil {
+ var typeVar string
+ err = json.Unmarshal(*v, &typeVar)
+ if err != nil {
+ return err
+ }
+ spd.Type = &typeVar
+ }
+ case "tags":
+ if v != nil {
+ var tags map[string]*string
+ err = json.Unmarshal(*v, &tags)
+ if err != nil {
+ return err
+ }
+ spd.Tags = tags
+ }
+ case "properties":
+ if v != nil {
+ var snapshotPolicyProperties SnapshotPolicyProperties
+ err = json.Unmarshal(*v, &snapshotPolicyProperties)
+ if err != nil {
+ return err
+ }
+ spd.SnapshotPolicyProperties = &snapshotPolicyProperties
+ }
+ }
+ }
+
+ return nil
+}
+
+// SnapshotPolicyPatch snapshot policy Details for create and update
+type SnapshotPolicyPatch struct {
+ // Location - Resource location
+ Location *string `json:"location,omitempty"`
+ // ID - READ-ONLY; Resource Id
+ ID *string `json:"id,omitempty"`
+ // Name - READ-ONLY; Resource name
+ Name *string `json:"name,omitempty"`
+ // Type - READ-ONLY; Resource type
+ Type *string `json:"type,omitempty"`
+ // Tags - Resource tags
+ Tags map[string]*string `json:"tags"`
+ // SnapshotPolicyProperties - Snapshot Policy properties
+ *SnapshotPolicyProperties `json:"properties,omitempty"`
+}
+
+// MarshalJSON is the custom marshaler for SnapshotPolicyPatch.
+func (spp SnapshotPolicyPatch) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]interface{})
+ if spp.Location != nil {
+ objectMap["location"] = spp.Location
+ }
+ if spp.Tags != nil {
+ objectMap["tags"] = spp.Tags
+ }
+ if spp.SnapshotPolicyProperties != nil {
+ objectMap["properties"] = spp.SnapshotPolicyProperties
+ }
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON is the custom unmarshaler for SnapshotPolicyPatch struct.
+func (spp *SnapshotPolicyPatch) UnmarshalJSON(body []byte) error {
+ var m map[string]*json.RawMessage
+ err := json.Unmarshal(body, &m)
+ if err != nil {
+ return err
+ }
+ for k, v := range m {
+ switch k {
+ case "location":
+ if v != nil {
+ var location string
+ err = json.Unmarshal(*v, &location)
+ if err != nil {
+ return err
+ }
+ spp.Location = &location
+ }
+ case "id":
+ if v != nil {
+ var ID string
+ err = json.Unmarshal(*v, &ID)
+ if err != nil {
+ return err
+ }
+ spp.ID = &ID
+ }
+ case "name":
+ if v != nil {
+ var name string
+ err = json.Unmarshal(*v, &name)
+ if err != nil {
+ return err
+ }
+ spp.Name = &name
+ }
+ case "type":
+ if v != nil {
+ var typeVar string
+ err = json.Unmarshal(*v, &typeVar)
+ if err != nil {
+ return err
+ }
+ spp.Type = &typeVar
+ }
+ case "tags":
+ if v != nil {
+ var tags map[string]*string
+ err = json.Unmarshal(*v, &tags)
+ if err != nil {
+ return err
+ }
+ spp.Tags = tags
+ }
+ case "properties":
+ if v != nil {
+ var snapshotPolicyProperties SnapshotPolicyProperties
+ err = json.Unmarshal(*v, &snapshotPolicyProperties)
+ if err != nil {
+ return err
+ }
+ spp.SnapshotPolicyProperties = &snapshotPolicyProperties
+ }
+ }
+ }
+
+ return nil
+}
+
+// SnapshotPolicyProperties snapshot policy properties
+type SnapshotPolicyProperties struct {
+ // HourlySchedule - Schedule for hourly snapshots
+ HourlySchedule *HourlySchedule `json:"hourlySchedule,omitempty"`
+ // DailySchedule - Schedule for daily snapshots
+ DailySchedule *DailySchedule `json:"dailySchedule,omitempty"`
+ // WeeklySchedule - Schedule for weekly snapshots
+ WeeklySchedule *WeeklySchedule `json:"weeklySchedule,omitempty"`
+ // MonthlySchedule - Schedule for monthly snapshots
+ MonthlySchedule *MonthlySchedule `json:"monthlySchedule,omitempty"`
+ // Enabled - The property to decide policy is enabled or not
+ Enabled *bool `json:"enabled,omitempty"`
+ // ProvisioningState - READ-ONLY; Azure lifecycle management
+ ProvisioningState *string `json:"provisioningState,omitempty"`
+}
+
+// MarshalJSON is the custom marshaler for SnapshotPolicyProperties.
+func (spp SnapshotPolicyProperties) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]interface{})
+ if spp.HourlySchedule != nil {
+ objectMap["hourlySchedule"] = spp.HourlySchedule
+ }
+ if spp.DailySchedule != nil {
+ objectMap["dailySchedule"] = spp.DailySchedule
+ }
+ if spp.WeeklySchedule != nil {
+ objectMap["weeklySchedule"] = spp.WeeklySchedule
+ }
+ if spp.MonthlySchedule != nil {
+ objectMap["monthlySchedule"] = spp.MonthlySchedule
+ }
+ if spp.Enabled != nil {
+ objectMap["enabled"] = spp.Enabled
+ }
+ return json.Marshal(objectMap)
+}
+
+// SnapshotPolicyVolumeList volumes associated with snapshot policy
+type SnapshotPolicyVolumeList struct {
+ autorest.Response `json:"-"`
+ // Value - List of volumes
+ Value *[]Volume `json:"value,omitempty"`
+}
+
+// SnapshotProperties snapshot properties
+type SnapshotProperties struct {
+ // SnapshotID - READ-ONLY; UUID v4 used to identify the Snapshot
+ SnapshotID *string `json:"snapshotId,omitempty"`
+ // Created - READ-ONLY; The creation date of the snapshot
+ Created *date.Time `json:"created,omitempty"`
+ // ProvisioningState - READ-ONLY; Azure lifecycle management
+ ProvisioningState *string `json:"provisioningState,omitempty"`
+}
+
+// MarshalJSON is the custom marshaler for SnapshotProperties.
+func (sp SnapshotProperties) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]interface{})
+ return json.Marshal(objectMap)
+}
+
+// SnapshotRestoreFiles restore payload for Single File Snapshot Restore
+type SnapshotRestoreFiles struct {
+ // FilePaths - List of files to be restored
+ FilePaths *[]string `json:"filePaths,omitempty"`
+ // DestinationPath - Destination folder where the files will be restored
+ DestinationPath *string `json:"destinationPath,omitempty"`
+}
+
+// SnapshotsCreateFuture an abstraction for monitoring and retrieving the results of a long-running
+// operation.
+type SnapshotsCreateFuture struct {
+ azure.FutureAPI
+ // Result returns the result of the asynchronous operation.
+ // If the operation has not completed it will return an error.
+ Result func(SnapshotsClient) (Snapshot, error)
+}
+
+// UnmarshalJSON is the custom unmarshaller for CreateFuture.
+func (future *SnapshotsCreateFuture) UnmarshalJSON(body []byte) error {
+ var azFuture azure.Future
+ if err := json.Unmarshal(body, &azFuture); err != nil {
+ return err
+ }
+ future.FutureAPI = &azFuture
+ future.Result = future.result
+ return nil
+}
+
+// result is the default implementation for SnapshotsCreateFuture.Result.
+func (future *SnapshotsCreateFuture) result(client SnapshotsClient) (s Snapshot, err error) {
+ var done bool
+ done, err = future.DoneWithContext(context.Background(), client)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "netapp.SnapshotsCreateFuture", "Result", future.Response(), "Polling failure")
+ return
+ }
+ if !done {
+ s.Response.Response = future.Response()
+ err = azure.NewAsyncOpIncompleteError("netapp.SnapshotsCreateFuture")
+ return
+ }
+ sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
+ if s.Response.Response, err = future.GetResult(sender); err == nil && s.Response.Response.StatusCode != http.StatusNoContent {
+ s, err = client.CreateResponder(s.Response.Response)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "netapp.SnapshotsCreateFuture", "Result", s.Response.Response, "Failure responding to request")
+ }
+ }
+ return
+}
+
+// SnapshotsDeleteFuture an abstraction for monitoring and retrieving the results of a long-running
+// operation.
+type SnapshotsDeleteFuture struct {
+ azure.FutureAPI
+ // Result returns the result of the asynchronous operation.
+ // If the operation has not completed it will return an error.
+ Result func(SnapshotsClient) (autorest.Response, error)
+}
+
+// UnmarshalJSON is the custom unmarshaller for CreateFuture.
+func (future *SnapshotsDeleteFuture) UnmarshalJSON(body []byte) error {
+ var azFuture azure.Future
+ if err := json.Unmarshal(body, &azFuture); err != nil {
+ return err
+ }
+ future.FutureAPI = &azFuture
+ future.Result = future.result
+ return nil
+}
+
+// result is the default implementation for SnapshotsDeleteFuture.Result.
+func (future *SnapshotsDeleteFuture) result(client SnapshotsClient) (ar autorest.Response, err error) {
+ var done bool
+ done, err = future.DoneWithContext(context.Background(), client)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "netapp.SnapshotsDeleteFuture", "Result", future.Response(), "Polling failure")
+ return
+ }
+ if !done {
+ ar.Response = future.Response()
+ err = azure.NewAsyncOpIncompleteError("netapp.SnapshotsDeleteFuture")
+ return
+ }
+ ar.Response = future.Response()
+ return
+}
+
+// SnapshotsList list of Snapshots
+type SnapshotsList struct {
+ autorest.Response `json:"-"`
+ // Value - A list of Snapshots
+ Value *[]Snapshot `json:"value,omitempty"`
+}
+
+// SnapshotsRestoreFilesFuture an abstraction for monitoring and retrieving the results of a long-running
+// operation.
+type SnapshotsRestoreFilesFuture struct {
+ azure.FutureAPI
+ // Result returns the result of the asynchronous operation.
+ // If the operation has not completed it will return an error.
+ Result func(SnapshotsClient) (autorest.Response, error)
+}
+
+// UnmarshalJSON is the custom unmarshaller for CreateFuture.
+func (future *SnapshotsRestoreFilesFuture) UnmarshalJSON(body []byte) error {
+ var azFuture azure.Future
+ if err := json.Unmarshal(body, &azFuture); err != nil {
+ return err
+ }
+ future.FutureAPI = &azFuture
+ future.Result = future.result
+ return nil
+}
+
+// result is the default implementation for SnapshotsRestoreFilesFuture.Result.
+func (future *SnapshotsRestoreFilesFuture) result(client SnapshotsClient) (ar autorest.Response, err error) {
+ var done bool
+ done, err = future.DoneWithContext(context.Background(), client)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "netapp.SnapshotsRestoreFilesFuture", "Result", future.Response(), "Polling failure")
+ return
+ }
+ if !done {
+ ar.Response = future.Response()
+ err = azure.NewAsyncOpIncompleteError("netapp.SnapshotsRestoreFilesFuture")
+ return
+ }
+ ar.Response = future.Response()
+ return
+}
+
+// SnapshotsUpdateFuture an abstraction for monitoring and retrieving the results of a long-running
+// operation.
+type SnapshotsUpdateFuture struct {
+ azure.FutureAPI
+ // Result returns the result of the asynchronous operation.
+ // If the operation has not completed it will return an error.
+ Result func(SnapshotsClient) (Snapshot, error)
+}
+
+// UnmarshalJSON is the custom unmarshaller for CreateFuture.
+func (future *SnapshotsUpdateFuture) UnmarshalJSON(body []byte) error {
+ var azFuture azure.Future
+ if err := json.Unmarshal(body, &azFuture); err != nil {
+ return err
+ }
+ future.FutureAPI = &azFuture
+ future.Result = future.result
+ return nil
+}
+
+// result is the default implementation for SnapshotsUpdateFuture.Result.
+func (future *SnapshotsUpdateFuture) result(client SnapshotsClient) (s Snapshot, err error) {
+ var done bool
+ done, err = future.DoneWithContext(context.Background(), client)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "netapp.SnapshotsUpdateFuture", "Result", future.Response(), "Polling failure")
+ return
+ }
+ if !done {
+ s.Response.Response = future.Response()
+ err = azure.NewAsyncOpIncompleteError("netapp.SnapshotsUpdateFuture")
+ return
+ }
+ sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
+ if s.Response.Response, err = future.GetResult(sender); err == nil && s.Response.Response.StatusCode != http.StatusNoContent {
+ s, err = client.UpdateResponder(s.Response.Response)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "netapp.SnapshotsUpdateFuture", "Result", s.Response.Response, "Failure responding to request")
+ }
+ }
+ return
+}
+
+// SubscriptionQuotaItem information regarding Subscription Quota Item.
+type SubscriptionQuotaItem struct {
+ autorest.Response `json:"-"`
+ // SubscriptionQuotaItemProperties - SubscriptionQuotaItem properties
+ *SubscriptionQuotaItemProperties `json:"properties,omitempty"`
+ // SystemData - READ-ONLY; The system meta data relating to this resource.
+ SystemData *SystemData `json:"systemData,omitempty"`
+ // ID - READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}
+ ID *string `json:"id,omitempty"`
+ // Name - READ-ONLY; The name of the resource
+ Name *string `json:"name,omitempty"`
+ // Type - READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts"
+ Type *string `json:"type,omitempty"`
+}
+
+// MarshalJSON is the custom marshaler for SubscriptionQuotaItem.
+func (sqi SubscriptionQuotaItem) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]interface{})
+ if sqi.SubscriptionQuotaItemProperties != nil {
+ objectMap["properties"] = sqi.SubscriptionQuotaItemProperties
+ }
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON is the custom unmarshaler for SubscriptionQuotaItem struct.
+func (sqi *SubscriptionQuotaItem) UnmarshalJSON(body []byte) error {
+ var m map[string]*json.RawMessage
+ err := json.Unmarshal(body, &m)
+ if err != nil {
+ return err
+ }
+ for k, v := range m {
+ switch k {
+ case "properties":
+ if v != nil {
+ var subscriptionQuotaItemProperties SubscriptionQuotaItemProperties
+ err = json.Unmarshal(*v, &subscriptionQuotaItemProperties)
+ if err != nil {
+ return err
+ }
+ sqi.SubscriptionQuotaItemProperties = &subscriptionQuotaItemProperties
+ }
+ case "systemData":
+ if v != nil {
+ var systemData SystemData
+ err = json.Unmarshal(*v, &systemData)
+ if err != nil {
+ return err
+ }
+ sqi.SystemData = &systemData
+ }
+ case "id":
+ if v != nil {
+ var ID string
+ err = json.Unmarshal(*v, &ID)
+ if err != nil {
+ return err
+ }
+ sqi.ID = &ID
+ }
+ case "name":
+ if v != nil {
+ var name string
+ err = json.Unmarshal(*v, &name)
+ if err != nil {
+ return err
+ }
+ sqi.Name = &name
+ }
+ case "type":
+ if v != nil {
+ var typeVar string
+ err = json.Unmarshal(*v, &typeVar)
+ if err != nil {
+ return err
+ }
+ sqi.Type = &typeVar
+ }
+ }
+ }
+
+ return nil
+}
+
+// SubscriptionQuotaItemList list of Subscription Quota Items
+type SubscriptionQuotaItemList struct {
+ autorest.Response `json:"-"`
+ // Value - A list of SubscriptionQuotaItems
+ Value *[]SubscriptionQuotaItem `json:"value,omitempty"`
+}
+
+// SubscriptionQuotaItemProperties subscriptionQuotaItem Properties
+type SubscriptionQuotaItemProperties struct {
+ // Current - READ-ONLY; The current quota value.
+ Current *int32 `json:"current,omitempty"`
+ // Default - READ-ONLY; The default quota value.
+ Default *int32 `json:"default,omitempty"`
+}
+
+// MarshalJSON is the custom marshaler for SubscriptionQuotaItemProperties.
+func (sqip SubscriptionQuotaItemProperties) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]interface{})
+ return json.Marshal(objectMap)
+}
+
+// SubvolumeInfo subvolume Information properties
+type SubvolumeInfo struct {
+ autorest.Response `json:"-"`
+ // SubvolumeProperties - Subvolume Properties
+ *SubvolumeProperties `json:"properties,omitempty"`
+ // SystemData - READ-ONLY; The system meta data relating to this resource.
+ SystemData *SystemData `json:"systemData,omitempty"`
+ // ID - READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}
+ ID *string `json:"id,omitempty"`
+ // Name - READ-ONLY; The name of the resource
+ Name *string `json:"name,omitempty"`
+ // Type - READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts"
+ Type *string `json:"type,omitempty"`
+}
+
+// MarshalJSON is the custom marshaler for SubvolumeInfo.
+func (si SubvolumeInfo) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]interface{})
+ if si.SubvolumeProperties != nil {
+ objectMap["properties"] = si.SubvolumeProperties
+ }
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON is the custom unmarshaler for SubvolumeInfo struct.
+func (si *SubvolumeInfo) UnmarshalJSON(body []byte) error {
+ var m map[string]*json.RawMessage
+ err := json.Unmarshal(body, &m)
+ if err != nil {
+ return err
+ }
+ for k, v := range m {
+ switch k {
+ case "properties":
+ if v != nil {
+ var subvolumeProperties SubvolumeProperties
+ err = json.Unmarshal(*v, &subvolumeProperties)
+ if err != nil {
+ return err
+ }
+ si.SubvolumeProperties = &subvolumeProperties
+ }
+ case "systemData":
+ if v != nil {
+ var systemData SystemData
+ err = json.Unmarshal(*v, &systemData)
+ if err != nil {
+ return err
+ }
+ si.SystemData = &systemData
+ }
+ case "id":
+ if v != nil {
+ var ID string
+ err = json.Unmarshal(*v, &ID)
+ if err != nil {
+ return err
+ }
+ si.ID = &ID
+ }
+ case "name":
+ if v != nil {
+ var name string
+ err = json.Unmarshal(*v, &name)
+ if err != nil {
+ return err
+ }
+ si.Name = &name
+ }
+ case "type":
+ if v != nil {
+ var typeVar string
+ err = json.Unmarshal(*v, &typeVar)
+ if err != nil {
+ return err
+ }
+ si.Type = &typeVar
+ }
+ }
+ }
+
+ return nil
+}
+
+// SubvolumeModel result of the post subvolume and action is to get metadata of the subvolume.
+type SubvolumeModel struct {
+ autorest.Response `json:"-"`
+ // ID - READ-ONLY; Resource Id
+ ID *string `json:"id,omitempty"`
+ // Name - READ-ONLY; Resource name
+ Name *string `json:"name,omitempty"`
+ // Type - READ-ONLY; Resource type
+ Type *string `json:"type,omitempty"`
+ // SubvolumeModelProperties - It represents the minimal properties of the subvolume.
+ *SubvolumeModelProperties `json:"properties,omitempty"`
+}
+
+// MarshalJSON is the custom marshaler for SubvolumeModel.
+func (sm SubvolumeModel) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]interface{})
+ if sm.SubvolumeModelProperties != nil {
+ objectMap["properties"] = sm.SubvolumeModelProperties
+ }
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON is the custom unmarshaler for SubvolumeModel struct.
+func (sm *SubvolumeModel) UnmarshalJSON(body []byte) error {
+ var m map[string]*json.RawMessage
+ err := json.Unmarshal(body, &m)
+ if err != nil {
+ return err
+ }
+ for k, v := range m {
+ switch k {
+ case "id":
+ if v != nil {
+ var ID string
+ err = json.Unmarshal(*v, &ID)
+ if err != nil {
+ return err
+ }
+ sm.ID = &ID
+ }
+ case "name":
+ if v != nil {
+ var name string
+ err = json.Unmarshal(*v, &name)
+ if err != nil {
+ return err
+ }
+ sm.Name = &name
+ }
+ case "type":
+ if v != nil {
+ var typeVar string
+ err = json.Unmarshal(*v, &typeVar)
+ if err != nil {
+ return err
+ }
+ sm.Type = &typeVar
+ }
+ case "properties":
+ if v != nil {
+ var subvolumeModelProperties SubvolumeModelProperties
+ err = json.Unmarshal(*v, &subvolumeModelProperties)
+ if err != nil {
+ return err
+ }
+ sm.SubvolumeModelProperties = &subvolumeModelProperties
+ }
+ }
+ }
+
+ return nil
+}
+
+// SubvolumeModelProperties properties which represents actual subvolume model which is stored as a file in
+// the system.
+type SubvolumeModelProperties struct {
+ // Path - Path to the subvolume
+ Path *string `json:"path,omitempty"`
+ // ParentPath - Path to the parent subvolume
+ ParentPath *string `json:"parentPath,omitempty"`
+ // Size - Size of subvolume
+ Size *int64 `json:"size,omitempty"`
+ // BytesUsed - Bytes used
+ BytesUsed *int64 `json:"bytesUsed,omitempty"`
+ // Permissions - Permissions of the subvolume
+ Permissions *string `json:"permissions,omitempty"`
+ // CreationTimeStamp - Creation time and date
+ CreationTimeStamp *date.Time `json:"creationTimeStamp,omitempty"`
+ // AccessedTimeStamp - Most recent access time and date
+ AccessedTimeStamp *date.Time `json:"accessedTimeStamp,omitempty"`
+ // ModifiedTimeStamp - Most recent modification time and date
+ ModifiedTimeStamp *date.Time `json:"modifiedTimeStamp,omitempty"`
+ // ChangedTimeStamp - Most recent change time and date
+ ChangedTimeStamp *date.Time `json:"changedTimeStamp,omitempty"`
+ // ProvisioningState - Azure lifecycle management
+ ProvisioningState *string `json:"provisioningState,omitempty"`
+}
+
+// SubvolumePatchParams parameters with which a subvolume can be updated
+type SubvolumePatchParams struct {
+ // Size - Truncate subvolume to the provided size in bytes
+ Size *int64 `json:"size,omitempty"`
+ // Path - path to the subvolume
+ Path *string `json:"path,omitempty"`
+}
+
+// SubvolumePatchRequest subvolume Patch Request properties
+type SubvolumePatchRequest struct {
+ // SubvolumePatchParams - Subvolume Properties
+ *SubvolumePatchParams `json:"properties,omitempty"`
+}
+
+// MarshalJSON is the custom marshaler for SubvolumePatchRequest.
+func (spr SubvolumePatchRequest) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]interface{})
+ if spr.SubvolumePatchParams != nil {
+ objectMap["properties"] = spr.SubvolumePatchParams
+ }
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON is the custom unmarshaler for SubvolumePatchRequest struct.
+func (spr *SubvolumePatchRequest) UnmarshalJSON(body []byte) error {
+ var m map[string]*json.RawMessage
+ err := json.Unmarshal(body, &m)
+ if err != nil {
+ return err
+ }
+ for k, v := range m {
+ switch k {
+ case "properties":
+ if v != nil {
+ var subvolumePatchParams SubvolumePatchParams
+ err = json.Unmarshal(*v, &subvolumePatchParams)
+ if err != nil {
+ return err
+ }
+ spr.SubvolumePatchParams = &subvolumePatchParams
+ }
+ }
+ }
+
+ return nil
+}
+
+// SubvolumeProperties this represents path associated with the subvolume
+type SubvolumeProperties struct {
+ // Path - Path to the subvolume
+ Path *string `json:"path,omitempty"`
+ // Size - Truncate subvolume to the provided size in bytes
+ Size *int64 `json:"size,omitempty"`
+ // ParentPath - parent path to the subvolume
+ ParentPath *string `json:"parentPath,omitempty"`
+ // ProvisioningState - READ-ONLY; Azure lifecycle management
+ ProvisioningState *string `json:"provisioningState,omitempty"`
+}
+
+// MarshalJSON is the custom marshaler for SubvolumeProperties.
+func (sp SubvolumeProperties) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]interface{})
+ if sp.Path != nil {
+ objectMap["path"] = sp.Path
+ }
+ if sp.Size != nil {
+ objectMap["size"] = sp.Size
+ }
+ if sp.ParentPath != nil {
+ objectMap["parentPath"] = sp.ParentPath
+ }
+ return json.Marshal(objectMap)
+}
+
+// SubvolumesCreateFuture an abstraction for monitoring and retrieving the results of a long-running
+// operation.
+type SubvolumesCreateFuture struct {
+ azure.FutureAPI
+ // Result returns the result of the asynchronous operation.
+ // If the operation has not completed it will return an error.
+ Result func(SubvolumesClient) (SubvolumeInfo, error)
+}
+
+// UnmarshalJSON is the custom unmarshaller for CreateFuture.
+func (future *SubvolumesCreateFuture) UnmarshalJSON(body []byte) error {
+ var azFuture azure.Future
+ if err := json.Unmarshal(body, &azFuture); err != nil {
+ return err
+ }
+ future.FutureAPI = &azFuture
+ future.Result = future.result
+ return nil
+}
+
+// result is the default implementation for SubvolumesCreateFuture.Result.
+func (future *SubvolumesCreateFuture) result(client SubvolumesClient) (si SubvolumeInfo, err error) {
+ var done bool
+ done, err = future.DoneWithContext(context.Background(), client)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "netapp.SubvolumesCreateFuture", "Result", future.Response(), "Polling failure")
+ return
+ }
+ if !done {
+ si.Response.Response = future.Response()
+ err = azure.NewAsyncOpIncompleteError("netapp.SubvolumesCreateFuture")
+ return
+ }
+ sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
+ if si.Response.Response, err = future.GetResult(sender); err == nil && si.Response.Response.StatusCode != http.StatusNoContent {
+ si, err = client.CreateResponder(si.Response.Response)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "netapp.SubvolumesCreateFuture", "Result", si.Response.Response, "Failure responding to request")
+ }
+ }
+ return
+}
+
+// SubvolumesDeleteFuture an abstraction for monitoring and retrieving the results of a long-running
+// operation.
+type SubvolumesDeleteFuture struct {
+ azure.FutureAPI
+ // Result returns the result of the asynchronous operation.
+ // If the operation has not completed it will return an error.
+ Result func(SubvolumesClient) (autorest.Response, error)
+}
+
+// UnmarshalJSON is the custom unmarshaller for CreateFuture.
+func (future *SubvolumesDeleteFuture) UnmarshalJSON(body []byte) error {
+ var azFuture azure.Future
+ if err := json.Unmarshal(body, &azFuture); err != nil {
+ return err
+ }
+ future.FutureAPI = &azFuture
+ future.Result = future.result
+ return nil
+}
+
+// result is the default implementation for SubvolumesDeleteFuture.Result.
+func (future *SubvolumesDeleteFuture) result(client SubvolumesClient) (ar autorest.Response, err error) {
+ var done bool
+ done, err = future.DoneWithContext(context.Background(), client)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "netapp.SubvolumesDeleteFuture", "Result", future.Response(), "Polling failure")
+ return
+ }
+ if !done {
+ ar.Response = future.Response()
+ err = azure.NewAsyncOpIncompleteError("netapp.SubvolumesDeleteFuture")
+ return
+ }
+ ar.Response = future.Response()
+ return
+}
+
+// SubvolumesGetMetadataFuture an abstraction for monitoring and retrieving the results of a long-running
+// operation.
+type SubvolumesGetMetadataFuture struct {
+ azure.FutureAPI
+ // Result returns the result of the asynchronous operation.
+ // If the operation has not completed it will return an error.
+ Result func(SubvolumesClient) (SubvolumeModel, error)
+}
+
+// UnmarshalJSON is the custom unmarshaller for CreateFuture.
+func (future *SubvolumesGetMetadataFuture) UnmarshalJSON(body []byte) error {
+ var azFuture azure.Future
+ if err := json.Unmarshal(body, &azFuture); err != nil {
+ return err
+ }
+ future.FutureAPI = &azFuture
+ future.Result = future.result
+ return nil
+}
+
+// result is the default implementation for SubvolumesGetMetadataFuture.Result.
+func (future *SubvolumesGetMetadataFuture) result(client SubvolumesClient) (sm SubvolumeModel, err error) {
+ var done bool
+ done, err = future.DoneWithContext(context.Background(), client)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "netapp.SubvolumesGetMetadataFuture", "Result", future.Response(), "Polling failure")
+ return
+ }
+ if !done {
+ sm.Response.Response = future.Response()
+ err = azure.NewAsyncOpIncompleteError("netapp.SubvolumesGetMetadataFuture")
+ return
+ }
+ sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
+ if sm.Response.Response, err = future.GetResult(sender); err == nil && sm.Response.Response.StatusCode != http.StatusNoContent {
+ sm, err = client.GetMetadataResponder(sm.Response.Response)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "netapp.SubvolumesGetMetadataFuture", "Result", sm.Response.Response, "Failure responding to request")
+ }
+ }
+ return
+}
+
+// SubvolumesList list of Subvolumes
+type SubvolumesList struct {
+ autorest.Response `json:"-"`
+ // Value - A list of Subvolumes
+ Value *[]SubvolumeInfo `json:"value,omitempty"`
+ // NextLink - URL to get the next set of results.
+ NextLink *string `json:"nextLink,omitempty"`
+}
+
+// SubvolumesListIterator provides access to a complete listing of SubvolumeInfo values.
+type SubvolumesListIterator struct {
+ i int
+ page SubvolumesListPage
+}
+
+// NextWithContext advances to the next value. If there was an error making
+// the request the iterator does not advance and the error is returned.
+func (iter *SubvolumesListIterator) NextWithContext(ctx context.Context) (err error) {
+ if tracing.IsEnabled() {
+ ctx = tracing.StartSpan(ctx, fqdn+"/SubvolumesListIterator.NextWithContext")
+ defer func() {
+ sc := -1
+ if iter.Response().Response.Response != nil {
+ sc = iter.Response().Response.Response.StatusCode
+ }
+ tracing.EndSpan(ctx, sc, err)
+ }()
+ }
+ iter.i++
+ if iter.i < len(iter.page.Values()) {
+ return nil
+ }
+ err = iter.page.NextWithContext(ctx)
+ if err != nil {
+ iter.i--
+ return err
+ }
+ iter.i = 0
+ return nil
+}
+
+// Next advances to the next value. If there was an error making
+// the request the iterator does not advance and the error is returned.
+// Deprecated: Use NextWithContext() instead.
+func (iter *SubvolumesListIterator) Next() error {
+ return iter.NextWithContext(context.Background())
+}
+
+// NotDone returns true if the enumeration should be started or is not yet complete.
+func (iter SubvolumesListIterator) NotDone() bool {
+ return iter.page.NotDone() && iter.i < len(iter.page.Values())
+}
+
+// Response returns the raw server response from the last page request.
+func (iter SubvolumesListIterator) Response() SubvolumesList {
+ return iter.page.Response()
+}
+
+// Value returns the current value or a zero-initialized value if the
+// iterator has advanced beyond the end of the collection.
+func (iter SubvolumesListIterator) Value() SubvolumeInfo {
+ if !iter.page.NotDone() {
+ return SubvolumeInfo{}
+ }
+ return iter.page.Values()[iter.i]
+}
+
+// Creates a new instance of the SubvolumesListIterator type.
+func NewSubvolumesListIterator(page SubvolumesListPage) SubvolumesListIterator {
+ return SubvolumesListIterator{page: page}
+}
+
+// IsEmpty returns true if the ListResult contains no values.
+func (sl SubvolumesList) IsEmpty() bool {
+ return sl.Value == nil || len(*sl.Value) == 0
+}
+
+// hasNextLink returns true if the NextLink is not empty.
+func (sl SubvolumesList) hasNextLink() bool {
+ return sl.NextLink != nil && len(*sl.NextLink) != 0
+}
+
+// subvolumesListPreparer prepares a request to retrieve the next set of results.
+// It returns nil if no more results exist.
+func (sl SubvolumesList) subvolumesListPreparer(ctx context.Context) (*http.Request, error) {
+ if !sl.hasNextLink() {
+ return nil, nil
+ }
+ return autorest.Prepare((&http.Request{}).WithContext(ctx),
+ autorest.AsJSON(),
+ autorest.AsGet(),
+ autorest.WithBaseURL(to.String(sl.NextLink)))
+}
+
+// SubvolumesListPage contains a page of SubvolumeInfo values.
+type SubvolumesListPage struct {
+ fn func(context.Context, SubvolumesList) (SubvolumesList, error)
+ sl SubvolumesList
+}
+
+// NextWithContext advances to the next page of values. If there was an error making
+// the request the page does not advance and the error is returned.
+func (page *SubvolumesListPage) NextWithContext(ctx context.Context) (err error) {
+ if tracing.IsEnabled() {
+ ctx = tracing.StartSpan(ctx, fqdn+"/SubvolumesListPage.NextWithContext")
+ defer func() {
+ sc := -1
+ if page.Response().Response.Response != nil {
+ sc = page.Response().Response.Response.StatusCode
+ }
+ tracing.EndSpan(ctx, sc, err)
+ }()
+ }
+ for {
+ next, err := page.fn(ctx, page.sl)
+ if err != nil {
+ return err
+ }
+ page.sl = next
+ if !next.hasNextLink() || !next.IsEmpty() {
+ break
+ }
+ }
+ return nil
+}
+
+// Next advances to the next page of values. If there was an error making
+// the request the page does not advance and the error is returned.
+// Deprecated: Use NextWithContext() instead.
+func (page *SubvolumesListPage) Next() error {
+ return page.NextWithContext(context.Background())
+}
+
+// NotDone returns true if the page enumeration should be started or is not yet complete.
+func (page SubvolumesListPage) NotDone() bool {
+ return !page.sl.IsEmpty()
+}
+
+// Response returns the raw server response from the last page request.
+func (page SubvolumesListPage) Response() SubvolumesList {
+ return page.sl
+}
+
+// Values returns the slice of values for the current page or nil if there are no values.
+func (page SubvolumesListPage) Values() []SubvolumeInfo {
+ if page.sl.IsEmpty() {
+ return nil
+ }
+ return *page.sl.Value
+}
+
+// Creates a new instance of the SubvolumesListPage type.
+func NewSubvolumesListPage(cur SubvolumesList, getNextPage func(context.Context, SubvolumesList) (SubvolumesList, error)) SubvolumesListPage {
+ return SubvolumesListPage{
+ fn: getNextPage,
+ sl: cur,
+ }
+}
+
+// SubvolumesUpdateFuture an abstraction for monitoring and retrieving the results of a long-running
+// operation.
+type SubvolumesUpdateFuture struct {
+ azure.FutureAPI
+ // Result returns the result of the asynchronous operation.
+ // If the operation has not completed it will return an error.
+ Result func(SubvolumesClient) (SubvolumeInfo, error)
+}
+
+// UnmarshalJSON is the custom unmarshaller for CreateFuture.
+func (future *SubvolumesUpdateFuture) UnmarshalJSON(body []byte) error {
+ var azFuture azure.Future
+ if err := json.Unmarshal(body, &azFuture); err != nil {
+ return err
+ }
+ future.FutureAPI = &azFuture
+ future.Result = future.result
+ return nil
+}
+
+// result is the default implementation for SubvolumesUpdateFuture.Result.
+func (future *SubvolumesUpdateFuture) result(client SubvolumesClient) (si SubvolumeInfo, err error) {
+ var done bool
+ done, err = future.DoneWithContext(context.Background(), client)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "netapp.SubvolumesUpdateFuture", "Result", future.Response(), "Polling failure")
+ return
+ }
+ if !done {
+ si.Response.Response = future.Response()
+ err = azure.NewAsyncOpIncompleteError("netapp.SubvolumesUpdateFuture")
+ return
+ }
+ sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
+ if si.Response.Response, err = future.GetResult(sender); err == nil && si.Response.Response.StatusCode != http.StatusNoContent {
+ si, err = client.UpdateResponder(si.Response.Response)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "netapp.SubvolumesUpdateFuture", "Result", si.Response.Response, "Failure responding to request")
+ }
+ }
+ return
+}
+
+// SystemData metadata pertaining to creation and last modification of the resource.
+type SystemData struct {
+ // CreatedBy - The identity that created the resource.
+ CreatedBy *string `json:"createdBy,omitempty"`
+ // CreatedByType - The type of identity that created the resource. Possible values include: 'User', 'Application', 'ManagedIdentity', 'Key'
+ CreatedByType CreatedByType `json:"createdByType,omitempty"`
+ // CreatedAt - The timestamp of resource creation (UTC).
+ CreatedAt *date.Time `json:"createdAt,omitempty"`
+ // LastModifiedBy - The identity that last modified the resource.
+ LastModifiedBy *string `json:"lastModifiedBy,omitempty"`
+ // LastModifiedByType - The type of identity that last modified the resource. Possible values include: 'User', 'Application', 'ManagedIdentity', 'Key'
+ LastModifiedByType CreatedByType `json:"lastModifiedByType,omitempty"`
+ // LastModifiedAt - The timestamp of resource last modification (UTC)
+ LastModifiedAt *date.Time `json:"lastModifiedAt,omitempty"`
+}
+
+// TrackedResource the resource model definition for an Azure Resource Manager tracked top level resource
+// which has 'tags' and a 'location'
+type TrackedResource struct {
+ // Tags - Resource tags.
+ Tags map[string]*string `json:"tags"`
+ // Location - The geo-location where the resource lives
+ Location *string `json:"location,omitempty"`
+ // ID - READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}
+ ID *string `json:"id,omitempty"`
+ // Name - READ-ONLY; The name of the resource
+ Name *string `json:"name,omitempty"`
+ // Type - READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts"
+ Type *string `json:"type,omitempty"`
+}
+
+// MarshalJSON is the custom marshaler for TrackedResource.
+func (tr TrackedResource) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]interface{})
+ if tr.Tags != nil {
+ objectMap["tags"] = tr.Tags
+ }
+ if tr.Location != nil {
+ objectMap["location"] = tr.Location
+ }
+ return json.Marshal(objectMap)
+}
+
+// Vault vault information
+type Vault struct {
+ // Location - Resource location
+ Location *string `json:"location,omitempty"`
+ // ID - READ-ONLY; Resource Id
+ ID *string `json:"id,omitempty"`
+ // Name - READ-ONLY; Resource name
+ Name *string `json:"name,omitempty"`
+ // Type - READ-ONLY; Resource type
+ Type *string `json:"type,omitempty"`
+ // VaultProperties - Vault Properties
+ *VaultProperties `json:"properties,omitempty"`
+}
+
+// MarshalJSON is the custom marshaler for Vault.
+func (vVar Vault) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]interface{})
+ if vVar.Location != nil {
+ objectMap["location"] = vVar.Location
+ }
+ if vVar.VaultProperties != nil {
+ objectMap["properties"] = vVar.VaultProperties
+ }
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON is the custom unmarshaler for Vault struct.
+func (vVar *Vault) UnmarshalJSON(body []byte) error {
+ var m map[string]*json.RawMessage
+ err := json.Unmarshal(body, &m)
+ if err != nil {
+ return err
+ }
+ for k, v := range m {
+ switch k {
+ case "location":
+ if v != nil {
+ var location string
+ err = json.Unmarshal(*v, &location)
+ if err != nil {
+ return err
+ }
+ vVar.Location = &location
+ }
+ case "id":
+ if v != nil {
+ var ID string
+ err = json.Unmarshal(*v, &ID)
+ if err != nil {
+ return err
+ }
+ vVar.ID = &ID
+ }
+ case "name":
+ if v != nil {
+ var name string
+ err = json.Unmarshal(*v, &name)
+ if err != nil {
+ return err
+ }
+ vVar.Name = &name
+ }
+ case "type":
+ if v != nil {
+ var typeVar string
+ err = json.Unmarshal(*v, &typeVar)
+ if err != nil {
+ return err
+ }
+ vVar.Type = &typeVar
+ }
+ case "properties":
+ if v != nil {
+ var vaultProperties VaultProperties
+ err = json.Unmarshal(*v, &vaultProperties)
+ if err != nil {
+ return err
+ }
+ vVar.VaultProperties = &vaultProperties
+ }
+ }
+ }
+
+ return nil
+}
+
+// VaultList list of Vaults
+type VaultList struct {
+ autorest.Response `json:"-"`
+ // Value - A list of vaults
+ Value *[]Vault `json:"value,omitempty"`
+}
+
+// VaultProperties vault properties
+type VaultProperties struct {
+ // VaultName - Vault Name
+ VaultName *string `json:"vaultName,omitempty"`
+}
+
+// Volume volume resource
+type Volume struct {
+ autorest.Response `json:"-"`
+ // Location - Resource location
+ Location *string `json:"location,omitempty"`
+ // ID - READ-ONLY; Resource Id
+ ID *string `json:"id,omitempty"`
+ // Name - READ-ONLY; Resource name
+ Name *string `json:"name,omitempty"`
+ // Etag - READ-ONLY; A unique read-only string that changes whenever the resource is updated.
+ Etag *string `json:"etag,omitempty"`
+ // Type - READ-ONLY; Resource type
+ Type *string `json:"type,omitempty"`
+ // Tags - Resource tags
+ Tags map[string]*string `json:"tags"`
+ // VolumeProperties - Volume properties
+ *VolumeProperties `json:"properties,omitempty"`
+ // SystemData - READ-ONLY; The system meta data relating to this resource.
+ SystemData *SystemData `json:"systemData,omitempty"`
+}
+
+// MarshalJSON is the custom marshaler for Volume.
+func (vVar Volume) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]interface{})
+ if vVar.Location != nil {
+ objectMap["location"] = vVar.Location
+ }
+ if vVar.Tags != nil {
+ objectMap["tags"] = vVar.Tags
+ }
+ if vVar.VolumeProperties != nil {
+ objectMap["properties"] = vVar.VolumeProperties
+ }
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON is the custom unmarshaler for Volume struct.
+func (vVar *Volume) UnmarshalJSON(body []byte) error {
+ var m map[string]*json.RawMessage
+ err := json.Unmarshal(body, &m)
+ if err != nil {
+ return err
+ }
+ for k, v := range m {
+ switch k {
+ case "location":
+ if v != nil {
+ var location string
+ err = json.Unmarshal(*v, &location)
+ if err != nil {
+ return err
+ }
+ vVar.Location = &location
+ }
+ case "id":
+ if v != nil {
+ var ID string
+ err = json.Unmarshal(*v, &ID)
+ if err != nil {
+ return err
+ }
+ vVar.ID = &ID
+ }
+ case "name":
+ if v != nil {
+ var name string
+ err = json.Unmarshal(*v, &name)
+ if err != nil {
+ return err
+ }
+ vVar.Name = &name
+ }
+ case "etag":
+ if v != nil {
+ var etag string
+ err = json.Unmarshal(*v, &etag)
+ if err != nil {
+ return err
+ }
+ vVar.Etag = &etag
+ }
+ case "type":
+ if v != nil {
+ var typeVar string
+ err = json.Unmarshal(*v, &typeVar)
+ if err != nil {
+ return err
+ }
+ vVar.Type = &typeVar
+ }
+ case "tags":
+ if v != nil {
+ var tags map[string]*string
+ err = json.Unmarshal(*v, &tags)
+ if err != nil {
+ return err
+ }
+ vVar.Tags = tags
+ }
+ case "properties":
+ if v != nil {
+ var volumeProperties VolumeProperties
+ err = json.Unmarshal(*v, &volumeProperties)
+ if err != nil {
+ return err
+ }
+ vVar.VolumeProperties = &volumeProperties
+ }
+ case "systemData":
+ if v != nil {
+ var systemData SystemData
+ err = json.Unmarshal(*v, &systemData)
+ if err != nil {
+ return err
+ }
+ vVar.SystemData = &systemData
+ }
+ }
+ }
+
+ return nil
+}
+
+// VolumeBackupProperties volume Backup Properties
+type VolumeBackupProperties struct {
+ // BackupPolicyID - Backup Policy Resource ID
+ BackupPolicyID *string `json:"backupPolicyId,omitempty"`
+ // PolicyEnforced - Policy Enforced
+ PolicyEnforced *bool `json:"policyEnforced,omitempty"`
+ // VaultID - Vault Resource ID
+ VaultID *string `json:"vaultId,omitempty"`
+ // BackupEnabled - Backup Enabled
+ BackupEnabled *bool `json:"backupEnabled,omitempty"`
+}
+
+// VolumeBackups volume details using the backup policy
+type VolumeBackups struct {
+ // VolumeName - Volume name
+ VolumeName *string `json:"volumeName,omitempty"`
+ // BackupsCount - Total count of backups for volume
+ BackupsCount *int32 `json:"backupsCount,omitempty"`
+ // PolicyEnabled - Policy enabled
+ PolicyEnabled *bool `json:"policyEnabled,omitempty"`
+}
+
+// VolumeGroup volume group resource
+type VolumeGroup struct {
+ // Location - Resource location
+ Location *string `json:"location,omitempty"`
+ // ID - READ-ONLY; Resource Id
+ ID *string `json:"id,omitempty"`
+ // Name - READ-ONLY; Resource name
+ Name *string `json:"name,omitempty"`
+ // Type - READ-ONLY; Resource type
+ Type *string `json:"type,omitempty"`
+ // Tags - Resource tags
+ Tags map[string]*string `json:"tags"`
+ // VolumeGroupListProperties - Volume group properties
+ *VolumeGroupListProperties `json:"properties,omitempty"`
+}
+
+// MarshalJSON is the custom marshaler for VolumeGroup.
+func (vg VolumeGroup) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]interface{})
+ if vg.Location != nil {
+ objectMap["location"] = vg.Location
+ }
+ if vg.Tags != nil {
+ objectMap["tags"] = vg.Tags
+ }
+ if vg.VolumeGroupListProperties != nil {
+ objectMap["properties"] = vg.VolumeGroupListProperties
+ }
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON is the custom unmarshaler for VolumeGroup struct.
+func (vg *VolumeGroup) UnmarshalJSON(body []byte) error {
+ var m map[string]*json.RawMessage
+ err := json.Unmarshal(body, &m)
+ if err != nil {
+ return err
+ }
+ for k, v := range m {
+ switch k {
+ case "location":
+ if v != nil {
+ var location string
+ err = json.Unmarshal(*v, &location)
+ if err != nil {
+ return err
+ }
+ vg.Location = &location
+ }
+ case "id":
+ if v != nil {
+ var ID string
+ err = json.Unmarshal(*v, &ID)
+ if err != nil {
+ return err
+ }
+ vg.ID = &ID
+ }
+ case "name":
+ if v != nil {
+ var name string
+ err = json.Unmarshal(*v, &name)
+ if err != nil {
+ return err
+ }
+ vg.Name = &name
+ }
+ case "type":
+ if v != nil {
+ var typeVar string
+ err = json.Unmarshal(*v, &typeVar)
+ if err != nil {
+ return err
+ }
+ vg.Type = &typeVar
+ }
+ case "tags":
+ if v != nil {
+ var tags map[string]*string
+ err = json.Unmarshal(*v, &tags)
+ if err != nil {
+ return err
+ }
+ vg.Tags = tags
+ }
+ case "properties":
+ if v != nil {
+ var volumeGroupListProperties VolumeGroupListProperties
+ err = json.Unmarshal(*v, &volumeGroupListProperties)
+ if err != nil {
+ return err
+ }
+ vg.VolumeGroupListProperties = &volumeGroupListProperties
+ }
+ }
+ }
+
+ return nil
+}
+
+// VolumeGroupDetails volume group resource for create
+type VolumeGroupDetails struct {
+ autorest.Response `json:"-"`
+ // Location - Resource location
+ Location *string `json:"location,omitempty"`
+ // ID - READ-ONLY; Resource Id
+ ID *string `json:"id,omitempty"`
+ // Name - READ-ONLY; Resource name
+ Name *string `json:"name,omitempty"`
+ // Type - READ-ONLY; Resource type
+ Type *string `json:"type,omitempty"`
+ // Tags - Resource tags
+ Tags map[string]*string `json:"tags"`
+ // VolumeGroupProperties - Volume group properties
+ *VolumeGroupProperties `json:"properties,omitempty"`
+}
+
+// MarshalJSON is the custom marshaler for VolumeGroupDetails.
+func (vgd VolumeGroupDetails) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]interface{})
+ if vgd.Location != nil {
+ objectMap["location"] = vgd.Location
+ }
+ if vgd.Tags != nil {
+ objectMap["tags"] = vgd.Tags
+ }
+ if vgd.VolumeGroupProperties != nil {
+ objectMap["properties"] = vgd.VolumeGroupProperties
+ }
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON is the custom unmarshaler for VolumeGroupDetails struct.
+func (vgd *VolumeGroupDetails) UnmarshalJSON(body []byte) error {
+ var m map[string]*json.RawMessage
+ err := json.Unmarshal(body, &m)
+ if err != nil {
+ return err
+ }
+ for k, v := range m {
+ switch k {
+ case "location":
+ if v != nil {
+ var location string
+ err = json.Unmarshal(*v, &location)
+ if err != nil {
+ return err
+ }
+ vgd.Location = &location
+ }
+ case "id":
+ if v != nil {
+ var ID string
+ err = json.Unmarshal(*v, &ID)
+ if err != nil {
+ return err
+ }
+ vgd.ID = &ID
+ }
+ case "name":
+ if v != nil {
+ var name string
+ err = json.Unmarshal(*v, &name)
+ if err != nil {
+ return err
+ }
+ vgd.Name = &name
+ }
+ case "type":
+ if v != nil {
+ var typeVar string
+ err = json.Unmarshal(*v, &typeVar)
+ if err != nil {
+ return err
+ }
+ vgd.Type = &typeVar
+ }
+ case "tags":
+ if v != nil {
+ var tags map[string]*string
+ err = json.Unmarshal(*v, &tags)
+ if err != nil {
+ return err
+ }
+ vgd.Tags = tags
+ }
+ case "properties":
+ if v != nil {
+ var volumeGroupProperties VolumeGroupProperties
+ err = json.Unmarshal(*v, &volumeGroupProperties)
+ if err != nil {
+ return err
+ }
+ vgd.VolumeGroupProperties = &volumeGroupProperties
+ }
+ }
+ }
+
+ return nil
+}
+
+// VolumeGroupList list of volume group resources
+type VolumeGroupList struct {
+ autorest.Response `json:"-"`
+ // Value - List of volume Groups
+ Value *[]VolumeGroup `json:"value,omitempty"`
+}
+
+// VolumeGroupListProperties volume group properties
+type VolumeGroupListProperties struct {
+ // ProvisioningState - READ-ONLY; Azure lifecycle management
+ ProvisioningState *string `json:"provisioningState,omitempty"`
+ // GroupMetaData - Volume group details
+ GroupMetaData *VolumeGroupMetaData `json:"groupMetaData,omitempty"`
+}
+
+// MarshalJSON is the custom marshaler for VolumeGroupListProperties.
+func (vglp VolumeGroupListProperties) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]interface{})
+ if vglp.GroupMetaData != nil {
+ objectMap["groupMetaData"] = vglp.GroupMetaData
+ }
+ return json.Marshal(objectMap)
+}
+
+// VolumeGroupMetaData volume group properties
+type VolumeGroupMetaData struct {
+ // GroupDescription - Group Description
+ GroupDescription *string `json:"groupDescription,omitempty"`
+ // ApplicationType - Application Type. Possible values include: 'SAPHANA'
+ ApplicationType ApplicationType `json:"applicationType,omitempty"`
+ // ApplicationIdentifier - Application specific identifier
+ ApplicationIdentifier *string `json:"applicationIdentifier,omitempty"`
+ // GlobalPlacementRules - Application specific placement rules for the volume group
+ GlobalPlacementRules *[]PlacementKeyValuePairs `json:"globalPlacementRules,omitempty"`
+ // DeploymentSpecID - Application specific identifier of deployment rules for the volume group
+ DeploymentSpecID *string `json:"deploymentSpecId,omitempty"`
+ // VolumesCount - READ-ONLY; Number of volumes in volume group
+ VolumesCount *int64 `json:"volumesCount,omitempty"`
+}
+
+// MarshalJSON is the custom marshaler for VolumeGroupMetaData.
+func (vgmd VolumeGroupMetaData) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]interface{})
+ if vgmd.GroupDescription != nil {
+ objectMap["groupDescription"] = vgmd.GroupDescription
+ }
+ if vgmd.ApplicationType != "" {
+ objectMap["applicationType"] = vgmd.ApplicationType
+ }
+ if vgmd.ApplicationIdentifier != nil {
+ objectMap["applicationIdentifier"] = vgmd.ApplicationIdentifier
+ }
+ if vgmd.GlobalPlacementRules != nil {
+ objectMap["globalPlacementRules"] = vgmd.GlobalPlacementRules
+ }
+ if vgmd.DeploymentSpecID != nil {
+ objectMap["deploymentSpecId"] = vgmd.DeploymentSpecID
+ }
+ return json.Marshal(objectMap)
+}
+
+// VolumeGroupProperties volume group properties
+type VolumeGroupProperties struct {
+ // ProvisioningState - READ-ONLY; Azure lifecycle management
+ ProvisioningState *string `json:"provisioningState,omitempty"`
+ // GroupMetaData - Volume group details
+ GroupMetaData *VolumeGroupMetaData `json:"groupMetaData,omitempty"`
+ // Volumes - List of volumes from group
+ Volumes *[]VolumeGroupVolumeProperties `json:"volumes,omitempty"`
+}
+
+// MarshalJSON is the custom marshaler for VolumeGroupProperties.
+func (vgp VolumeGroupProperties) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]interface{})
+ if vgp.GroupMetaData != nil {
+ objectMap["groupMetaData"] = vgp.GroupMetaData
+ }
+ if vgp.Volumes != nil {
+ objectMap["volumes"] = vgp.Volumes
+ }
+ return json.Marshal(objectMap)
+}
+
+// VolumeGroupsCreateFuture an abstraction for monitoring and retrieving the results of a long-running
+// operation.
+type VolumeGroupsCreateFuture struct {
+ azure.FutureAPI
+ // Result returns the result of the asynchronous operation.
+ // If the operation has not completed it will return an error.
+ Result func(VolumeGroupsClient) (VolumeGroupDetails, error)
+}
+
+// UnmarshalJSON is the custom unmarshaller for CreateFuture.
+func (future *VolumeGroupsCreateFuture) UnmarshalJSON(body []byte) error {
+ var azFuture azure.Future
+ if err := json.Unmarshal(body, &azFuture); err != nil {
+ return err
+ }
+ future.FutureAPI = &azFuture
+ future.Result = future.result
+ return nil
+}
+
+// result is the default implementation for VolumeGroupsCreateFuture.Result.
+func (future *VolumeGroupsCreateFuture) result(client VolumeGroupsClient) (vgd VolumeGroupDetails, err error) {
+ var done bool
+ done, err = future.DoneWithContext(context.Background(), client)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "netapp.VolumeGroupsCreateFuture", "Result", future.Response(), "Polling failure")
+ return
+ }
+ if !done {
+ vgd.Response.Response = future.Response()
+ err = azure.NewAsyncOpIncompleteError("netapp.VolumeGroupsCreateFuture")
+ return
+ }
+ sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
+ if vgd.Response.Response, err = future.GetResult(sender); err == nil && vgd.Response.Response.StatusCode != http.StatusNoContent {
+ vgd, err = client.CreateResponder(vgd.Response.Response)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "netapp.VolumeGroupsCreateFuture", "Result", vgd.Response.Response, "Failure responding to request")
+ }
+ }
+ return
+}
+
+// VolumeGroupsDeleteFuture an abstraction for monitoring and retrieving the results of a long-running
+// operation.
+type VolumeGroupsDeleteFuture struct {
+ azure.FutureAPI
+ // Result returns the result of the asynchronous operation.
+ // If the operation has not completed it will return an error.
+ Result func(VolumeGroupsClient) (autorest.Response, error)
+}
+
+// UnmarshalJSON is the custom unmarshaller for CreateFuture.
+func (future *VolumeGroupsDeleteFuture) UnmarshalJSON(body []byte) error {
+ var azFuture azure.Future
+ if err := json.Unmarshal(body, &azFuture); err != nil {
+ return err
+ }
+ future.FutureAPI = &azFuture
+ future.Result = future.result
+ return nil
+}
+
+// result is the default implementation for VolumeGroupsDeleteFuture.Result.
+func (future *VolumeGroupsDeleteFuture) result(client VolumeGroupsClient) (ar autorest.Response, err error) {
+ var done bool
+ done, err = future.DoneWithContext(context.Background(), client)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "netapp.VolumeGroupsDeleteFuture", "Result", future.Response(), "Polling failure")
+ return
+ }
+ if !done {
+ ar.Response = future.Response()
+ err = azure.NewAsyncOpIncompleteError("netapp.VolumeGroupsDeleteFuture")
+ return
+ }
+ ar.Response = future.Response()
+ return
+}
+
+// VolumeGroupVolumeProperties volume resource
+type VolumeGroupVolumeProperties struct {
+ // ID - READ-ONLY; Resource Id
+ ID *string `json:"id,omitempty"`
+ // Name - Resource name
+ Name *string `json:"name,omitempty"`
+ // Type - READ-ONLY; Resource type
+ Type *string `json:"type,omitempty"`
+ // Tags - Resource tags
+ Tags map[string]*string `json:"tags"`
+ // VolumeProperties - Volume properties
+ *VolumeProperties `json:"properties,omitempty"`
+}
+
+// MarshalJSON is the custom marshaler for VolumeGroupVolumeProperties.
+func (vgvp VolumeGroupVolumeProperties) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]interface{})
+ if vgvp.Name != nil {
+ objectMap["name"] = vgvp.Name
+ }
+ if vgvp.Tags != nil {
+ objectMap["tags"] = vgvp.Tags
+ }
+ if vgvp.VolumeProperties != nil {
+ objectMap["properties"] = vgvp.VolumeProperties
+ }
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON is the custom unmarshaler for VolumeGroupVolumeProperties struct.
+func (vgvp *VolumeGroupVolumeProperties) UnmarshalJSON(body []byte) error {
+ var m map[string]*json.RawMessage
+ err := json.Unmarshal(body, &m)
+ if err != nil {
+ return err
+ }
+ for k, v := range m {
+ switch k {
+ case "id":
+ if v != nil {
+ var ID string
+ err = json.Unmarshal(*v, &ID)
+ if err != nil {
+ return err
+ }
+ vgvp.ID = &ID
+ }
+ case "name":
+ if v != nil {
+ var name string
+ err = json.Unmarshal(*v, &name)
+ if err != nil {
+ return err
+ }
+ vgvp.Name = &name
+ }
+ case "type":
+ if v != nil {
+ var typeVar string
+ err = json.Unmarshal(*v, &typeVar)
+ if err != nil {
+ return err
+ }
+ vgvp.Type = &typeVar
+ }
+ case "tags":
+ if v != nil {
+ var tags map[string]*string
+ err = json.Unmarshal(*v, &tags)
+ if err != nil {
+ return err
+ }
+ vgvp.Tags = tags
+ }
+ case "properties":
+ if v != nil {
+ var volumeProperties VolumeProperties
+ err = json.Unmarshal(*v, &volumeProperties)
+ if err != nil {
+ return err
+ }
+ vgvp.VolumeProperties = &volumeProperties
+ }
+ }
+ }
+
+ return nil
+}
+
+// VolumeList list of volume resources
+type VolumeList struct {
+ autorest.Response `json:"-"`
+ // Value - List of volumes
+ Value *[]Volume `json:"value,omitempty"`
+ // NextLink - URL to get the next set of results.
+ NextLink *string `json:"nextLink,omitempty"`
+}
+
+// VolumeListIterator provides access to a complete listing of Volume values.
+type VolumeListIterator struct {
+ i int
+ page VolumeListPage
+}
+
+// NextWithContext advances to the next value. If there was an error making
+// the request the iterator does not advance and the error is returned.
+func (iter *VolumeListIterator) NextWithContext(ctx context.Context) (err error) {
+ if tracing.IsEnabled() {
+ ctx = tracing.StartSpan(ctx, fqdn+"/VolumeListIterator.NextWithContext")
+ defer func() {
+ sc := -1
+ if iter.Response().Response.Response != nil {
+ sc = iter.Response().Response.Response.StatusCode
+ }
+ tracing.EndSpan(ctx, sc, err)
+ }()
+ }
+ iter.i++
+ if iter.i < len(iter.page.Values()) {
+ return nil
+ }
+ err = iter.page.NextWithContext(ctx)
+ if err != nil {
+ iter.i--
+ return err
+ }
+ iter.i = 0
+ return nil
+}
+
+// Next advances to the next value. If there was an error making
+// the request the iterator does not advance and the error is returned.
+// Deprecated: Use NextWithContext() instead.
+func (iter *VolumeListIterator) Next() error {
+ return iter.NextWithContext(context.Background())
+}
+
+// NotDone returns true if the enumeration should be started or is not yet complete.
+func (iter VolumeListIterator) NotDone() bool {
+ return iter.page.NotDone() && iter.i < len(iter.page.Values())
+}
+
+// Response returns the raw server response from the last page request.
+func (iter VolumeListIterator) Response() VolumeList {
+ return iter.page.Response()
+}
+
+// Value returns the current value or a zero-initialized value if the
+// iterator has advanced beyond the end of the collection.
+func (iter VolumeListIterator) Value() Volume {
+ if !iter.page.NotDone() {
+ return Volume{}
+ }
+ return iter.page.Values()[iter.i]
+}
+
+// Creates a new instance of the VolumeListIterator type.
+func NewVolumeListIterator(page VolumeListPage) VolumeListIterator {
+ return VolumeListIterator{page: page}
+}
+
+// IsEmpty returns true if the ListResult contains no values.
+func (vl VolumeList) IsEmpty() bool {
+ return vl.Value == nil || len(*vl.Value) == 0
+}
+
+// hasNextLink returns true if the NextLink is not empty.
+func (vl VolumeList) hasNextLink() bool {
+ return vl.NextLink != nil && len(*vl.NextLink) != 0
+}
+
+// volumeListPreparer prepares a request to retrieve the next set of results.
+// It returns nil if no more results exist.
+func (vl VolumeList) volumeListPreparer(ctx context.Context) (*http.Request, error) {
+ if !vl.hasNextLink() {
+ return nil, nil
+ }
+ return autorest.Prepare((&http.Request{}).WithContext(ctx),
+ autorest.AsJSON(),
+ autorest.AsGet(),
+ autorest.WithBaseURL(to.String(vl.NextLink)))
+}
+
+// VolumeListPage contains a page of Volume values.
+type VolumeListPage struct {
+ fn func(context.Context, VolumeList) (VolumeList, error)
+ vl VolumeList
+}
+
+// NextWithContext advances to the next page of values. If there was an error making
+// the request the page does not advance and the error is returned.
+func (page *VolumeListPage) NextWithContext(ctx context.Context) (err error) {
+ if tracing.IsEnabled() {
+ ctx = tracing.StartSpan(ctx, fqdn+"/VolumeListPage.NextWithContext")
+ defer func() {
+ sc := -1
+ if page.Response().Response.Response != nil {
+ sc = page.Response().Response.Response.StatusCode
+ }
+ tracing.EndSpan(ctx, sc, err)
+ }()
+ }
+ for {
+ next, err := page.fn(ctx, page.vl)
+ if err != nil {
+ return err
+ }
+ page.vl = next
+ if !next.hasNextLink() || !next.IsEmpty() {
+ break
+ }
+ }
+ return nil
+}
+
+// Next advances to the next page of values. If there was an error making
+// the request the page does not advance and the error is returned.
+// Deprecated: Use NextWithContext() instead.
+func (page *VolumeListPage) Next() error {
+ return page.NextWithContext(context.Background())
+}
+
+// NotDone returns true if the page enumeration should be started or is not yet complete.
+func (page VolumeListPage) NotDone() bool {
+ return !page.vl.IsEmpty()
+}
+
+// Response returns the raw server response from the last page request.
+func (page VolumeListPage) Response() VolumeList {
+ return page.vl
+}
+
+// Values returns the slice of values for the current page or nil if there are no values.
+func (page VolumeListPage) Values() []Volume {
+ if page.vl.IsEmpty() {
+ return nil
+ }
+ return *page.vl.Value
+}
+
+// Creates a new instance of the VolumeListPage type.
+func NewVolumeListPage(cur VolumeList, getNextPage func(context.Context, VolumeList) (VolumeList, error)) VolumeListPage {
+ return VolumeListPage{
+ fn: getNextPage,
+ vl: cur,
+ }
+}
+
+// VolumePatch volume patch resource
+type VolumePatch struct {
+ // Location - Resource location
+ Location *string `json:"location,omitempty"`
+ // ID - READ-ONLY; Resource Id
+ ID *string `json:"id,omitempty"`
+ // Name - READ-ONLY; Resource name
+ Name *string `json:"name,omitempty"`
+ // Type - READ-ONLY; Resource type
+ Type *string `json:"type,omitempty"`
+ // Tags - Resource tags
+ Tags map[string]*string `json:"tags"`
+ // VolumePatchProperties - Patchable volume properties
+ *VolumePatchProperties `json:"properties,omitempty"`
+}
+
+// MarshalJSON is the custom marshaler for VolumePatch.
+func (vp VolumePatch) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]interface{})
+ if vp.Location != nil {
+ objectMap["location"] = vp.Location
+ }
+ if vp.Tags != nil {
+ objectMap["tags"] = vp.Tags
+ }
+ if vp.VolumePatchProperties != nil {
+ objectMap["properties"] = vp.VolumePatchProperties
+ }
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON is the custom unmarshaler for VolumePatch struct.
+func (vp *VolumePatch) UnmarshalJSON(body []byte) error {
+ var m map[string]*json.RawMessage
+ err := json.Unmarshal(body, &m)
+ if err != nil {
+ return err
+ }
+ for k, v := range m {
+ switch k {
+ case "location":
+ if v != nil {
+ var location string
+ err = json.Unmarshal(*v, &location)
+ if err != nil {
+ return err
+ }
+ vp.Location = &location
+ }
+ case "id":
+ if v != nil {
+ var ID string
+ err = json.Unmarshal(*v, &ID)
+ if err != nil {
+ return err
+ }
+ vp.ID = &ID
+ }
+ case "name":
+ if v != nil {
+ var name string
+ err = json.Unmarshal(*v, &name)
+ if err != nil {
+ return err
+ }
+ vp.Name = &name
+ }
+ case "type":
+ if v != nil {
+ var typeVar string
+ err = json.Unmarshal(*v, &typeVar)
+ if err != nil {
+ return err
+ }
+ vp.Type = &typeVar
+ }
+ case "tags":
+ if v != nil {
+ var tags map[string]*string
+ err = json.Unmarshal(*v, &tags)
+ if err != nil {
+ return err
+ }
+ vp.Tags = tags
+ }
+ case "properties":
+ if v != nil {
+ var volumePatchProperties VolumePatchProperties
+ err = json.Unmarshal(*v, &volumePatchProperties)
+ if err != nil {
+ return err
+ }
+ vp.VolumePatchProperties = &volumePatchProperties
+ }
+ }
+ }
+
+ return nil
+}
+
+// VolumePatchProperties patchable volume properties
+type VolumePatchProperties struct {
+ // ServiceLevel - Possible values include: 'ServiceLevelStandard', 'ServiceLevelPremium', 'ServiceLevelUltra', 'ServiceLevelStandardZRS'
+ ServiceLevel ServiceLevel `json:"serviceLevel,omitempty"`
+ // UsageThreshold - Maximum storage quota allowed for a file system in bytes. This is a soft quota used for alerting only. Minimum size is 100 GiB. Upper limit is 100TiB. Specified in bytes.
+ UsageThreshold *int64 `json:"usageThreshold,omitempty"`
+ // ExportPolicy - Set of export policy rules
+ ExportPolicy *VolumePatchPropertiesExportPolicy `json:"exportPolicy,omitempty"`
+ ThroughputMibps *float64 `json:"throughputMibps,omitempty"`
+ // DataProtection - DataProtection type volumes include an object containing details of the replication
+ DataProtection *VolumePatchPropertiesDataProtection `json:"dataProtection,omitempty"`
+ // IsDefaultQuotaEnabled - Specifies if default quota is enabled for the volume.
+ IsDefaultQuotaEnabled *bool `json:"isDefaultQuotaEnabled,omitempty"`
+ // DefaultUserQuotaInKiBs - Default user quota for volume in KiBs. If isDefaultQuotaEnabled is set, the minimum value of 4 KiBs applies .
+ DefaultUserQuotaInKiBs *int64 `json:"defaultUserQuotaInKiBs,omitempty"`
+ // DefaultGroupQuotaInKiBs - Default group quota for volume in KiBs. If isDefaultQuotaEnabled is set, the minimum value of 4 KiBs applies.
+ DefaultGroupQuotaInKiBs *int64 `json:"defaultGroupQuotaInKiBs,omitempty"`
+ // UnixPermissions - UNIX permissions for NFS volume accepted in octal 4 digit format. First digit selects the set user ID(4), set group ID (2) and sticky (1) attributes. Second digit selects permission for the owner of the file: read (4), write (2) and execute (1). Third selects permissions for other users in the same group. the fourth for other users not in the group. 0755 - gives read/write/execute permissions to owner and read/execute to group and other users.
+ UnixPermissions *string `json:"unixPermissions,omitempty"`
+}
+
+// VolumePatchPropertiesDataProtection dataProtection type volumes include an object containing details of
+// the replication
+type VolumePatchPropertiesDataProtection struct {
+ // Backup - Backup Properties
+ Backup *VolumeBackupProperties `json:"backup,omitempty"`
+ // Snapshot - Snapshot properties.
+ Snapshot *VolumeSnapshotProperties `json:"snapshot,omitempty"`
+}
+
+// VolumePatchPropertiesExportPolicy set of export policy rules
+type VolumePatchPropertiesExportPolicy struct {
+ // Rules - Export policy rule
+ Rules *[]ExportPolicyRule `json:"rules,omitempty"`
+}
+
+// VolumeProperties volume properties
+type VolumeProperties struct {
+ // FileSystemID - READ-ONLY; Unique FileSystem Identifier.
+ FileSystemID *string `json:"fileSystemId,omitempty"`
+ // CreationToken - A unique file path for the volume. Used when creating mount targets
+ CreationToken *string `json:"creationToken,omitempty"`
+ // ServiceLevel - Possible values include: 'ServiceLevelStandard', 'ServiceLevelPremium', 'ServiceLevelUltra', 'ServiceLevelStandardZRS'
+ ServiceLevel ServiceLevel `json:"serviceLevel,omitempty"`
+ // UsageThreshold - Maximum storage quota allowed for a file system in bytes. This is a soft quota used for alerting only. Minimum size is 100 GiB. Upper limit is 100TiB. Specified in bytes.
+ UsageThreshold *int64 `json:"usageThreshold,omitempty"`
+ // ExportPolicy - Set of export policy rules
+ ExportPolicy *VolumePropertiesExportPolicy `json:"exportPolicy,omitempty"`
+ // ProtocolTypes - Set of protocol types, default NFSv3, CIFS for SMB protocol
+ ProtocolTypes *[]string `json:"protocolTypes,omitempty"`
+ // ProvisioningState - READ-ONLY; Azure lifecycle management
+ ProvisioningState *string `json:"provisioningState,omitempty"`
+ // SnapshotID - UUID v4 or resource identifier used to identify the Snapshot.
+ SnapshotID *string `json:"snapshotId,omitempty"`
+ // BackupID - UUID v4 or resource identifier used to identify the Backup.
+ BackupID *string `json:"backupId,omitempty"`
+ // BaremetalTenantID - READ-ONLY; Unique Baremetal Tenant Identifier.
+ BaremetalTenantID *string `json:"baremetalTenantId,omitempty"`
+ // SubnetID - The Azure Resource URI for a delegated subnet. Must have the delegation Microsoft.NetApp/volumes
+ SubnetID *string `json:"subnetId,omitempty"`
+ // NetworkFeatures - Basic network, or Standard features available to the volume. Possible values include: 'Basic', 'Standard'
+ NetworkFeatures NetworkFeatures `json:"networkFeatures,omitempty"`
+ // NetworkSiblingSetID - READ-ONLY; Network Sibling Set ID for the the group of volumes sharing networking resources.
+ NetworkSiblingSetID *string `json:"networkSiblingSetId,omitempty"`
+ // StorageToNetworkProximity - READ-ONLY; Provides storage to network proximity information for the volume. Possible values include: 'Default', 'T1', 'T2'
+ StorageToNetworkProximity VolumeStorageToNetworkProximity `json:"storageToNetworkProximity,omitempty"`
+ // MountTargets - READ-ONLY; List of mount targets
+ MountTargets *[]MountTargetProperties `json:"mountTargets,omitempty"`
+ // VolumeType - What type of volume is this. For destination volumes in Cross Region Replication, set type to DataProtection
+ VolumeType *string `json:"volumeType,omitempty"`
+ // DataProtection - DataProtection type volumes include an object containing details of the replication
+ DataProtection *VolumePropertiesDataProtection `json:"dataProtection,omitempty"`
+ // IsRestoring - Restoring
+ IsRestoring *bool `json:"isRestoring,omitempty"`
+ // SnapshotDirectoryVisible - If enabled (true) the volume will contain a read-only snapshot directory which provides access to each of the volume's snapshots (default to true).
+ SnapshotDirectoryVisible *bool `json:"snapshotDirectoryVisible,omitempty"`
+ // KerberosEnabled - Describe if a volume is KerberosEnabled. To be use with swagger version 2020-05-01 or later
+ KerberosEnabled *bool `json:"kerberosEnabled,omitempty"`
+ // SecurityStyle - The security style of volume, default unix, defaults to ntfs for dual protocol or CIFS protocol. Possible values include: 'Ntfs', 'Unix'
+ SecurityStyle SecurityStyle `json:"securityStyle,omitempty"`
+ // SmbEncryption - Enables encryption for in-flight smb3 data. Only applicable for SMB/DualProtocol volume. To be used with swagger version 2020-08-01 or later
+ SmbEncryption *bool `json:"smbEncryption,omitempty"`
+ // SmbContinuouslyAvailable - Enables continuously available share property for smb volume. Only applicable for SMB volume
+ SmbContinuouslyAvailable *bool `json:"smbContinuouslyAvailable,omitempty"`
+ ThroughputMibps *float64 `json:"throughputMibps,omitempty"`
+ // EncryptionKeySource - Encryption Key Source. Possible values are: 'Microsoft.NetApp'
+ EncryptionKeySource *string `json:"encryptionKeySource,omitempty"`
+ // LdapEnabled - Specifies whether LDAP is enabled or not for a given NFS volume.
+ LdapEnabled *bool `json:"ldapEnabled,omitempty"`
+ // CoolAccess - Specifies whether Cool Access(tiering) is enabled for the volume.
+ CoolAccess *bool `json:"coolAccess,omitempty"`
+ // CoolnessPeriod - Specifies the number of days after which data that is not accessed by clients will be tiered.
+ CoolnessPeriod *int32 `json:"coolnessPeriod,omitempty"`
+ // UnixPermissions - UNIX permissions for NFS volume accepted in octal 4 digit format. First digit selects the set user ID(4), set group ID (2) and sticky (1) attributes. Second digit selects permission for the owner of the file: read (4), write (2) and execute (1). Third selects permissions for other users in the same group. the fourth for other users not in the group. 0755 - gives read/write/execute permissions to owner and read/execute to group and other users.
+ UnixPermissions *string `json:"unixPermissions,omitempty"`
+ // CloneProgress - READ-ONLY; When a volume is being restored from another volume's snapshot, will show the percentage completion of this cloning process. When this value is empty/null there is no cloning process currently happening on this volume. This value will update every 5 minutes during cloning.
+ CloneProgress *int32 `json:"cloneProgress,omitempty"`
+ // AvsDataStore - Specifies whether the volume is enabled for Azure VMware Solution (AVS) datastore purpose. Possible values include: 'Enabled', 'Disabled'
+ AvsDataStore AvsDataStore `json:"avsDataStore,omitempty"`
+ // IsDefaultQuotaEnabled - Specifies if default quota is enabled for the volume.
+ IsDefaultQuotaEnabled *bool `json:"isDefaultQuotaEnabled,omitempty"`
+ // DefaultUserQuotaInKiBs - Default user quota for volume in KiBs. If isDefaultQuotaEnabled is set, the minimum value of 4 KiBs applies .
+ DefaultUserQuotaInKiBs *int64 `json:"defaultUserQuotaInKiBs,omitempty"`
+ // DefaultGroupQuotaInKiBs - Default group quota for volume in KiBs. If isDefaultQuotaEnabled is set, the minimum value of 4 KiBs applies.
+ DefaultGroupQuotaInKiBs *int64 `json:"defaultGroupQuotaInKiBs,omitempty"`
+ // MaximumNumberOfFiles - READ-ONLY; Maximum number of files allowed. Needs a service request in order to be changed. Only allowed to be changed if volume quota is more than 4TiB.
+ MaximumNumberOfFiles *int64 `json:"maximumNumberOfFiles,omitempty"`
+ // VolumeGroupName - READ-ONLY; Volume Group Name
+ VolumeGroupName *string `json:"volumeGroupName,omitempty"`
+ // CapacityPoolResourceID - Pool Resource Id used in case of creating a volume through volume group
+ CapacityPoolResourceID *string `json:"capacityPoolResourceId,omitempty"`
+ // ProximityPlacementGroup - Proximity placement group associated with the volume
+ ProximityPlacementGroup *string `json:"proximityPlacementGroup,omitempty"`
+ // T2Network - READ-ONLY; T2 network information
+ T2Network *string `json:"t2Network,omitempty"`
+ // VolumeSpecName - Volume spec name is the application specific designation or identifier for the particular volume in a volume group for e.g. data, log
+ VolumeSpecName *string `json:"volumeSpecName,omitempty"`
+ // PlacementRules - Application specific placement rules for the particular volume
+ PlacementRules *[]PlacementKeyValuePairs `json:"placementRules,omitempty"`
+ // EnableSubvolumes - Flag indicating whether subvolume operations are enabled on the volume. Possible values include: 'EnableSubvolumesEnabled', 'EnableSubvolumesDisabled'
+ EnableSubvolumes EnableSubvolumes `json:"enableSubvolumes,omitempty"`
+}
+
+// MarshalJSON is the custom marshaler for VolumeProperties.
+func (vp VolumeProperties) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]interface{})
+ if vp.CreationToken != nil {
+ objectMap["creationToken"] = vp.CreationToken
+ }
+ if vp.ServiceLevel != "" {
+ objectMap["serviceLevel"] = vp.ServiceLevel
+ }
+ if vp.UsageThreshold != nil {
+ objectMap["usageThreshold"] = vp.UsageThreshold
+ }
+ if vp.ExportPolicy != nil {
+ objectMap["exportPolicy"] = vp.ExportPolicy
+ }
+ if vp.ProtocolTypes != nil {
+ objectMap["protocolTypes"] = vp.ProtocolTypes
+ }
+ if vp.SnapshotID != nil {
+ objectMap["snapshotId"] = vp.SnapshotID
+ }
+ if vp.BackupID != nil {
+ objectMap["backupId"] = vp.BackupID
+ }
+ if vp.SubnetID != nil {
+ objectMap["subnetId"] = vp.SubnetID
+ }
+ if vp.NetworkFeatures != "" {
+ objectMap["networkFeatures"] = vp.NetworkFeatures
+ }
+ if vp.VolumeType != nil {
+ objectMap["volumeType"] = vp.VolumeType
+ }
+ if vp.DataProtection != nil {
+ objectMap["dataProtection"] = vp.DataProtection
+ }
+ if vp.IsRestoring != nil {
+ objectMap["isRestoring"] = vp.IsRestoring
+ }
+ if vp.SnapshotDirectoryVisible != nil {
+ objectMap["snapshotDirectoryVisible"] = vp.SnapshotDirectoryVisible
+ }
+ if vp.KerberosEnabled != nil {
+ objectMap["kerberosEnabled"] = vp.KerberosEnabled
+ }
+ if vp.SecurityStyle != "" {
+ objectMap["securityStyle"] = vp.SecurityStyle
+ }
+ if vp.SmbEncryption != nil {
+ objectMap["smbEncryption"] = vp.SmbEncryption
+ }
+ if vp.SmbContinuouslyAvailable != nil {
+ objectMap["smbContinuouslyAvailable"] = vp.SmbContinuouslyAvailable
+ }
+ if vp.ThroughputMibps != nil {
+ objectMap["throughputMibps"] = vp.ThroughputMibps
+ }
+ if vp.EncryptionKeySource != nil {
+ objectMap["encryptionKeySource"] = vp.EncryptionKeySource
+ }
+ if vp.LdapEnabled != nil {
+ objectMap["ldapEnabled"] = vp.LdapEnabled
+ }
+ if vp.CoolAccess != nil {
+ objectMap["coolAccess"] = vp.CoolAccess
+ }
+ if vp.CoolnessPeriod != nil {
+ objectMap["coolnessPeriod"] = vp.CoolnessPeriod
+ }
+ if vp.UnixPermissions != nil {
+ objectMap["unixPermissions"] = vp.UnixPermissions
+ }
+ if vp.AvsDataStore != "" {
+ objectMap["avsDataStore"] = vp.AvsDataStore
+ }
+ if vp.IsDefaultQuotaEnabled != nil {
+ objectMap["isDefaultQuotaEnabled"] = vp.IsDefaultQuotaEnabled
+ }
+ if vp.DefaultUserQuotaInKiBs != nil {
+ objectMap["defaultUserQuotaInKiBs"] = vp.DefaultUserQuotaInKiBs
+ }
+ if vp.DefaultGroupQuotaInKiBs != nil {
+ objectMap["defaultGroupQuotaInKiBs"] = vp.DefaultGroupQuotaInKiBs
+ }
+ if vp.CapacityPoolResourceID != nil {
+ objectMap["capacityPoolResourceId"] = vp.CapacityPoolResourceID
+ }
+ if vp.ProximityPlacementGroup != nil {
+ objectMap["proximityPlacementGroup"] = vp.ProximityPlacementGroup
+ }
+ if vp.VolumeSpecName != nil {
+ objectMap["volumeSpecName"] = vp.VolumeSpecName
+ }
+ if vp.PlacementRules != nil {
+ objectMap["placementRules"] = vp.PlacementRules
+ }
+ if vp.EnableSubvolumes != "" {
+ objectMap["enableSubvolumes"] = vp.EnableSubvolumes
+ }
+ return json.Marshal(objectMap)
+}
+
+// VolumePropertiesDataProtection dataProtection type volumes include an object containing details of the
+// replication
+type VolumePropertiesDataProtection struct {
+ // Backup - Backup Properties
+ Backup *VolumeBackupProperties `json:"backup,omitempty"`
+ // Replication - Replication properties
+ Replication *ReplicationObject `json:"replication,omitempty"`
+ // Snapshot - Snapshot properties.
+ Snapshot *VolumeSnapshotProperties `json:"snapshot,omitempty"`
+}
+
+// VolumePropertiesExportPolicy set of export policy rules
+type VolumePropertiesExportPolicy struct {
+ // Rules - Export policy rule
+ Rules *[]ExportPolicyRule `json:"rules,omitempty"`
+}
+
+// VolumeRevert revert a volume to the snapshot
+type VolumeRevert struct {
+ // SnapshotID - Resource id of the snapshot
+ SnapshotID *string `json:"snapshotId,omitempty"`
+}
+
+// VolumesAuthorizeReplicationFuture an abstraction for monitoring and retrieving the results of a
+// long-running operation.
+type VolumesAuthorizeReplicationFuture struct {
+ azure.FutureAPI
+ // Result returns the result of the asynchronous operation.
+ // If the operation has not completed it will return an error.
+ Result func(VolumesClient) (autorest.Response, error)
+}
+
+// UnmarshalJSON is the custom unmarshaller for CreateFuture.
+func (future *VolumesAuthorizeReplicationFuture) UnmarshalJSON(body []byte) error {
+ var azFuture azure.Future
+ if err := json.Unmarshal(body, &azFuture); err != nil {
+ return err
+ }
+ future.FutureAPI = &azFuture
+ future.Result = future.result
+ return nil
+}
+
+// result is the default implementation for VolumesAuthorizeReplicationFuture.Result.
+func (future *VolumesAuthorizeReplicationFuture) result(client VolumesClient) (ar autorest.Response, err error) {
+ var done bool
+ done, err = future.DoneWithContext(context.Background(), client)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "netapp.VolumesAuthorizeReplicationFuture", "Result", future.Response(), "Polling failure")
+ return
+ }
+ if !done {
+ ar.Response = future.Response()
+ err = azure.NewAsyncOpIncompleteError("netapp.VolumesAuthorizeReplicationFuture")
+ return
+ }
+ ar.Response = future.Response()
+ return
+}
+
+// VolumesBreakReplicationFuture an abstraction for monitoring and retrieving the results of a long-running
+// operation.
+type VolumesBreakReplicationFuture struct {
+ azure.FutureAPI
+ // Result returns the result of the asynchronous operation.
+ // If the operation has not completed it will return an error.
+ Result func(VolumesClient) (autorest.Response, error)
+}
+
+// UnmarshalJSON is the custom unmarshaller for CreateFuture.
+func (future *VolumesBreakReplicationFuture) UnmarshalJSON(body []byte) error {
+ var azFuture azure.Future
+ if err := json.Unmarshal(body, &azFuture); err != nil {
+ return err
+ }
+ future.FutureAPI = &azFuture
+ future.Result = future.result
+ return nil
+}
+
+// result is the default implementation for VolumesBreakReplicationFuture.Result.
+func (future *VolumesBreakReplicationFuture) result(client VolumesClient) (ar autorest.Response, err error) {
+ var done bool
+ done, err = future.DoneWithContext(context.Background(), client)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "netapp.VolumesBreakReplicationFuture", "Result", future.Response(), "Polling failure")
+ return
+ }
+ if !done {
+ ar.Response = future.Response()
+ err = azure.NewAsyncOpIncompleteError("netapp.VolumesBreakReplicationFuture")
+ return
+ }
+ ar.Response = future.Response()
+ return
+}
+
+// VolumesCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a long-running
+// operation.
+type VolumesCreateOrUpdateFuture struct {
+ azure.FutureAPI
+ // Result returns the result of the asynchronous operation.
+ // If the operation has not completed it will return an error.
+ Result func(VolumesClient) (Volume, error)
+}
+
+// UnmarshalJSON is the custom unmarshaller for CreateFuture.
+func (future *VolumesCreateOrUpdateFuture) UnmarshalJSON(body []byte) error {
+ var azFuture azure.Future
+ if err := json.Unmarshal(body, &azFuture); err != nil {
+ return err
+ }
+ future.FutureAPI = &azFuture
+ future.Result = future.result
+ return nil
+}
+
+// result is the default implementation for VolumesCreateOrUpdateFuture.Result.
+func (future *VolumesCreateOrUpdateFuture) result(client VolumesClient) (vVar Volume, err error) {
+ var done bool
+ done, err = future.DoneWithContext(context.Background(), client)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "netapp.VolumesCreateOrUpdateFuture", "Result", future.Response(), "Polling failure")
+ return
+ }
+ if !done {
+ vVar.Response.Response = future.Response()
+ err = azure.NewAsyncOpIncompleteError("netapp.VolumesCreateOrUpdateFuture")
+ return
+ }
+ sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
+ if vVar.Response.Response, err = future.GetResult(sender); err == nil && vVar.Response.Response.StatusCode != http.StatusNoContent {
+ vVar, err = client.CreateOrUpdateResponder(vVar.Response.Response)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "netapp.VolumesCreateOrUpdateFuture", "Result", vVar.Response.Response, "Failure responding to request")
+ }
+ }
+ return
+}
+
+// VolumesDeleteFuture an abstraction for monitoring and retrieving the results of a long-running
+// operation.
+type VolumesDeleteFuture struct {
+ azure.FutureAPI
+ // Result returns the result of the asynchronous operation.
+ // If the operation has not completed it will return an error.
+ Result func(VolumesClient) (autorest.Response, error)
+}
+
+// UnmarshalJSON is the custom unmarshaller for CreateFuture.
+func (future *VolumesDeleteFuture) UnmarshalJSON(body []byte) error {
+ var azFuture azure.Future
+ if err := json.Unmarshal(body, &azFuture); err != nil {
+ return err
+ }
+ future.FutureAPI = &azFuture
+ future.Result = future.result
+ return nil
+}
+
+// result is the default implementation for VolumesDeleteFuture.Result.
+func (future *VolumesDeleteFuture) result(client VolumesClient) (ar autorest.Response, err error) {
+ var done bool
+ done, err = future.DoneWithContext(context.Background(), client)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "netapp.VolumesDeleteFuture", "Result", future.Response(), "Polling failure")
+ return
+ }
+ if !done {
+ ar.Response = future.Response()
+ err = azure.NewAsyncOpIncompleteError("netapp.VolumesDeleteFuture")
+ return
+ }
+ ar.Response = future.Response()
+ return
+}
+
+// VolumesDeleteReplicationFuture an abstraction for monitoring and retrieving the results of a
+// long-running operation.
+type VolumesDeleteReplicationFuture struct {
+ azure.FutureAPI
+ // Result returns the result of the asynchronous operation.
+ // If the operation has not completed it will return an error.
+ Result func(VolumesClient) (autorest.Response, error)
+}
+
+// UnmarshalJSON is the custom unmarshaller for CreateFuture.
+func (future *VolumesDeleteReplicationFuture) UnmarshalJSON(body []byte) error {
+ var azFuture azure.Future
+ if err := json.Unmarshal(body, &azFuture); err != nil {
+ return err
+ }
+ future.FutureAPI = &azFuture
+ future.Result = future.result
+ return nil
+}
+
+// result is the default implementation for VolumesDeleteReplicationFuture.Result.
+func (future *VolumesDeleteReplicationFuture) result(client VolumesClient) (ar autorest.Response, err error) {
+ var done bool
+ done, err = future.DoneWithContext(context.Background(), client)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "netapp.VolumesDeleteReplicationFuture", "Result", future.Response(), "Polling failure")
+ return
+ }
+ if !done {
+ ar.Response = future.Response()
+ err = azure.NewAsyncOpIncompleteError("netapp.VolumesDeleteReplicationFuture")
+ return
+ }
+ ar.Response = future.Response()
+ return
+}
+
+// VolumeSnapshotProperties volume Snapshot Properties
+type VolumeSnapshotProperties struct {
+ // SnapshotPolicyID - Snapshot Policy ResourceId
+ SnapshotPolicyID *string `json:"snapshotPolicyId,omitempty"`
+}
+
+// VolumesPoolChangeFuture an abstraction for monitoring and retrieving the results of a long-running
+// operation.
+type VolumesPoolChangeFuture struct {
+ azure.FutureAPI
+ // Result returns the result of the asynchronous operation.
+ // If the operation has not completed it will return an error.
+ Result func(VolumesClient) (autorest.Response, error)
+}
+
+// UnmarshalJSON is the custom unmarshaller for CreateFuture.
+func (future *VolumesPoolChangeFuture) UnmarshalJSON(body []byte) error {
+ var azFuture azure.Future
+ if err := json.Unmarshal(body, &azFuture); err != nil {
+ return err
+ }
+ future.FutureAPI = &azFuture
+ future.Result = future.result
+ return nil
+}
+
+// result is the default implementation for VolumesPoolChangeFuture.Result.
+func (future *VolumesPoolChangeFuture) result(client VolumesClient) (ar autorest.Response, err error) {
+ var done bool
+ done, err = future.DoneWithContext(context.Background(), client)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "netapp.VolumesPoolChangeFuture", "Result", future.Response(), "Polling failure")
+ return
+ }
+ if !done {
+ ar.Response = future.Response()
+ err = azure.NewAsyncOpIncompleteError("netapp.VolumesPoolChangeFuture")
+ return
+ }
+ ar.Response = future.Response()
+ return
+}
+
+// VolumesReInitializeReplicationFuture an abstraction for monitoring and retrieving the results of a
+// long-running operation.
+type VolumesReInitializeReplicationFuture struct {
+ azure.FutureAPI
+ // Result returns the result of the asynchronous operation.
+ // If the operation has not completed it will return an error.
+ Result func(VolumesClient) (autorest.Response, error)
+}
+
+// UnmarshalJSON is the custom unmarshaller for CreateFuture.
+func (future *VolumesReInitializeReplicationFuture) UnmarshalJSON(body []byte) error {
+ var azFuture azure.Future
+ if err := json.Unmarshal(body, &azFuture); err != nil {
+ return err
+ }
+ future.FutureAPI = &azFuture
+ future.Result = future.result
+ return nil
+}
+
+// result is the default implementation for VolumesReInitializeReplicationFuture.Result.
+func (future *VolumesReInitializeReplicationFuture) result(client VolumesClient) (ar autorest.Response, err error) {
+ var done bool
+ done, err = future.DoneWithContext(context.Background(), client)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "netapp.VolumesReInitializeReplicationFuture", "Result", future.Response(), "Polling failure")
+ return
+ }
+ if !done {
+ ar.Response = future.Response()
+ err = azure.NewAsyncOpIncompleteError("netapp.VolumesReInitializeReplicationFuture")
+ return
+ }
+ ar.Response = future.Response()
+ return
+}
+
+// VolumesResyncReplicationFuture an abstraction for monitoring and retrieving the results of a
+// long-running operation.
+type VolumesResyncReplicationFuture struct {
+ azure.FutureAPI
+ // Result returns the result of the asynchronous operation.
+ // If the operation has not completed it will return an error.
+ Result func(VolumesClient) (autorest.Response, error)
+}
+
+// UnmarshalJSON is the custom unmarshaller for CreateFuture.
+func (future *VolumesResyncReplicationFuture) UnmarshalJSON(body []byte) error {
+ var azFuture azure.Future
+ if err := json.Unmarshal(body, &azFuture); err != nil {
+ return err
+ }
+ future.FutureAPI = &azFuture
+ future.Result = future.result
+ return nil
+}
+
+// result is the default implementation for VolumesResyncReplicationFuture.Result.
+func (future *VolumesResyncReplicationFuture) result(client VolumesClient) (ar autorest.Response, err error) {
+ var done bool
+ done, err = future.DoneWithContext(context.Background(), client)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "netapp.VolumesResyncReplicationFuture", "Result", future.Response(), "Polling failure")
+ return
+ }
+ if !done {
+ ar.Response = future.Response()
+ err = azure.NewAsyncOpIncompleteError("netapp.VolumesResyncReplicationFuture")
+ return
+ }
+ ar.Response = future.Response()
+ return
+}
+
+// VolumesRevertFuture an abstraction for monitoring and retrieving the results of a long-running
+// operation.
+type VolumesRevertFuture struct {
+ azure.FutureAPI
+ // Result returns the result of the asynchronous operation.
+ // If the operation has not completed it will return an error.
+ Result func(VolumesClient) (autorest.Response, error)
+}
+
+// UnmarshalJSON is the custom unmarshaller for CreateFuture.
+func (future *VolumesRevertFuture) UnmarshalJSON(body []byte) error {
+ var azFuture azure.Future
+ if err := json.Unmarshal(body, &azFuture); err != nil {
+ return err
+ }
+ future.FutureAPI = &azFuture
+ future.Result = future.result
+ return nil
+}
+
+// result is the default implementation for VolumesRevertFuture.Result.
+func (future *VolumesRevertFuture) result(client VolumesClient) (ar autorest.Response, err error) {
+ var done bool
+ done, err = future.DoneWithContext(context.Background(), client)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "netapp.VolumesRevertFuture", "Result", future.Response(), "Polling failure")
+ return
+ }
+ if !done {
+ ar.Response = future.Response()
+ err = azure.NewAsyncOpIncompleteError("netapp.VolumesRevertFuture")
+ return
+ }
+ ar.Response = future.Response()
+ return
+}
+
+// VolumesUpdateFuture an abstraction for monitoring and retrieving the results of a long-running
+// operation.
+type VolumesUpdateFuture struct {
+ azure.FutureAPI
+ // Result returns the result of the asynchronous operation.
+ // If the operation has not completed it will return an error.
+ Result func(VolumesClient) (Volume, error)
+}
+
+// UnmarshalJSON is the custom unmarshaller for CreateFuture.
+func (future *VolumesUpdateFuture) UnmarshalJSON(body []byte) error {
+ var azFuture azure.Future
+ if err := json.Unmarshal(body, &azFuture); err != nil {
+ return err
+ }
+ future.FutureAPI = &azFuture
+ future.Result = future.result
+ return nil
+}
+
+// result is the default implementation for VolumesUpdateFuture.Result.
+func (future *VolumesUpdateFuture) result(client VolumesClient) (vVar Volume, err error) {
+ var done bool
+ done, err = future.DoneWithContext(context.Background(), client)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "netapp.VolumesUpdateFuture", "Result", future.Response(), "Polling failure")
+ return
+ }
+ if !done {
+ vVar.Response.Response = future.Response()
+ err = azure.NewAsyncOpIncompleteError("netapp.VolumesUpdateFuture")
+ return
+ }
+ sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
+ if vVar.Response.Response, err = future.GetResult(sender); err == nil && vVar.Response.Response.StatusCode != http.StatusNoContent {
+ vVar, err = client.UpdateResponder(vVar.Response.Response)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "netapp.VolumesUpdateFuture", "Result", vVar.Response.Response, "Failure responding to request")
+ }
+ }
+ return
+}
+
+// WeeklySchedule weekly Schedule properties, make a snapshot every week at a specific day or days
+type WeeklySchedule struct {
+ // SnapshotsToKeep - Weekly snapshot count to keep
+ SnapshotsToKeep *int32 `json:"snapshotsToKeep,omitempty"`
+ // Day - Indicates which weekdays snapshot should be taken, accepts a comma separated list of week day names in english
+ Day *string `json:"day,omitempty"`
+ // Hour - Indicates which hour in UTC timezone a snapshot should be taken
+ Hour *int32 `json:"hour,omitempty"`
+ // Minute - Indicates which minute snapshot should be taken
+ Minute *int32 `json:"minute,omitempty"`
+ // UsedBytes - Resource size in bytes, current storage usage for the volume in bytes
+ UsedBytes *int64 `json:"usedBytes,omitempty"`
+}
diff --git a/services/netapp/mgmt/2021-10-01/netapp/netappapi/interfaces.go b/services/netapp/mgmt/2021-10-01/netapp/netappapi/interfaces.go
new file mode 100644
index 000000000000..0ac25694b2d7
--- /dev/null
+++ b/services/netapp/mgmt/2021-10-01/netapp/netappapi/interfaces.go
@@ -0,0 +1,169 @@
+package netappapi
+
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License. See License.txt in the project root for license information.
+//
+// Code generated by Microsoft (R) AutoRest Code Generator.
+// Changes may cause incorrect behavior and will be lost if the code is regenerated.
+
+import (
+ "context"
+ "github.com/Azure/azure-sdk-for-go/services/netapp/mgmt/2021-10-01/netapp"
+)
+
+// OperationsClientAPI contains the set of methods on the OperationsClient type.
+type OperationsClientAPI interface {
+ List(ctx context.Context) (result netapp.OperationListResult, err error)
+}
+
+var _ OperationsClientAPI = (*netapp.OperationsClient)(nil)
+
+// ResourceClientAPI contains the set of methods on the ResourceClient type.
+type ResourceClientAPI interface {
+ CheckFilePathAvailability(ctx context.Context, body netapp.FilePathAvailabilityRequest, location string) (result netapp.CheckAvailabilityResponse, err error)
+ CheckNameAvailability(ctx context.Context, body netapp.ResourceNameAvailabilityRequest, location string) (result netapp.CheckAvailabilityResponse, err error)
+ CheckQuotaAvailability(ctx context.Context, body netapp.QuotaAvailabilityRequest, location string) (result netapp.CheckAvailabilityResponse, err error)
+}
+
+var _ ResourceClientAPI = (*netapp.ResourceClient)(nil)
+
+// ResourceQuotaLimitsClientAPI contains the set of methods on the ResourceQuotaLimitsClient type.
+type ResourceQuotaLimitsClientAPI interface {
+ Get(ctx context.Context, location string, quotaLimitName string) (result netapp.SubscriptionQuotaItem, err error)
+ List(ctx context.Context, location string) (result netapp.SubscriptionQuotaItemList, err error)
+}
+
+var _ ResourceQuotaLimitsClientAPI = (*netapp.ResourceQuotaLimitsClient)(nil)
+
+// AccountsClientAPI contains the set of methods on the AccountsClient type.
+type AccountsClientAPI interface {
+ CreateOrUpdate(ctx context.Context, body netapp.Account, resourceGroupName string, accountName string) (result netapp.AccountsCreateOrUpdateFuture, err error)
+ Delete(ctx context.Context, resourceGroupName string, accountName string) (result netapp.AccountsDeleteFuture, err error)
+ Get(ctx context.Context, resourceGroupName string, accountName string) (result netapp.Account, err error)
+ List(ctx context.Context, resourceGroupName string) (result netapp.AccountListPage, err error)
+ ListComplete(ctx context.Context, resourceGroupName string) (result netapp.AccountListIterator, err error)
+ ListBySubscription(ctx context.Context) (result netapp.AccountListPage, err error)
+ ListBySubscriptionComplete(ctx context.Context) (result netapp.AccountListIterator, err error)
+ Update(ctx context.Context, body netapp.AccountPatch, resourceGroupName string, accountName string) (result netapp.AccountsUpdateFuture, err error)
+}
+
+var _ AccountsClientAPI = (*netapp.AccountsClient)(nil)
+
+// PoolsClientAPI contains the set of methods on the PoolsClient type.
+type PoolsClientAPI interface {
+ CreateOrUpdate(ctx context.Context, body netapp.CapacityPool, resourceGroupName string, accountName string, poolName string) (result netapp.PoolsCreateOrUpdateFuture, err error)
+ Delete(ctx context.Context, resourceGroupName string, accountName string, poolName string) (result netapp.PoolsDeleteFuture, err error)
+ Get(ctx context.Context, resourceGroupName string, accountName string, poolName string) (result netapp.CapacityPool, err error)
+ List(ctx context.Context, resourceGroupName string, accountName string) (result netapp.CapacityPoolListPage, err error)
+ ListComplete(ctx context.Context, resourceGroupName string, accountName string) (result netapp.CapacityPoolListIterator, err error)
+ Update(ctx context.Context, body netapp.CapacityPoolPatch, resourceGroupName string, accountName string, poolName string) (result netapp.PoolsUpdateFuture, err error)
+}
+
+var _ PoolsClientAPI = (*netapp.PoolsClient)(nil)
+
+// VolumesClientAPI contains the set of methods on the VolumesClient type.
+type VolumesClientAPI interface {
+ AuthorizeReplication(ctx context.Context, resourceGroupName string, accountName string, poolName string, volumeName string, body netapp.AuthorizeRequest) (result netapp.VolumesAuthorizeReplicationFuture, err error)
+ BreakReplication(ctx context.Context, resourceGroupName string, accountName string, poolName string, volumeName string, body *netapp.BreakReplicationRequest) (result netapp.VolumesBreakReplicationFuture, err error)
+ CreateOrUpdate(ctx context.Context, body netapp.Volume, resourceGroupName string, accountName string, poolName string, volumeName string) (result netapp.VolumesCreateOrUpdateFuture, err error)
+ Delete(ctx context.Context, resourceGroupName string, accountName string, poolName string, volumeName string, forceDelete *bool) (result netapp.VolumesDeleteFuture, err error)
+ DeleteReplication(ctx context.Context, resourceGroupName string, accountName string, poolName string, volumeName string) (result netapp.VolumesDeleteReplicationFuture, err error)
+ Get(ctx context.Context, resourceGroupName string, accountName string, poolName string, volumeName string) (result netapp.Volume, err error)
+ List(ctx context.Context, resourceGroupName string, accountName string, poolName string) (result netapp.VolumeListPage, err error)
+ ListComplete(ctx context.Context, resourceGroupName string, accountName string, poolName string) (result netapp.VolumeListIterator, err error)
+ PoolChange(ctx context.Context, resourceGroupName string, accountName string, poolName string, volumeName string, body netapp.PoolChangeRequest) (result netapp.VolumesPoolChangeFuture, err error)
+ ReInitializeReplication(ctx context.Context, resourceGroupName string, accountName string, poolName string, volumeName string) (result netapp.VolumesReInitializeReplicationFuture, err error)
+ ReplicationStatusMethod(ctx context.Context, resourceGroupName string, accountName string, poolName string, volumeName string) (result netapp.ReplicationStatus, err error)
+ ResyncReplication(ctx context.Context, resourceGroupName string, accountName string, poolName string, volumeName string) (result netapp.VolumesResyncReplicationFuture, err error)
+ Revert(ctx context.Context, resourceGroupName string, accountName string, poolName string, volumeName string, body netapp.VolumeRevert) (result netapp.VolumesRevertFuture, err error)
+ Update(ctx context.Context, body netapp.VolumePatch, resourceGroupName string, accountName string, poolName string, volumeName string) (result netapp.VolumesUpdateFuture, err error)
+}
+
+var _ VolumesClientAPI = (*netapp.VolumesClient)(nil)
+
+// SnapshotsClientAPI contains the set of methods on the SnapshotsClient type.
+type SnapshotsClientAPI interface {
+ Create(ctx context.Context, body netapp.Snapshot, resourceGroupName string, accountName string, poolName string, volumeName string, snapshotName string) (result netapp.SnapshotsCreateFuture, err error)
+ Delete(ctx context.Context, resourceGroupName string, accountName string, poolName string, volumeName string, snapshotName string) (result netapp.SnapshotsDeleteFuture, err error)
+ Get(ctx context.Context, resourceGroupName string, accountName string, poolName string, volumeName string, snapshotName string) (result netapp.Snapshot, err error)
+ List(ctx context.Context, resourceGroupName string, accountName string, poolName string, volumeName string) (result netapp.SnapshotsList, err error)
+ RestoreFiles(ctx context.Context, body netapp.SnapshotRestoreFiles, resourceGroupName string, accountName string, poolName string, volumeName string, snapshotName string) (result netapp.SnapshotsRestoreFilesFuture, err error)
+ Update(ctx context.Context, body interface{}, resourceGroupName string, accountName string, poolName string, volumeName string, snapshotName string) (result netapp.SnapshotsUpdateFuture, err error)
+}
+
+var _ SnapshotsClientAPI = (*netapp.SnapshotsClient)(nil)
+
+// SnapshotPoliciesClientAPI contains the set of methods on the SnapshotPoliciesClient type.
+type SnapshotPoliciesClientAPI interface {
+ Create(ctx context.Context, body netapp.SnapshotPolicy, resourceGroupName string, accountName string, snapshotPolicyName string) (result netapp.SnapshotPolicy, err error)
+ Delete(ctx context.Context, resourceGroupName string, accountName string, snapshotPolicyName string) (result netapp.SnapshotPoliciesDeleteFuture, err error)
+ Get(ctx context.Context, resourceGroupName string, accountName string, snapshotPolicyName string) (result netapp.SnapshotPolicy, err error)
+ List(ctx context.Context, resourceGroupName string, accountName string) (result netapp.SnapshotPoliciesList, err error)
+ ListVolumes(ctx context.Context, resourceGroupName string, accountName string, snapshotPolicyName string) (result netapp.SnapshotPolicyVolumeList, err error)
+ Update(ctx context.Context, body netapp.SnapshotPolicyPatch, resourceGroupName string, accountName string, snapshotPolicyName string) (result netapp.SnapshotPoliciesUpdateFuture, err error)
+}
+
+var _ SnapshotPoliciesClientAPI = (*netapp.SnapshotPoliciesClient)(nil)
+
+// BackupsClientAPI contains the set of methods on the BackupsClient type.
+type BackupsClientAPI interface {
+ Create(ctx context.Context, resourceGroupName string, accountName string, poolName string, volumeName string, backupName string, body netapp.Backup) (result netapp.BackupsCreateFuture, err error)
+ Delete(ctx context.Context, resourceGroupName string, accountName string, poolName string, volumeName string, backupName string) (result netapp.BackupsDeleteFuture, err error)
+ Get(ctx context.Context, resourceGroupName string, accountName string, poolName string, volumeName string, backupName string) (result netapp.Backup, err error)
+ GetStatus(ctx context.Context, resourceGroupName string, accountName string, poolName string, volumeName string) (result netapp.BackupStatus, err error)
+ GetVolumeRestoreStatus(ctx context.Context, resourceGroupName string, accountName string, poolName string, volumeName string) (result netapp.RestoreStatus, err error)
+ List(ctx context.Context, resourceGroupName string, accountName string, poolName string, volumeName string) (result netapp.BackupsList, err error)
+ Update(ctx context.Context, resourceGroupName string, accountName string, poolName string, volumeName string, backupName string, body *netapp.BackupPatch) (result netapp.BackupsUpdateFuture, err error)
+}
+
+var _ BackupsClientAPI = (*netapp.BackupsClient)(nil)
+
+// AccountBackupsClientAPI contains the set of methods on the AccountBackupsClient type.
+type AccountBackupsClientAPI interface {
+ Delete(ctx context.Context, resourceGroupName string, accountName string, backupName string) (result netapp.AccountBackupsDeleteFuture, err error)
+ Get(ctx context.Context, resourceGroupName string, accountName string, backupName string) (result netapp.Backup, err error)
+ List(ctx context.Context, resourceGroupName string, accountName string) (result netapp.BackupsList, err error)
+}
+
+var _ AccountBackupsClientAPI = (*netapp.AccountBackupsClient)(nil)
+
+// BackupPoliciesClientAPI contains the set of methods on the BackupPoliciesClient type.
+type BackupPoliciesClientAPI interface {
+ Create(ctx context.Context, resourceGroupName string, accountName string, backupPolicyName string, body netapp.BackupPolicy) (result netapp.BackupPoliciesCreateFuture, err error)
+ Delete(ctx context.Context, resourceGroupName string, accountName string, backupPolicyName string) (result netapp.BackupPoliciesDeleteFuture, err error)
+ Get(ctx context.Context, resourceGroupName string, accountName string, backupPolicyName string) (result netapp.BackupPolicy, err error)
+ List(ctx context.Context, resourceGroupName string, accountName string) (result netapp.BackupPoliciesList, err error)
+ Update(ctx context.Context, resourceGroupName string, accountName string, backupPolicyName string, body netapp.BackupPolicyPatch) (result netapp.BackupPoliciesUpdateFuture, err error)
+}
+
+var _ BackupPoliciesClientAPI = (*netapp.BackupPoliciesClient)(nil)
+
+// VaultsClientAPI contains the set of methods on the VaultsClient type.
+type VaultsClientAPI interface {
+ List(ctx context.Context, resourceGroupName string, accountName string) (result netapp.VaultList, err error)
+}
+
+var _ VaultsClientAPI = (*netapp.VaultsClient)(nil)
+
+// VolumeGroupsClientAPI contains the set of methods on the VolumeGroupsClient type.
+type VolumeGroupsClientAPI interface {
+ Create(ctx context.Context, body netapp.VolumeGroupDetails, resourceGroupName string, accountName string, volumeGroupName string) (result netapp.VolumeGroupsCreateFuture, err error)
+ Delete(ctx context.Context, resourceGroupName string, accountName string, volumeGroupName string) (result netapp.VolumeGroupsDeleteFuture, err error)
+ Get(ctx context.Context, resourceGroupName string, accountName string, volumeGroupName string) (result netapp.VolumeGroupDetails, err error)
+ ListByNetAppAccount(ctx context.Context, resourceGroupName string, accountName string) (result netapp.VolumeGroupList, err error)
+}
+
+var _ VolumeGroupsClientAPI = (*netapp.VolumeGroupsClient)(nil)
+
+// SubvolumesClientAPI contains the set of methods on the SubvolumesClient type.
+type SubvolumesClientAPI interface {
+ Create(ctx context.Context, body netapp.SubvolumeInfo, resourceGroupName string, accountName string, poolName string, volumeName string, subvolumeName string) (result netapp.SubvolumesCreateFuture, err error)
+ Delete(ctx context.Context, resourceGroupName string, accountName string, poolName string, volumeName string, subvolumeName string) (result netapp.SubvolumesDeleteFuture, err error)
+ Get(ctx context.Context, resourceGroupName string, accountName string, poolName string, volumeName string, subvolumeName string) (result netapp.SubvolumeInfo, err error)
+ GetMetadata(ctx context.Context, resourceGroupName string, accountName string, poolName string, volumeName string, subvolumeName string) (result netapp.SubvolumesGetMetadataFuture, err error)
+ ListByVolume(ctx context.Context, resourceGroupName string, accountName string, poolName string, volumeName string) (result netapp.SubvolumesListPage, err error)
+ ListByVolumeComplete(ctx context.Context, resourceGroupName string, accountName string, poolName string, volumeName string) (result netapp.SubvolumesListIterator, err error)
+ Update(ctx context.Context, body netapp.SubvolumePatchRequest, resourceGroupName string, accountName string, poolName string, volumeName string, subvolumeName string) (result netapp.SubvolumesUpdateFuture, err error)
+}
+
+var _ SubvolumesClientAPI = (*netapp.SubvolumesClient)(nil)
diff --git a/services/netapp/mgmt/2021-10-01/netapp/operations.go b/services/netapp/mgmt/2021-10-01/netapp/operations.go
new file mode 100644
index 000000000000..d903fa2473a3
--- /dev/null
+++ b/services/netapp/mgmt/2021-10-01/netapp/operations.go
@@ -0,0 +1,98 @@
+package netapp
+
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License. See License.txt in the project root for license information.
+//
+// Code generated by Microsoft (R) AutoRest Code Generator.
+// Changes may cause incorrect behavior and will be lost if the code is regenerated.
+
+import (
+ "context"
+ "github.com/Azure/go-autorest/autorest"
+ "github.com/Azure/go-autorest/autorest/azure"
+ "github.com/Azure/go-autorest/tracing"
+ "net/http"
+)
+
+// OperationsClient is the microsoft NetApp Files Azure Resource Provider specification
+type OperationsClient struct {
+ BaseClient
+}
+
+// NewOperationsClient creates an instance of the OperationsClient client.
+func NewOperationsClient(subscriptionID string) OperationsClient {
+ return NewOperationsClientWithBaseURI(DefaultBaseURI, subscriptionID)
+}
+
+// NewOperationsClientWithBaseURI creates an instance of the OperationsClient client using a custom endpoint. Use this
+// when interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure stack).
+func NewOperationsClientWithBaseURI(baseURI string, subscriptionID string) OperationsClient {
+ return OperationsClient{NewWithBaseURI(baseURI, subscriptionID)}
+}
+
+// List lists all of the available Microsoft.NetApp Rest API operations
+func (client OperationsClient) List(ctx context.Context) (result OperationListResult, err error) {
+ if tracing.IsEnabled() {
+ ctx = tracing.StartSpan(ctx, fqdn+"/OperationsClient.List")
+ defer func() {
+ sc := -1
+ if result.Response.Response != nil {
+ sc = result.Response.Response.StatusCode
+ }
+ tracing.EndSpan(ctx, sc, err)
+ }()
+ }
+ req, err := client.ListPreparer(ctx)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "netapp.OperationsClient", "List", nil, "Failure preparing request")
+ return
+ }
+
+ resp, err := client.ListSender(req)
+ if err != nil {
+ result.Response = autorest.Response{Response: resp}
+ err = autorest.NewErrorWithError(err, "netapp.OperationsClient", "List", resp, "Failure sending request")
+ return
+ }
+
+ result, err = client.ListResponder(resp)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "netapp.OperationsClient", "List", resp, "Failure responding to request")
+ return
+ }
+
+ return
+}
+
+// ListPreparer prepares the List request.
+func (client OperationsClient) ListPreparer(ctx context.Context) (*http.Request, error) {
+ const APIVersion = "2021-10-01"
+ queryParameters := map[string]interface{}{
+ "api-version": APIVersion,
+ }
+
+ preparer := autorest.CreatePreparer(
+ autorest.AsGet(),
+ autorest.WithBaseURL(client.BaseURI),
+ autorest.WithPath("/providers/Microsoft.NetApp/operations"),
+ autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare((&http.Request{}).WithContext(ctx))
+}
+
+// ListSender sends the List request. The method will close the
+// http.Response Body if it receives an error.
+func (client OperationsClient) ListSender(req *http.Request) (*http.Response, error) {
+ return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
+}
+
+// ListResponder handles the response to the List request. The method always
+// closes the http.Response Body.
+func (client OperationsClient) ListResponder(resp *http.Response) (result OperationListResult, err error) {
+ err = autorest.Respond(
+ resp,
+ azure.WithErrorUnlessStatusCode(http.StatusOK),
+ autorest.ByUnmarshallingJSON(&result),
+ autorest.ByClosing())
+ result.Response = autorest.Response{Response: resp}
+ return
+}
diff --git a/services/netapp/mgmt/2021-10-01/netapp/pools.go b/services/netapp/mgmt/2021-10-01/netapp/pools.go
new file mode 100644
index 000000000000..67284b542dfa
--- /dev/null
+++ b/services/netapp/mgmt/2021-10-01/netapp/pools.go
@@ -0,0 +1,550 @@
+package netapp
+
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License. See License.txt in the project root for license information.
+//
+// Code generated by Microsoft (R) AutoRest Code Generator.
+// Changes may cause incorrect behavior and will be lost if the code is regenerated.
+
+import (
+ "context"
+ "github.com/Azure/go-autorest/autorest"
+ "github.com/Azure/go-autorest/autorest/azure"
+ "github.com/Azure/go-autorest/autorest/validation"
+ "github.com/Azure/go-autorest/tracing"
+ "net/http"
+)
+
+// PoolsClient is the microsoft NetApp Files Azure Resource Provider specification
+type PoolsClient struct {
+ BaseClient
+}
+
+// NewPoolsClient creates an instance of the PoolsClient client.
+func NewPoolsClient(subscriptionID string) PoolsClient {
+ return NewPoolsClientWithBaseURI(DefaultBaseURI, subscriptionID)
+}
+
+// NewPoolsClientWithBaseURI creates an instance of the PoolsClient client using a custom endpoint. Use this when
+// interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure stack).
+func NewPoolsClientWithBaseURI(baseURI string, subscriptionID string) PoolsClient {
+ return PoolsClient{NewWithBaseURI(baseURI, subscriptionID)}
+}
+
+// CreateOrUpdate create or Update a capacity pool
+// Parameters:
+// body - capacity pool object supplied in the body of the operation.
+// resourceGroupName - the name of the resource group.
+// accountName - the name of the NetApp account
+// poolName - the name of the capacity pool
+func (client PoolsClient) CreateOrUpdate(ctx context.Context, body CapacityPool, resourceGroupName string, accountName string, poolName string) (result PoolsCreateOrUpdateFuture, err error) {
+ if tracing.IsEnabled() {
+ ctx = tracing.StartSpan(ctx, fqdn+"/PoolsClient.CreateOrUpdate")
+ defer func() {
+ sc := -1
+ if result.FutureAPI != nil && result.FutureAPI.Response() != nil {
+ sc = result.FutureAPI.Response().StatusCode
+ }
+ tracing.EndSpan(ctx, sc, err)
+ }()
+ }
+ if err := validation.Validate([]validation.Validation{
+ {TargetValue: body,
+ Constraints: []validation.Constraint{{Target: "body.Location", Name: validation.Null, Rule: true, Chain: nil},
+ {Target: "body.PoolProperties", Name: validation.Null, Rule: true,
+ Chain: []validation.Constraint{{Target: "body.PoolProperties.PoolID", Name: validation.Null, Rule: false,
+ Chain: []validation.Constraint{{Target: "body.PoolProperties.PoolID", Name: validation.MaxLength, Rule: 36, Chain: nil},
+ {Target: "body.PoolProperties.PoolID", Name: validation.MinLength, Rule: 36, Chain: nil},
+ {Target: "body.PoolProperties.PoolID", Name: validation.Pattern, Rule: `^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$`, Chain: nil},
+ }},
+ {Target: "body.PoolProperties.Size", Name: validation.Null, Rule: true, Chain: nil},
+ }}}},
+ {TargetValue: resourceGroupName,
+ Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil},
+ {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil},
+ {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}},
+ {TargetValue: poolName,
+ Constraints: []validation.Constraint{{Target: "poolName", Name: validation.MaxLength, Rule: 64, Chain: nil},
+ {Target: "poolName", Name: validation.MinLength, Rule: 1, Chain: nil},
+ {Target: "poolName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9][a-zA-Z0-9\-_]{0,63}$`, Chain: nil}}}}); err != nil {
+ return result, validation.NewError("netapp.PoolsClient", "CreateOrUpdate", err.Error())
+ }
+
+ req, err := client.CreateOrUpdatePreparer(ctx, body, resourceGroupName, accountName, poolName)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "netapp.PoolsClient", "CreateOrUpdate", nil, "Failure preparing request")
+ return
+ }
+
+ result, err = client.CreateOrUpdateSender(req)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "netapp.PoolsClient", "CreateOrUpdate", result.Response(), "Failure sending request")
+ return
+ }
+
+ return
+}
+
+// CreateOrUpdatePreparer prepares the CreateOrUpdate request.
+func (client PoolsClient) CreateOrUpdatePreparer(ctx context.Context, body CapacityPool, resourceGroupName string, accountName string, poolName string) (*http.Request, error) {
+ pathParameters := map[string]interface{}{
+ "accountName": autorest.Encode("path", accountName),
+ "poolName": autorest.Encode("path", poolName),
+ "resourceGroupName": autorest.Encode("path", resourceGroupName),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
+ }
+
+ const APIVersion = "2021-10-01"
+ queryParameters := map[string]interface{}{
+ "api-version": APIVersion,
+ }
+
+ body.ID = nil
+ body.Name = nil
+ body.Etag = nil
+ body.Type = nil
+ body.SystemData = nil
+ preparer := autorest.CreatePreparer(
+ autorest.AsContentType("application/json; charset=utf-8"),
+ autorest.AsPut(),
+ autorest.WithBaseURL(client.BaseURI),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/capacityPools/{poolName}", pathParameters),
+ autorest.WithJSON(body),
+ autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare((&http.Request{}).WithContext(ctx))
+}
+
+// CreateOrUpdateSender sends the CreateOrUpdate request. The method will close the
+// http.Response Body if it receives an error.
+func (client PoolsClient) CreateOrUpdateSender(req *http.Request) (future PoolsCreateOrUpdateFuture, err error) {
+ var resp *http.Response
+ future.FutureAPI = &azure.Future{}
+ resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client))
+ if err != nil {
+ return
+ }
+ var azf azure.Future
+ azf, err = azure.NewFutureFromResponse(resp)
+ future.FutureAPI = &azf
+ future.Result = future.result
+ return
+}
+
+// CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always
+// closes the http.Response Body.
+func (client PoolsClient) CreateOrUpdateResponder(resp *http.Response) (result CapacityPool, err error) {
+ err = autorest.Respond(
+ resp,
+ azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated),
+ autorest.ByUnmarshallingJSON(&result),
+ autorest.ByClosing())
+ result.Response = autorest.Response{Response: resp}
+ return
+}
+
+// Delete delete the specified capacity pool
+// Parameters:
+// resourceGroupName - the name of the resource group.
+// accountName - the name of the NetApp account
+// poolName - the name of the capacity pool
+func (client PoolsClient) Delete(ctx context.Context, resourceGroupName string, accountName string, poolName string) (result PoolsDeleteFuture, err error) {
+ if tracing.IsEnabled() {
+ ctx = tracing.StartSpan(ctx, fqdn+"/PoolsClient.Delete")
+ defer func() {
+ sc := -1
+ if result.FutureAPI != nil && result.FutureAPI.Response() != nil {
+ sc = result.FutureAPI.Response().StatusCode
+ }
+ tracing.EndSpan(ctx, sc, err)
+ }()
+ }
+ if err := validation.Validate([]validation.Validation{
+ {TargetValue: resourceGroupName,
+ Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil},
+ {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil},
+ {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}},
+ {TargetValue: poolName,
+ Constraints: []validation.Constraint{{Target: "poolName", Name: validation.MaxLength, Rule: 64, Chain: nil},
+ {Target: "poolName", Name: validation.MinLength, Rule: 1, Chain: nil},
+ {Target: "poolName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9][a-zA-Z0-9\-_]{0,63}$`, Chain: nil}}}}); err != nil {
+ return result, validation.NewError("netapp.PoolsClient", "Delete", err.Error())
+ }
+
+ req, err := client.DeletePreparer(ctx, resourceGroupName, accountName, poolName)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "netapp.PoolsClient", "Delete", nil, "Failure preparing request")
+ return
+ }
+
+ result, err = client.DeleteSender(req)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "netapp.PoolsClient", "Delete", result.Response(), "Failure sending request")
+ return
+ }
+
+ return
+}
+
+// DeletePreparer prepares the Delete request.
+func (client PoolsClient) DeletePreparer(ctx context.Context, resourceGroupName string, accountName string, poolName string) (*http.Request, error) {
+ pathParameters := map[string]interface{}{
+ "accountName": autorest.Encode("path", accountName),
+ "poolName": autorest.Encode("path", poolName),
+ "resourceGroupName": autorest.Encode("path", resourceGroupName),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
+ }
+
+ const APIVersion = "2021-10-01"
+ queryParameters := map[string]interface{}{
+ "api-version": APIVersion,
+ }
+
+ preparer := autorest.CreatePreparer(
+ autorest.AsDelete(),
+ autorest.WithBaseURL(client.BaseURI),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/capacityPools/{poolName}", pathParameters),
+ autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare((&http.Request{}).WithContext(ctx))
+}
+
+// DeleteSender sends the Delete request. The method will close the
+// http.Response Body if it receives an error.
+func (client PoolsClient) DeleteSender(req *http.Request) (future PoolsDeleteFuture, err error) {
+ var resp *http.Response
+ future.FutureAPI = &azure.Future{}
+ resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client))
+ if err != nil {
+ return
+ }
+ var azf azure.Future
+ azf, err = azure.NewFutureFromResponse(resp)
+ future.FutureAPI = &azf
+ future.Result = future.result
+ return
+}
+
+// DeleteResponder handles the response to the Delete request. The method always
+// closes the http.Response Body.
+func (client PoolsClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) {
+ err = autorest.Respond(
+ resp,
+ azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent),
+ autorest.ByClosing())
+ result.Response = resp
+ return
+}
+
+// Get get details of the specified capacity pool
+// Parameters:
+// resourceGroupName - the name of the resource group.
+// accountName - the name of the NetApp account
+// poolName - the name of the capacity pool
+func (client PoolsClient) Get(ctx context.Context, resourceGroupName string, accountName string, poolName string) (result CapacityPool, err error) {
+ if tracing.IsEnabled() {
+ ctx = tracing.StartSpan(ctx, fqdn+"/PoolsClient.Get")
+ defer func() {
+ sc := -1
+ if result.Response.Response != nil {
+ sc = result.Response.Response.StatusCode
+ }
+ tracing.EndSpan(ctx, sc, err)
+ }()
+ }
+ if err := validation.Validate([]validation.Validation{
+ {TargetValue: resourceGroupName,
+ Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil},
+ {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil},
+ {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}},
+ {TargetValue: poolName,
+ Constraints: []validation.Constraint{{Target: "poolName", Name: validation.MaxLength, Rule: 64, Chain: nil},
+ {Target: "poolName", Name: validation.MinLength, Rule: 1, Chain: nil},
+ {Target: "poolName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9][a-zA-Z0-9\-_]{0,63}$`, Chain: nil}}}}); err != nil {
+ return result, validation.NewError("netapp.PoolsClient", "Get", err.Error())
+ }
+
+ req, err := client.GetPreparer(ctx, resourceGroupName, accountName, poolName)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "netapp.PoolsClient", "Get", nil, "Failure preparing request")
+ return
+ }
+
+ resp, err := client.GetSender(req)
+ if err != nil {
+ result.Response = autorest.Response{Response: resp}
+ err = autorest.NewErrorWithError(err, "netapp.PoolsClient", "Get", resp, "Failure sending request")
+ return
+ }
+
+ result, err = client.GetResponder(resp)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "netapp.PoolsClient", "Get", resp, "Failure responding to request")
+ return
+ }
+
+ return
+}
+
+// GetPreparer prepares the Get request.
+func (client PoolsClient) GetPreparer(ctx context.Context, resourceGroupName string, accountName string, poolName string) (*http.Request, error) {
+ pathParameters := map[string]interface{}{
+ "accountName": autorest.Encode("path", accountName),
+ "poolName": autorest.Encode("path", poolName),
+ "resourceGroupName": autorest.Encode("path", resourceGroupName),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
+ }
+
+ const APIVersion = "2021-10-01"
+ queryParameters := map[string]interface{}{
+ "api-version": APIVersion,
+ }
+
+ preparer := autorest.CreatePreparer(
+ autorest.AsGet(),
+ autorest.WithBaseURL(client.BaseURI),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/capacityPools/{poolName}", pathParameters),
+ autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare((&http.Request{}).WithContext(ctx))
+}
+
+// GetSender sends the Get request. The method will close the
+// http.Response Body if it receives an error.
+func (client PoolsClient) GetSender(req *http.Request) (*http.Response, error) {
+ return client.Send(req, azure.DoRetryWithRegistration(client.Client))
+}
+
+// GetResponder handles the response to the Get request. The method always
+// closes the http.Response Body.
+func (client PoolsClient) GetResponder(resp *http.Response) (result CapacityPool, err error) {
+ err = autorest.Respond(
+ resp,
+ azure.WithErrorUnlessStatusCode(http.StatusOK),
+ autorest.ByUnmarshallingJSON(&result),
+ autorest.ByClosing())
+ result.Response = autorest.Response{Response: resp}
+ return
+}
+
+// List list all capacity pools in the NetApp Account
+// Parameters:
+// resourceGroupName - the name of the resource group.
+// accountName - the name of the NetApp account
+func (client PoolsClient) List(ctx context.Context, resourceGroupName string, accountName string) (result CapacityPoolListPage, err error) {
+ if tracing.IsEnabled() {
+ ctx = tracing.StartSpan(ctx, fqdn+"/PoolsClient.List")
+ defer func() {
+ sc := -1
+ if result.cpl.Response.Response != nil {
+ sc = result.cpl.Response.Response.StatusCode
+ }
+ tracing.EndSpan(ctx, sc, err)
+ }()
+ }
+ if err := validation.Validate([]validation.Validation{
+ {TargetValue: resourceGroupName,
+ Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil},
+ {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil},
+ {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}}); err != nil {
+ return result, validation.NewError("netapp.PoolsClient", "List", err.Error())
+ }
+
+ result.fn = client.listNextResults
+ req, err := client.ListPreparer(ctx, resourceGroupName, accountName)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "netapp.PoolsClient", "List", nil, "Failure preparing request")
+ return
+ }
+
+ resp, err := client.ListSender(req)
+ if err != nil {
+ result.cpl.Response = autorest.Response{Response: resp}
+ err = autorest.NewErrorWithError(err, "netapp.PoolsClient", "List", resp, "Failure sending request")
+ return
+ }
+
+ result.cpl, err = client.ListResponder(resp)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "netapp.PoolsClient", "List", resp, "Failure responding to request")
+ return
+ }
+ if result.cpl.hasNextLink() && result.cpl.IsEmpty() {
+ err = result.NextWithContext(ctx)
+ return
+ }
+
+ return
+}
+
+// ListPreparer prepares the List request.
+func (client PoolsClient) ListPreparer(ctx context.Context, resourceGroupName string, accountName string) (*http.Request, error) {
+ pathParameters := map[string]interface{}{
+ "accountName": autorest.Encode("path", accountName),
+ "resourceGroupName": autorest.Encode("path", resourceGroupName),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
+ }
+
+ const APIVersion = "2021-10-01"
+ queryParameters := map[string]interface{}{
+ "api-version": APIVersion,
+ }
+
+ preparer := autorest.CreatePreparer(
+ autorest.AsGet(),
+ autorest.WithBaseURL(client.BaseURI),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/capacityPools", pathParameters),
+ autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare((&http.Request{}).WithContext(ctx))
+}
+
+// ListSender sends the List request. The method will close the
+// http.Response Body if it receives an error.
+func (client PoolsClient) ListSender(req *http.Request) (*http.Response, error) {
+ return client.Send(req, azure.DoRetryWithRegistration(client.Client))
+}
+
+// ListResponder handles the response to the List request. The method always
+// closes the http.Response Body.
+func (client PoolsClient) ListResponder(resp *http.Response) (result CapacityPoolList, err error) {
+ err = autorest.Respond(
+ resp,
+ azure.WithErrorUnlessStatusCode(http.StatusOK),
+ autorest.ByUnmarshallingJSON(&result),
+ autorest.ByClosing())
+ result.Response = autorest.Response{Response: resp}
+ return
+}
+
+// listNextResults retrieves the next set of results, if any.
+func (client PoolsClient) listNextResults(ctx context.Context, lastResults CapacityPoolList) (result CapacityPoolList, err error) {
+ req, err := lastResults.capacityPoolListPreparer(ctx)
+ if err != nil {
+ return result, autorest.NewErrorWithError(err, "netapp.PoolsClient", "listNextResults", nil, "Failure preparing next results request")
+ }
+ if req == nil {
+ return
+ }
+ resp, err := client.ListSender(req)
+ if err != nil {
+ result.Response = autorest.Response{Response: resp}
+ return result, autorest.NewErrorWithError(err, "netapp.PoolsClient", "listNextResults", resp, "Failure sending next results request")
+ }
+ result, err = client.ListResponder(resp)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "netapp.PoolsClient", "listNextResults", resp, "Failure responding to next results request")
+ }
+ return
+}
+
+// ListComplete enumerates all values, automatically crossing page boundaries as required.
+func (client PoolsClient) ListComplete(ctx context.Context, resourceGroupName string, accountName string) (result CapacityPoolListIterator, err error) {
+ if tracing.IsEnabled() {
+ ctx = tracing.StartSpan(ctx, fqdn+"/PoolsClient.List")
+ defer func() {
+ sc := -1
+ if result.Response().Response.Response != nil {
+ sc = result.page.Response().Response.Response.StatusCode
+ }
+ tracing.EndSpan(ctx, sc, err)
+ }()
+ }
+ result.page, err = client.List(ctx, resourceGroupName, accountName)
+ return
+}
+
+// Update patch the specified capacity pool
+// Parameters:
+// body - capacity pool object supplied in the body of the operation.
+// resourceGroupName - the name of the resource group.
+// accountName - the name of the NetApp account
+// poolName - the name of the capacity pool
+func (client PoolsClient) Update(ctx context.Context, body CapacityPoolPatch, resourceGroupName string, accountName string, poolName string) (result PoolsUpdateFuture, err error) {
+ if tracing.IsEnabled() {
+ ctx = tracing.StartSpan(ctx, fqdn+"/PoolsClient.Update")
+ defer func() {
+ sc := -1
+ if result.FutureAPI != nil && result.FutureAPI.Response() != nil {
+ sc = result.FutureAPI.Response().StatusCode
+ }
+ tracing.EndSpan(ctx, sc, err)
+ }()
+ }
+ if err := validation.Validate([]validation.Validation{
+ {TargetValue: resourceGroupName,
+ Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil},
+ {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil},
+ {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}},
+ {TargetValue: poolName,
+ Constraints: []validation.Constraint{{Target: "poolName", Name: validation.MaxLength, Rule: 64, Chain: nil},
+ {Target: "poolName", Name: validation.MinLength, Rule: 1, Chain: nil},
+ {Target: "poolName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9][a-zA-Z0-9\-_]{0,63}$`, Chain: nil}}}}); err != nil {
+ return result, validation.NewError("netapp.PoolsClient", "Update", err.Error())
+ }
+
+ req, err := client.UpdatePreparer(ctx, body, resourceGroupName, accountName, poolName)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "netapp.PoolsClient", "Update", nil, "Failure preparing request")
+ return
+ }
+
+ result, err = client.UpdateSender(req)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "netapp.PoolsClient", "Update", result.Response(), "Failure sending request")
+ return
+ }
+
+ return
+}
+
+// UpdatePreparer prepares the Update request.
+func (client PoolsClient) UpdatePreparer(ctx context.Context, body CapacityPoolPatch, resourceGroupName string, accountName string, poolName string) (*http.Request, error) {
+ pathParameters := map[string]interface{}{
+ "accountName": autorest.Encode("path", accountName),
+ "poolName": autorest.Encode("path", poolName),
+ "resourceGroupName": autorest.Encode("path", resourceGroupName),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
+ }
+
+ const APIVersion = "2021-10-01"
+ queryParameters := map[string]interface{}{
+ "api-version": APIVersion,
+ }
+
+ body.ID = nil
+ body.Name = nil
+ body.Type = nil
+ preparer := autorest.CreatePreparer(
+ autorest.AsContentType("application/json; charset=utf-8"),
+ autorest.AsPatch(),
+ autorest.WithBaseURL(client.BaseURI),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/capacityPools/{poolName}", pathParameters),
+ autorest.WithJSON(body),
+ autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare((&http.Request{}).WithContext(ctx))
+}
+
+// UpdateSender sends the Update request. The method will close the
+// http.Response Body if it receives an error.
+func (client PoolsClient) UpdateSender(req *http.Request) (future PoolsUpdateFuture, err error) {
+ var resp *http.Response
+ future.FutureAPI = &azure.Future{}
+ resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client))
+ if err != nil {
+ return
+ }
+ var azf azure.Future
+ azf, err = azure.NewFutureFromResponse(resp)
+ future.FutureAPI = &azf
+ future.Result = future.result
+ return
+}
+
+// UpdateResponder handles the response to the Update request. The method always
+// closes the http.Response Body.
+func (client PoolsClient) UpdateResponder(resp *http.Response) (result CapacityPool, err error) {
+ err = autorest.Respond(
+ resp,
+ azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted),
+ autorest.ByUnmarshallingJSON(&result),
+ autorest.ByClosing())
+ result.Response = autorest.Response{Response: resp}
+ return
+}
diff --git a/services/netapp/mgmt/2021-10-01/netapp/resource.go b/services/netapp/mgmt/2021-10-01/netapp/resource.go
new file mode 100644
index 000000000000..c2e42cc2ad2b
--- /dev/null
+++ b/services/netapp/mgmt/2021-10-01/netapp/resource.go
@@ -0,0 +1,284 @@
+package netapp
+
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License. See License.txt in the project root for license information.
+//
+// Code generated by Microsoft (R) AutoRest Code Generator.
+// Changes may cause incorrect behavior and will be lost if the code is regenerated.
+
+import (
+ "context"
+ "github.com/Azure/go-autorest/autorest"
+ "github.com/Azure/go-autorest/autorest/azure"
+ "github.com/Azure/go-autorest/autorest/validation"
+ "github.com/Azure/go-autorest/tracing"
+ "net/http"
+)
+
+// ResourceClient is the microsoft NetApp Files Azure Resource Provider specification
+type ResourceClient struct {
+ BaseClient
+}
+
+// NewResourceClient creates an instance of the ResourceClient client.
+func NewResourceClient(subscriptionID string) ResourceClient {
+ return NewResourceClientWithBaseURI(DefaultBaseURI, subscriptionID)
+}
+
+// NewResourceClientWithBaseURI creates an instance of the ResourceClient client using a custom endpoint. Use this
+// when interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure stack).
+func NewResourceClientWithBaseURI(baseURI string, subscriptionID string) ResourceClient {
+ return ResourceClient{NewWithBaseURI(baseURI, subscriptionID)}
+}
+
+// CheckFilePathAvailability check if a file path is available.
+// Parameters:
+// body - file path availability request.
+// location - the location
+func (client ResourceClient) CheckFilePathAvailability(ctx context.Context, body FilePathAvailabilityRequest, location string) (result CheckAvailabilityResponse, err error) {
+ if tracing.IsEnabled() {
+ ctx = tracing.StartSpan(ctx, fqdn+"/ResourceClient.CheckFilePathAvailability")
+ defer func() {
+ sc := -1
+ if result.Response.Response != nil {
+ sc = result.Response.Response.StatusCode
+ }
+ tracing.EndSpan(ctx, sc, err)
+ }()
+ }
+ if err := validation.Validate([]validation.Validation{
+ {TargetValue: body,
+ Constraints: []validation.Constraint{{Target: "body.Name", Name: validation.Null, Rule: true, Chain: nil},
+ {Target: "body.SubnetID", Name: validation.Null, Rule: true, Chain: nil}}}}); err != nil {
+ return result, validation.NewError("netapp.ResourceClient", "CheckFilePathAvailability", err.Error())
+ }
+
+ req, err := client.CheckFilePathAvailabilityPreparer(ctx, body, location)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "netapp.ResourceClient", "CheckFilePathAvailability", nil, "Failure preparing request")
+ return
+ }
+
+ resp, err := client.CheckFilePathAvailabilitySender(req)
+ if err != nil {
+ result.Response = autorest.Response{Response: resp}
+ err = autorest.NewErrorWithError(err, "netapp.ResourceClient", "CheckFilePathAvailability", resp, "Failure sending request")
+ return
+ }
+
+ result, err = client.CheckFilePathAvailabilityResponder(resp)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "netapp.ResourceClient", "CheckFilePathAvailability", resp, "Failure responding to request")
+ return
+ }
+
+ return
+}
+
+// CheckFilePathAvailabilityPreparer prepares the CheckFilePathAvailability request.
+func (client ResourceClient) CheckFilePathAvailabilityPreparer(ctx context.Context, body FilePathAvailabilityRequest, location string) (*http.Request, error) {
+ pathParameters := map[string]interface{}{
+ "location": autorest.Encode("path", location),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
+ }
+
+ const APIVersion = "2021-10-01"
+ queryParameters := map[string]interface{}{
+ "api-version": APIVersion,
+ }
+
+ preparer := autorest.CreatePreparer(
+ autorest.AsContentType("application/json; charset=utf-8"),
+ autorest.AsPost(),
+ autorest.WithBaseURL(client.BaseURI),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.NetApp/locations/{location}/checkFilePathAvailability", pathParameters),
+ autorest.WithJSON(body),
+ autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare((&http.Request{}).WithContext(ctx))
+}
+
+// CheckFilePathAvailabilitySender sends the CheckFilePathAvailability request. The method will close the
+// http.Response Body if it receives an error.
+func (client ResourceClient) CheckFilePathAvailabilitySender(req *http.Request) (*http.Response, error) {
+ return client.Send(req, azure.DoRetryWithRegistration(client.Client))
+}
+
+// CheckFilePathAvailabilityResponder handles the response to the CheckFilePathAvailability request. The method always
+// closes the http.Response Body.
+func (client ResourceClient) CheckFilePathAvailabilityResponder(resp *http.Response) (result CheckAvailabilityResponse, err error) {
+ err = autorest.Respond(
+ resp,
+ azure.WithErrorUnlessStatusCode(http.StatusOK),
+ autorest.ByUnmarshallingJSON(&result),
+ autorest.ByClosing())
+ result.Response = autorest.Response{Response: resp}
+ return
+}
+
+// CheckNameAvailability check if a resource name is available.
+// Parameters:
+// body - name availability request.
+// location - the location
+func (client ResourceClient) CheckNameAvailability(ctx context.Context, body ResourceNameAvailabilityRequest, location string) (result CheckAvailabilityResponse, err error) {
+ if tracing.IsEnabled() {
+ ctx = tracing.StartSpan(ctx, fqdn+"/ResourceClient.CheckNameAvailability")
+ defer func() {
+ sc := -1
+ if result.Response.Response != nil {
+ sc = result.Response.Response.StatusCode
+ }
+ tracing.EndSpan(ctx, sc, err)
+ }()
+ }
+ if err := validation.Validate([]validation.Validation{
+ {TargetValue: body,
+ Constraints: []validation.Constraint{{Target: "body.Name", Name: validation.Null, Rule: true, Chain: nil},
+ {Target: "body.ResourceGroup", Name: validation.Null, Rule: true, Chain: nil}}}}); err != nil {
+ return result, validation.NewError("netapp.ResourceClient", "CheckNameAvailability", err.Error())
+ }
+
+ req, err := client.CheckNameAvailabilityPreparer(ctx, body, location)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "netapp.ResourceClient", "CheckNameAvailability", nil, "Failure preparing request")
+ return
+ }
+
+ resp, err := client.CheckNameAvailabilitySender(req)
+ if err != nil {
+ result.Response = autorest.Response{Response: resp}
+ err = autorest.NewErrorWithError(err, "netapp.ResourceClient", "CheckNameAvailability", resp, "Failure sending request")
+ return
+ }
+
+ result, err = client.CheckNameAvailabilityResponder(resp)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "netapp.ResourceClient", "CheckNameAvailability", resp, "Failure responding to request")
+ return
+ }
+
+ return
+}
+
+// CheckNameAvailabilityPreparer prepares the CheckNameAvailability request.
+func (client ResourceClient) CheckNameAvailabilityPreparer(ctx context.Context, body ResourceNameAvailabilityRequest, location string) (*http.Request, error) {
+ pathParameters := map[string]interface{}{
+ "location": autorest.Encode("path", location),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
+ }
+
+ const APIVersion = "2021-10-01"
+ queryParameters := map[string]interface{}{
+ "api-version": APIVersion,
+ }
+
+ preparer := autorest.CreatePreparer(
+ autorest.AsContentType("application/json; charset=utf-8"),
+ autorest.AsPost(),
+ autorest.WithBaseURL(client.BaseURI),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.NetApp/locations/{location}/checkNameAvailability", pathParameters),
+ autorest.WithJSON(body),
+ autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare((&http.Request{}).WithContext(ctx))
+}
+
+// CheckNameAvailabilitySender sends the CheckNameAvailability request. The method will close the
+// http.Response Body if it receives an error.
+func (client ResourceClient) CheckNameAvailabilitySender(req *http.Request) (*http.Response, error) {
+ return client.Send(req, azure.DoRetryWithRegistration(client.Client))
+}
+
+// CheckNameAvailabilityResponder handles the response to the CheckNameAvailability request. The method always
+// closes the http.Response Body.
+func (client ResourceClient) CheckNameAvailabilityResponder(resp *http.Response) (result CheckAvailabilityResponse, err error) {
+ err = autorest.Respond(
+ resp,
+ azure.WithErrorUnlessStatusCode(http.StatusOK),
+ autorest.ByUnmarshallingJSON(&result),
+ autorest.ByClosing())
+ result.Response = autorest.Response{Response: resp}
+ return
+}
+
+// CheckQuotaAvailability check if a quota is available.
+// Parameters:
+// body - quota availability request.
+// location - the location
+func (client ResourceClient) CheckQuotaAvailability(ctx context.Context, body QuotaAvailabilityRequest, location string) (result CheckAvailabilityResponse, err error) {
+ if tracing.IsEnabled() {
+ ctx = tracing.StartSpan(ctx, fqdn+"/ResourceClient.CheckQuotaAvailability")
+ defer func() {
+ sc := -1
+ if result.Response.Response != nil {
+ sc = result.Response.Response.StatusCode
+ }
+ tracing.EndSpan(ctx, sc, err)
+ }()
+ }
+ if err := validation.Validate([]validation.Validation{
+ {TargetValue: body,
+ Constraints: []validation.Constraint{{Target: "body.Name", Name: validation.Null, Rule: true, Chain: nil},
+ {Target: "body.ResourceGroup", Name: validation.Null, Rule: true, Chain: nil}}}}); err != nil {
+ return result, validation.NewError("netapp.ResourceClient", "CheckQuotaAvailability", err.Error())
+ }
+
+ req, err := client.CheckQuotaAvailabilityPreparer(ctx, body, location)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "netapp.ResourceClient", "CheckQuotaAvailability", nil, "Failure preparing request")
+ return
+ }
+
+ resp, err := client.CheckQuotaAvailabilitySender(req)
+ if err != nil {
+ result.Response = autorest.Response{Response: resp}
+ err = autorest.NewErrorWithError(err, "netapp.ResourceClient", "CheckQuotaAvailability", resp, "Failure sending request")
+ return
+ }
+
+ result, err = client.CheckQuotaAvailabilityResponder(resp)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "netapp.ResourceClient", "CheckQuotaAvailability", resp, "Failure responding to request")
+ return
+ }
+
+ return
+}
+
+// CheckQuotaAvailabilityPreparer prepares the CheckQuotaAvailability request.
+func (client ResourceClient) CheckQuotaAvailabilityPreparer(ctx context.Context, body QuotaAvailabilityRequest, location string) (*http.Request, error) {
+ pathParameters := map[string]interface{}{
+ "location": autorest.Encode("path", location),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
+ }
+
+ const APIVersion = "2021-10-01"
+ queryParameters := map[string]interface{}{
+ "api-version": APIVersion,
+ }
+
+ preparer := autorest.CreatePreparer(
+ autorest.AsContentType("application/json; charset=utf-8"),
+ autorest.AsPost(),
+ autorest.WithBaseURL(client.BaseURI),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.NetApp/locations/{location}/checkQuotaAvailability", pathParameters),
+ autorest.WithJSON(body),
+ autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare((&http.Request{}).WithContext(ctx))
+}
+
+// CheckQuotaAvailabilitySender sends the CheckQuotaAvailability request. The method will close the
+// http.Response Body if it receives an error.
+func (client ResourceClient) CheckQuotaAvailabilitySender(req *http.Request) (*http.Response, error) {
+ return client.Send(req, azure.DoRetryWithRegistration(client.Client))
+}
+
+// CheckQuotaAvailabilityResponder handles the response to the CheckQuotaAvailability request. The method always
+// closes the http.Response Body.
+func (client ResourceClient) CheckQuotaAvailabilityResponder(resp *http.Response) (result CheckAvailabilityResponse, err error) {
+ err = autorest.Respond(
+ resp,
+ azure.WithErrorUnlessStatusCode(http.StatusOK),
+ autorest.ByUnmarshallingJSON(&result),
+ autorest.ByClosing())
+ result.Response = autorest.Response{Response: resp}
+ return
+}
diff --git a/services/netapp/mgmt/2021-10-01/netapp/resourcequotalimits.go b/services/netapp/mgmt/2021-10-01/netapp/resourcequotalimits.go
new file mode 100644
index 000000000000..0cd8f587e0b8
--- /dev/null
+++ b/services/netapp/mgmt/2021-10-01/netapp/resourcequotalimits.go
@@ -0,0 +1,182 @@
+package netapp
+
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License. See License.txt in the project root for license information.
+//
+// Code generated by Microsoft (R) AutoRest Code Generator.
+// Changes may cause incorrect behavior and will be lost if the code is regenerated.
+
+import (
+ "context"
+ "github.com/Azure/go-autorest/autorest"
+ "github.com/Azure/go-autorest/autorest/azure"
+ "github.com/Azure/go-autorest/tracing"
+ "net/http"
+)
+
+// ResourceQuotaLimitsClient is the microsoft NetApp Files Azure Resource Provider specification
+type ResourceQuotaLimitsClient struct {
+ BaseClient
+}
+
+// NewResourceQuotaLimitsClient creates an instance of the ResourceQuotaLimitsClient client.
+func NewResourceQuotaLimitsClient(subscriptionID string) ResourceQuotaLimitsClient {
+ return NewResourceQuotaLimitsClientWithBaseURI(DefaultBaseURI, subscriptionID)
+}
+
+// NewResourceQuotaLimitsClientWithBaseURI creates an instance of the ResourceQuotaLimitsClient client using a custom
+// endpoint. Use this when interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure
+// stack).
+func NewResourceQuotaLimitsClientWithBaseURI(baseURI string, subscriptionID string) ResourceQuotaLimitsClient {
+ return ResourceQuotaLimitsClient{NewWithBaseURI(baseURI, subscriptionID)}
+}
+
+// Get get the default and current subscription quota limit
+// Parameters:
+// location - the location
+// quotaLimitName - the name of the Quota Limit
+func (client ResourceQuotaLimitsClient) Get(ctx context.Context, location string, quotaLimitName string) (result SubscriptionQuotaItem, err error) {
+ if tracing.IsEnabled() {
+ ctx = tracing.StartSpan(ctx, fqdn+"/ResourceQuotaLimitsClient.Get")
+ defer func() {
+ sc := -1
+ if result.Response.Response != nil {
+ sc = result.Response.Response.StatusCode
+ }
+ tracing.EndSpan(ctx, sc, err)
+ }()
+ }
+ req, err := client.GetPreparer(ctx, location, quotaLimitName)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "netapp.ResourceQuotaLimitsClient", "Get", nil, "Failure preparing request")
+ return
+ }
+
+ resp, err := client.GetSender(req)
+ if err != nil {
+ result.Response = autorest.Response{Response: resp}
+ err = autorest.NewErrorWithError(err, "netapp.ResourceQuotaLimitsClient", "Get", resp, "Failure sending request")
+ return
+ }
+
+ result, err = client.GetResponder(resp)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "netapp.ResourceQuotaLimitsClient", "Get", resp, "Failure responding to request")
+ return
+ }
+
+ return
+}
+
+// GetPreparer prepares the Get request.
+func (client ResourceQuotaLimitsClient) GetPreparer(ctx context.Context, location string, quotaLimitName string) (*http.Request, error) {
+ pathParameters := map[string]interface{}{
+ "location": autorest.Encode("path", location),
+ "quotaLimitName": autorest.Encode("path", quotaLimitName),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
+ }
+
+ const APIVersion = "2021-10-01"
+ queryParameters := map[string]interface{}{
+ "api-version": APIVersion,
+ }
+
+ preparer := autorest.CreatePreparer(
+ autorest.AsGet(),
+ autorest.WithBaseURL(client.BaseURI),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.NetApp/locations/{location}/quotaLimits/{quotaLimitName}", pathParameters),
+ autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare((&http.Request{}).WithContext(ctx))
+}
+
+// GetSender sends the Get request. The method will close the
+// http.Response Body if it receives an error.
+func (client ResourceQuotaLimitsClient) GetSender(req *http.Request) (*http.Response, error) {
+ return client.Send(req, azure.DoRetryWithRegistration(client.Client))
+}
+
+// GetResponder handles the response to the Get request. The method always
+// closes the http.Response Body.
+func (client ResourceQuotaLimitsClient) GetResponder(resp *http.Response) (result SubscriptionQuotaItem, err error) {
+ err = autorest.Respond(
+ resp,
+ azure.WithErrorUnlessStatusCode(http.StatusOK),
+ autorest.ByUnmarshallingJSON(&result),
+ autorest.ByClosing())
+ result.Response = autorest.Response{Response: resp}
+ return
+}
+
+// List get the default and current limits for quotas
+// Parameters:
+// location - the location
+func (client ResourceQuotaLimitsClient) List(ctx context.Context, location string) (result SubscriptionQuotaItemList, err error) {
+ if tracing.IsEnabled() {
+ ctx = tracing.StartSpan(ctx, fqdn+"/ResourceQuotaLimitsClient.List")
+ defer func() {
+ sc := -1
+ if result.Response.Response != nil {
+ sc = result.Response.Response.StatusCode
+ }
+ tracing.EndSpan(ctx, sc, err)
+ }()
+ }
+ req, err := client.ListPreparer(ctx, location)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "netapp.ResourceQuotaLimitsClient", "List", nil, "Failure preparing request")
+ return
+ }
+
+ resp, err := client.ListSender(req)
+ if err != nil {
+ result.Response = autorest.Response{Response: resp}
+ err = autorest.NewErrorWithError(err, "netapp.ResourceQuotaLimitsClient", "List", resp, "Failure sending request")
+ return
+ }
+
+ result, err = client.ListResponder(resp)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "netapp.ResourceQuotaLimitsClient", "List", resp, "Failure responding to request")
+ return
+ }
+
+ return
+}
+
+// ListPreparer prepares the List request.
+func (client ResourceQuotaLimitsClient) ListPreparer(ctx context.Context, location string) (*http.Request, error) {
+ pathParameters := map[string]interface{}{
+ "location": autorest.Encode("path", location),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
+ }
+
+ const APIVersion = "2021-10-01"
+ queryParameters := map[string]interface{}{
+ "api-version": APIVersion,
+ }
+
+ preparer := autorest.CreatePreparer(
+ autorest.AsGet(),
+ autorest.WithBaseURL(client.BaseURI),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.NetApp/locations/{location}/quotaLimits", pathParameters),
+ autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare((&http.Request{}).WithContext(ctx))
+}
+
+// ListSender sends the List request. The method will close the
+// http.Response Body if it receives an error.
+func (client ResourceQuotaLimitsClient) ListSender(req *http.Request) (*http.Response, error) {
+ return client.Send(req, azure.DoRetryWithRegistration(client.Client))
+}
+
+// ListResponder handles the response to the List request. The method always
+// closes the http.Response Body.
+func (client ResourceQuotaLimitsClient) ListResponder(resp *http.Response) (result SubscriptionQuotaItemList, err error) {
+ err = autorest.Respond(
+ resp,
+ azure.WithErrorUnlessStatusCode(http.StatusOK),
+ autorest.ByUnmarshallingJSON(&result),
+ autorest.ByClosing())
+ result.Response = autorest.Response{Response: resp}
+ return
+}
diff --git a/services/netapp/mgmt/2021-10-01/netapp/snapshotpolicies.go b/services/netapp/mgmt/2021-10-01/netapp/snapshotpolicies.go
new file mode 100644
index 000000000000..365057c6955f
--- /dev/null
+++ b/services/netapp/mgmt/2021-10-01/netapp/snapshotpolicies.go
@@ -0,0 +1,569 @@
+package netapp
+
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License. See License.txt in the project root for license information.
+//
+// Code generated by Microsoft (R) AutoRest Code Generator.
+// Changes may cause incorrect behavior and will be lost if the code is regenerated.
+
+import (
+ "context"
+ "github.com/Azure/go-autorest/autorest"
+ "github.com/Azure/go-autorest/autorest/azure"
+ "github.com/Azure/go-autorest/autorest/validation"
+ "github.com/Azure/go-autorest/tracing"
+ "net/http"
+)
+
+// SnapshotPoliciesClient is the microsoft NetApp Files Azure Resource Provider specification
+type SnapshotPoliciesClient struct {
+ BaseClient
+}
+
+// NewSnapshotPoliciesClient creates an instance of the SnapshotPoliciesClient client.
+func NewSnapshotPoliciesClient(subscriptionID string) SnapshotPoliciesClient {
+ return NewSnapshotPoliciesClientWithBaseURI(DefaultBaseURI, subscriptionID)
+}
+
+// NewSnapshotPoliciesClientWithBaseURI creates an instance of the SnapshotPoliciesClient client using a custom
+// endpoint. Use this when interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure
+// stack).
+func NewSnapshotPoliciesClientWithBaseURI(baseURI string, subscriptionID string) SnapshotPoliciesClient {
+ return SnapshotPoliciesClient{NewWithBaseURI(baseURI, subscriptionID)}
+}
+
+// Create create a snapshot policy
+// Parameters:
+// body - snapshot policy object supplied in the body of the operation.
+// resourceGroupName - the name of the resource group.
+// accountName - the name of the NetApp account
+// snapshotPolicyName - the name of the snapshot policy
+func (client SnapshotPoliciesClient) Create(ctx context.Context, body SnapshotPolicy, resourceGroupName string, accountName string, snapshotPolicyName string) (result SnapshotPolicy, err error) {
+ if tracing.IsEnabled() {
+ ctx = tracing.StartSpan(ctx, fqdn+"/SnapshotPoliciesClient.Create")
+ defer func() {
+ sc := -1
+ if result.Response.Response != nil {
+ sc = result.Response.Response.StatusCode
+ }
+ tracing.EndSpan(ctx, sc, err)
+ }()
+ }
+ if err := validation.Validate([]validation.Validation{
+ {TargetValue: body,
+ Constraints: []validation.Constraint{{Target: "body.Location", Name: validation.Null, Rule: true, Chain: nil},
+ {Target: "body.SnapshotPolicyProperties", Name: validation.Null, Rule: true, Chain: nil}}},
+ {TargetValue: resourceGroupName,
+ Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil},
+ {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil},
+ {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}}); err != nil {
+ return result, validation.NewError("netapp.SnapshotPoliciesClient", "Create", err.Error())
+ }
+
+ req, err := client.CreatePreparer(ctx, body, resourceGroupName, accountName, snapshotPolicyName)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "netapp.SnapshotPoliciesClient", "Create", nil, "Failure preparing request")
+ return
+ }
+
+ resp, err := client.CreateSender(req)
+ if err != nil {
+ result.Response = autorest.Response{Response: resp}
+ err = autorest.NewErrorWithError(err, "netapp.SnapshotPoliciesClient", "Create", resp, "Failure sending request")
+ return
+ }
+
+ result, err = client.CreateResponder(resp)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "netapp.SnapshotPoliciesClient", "Create", resp, "Failure responding to request")
+ return
+ }
+
+ return
+}
+
+// CreatePreparer prepares the Create request.
+func (client SnapshotPoliciesClient) CreatePreparer(ctx context.Context, body SnapshotPolicy, resourceGroupName string, accountName string, snapshotPolicyName string) (*http.Request, error) {
+ pathParameters := map[string]interface{}{
+ "accountName": autorest.Encode("path", accountName),
+ "resourceGroupName": autorest.Encode("path", resourceGroupName),
+ "snapshotPolicyName": autorest.Encode("path", snapshotPolicyName),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
+ }
+
+ const APIVersion = "2021-10-01"
+ queryParameters := map[string]interface{}{
+ "api-version": APIVersion,
+ }
+
+ body.ID = nil
+ body.Name = nil
+ body.Etag = nil
+ body.Type = nil
+ body.SystemData = nil
+ preparer := autorest.CreatePreparer(
+ autorest.AsContentType("application/json; charset=utf-8"),
+ autorest.AsPut(),
+ autorest.WithBaseURL(client.BaseURI),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/snapshotPolicies/{snapshotPolicyName}", pathParameters),
+ autorest.WithJSON(body),
+ autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare((&http.Request{}).WithContext(ctx))
+}
+
+// CreateSender sends the Create request. The method will close the
+// http.Response Body if it receives an error.
+func (client SnapshotPoliciesClient) CreateSender(req *http.Request) (*http.Response, error) {
+ return client.Send(req, azure.DoRetryWithRegistration(client.Client))
+}
+
+// CreateResponder handles the response to the Create request. The method always
+// closes the http.Response Body.
+func (client SnapshotPoliciesClient) CreateResponder(resp *http.Response) (result SnapshotPolicy, err error) {
+ err = autorest.Respond(
+ resp,
+ azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated),
+ autorest.ByUnmarshallingJSON(&result),
+ autorest.ByClosing())
+ result.Response = autorest.Response{Response: resp}
+ return
+}
+
+// Delete delete snapshot policy
+// Parameters:
+// resourceGroupName - the name of the resource group.
+// accountName - the name of the NetApp account
+// snapshotPolicyName - the name of the snapshot policy
+func (client SnapshotPoliciesClient) Delete(ctx context.Context, resourceGroupName string, accountName string, snapshotPolicyName string) (result SnapshotPoliciesDeleteFuture, err error) {
+ if tracing.IsEnabled() {
+ ctx = tracing.StartSpan(ctx, fqdn+"/SnapshotPoliciesClient.Delete")
+ defer func() {
+ sc := -1
+ if result.FutureAPI != nil && result.FutureAPI.Response() != nil {
+ sc = result.FutureAPI.Response().StatusCode
+ }
+ tracing.EndSpan(ctx, sc, err)
+ }()
+ }
+ if err := validation.Validate([]validation.Validation{
+ {TargetValue: resourceGroupName,
+ Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil},
+ {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil},
+ {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}}); err != nil {
+ return result, validation.NewError("netapp.SnapshotPoliciesClient", "Delete", err.Error())
+ }
+
+ req, err := client.DeletePreparer(ctx, resourceGroupName, accountName, snapshotPolicyName)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "netapp.SnapshotPoliciesClient", "Delete", nil, "Failure preparing request")
+ return
+ }
+
+ result, err = client.DeleteSender(req)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "netapp.SnapshotPoliciesClient", "Delete", result.Response(), "Failure sending request")
+ return
+ }
+
+ return
+}
+
+// DeletePreparer prepares the Delete request.
+func (client SnapshotPoliciesClient) DeletePreparer(ctx context.Context, resourceGroupName string, accountName string, snapshotPolicyName string) (*http.Request, error) {
+ pathParameters := map[string]interface{}{
+ "accountName": autorest.Encode("path", accountName),
+ "resourceGroupName": autorest.Encode("path", resourceGroupName),
+ "snapshotPolicyName": autorest.Encode("path", snapshotPolicyName),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
+ }
+
+ const APIVersion = "2021-10-01"
+ queryParameters := map[string]interface{}{
+ "api-version": APIVersion,
+ }
+
+ preparer := autorest.CreatePreparer(
+ autorest.AsDelete(),
+ autorest.WithBaseURL(client.BaseURI),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/snapshotPolicies/{snapshotPolicyName}", pathParameters),
+ autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare((&http.Request{}).WithContext(ctx))
+}
+
+// DeleteSender sends the Delete request. The method will close the
+// http.Response Body if it receives an error.
+func (client SnapshotPoliciesClient) DeleteSender(req *http.Request) (future SnapshotPoliciesDeleteFuture, err error) {
+ var resp *http.Response
+ future.FutureAPI = &azure.Future{}
+ resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client))
+ if err != nil {
+ return
+ }
+ var azf azure.Future
+ azf, err = azure.NewFutureFromResponse(resp)
+ future.FutureAPI = &azf
+ future.Result = future.result
+ return
+}
+
+// DeleteResponder handles the response to the Delete request. The method always
+// closes the http.Response Body.
+func (client SnapshotPoliciesClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) {
+ err = autorest.Respond(
+ resp,
+ azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent),
+ autorest.ByClosing())
+ result.Response = resp
+ return
+}
+
+// Get get a snapshot Policy
+// Parameters:
+// resourceGroupName - the name of the resource group.
+// accountName - the name of the NetApp account
+// snapshotPolicyName - the name of the snapshot policy
+func (client SnapshotPoliciesClient) Get(ctx context.Context, resourceGroupName string, accountName string, snapshotPolicyName string) (result SnapshotPolicy, err error) {
+ if tracing.IsEnabled() {
+ ctx = tracing.StartSpan(ctx, fqdn+"/SnapshotPoliciesClient.Get")
+ defer func() {
+ sc := -1
+ if result.Response.Response != nil {
+ sc = result.Response.Response.StatusCode
+ }
+ tracing.EndSpan(ctx, sc, err)
+ }()
+ }
+ if err := validation.Validate([]validation.Validation{
+ {TargetValue: resourceGroupName,
+ Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil},
+ {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil},
+ {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}}); err != nil {
+ return result, validation.NewError("netapp.SnapshotPoliciesClient", "Get", err.Error())
+ }
+
+ req, err := client.GetPreparer(ctx, resourceGroupName, accountName, snapshotPolicyName)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "netapp.SnapshotPoliciesClient", "Get", nil, "Failure preparing request")
+ return
+ }
+
+ resp, err := client.GetSender(req)
+ if err != nil {
+ result.Response = autorest.Response{Response: resp}
+ err = autorest.NewErrorWithError(err, "netapp.SnapshotPoliciesClient", "Get", resp, "Failure sending request")
+ return
+ }
+
+ result, err = client.GetResponder(resp)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "netapp.SnapshotPoliciesClient", "Get", resp, "Failure responding to request")
+ return
+ }
+
+ return
+}
+
+// GetPreparer prepares the Get request.
+func (client SnapshotPoliciesClient) GetPreparer(ctx context.Context, resourceGroupName string, accountName string, snapshotPolicyName string) (*http.Request, error) {
+ pathParameters := map[string]interface{}{
+ "accountName": autorest.Encode("path", accountName),
+ "resourceGroupName": autorest.Encode("path", resourceGroupName),
+ "snapshotPolicyName": autorest.Encode("path", snapshotPolicyName),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
+ }
+
+ const APIVersion = "2021-10-01"
+ queryParameters := map[string]interface{}{
+ "api-version": APIVersion,
+ }
+
+ preparer := autorest.CreatePreparer(
+ autorest.AsGet(),
+ autorest.WithBaseURL(client.BaseURI),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/snapshotPolicies/{snapshotPolicyName}", pathParameters),
+ autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare((&http.Request{}).WithContext(ctx))
+}
+
+// GetSender sends the Get request. The method will close the
+// http.Response Body if it receives an error.
+func (client SnapshotPoliciesClient) GetSender(req *http.Request) (*http.Response, error) {
+ return client.Send(req, azure.DoRetryWithRegistration(client.Client))
+}
+
+// GetResponder handles the response to the Get request. The method always
+// closes the http.Response Body.
+func (client SnapshotPoliciesClient) GetResponder(resp *http.Response) (result SnapshotPolicy, err error) {
+ err = autorest.Respond(
+ resp,
+ azure.WithErrorUnlessStatusCode(http.StatusOK),
+ autorest.ByUnmarshallingJSON(&result),
+ autorest.ByClosing())
+ result.Response = autorest.Response{Response: resp}
+ return
+}
+
+// List list snapshot policy
+// Parameters:
+// resourceGroupName - the name of the resource group.
+// accountName - the name of the NetApp account
+func (client SnapshotPoliciesClient) List(ctx context.Context, resourceGroupName string, accountName string) (result SnapshotPoliciesList, err error) {
+ if tracing.IsEnabled() {
+ ctx = tracing.StartSpan(ctx, fqdn+"/SnapshotPoliciesClient.List")
+ defer func() {
+ sc := -1
+ if result.Response.Response != nil {
+ sc = result.Response.Response.StatusCode
+ }
+ tracing.EndSpan(ctx, sc, err)
+ }()
+ }
+ if err := validation.Validate([]validation.Validation{
+ {TargetValue: resourceGroupName,
+ Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil},
+ {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil},
+ {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}}); err != nil {
+ return result, validation.NewError("netapp.SnapshotPoliciesClient", "List", err.Error())
+ }
+
+ req, err := client.ListPreparer(ctx, resourceGroupName, accountName)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "netapp.SnapshotPoliciesClient", "List", nil, "Failure preparing request")
+ return
+ }
+
+ resp, err := client.ListSender(req)
+ if err != nil {
+ result.Response = autorest.Response{Response: resp}
+ err = autorest.NewErrorWithError(err, "netapp.SnapshotPoliciesClient", "List", resp, "Failure sending request")
+ return
+ }
+
+ result, err = client.ListResponder(resp)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "netapp.SnapshotPoliciesClient", "List", resp, "Failure responding to request")
+ return
+ }
+
+ return
+}
+
+// ListPreparer prepares the List request.
+func (client SnapshotPoliciesClient) ListPreparer(ctx context.Context, resourceGroupName string, accountName string) (*http.Request, error) {
+ pathParameters := map[string]interface{}{
+ "accountName": autorest.Encode("path", accountName),
+ "resourceGroupName": autorest.Encode("path", resourceGroupName),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
+ }
+
+ const APIVersion = "2021-10-01"
+ queryParameters := map[string]interface{}{
+ "api-version": APIVersion,
+ }
+
+ preparer := autorest.CreatePreparer(
+ autorest.AsGet(),
+ autorest.WithBaseURL(client.BaseURI),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/snapshotPolicies", pathParameters),
+ autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare((&http.Request{}).WithContext(ctx))
+}
+
+// ListSender sends the List request. The method will close the
+// http.Response Body if it receives an error.
+func (client SnapshotPoliciesClient) ListSender(req *http.Request) (*http.Response, error) {
+ return client.Send(req, azure.DoRetryWithRegistration(client.Client))
+}
+
+// ListResponder handles the response to the List request. The method always
+// closes the http.Response Body.
+func (client SnapshotPoliciesClient) ListResponder(resp *http.Response) (result SnapshotPoliciesList, err error) {
+ err = autorest.Respond(
+ resp,
+ azure.WithErrorUnlessStatusCode(http.StatusOK),
+ autorest.ByUnmarshallingJSON(&result),
+ autorest.ByClosing())
+ result.Response = autorest.Response{Response: resp}
+ return
+}
+
+// ListVolumes get volumes associated with snapshot policy
+// Parameters:
+// resourceGroupName - the name of the resource group.
+// accountName - the name of the NetApp account
+// snapshotPolicyName - the name of the snapshot policy
+func (client SnapshotPoliciesClient) ListVolumes(ctx context.Context, resourceGroupName string, accountName string, snapshotPolicyName string) (result SnapshotPolicyVolumeList, err error) {
+ if tracing.IsEnabled() {
+ ctx = tracing.StartSpan(ctx, fqdn+"/SnapshotPoliciesClient.ListVolumes")
+ defer func() {
+ sc := -1
+ if result.Response.Response != nil {
+ sc = result.Response.Response.StatusCode
+ }
+ tracing.EndSpan(ctx, sc, err)
+ }()
+ }
+ if err := validation.Validate([]validation.Validation{
+ {TargetValue: resourceGroupName,
+ Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil},
+ {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil},
+ {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}}); err != nil {
+ return result, validation.NewError("netapp.SnapshotPoliciesClient", "ListVolumes", err.Error())
+ }
+
+ req, err := client.ListVolumesPreparer(ctx, resourceGroupName, accountName, snapshotPolicyName)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "netapp.SnapshotPoliciesClient", "ListVolumes", nil, "Failure preparing request")
+ return
+ }
+
+ resp, err := client.ListVolumesSender(req)
+ if err != nil {
+ result.Response = autorest.Response{Response: resp}
+ err = autorest.NewErrorWithError(err, "netapp.SnapshotPoliciesClient", "ListVolumes", resp, "Failure sending request")
+ return
+ }
+
+ result, err = client.ListVolumesResponder(resp)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "netapp.SnapshotPoliciesClient", "ListVolumes", resp, "Failure responding to request")
+ return
+ }
+
+ return
+}
+
+// ListVolumesPreparer prepares the ListVolumes request.
+func (client SnapshotPoliciesClient) ListVolumesPreparer(ctx context.Context, resourceGroupName string, accountName string, snapshotPolicyName string) (*http.Request, error) {
+ pathParameters := map[string]interface{}{
+ "accountName": autorest.Encode("path", accountName),
+ "resourceGroupName": autorest.Encode("path", resourceGroupName),
+ "snapshotPolicyName": autorest.Encode("path", snapshotPolicyName),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
+ }
+
+ const APIVersion = "2021-10-01"
+ queryParameters := map[string]interface{}{
+ "api-version": APIVersion,
+ }
+
+ preparer := autorest.CreatePreparer(
+ autorest.AsGet(),
+ autorest.WithBaseURL(client.BaseURI),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/snapshotPolicies/{snapshotPolicyName}/volumes", pathParameters),
+ autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare((&http.Request{}).WithContext(ctx))
+}
+
+// ListVolumesSender sends the ListVolumes request. The method will close the
+// http.Response Body if it receives an error.
+func (client SnapshotPoliciesClient) ListVolumesSender(req *http.Request) (*http.Response, error) {
+ return client.Send(req, azure.DoRetryWithRegistration(client.Client))
+}
+
+// ListVolumesResponder handles the response to the ListVolumes request. The method always
+// closes the http.Response Body.
+func (client SnapshotPoliciesClient) ListVolumesResponder(resp *http.Response) (result SnapshotPolicyVolumeList, err error) {
+ err = autorest.Respond(
+ resp,
+ azure.WithErrorUnlessStatusCode(http.StatusOK),
+ autorest.ByUnmarshallingJSON(&result),
+ autorest.ByClosing())
+ result.Response = autorest.Response{Response: resp}
+ return
+}
+
+// Update patch a snapshot policy
+// Parameters:
+// body - snapshot policy object supplied in the body of the operation.
+// resourceGroupName - the name of the resource group.
+// accountName - the name of the NetApp account
+// snapshotPolicyName - the name of the snapshot policy
+func (client SnapshotPoliciesClient) Update(ctx context.Context, body SnapshotPolicyPatch, resourceGroupName string, accountName string, snapshotPolicyName string) (result SnapshotPoliciesUpdateFuture, err error) {
+ if tracing.IsEnabled() {
+ ctx = tracing.StartSpan(ctx, fqdn+"/SnapshotPoliciesClient.Update")
+ defer func() {
+ sc := -1
+ if result.FutureAPI != nil && result.FutureAPI.Response() != nil {
+ sc = result.FutureAPI.Response().StatusCode
+ }
+ tracing.EndSpan(ctx, sc, err)
+ }()
+ }
+ if err := validation.Validate([]validation.Validation{
+ {TargetValue: resourceGroupName,
+ Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil},
+ {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil},
+ {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}}); err != nil {
+ return result, validation.NewError("netapp.SnapshotPoliciesClient", "Update", err.Error())
+ }
+
+ req, err := client.UpdatePreparer(ctx, body, resourceGroupName, accountName, snapshotPolicyName)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "netapp.SnapshotPoliciesClient", "Update", nil, "Failure preparing request")
+ return
+ }
+
+ result, err = client.UpdateSender(req)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "netapp.SnapshotPoliciesClient", "Update", result.Response(), "Failure sending request")
+ return
+ }
+
+ return
+}
+
+// UpdatePreparer prepares the Update request.
+func (client SnapshotPoliciesClient) UpdatePreparer(ctx context.Context, body SnapshotPolicyPatch, resourceGroupName string, accountName string, snapshotPolicyName string) (*http.Request, error) {
+ pathParameters := map[string]interface{}{
+ "accountName": autorest.Encode("path", accountName),
+ "resourceGroupName": autorest.Encode("path", resourceGroupName),
+ "snapshotPolicyName": autorest.Encode("path", snapshotPolicyName),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
+ }
+
+ const APIVersion = "2021-10-01"
+ queryParameters := map[string]interface{}{
+ "api-version": APIVersion,
+ }
+
+ body.ID = nil
+ body.Name = nil
+ body.Type = nil
+ preparer := autorest.CreatePreparer(
+ autorest.AsContentType("application/json; charset=utf-8"),
+ autorest.AsPatch(),
+ autorest.WithBaseURL(client.BaseURI),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/snapshotPolicies/{snapshotPolicyName}", pathParameters),
+ autorest.WithJSON(body),
+ autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare((&http.Request{}).WithContext(ctx))
+}
+
+// UpdateSender sends the Update request. The method will close the
+// http.Response Body if it receives an error.
+func (client SnapshotPoliciesClient) UpdateSender(req *http.Request) (future SnapshotPoliciesUpdateFuture, err error) {
+ var resp *http.Response
+ future.FutureAPI = &azure.Future{}
+ resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client))
+ if err != nil {
+ return
+ }
+ var azf azure.Future
+ azf, err = azure.NewFutureFromResponse(resp)
+ future.FutureAPI = &azf
+ future.Result = future.result
+ return
+}
+
+// UpdateResponder handles the response to the Update request. The method always
+// closes the http.Response Body.
+func (client SnapshotPoliciesClient) UpdateResponder(resp *http.Response) (result SnapshotPolicy, err error) {
+ err = autorest.Respond(
+ resp,
+ azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted),
+ autorest.ByUnmarshallingJSON(&result),
+ autorest.ByClosing())
+ result.Response = autorest.Response{Response: resp}
+ return
+}
diff --git a/services/netapp/mgmt/2021-10-01/netapp/snapshots.go b/services/netapp/mgmt/2021-10-01/netapp/snapshots.go
new file mode 100644
index 000000000000..d225f05633bc
--- /dev/null
+++ b/services/netapp/mgmt/2021-10-01/netapp/snapshots.go
@@ -0,0 +1,654 @@
+package netapp
+
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License. See License.txt in the project root for license information.
+//
+// Code generated by Microsoft (R) AutoRest Code Generator.
+// Changes may cause incorrect behavior and will be lost if the code is regenerated.
+
+import (
+ "context"
+ "github.com/Azure/go-autorest/autorest"
+ "github.com/Azure/go-autorest/autorest/azure"
+ "github.com/Azure/go-autorest/autorest/validation"
+ "github.com/Azure/go-autorest/tracing"
+ "net/http"
+)
+
+// SnapshotsClient is the microsoft NetApp Files Azure Resource Provider specification
+type SnapshotsClient struct {
+ BaseClient
+}
+
+// NewSnapshotsClient creates an instance of the SnapshotsClient client.
+func NewSnapshotsClient(subscriptionID string) SnapshotsClient {
+ return NewSnapshotsClientWithBaseURI(DefaultBaseURI, subscriptionID)
+}
+
+// NewSnapshotsClientWithBaseURI creates an instance of the SnapshotsClient client using a custom endpoint. Use this
+// when interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure stack).
+func NewSnapshotsClientWithBaseURI(baseURI string, subscriptionID string) SnapshotsClient {
+ return SnapshotsClient{NewWithBaseURI(baseURI, subscriptionID)}
+}
+
+// Create create the specified snapshot within the given volume
+// Parameters:
+// body - snapshot object supplied in the body of the operation.
+// resourceGroupName - the name of the resource group.
+// accountName - the name of the NetApp account
+// poolName - the name of the capacity pool
+// volumeName - the name of the volume
+// snapshotName - the name of the snapshot
+func (client SnapshotsClient) Create(ctx context.Context, body Snapshot, resourceGroupName string, accountName string, poolName string, volumeName string, snapshotName string) (result SnapshotsCreateFuture, err error) {
+ if tracing.IsEnabled() {
+ ctx = tracing.StartSpan(ctx, fqdn+"/SnapshotsClient.Create")
+ defer func() {
+ sc := -1
+ if result.FutureAPI != nil && result.FutureAPI.Response() != nil {
+ sc = result.FutureAPI.Response().StatusCode
+ }
+ tracing.EndSpan(ctx, sc, err)
+ }()
+ }
+ if err := validation.Validate([]validation.Validation{
+ {TargetValue: body,
+ Constraints: []validation.Constraint{{Target: "body.Location", Name: validation.Null, Rule: true, Chain: nil},
+ {Target: "body.SnapshotProperties", Name: validation.Null, Rule: false,
+ Chain: []validation.Constraint{{Target: "body.SnapshotProperties.SnapshotID", Name: validation.Null, Rule: false,
+ Chain: []validation.Constraint{{Target: "body.SnapshotProperties.SnapshotID", Name: validation.MaxLength, Rule: 36, Chain: nil},
+ {Target: "body.SnapshotProperties.SnapshotID", Name: validation.MinLength, Rule: 36, Chain: nil},
+ {Target: "body.SnapshotProperties.SnapshotID", Name: validation.Pattern, Rule: `^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$`, Chain: nil},
+ }},
+ }}}},
+ {TargetValue: resourceGroupName,
+ Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil},
+ {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil},
+ {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}},
+ {TargetValue: poolName,
+ Constraints: []validation.Constraint{{Target: "poolName", Name: validation.MaxLength, Rule: 64, Chain: nil},
+ {Target: "poolName", Name: validation.MinLength, Rule: 1, Chain: nil},
+ {Target: "poolName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9][a-zA-Z0-9\-_]{0,63}$`, Chain: nil}}},
+ {TargetValue: volumeName,
+ Constraints: []validation.Constraint{{Target: "volumeName", Name: validation.MaxLength, Rule: 64, Chain: nil},
+ {Target: "volumeName", Name: validation.MinLength, Rule: 1, Chain: nil},
+ {Target: "volumeName", Name: validation.Pattern, Rule: `^[a-zA-Z][a-zA-Z0-9\-_]{0,63}$`, Chain: nil}}}}); err != nil {
+ return result, validation.NewError("netapp.SnapshotsClient", "Create", err.Error())
+ }
+
+ req, err := client.CreatePreparer(ctx, body, resourceGroupName, accountName, poolName, volumeName, snapshotName)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "netapp.SnapshotsClient", "Create", nil, "Failure preparing request")
+ return
+ }
+
+ result, err = client.CreateSender(req)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "netapp.SnapshotsClient", "Create", result.Response(), "Failure sending request")
+ return
+ }
+
+ return
+}
+
+// CreatePreparer prepares the Create request.
+func (client SnapshotsClient) CreatePreparer(ctx context.Context, body Snapshot, resourceGroupName string, accountName string, poolName string, volumeName string, snapshotName string) (*http.Request, error) {
+ pathParameters := map[string]interface{}{
+ "accountName": autorest.Encode("path", accountName),
+ "poolName": autorest.Encode("path", poolName),
+ "resourceGroupName": autorest.Encode("path", resourceGroupName),
+ "snapshotName": autorest.Encode("path", snapshotName),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
+ "volumeName": autorest.Encode("path", volumeName),
+ }
+
+ const APIVersion = "2021-10-01"
+ queryParameters := map[string]interface{}{
+ "api-version": APIVersion,
+ }
+
+ body.ID = nil
+ body.Name = nil
+ body.Type = nil
+ preparer := autorest.CreatePreparer(
+ autorest.AsContentType("application/json; charset=utf-8"),
+ autorest.AsPut(),
+ autorest.WithBaseURL(client.BaseURI),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/capacityPools/{poolName}/volumes/{volumeName}/snapshots/{snapshotName}", pathParameters),
+ autorest.WithJSON(body),
+ autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare((&http.Request{}).WithContext(ctx))
+}
+
+// CreateSender sends the Create request. The method will close the
+// http.Response Body if it receives an error.
+func (client SnapshotsClient) CreateSender(req *http.Request) (future SnapshotsCreateFuture, err error) {
+ var resp *http.Response
+ future.FutureAPI = &azure.Future{}
+ resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client))
+ if err != nil {
+ return
+ }
+ var azf azure.Future
+ azf, err = azure.NewFutureFromResponse(resp)
+ future.FutureAPI = &azf
+ future.Result = future.result
+ return
+}
+
+// CreateResponder handles the response to the Create request. The method always
+// closes the http.Response Body.
+func (client SnapshotsClient) CreateResponder(resp *http.Response) (result Snapshot, err error) {
+ err = autorest.Respond(
+ resp,
+ azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated, http.StatusAccepted),
+ autorest.ByUnmarshallingJSON(&result),
+ autorest.ByClosing())
+ result.Response = autorest.Response{Response: resp}
+ return
+}
+
+// Delete delete snapshot
+// Parameters:
+// resourceGroupName - the name of the resource group.
+// accountName - the name of the NetApp account
+// poolName - the name of the capacity pool
+// volumeName - the name of the volume
+// snapshotName - the name of the snapshot
+func (client SnapshotsClient) Delete(ctx context.Context, resourceGroupName string, accountName string, poolName string, volumeName string, snapshotName string) (result SnapshotsDeleteFuture, err error) {
+ if tracing.IsEnabled() {
+ ctx = tracing.StartSpan(ctx, fqdn+"/SnapshotsClient.Delete")
+ defer func() {
+ sc := -1
+ if result.FutureAPI != nil && result.FutureAPI.Response() != nil {
+ sc = result.FutureAPI.Response().StatusCode
+ }
+ tracing.EndSpan(ctx, sc, err)
+ }()
+ }
+ if err := validation.Validate([]validation.Validation{
+ {TargetValue: resourceGroupName,
+ Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil},
+ {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil},
+ {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}},
+ {TargetValue: poolName,
+ Constraints: []validation.Constraint{{Target: "poolName", Name: validation.MaxLength, Rule: 64, Chain: nil},
+ {Target: "poolName", Name: validation.MinLength, Rule: 1, Chain: nil},
+ {Target: "poolName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9][a-zA-Z0-9\-_]{0,63}$`, Chain: nil}}},
+ {TargetValue: volumeName,
+ Constraints: []validation.Constraint{{Target: "volumeName", Name: validation.MaxLength, Rule: 64, Chain: nil},
+ {Target: "volumeName", Name: validation.MinLength, Rule: 1, Chain: nil},
+ {Target: "volumeName", Name: validation.Pattern, Rule: `^[a-zA-Z][a-zA-Z0-9\-_]{0,63}$`, Chain: nil}}}}); err != nil {
+ return result, validation.NewError("netapp.SnapshotsClient", "Delete", err.Error())
+ }
+
+ req, err := client.DeletePreparer(ctx, resourceGroupName, accountName, poolName, volumeName, snapshotName)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "netapp.SnapshotsClient", "Delete", nil, "Failure preparing request")
+ return
+ }
+
+ result, err = client.DeleteSender(req)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "netapp.SnapshotsClient", "Delete", result.Response(), "Failure sending request")
+ return
+ }
+
+ return
+}
+
+// DeletePreparer prepares the Delete request.
+func (client SnapshotsClient) DeletePreparer(ctx context.Context, resourceGroupName string, accountName string, poolName string, volumeName string, snapshotName string) (*http.Request, error) {
+ pathParameters := map[string]interface{}{
+ "accountName": autorest.Encode("path", accountName),
+ "poolName": autorest.Encode("path", poolName),
+ "resourceGroupName": autorest.Encode("path", resourceGroupName),
+ "snapshotName": autorest.Encode("path", snapshotName),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
+ "volumeName": autorest.Encode("path", volumeName),
+ }
+
+ const APIVersion = "2021-10-01"
+ queryParameters := map[string]interface{}{
+ "api-version": APIVersion,
+ }
+
+ preparer := autorest.CreatePreparer(
+ autorest.AsDelete(),
+ autorest.WithBaseURL(client.BaseURI),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/capacityPools/{poolName}/volumes/{volumeName}/snapshots/{snapshotName}", pathParameters),
+ autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare((&http.Request{}).WithContext(ctx))
+}
+
+// DeleteSender sends the Delete request. The method will close the
+// http.Response Body if it receives an error.
+func (client SnapshotsClient) DeleteSender(req *http.Request) (future SnapshotsDeleteFuture, err error) {
+ var resp *http.Response
+ future.FutureAPI = &azure.Future{}
+ resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client))
+ if err != nil {
+ return
+ }
+ var azf azure.Future
+ azf, err = azure.NewFutureFromResponse(resp)
+ future.FutureAPI = &azf
+ future.Result = future.result
+ return
+}
+
+// DeleteResponder handles the response to the Delete request. The method always
+// closes the http.Response Body.
+func (client SnapshotsClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) {
+ err = autorest.Respond(
+ resp,
+ azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent),
+ autorest.ByClosing())
+ result.Response = resp
+ return
+}
+
+// Get get details of the specified snapshot
+// Parameters:
+// resourceGroupName - the name of the resource group.
+// accountName - the name of the NetApp account
+// poolName - the name of the capacity pool
+// volumeName - the name of the volume
+// snapshotName - the name of the snapshot
+func (client SnapshotsClient) Get(ctx context.Context, resourceGroupName string, accountName string, poolName string, volumeName string, snapshotName string) (result Snapshot, err error) {
+ if tracing.IsEnabled() {
+ ctx = tracing.StartSpan(ctx, fqdn+"/SnapshotsClient.Get")
+ defer func() {
+ sc := -1
+ if result.Response.Response != nil {
+ sc = result.Response.Response.StatusCode
+ }
+ tracing.EndSpan(ctx, sc, err)
+ }()
+ }
+ if err := validation.Validate([]validation.Validation{
+ {TargetValue: resourceGroupName,
+ Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil},
+ {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil},
+ {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}},
+ {TargetValue: poolName,
+ Constraints: []validation.Constraint{{Target: "poolName", Name: validation.MaxLength, Rule: 64, Chain: nil},
+ {Target: "poolName", Name: validation.MinLength, Rule: 1, Chain: nil},
+ {Target: "poolName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9][a-zA-Z0-9\-_]{0,63}$`, Chain: nil}}},
+ {TargetValue: volumeName,
+ Constraints: []validation.Constraint{{Target: "volumeName", Name: validation.MaxLength, Rule: 64, Chain: nil},
+ {Target: "volumeName", Name: validation.MinLength, Rule: 1, Chain: nil},
+ {Target: "volumeName", Name: validation.Pattern, Rule: `^[a-zA-Z][a-zA-Z0-9\-_]{0,63}$`, Chain: nil}}}}); err != nil {
+ return result, validation.NewError("netapp.SnapshotsClient", "Get", err.Error())
+ }
+
+ req, err := client.GetPreparer(ctx, resourceGroupName, accountName, poolName, volumeName, snapshotName)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "netapp.SnapshotsClient", "Get", nil, "Failure preparing request")
+ return
+ }
+
+ resp, err := client.GetSender(req)
+ if err != nil {
+ result.Response = autorest.Response{Response: resp}
+ err = autorest.NewErrorWithError(err, "netapp.SnapshotsClient", "Get", resp, "Failure sending request")
+ return
+ }
+
+ result, err = client.GetResponder(resp)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "netapp.SnapshotsClient", "Get", resp, "Failure responding to request")
+ return
+ }
+
+ return
+}
+
+// GetPreparer prepares the Get request.
+func (client SnapshotsClient) GetPreparer(ctx context.Context, resourceGroupName string, accountName string, poolName string, volumeName string, snapshotName string) (*http.Request, error) {
+ pathParameters := map[string]interface{}{
+ "accountName": autorest.Encode("path", accountName),
+ "poolName": autorest.Encode("path", poolName),
+ "resourceGroupName": autorest.Encode("path", resourceGroupName),
+ "snapshotName": autorest.Encode("path", snapshotName),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
+ "volumeName": autorest.Encode("path", volumeName),
+ }
+
+ const APIVersion = "2021-10-01"
+ queryParameters := map[string]interface{}{
+ "api-version": APIVersion,
+ }
+
+ preparer := autorest.CreatePreparer(
+ autorest.AsGet(),
+ autorest.WithBaseURL(client.BaseURI),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/capacityPools/{poolName}/volumes/{volumeName}/snapshots/{snapshotName}", pathParameters),
+ autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare((&http.Request{}).WithContext(ctx))
+}
+
+// GetSender sends the Get request. The method will close the
+// http.Response Body if it receives an error.
+func (client SnapshotsClient) GetSender(req *http.Request) (*http.Response, error) {
+ return client.Send(req, azure.DoRetryWithRegistration(client.Client))
+}
+
+// GetResponder handles the response to the Get request. The method always
+// closes the http.Response Body.
+func (client SnapshotsClient) GetResponder(resp *http.Response) (result Snapshot, err error) {
+ err = autorest.Respond(
+ resp,
+ azure.WithErrorUnlessStatusCode(http.StatusOK),
+ autorest.ByUnmarshallingJSON(&result),
+ autorest.ByClosing())
+ result.Response = autorest.Response{Response: resp}
+ return
+}
+
+// List list all snapshots associated with the volume
+// Parameters:
+// resourceGroupName - the name of the resource group.
+// accountName - the name of the NetApp account
+// poolName - the name of the capacity pool
+// volumeName - the name of the volume
+func (client SnapshotsClient) List(ctx context.Context, resourceGroupName string, accountName string, poolName string, volumeName string) (result SnapshotsList, err error) {
+ if tracing.IsEnabled() {
+ ctx = tracing.StartSpan(ctx, fqdn+"/SnapshotsClient.List")
+ defer func() {
+ sc := -1
+ if result.Response.Response != nil {
+ sc = result.Response.Response.StatusCode
+ }
+ tracing.EndSpan(ctx, sc, err)
+ }()
+ }
+ if err := validation.Validate([]validation.Validation{
+ {TargetValue: resourceGroupName,
+ Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil},
+ {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil},
+ {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}},
+ {TargetValue: poolName,
+ Constraints: []validation.Constraint{{Target: "poolName", Name: validation.MaxLength, Rule: 64, Chain: nil},
+ {Target: "poolName", Name: validation.MinLength, Rule: 1, Chain: nil},
+ {Target: "poolName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9][a-zA-Z0-9\-_]{0,63}$`, Chain: nil}}},
+ {TargetValue: volumeName,
+ Constraints: []validation.Constraint{{Target: "volumeName", Name: validation.MaxLength, Rule: 64, Chain: nil},
+ {Target: "volumeName", Name: validation.MinLength, Rule: 1, Chain: nil},
+ {Target: "volumeName", Name: validation.Pattern, Rule: `^[a-zA-Z][a-zA-Z0-9\-_]{0,63}$`, Chain: nil}}}}); err != nil {
+ return result, validation.NewError("netapp.SnapshotsClient", "List", err.Error())
+ }
+
+ req, err := client.ListPreparer(ctx, resourceGroupName, accountName, poolName, volumeName)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "netapp.SnapshotsClient", "List", nil, "Failure preparing request")
+ return
+ }
+
+ resp, err := client.ListSender(req)
+ if err != nil {
+ result.Response = autorest.Response{Response: resp}
+ err = autorest.NewErrorWithError(err, "netapp.SnapshotsClient", "List", resp, "Failure sending request")
+ return
+ }
+
+ result, err = client.ListResponder(resp)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "netapp.SnapshotsClient", "List", resp, "Failure responding to request")
+ return
+ }
+
+ return
+}
+
+// ListPreparer prepares the List request.
+func (client SnapshotsClient) ListPreparer(ctx context.Context, resourceGroupName string, accountName string, poolName string, volumeName string) (*http.Request, error) {
+ pathParameters := map[string]interface{}{
+ "accountName": autorest.Encode("path", accountName),
+ "poolName": autorest.Encode("path", poolName),
+ "resourceGroupName": autorest.Encode("path", resourceGroupName),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
+ "volumeName": autorest.Encode("path", volumeName),
+ }
+
+ const APIVersion = "2021-10-01"
+ queryParameters := map[string]interface{}{
+ "api-version": APIVersion,
+ }
+
+ preparer := autorest.CreatePreparer(
+ autorest.AsGet(),
+ autorest.WithBaseURL(client.BaseURI),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/capacityPools/{poolName}/volumes/{volumeName}/snapshots", pathParameters),
+ autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare((&http.Request{}).WithContext(ctx))
+}
+
+// ListSender sends the List request. The method will close the
+// http.Response Body if it receives an error.
+func (client SnapshotsClient) ListSender(req *http.Request) (*http.Response, error) {
+ return client.Send(req, azure.DoRetryWithRegistration(client.Client))
+}
+
+// ListResponder handles the response to the List request. The method always
+// closes the http.Response Body.
+func (client SnapshotsClient) ListResponder(resp *http.Response) (result SnapshotsList, err error) {
+ err = autorest.Respond(
+ resp,
+ azure.WithErrorUnlessStatusCode(http.StatusOK),
+ autorest.ByUnmarshallingJSON(&result),
+ autorest.ByClosing())
+ result.Response = autorest.Response{Response: resp}
+ return
+}
+
+// RestoreFiles restore the specified files from the specified snapshot to the active filesystem
+// Parameters:
+// body - restore payload supplied in the body of the operation.
+// resourceGroupName - the name of the resource group.
+// accountName - the name of the NetApp account
+// poolName - the name of the capacity pool
+// volumeName - the name of the volume
+// snapshotName - the name of the snapshot
+func (client SnapshotsClient) RestoreFiles(ctx context.Context, body SnapshotRestoreFiles, resourceGroupName string, accountName string, poolName string, volumeName string, snapshotName string) (result SnapshotsRestoreFilesFuture, err error) {
+ if tracing.IsEnabled() {
+ ctx = tracing.StartSpan(ctx, fqdn+"/SnapshotsClient.RestoreFiles")
+ defer func() {
+ sc := -1
+ if result.FutureAPI != nil && result.FutureAPI.Response() != nil {
+ sc = result.FutureAPI.Response().StatusCode
+ }
+ tracing.EndSpan(ctx, sc, err)
+ }()
+ }
+ if err := validation.Validate([]validation.Validation{
+ {TargetValue: body,
+ Constraints: []validation.Constraint{{Target: "body.FilePaths", Name: validation.Null, Rule: true,
+ Chain: []validation.Constraint{{Target: "body.FilePaths", Name: validation.MaxItems, Rule: 10, Chain: nil},
+ {Target: "body.FilePaths", Name: validation.MinItems, Rule: 1, Chain: nil},
+ }}}},
+ {TargetValue: resourceGroupName,
+ Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil},
+ {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil},
+ {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}},
+ {TargetValue: poolName,
+ Constraints: []validation.Constraint{{Target: "poolName", Name: validation.MaxLength, Rule: 64, Chain: nil},
+ {Target: "poolName", Name: validation.MinLength, Rule: 1, Chain: nil},
+ {Target: "poolName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9][a-zA-Z0-9\-_]{0,63}$`, Chain: nil}}},
+ {TargetValue: volumeName,
+ Constraints: []validation.Constraint{{Target: "volumeName", Name: validation.MaxLength, Rule: 64, Chain: nil},
+ {Target: "volumeName", Name: validation.MinLength, Rule: 1, Chain: nil},
+ {Target: "volumeName", Name: validation.Pattern, Rule: `^[a-zA-Z][a-zA-Z0-9\-_]{0,63}$`, Chain: nil}}}}); err != nil {
+ return result, validation.NewError("netapp.SnapshotsClient", "RestoreFiles", err.Error())
+ }
+
+ req, err := client.RestoreFilesPreparer(ctx, body, resourceGroupName, accountName, poolName, volumeName, snapshotName)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "netapp.SnapshotsClient", "RestoreFiles", nil, "Failure preparing request")
+ return
+ }
+
+ result, err = client.RestoreFilesSender(req)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "netapp.SnapshotsClient", "RestoreFiles", result.Response(), "Failure sending request")
+ return
+ }
+
+ return
+}
+
+// RestoreFilesPreparer prepares the RestoreFiles request.
+func (client SnapshotsClient) RestoreFilesPreparer(ctx context.Context, body SnapshotRestoreFiles, resourceGroupName string, accountName string, poolName string, volumeName string, snapshotName string) (*http.Request, error) {
+ pathParameters := map[string]interface{}{
+ "accountName": autorest.Encode("path", accountName),
+ "poolName": autorest.Encode("path", poolName),
+ "resourceGroupName": autorest.Encode("path", resourceGroupName),
+ "snapshotName": autorest.Encode("path", snapshotName),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
+ "volumeName": autorest.Encode("path", volumeName),
+ }
+
+ const APIVersion = "2021-10-01"
+ queryParameters := map[string]interface{}{
+ "api-version": APIVersion,
+ }
+
+ preparer := autorest.CreatePreparer(
+ autorest.AsContentType("application/json; charset=utf-8"),
+ autorest.AsPost(),
+ autorest.WithBaseURL(client.BaseURI),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/capacityPools/{poolName}/volumes/{volumeName}/snapshots/{snapshotName}/restoreFiles", pathParameters),
+ autorest.WithJSON(body),
+ autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare((&http.Request{}).WithContext(ctx))
+}
+
+// RestoreFilesSender sends the RestoreFiles request. The method will close the
+// http.Response Body if it receives an error.
+func (client SnapshotsClient) RestoreFilesSender(req *http.Request) (future SnapshotsRestoreFilesFuture, err error) {
+ var resp *http.Response
+ future.FutureAPI = &azure.Future{}
+ resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client))
+ if err != nil {
+ return
+ }
+ var azf azure.Future
+ azf, err = azure.NewFutureFromResponse(resp)
+ future.FutureAPI = &azf
+ future.Result = future.result
+ return
+}
+
+// RestoreFilesResponder handles the response to the RestoreFiles request. The method always
+// closes the http.Response Body.
+func (client SnapshotsClient) RestoreFilesResponder(resp *http.Response) (result autorest.Response, err error) {
+ err = autorest.Respond(
+ resp,
+ azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted),
+ autorest.ByClosing())
+ result.Response = resp
+ return
+}
+
+// Update patch a snapshot
+// Parameters:
+// body - snapshot object supplied in the body of the operation.
+// resourceGroupName - the name of the resource group.
+// accountName - the name of the NetApp account
+// poolName - the name of the capacity pool
+// volumeName - the name of the volume
+// snapshotName - the name of the snapshot
+func (client SnapshotsClient) Update(ctx context.Context, body interface{}, resourceGroupName string, accountName string, poolName string, volumeName string, snapshotName string) (result SnapshotsUpdateFuture, err error) {
+ if tracing.IsEnabled() {
+ ctx = tracing.StartSpan(ctx, fqdn+"/SnapshotsClient.Update")
+ defer func() {
+ sc := -1
+ if result.FutureAPI != nil && result.FutureAPI.Response() != nil {
+ sc = result.FutureAPI.Response().StatusCode
+ }
+ tracing.EndSpan(ctx, sc, err)
+ }()
+ }
+ if err := validation.Validate([]validation.Validation{
+ {TargetValue: resourceGroupName,
+ Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil},
+ {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil},
+ {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}},
+ {TargetValue: poolName,
+ Constraints: []validation.Constraint{{Target: "poolName", Name: validation.MaxLength, Rule: 64, Chain: nil},
+ {Target: "poolName", Name: validation.MinLength, Rule: 1, Chain: nil},
+ {Target: "poolName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9][a-zA-Z0-9\-_]{0,63}$`, Chain: nil}}},
+ {TargetValue: volumeName,
+ Constraints: []validation.Constraint{{Target: "volumeName", Name: validation.MaxLength, Rule: 64, Chain: nil},
+ {Target: "volumeName", Name: validation.MinLength, Rule: 1, Chain: nil},
+ {Target: "volumeName", Name: validation.Pattern, Rule: `^[a-zA-Z][a-zA-Z0-9\-_]{0,63}$`, Chain: nil}}}}); err != nil {
+ return result, validation.NewError("netapp.SnapshotsClient", "Update", err.Error())
+ }
+
+ req, err := client.UpdatePreparer(ctx, body, resourceGroupName, accountName, poolName, volumeName, snapshotName)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "netapp.SnapshotsClient", "Update", nil, "Failure preparing request")
+ return
+ }
+
+ result, err = client.UpdateSender(req)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "netapp.SnapshotsClient", "Update", result.Response(), "Failure sending request")
+ return
+ }
+
+ return
+}
+
+// UpdatePreparer prepares the Update request.
+func (client SnapshotsClient) UpdatePreparer(ctx context.Context, body interface{}, resourceGroupName string, accountName string, poolName string, volumeName string, snapshotName string) (*http.Request, error) {
+ pathParameters := map[string]interface{}{
+ "accountName": autorest.Encode("path", accountName),
+ "poolName": autorest.Encode("path", poolName),
+ "resourceGroupName": autorest.Encode("path", resourceGroupName),
+ "snapshotName": autorest.Encode("path", snapshotName),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
+ "volumeName": autorest.Encode("path", volumeName),
+ }
+
+ const APIVersion = "2021-10-01"
+ queryParameters := map[string]interface{}{
+ "api-version": APIVersion,
+ }
+
+ preparer := autorest.CreatePreparer(
+ autorest.AsContentType("application/json; charset=utf-8"),
+ autorest.AsPatch(),
+ autorest.WithBaseURL(client.BaseURI),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/capacityPools/{poolName}/volumes/{volumeName}/snapshots/{snapshotName}", pathParameters),
+ autorest.WithJSON(body),
+ autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare((&http.Request{}).WithContext(ctx))
+}
+
+// UpdateSender sends the Update request. The method will close the
+// http.Response Body if it receives an error.
+func (client SnapshotsClient) UpdateSender(req *http.Request) (future SnapshotsUpdateFuture, err error) {
+ var resp *http.Response
+ future.FutureAPI = &azure.Future{}
+ resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client))
+ if err != nil {
+ return
+ }
+ var azf azure.Future
+ azf, err = azure.NewFutureFromResponse(resp)
+ future.FutureAPI = &azf
+ future.Result = future.result
+ return
+}
+
+// UpdateResponder handles the response to the Update request. The method always
+// closes the http.Response Body.
+func (client SnapshotsClient) UpdateResponder(resp *http.Response) (result Snapshot, err error) {
+ err = autorest.Respond(
+ resp,
+ azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted),
+ autorest.ByUnmarshallingJSON(&result),
+ autorest.ByClosing())
+ result.Response = autorest.Response{Response: resp}
+ return
+}
diff --git a/services/netapp/mgmt/2021-10-01/netapp/subvolumes.go b/services/netapp/mgmt/2021-10-01/netapp/subvolumes.go
new file mode 100644
index 000000000000..54cec7e712e5
--- /dev/null
+++ b/services/netapp/mgmt/2021-10-01/netapp/subvolumes.go
@@ -0,0 +1,698 @@
+package netapp
+
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License. See License.txt in the project root for license information.
+//
+// Code generated by Microsoft (R) AutoRest Code Generator.
+// Changes may cause incorrect behavior and will be lost if the code is regenerated.
+
+import (
+ "context"
+ "github.com/Azure/go-autorest/autorest"
+ "github.com/Azure/go-autorest/autorest/azure"
+ "github.com/Azure/go-autorest/autorest/validation"
+ "github.com/Azure/go-autorest/tracing"
+ "net/http"
+)
+
+// SubvolumesClient is the microsoft NetApp Files Azure Resource Provider specification
+type SubvolumesClient struct {
+ BaseClient
+}
+
+// NewSubvolumesClient creates an instance of the SubvolumesClient client.
+func NewSubvolumesClient(subscriptionID string) SubvolumesClient {
+ return NewSubvolumesClientWithBaseURI(DefaultBaseURI, subscriptionID)
+}
+
+// NewSubvolumesClientWithBaseURI creates an instance of the SubvolumesClient client using a custom endpoint. Use this
+// when interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure stack).
+func NewSubvolumesClientWithBaseURI(baseURI string, subscriptionID string) SubvolumesClient {
+ return SubvolumesClient{NewWithBaseURI(baseURI, subscriptionID)}
+}
+
+// Create creates a subvolume in the path or clones the subvolume mentioned in the parentPath
+// Parameters:
+// body - subvolume object supplied in the body of the operation.
+// resourceGroupName - the name of the resource group.
+// accountName - the name of the NetApp account
+// poolName - the name of the capacity pool
+// volumeName - the name of the volume
+// subvolumeName - the name of the subvolume.
+func (client SubvolumesClient) Create(ctx context.Context, body SubvolumeInfo, resourceGroupName string, accountName string, poolName string, volumeName string, subvolumeName string) (result SubvolumesCreateFuture, err error) {
+ if tracing.IsEnabled() {
+ ctx = tracing.StartSpan(ctx, fqdn+"/SubvolumesClient.Create")
+ defer func() {
+ sc := -1
+ if result.FutureAPI != nil && result.FutureAPI.Response() != nil {
+ sc = result.FutureAPI.Response().StatusCode
+ }
+ tracing.EndSpan(ctx, sc, err)
+ }()
+ }
+ if err := validation.Validate([]validation.Validation{
+ {TargetValue: resourceGroupName,
+ Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil},
+ {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil},
+ {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}},
+ {TargetValue: poolName,
+ Constraints: []validation.Constraint{{Target: "poolName", Name: validation.MaxLength, Rule: 64, Chain: nil},
+ {Target: "poolName", Name: validation.MinLength, Rule: 1, Chain: nil},
+ {Target: "poolName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9][a-zA-Z0-9\-_]{0,63}$`, Chain: nil}}},
+ {TargetValue: volumeName,
+ Constraints: []validation.Constraint{{Target: "volumeName", Name: validation.MaxLength, Rule: 64, Chain: nil},
+ {Target: "volumeName", Name: validation.MinLength, Rule: 1, Chain: nil},
+ {Target: "volumeName", Name: validation.Pattern, Rule: `^[a-zA-Z][a-zA-Z0-9\-_]{0,63}$`, Chain: nil}}},
+ {TargetValue: subvolumeName,
+ Constraints: []validation.Constraint{{Target: "subvolumeName", Name: validation.MaxLength, Rule: 64, Chain: nil},
+ {Target: "subvolumeName", Name: validation.MinLength, Rule: 1, Chain: nil},
+ {Target: "subvolumeName", Name: validation.Pattern, Rule: `^[a-zA-Z][a-zA-Z0-9\-_]{0,63}$`, Chain: nil}}}}); err != nil {
+ return result, validation.NewError("netapp.SubvolumesClient", "Create", err.Error())
+ }
+
+ req, err := client.CreatePreparer(ctx, body, resourceGroupName, accountName, poolName, volumeName, subvolumeName)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "netapp.SubvolumesClient", "Create", nil, "Failure preparing request")
+ return
+ }
+
+ result, err = client.CreateSender(req)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "netapp.SubvolumesClient", "Create", result.Response(), "Failure sending request")
+ return
+ }
+
+ return
+}
+
+// CreatePreparer prepares the Create request.
+func (client SubvolumesClient) CreatePreparer(ctx context.Context, body SubvolumeInfo, resourceGroupName string, accountName string, poolName string, volumeName string, subvolumeName string) (*http.Request, error) {
+ pathParameters := map[string]interface{}{
+ "accountName": autorest.Encode("path", accountName),
+ "poolName": autorest.Encode("path", poolName),
+ "resourceGroupName": autorest.Encode("path", resourceGroupName),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
+ "subvolumeName": autorest.Encode("path", subvolumeName),
+ "volumeName": autorest.Encode("path", volumeName),
+ }
+
+ const APIVersion = "2021-10-01"
+ queryParameters := map[string]interface{}{
+ "api-version": APIVersion,
+ }
+
+ body.SystemData = nil
+ preparer := autorest.CreatePreparer(
+ autorest.AsContentType("application/json; charset=utf-8"),
+ autorest.AsPut(),
+ autorest.WithBaseURL(client.BaseURI),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/capacityPools/{poolName}/volumes/{volumeName}/subvolumes/{subvolumeName}", pathParameters),
+ autorest.WithJSON(body),
+ autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare((&http.Request{}).WithContext(ctx))
+}
+
+// CreateSender sends the Create request. The method will close the
+// http.Response Body if it receives an error.
+func (client SubvolumesClient) CreateSender(req *http.Request) (future SubvolumesCreateFuture, err error) {
+ var resp *http.Response
+ future.FutureAPI = &azure.Future{}
+ resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client))
+ if err != nil {
+ return
+ }
+ var azf azure.Future
+ azf, err = azure.NewFutureFromResponse(resp)
+ future.FutureAPI = &azf
+ future.Result = future.result
+ return
+}
+
+// CreateResponder handles the response to the Create request. The method always
+// closes the http.Response Body.
+func (client SubvolumesClient) CreateResponder(resp *http.Response) (result SubvolumeInfo, err error) {
+ err = autorest.Respond(
+ resp,
+ azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated, http.StatusAccepted),
+ autorest.ByUnmarshallingJSON(&result),
+ autorest.ByClosing())
+ result.Response = autorest.Response{Response: resp}
+ return
+}
+
+// Delete delete subvolume
+// Parameters:
+// resourceGroupName - the name of the resource group.
+// accountName - the name of the NetApp account
+// poolName - the name of the capacity pool
+// volumeName - the name of the volume
+// subvolumeName - the name of the subvolume.
+func (client SubvolumesClient) Delete(ctx context.Context, resourceGroupName string, accountName string, poolName string, volumeName string, subvolumeName string) (result SubvolumesDeleteFuture, err error) {
+ if tracing.IsEnabled() {
+ ctx = tracing.StartSpan(ctx, fqdn+"/SubvolumesClient.Delete")
+ defer func() {
+ sc := -1
+ if result.FutureAPI != nil && result.FutureAPI.Response() != nil {
+ sc = result.FutureAPI.Response().StatusCode
+ }
+ tracing.EndSpan(ctx, sc, err)
+ }()
+ }
+ if err := validation.Validate([]validation.Validation{
+ {TargetValue: resourceGroupName,
+ Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil},
+ {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil},
+ {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}},
+ {TargetValue: poolName,
+ Constraints: []validation.Constraint{{Target: "poolName", Name: validation.MaxLength, Rule: 64, Chain: nil},
+ {Target: "poolName", Name: validation.MinLength, Rule: 1, Chain: nil},
+ {Target: "poolName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9][a-zA-Z0-9\-_]{0,63}$`, Chain: nil}}},
+ {TargetValue: volumeName,
+ Constraints: []validation.Constraint{{Target: "volumeName", Name: validation.MaxLength, Rule: 64, Chain: nil},
+ {Target: "volumeName", Name: validation.MinLength, Rule: 1, Chain: nil},
+ {Target: "volumeName", Name: validation.Pattern, Rule: `^[a-zA-Z][a-zA-Z0-9\-_]{0,63}$`, Chain: nil}}},
+ {TargetValue: subvolumeName,
+ Constraints: []validation.Constraint{{Target: "subvolumeName", Name: validation.MaxLength, Rule: 64, Chain: nil},
+ {Target: "subvolumeName", Name: validation.MinLength, Rule: 1, Chain: nil},
+ {Target: "subvolumeName", Name: validation.Pattern, Rule: `^[a-zA-Z][a-zA-Z0-9\-_]{0,63}$`, Chain: nil}}}}); err != nil {
+ return result, validation.NewError("netapp.SubvolumesClient", "Delete", err.Error())
+ }
+
+ req, err := client.DeletePreparer(ctx, resourceGroupName, accountName, poolName, volumeName, subvolumeName)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "netapp.SubvolumesClient", "Delete", nil, "Failure preparing request")
+ return
+ }
+
+ result, err = client.DeleteSender(req)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "netapp.SubvolumesClient", "Delete", result.Response(), "Failure sending request")
+ return
+ }
+
+ return
+}
+
+// DeletePreparer prepares the Delete request.
+func (client SubvolumesClient) DeletePreparer(ctx context.Context, resourceGroupName string, accountName string, poolName string, volumeName string, subvolumeName string) (*http.Request, error) {
+ pathParameters := map[string]interface{}{
+ "accountName": autorest.Encode("path", accountName),
+ "poolName": autorest.Encode("path", poolName),
+ "resourceGroupName": autorest.Encode("path", resourceGroupName),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
+ "subvolumeName": autorest.Encode("path", subvolumeName),
+ "volumeName": autorest.Encode("path", volumeName),
+ }
+
+ const APIVersion = "2021-10-01"
+ queryParameters := map[string]interface{}{
+ "api-version": APIVersion,
+ }
+
+ preparer := autorest.CreatePreparer(
+ autorest.AsDelete(),
+ autorest.WithBaseURL(client.BaseURI),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/capacityPools/{poolName}/volumes/{volumeName}/subvolumes/{subvolumeName}", pathParameters),
+ autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare((&http.Request{}).WithContext(ctx))
+}
+
+// DeleteSender sends the Delete request. The method will close the
+// http.Response Body if it receives an error.
+func (client SubvolumesClient) DeleteSender(req *http.Request) (future SubvolumesDeleteFuture, err error) {
+ var resp *http.Response
+ future.FutureAPI = &azure.Future{}
+ resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client))
+ if err != nil {
+ return
+ }
+ var azf azure.Future
+ azf, err = azure.NewFutureFromResponse(resp)
+ future.FutureAPI = &azf
+ future.Result = future.result
+ return
+}
+
+// DeleteResponder handles the response to the Delete request. The method always
+// closes the http.Response Body.
+func (client SubvolumesClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) {
+ err = autorest.Respond(
+ resp,
+ azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent),
+ autorest.ByClosing())
+ result.Response = resp
+ return
+}
+
+// Get returns the path associated with the subvolumeName provided
+// Parameters:
+// resourceGroupName - the name of the resource group.
+// accountName - the name of the NetApp account
+// poolName - the name of the capacity pool
+// volumeName - the name of the volume
+// subvolumeName - the name of the subvolume.
+func (client SubvolumesClient) Get(ctx context.Context, resourceGroupName string, accountName string, poolName string, volumeName string, subvolumeName string) (result SubvolumeInfo, err error) {
+ if tracing.IsEnabled() {
+ ctx = tracing.StartSpan(ctx, fqdn+"/SubvolumesClient.Get")
+ defer func() {
+ sc := -1
+ if result.Response.Response != nil {
+ sc = result.Response.Response.StatusCode
+ }
+ tracing.EndSpan(ctx, sc, err)
+ }()
+ }
+ if err := validation.Validate([]validation.Validation{
+ {TargetValue: resourceGroupName,
+ Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil},
+ {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil},
+ {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}},
+ {TargetValue: poolName,
+ Constraints: []validation.Constraint{{Target: "poolName", Name: validation.MaxLength, Rule: 64, Chain: nil},
+ {Target: "poolName", Name: validation.MinLength, Rule: 1, Chain: nil},
+ {Target: "poolName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9][a-zA-Z0-9\-_]{0,63}$`, Chain: nil}}},
+ {TargetValue: volumeName,
+ Constraints: []validation.Constraint{{Target: "volumeName", Name: validation.MaxLength, Rule: 64, Chain: nil},
+ {Target: "volumeName", Name: validation.MinLength, Rule: 1, Chain: nil},
+ {Target: "volumeName", Name: validation.Pattern, Rule: `^[a-zA-Z][a-zA-Z0-9\-_]{0,63}$`, Chain: nil}}},
+ {TargetValue: subvolumeName,
+ Constraints: []validation.Constraint{{Target: "subvolumeName", Name: validation.MaxLength, Rule: 64, Chain: nil},
+ {Target: "subvolumeName", Name: validation.MinLength, Rule: 1, Chain: nil},
+ {Target: "subvolumeName", Name: validation.Pattern, Rule: `^[a-zA-Z][a-zA-Z0-9\-_]{0,63}$`, Chain: nil}}}}); err != nil {
+ return result, validation.NewError("netapp.SubvolumesClient", "Get", err.Error())
+ }
+
+ req, err := client.GetPreparer(ctx, resourceGroupName, accountName, poolName, volumeName, subvolumeName)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "netapp.SubvolumesClient", "Get", nil, "Failure preparing request")
+ return
+ }
+
+ resp, err := client.GetSender(req)
+ if err != nil {
+ result.Response = autorest.Response{Response: resp}
+ err = autorest.NewErrorWithError(err, "netapp.SubvolumesClient", "Get", resp, "Failure sending request")
+ return
+ }
+
+ result, err = client.GetResponder(resp)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "netapp.SubvolumesClient", "Get", resp, "Failure responding to request")
+ return
+ }
+
+ return
+}
+
+// GetPreparer prepares the Get request.
+func (client SubvolumesClient) GetPreparer(ctx context.Context, resourceGroupName string, accountName string, poolName string, volumeName string, subvolumeName string) (*http.Request, error) {
+ pathParameters := map[string]interface{}{
+ "accountName": autorest.Encode("path", accountName),
+ "poolName": autorest.Encode("path", poolName),
+ "resourceGroupName": autorest.Encode("path", resourceGroupName),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
+ "subvolumeName": autorest.Encode("path", subvolumeName),
+ "volumeName": autorest.Encode("path", volumeName),
+ }
+
+ const APIVersion = "2021-10-01"
+ queryParameters := map[string]interface{}{
+ "api-version": APIVersion,
+ }
+
+ preparer := autorest.CreatePreparer(
+ autorest.AsGet(),
+ autorest.WithBaseURL(client.BaseURI),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/capacityPools/{poolName}/volumes/{volumeName}/subvolumes/{subvolumeName}", pathParameters),
+ autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare((&http.Request{}).WithContext(ctx))
+}
+
+// GetSender sends the Get request. The method will close the
+// http.Response Body if it receives an error.
+func (client SubvolumesClient) GetSender(req *http.Request) (*http.Response, error) {
+ return client.Send(req, azure.DoRetryWithRegistration(client.Client))
+}
+
+// GetResponder handles the response to the Get request. The method always
+// closes the http.Response Body.
+func (client SubvolumesClient) GetResponder(resp *http.Response) (result SubvolumeInfo, err error) {
+ err = autorest.Respond(
+ resp,
+ azure.WithErrorUnlessStatusCode(http.StatusOK),
+ autorest.ByUnmarshallingJSON(&result),
+ autorest.ByClosing())
+ result.Response = autorest.Response{Response: resp}
+ return
+}
+
+// GetMetadata get details of the specified subvolume
+// Parameters:
+// resourceGroupName - the name of the resource group.
+// accountName - the name of the NetApp account
+// poolName - the name of the capacity pool
+// volumeName - the name of the volume
+// subvolumeName - the name of the subvolume.
+func (client SubvolumesClient) GetMetadata(ctx context.Context, resourceGroupName string, accountName string, poolName string, volumeName string, subvolumeName string) (result SubvolumesGetMetadataFuture, err error) {
+ if tracing.IsEnabled() {
+ ctx = tracing.StartSpan(ctx, fqdn+"/SubvolumesClient.GetMetadata")
+ defer func() {
+ sc := -1
+ if result.FutureAPI != nil && result.FutureAPI.Response() != nil {
+ sc = result.FutureAPI.Response().StatusCode
+ }
+ tracing.EndSpan(ctx, sc, err)
+ }()
+ }
+ if err := validation.Validate([]validation.Validation{
+ {TargetValue: resourceGroupName,
+ Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil},
+ {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil},
+ {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}},
+ {TargetValue: poolName,
+ Constraints: []validation.Constraint{{Target: "poolName", Name: validation.MaxLength, Rule: 64, Chain: nil},
+ {Target: "poolName", Name: validation.MinLength, Rule: 1, Chain: nil},
+ {Target: "poolName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9][a-zA-Z0-9\-_]{0,63}$`, Chain: nil}}},
+ {TargetValue: volumeName,
+ Constraints: []validation.Constraint{{Target: "volumeName", Name: validation.MaxLength, Rule: 64, Chain: nil},
+ {Target: "volumeName", Name: validation.MinLength, Rule: 1, Chain: nil},
+ {Target: "volumeName", Name: validation.Pattern, Rule: `^[a-zA-Z][a-zA-Z0-9\-_]{0,63}$`, Chain: nil}}},
+ {TargetValue: subvolumeName,
+ Constraints: []validation.Constraint{{Target: "subvolumeName", Name: validation.MaxLength, Rule: 64, Chain: nil},
+ {Target: "subvolumeName", Name: validation.MinLength, Rule: 1, Chain: nil},
+ {Target: "subvolumeName", Name: validation.Pattern, Rule: `^[a-zA-Z][a-zA-Z0-9\-_]{0,63}$`, Chain: nil}}}}); err != nil {
+ return result, validation.NewError("netapp.SubvolumesClient", "GetMetadata", err.Error())
+ }
+
+ req, err := client.GetMetadataPreparer(ctx, resourceGroupName, accountName, poolName, volumeName, subvolumeName)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "netapp.SubvolumesClient", "GetMetadata", nil, "Failure preparing request")
+ return
+ }
+
+ result, err = client.GetMetadataSender(req)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "netapp.SubvolumesClient", "GetMetadata", result.Response(), "Failure sending request")
+ return
+ }
+
+ return
+}
+
+// GetMetadataPreparer prepares the GetMetadata request.
+func (client SubvolumesClient) GetMetadataPreparer(ctx context.Context, resourceGroupName string, accountName string, poolName string, volumeName string, subvolumeName string) (*http.Request, error) {
+ pathParameters := map[string]interface{}{
+ "accountName": autorest.Encode("path", accountName),
+ "poolName": autorest.Encode("path", poolName),
+ "resourceGroupName": autorest.Encode("path", resourceGroupName),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
+ "subvolumeName": autorest.Encode("path", subvolumeName),
+ "volumeName": autorest.Encode("path", volumeName),
+ }
+
+ const APIVersion = "2021-10-01"
+ queryParameters := map[string]interface{}{
+ "api-version": APIVersion,
+ }
+
+ preparer := autorest.CreatePreparer(
+ autorest.AsPost(),
+ autorest.WithBaseURL(client.BaseURI),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/capacityPools/{poolName}/volumes/{volumeName}/subvolumes/{subvolumeName}/getMetadata", pathParameters),
+ autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare((&http.Request{}).WithContext(ctx))
+}
+
+// GetMetadataSender sends the GetMetadata request. The method will close the
+// http.Response Body if it receives an error.
+func (client SubvolumesClient) GetMetadataSender(req *http.Request) (future SubvolumesGetMetadataFuture, err error) {
+ var resp *http.Response
+ future.FutureAPI = &azure.Future{}
+ resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client))
+ if err != nil {
+ return
+ }
+ var azf azure.Future
+ azf, err = azure.NewFutureFromResponse(resp)
+ future.FutureAPI = &azf
+ future.Result = future.result
+ return
+}
+
+// GetMetadataResponder handles the response to the GetMetadata request. The method always
+// closes the http.Response Body.
+func (client SubvolumesClient) GetMetadataResponder(resp *http.Response) (result SubvolumeModel, err error) {
+ err = autorest.Respond(
+ resp,
+ azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted),
+ autorest.ByUnmarshallingJSON(&result),
+ autorest.ByClosing())
+ result.Response = autorest.Response{Response: resp}
+ return
+}
+
+// ListByVolume returns a list of the subvolumes in the volume
+// Parameters:
+// resourceGroupName - the name of the resource group.
+// accountName - the name of the NetApp account
+// poolName - the name of the capacity pool
+// volumeName - the name of the volume
+func (client SubvolumesClient) ListByVolume(ctx context.Context, resourceGroupName string, accountName string, poolName string, volumeName string) (result SubvolumesListPage, err error) {
+ if tracing.IsEnabled() {
+ ctx = tracing.StartSpan(ctx, fqdn+"/SubvolumesClient.ListByVolume")
+ defer func() {
+ sc := -1
+ if result.sl.Response.Response != nil {
+ sc = result.sl.Response.Response.StatusCode
+ }
+ tracing.EndSpan(ctx, sc, err)
+ }()
+ }
+ if err := validation.Validate([]validation.Validation{
+ {TargetValue: resourceGroupName,
+ Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil},
+ {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil},
+ {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}},
+ {TargetValue: poolName,
+ Constraints: []validation.Constraint{{Target: "poolName", Name: validation.MaxLength, Rule: 64, Chain: nil},
+ {Target: "poolName", Name: validation.MinLength, Rule: 1, Chain: nil},
+ {Target: "poolName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9][a-zA-Z0-9\-_]{0,63}$`, Chain: nil}}},
+ {TargetValue: volumeName,
+ Constraints: []validation.Constraint{{Target: "volumeName", Name: validation.MaxLength, Rule: 64, Chain: nil},
+ {Target: "volumeName", Name: validation.MinLength, Rule: 1, Chain: nil},
+ {Target: "volumeName", Name: validation.Pattern, Rule: `^[a-zA-Z][a-zA-Z0-9\-_]{0,63}$`, Chain: nil}}}}); err != nil {
+ return result, validation.NewError("netapp.SubvolumesClient", "ListByVolume", err.Error())
+ }
+
+ result.fn = client.listByVolumeNextResults
+ req, err := client.ListByVolumePreparer(ctx, resourceGroupName, accountName, poolName, volumeName)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "netapp.SubvolumesClient", "ListByVolume", nil, "Failure preparing request")
+ return
+ }
+
+ resp, err := client.ListByVolumeSender(req)
+ if err != nil {
+ result.sl.Response = autorest.Response{Response: resp}
+ err = autorest.NewErrorWithError(err, "netapp.SubvolumesClient", "ListByVolume", resp, "Failure sending request")
+ return
+ }
+
+ result.sl, err = client.ListByVolumeResponder(resp)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "netapp.SubvolumesClient", "ListByVolume", resp, "Failure responding to request")
+ return
+ }
+ if result.sl.hasNextLink() && result.sl.IsEmpty() {
+ err = result.NextWithContext(ctx)
+ return
+ }
+
+ return
+}
+
+// ListByVolumePreparer prepares the ListByVolume request.
+func (client SubvolumesClient) ListByVolumePreparer(ctx context.Context, resourceGroupName string, accountName string, poolName string, volumeName string) (*http.Request, error) {
+ pathParameters := map[string]interface{}{
+ "accountName": autorest.Encode("path", accountName),
+ "poolName": autorest.Encode("path", poolName),
+ "resourceGroupName": autorest.Encode("path", resourceGroupName),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
+ "volumeName": autorest.Encode("path", volumeName),
+ }
+
+ const APIVersion = "2021-10-01"
+ queryParameters := map[string]interface{}{
+ "api-version": APIVersion,
+ }
+
+ preparer := autorest.CreatePreparer(
+ autorest.AsGet(),
+ autorest.WithBaseURL(client.BaseURI),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/capacityPools/{poolName}/volumes/{volumeName}/subvolumes", pathParameters),
+ autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare((&http.Request{}).WithContext(ctx))
+}
+
+// ListByVolumeSender sends the ListByVolume request. The method will close the
+// http.Response Body if it receives an error.
+func (client SubvolumesClient) ListByVolumeSender(req *http.Request) (*http.Response, error) {
+ return client.Send(req, azure.DoRetryWithRegistration(client.Client))
+}
+
+// ListByVolumeResponder handles the response to the ListByVolume request. The method always
+// closes the http.Response Body.
+func (client SubvolumesClient) ListByVolumeResponder(resp *http.Response) (result SubvolumesList, err error) {
+ err = autorest.Respond(
+ resp,
+ azure.WithErrorUnlessStatusCode(http.StatusOK),
+ autorest.ByUnmarshallingJSON(&result),
+ autorest.ByClosing())
+ result.Response = autorest.Response{Response: resp}
+ return
+}
+
+// listByVolumeNextResults retrieves the next set of results, if any.
+func (client SubvolumesClient) listByVolumeNextResults(ctx context.Context, lastResults SubvolumesList) (result SubvolumesList, err error) {
+ req, err := lastResults.subvolumesListPreparer(ctx)
+ if err != nil {
+ return result, autorest.NewErrorWithError(err, "netapp.SubvolumesClient", "listByVolumeNextResults", nil, "Failure preparing next results request")
+ }
+ if req == nil {
+ return
+ }
+ resp, err := client.ListByVolumeSender(req)
+ if err != nil {
+ result.Response = autorest.Response{Response: resp}
+ return result, autorest.NewErrorWithError(err, "netapp.SubvolumesClient", "listByVolumeNextResults", resp, "Failure sending next results request")
+ }
+ result, err = client.ListByVolumeResponder(resp)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "netapp.SubvolumesClient", "listByVolumeNextResults", resp, "Failure responding to next results request")
+ }
+ return
+}
+
+// ListByVolumeComplete enumerates all values, automatically crossing page boundaries as required.
+func (client SubvolumesClient) ListByVolumeComplete(ctx context.Context, resourceGroupName string, accountName string, poolName string, volumeName string) (result SubvolumesListIterator, err error) {
+ if tracing.IsEnabled() {
+ ctx = tracing.StartSpan(ctx, fqdn+"/SubvolumesClient.ListByVolume")
+ defer func() {
+ sc := -1
+ if result.Response().Response.Response != nil {
+ sc = result.page.Response().Response.Response.StatusCode
+ }
+ tracing.EndSpan(ctx, sc, err)
+ }()
+ }
+ result.page, err = client.ListByVolume(ctx, resourceGroupName, accountName, poolName, volumeName)
+ return
+}
+
+// Update patch a subvolume
+// Parameters:
+// body - subvolume object supplied in the body of the operation.
+// resourceGroupName - the name of the resource group.
+// accountName - the name of the NetApp account
+// poolName - the name of the capacity pool
+// volumeName - the name of the volume
+// subvolumeName - the name of the subvolume.
+func (client SubvolumesClient) Update(ctx context.Context, body SubvolumePatchRequest, resourceGroupName string, accountName string, poolName string, volumeName string, subvolumeName string) (result SubvolumesUpdateFuture, err error) {
+ if tracing.IsEnabled() {
+ ctx = tracing.StartSpan(ctx, fqdn+"/SubvolumesClient.Update")
+ defer func() {
+ sc := -1
+ if result.FutureAPI != nil && result.FutureAPI.Response() != nil {
+ sc = result.FutureAPI.Response().StatusCode
+ }
+ tracing.EndSpan(ctx, sc, err)
+ }()
+ }
+ if err := validation.Validate([]validation.Validation{
+ {TargetValue: resourceGroupName,
+ Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil},
+ {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil},
+ {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}},
+ {TargetValue: poolName,
+ Constraints: []validation.Constraint{{Target: "poolName", Name: validation.MaxLength, Rule: 64, Chain: nil},
+ {Target: "poolName", Name: validation.MinLength, Rule: 1, Chain: nil},
+ {Target: "poolName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9][a-zA-Z0-9\-_]{0,63}$`, Chain: nil}}},
+ {TargetValue: volumeName,
+ Constraints: []validation.Constraint{{Target: "volumeName", Name: validation.MaxLength, Rule: 64, Chain: nil},
+ {Target: "volumeName", Name: validation.MinLength, Rule: 1, Chain: nil},
+ {Target: "volumeName", Name: validation.Pattern, Rule: `^[a-zA-Z][a-zA-Z0-9\-_]{0,63}$`, Chain: nil}}},
+ {TargetValue: subvolumeName,
+ Constraints: []validation.Constraint{{Target: "subvolumeName", Name: validation.MaxLength, Rule: 64, Chain: nil},
+ {Target: "subvolumeName", Name: validation.MinLength, Rule: 1, Chain: nil},
+ {Target: "subvolumeName", Name: validation.Pattern, Rule: `^[a-zA-Z][a-zA-Z0-9\-_]{0,63}$`, Chain: nil}}}}); err != nil {
+ return result, validation.NewError("netapp.SubvolumesClient", "Update", err.Error())
+ }
+
+ req, err := client.UpdatePreparer(ctx, body, resourceGroupName, accountName, poolName, volumeName, subvolumeName)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "netapp.SubvolumesClient", "Update", nil, "Failure preparing request")
+ return
+ }
+
+ result, err = client.UpdateSender(req)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "netapp.SubvolumesClient", "Update", result.Response(), "Failure sending request")
+ return
+ }
+
+ return
+}
+
+// UpdatePreparer prepares the Update request.
+func (client SubvolumesClient) UpdatePreparer(ctx context.Context, body SubvolumePatchRequest, resourceGroupName string, accountName string, poolName string, volumeName string, subvolumeName string) (*http.Request, error) {
+ pathParameters := map[string]interface{}{
+ "accountName": autorest.Encode("path", accountName),
+ "poolName": autorest.Encode("path", poolName),
+ "resourceGroupName": autorest.Encode("path", resourceGroupName),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
+ "subvolumeName": autorest.Encode("path", subvolumeName),
+ "volumeName": autorest.Encode("path", volumeName),
+ }
+
+ const APIVersion = "2021-10-01"
+ queryParameters := map[string]interface{}{
+ "api-version": APIVersion,
+ }
+
+ preparer := autorest.CreatePreparer(
+ autorest.AsContentType("application/json; charset=utf-8"),
+ autorest.AsPatch(),
+ autorest.WithBaseURL(client.BaseURI),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/capacityPools/{poolName}/volumes/{volumeName}/subvolumes/{subvolumeName}", pathParameters),
+ autorest.WithJSON(body),
+ autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare((&http.Request{}).WithContext(ctx))
+}
+
+// UpdateSender sends the Update request. The method will close the
+// http.Response Body if it receives an error.
+func (client SubvolumesClient) UpdateSender(req *http.Request) (future SubvolumesUpdateFuture, err error) {
+ var resp *http.Response
+ future.FutureAPI = &azure.Future{}
+ resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client))
+ if err != nil {
+ return
+ }
+ var azf azure.Future
+ azf, err = azure.NewFutureFromResponse(resp)
+ future.FutureAPI = &azf
+ future.Result = future.result
+ return
+}
+
+// UpdateResponder handles the response to the Update request. The method always
+// closes the http.Response Body.
+func (client SubvolumesClient) UpdateResponder(resp *http.Response) (result SubvolumeInfo, err error) {
+ err = autorest.Respond(
+ resp,
+ azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted),
+ autorest.ByUnmarshallingJSON(&result),
+ autorest.ByClosing())
+ result.Response = autorest.Response{Response: resp}
+ return
+}
diff --git a/services/netapp/mgmt/2021-10-01/netapp/vaults.go b/services/netapp/mgmt/2021-10-01/netapp/vaults.go
new file mode 100644
index 000000000000..ee3222d17445
--- /dev/null
+++ b/services/netapp/mgmt/2021-10-01/netapp/vaults.go
@@ -0,0 +1,116 @@
+package netapp
+
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License. See License.txt in the project root for license information.
+//
+// Code generated by Microsoft (R) AutoRest Code Generator.
+// Changes may cause incorrect behavior and will be lost if the code is regenerated.
+
+import (
+ "context"
+ "github.com/Azure/go-autorest/autorest"
+ "github.com/Azure/go-autorest/autorest/azure"
+ "github.com/Azure/go-autorest/autorest/validation"
+ "github.com/Azure/go-autorest/tracing"
+ "net/http"
+)
+
+// VaultsClient is the microsoft NetApp Files Azure Resource Provider specification
+type VaultsClient struct {
+ BaseClient
+}
+
+// NewVaultsClient creates an instance of the VaultsClient client.
+func NewVaultsClient(subscriptionID string) VaultsClient {
+ return NewVaultsClientWithBaseURI(DefaultBaseURI, subscriptionID)
+}
+
+// NewVaultsClientWithBaseURI creates an instance of the VaultsClient client using a custom endpoint. Use this when
+// interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure stack).
+func NewVaultsClientWithBaseURI(baseURI string, subscriptionID string) VaultsClient {
+ return VaultsClient{NewWithBaseURI(baseURI, subscriptionID)}
+}
+
+// List list vaults for a Netapp Account
+// Parameters:
+// resourceGroupName - the name of the resource group.
+// accountName - the name of the NetApp account
+func (client VaultsClient) List(ctx context.Context, resourceGroupName string, accountName string) (result VaultList, err error) {
+ if tracing.IsEnabled() {
+ ctx = tracing.StartSpan(ctx, fqdn+"/VaultsClient.List")
+ defer func() {
+ sc := -1
+ if result.Response.Response != nil {
+ sc = result.Response.Response.StatusCode
+ }
+ tracing.EndSpan(ctx, sc, err)
+ }()
+ }
+ if err := validation.Validate([]validation.Validation{
+ {TargetValue: resourceGroupName,
+ Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil},
+ {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil},
+ {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}}); err != nil {
+ return result, validation.NewError("netapp.VaultsClient", "List", err.Error())
+ }
+
+ req, err := client.ListPreparer(ctx, resourceGroupName, accountName)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "netapp.VaultsClient", "List", nil, "Failure preparing request")
+ return
+ }
+
+ resp, err := client.ListSender(req)
+ if err != nil {
+ result.Response = autorest.Response{Response: resp}
+ err = autorest.NewErrorWithError(err, "netapp.VaultsClient", "List", resp, "Failure sending request")
+ return
+ }
+
+ result, err = client.ListResponder(resp)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "netapp.VaultsClient", "List", resp, "Failure responding to request")
+ return
+ }
+
+ return
+}
+
+// ListPreparer prepares the List request.
+func (client VaultsClient) ListPreparer(ctx context.Context, resourceGroupName string, accountName string) (*http.Request, error) {
+ pathParameters := map[string]interface{}{
+ "accountName": autorest.Encode("path", accountName),
+ "resourceGroupName": autorest.Encode("path", resourceGroupName),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
+ }
+
+ const APIVersion = "2021-10-01"
+ queryParameters := map[string]interface{}{
+ "api-version": APIVersion,
+ }
+
+ preparer := autorest.CreatePreparer(
+ autorest.AsGet(),
+ autorest.WithBaseURL(client.BaseURI),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/vaults", pathParameters),
+ autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare((&http.Request{}).WithContext(ctx))
+}
+
+// ListSender sends the List request. The method will close the
+// http.Response Body if it receives an error.
+func (client VaultsClient) ListSender(req *http.Request) (*http.Response, error) {
+ return client.Send(req, azure.DoRetryWithRegistration(client.Client))
+}
+
+// ListResponder handles the response to the List request. The method always
+// closes the http.Response Body.
+func (client VaultsClient) ListResponder(resp *http.Response) (result VaultList, err error) {
+ err = autorest.Respond(
+ resp,
+ azure.WithErrorUnlessStatusCode(http.StatusOK),
+ autorest.ByUnmarshallingJSON(&result),
+ autorest.ByClosing())
+ result.Response = autorest.Response{Response: resp}
+ return
+}
diff --git a/services/netapp/mgmt/2021-10-01/netapp/version.go b/services/netapp/mgmt/2021-10-01/netapp/version.go
new file mode 100644
index 000000000000..d254f8bece8a
--- /dev/null
+++ b/services/netapp/mgmt/2021-10-01/netapp/version.go
@@ -0,0 +1,19 @@
+package netapp
+
+import "github.com/Azure/azure-sdk-for-go/version"
+
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License. See License.txt in the project root for license information.
+//
+// Code generated by Microsoft (R) AutoRest Code Generator.
+// Changes may cause incorrect behavior and will be lost if the code is regenerated.
+
+// UserAgent returns the UserAgent string to use when sending http.Requests.
+func UserAgent() string {
+ return "Azure-SDK-For-Go/" + Version() + " netapp/2021-10-01"
+}
+
+// Version returns the semantic version (see http://semver.org) of the client.
+func Version() string {
+ return version.Number
+}
diff --git a/services/netapp/mgmt/2021-10-01/netapp/volumegroups.go b/services/netapp/mgmt/2021-10-01/netapp/volumegroups.go
new file mode 100644
index 000000000000..65bc0539bda9
--- /dev/null
+++ b/services/netapp/mgmt/2021-10-01/netapp/volumegroups.go
@@ -0,0 +1,397 @@
+package netapp
+
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License. See License.txt in the project root for license information.
+//
+// Code generated by Microsoft (R) AutoRest Code Generator.
+// Changes may cause incorrect behavior and will be lost if the code is regenerated.
+
+import (
+ "context"
+ "github.com/Azure/go-autorest/autorest"
+ "github.com/Azure/go-autorest/autorest/azure"
+ "github.com/Azure/go-autorest/autorest/validation"
+ "github.com/Azure/go-autorest/tracing"
+ "net/http"
+)
+
+// VolumeGroupsClient is the microsoft NetApp Files Azure Resource Provider specification
+type VolumeGroupsClient struct {
+ BaseClient
+}
+
+// NewVolumeGroupsClient creates an instance of the VolumeGroupsClient client.
+func NewVolumeGroupsClient(subscriptionID string) VolumeGroupsClient {
+ return NewVolumeGroupsClientWithBaseURI(DefaultBaseURI, subscriptionID)
+}
+
+// NewVolumeGroupsClientWithBaseURI creates an instance of the VolumeGroupsClient client using a custom endpoint. Use
+// this when interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure stack).
+func NewVolumeGroupsClientWithBaseURI(baseURI string, subscriptionID string) VolumeGroupsClient {
+ return VolumeGroupsClient{NewWithBaseURI(baseURI, subscriptionID)}
+}
+
+// Create create a volume group along with specified volumes
+// Parameters:
+// body - volume Group object supplied in the body of the operation.
+// resourceGroupName - the name of the resource group.
+// accountName - the name of the NetApp account
+// volumeGroupName - the name of the volumeGroup
+func (client VolumeGroupsClient) Create(ctx context.Context, body VolumeGroupDetails, resourceGroupName string, accountName string, volumeGroupName string) (result VolumeGroupsCreateFuture, err error) {
+ if tracing.IsEnabled() {
+ ctx = tracing.StartSpan(ctx, fqdn+"/VolumeGroupsClient.Create")
+ defer func() {
+ sc := -1
+ if result.FutureAPI != nil && result.FutureAPI.Response() != nil {
+ sc = result.FutureAPI.Response().StatusCode
+ }
+ tracing.EndSpan(ctx, sc, err)
+ }()
+ }
+ if err := validation.Validate([]validation.Validation{
+ {TargetValue: resourceGroupName,
+ Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil},
+ {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil},
+ {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}},
+ {TargetValue: volumeGroupName,
+ Constraints: []validation.Constraint{{Target: "volumeGroupName", Name: validation.MaxLength, Rule: 64, Chain: nil},
+ {Target: "volumeGroupName", Name: validation.MinLength, Rule: 1, Chain: nil},
+ {Target: "volumeGroupName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9][a-zA-Z0-9\-_]{0,63}$`, Chain: nil}}}}); err != nil {
+ return result, validation.NewError("netapp.VolumeGroupsClient", "Create", err.Error())
+ }
+
+ req, err := client.CreatePreparer(ctx, body, resourceGroupName, accountName, volumeGroupName)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "netapp.VolumeGroupsClient", "Create", nil, "Failure preparing request")
+ return
+ }
+
+ result, err = client.CreateSender(req)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "netapp.VolumeGroupsClient", "Create", result.Response(), "Failure sending request")
+ return
+ }
+
+ return
+}
+
+// CreatePreparer prepares the Create request.
+func (client VolumeGroupsClient) CreatePreparer(ctx context.Context, body VolumeGroupDetails, resourceGroupName string, accountName string, volumeGroupName string) (*http.Request, error) {
+ pathParameters := map[string]interface{}{
+ "accountName": autorest.Encode("path", accountName),
+ "resourceGroupName": autorest.Encode("path", resourceGroupName),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
+ "volumeGroupName": autorest.Encode("path", volumeGroupName),
+ }
+
+ const APIVersion = "2021-10-01"
+ queryParameters := map[string]interface{}{
+ "api-version": APIVersion,
+ }
+
+ body.ID = nil
+ body.Name = nil
+ body.Type = nil
+ preparer := autorest.CreatePreparer(
+ autorest.AsContentType("application/json; charset=utf-8"),
+ autorest.AsPut(),
+ autorest.WithBaseURL(client.BaseURI),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/volumeGroups/{volumeGroupName}", pathParameters),
+ autorest.WithJSON(body),
+ autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare((&http.Request{}).WithContext(ctx))
+}
+
+// CreateSender sends the Create request. The method will close the
+// http.Response Body if it receives an error.
+func (client VolumeGroupsClient) CreateSender(req *http.Request) (future VolumeGroupsCreateFuture, err error) {
+ var resp *http.Response
+ future.FutureAPI = &azure.Future{}
+ resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client))
+ if err != nil {
+ return
+ }
+ var azf azure.Future
+ azf, err = azure.NewFutureFromResponse(resp)
+ future.FutureAPI = &azf
+ future.Result = future.result
+ return
+}
+
+// CreateResponder handles the response to the Create request. The method always
+// closes the http.Response Body.
+func (client VolumeGroupsClient) CreateResponder(resp *http.Response) (result VolumeGroupDetails, err error) {
+ err = autorest.Respond(
+ resp,
+ azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated),
+ autorest.ByUnmarshallingJSON(&result),
+ autorest.ByClosing())
+ result.Response = autorest.Response{Response: resp}
+ return
+}
+
+// Delete delete the specified volume group only if there are no volumes under volume group.
+// Parameters:
+// resourceGroupName - the name of the resource group.
+// accountName - the name of the NetApp account
+// volumeGroupName - the name of the volumeGroup
+func (client VolumeGroupsClient) Delete(ctx context.Context, resourceGroupName string, accountName string, volumeGroupName string) (result VolumeGroupsDeleteFuture, err error) {
+ if tracing.IsEnabled() {
+ ctx = tracing.StartSpan(ctx, fqdn+"/VolumeGroupsClient.Delete")
+ defer func() {
+ sc := -1
+ if result.FutureAPI != nil && result.FutureAPI.Response() != nil {
+ sc = result.FutureAPI.Response().StatusCode
+ }
+ tracing.EndSpan(ctx, sc, err)
+ }()
+ }
+ if err := validation.Validate([]validation.Validation{
+ {TargetValue: resourceGroupName,
+ Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil},
+ {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil},
+ {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}},
+ {TargetValue: volumeGroupName,
+ Constraints: []validation.Constraint{{Target: "volumeGroupName", Name: validation.MaxLength, Rule: 64, Chain: nil},
+ {Target: "volumeGroupName", Name: validation.MinLength, Rule: 1, Chain: nil},
+ {Target: "volumeGroupName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9][a-zA-Z0-9\-_]{0,63}$`, Chain: nil}}}}); err != nil {
+ return result, validation.NewError("netapp.VolumeGroupsClient", "Delete", err.Error())
+ }
+
+ req, err := client.DeletePreparer(ctx, resourceGroupName, accountName, volumeGroupName)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "netapp.VolumeGroupsClient", "Delete", nil, "Failure preparing request")
+ return
+ }
+
+ result, err = client.DeleteSender(req)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "netapp.VolumeGroupsClient", "Delete", result.Response(), "Failure sending request")
+ return
+ }
+
+ return
+}
+
+// DeletePreparer prepares the Delete request.
+func (client VolumeGroupsClient) DeletePreparer(ctx context.Context, resourceGroupName string, accountName string, volumeGroupName string) (*http.Request, error) {
+ pathParameters := map[string]interface{}{
+ "accountName": autorest.Encode("path", accountName),
+ "resourceGroupName": autorest.Encode("path", resourceGroupName),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
+ "volumeGroupName": autorest.Encode("path", volumeGroupName),
+ }
+
+ const APIVersion = "2021-10-01"
+ queryParameters := map[string]interface{}{
+ "api-version": APIVersion,
+ }
+
+ preparer := autorest.CreatePreparer(
+ autorest.AsDelete(),
+ autorest.WithBaseURL(client.BaseURI),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/volumeGroups/{volumeGroupName}", pathParameters),
+ autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare((&http.Request{}).WithContext(ctx))
+}
+
+// DeleteSender sends the Delete request. The method will close the
+// http.Response Body if it receives an error.
+func (client VolumeGroupsClient) DeleteSender(req *http.Request) (future VolumeGroupsDeleteFuture, err error) {
+ var resp *http.Response
+ future.FutureAPI = &azure.Future{}
+ resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client))
+ if err != nil {
+ return
+ }
+ var azf azure.Future
+ azf, err = azure.NewFutureFromResponse(resp)
+ future.FutureAPI = &azf
+ future.Result = future.result
+ return
+}
+
+// DeleteResponder handles the response to the Delete request. The method always
+// closes the http.Response Body.
+func (client VolumeGroupsClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) {
+ err = autorest.Respond(
+ resp,
+ azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent),
+ autorest.ByClosing())
+ result.Response = resp
+ return
+}
+
+// Get get details of the specified volume group
+// Parameters:
+// resourceGroupName - the name of the resource group.
+// accountName - the name of the NetApp account
+// volumeGroupName - the name of the volumeGroup
+func (client VolumeGroupsClient) Get(ctx context.Context, resourceGroupName string, accountName string, volumeGroupName string) (result VolumeGroupDetails, err error) {
+ if tracing.IsEnabled() {
+ ctx = tracing.StartSpan(ctx, fqdn+"/VolumeGroupsClient.Get")
+ defer func() {
+ sc := -1
+ if result.Response.Response != nil {
+ sc = result.Response.Response.StatusCode
+ }
+ tracing.EndSpan(ctx, sc, err)
+ }()
+ }
+ if err := validation.Validate([]validation.Validation{
+ {TargetValue: resourceGroupName,
+ Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil},
+ {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil},
+ {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}},
+ {TargetValue: volumeGroupName,
+ Constraints: []validation.Constraint{{Target: "volumeGroupName", Name: validation.MaxLength, Rule: 64, Chain: nil},
+ {Target: "volumeGroupName", Name: validation.MinLength, Rule: 1, Chain: nil},
+ {Target: "volumeGroupName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9][a-zA-Z0-9\-_]{0,63}$`, Chain: nil}}}}); err != nil {
+ return result, validation.NewError("netapp.VolumeGroupsClient", "Get", err.Error())
+ }
+
+ req, err := client.GetPreparer(ctx, resourceGroupName, accountName, volumeGroupName)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "netapp.VolumeGroupsClient", "Get", nil, "Failure preparing request")
+ return
+ }
+
+ resp, err := client.GetSender(req)
+ if err != nil {
+ result.Response = autorest.Response{Response: resp}
+ err = autorest.NewErrorWithError(err, "netapp.VolumeGroupsClient", "Get", resp, "Failure sending request")
+ return
+ }
+
+ result, err = client.GetResponder(resp)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "netapp.VolumeGroupsClient", "Get", resp, "Failure responding to request")
+ return
+ }
+
+ return
+}
+
+// GetPreparer prepares the Get request.
+func (client VolumeGroupsClient) GetPreparer(ctx context.Context, resourceGroupName string, accountName string, volumeGroupName string) (*http.Request, error) {
+ pathParameters := map[string]interface{}{
+ "accountName": autorest.Encode("path", accountName),
+ "resourceGroupName": autorest.Encode("path", resourceGroupName),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
+ "volumeGroupName": autorest.Encode("path", volumeGroupName),
+ }
+
+ const APIVersion = "2021-10-01"
+ queryParameters := map[string]interface{}{
+ "api-version": APIVersion,
+ }
+
+ preparer := autorest.CreatePreparer(
+ autorest.AsGet(),
+ autorest.WithBaseURL(client.BaseURI),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/volumeGroups/{volumeGroupName}", pathParameters),
+ autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare((&http.Request{}).WithContext(ctx))
+}
+
+// GetSender sends the Get request. The method will close the
+// http.Response Body if it receives an error.
+func (client VolumeGroupsClient) GetSender(req *http.Request) (*http.Response, error) {
+ return client.Send(req, azure.DoRetryWithRegistration(client.Client))
+}
+
+// GetResponder handles the response to the Get request. The method always
+// closes the http.Response Body.
+func (client VolumeGroupsClient) GetResponder(resp *http.Response) (result VolumeGroupDetails, err error) {
+ err = autorest.Respond(
+ resp,
+ azure.WithErrorUnlessStatusCode(http.StatusOK),
+ autorest.ByUnmarshallingJSON(&result),
+ autorest.ByClosing())
+ result.Response = autorest.Response{Response: resp}
+ return
+}
+
+// ListByNetAppAccount list all volume groups for given account
+// Parameters:
+// resourceGroupName - the name of the resource group.
+// accountName - the name of the NetApp account
+func (client VolumeGroupsClient) ListByNetAppAccount(ctx context.Context, resourceGroupName string, accountName string) (result VolumeGroupList, err error) {
+ if tracing.IsEnabled() {
+ ctx = tracing.StartSpan(ctx, fqdn+"/VolumeGroupsClient.ListByNetAppAccount")
+ defer func() {
+ sc := -1
+ if result.Response.Response != nil {
+ sc = result.Response.Response.StatusCode
+ }
+ tracing.EndSpan(ctx, sc, err)
+ }()
+ }
+ if err := validation.Validate([]validation.Validation{
+ {TargetValue: resourceGroupName,
+ Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil},
+ {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil},
+ {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}}); err != nil {
+ return result, validation.NewError("netapp.VolumeGroupsClient", "ListByNetAppAccount", err.Error())
+ }
+
+ req, err := client.ListByNetAppAccountPreparer(ctx, resourceGroupName, accountName)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "netapp.VolumeGroupsClient", "ListByNetAppAccount", nil, "Failure preparing request")
+ return
+ }
+
+ resp, err := client.ListByNetAppAccountSender(req)
+ if err != nil {
+ result.Response = autorest.Response{Response: resp}
+ err = autorest.NewErrorWithError(err, "netapp.VolumeGroupsClient", "ListByNetAppAccount", resp, "Failure sending request")
+ return
+ }
+
+ result, err = client.ListByNetAppAccountResponder(resp)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "netapp.VolumeGroupsClient", "ListByNetAppAccount", resp, "Failure responding to request")
+ return
+ }
+
+ return
+}
+
+// ListByNetAppAccountPreparer prepares the ListByNetAppAccount request.
+func (client VolumeGroupsClient) ListByNetAppAccountPreparer(ctx context.Context, resourceGroupName string, accountName string) (*http.Request, error) {
+ pathParameters := map[string]interface{}{
+ "accountName": autorest.Encode("path", accountName),
+ "resourceGroupName": autorest.Encode("path", resourceGroupName),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
+ }
+
+ const APIVersion = "2021-10-01"
+ queryParameters := map[string]interface{}{
+ "api-version": APIVersion,
+ }
+
+ preparer := autorest.CreatePreparer(
+ autorest.AsGet(),
+ autorest.WithBaseURL(client.BaseURI),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/volumeGroups", pathParameters),
+ autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare((&http.Request{}).WithContext(ctx))
+}
+
+// ListByNetAppAccountSender sends the ListByNetAppAccount request. The method will close the
+// http.Response Body if it receives an error.
+func (client VolumeGroupsClient) ListByNetAppAccountSender(req *http.Request) (*http.Response, error) {
+ return client.Send(req, azure.DoRetryWithRegistration(client.Client))
+}
+
+// ListByNetAppAccountResponder handles the response to the ListByNetAppAccount request. The method always
+// closes the http.Response Body.
+func (client VolumeGroupsClient) ListByNetAppAccountResponder(resp *http.Response) (result VolumeGroupList, err error) {
+ err = autorest.Respond(
+ resp,
+ azure.WithErrorUnlessStatusCode(http.StatusOK),
+ autorest.ByUnmarshallingJSON(&result),
+ autorest.ByClosing())
+ result.Response = autorest.Response{Response: resp}
+ return
+}
diff --git a/services/netapp/mgmt/2021-10-01/netapp/volumes.go b/services/netapp/mgmt/2021-10-01/netapp/volumes.go
new file mode 100644
index 000000000000..11016cd3a95a
--- /dev/null
+++ b/services/netapp/mgmt/2021-10-01/netapp/volumes.go
@@ -0,0 +1,1422 @@
+package netapp
+
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License. See License.txt in the project root for license information.
+//
+// Code generated by Microsoft (R) AutoRest Code Generator.
+// Changes may cause incorrect behavior and will be lost if the code is regenerated.
+
+import (
+ "context"
+ "github.com/Azure/go-autorest/autorest"
+ "github.com/Azure/go-autorest/autorest/azure"
+ "github.com/Azure/go-autorest/autorest/validation"
+ "github.com/Azure/go-autorest/tracing"
+ "net/http"
+)
+
+// VolumesClient is the microsoft NetApp Files Azure Resource Provider specification
+type VolumesClient struct {
+ BaseClient
+}
+
+// NewVolumesClient creates an instance of the VolumesClient client.
+func NewVolumesClient(subscriptionID string) VolumesClient {
+ return NewVolumesClientWithBaseURI(DefaultBaseURI, subscriptionID)
+}
+
+// NewVolumesClientWithBaseURI creates an instance of the VolumesClient client using a custom endpoint. Use this when
+// interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure stack).
+func NewVolumesClientWithBaseURI(baseURI string, subscriptionID string) VolumesClient {
+ return VolumesClient{NewWithBaseURI(baseURI, subscriptionID)}
+}
+
+// AuthorizeReplication authorize the replication connection on the source volume
+// Parameters:
+// resourceGroupName - the name of the resource group.
+// accountName - the name of the NetApp account
+// poolName - the name of the capacity pool
+// volumeName - the name of the volume
+// body - authorize request object supplied in the body of the operation.
+func (client VolumesClient) AuthorizeReplication(ctx context.Context, resourceGroupName string, accountName string, poolName string, volumeName string, body AuthorizeRequest) (result VolumesAuthorizeReplicationFuture, err error) {
+ if tracing.IsEnabled() {
+ ctx = tracing.StartSpan(ctx, fqdn+"/VolumesClient.AuthorizeReplication")
+ defer func() {
+ sc := -1
+ if result.FutureAPI != nil && result.FutureAPI.Response() != nil {
+ sc = result.FutureAPI.Response().StatusCode
+ }
+ tracing.EndSpan(ctx, sc, err)
+ }()
+ }
+ if err := validation.Validate([]validation.Validation{
+ {TargetValue: resourceGroupName,
+ Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil},
+ {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil},
+ {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}},
+ {TargetValue: poolName,
+ Constraints: []validation.Constraint{{Target: "poolName", Name: validation.MaxLength, Rule: 64, Chain: nil},
+ {Target: "poolName", Name: validation.MinLength, Rule: 1, Chain: nil},
+ {Target: "poolName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9][a-zA-Z0-9\-_]{0,63}$`, Chain: nil}}},
+ {TargetValue: volumeName,
+ Constraints: []validation.Constraint{{Target: "volumeName", Name: validation.MaxLength, Rule: 64, Chain: nil},
+ {Target: "volumeName", Name: validation.MinLength, Rule: 1, Chain: nil},
+ {Target: "volumeName", Name: validation.Pattern, Rule: `^[a-zA-Z][a-zA-Z0-9\-_]{0,63}$`, Chain: nil}}}}); err != nil {
+ return result, validation.NewError("netapp.VolumesClient", "AuthorizeReplication", err.Error())
+ }
+
+ req, err := client.AuthorizeReplicationPreparer(ctx, resourceGroupName, accountName, poolName, volumeName, body)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "netapp.VolumesClient", "AuthorizeReplication", nil, "Failure preparing request")
+ return
+ }
+
+ result, err = client.AuthorizeReplicationSender(req)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "netapp.VolumesClient", "AuthorizeReplication", result.Response(), "Failure sending request")
+ return
+ }
+
+ return
+}
+
+// AuthorizeReplicationPreparer prepares the AuthorizeReplication request.
+func (client VolumesClient) AuthorizeReplicationPreparer(ctx context.Context, resourceGroupName string, accountName string, poolName string, volumeName string, body AuthorizeRequest) (*http.Request, error) {
+ pathParameters := map[string]interface{}{
+ "accountName": autorest.Encode("path", accountName),
+ "poolName": autorest.Encode("path", poolName),
+ "resourceGroupName": autorest.Encode("path", resourceGroupName),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
+ "volumeName": autorest.Encode("path", volumeName),
+ }
+
+ const APIVersion = "2021-10-01"
+ queryParameters := map[string]interface{}{
+ "api-version": APIVersion,
+ }
+
+ preparer := autorest.CreatePreparer(
+ autorest.AsContentType("application/json; charset=utf-8"),
+ autorest.AsPost(),
+ autorest.WithBaseURL(client.BaseURI),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/capacityPools/{poolName}/volumes/{volumeName}/authorizeReplication", pathParameters),
+ autorest.WithJSON(body),
+ autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare((&http.Request{}).WithContext(ctx))
+}
+
+// AuthorizeReplicationSender sends the AuthorizeReplication request. The method will close the
+// http.Response Body if it receives an error.
+func (client VolumesClient) AuthorizeReplicationSender(req *http.Request) (future VolumesAuthorizeReplicationFuture, err error) {
+ var resp *http.Response
+ future.FutureAPI = &azure.Future{}
+ resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client))
+ if err != nil {
+ return
+ }
+ var azf azure.Future
+ azf, err = azure.NewFutureFromResponse(resp)
+ future.FutureAPI = &azf
+ future.Result = future.result
+ return
+}
+
+// AuthorizeReplicationResponder handles the response to the AuthorizeReplication request. The method always
+// closes the http.Response Body.
+func (client VolumesClient) AuthorizeReplicationResponder(resp *http.Response) (result autorest.Response, err error) {
+ err = autorest.Respond(
+ resp,
+ azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted),
+ autorest.ByClosing())
+ result.Response = resp
+ return
+}
+
+// BreakReplication break the replication connection on the destination volume
+// Parameters:
+// resourceGroupName - the name of the resource group.
+// accountName - the name of the NetApp account
+// poolName - the name of the capacity pool
+// volumeName - the name of the volume
+// body - optional body to force break the replication.
+func (client VolumesClient) BreakReplication(ctx context.Context, resourceGroupName string, accountName string, poolName string, volumeName string, body *BreakReplicationRequest) (result VolumesBreakReplicationFuture, err error) {
+ if tracing.IsEnabled() {
+ ctx = tracing.StartSpan(ctx, fqdn+"/VolumesClient.BreakReplication")
+ defer func() {
+ sc := -1
+ if result.FutureAPI != nil && result.FutureAPI.Response() != nil {
+ sc = result.FutureAPI.Response().StatusCode
+ }
+ tracing.EndSpan(ctx, sc, err)
+ }()
+ }
+ if err := validation.Validate([]validation.Validation{
+ {TargetValue: resourceGroupName,
+ Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil},
+ {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil},
+ {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}},
+ {TargetValue: poolName,
+ Constraints: []validation.Constraint{{Target: "poolName", Name: validation.MaxLength, Rule: 64, Chain: nil},
+ {Target: "poolName", Name: validation.MinLength, Rule: 1, Chain: nil},
+ {Target: "poolName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9][a-zA-Z0-9\-_]{0,63}$`, Chain: nil}}},
+ {TargetValue: volumeName,
+ Constraints: []validation.Constraint{{Target: "volumeName", Name: validation.MaxLength, Rule: 64, Chain: nil},
+ {Target: "volumeName", Name: validation.MinLength, Rule: 1, Chain: nil},
+ {Target: "volumeName", Name: validation.Pattern, Rule: `^[a-zA-Z][a-zA-Z0-9\-_]{0,63}$`, Chain: nil}}}}); err != nil {
+ return result, validation.NewError("netapp.VolumesClient", "BreakReplication", err.Error())
+ }
+
+ req, err := client.BreakReplicationPreparer(ctx, resourceGroupName, accountName, poolName, volumeName, body)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "netapp.VolumesClient", "BreakReplication", nil, "Failure preparing request")
+ return
+ }
+
+ result, err = client.BreakReplicationSender(req)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "netapp.VolumesClient", "BreakReplication", result.Response(), "Failure sending request")
+ return
+ }
+
+ return
+}
+
+// BreakReplicationPreparer prepares the BreakReplication request.
+func (client VolumesClient) BreakReplicationPreparer(ctx context.Context, resourceGroupName string, accountName string, poolName string, volumeName string, body *BreakReplicationRequest) (*http.Request, error) {
+ pathParameters := map[string]interface{}{
+ "accountName": autorest.Encode("path", accountName),
+ "poolName": autorest.Encode("path", poolName),
+ "resourceGroupName": autorest.Encode("path", resourceGroupName),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
+ "volumeName": autorest.Encode("path", volumeName),
+ }
+
+ const APIVersion = "2021-10-01"
+ queryParameters := map[string]interface{}{
+ "api-version": APIVersion,
+ }
+
+ preparer := autorest.CreatePreparer(
+ autorest.AsContentType("application/json; charset=utf-8"),
+ autorest.AsPost(),
+ autorest.WithBaseURL(client.BaseURI),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/capacityPools/{poolName}/volumes/{volumeName}/breakReplication", pathParameters),
+ autorest.WithQueryParameters(queryParameters))
+ if body != nil {
+ preparer = autorest.DecoratePreparer(preparer,
+ autorest.WithJSON(body))
+ }
+ return preparer.Prepare((&http.Request{}).WithContext(ctx))
+}
+
+// BreakReplicationSender sends the BreakReplication request. The method will close the
+// http.Response Body if it receives an error.
+func (client VolumesClient) BreakReplicationSender(req *http.Request) (future VolumesBreakReplicationFuture, err error) {
+ var resp *http.Response
+ future.FutureAPI = &azure.Future{}
+ resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client))
+ if err != nil {
+ return
+ }
+ var azf azure.Future
+ azf, err = azure.NewFutureFromResponse(resp)
+ future.FutureAPI = &azf
+ future.Result = future.result
+ return
+}
+
+// BreakReplicationResponder handles the response to the BreakReplication request. The method always
+// closes the http.Response Body.
+func (client VolumesClient) BreakReplicationResponder(resp *http.Response) (result autorest.Response, err error) {
+ err = autorest.Respond(
+ resp,
+ azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted),
+ autorest.ByClosing())
+ result.Response = resp
+ return
+}
+
+// CreateOrUpdate create or update the specified volume within the capacity pool
+// Parameters:
+// body - volume object supplied in the body of the operation.
+// resourceGroupName - the name of the resource group.
+// accountName - the name of the NetApp account
+// poolName - the name of the capacity pool
+// volumeName - the name of the volume
+func (client VolumesClient) CreateOrUpdate(ctx context.Context, body Volume, resourceGroupName string, accountName string, poolName string, volumeName string) (result VolumesCreateOrUpdateFuture, err error) {
+ if tracing.IsEnabled() {
+ ctx = tracing.StartSpan(ctx, fqdn+"/VolumesClient.CreateOrUpdate")
+ defer func() {
+ sc := -1
+ if result.FutureAPI != nil && result.FutureAPI.Response() != nil {
+ sc = result.FutureAPI.Response().StatusCode
+ }
+ tracing.EndSpan(ctx, sc, err)
+ }()
+ }
+ if err := validation.Validate([]validation.Validation{
+ {TargetValue: body,
+ Constraints: []validation.Constraint{{Target: "body.Location", Name: validation.Null, Rule: true, Chain: nil},
+ {Target: "body.VolumeProperties", Name: validation.Null, Rule: true,
+ Chain: []validation.Constraint{{Target: "body.VolumeProperties.FileSystemID", Name: validation.Null, Rule: false,
+ Chain: []validation.Constraint{{Target: "body.VolumeProperties.FileSystemID", Name: validation.MaxLength, Rule: 36, Chain: nil},
+ {Target: "body.VolumeProperties.FileSystemID", Name: validation.MinLength, Rule: 36, Chain: nil},
+ {Target: "body.VolumeProperties.FileSystemID", Name: validation.Pattern, Rule: `^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$`, Chain: nil},
+ }},
+ {Target: "body.VolumeProperties.CreationToken", Name: validation.Null, Rule: true,
+ Chain: []validation.Constraint{{Target: "body.VolumeProperties.CreationToken", Name: validation.MaxLength, Rule: 80, Chain: nil},
+ {Target: "body.VolumeProperties.CreationToken", Name: validation.MinLength, Rule: 1, Chain: nil},
+ {Target: "body.VolumeProperties.CreationToken", Name: validation.Pattern, Rule: `^[a-zA-Z][a-zA-Z0-9\-]{0,79}$`, Chain: nil},
+ }},
+ {Target: "body.VolumeProperties.UsageThreshold", Name: validation.Null, Rule: true,
+ Chain: []validation.Constraint{{Target: "body.VolumeProperties.UsageThreshold", Name: validation.InclusiveMaximum, Rule: int64(109951162777600), Chain: nil},
+ {Target: "body.VolumeProperties.UsageThreshold", Name: validation.InclusiveMinimum, Rule: int64(107374182400), Chain: nil},
+ }},
+ {Target: "body.VolumeProperties.SnapshotID", Name: validation.Null, Rule: false,
+ Chain: []validation.Constraint{{Target: "body.VolumeProperties.SnapshotID", Name: validation.MaxLength, Rule: 36, Chain: nil},
+ {Target: "body.VolumeProperties.SnapshotID", Name: validation.MinLength, Rule: 36, Chain: nil},
+ {Target: "body.VolumeProperties.SnapshotID", Name: validation.Pattern, Rule: `^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}|(\\?([^\/]*[\/])*)([^\/]+)$`, Chain: nil},
+ }},
+ {Target: "body.VolumeProperties.BackupID", Name: validation.Null, Rule: false,
+ Chain: []validation.Constraint{{Target: "body.VolumeProperties.BackupID", Name: validation.MaxLength, Rule: 36, Chain: nil},
+ {Target: "body.VolumeProperties.BackupID", Name: validation.MinLength, Rule: 36, Chain: nil},
+ {Target: "body.VolumeProperties.BackupID", Name: validation.Pattern, Rule: `^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}|(\\?([^\/]*[\/])*)([^\/]+)$`, Chain: nil},
+ }},
+ {Target: "body.VolumeProperties.SubnetID", Name: validation.Null, Rule: true, Chain: nil},
+ {Target: "body.VolumeProperties.NetworkSiblingSetID", Name: validation.Null, Rule: false,
+ Chain: []validation.Constraint{{Target: "body.VolumeProperties.NetworkSiblingSetID", Name: validation.MaxLength, Rule: 36, Chain: nil},
+ {Target: "body.VolumeProperties.NetworkSiblingSetID", Name: validation.MinLength, Rule: 36, Chain: nil},
+ {Target: "body.VolumeProperties.NetworkSiblingSetID", Name: validation.Pattern, Rule: `^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$`, Chain: nil},
+ }},
+ {Target: "body.VolumeProperties.DataProtection", Name: validation.Null, Rule: false,
+ Chain: []validation.Constraint{{Target: "body.VolumeProperties.DataProtection.Replication", Name: validation.Null, Rule: false,
+ Chain: []validation.Constraint{{Target: "body.VolumeProperties.DataProtection.Replication.RemoteVolumeResourceID", Name: validation.Null, Rule: true, Chain: nil}}},
+ }},
+ {Target: "body.VolumeProperties.CoolnessPeriod", Name: validation.Null, Rule: false,
+ Chain: []validation.Constraint{{Target: "body.VolumeProperties.CoolnessPeriod", Name: validation.InclusiveMaximum, Rule: int64(63), Chain: nil},
+ {Target: "body.VolumeProperties.CoolnessPeriod", Name: validation.InclusiveMinimum, Rule: int64(7), Chain: nil},
+ }},
+ {Target: "body.VolumeProperties.UnixPermissions", Name: validation.Null, Rule: false,
+ Chain: []validation.Constraint{{Target: "body.VolumeProperties.UnixPermissions", Name: validation.MaxLength, Rule: 4, Chain: nil},
+ {Target: "body.VolumeProperties.UnixPermissions", Name: validation.MinLength, Rule: 4, Chain: nil},
+ }},
+ }}}},
+ {TargetValue: resourceGroupName,
+ Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil},
+ {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil},
+ {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}},
+ {TargetValue: poolName,
+ Constraints: []validation.Constraint{{Target: "poolName", Name: validation.MaxLength, Rule: 64, Chain: nil},
+ {Target: "poolName", Name: validation.MinLength, Rule: 1, Chain: nil},
+ {Target: "poolName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9][a-zA-Z0-9\-_]{0,63}$`, Chain: nil}}},
+ {TargetValue: volumeName,
+ Constraints: []validation.Constraint{{Target: "volumeName", Name: validation.MaxLength, Rule: 64, Chain: nil},
+ {Target: "volumeName", Name: validation.MinLength, Rule: 1, Chain: nil},
+ {Target: "volumeName", Name: validation.Pattern, Rule: `^[a-zA-Z][a-zA-Z0-9\-_]{0,63}$`, Chain: nil}}}}); err != nil {
+ return result, validation.NewError("netapp.VolumesClient", "CreateOrUpdate", err.Error())
+ }
+
+ req, err := client.CreateOrUpdatePreparer(ctx, body, resourceGroupName, accountName, poolName, volumeName)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "netapp.VolumesClient", "CreateOrUpdate", nil, "Failure preparing request")
+ return
+ }
+
+ result, err = client.CreateOrUpdateSender(req)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "netapp.VolumesClient", "CreateOrUpdate", result.Response(), "Failure sending request")
+ return
+ }
+
+ return
+}
+
+// CreateOrUpdatePreparer prepares the CreateOrUpdate request.
+func (client VolumesClient) CreateOrUpdatePreparer(ctx context.Context, body Volume, resourceGroupName string, accountName string, poolName string, volumeName string) (*http.Request, error) {
+ pathParameters := map[string]interface{}{
+ "accountName": autorest.Encode("path", accountName),
+ "poolName": autorest.Encode("path", poolName),
+ "resourceGroupName": autorest.Encode("path", resourceGroupName),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
+ "volumeName": autorest.Encode("path", volumeName),
+ }
+
+ const APIVersion = "2021-10-01"
+ queryParameters := map[string]interface{}{
+ "api-version": APIVersion,
+ }
+
+ body.ID = nil
+ body.Name = nil
+ body.Etag = nil
+ body.Type = nil
+ body.SystemData = nil
+ preparer := autorest.CreatePreparer(
+ autorest.AsContentType("application/json; charset=utf-8"),
+ autorest.AsPut(),
+ autorest.WithBaseURL(client.BaseURI),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/capacityPools/{poolName}/volumes/{volumeName}", pathParameters),
+ autorest.WithJSON(body),
+ autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare((&http.Request{}).WithContext(ctx))
+}
+
+// CreateOrUpdateSender sends the CreateOrUpdate request. The method will close the
+// http.Response Body if it receives an error.
+func (client VolumesClient) CreateOrUpdateSender(req *http.Request) (future VolumesCreateOrUpdateFuture, err error) {
+ var resp *http.Response
+ future.FutureAPI = &azure.Future{}
+ resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client))
+ if err != nil {
+ return
+ }
+ var azf azure.Future
+ azf, err = azure.NewFutureFromResponse(resp)
+ future.FutureAPI = &azf
+ future.Result = future.result
+ return
+}
+
+// CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always
+// closes the http.Response Body.
+func (client VolumesClient) CreateOrUpdateResponder(resp *http.Response) (result Volume, err error) {
+ err = autorest.Respond(
+ resp,
+ azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated, http.StatusAccepted),
+ autorest.ByUnmarshallingJSON(&result),
+ autorest.ByClosing())
+ result.Response = autorest.Response{Response: resp}
+ return
+}
+
+// Delete delete the specified volume
+// Parameters:
+// resourceGroupName - the name of the resource group.
+// accountName - the name of the NetApp account
+// poolName - the name of the capacity pool
+// volumeName - the name of the volume
+// forceDelete - an option to force delete the volume. Will cleanup resources connected to the particular
+// volume
+func (client VolumesClient) Delete(ctx context.Context, resourceGroupName string, accountName string, poolName string, volumeName string, forceDelete *bool) (result VolumesDeleteFuture, err error) {
+ if tracing.IsEnabled() {
+ ctx = tracing.StartSpan(ctx, fqdn+"/VolumesClient.Delete")
+ defer func() {
+ sc := -1
+ if result.FutureAPI != nil && result.FutureAPI.Response() != nil {
+ sc = result.FutureAPI.Response().StatusCode
+ }
+ tracing.EndSpan(ctx, sc, err)
+ }()
+ }
+ if err := validation.Validate([]validation.Validation{
+ {TargetValue: resourceGroupName,
+ Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil},
+ {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil},
+ {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}},
+ {TargetValue: poolName,
+ Constraints: []validation.Constraint{{Target: "poolName", Name: validation.MaxLength, Rule: 64, Chain: nil},
+ {Target: "poolName", Name: validation.MinLength, Rule: 1, Chain: nil},
+ {Target: "poolName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9][a-zA-Z0-9\-_]{0,63}$`, Chain: nil}}},
+ {TargetValue: volumeName,
+ Constraints: []validation.Constraint{{Target: "volumeName", Name: validation.MaxLength, Rule: 64, Chain: nil},
+ {Target: "volumeName", Name: validation.MinLength, Rule: 1, Chain: nil},
+ {Target: "volumeName", Name: validation.Pattern, Rule: `^[a-zA-Z][a-zA-Z0-9\-_]{0,63}$`, Chain: nil}}}}); err != nil {
+ return result, validation.NewError("netapp.VolumesClient", "Delete", err.Error())
+ }
+
+ req, err := client.DeletePreparer(ctx, resourceGroupName, accountName, poolName, volumeName, forceDelete)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "netapp.VolumesClient", "Delete", nil, "Failure preparing request")
+ return
+ }
+
+ result, err = client.DeleteSender(req)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "netapp.VolumesClient", "Delete", result.Response(), "Failure sending request")
+ return
+ }
+
+ return
+}
+
+// DeletePreparer prepares the Delete request.
+func (client VolumesClient) DeletePreparer(ctx context.Context, resourceGroupName string, accountName string, poolName string, volumeName string, forceDelete *bool) (*http.Request, error) {
+ pathParameters := map[string]interface{}{
+ "accountName": autorest.Encode("path", accountName),
+ "poolName": autorest.Encode("path", poolName),
+ "resourceGroupName": autorest.Encode("path", resourceGroupName),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
+ "volumeName": autorest.Encode("path", volumeName),
+ }
+
+ const APIVersion = "2021-10-01"
+ queryParameters := map[string]interface{}{
+ "api-version": APIVersion,
+ }
+ if forceDelete != nil {
+ queryParameters["forceDelete"] = autorest.Encode("query", *forceDelete)
+ }
+
+ preparer := autorest.CreatePreparer(
+ autorest.AsDelete(),
+ autorest.WithBaseURL(client.BaseURI),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/capacityPools/{poolName}/volumes/{volumeName}", pathParameters),
+ autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare((&http.Request{}).WithContext(ctx))
+}
+
+// DeleteSender sends the Delete request. The method will close the
+// http.Response Body if it receives an error.
+func (client VolumesClient) DeleteSender(req *http.Request) (future VolumesDeleteFuture, err error) {
+ var resp *http.Response
+ future.FutureAPI = &azure.Future{}
+ resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client))
+ if err != nil {
+ return
+ }
+ var azf azure.Future
+ azf, err = azure.NewFutureFromResponse(resp)
+ future.FutureAPI = &azf
+ future.Result = future.result
+ return
+}
+
+// DeleteResponder handles the response to the Delete request. The method always
+// closes the http.Response Body.
+func (client VolumesClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) {
+ err = autorest.Respond(
+ resp,
+ azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent),
+ autorest.ByClosing())
+ result.Response = resp
+ return
+}
+
+// DeleteReplication delete the replication connection on the destination volume, and send release to the source
+// replication
+// Parameters:
+// resourceGroupName - the name of the resource group.
+// accountName - the name of the NetApp account
+// poolName - the name of the capacity pool
+// volumeName - the name of the volume
+func (client VolumesClient) DeleteReplication(ctx context.Context, resourceGroupName string, accountName string, poolName string, volumeName string) (result VolumesDeleteReplicationFuture, err error) {
+ if tracing.IsEnabled() {
+ ctx = tracing.StartSpan(ctx, fqdn+"/VolumesClient.DeleteReplication")
+ defer func() {
+ sc := -1
+ if result.FutureAPI != nil && result.FutureAPI.Response() != nil {
+ sc = result.FutureAPI.Response().StatusCode
+ }
+ tracing.EndSpan(ctx, sc, err)
+ }()
+ }
+ if err := validation.Validate([]validation.Validation{
+ {TargetValue: resourceGroupName,
+ Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil},
+ {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil},
+ {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}},
+ {TargetValue: poolName,
+ Constraints: []validation.Constraint{{Target: "poolName", Name: validation.MaxLength, Rule: 64, Chain: nil},
+ {Target: "poolName", Name: validation.MinLength, Rule: 1, Chain: nil},
+ {Target: "poolName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9][a-zA-Z0-9\-_]{0,63}$`, Chain: nil}}},
+ {TargetValue: volumeName,
+ Constraints: []validation.Constraint{{Target: "volumeName", Name: validation.MaxLength, Rule: 64, Chain: nil},
+ {Target: "volumeName", Name: validation.MinLength, Rule: 1, Chain: nil},
+ {Target: "volumeName", Name: validation.Pattern, Rule: `^[a-zA-Z][a-zA-Z0-9\-_]{0,63}$`, Chain: nil}}}}); err != nil {
+ return result, validation.NewError("netapp.VolumesClient", "DeleteReplication", err.Error())
+ }
+
+ req, err := client.DeleteReplicationPreparer(ctx, resourceGroupName, accountName, poolName, volumeName)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "netapp.VolumesClient", "DeleteReplication", nil, "Failure preparing request")
+ return
+ }
+
+ result, err = client.DeleteReplicationSender(req)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "netapp.VolumesClient", "DeleteReplication", result.Response(), "Failure sending request")
+ return
+ }
+
+ return
+}
+
+// DeleteReplicationPreparer prepares the DeleteReplication request.
+func (client VolumesClient) DeleteReplicationPreparer(ctx context.Context, resourceGroupName string, accountName string, poolName string, volumeName string) (*http.Request, error) {
+ pathParameters := map[string]interface{}{
+ "accountName": autorest.Encode("path", accountName),
+ "poolName": autorest.Encode("path", poolName),
+ "resourceGroupName": autorest.Encode("path", resourceGroupName),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
+ "volumeName": autorest.Encode("path", volumeName),
+ }
+
+ const APIVersion = "2021-10-01"
+ queryParameters := map[string]interface{}{
+ "api-version": APIVersion,
+ }
+
+ preparer := autorest.CreatePreparer(
+ autorest.AsPost(),
+ autorest.WithBaseURL(client.BaseURI),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/capacityPools/{poolName}/volumes/{volumeName}/deleteReplication", pathParameters),
+ autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare((&http.Request{}).WithContext(ctx))
+}
+
+// DeleteReplicationSender sends the DeleteReplication request. The method will close the
+// http.Response Body if it receives an error.
+func (client VolumesClient) DeleteReplicationSender(req *http.Request) (future VolumesDeleteReplicationFuture, err error) {
+ var resp *http.Response
+ future.FutureAPI = &azure.Future{}
+ resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client))
+ if err != nil {
+ return
+ }
+ var azf azure.Future
+ azf, err = azure.NewFutureFromResponse(resp)
+ future.FutureAPI = &azf
+ future.Result = future.result
+ return
+}
+
+// DeleteReplicationResponder handles the response to the DeleteReplication request. The method always
+// closes the http.Response Body.
+func (client VolumesClient) DeleteReplicationResponder(resp *http.Response) (result autorest.Response, err error) {
+ err = autorest.Respond(
+ resp,
+ azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted),
+ autorest.ByClosing())
+ result.Response = resp
+ return
+}
+
+// Get get the details of the specified volume
+// Parameters:
+// resourceGroupName - the name of the resource group.
+// accountName - the name of the NetApp account
+// poolName - the name of the capacity pool
+// volumeName - the name of the volume
+func (client VolumesClient) Get(ctx context.Context, resourceGroupName string, accountName string, poolName string, volumeName string) (result Volume, err error) {
+ if tracing.IsEnabled() {
+ ctx = tracing.StartSpan(ctx, fqdn+"/VolumesClient.Get")
+ defer func() {
+ sc := -1
+ if result.Response.Response != nil {
+ sc = result.Response.Response.StatusCode
+ }
+ tracing.EndSpan(ctx, sc, err)
+ }()
+ }
+ if err := validation.Validate([]validation.Validation{
+ {TargetValue: resourceGroupName,
+ Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil},
+ {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil},
+ {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}},
+ {TargetValue: poolName,
+ Constraints: []validation.Constraint{{Target: "poolName", Name: validation.MaxLength, Rule: 64, Chain: nil},
+ {Target: "poolName", Name: validation.MinLength, Rule: 1, Chain: nil},
+ {Target: "poolName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9][a-zA-Z0-9\-_]{0,63}$`, Chain: nil}}},
+ {TargetValue: volumeName,
+ Constraints: []validation.Constraint{{Target: "volumeName", Name: validation.MaxLength, Rule: 64, Chain: nil},
+ {Target: "volumeName", Name: validation.MinLength, Rule: 1, Chain: nil},
+ {Target: "volumeName", Name: validation.Pattern, Rule: `^[a-zA-Z][a-zA-Z0-9\-_]{0,63}$`, Chain: nil}}}}); err != nil {
+ return result, validation.NewError("netapp.VolumesClient", "Get", err.Error())
+ }
+
+ req, err := client.GetPreparer(ctx, resourceGroupName, accountName, poolName, volumeName)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "netapp.VolumesClient", "Get", nil, "Failure preparing request")
+ return
+ }
+
+ resp, err := client.GetSender(req)
+ if err != nil {
+ result.Response = autorest.Response{Response: resp}
+ err = autorest.NewErrorWithError(err, "netapp.VolumesClient", "Get", resp, "Failure sending request")
+ return
+ }
+
+ result, err = client.GetResponder(resp)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "netapp.VolumesClient", "Get", resp, "Failure responding to request")
+ return
+ }
+
+ return
+}
+
+// GetPreparer prepares the Get request.
+func (client VolumesClient) GetPreparer(ctx context.Context, resourceGroupName string, accountName string, poolName string, volumeName string) (*http.Request, error) {
+ pathParameters := map[string]interface{}{
+ "accountName": autorest.Encode("path", accountName),
+ "poolName": autorest.Encode("path", poolName),
+ "resourceGroupName": autorest.Encode("path", resourceGroupName),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
+ "volumeName": autorest.Encode("path", volumeName),
+ }
+
+ const APIVersion = "2021-10-01"
+ queryParameters := map[string]interface{}{
+ "api-version": APIVersion,
+ }
+
+ preparer := autorest.CreatePreparer(
+ autorest.AsGet(),
+ autorest.WithBaseURL(client.BaseURI),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/capacityPools/{poolName}/volumes/{volumeName}", pathParameters),
+ autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare((&http.Request{}).WithContext(ctx))
+}
+
+// GetSender sends the Get request. The method will close the
+// http.Response Body if it receives an error.
+func (client VolumesClient) GetSender(req *http.Request) (*http.Response, error) {
+ return client.Send(req, azure.DoRetryWithRegistration(client.Client))
+}
+
+// GetResponder handles the response to the Get request. The method always
+// closes the http.Response Body.
+func (client VolumesClient) GetResponder(resp *http.Response) (result Volume, err error) {
+ err = autorest.Respond(
+ resp,
+ azure.WithErrorUnlessStatusCode(http.StatusOK),
+ autorest.ByUnmarshallingJSON(&result),
+ autorest.ByClosing())
+ result.Response = autorest.Response{Response: resp}
+ return
+}
+
+// List list all volumes within the capacity pool
+// Parameters:
+// resourceGroupName - the name of the resource group.
+// accountName - the name of the NetApp account
+// poolName - the name of the capacity pool
+func (client VolumesClient) List(ctx context.Context, resourceGroupName string, accountName string, poolName string) (result VolumeListPage, err error) {
+ if tracing.IsEnabled() {
+ ctx = tracing.StartSpan(ctx, fqdn+"/VolumesClient.List")
+ defer func() {
+ sc := -1
+ if result.vl.Response.Response != nil {
+ sc = result.vl.Response.Response.StatusCode
+ }
+ tracing.EndSpan(ctx, sc, err)
+ }()
+ }
+ if err := validation.Validate([]validation.Validation{
+ {TargetValue: resourceGroupName,
+ Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil},
+ {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil},
+ {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}},
+ {TargetValue: poolName,
+ Constraints: []validation.Constraint{{Target: "poolName", Name: validation.MaxLength, Rule: 64, Chain: nil},
+ {Target: "poolName", Name: validation.MinLength, Rule: 1, Chain: nil},
+ {Target: "poolName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9][a-zA-Z0-9\-_]{0,63}$`, Chain: nil}}}}); err != nil {
+ return result, validation.NewError("netapp.VolumesClient", "List", err.Error())
+ }
+
+ result.fn = client.listNextResults
+ req, err := client.ListPreparer(ctx, resourceGroupName, accountName, poolName)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "netapp.VolumesClient", "List", nil, "Failure preparing request")
+ return
+ }
+
+ resp, err := client.ListSender(req)
+ if err != nil {
+ result.vl.Response = autorest.Response{Response: resp}
+ err = autorest.NewErrorWithError(err, "netapp.VolumesClient", "List", resp, "Failure sending request")
+ return
+ }
+
+ result.vl, err = client.ListResponder(resp)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "netapp.VolumesClient", "List", resp, "Failure responding to request")
+ return
+ }
+ if result.vl.hasNextLink() && result.vl.IsEmpty() {
+ err = result.NextWithContext(ctx)
+ return
+ }
+
+ return
+}
+
+// ListPreparer prepares the List request.
+func (client VolumesClient) ListPreparer(ctx context.Context, resourceGroupName string, accountName string, poolName string) (*http.Request, error) {
+ pathParameters := map[string]interface{}{
+ "accountName": autorest.Encode("path", accountName),
+ "poolName": autorest.Encode("path", poolName),
+ "resourceGroupName": autorest.Encode("path", resourceGroupName),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
+ }
+
+ const APIVersion = "2021-10-01"
+ queryParameters := map[string]interface{}{
+ "api-version": APIVersion,
+ }
+
+ preparer := autorest.CreatePreparer(
+ autorest.AsGet(),
+ autorest.WithBaseURL(client.BaseURI),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/capacityPools/{poolName}/volumes", pathParameters),
+ autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare((&http.Request{}).WithContext(ctx))
+}
+
+// ListSender sends the List request. The method will close the
+// http.Response Body if it receives an error.
+func (client VolumesClient) ListSender(req *http.Request) (*http.Response, error) {
+ return client.Send(req, azure.DoRetryWithRegistration(client.Client))
+}
+
+// ListResponder handles the response to the List request. The method always
+// closes the http.Response Body.
+func (client VolumesClient) ListResponder(resp *http.Response) (result VolumeList, err error) {
+ err = autorest.Respond(
+ resp,
+ azure.WithErrorUnlessStatusCode(http.StatusOK),
+ autorest.ByUnmarshallingJSON(&result),
+ autorest.ByClosing())
+ result.Response = autorest.Response{Response: resp}
+ return
+}
+
+// listNextResults retrieves the next set of results, if any.
+func (client VolumesClient) listNextResults(ctx context.Context, lastResults VolumeList) (result VolumeList, err error) {
+ req, err := lastResults.volumeListPreparer(ctx)
+ if err != nil {
+ return result, autorest.NewErrorWithError(err, "netapp.VolumesClient", "listNextResults", nil, "Failure preparing next results request")
+ }
+ if req == nil {
+ return
+ }
+ resp, err := client.ListSender(req)
+ if err != nil {
+ result.Response = autorest.Response{Response: resp}
+ return result, autorest.NewErrorWithError(err, "netapp.VolumesClient", "listNextResults", resp, "Failure sending next results request")
+ }
+ result, err = client.ListResponder(resp)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "netapp.VolumesClient", "listNextResults", resp, "Failure responding to next results request")
+ }
+ return
+}
+
+// ListComplete enumerates all values, automatically crossing page boundaries as required.
+func (client VolumesClient) ListComplete(ctx context.Context, resourceGroupName string, accountName string, poolName string) (result VolumeListIterator, err error) {
+ if tracing.IsEnabled() {
+ ctx = tracing.StartSpan(ctx, fqdn+"/VolumesClient.List")
+ defer func() {
+ sc := -1
+ if result.Response().Response.Response != nil {
+ sc = result.page.Response().Response.Response.StatusCode
+ }
+ tracing.EndSpan(ctx, sc, err)
+ }()
+ }
+ result.page, err = client.List(ctx, resourceGroupName, accountName, poolName)
+ return
+}
+
+// PoolChange moves volume to another pool
+// Parameters:
+// resourceGroupName - the name of the resource group.
+// accountName - the name of the NetApp account
+// poolName - the name of the capacity pool
+// volumeName - the name of the volume
+// body - move volume to the pool supplied in the body of the operation.
+func (client VolumesClient) PoolChange(ctx context.Context, resourceGroupName string, accountName string, poolName string, volumeName string, body PoolChangeRequest) (result VolumesPoolChangeFuture, err error) {
+ if tracing.IsEnabled() {
+ ctx = tracing.StartSpan(ctx, fqdn+"/VolumesClient.PoolChange")
+ defer func() {
+ sc := -1
+ if result.FutureAPI != nil && result.FutureAPI.Response() != nil {
+ sc = result.FutureAPI.Response().StatusCode
+ }
+ tracing.EndSpan(ctx, sc, err)
+ }()
+ }
+ if err := validation.Validate([]validation.Validation{
+ {TargetValue: resourceGroupName,
+ Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil},
+ {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil},
+ {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}},
+ {TargetValue: poolName,
+ Constraints: []validation.Constraint{{Target: "poolName", Name: validation.MaxLength, Rule: 64, Chain: nil},
+ {Target: "poolName", Name: validation.MinLength, Rule: 1, Chain: nil},
+ {Target: "poolName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9][a-zA-Z0-9\-_]{0,63}$`, Chain: nil}}},
+ {TargetValue: volumeName,
+ Constraints: []validation.Constraint{{Target: "volumeName", Name: validation.MaxLength, Rule: 64, Chain: nil},
+ {Target: "volumeName", Name: validation.MinLength, Rule: 1, Chain: nil},
+ {Target: "volumeName", Name: validation.Pattern, Rule: `^[a-zA-Z][a-zA-Z0-9\-_]{0,63}$`, Chain: nil}}},
+ {TargetValue: body,
+ Constraints: []validation.Constraint{{Target: "body.NewPoolResourceID", Name: validation.Null, Rule: true, Chain: nil}}}}); err != nil {
+ return result, validation.NewError("netapp.VolumesClient", "PoolChange", err.Error())
+ }
+
+ req, err := client.PoolChangePreparer(ctx, resourceGroupName, accountName, poolName, volumeName, body)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "netapp.VolumesClient", "PoolChange", nil, "Failure preparing request")
+ return
+ }
+
+ result, err = client.PoolChangeSender(req)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "netapp.VolumesClient", "PoolChange", result.Response(), "Failure sending request")
+ return
+ }
+
+ return
+}
+
+// PoolChangePreparer prepares the PoolChange request.
+func (client VolumesClient) PoolChangePreparer(ctx context.Context, resourceGroupName string, accountName string, poolName string, volumeName string, body PoolChangeRequest) (*http.Request, error) {
+ pathParameters := map[string]interface{}{
+ "accountName": autorest.Encode("path", accountName),
+ "poolName": autorest.Encode("path", poolName),
+ "resourceGroupName": autorest.Encode("path", resourceGroupName),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
+ "volumeName": autorest.Encode("path", volumeName),
+ }
+
+ const APIVersion = "2021-10-01"
+ queryParameters := map[string]interface{}{
+ "api-version": APIVersion,
+ }
+
+ preparer := autorest.CreatePreparer(
+ autorest.AsContentType("application/json; charset=utf-8"),
+ autorest.AsPost(),
+ autorest.WithBaseURL(client.BaseURI),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/capacityPools/{poolName}/volumes/{volumeName}/poolChange", pathParameters),
+ autorest.WithJSON(body),
+ autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare((&http.Request{}).WithContext(ctx))
+}
+
+// PoolChangeSender sends the PoolChange request. The method will close the
+// http.Response Body if it receives an error.
+func (client VolumesClient) PoolChangeSender(req *http.Request) (future VolumesPoolChangeFuture, err error) {
+ var resp *http.Response
+ future.FutureAPI = &azure.Future{}
+ resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client))
+ if err != nil {
+ return
+ }
+ var azf azure.Future
+ azf, err = azure.NewFutureFromResponse(resp)
+ future.FutureAPI = &azf
+ future.Result = future.result
+ return
+}
+
+// PoolChangeResponder handles the response to the PoolChange request. The method always
+// closes the http.Response Body.
+func (client VolumesClient) PoolChangeResponder(resp *http.Response) (result autorest.Response, err error) {
+ err = autorest.Respond(
+ resp,
+ azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted),
+ autorest.ByClosing())
+ result.Response = resp
+ return
+}
+
+// ReInitializeReplication re-Initializes the replication connection on the destination volume
+// Parameters:
+// resourceGroupName - the name of the resource group.
+// accountName - the name of the NetApp account
+// poolName - the name of the capacity pool
+// volumeName - the name of the volume
+func (client VolumesClient) ReInitializeReplication(ctx context.Context, resourceGroupName string, accountName string, poolName string, volumeName string) (result VolumesReInitializeReplicationFuture, err error) {
+ if tracing.IsEnabled() {
+ ctx = tracing.StartSpan(ctx, fqdn+"/VolumesClient.ReInitializeReplication")
+ defer func() {
+ sc := -1
+ if result.FutureAPI != nil && result.FutureAPI.Response() != nil {
+ sc = result.FutureAPI.Response().StatusCode
+ }
+ tracing.EndSpan(ctx, sc, err)
+ }()
+ }
+ if err := validation.Validate([]validation.Validation{
+ {TargetValue: resourceGroupName,
+ Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil},
+ {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil},
+ {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}},
+ {TargetValue: poolName,
+ Constraints: []validation.Constraint{{Target: "poolName", Name: validation.MaxLength, Rule: 64, Chain: nil},
+ {Target: "poolName", Name: validation.MinLength, Rule: 1, Chain: nil},
+ {Target: "poolName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9][a-zA-Z0-9\-_]{0,63}$`, Chain: nil}}},
+ {TargetValue: volumeName,
+ Constraints: []validation.Constraint{{Target: "volumeName", Name: validation.MaxLength, Rule: 64, Chain: nil},
+ {Target: "volumeName", Name: validation.MinLength, Rule: 1, Chain: nil},
+ {Target: "volumeName", Name: validation.Pattern, Rule: `^[a-zA-Z][a-zA-Z0-9\-_]{0,63}$`, Chain: nil}}}}); err != nil {
+ return result, validation.NewError("netapp.VolumesClient", "ReInitializeReplication", err.Error())
+ }
+
+ req, err := client.ReInitializeReplicationPreparer(ctx, resourceGroupName, accountName, poolName, volumeName)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "netapp.VolumesClient", "ReInitializeReplication", nil, "Failure preparing request")
+ return
+ }
+
+ result, err = client.ReInitializeReplicationSender(req)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "netapp.VolumesClient", "ReInitializeReplication", result.Response(), "Failure sending request")
+ return
+ }
+
+ return
+}
+
+// ReInitializeReplicationPreparer prepares the ReInitializeReplication request.
+func (client VolumesClient) ReInitializeReplicationPreparer(ctx context.Context, resourceGroupName string, accountName string, poolName string, volumeName string) (*http.Request, error) {
+ pathParameters := map[string]interface{}{
+ "accountName": autorest.Encode("path", accountName),
+ "poolName": autorest.Encode("path", poolName),
+ "resourceGroupName": autorest.Encode("path", resourceGroupName),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
+ "volumeName": autorest.Encode("path", volumeName),
+ }
+
+ const APIVersion = "2021-10-01"
+ queryParameters := map[string]interface{}{
+ "api-version": APIVersion,
+ }
+
+ preparer := autorest.CreatePreparer(
+ autorest.AsPost(),
+ autorest.WithBaseURL(client.BaseURI),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/capacityPools/{poolName}/volumes/{volumeName}/reinitializeReplication", pathParameters),
+ autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare((&http.Request{}).WithContext(ctx))
+}
+
+// ReInitializeReplicationSender sends the ReInitializeReplication request. The method will close the
+// http.Response Body if it receives an error.
+func (client VolumesClient) ReInitializeReplicationSender(req *http.Request) (future VolumesReInitializeReplicationFuture, err error) {
+ var resp *http.Response
+ future.FutureAPI = &azure.Future{}
+ resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client))
+ if err != nil {
+ return
+ }
+ var azf azure.Future
+ azf, err = azure.NewFutureFromResponse(resp)
+ future.FutureAPI = &azf
+ future.Result = future.result
+ return
+}
+
+// ReInitializeReplicationResponder handles the response to the ReInitializeReplication request. The method always
+// closes the http.Response Body.
+func (client VolumesClient) ReInitializeReplicationResponder(resp *http.Response) (result autorest.Response, err error) {
+ err = autorest.Respond(
+ resp,
+ azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted),
+ autorest.ByClosing())
+ result.Response = resp
+ return
+}
+
+// ReplicationStatusMethod get the status of the replication
+// Parameters:
+// resourceGroupName - the name of the resource group.
+// accountName - the name of the NetApp account
+// poolName - the name of the capacity pool
+// volumeName - the name of the volume
+func (client VolumesClient) ReplicationStatusMethod(ctx context.Context, resourceGroupName string, accountName string, poolName string, volumeName string) (result ReplicationStatus, err error) {
+ if tracing.IsEnabled() {
+ ctx = tracing.StartSpan(ctx, fqdn+"/VolumesClient.ReplicationStatusMethod")
+ defer func() {
+ sc := -1
+ if result.Response.Response != nil {
+ sc = result.Response.Response.StatusCode
+ }
+ tracing.EndSpan(ctx, sc, err)
+ }()
+ }
+ if err := validation.Validate([]validation.Validation{
+ {TargetValue: resourceGroupName,
+ Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil},
+ {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil},
+ {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}},
+ {TargetValue: poolName,
+ Constraints: []validation.Constraint{{Target: "poolName", Name: validation.MaxLength, Rule: 64, Chain: nil},
+ {Target: "poolName", Name: validation.MinLength, Rule: 1, Chain: nil},
+ {Target: "poolName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9][a-zA-Z0-9\-_]{0,63}$`, Chain: nil}}},
+ {TargetValue: volumeName,
+ Constraints: []validation.Constraint{{Target: "volumeName", Name: validation.MaxLength, Rule: 64, Chain: nil},
+ {Target: "volumeName", Name: validation.MinLength, Rule: 1, Chain: nil},
+ {Target: "volumeName", Name: validation.Pattern, Rule: `^[a-zA-Z][a-zA-Z0-9\-_]{0,63}$`, Chain: nil}}}}); err != nil {
+ return result, validation.NewError("netapp.VolumesClient", "ReplicationStatusMethod", err.Error())
+ }
+
+ req, err := client.ReplicationStatusMethodPreparer(ctx, resourceGroupName, accountName, poolName, volumeName)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "netapp.VolumesClient", "ReplicationStatusMethod", nil, "Failure preparing request")
+ return
+ }
+
+ resp, err := client.ReplicationStatusMethodSender(req)
+ if err != nil {
+ result.Response = autorest.Response{Response: resp}
+ err = autorest.NewErrorWithError(err, "netapp.VolumesClient", "ReplicationStatusMethod", resp, "Failure sending request")
+ return
+ }
+
+ result, err = client.ReplicationStatusMethodResponder(resp)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "netapp.VolumesClient", "ReplicationStatusMethod", resp, "Failure responding to request")
+ return
+ }
+
+ return
+}
+
+// ReplicationStatusMethodPreparer prepares the ReplicationStatusMethod request.
+func (client VolumesClient) ReplicationStatusMethodPreparer(ctx context.Context, resourceGroupName string, accountName string, poolName string, volumeName string) (*http.Request, error) {
+ pathParameters := map[string]interface{}{
+ "accountName": autorest.Encode("path", accountName),
+ "poolName": autorest.Encode("path", poolName),
+ "resourceGroupName": autorest.Encode("path", resourceGroupName),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
+ "volumeName": autorest.Encode("path", volumeName),
+ }
+
+ const APIVersion = "2021-10-01"
+ queryParameters := map[string]interface{}{
+ "api-version": APIVersion,
+ }
+
+ preparer := autorest.CreatePreparer(
+ autorest.AsGet(),
+ autorest.WithBaseURL(client.BaseURI),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/capacityPools/{poolName}/volumes/{volumeName}/replicationStatus", pathParameters),
+ autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare((&http.Request{}).WithContext(ctx))
+}
+
+// ReplicationStatusMethodSender sends the ReplicationStatusMethod request. The method will close the
+// http.Response Body if it receives an error.
+func (client VolumesClient) ReplicationStatusMethodSender(req *http.Request) (*http.Response, error) {
+ return client.Send(req, azure.DoRetryWithRegistration(client.Client))
+}
+
+// ReplicationStatusMethodResponder handles the response to the ReplicationStatusMethod request. The method always
+// closes the http.Response Body.
+func (client VolumesClient) ReplicationStatusMethodResponder(resp *http.Response) (result ReplicationStatus, err error) {
+ err = autorest.Respond(
+ resp,
+ azure.WithErrorUnlessStatusCode(http.StatusOK),
+ autorest.ByUnmarshallingJSON(&result),
+ autorest.ByClosing())
+ result.Response = autorest.Response{Response: resp}
+ return
+}
+
+// ResyncReplication resync the connection on the destination volume. If the operation is ran on the source volume it
+// will reverse-resync the connection and sync from destination to source.
+// Parameters:
+// resourceGroupName - the name of the resource group.
+// accountName - the name of the NetApp account
+// poolName - the name of the capacity pool
+// volumeName - the name of the volume
+func (client VolumesClient) ResyncReplication(ctx context.Context, resourceGroupName string, accountName string, poolName string, volumeName string) (result VolumesResyncReplicationFuture, err error) {
+ if tracing.IsEnabled() {
+ ctx = tracing.StartSpan(ctx, fqdn+"/VolumesClient.ResyncReplication")
+ defer func() {
+ sc := -1
+ if result.FutureAPI != nil && result.FutureAPI.Response() != nil {
+ sc = result.FutureAPI.Response().StatusCode
+ }
+ tracing.EndSpan(ctx, sc, err)
+ }()
+ }
+ if err := validation.Validate([]validation.Validation{
+ {TargetValue: resourceGroupName,
+ Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil},
+ {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil},
+ {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}},
+ {TargetValue: poolName,
+ Constraints: []validation.Constraint{{Target: "poolName", Name: validation.MaxLength, Rule: 64, Chain: nil},
+ {Target: "poolName", Name: validation.MinLength, Rule: 1, Chain: nil},
+ {Target: "poolName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9][a-zA-Z0-9\-_]{0,63}$`, Chain: nil}}},
+ {TargetValue: volumeName,
+ Constraints: []validation.Constraint{{Target: "volumeName", Name: validation.MaxLength, Rule: 64, Chain: nil},
+ {Target: "volumeName", Name: validation.MinLength, Rule: 1, Chain: nil},
+ {Target: "volumeName", Name: validation.Pattern, Rule: `^[a-zA-Z][a-zA-Z0-9\-_]{0,63}$`, Chain: nil}}}}); err != nil {
+ return result, validation.NewError("netapp.VolumesClient", "ResyncReplication", err.Error())
+ }
+
+ req, err := client.ResyncReplicationPreparer(ctx, resourceGroupName, accountName, poolName, volumeName)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "netapp.VolumesClient", "ResyncReplication", nil, "Failure preparing request")
+ return
+ }
+
+ result, err = client.ResyncReplicationSender(req)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "netapp.VolumesClient", "ResyncReplication", result.Response(), "Failure sending request")
+ return
+ }
+
+ return
+}
+
+// ResyncReplicationPreparer prepares the ResyncReplication request.
+func (client VolumesClient) ResyncReplicationPreparer(ctx context.Context, resourceGroupName string, accountName string, poolName string, volumeName string) (*http.Request, error) {
+ pathParameters := map[string]interface{}{
+ "accountName": autorest.Encode("path", accountName),
+ "poolName": autorest.Encode("path", poolName),
+ "resourceGroupName": autorest.Encode("path", resourceGroupName),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
+ "volumeName": autorest.Encode("path", volumeName),
+ }
+
+ const APIVersion = "2021-10-01"
+ queryParameters := map[string]interface{}{
+ "api-version": APIVersion,
+ }
+
+ preparer := autorest.CreatePreparer(
+ autorest.AsPost(),
+ autorest.WithBaseURL(client.BaseURI),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/capacityPools/{poolName}/volumes/{volumeName}/resyncReplication", pathParameters),
+ autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare((&http.Request{}).WithContext(ctx))
+}
+
+// ResyncReplicationSender sends the ResyncReplication request. The method will close the
+// http.Response Body if it receives an error.
+func (client VolumesClient) ResyncReplicationSender(req *http.Request) (future VolumesResyncReplicationFuture, err error) {
+ var resp *http.Response
+ future.FutureAPI = &azure.Future{}
+ resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client))
+ if err != nil {
+ return
+ }
+ var azf azure.Future
+ azf, err = azure.NewFutureFromResponse(resp)
+ future.FutureAPI = &azf
+ future.Result = future.result
+ return
+}
+
+// ResyncReplicationResponder handles the response to the ResyncReplication request. The method always
+// closes the http.Response Body.
+func (client VolumesClient) ResyncReplicationResponder(resp *http.Response) (result autorest.Response, err error) {
+ err = autorest.Respond(
+ resp,
+ azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted),
+ autorest.ByClosing())
+ result.Response = resp
+ return
+}
+
+// Revert revert a volume to the snapshot specified in the body
+// Parameters:
+// resourceGroupName - the name of the resource group.
+// accountName - the name of the NetApp account
+// poolName - the name of the capacity pool
+// volumeName - the name of the volume
+// body - object for snapshot to revert supplied in the body of the operation.
+func (client VolumesClient) Revert(ctx context.Context, resourceGroupName string, accountName string, poolName string, volumeName string, body VolumeRevert) (result VolumesRevertFuture, err error) {
+ if tracing.IsEnabled() {
+ ctx = tracing.StartSpan(ctx, fqdn+"/VolumesClient.Revert")
+ defer func() {
+ sc := -1
+ if result.FutureAPI != nil && result.FutureAPI.Response() != nil {
+ sc = result.FutureAPI.Response().StatusCode
+ }
+ tracing.EndSpan(ctx, sc, err)
+ }()
+ }
+ if err := validation.Validate([]validation.Validation{
+ {TargetValue: resourceGroupName,
+ Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil},
+ {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil},
+ {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}},
+ {TargetValue: poolName,
+ Constraints: []validation.Constraint{{Target: "poolName", Name: validation.MaxLength, Rule: 64, Chain: nil},
+ {Target: "poolName", Name: validation.MinLength, Rule: 1, Chain: nil},
+ {Target: "poolName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9][a-zA-Z0-9\-_]{0,63}$`, Chain: nil}}},
+ {TargetValue: volumeName,
+ Constraints: []validation.Constraint{{Target: "volumeName", Name: validation.MaxLength, Rule: 64, Chain: nil},
+ {Target: "volumeName", Name: validation.MinLength, Rule: 1, Chain: nil},
+ {Target: "volumeName", Name: validation.Pattern, Rule: `^[a-zA-Z][a-zA-Z0-9\-_]{0,63}$`, Chain: nil}}}}); err != nil {
+ return result, validation.NewError("netapp.VolumesClient", "Revert", err.Error())
+ }
+
+ req, err := client.RevertPreparer(ctx, resourceGroupName, accountName, poolName, volumeName, body)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "netapp.VolumesClient", "Revert", nil, "Failure preparing request")
+ return
+ }
+
+ result, err = client.RevertSender(req)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "netapp.VolumesClient", "Revert", result.Response(), "Failure sending request")
+ return
+ }
+
+ return
+}
+
+// RevertPreparer prepares the Revert request.
+func (client VolumesClient) RevertPreparer(ctx context.Context, resourceGroupName string, accountName string, poolName string, volumeName string, body VolumeRevert) (*http.Request, error) {
+ pathParameters := map[string]interface{}{
+ "accountName": autorest.Encode("path", accountName),
+ "poolName": autorest.Encode("path", poolName),
+ "resourceGroupName": autorest.Encode("path", resourceGroupName),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
+ "volumeName": autorest.Encode("path", volumeName),
+ }
+
+ const APIVersion = "2021-10-01"
+ queryParameters := map[string]interface{}{
+ "api-version": APIVersion,
+ }
+
+ preparer := autorest.CreatePreparer(
+ autorest.AsContentType("application/json; charset=utf-8"),
+ autorest.AsPost(),
+ autorest.WithBaseURL(client.BaseURI),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/capacityPools/{poolName}/volumes/{volumeName}/revert", pathParameters),
+ autorest.WithJSON(body),
+ autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare((&http.Request{}).WithContext(ctx))
+}
+
+// RevertSender sends the Revert request. The method will close the
+// http.Response Body if it receives an error.
+func (client VolumesClient) RevertSender(req *http.Request) (future VolumesRevertFuture, err error) {
+ var resp *http.Response
+ future.FutureAPI = &azure.Future{}
+ resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client))
+ if err != nil {
+ return
+ }
+ var azf azure.Future
+ azf, err = azure.NewFutureFromResponse(resp)
+ future.FutureAPI = &azf
+ future.Result = future.result
+ return
+}
+
+// RevertResponder handles the response to the Revert request. The method always
+// closes the http.Response Body.
+func (client VolumesClient) RevertResponder(resp *http.Response) (result autorest.Response, err error) {
+ err = autorest.Respond(
+ resp,
+ azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted),
+ autorest.ByClosing())
+ result.Response = resp
+ return
+}
+
+// Update patch the specified volume
+// Parameters:
+// body - volume object supplied in the body of the operation.
+// resourceGroupName - the name of the resource group.
+// accountName - the name of the NetApp account
+// poolName - the name of the capacity pool
+// volumeName - the name of the volume
+func (client VolumesClient) Update(ctx context.Context, body VolumePatch, resourceGroupName string, accountName string, poolName string, volumeName string) (result VolumesUpdateFuture, err error) {
+ if tracing.IsEnabled() {
+ ctx = tracing.StartSpan(ctx, fqdn+"/VolumesClient.Update")
+ defer func() {
+ sc := -1
+ if result.FutureAPI != nil && result.FutureAPI.Response() != nil {
+ sc = result.FutureAPI.Response().StatusCode
+ }
+ tracing.EndSpan(ctx, sc, err)
+ }()
+ }
+ if err := validation.Validate([]validation.Validation{
+ {TargetValue: resourceGroupName,
+ Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil},
+ {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil},
+ {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}},
+ {TargetValue: poolName,
+ Constraints: []validation.Constraint{{Target: "poolName", Name: validation.MaxLength, Rule: 64, Chain: nil},
+ {Target: "poolName", Name: validation.MinLength, Rule: 1, Chain: nil},
+ {Target: "poolName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9][a-zA-Z0-9\-_]{0,63}$`, Chain: nil}}},
+ {TargetValue: volumeName,
+ Constraints: []validation.Constraint{{Target: "volumeName", Name: validation.MaxLength, Rule: 64, Chain: nil},
+ {Target: "volumeName", Name: validation.MinLength, Rule: 1, Chain: nil},
+ {Target: "volumeName", Name: validation.Pattern, Rule: `^[a-zA-Z][a-zA-Z0-9\-_]{0,63}$`, Chain: nil}}}}); err != nil {
+ return result, validation.NewError("netapp.VolumesClient", "Update", err.Error())
+ }
+
+ req, err := client.UpdatePreparer(ctx, body, resourceGroupName, accountName, poolName, volumeName)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "netapp.VolumesClient", "Update", nil, "Failure preparing request")
+ return
+ }
+
+ result, err = client.UpdateSender(req)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "netapp.VolumesClient", "Update", result.Response(), "Failure sending request")
+ return
+ }
+
+ return
+}
+
+// UpdatePreparer prepares the Update request.
+func (client VolumesClient) UpdatePreparer(ctx context.Context, body VolumePatch, resourceGroupName string, accountName string, poolName string, volumeName string) (*http.Request, error) {
+ pathParameters := map[string]interface{}{
+ "accountName": autorest.Encode("path", accountName),
+ "poolName": autorest.Encode("path", poolName),
+ "resourceGroupName": autorest.Encode("path", resourceGroupName),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
+ "volumeName": autorest.Encode("path", volumeName),
+ }
+
+ const APIVersion = "2021-10-01"
+ queryParameters := map[string]interface{}{
+ "api-version": APIVersion,
+ }
+
+ body.ID = nil
+ body.Name = nil
+ body.Type = nil
+ preparer := autorest.CreatePreparer(
+ autorest.AsContentType("application/json; charset=utf-8"),
+ autorest.AsPatch(),
+ autorest.WithBaseURL(client.BaseURI),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/capacityPools/{poolName}/volumes/{volumeName}", pathParameters),
+ autorest.WithJSON(body),
+ autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare((&http.Request{}).WithContext(ctx))
+}
+
+// UpdateSender sends the Update request. The method will close the
+// http.Response Body if it receives an error.
+func (client VolumesClient) UpdateSender(req *http.Request) (future VolumesUpdateFuture, err error) {
+ var resp *http.Response
+ future.FutureAPI = &azure.Future{}
+ resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client))
+ if err != nil {
+ return
+ }
+ var azf azure.Future
+ azf, err = azure.NewFutureFromResponse(resp)
+ future.FutureAPI = &azf
+ future.Result = future.result
+ return
+}
+
+// UpdateResponder handles the response to the Update request. The method always
+// closes the http.Response Body.
+func (client VolumesClient) UpdateResponder(resp *http.Response) (result Volume, err error) {
+ err = autorest.Respond(
+ resp,
+ azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted),
+ autorest.ByUnmarshallingJSON(&result),
+ autorest.ByClosing())
+ result.Response = autorest.Response{Response: resp}
+ return
+}
diff --git a/services/preview/netapp/mgmt/2017-08-15/netapp/CHANGELOG.md b/services/preview/netapp/mgmt/2017-08-15/netapp/CHANGELOG.md
index 52911e4cc5e4..a1ecf841edb0 100644
--- a/services/preview/netapp/mgmt/2017-08-15/netapp/CHANGELOG.md
+++ b/services/preview/netapp/mgmt/2017-08-15/netapp/CHANGELOG.md
@@ -1,2 +1,2 @@
-# Change History
+# Unreleased
diff --git a/services/preview/netapp/mgmt/2017-08-15/netapp/_meta.json b/services/preview/netapp/mgmt/2017-08-15/netapp/_meta.json
index 24ef7f1766bf..6c7f4f7ea636 100644
--- a/services/preview/netapp/mgmt/2017-08-15/netapp/_meta.json
+++ b/services/preview/netapp/mgmt/2017-08-15/netapp/_meta.json
@@ -1,5 +1,5 @@
{
- "commit": "3c764635e7d442b3e74caf593029fcd440b3ef82",
+ "commit": "ed4b29fbceaea3cc48f039826db5a92360bc7c56",
"readme": "/_/azure-rest-api-specs/specification/netapp/resource-manager/readme.md",
"tag": "package-2017-08-15",
"use": "@microsoft.azure/autorest.go@2.1.187",
diff --git a/services/preview/netapp/mgmt/2017-08-15/netapp/accounts.go b/services/preview/netapp/mgmt/2017-08-15/netapp/accounts.go
index f1212139c005..08db2dc76ba2 100644
--- a/services/preview/netapp/mgmt/2017-08-15/netapp/accounts.go
+++ b/services/preview/netapp/mgmt/2017-08-15/netapp/accounts.go
@@ -15,7 +15,7 @@ import (
"net/http"
)
-// AccountsClient is the microsoft NetApp Azure Resource Provider specification
+// AccountsClient is the microsoft NetApp Files Azure Resource Provider specification
type AccountsClient struct {
BaseClient
}
diff --git a/services/preview/netapp/mgmt/2017-08-15/netapp/client.go b/services/preview/netapp/mgmt/2017-08-15/netapp/client.go
index 135b0fc1ab9a..3779c7ff4094 100644
--- a/services/preview/netapp/mgmt/2017-08-15/netapp/client.go
+++ b/services/preview/netapp/mgmt/2017-08-15/netapp/client.go
@@ -1,6 +1,6 @@
// Package netapp implements the Azure ARM Netapp service API version 2017-08-15.
//
-// Microsoft NetApp Azure Resource Provider specification
+// Microsoft NetApp Files Azure Resource Provider specification
package netapp
// Copyright (c) Microsoft Corporation. All rights reserved.
diff --git a/services/preview/netapp/mgmt/2017-08-15/netapp/mounttargets.go b/services/preview/netapp/mgmt/2017-08-15/netapp/mounttargets.go
index bee25660f666..25273b2bb870 100644
--- a/services/preview/netapp/mgmt/2017-08-15/netapp/mounttargets.go
+++ b/services/preview/netapp/mgmt/2017-08-15/netapp/mounttargets.go
@@ -15,7 +15,7 @@ import (
"net/http"
)
-// MountTargetsClient is the microsoft NetApp Azure Resource Provider specification
+// MountTargetsClient is the microsoft NetApp Files Azure Resource Provider specification
type MountTargetsClient struct {
BaseClient
}
diff --git a/services/preview/netapp/mgmt/2017-08-15/netapp/operations.go b/services/preview/netapp/mgmt/2017-08-15/netapp/operations.go
index 0533df425804..d4c39393921e 100644
--- a/services/preview/netapp/mgmt/2017-08-15/netapp/operations.go
+++ b/services/preview/netapp/mgmt/2017-08-15/netapp/operations.go
@@ -14,7 +14,7 @@ import (
"net/http"
)
-// OperationsClient is the microsoft NetApp Azure Resource Provider specification
+// OperationsClient is the microsoft NetApp Files Azure Resource Provider specification
type OperationsClient struct {
BaseClient
}
diff --git a/services/preview/netapp/mgmt/2017-08-15/netapp/pools.go b/services/preview/netapp/mgmt/2017-08-15/netapp/pools.go
index 98d0bea55714..703d18ff310a 100644
--- a/services/preview/netapp/mgmt/2017-08-15/netapp/pools.go
+++ b/services/preview/netapp/mgmt/2017-08-15/netapp/pools.go
@@ -15,7 +15,7 @@ import (
"net/http"
)
-// PoolsClient is the microsoft NetApp Azure Resource Provider specification
+// PoolsClient is the microsoft NetApp Files Azure Resource Provider specification
type PoolsClient struct {
BaseClient
}
diff --git a/services/preview/netapp/mgmt/2017-08-15/netapp/snapshots.go b/services/preview/netapp/mgmt/2017-08-15/netapp/snapshots.go
index 9b93d6c497a3..f7cf942452bf 100644
--- a/services/preview/netapp/mgmt/2017-08-15/netapp/snapshots.go
+++ b/services/preview/netapp/mgmt/2017-08-15/netapp/snapshots.go
@@ -15,7 +15,7 @@ import (
"net/http"
)
-// SnapshotsClient is the microsoft NetApp Azure Resource Provider specification
+// SnapshotsClient is the microsoft NetApp Files Azure Resource Provider specification
type SnapshotsClient struct {
BaseClient
}
diff --git a/services/preview/netapp/mgmt/2017-08-15/netapp/volumes.go b/services/preview/netapp/mgmt/2017-08-15/netapp/volumes.go
index 68547fa4cb78..949f6a366cb0 100644
--- a/services/preview/netapp/mgmt/2017-08-15/netapp/volumes.go
+++ b/services/preview/netapp/mgmt/2017-08-15/netapp/volumes.go
@@ -15,7 +15,7 @@ import (
"net/http"
)
-// VolumesClient is the microsoft NetApp Azure Resource Provider specification
+// VolumesClient is the microsoft NetApp Files Azure Resource Provider specification
type VolumesClient struct {
BaseClient
}
diff --git a/services/preview/netapp/mgmt/2021-04-01-preview/netapp/CHANGELOG.md b/services/preview/netapp/mgmt/2021-04-01-preview/netapp/CHANGELOG.md
new file mode 100644
index 000000000000..a1ecf841edb0
--- /dev/null
+++ b/services/preview/netapp/mgmt/2021-04-01-preview/netapp/CHANGELOG.md
@@ -0,0 +1,2 @@
+# Unreleased
+
diff --git a/services/preview/netapp/mgmt/2021-04-01-preview/netapp/_meta.json b/services/preview/netapp/mgmt/2021-04-01-preview/netapp/_meta.json
new file mode 100644
index 000000000000..32f55c262d21
--- /dev/null
+++ b/services/preview/netapp/mgmt/2021-04-01-preview/netapp/_meta.json
@@ -0,0 +1,11 @@
+{
+ "commit": "ed4b29fbceaea3cc48f039826db5a92360bc7c56",
+ "readme": "/_/azure-rest-api-specs/specification/netapp/resource-manager/readme.md",
+ "tag": "package-netapp-2021-04-01-preview",
+ "use": "@microsoft.azure/autorest.go@2.1.187",
+ "repository_url": "https://github.com/Azure/azure-rest-api-specs.git",
+ "autorest_command": "autorest --use=@microsoft.azure/autorest.go@2.1.187 --tag=package-netapp-2021-04-01-preview --go-sdk-folder=/_/azure-sdk-for-go --go --verbose --use-onever --version=2.0.4421 --go.license-header=MICROSOFT_MIT_NO_VERSION /_/azure-rest-api-specs/specification/netapp/resource-manager/readme.md",
+ "additional_properties": {
+ "additional_options": "--go --verbose --use-onever --version=2.0.4421 --go.license-header=MICROSOFT_MIT_NO_VERSION"
+ }
+}
\ No newline at end of file
diff --git a/services/preview/netapp/mgmt/2021-04-01-preview/netapp/accountbackups.go b/services/preview/netapp/mgmt/2021-04-01-preview/netapp/accountbackups.go
new file mode 100644
index 000000000000..b28facf17f67
--- /dev/null
+++ b/services/preview/netapp/mgmt/2021-04-01-preview/netapp/accountbackups.go
@@ -0,0 +1,290 @@
+package netapp
+
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License. See License.txt in the project root for license information.
+//
+// Code generated by Microsoft (R) AutoRest Code Generator.
+// Changes may cause incorrect behavior and will be lost if the code is regenerated.
+
+import (
+ "context"
+ "github.com/Azure/go-autorest/autorest"
+ "github.com/Azure/go-autorest/autorest/azure"
+ "github.com/Azure/go-autorest/autorest/validation"
+ "github.com/Azure/go-autorest/tracing"
+ "net/http"
+)
+
+// AccountBackupsClient is the microsoft NetApp Files Azure Resource Provider specification
+type AccountBackupsClient struct {
+ BaseClient
+}
+
+// NewAccountBackupsClient creates an instance of the AccountBackupsClient client.
+func NewAccountBackupsClient(subscriptionID string) AccountBackupsClient {
+ return NewAccountBackupsClientWithBaseURI(DefaultBaseURI, subscriptionID)
+}
+
+// NewAccountBackupsClientWithBaseURI creates an instance of the AccountBackupsClient client using a custom endpoint.
+// Use this when interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure stack).
+func NewAccountBackupsClientWithBaseURI(baseURI string, subscriptionID string) AccountBackupsClient {
+ return AccountBackupsClient{NewWithBaseURI(baseURI, subscriptionID)}
+}
+
+// Delete delete the specified Backup for a Netapp Account
+// Parameters:
+// resourceGroupName - the name of the resource group.
+// accountName - the name of the NetApp account
+// backupName - the name of the backup
+func (client AccountBackupsClient) Delete(ctx context.Context, resourceGroupName string, accountName string, backupName string) (result AccountBackupsDeleteFuture, err error) {
+ if tracing.IsEnabled() {
+ ctx = tracing.StartSpan(ctx, fqdn+"/AccountBackupsClient.Delete")
+ defer func() {
+ sc := -1
+ if result.FutureAPI != nil && result.FutureAPI.Response() != nil {
+ sc = result.FutureAPI.Response().StatusCode
+ }
+ tracing.EndSpan(ctx, sc, err)
+ }()
+ }
+ if err := validation.Validate([]validation.Validation{
+ {TargetValue: resourceGroupName,
+ Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil},
+ {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil},
+ {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}}); err != nil {
+ return result, validation.NewError("netapp.AccountBackupsClient", "Delete", err.Error())
+ }
+
+ req, err := client.DeletePreparer(ctx, resourceGroupName, accountName, backupName)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "netapp.AccountBackupsClient", "Delete", nil, "Failure preparing request")
+ return
+ }
+
+ result, err = client.DeleteSender(req)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "netapp.AccountBackupsClient", "Delete", result.Response(), "Failure sending request")
+ return
+ }
+
+ return
+}
+
+// DeletePreparer prepares the Delete request.
+func (client AccountBackupsClient) DeletePreparer(ctx context.Context, resourceGroupName string, accountName string, backupName string) (*http.Request, error) {
+ pathParameters := map[string]interface{}{
+ "accountName": autorest.Encode("path", accountName),
+ "backupName": autorest.Encode("path", backupName),
+ "resourceGroupName": autorest.Encode("path", resourceGroupName),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
+ }
+
+ const APIVersion = "2021-04-01-preview"
+ queryParameters := map[string]interface{}{
+ "api-version": APIVersion,
+ }
+
+ preparer := autorest.CreatePreparer(
+ autorest.AsDelete(),
+ autorest.WithBaseURL(client.BaseURI),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/accountBackups/{backupName}", pathParameters),
+ autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare((&http.Request{}).WithContext(ctx))
+}
+
+// DeleteSender sends the Delete request. The method will close the
+// http.Response Body if it receives an error.
+func (client AccountBackupsClient) DeleteSender(req *http.Request) (future AccountBackupsDeleteFuture, err error) {
+ var resp *http.Response
+ future.FutureAPI = &azure.Future{}
+ resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client))
+ if err != nil {
+ return
+ }
+ var azf azure.Future
+ azf, err = azure.NewFutureFromResponse(resp)
+ future.FutureAPI = &azf
+ future.Result = future.result
+ return
+}
+
+// DeleteResponder handles the response to the Delete request. The method always
+// closes the http.Response Body.
+func (client AccountBackupsClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) {
+ err = autorest.Respond(
+ resp,
+ azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent),
+ autorest.ByClosing())
+ result.Response = resp
+ return
+}
+
+// Get gets the specified backup for a Netapp Account
+// Parameters:
+// resourceGroupName - the name of the resource group.
+// accountName - the name of the NetApp account
+// backupName - the name of the backup
+func (client AccountBackupsClient) Get(ctx context.Context, resourceGroupName string, accountName string, backupName string) (result Backup, err error) {
+ if tracing.IsEnabled() {
+ ctx = tracing.StartSpan(ctx, fqdn+"/AccountBackupsClient.Get")
+ defer func() {
+ sc := -1
+ if result.Response.Response != nil {
+ sc = result.Response.Response.StatusCode
+ }
+ tracing.EndSpan(ctx, sc, err)
+ }()
+ }
+ if err := validation.Validate([]validation.Validation{
+ {TargetValue: resourceGroupName,
+ Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil},
+ {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil},
+ {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}}); err != nil {
+ return result, validation.NewError("netapp.AccountBackupsClient", "Get", err.Error())
+ }
+
+ req, err := client.GetPreparer(ctx, resourceGroupName, accountName, backupName)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "netapp.AccountBackupsClient", "Get", nil, "Failure preparing request")
+ return
+ }
+
+ resp, err := client.GetSender(req)
+ if err != nil {
+ result.Response = autorest.Response{Response: resp}
+ err = autorest.NewErrorWithError(err, "netapp.AccountBackupsClient", "Get", resp, "Failure sending request")
+ return
+ }
+
+ result, err = client.GetResponder(resp)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "netapp.AccountBackupsClient", "Get", resp, "Failure responding to request")
+ return
+ }
+
+ return
+}
+
+// GetPreparer prepares the Get request.
+func (client AccountBackupsClient) GetPreparer(ctx context.Context, resourceGroupName string, accountName string, backupName string) (*http.Request, error) {
+ pathParameters := map[string]interface{}{
+ "accountName": autorest.Encode("path", accountName),
+ "backupName": autorest.Encode("path", backupName),
+ "resourceGroupName": autorest.Encode("path", resourceGroupName),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
+ }
+
+ const APIVersion = "2021-04-01-preview"
+ queryParameters := map[string]interface{}{
+ "api-version": APIVersion,
+ }
+
+ preparer := autorest.CreatePreparer(
+ autorest.AsGet(),
+ autorest.WithBaseURL(client.BaseURI),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/accountBackups/{backupName}", pathParameters),
+ autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare((&http.Request{}).WithContext(ctx))
+}
+
+// GetSender sends the Get request. The method will close the
+// http.Response Body if it receives an error.
+func (client AccountBackupsClient) GetSender(req *http.Request) (*http.Response, error) {
+ return client.Send(req, azure.DoRetryWithRegistration(client.Client))
+}
+
+// GetResponder handles the response to the Get request. The method always
+// closes the http.Response Body.
+func (client AccountBackupsClient) GetResponder(resp *http.Response) (result Backup, err error) {
+ err = autorest.Respond(
+ resp,
+ azure.WithErrorUnlessStatusCode(http.StatusOK),
+ autorest.ByUnmarshallingJSON(&result),
+ autorest.ByClosing())
+ result.Response = autorest.Response{Response: resp}
+ return
+}
+
+// List list all Backups for a Netapp Account
+// Parameters:
+// resourceGroupName - the name of the resource group.
+// accountName - the name of the NetApp account
+func (client AccountBackupsClient) List(ctx context.Context, resourceGroupName string, accountName string) (result BackupsList, err error) {
+ if tracing.IsEnabled() {
+ ctx = tracing.StartSpan(ctx, fqdn+"/AccountBackupsClient.List")
+ defer func() {
+ sc := -1
+ if result.Response.Response != nil {
+ sc = result.Response.Response.StatusCode
+ }
+ tracing.EndSpan(ctx, sc, err)
+ }()
+ }
+ if err := validation.Validate([]validation.Validation{
+ {TargetValue: resourceGroupName,
+ Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil},
+ {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil},
+ {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}}); err != nil {
+ return result, validation.NewError("netapp.AccountBackupsClient", "List", err.Error())
+ }
+
+ req, err := client.ListPreparer(ctx, resourceGroupName, accountName)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "netapp.AccountBackupsClient", "List", nil, "Failure preparing request")
+ return
+ }
+
+ resp, err := client.ListSender(req)
+ if err != nil {
+ result.Response = autorest.Response{Response: resp}
+ err = autorest.NewErrorWithError(err, "netapp.AccountBackupsClient", "List", resp, "Failure sending request")
+ return
+ }
+
+ result, err = client.ListResponder(resp)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "netapp.AccountBackupsClient", "List", resp, "Failure responding to request")
+ return
+ }
+
+ return
+}
+
+// ListPreparer prepares the List request.
+func (client AccountBackupsClient) ListPreparer(ctx context.Context, resourceGroupName string, accountName string) (*http.Request, error) {
+ pathParameters := map[string]interface{}{
+ "accountName": autorest.Encode("path", accountName),
+ "resourceGroupName": autorest.Encode("path", resourceGroupName),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
+ }
+
+ const APIVersion = "2021-04-01-preview"
+ queryParameters := map[string]interface{}{
+ "api-version": APIVersion,
+ }
+
+ preparer := autorest.CreatePreparer(
+ autorest.AsGet(),
+ autorest.WithBaseURL(client.BaseURI),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/accountBackups", pathParameters),
+ autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare((&http.Request{}).WithContext(ctx))
+}
+
+// ListSender sends the List request. The method will close the
+// http.Response Body if it receives an error.
+func (client AccountBackupsClient) ListSender(req *http.Request) (*http.Response, error) {
+ return client.Send(req, azure.DoRetryWithRegistration(client.Client))
+}
+
+// ListResponder handles the response to the List request. The method always
+// closes the http.Response Body.
+func (client AccountBackupsClient) ListResponder(resp *http.Response) (result BackupsList, err error) {
+ err = autorest.Respond(
+ resp,
+ azure.WithErrorUnlessStatusCode(http.StatusOK),
+ autorest.ByUnmarshallingJSON(&result),
+ autorest.ByClosing())
+ result.Response = autorest.Response{Response: resp}
+ return
+}
diff --git a/services/preview/netapp/mgmt/2021-04-01-preview/netapp/accounts.go b/services/preview/netapp/mgmt/2021-04-01-preview/netapp/accounts.go
new file mode 100644
index 000000000000..0ee68163b57f
--- /dev/null
+++ b/services/preview/netapp/mgmt/2021-04-01-preview/netapp/accounts.go
@@ -0,0 +1,515 @@
+package netapp
+
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License. See License.txt in the project root for license information.
+//
+// Code generated by Microsoft (R) AutoRest Code Generator.
+// Changes may cause incorrect behavior and will be lost if the code is regenerated.
+
+import (
+ "context"
+ "github.com/Azure/go-autorest/autorest"
+ "github.com/Azure/go-autorest/autorest/azure"
+ "github.com/Azure/go-autorest/autorest/validation"
+ "github.com/Azure/go-autorest/tracing"
+ "net/http"
+)
+
+// AccountsClient is the microsoft NetApp Files Azure Resource Provider specification
+type AccountsClient struct {
+ BaseClient
+}
+
+// NewAccountsClient creates an instance of the AccountsClient client.
+func NewAccountsClient(subscriptionID string) AccountsClient {
+ return NewAccountsClientWithBaseURI(DefaultBaseURI, subscriptionID)
+}
+
+// NewAccountsClientWithBaseURI creates an instance of the AccountsClient client using a custom endpoint. Use this
+// when interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure stack).
+func NewAccountsClientWithBaseURI(baseURI string, subscriptionID string) AccountsClient {
+ return AccountsClient{NewWithBaseURI(baseURI, subscriptionID)}
+}
+
+// CreateOrUpdate create or update the specified NetApp account within the resource group
+// Parameters:
+// body - netApp Account object supplied in the body of the operation.
+// resourceGroupName - the name of the resource group.
+// accountName - the name of the NetApp account
+func (client AccountsClient) CreateOrUpdate(ctx context.Context, body Account, resourceGroupName string, accountName string) (result AccountsCreateOrUpdateFuture, err error) {
+ if tracing.IsEnabled() {
+ ctx = tracing.StartSpan(ctx, fqdn+"/AccountsClient.CreateOrUpdate")
+ defer func() {
+ sc := -1
+ if result.FutureAPI != nil && result.FutureAPI.Response() != nil {
+ sc = result.FutureAPI.Response().StatusCode
+ }
+ tracing.EndSpan(ctx, sc, err)
+ }()
+ }
+ if err := validation.Validate([]validation.Validation{
+ {TargetValue: body,
+ Constraints: []validation.Constraint{{Target: "body.Location", Name: validation.Null, Rule: true, Chain: nil}}},
+ {TargetValue: resourceGroupName,
+ Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil},
+ {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil},
+ {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}}); err != nil {
+ return result, validation.NewError("netapp.AccountsClient", "CreateOrUpdate", err.Error())
+ }
+
+ req, err := client.CreateOrUpdatePreparer(ctx, body, resourceGroupName, accountName)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "netapp.AccountsClient", "CreateOrUpdate", nil, "Failure preparing request")
+ return
+ }
+
+ result, err = client.CreateOrUpdateSender(req)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "netapp.AccountsClient", "CreateOrUpdate", result.Response(), "Failure sending request")
+ return
+ }
+
+ return
+}
+
+// CreateOrUpdatePreparer prepares the CreateOrUpdate request.
+func (client AccountsClient) CreateOrUpdatePreparer(ctx context.Context, body Account, resourceGroupName string, accountName string) (*http.Request, error) {
+ pathParameters := map[string]interface{}{
+ "accountName": autorest.Encode("path", accountName),
+ "resourceGroupName": autorest.Encode("path", resourceGroupName),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
+ }
+
+ const APIVersion = "2021-04-01-preview"
+ queryParameters := map[string]interface{}{
+ "api-version": APIVersion,
+ }
+
+ body.ID = nil
+ body.Name = nil
+ body.Type = nil
+ body.SystemData = nil
+ preparer := autorest.CreatePreparer(
+ autorest.AsContentType("application/json; charset=utf-8"),
+ autorest.AsPut(),
+ autorest.WithBaseURL(client.BaseURI),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}", pathParameters),
+ autorest.WithJSON(body),
+ autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare((&http.Request{}).WithContext(ctx))
+}
+
+// CreateOrUpdateSender sends the CreateOrUpdate request. The method will close the
+// http.Response Body if it receives an error.
+func (client AccountsClient) CreateOrUpdateSender(req *http.Request) (future AccountsCreateOrUpdateFuture, err error) {
+ var resp *http.Response
+ future.FutureAPI = &azure.Future{}
+ resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client))
+ if err != nil {
+ return
+ }
+ var azf azure.Future
+ azf, err = azure.NewFutureFromResponse(resp)
+ future.FutureAPI = &azf
+ future.Result = future.result
+ return
+}
+
+// CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always
+// closes the http.Response Body.
+func (client AccountsClient) CreateOrUpdateResponder(resp *http.Response) (result Account, err error) {
+ err = autorest.Respond(
+ resp,
+ azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated),
+ autorest.ByUnmarshallingJSON(&result),
+ autorest.ByClosing())
+ result.Response = autorest.Response{Response: resp}
+ return
+}
+
+// Delete delete the specified NetApp account
+// Parameters:
+// resourceGroupName - the name of the resource group.
+// accountName - the name of the NetApp account
+func (client AccountsClient) Delete(ctx context.Context, resourceGroupName string, accountName string) (result AccountsDeleteFuture, err error) {
+ if tracing.IsEnabled() {
+ ctx = tracing.StartSpan(ctx, fqdn+"/AccountsClient.Delete")
+ defer func() {
+ sc := -1
+ if result.FutureAPI != nil && result.FutureAPI.Response() != nil {
+ sc = result.FutureAPI.Response().StatusCode
+ }
+ tracing.EndSpan(ctx, sc, err)
+ }()
+ }
+ if err := validation.Validate([]validation.Validation{
+ {TargetValue: resourceGroupName,
+ Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil},
+ {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil},
+ {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}}); err != nil {
+ return result, validation.NewError("netapp.AccountsClient", "Delete", err.Error())
+ }
+
+ req, err := client.DeletePreparer(ctx, resourceGroupName, accountName)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "netapp.AccountsClient", "Delete", nil, "Failure preparing request")
+ return
+ }
+
+ result, err = client.DeleteSender(req)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "netapp.AccountsClient", "Delete", result.Response(), "Failure sending request")
+ return
+ }
+
+ return
+}
+
+// DeletePreparer prepares the Delete request.
+func (client AccountsClient) DeletePreparer(ctx context.Context, resourceGroupName string, accountName string) (*http.Request, error) {
+ pathParameters := map[string]interface{}{
+ "accountName": autorest.Encode("path", accountName),
+ "resourceGroupName": autorest.Encode("path", resourceGroupName),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
+ }
+
+ const APIVersion = "2021-04-01-preview"
+ queryParameters := map[string]interface{}{
+ "api-version": APIVersion,
+ }
+
+ preparer := autorest.CreatePreparer(
+ autorest.AsDelete(),
+ autorest.WithBaseURL(client.BaseURI),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}", pathParameters),
+ autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare((&http.Request{}).WithContext(ctx))
+}
+
+// DeleteSender sends the Delete request. The method will close the
+// http.Response Body if it receives an error.
+func (client AccountsClient) DeleteSender(req *http.Request) (future AccountsDeleteFuture, err error) {
+ var resp *http.Response
+ future.FutureAPI = &azure.Future{}
+ resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client))
+ if err != nil {
+ return
+ }
+ var azf azure.Future
+ azf, err = azure.NewFutureFromResponse(resp)
+ future.FutureAPI = &azf
+ future.Result = future.result
+ return
+}
+
+// DeleteResponder handles the response to the Delete request. The method always
+// closes the http.Response Body.
+func (client AccountsClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) {
+ err = autorest.Respond(
+ resp,
+ azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent),
+ autorest.ByClosing())
+ result.Response = resp
+ return
+}
+
+// Get get the NetApp account
+// Parameters:
+// resourceGroupName - the name of the resource group.
+// accountName - the name of the NetApp account
+func (client AccountsClient) Get(ctx context.Context, resourceGroupName string, accountName string) (result Account, err error) {
+ if tracing.IsEnabled() {
+ ctx = tracing.StartSpan(ctx, fqdn+"/AccountsClient.Get")
+ defer func() {
+ sc := -1
+ if result.Response.Response != nil {
+ sc = result.Response.Response.StatusCode
+ }
+ tracing.EndSpan(ctx, sc, err)
+ }()
+ }
+ if err := validation.Validate([]validation.Validation{
+ {TargetValue: resourceGroupName,
+ Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil},
+ {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil},
+ {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}}); err != nil {
+ return result, validation.NewError("netapp.AccountsClient", "Get", err.Error())
+ }
+
+ req, err := client.GetPreparer(ctx, resourceGroupName, accountName)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "netapp.AccountsClient", "Get", nil, "Failure preparing request")
+ return
+ }
+
+ resp, err := client.GetSender(req)
+ if err != nil {
+ result.Response = autorest.Response{Response: resp}
+ err = autorest.NewErrorWithError(err, "netapp.AccountsClient", "Get", resp, "Failure sending request")
+ return
+ }
+
+ result, err = client.GetResponder(resp)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "netapp.AccountsClient", "Get", resp, "Failure responding to request")
+ return
+ }
+
+ return
+}
+
+// GetPreparer prepares the Get request.
+func (client AccountsClient) GetPreparer(ctx context.Context, resourceGroupName string, accountName string) (*http.Request, error) {
+ pathParameters := map[string]interface{}{
+ "accountName": autorest.Encode("path", accountName),
+ "resourceGroupName": autorest.Encode("path", resourceGroupName),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
+ }
+
+ const APIVersion = "2021-04-01-preview"
+ queryParameters := map[string]interface{}{
+ "api-version": APIVersion,
+ }
+
+ preparer := autorest.CreatePreparer(
+ autorest.AsGet(),
+ autorest.WithBaseURL(client.BaseURI),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}", pathParameters),
+ autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare((&http.Request{}).WithContext(ctx))
+}
+
+// GetSender sends the Get request. The method will close the
+// http.Response Body if it receives an error.
+func (client AccountsClient) GetSender(req *http.Request) (*http.Response, error) {
+ return client.Send(req, azure.DoRetryWithRegistration(client.Client))
+}
+
+// GetResponder handles the response to the Get request. The method always
+// closes the http.Response Body.
+func (client AccountsClient) GetResponder(resp *http.Response) (result Account, err error) {
+ err = autorest.Respond(
+ resp,
+ azure.WithErrorUnlessStatusCode(http.StatusOK),
+ autorest.ByUnmarshallingJSON(&result),
+ autorest.ByClosing())
+ result.Response = autorest.Response{Response: resp}
+ return
+}
+
+// List list and describe all NetApp accounts in the resource group.
+// Parameters:
+// resourceGroupName - the name of the resource group.
+func (client AccountsClient) List(ctx context.Context, resourceGroupName string) (result AccountListPage, err error) {
+ if tracing.IsEnabled() {
+ ctx = tracing.StartSpan(ctx, fqdn+"/AccountsClient.List")
+ defer func() {
+ sc := -1
+ if result.al.Response.Response != nil {
+ sc = result.al.Response.Response.StatusCode
+ }
+ tracing.EndSpan(ctx, sc, err)
+ }()
+ }
+ if err := validation.Validate([]validation.Validation{
+ {TargetValue: resourceGroupName,
+ Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil},
+ {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil},
+ {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}}); err != nil {
+ return result, validation.NewError("netapp.AccountsClient", "List", err.Error())
+ }
+
+ result.fn = client.listNextResults
+ req, err := client.ListPreparer(ctx, resourceGroupName)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "netapp.AccountsClient", "List", nil, "Failure preparing request")
+ return
+ }
+
+ resp, err := client.ListSender(req)
+ if err != nil {
+ result.al.Response = autorest.Response{Response: resp}
+ err = autorest.NewErrorWithError(err, "netapp.AccountsClient", "List", resp, "Failure sending request")
+ return
+ }
+
+ result.al, err = client.ListResponder(resp)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "netapp.AccountsClient", "List", resp, "Failure responding to request")
+ return
+ }
+ if result.al.hasNextLink() && result.al.IsEmpty() {
+ err = result.NextWithContext(ctx)
+ return
+ }
+
+ return
+}
+
+// ListPreparer prepares the List request.
+func (client AccountsClient) ListPreparer(ctx context.Context, resourceGroupName string) (*http.Request, error) {
+ pathParameters := map[string]interface{}{
+ "resourceGroupName": autorest.Encode("path", resourceGroupName),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
+ }
+
+ const APIVersion = "2021-04-01-preview"
+ queryParameters := map[string]interface{}{
+ "api-version": APIVersion,
+ }
+
+ preparer := autorest.CreatePreparer(
+ autorest.AsGet(),
+ autorest.WithBaseURL(client.BaseURI),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts", pathParameters),
+ autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare((&http.Request{}).WithContext(ctx))
+}
+
+// ListSender sends the List request. The method will close the
+// http.Response Body if it receives an error.
+func (client AccountsClient) ListSender(req *http.Request) (*http.Response, error) {
+ return client.Send(req, azure.DoRetryWithRegistration(client.Client))
+}
+
+// ListResponder handles the response to the List request. The method always
+// closes the http.Response Body.
+func (client AccountsClient) ListResponder(resp *http.Response) (result AccountList, err error) {
+ err = autorest.Respond(
+ resp,
+ azure.WithErrorUnlessStatusCode(http.StatusOK),
+ autorest.ByUnmarshallingJSON(&result),
+ autorest.ByClosing())
+ result.Response = autorest.Response{Response: resp}
+ return
+}
+
+// listNextResults retrieves the next set of results, if any.
+func (client AccountsClient) listNextResults(ctx context.Context, lastResults AccountList) (result AccountList, err error) {
+ req, err := lastResults.accountListPreparer(ctx)
+ if err != nil {
+ return result, autorest.NewErrorWithError(err, "netapp.AccountsClient", "listNextResults", nil, "Failure preparing next results request")
+ }
+ if req == nil {
+ return
+ }
+ resp, err := client.ListSender(req)
+ if err != nil {
+ result.Response = autorest.Response{Response: resp}
+ return result, autorest.NewErrorWithError(err, "netapp.AccountsClient", "listNextResults", resp, "Failure sending next results request")
+ }
+ result, err = client.ListResponder(resp)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "netapp.AccountsClient", "listNextResults", resp, "Failure responding to next results request")
+ }
+ return
+}
+
+// ListComplete enumerates all values, automatically crossing page boundaries as required.
+func (client AccountsClient) ListComplete(ctx context.Context, resourceGroupName string) (result AccountListIterator, err error) {
+ if tracing.IsEnabled() {
+ ctx = tracing.StartSpan(ctx, fqdn+"/AccountsClient.List")
+ defer func() {
+ sc := -1
+ if result.Response().Response.Response != nil {
+ sc = result.page.Response().Response.Response.StatusCode
+ }
+ tracing.EndSpan(ctx, sc, err)
+ }()
+ }
+ result.page, err = client.List(ctx, resourceGroupName)
+ return
+}
+
+// Update patch the specified NetApp account
+// Parameters:
+// body - netApp Account object supplied in the body of the operation.
+// resourceGroupName - the name of the resource group.
+// accountName - the name of the NetApp account
+func (client AccountsClient) Update(ctx context.Context, body AccountPatch, resourceGroupName string, accountName string) (result AccountsUpdateFuture, err error) {
+ if tracing.IsEnabled() {
+ ctx = tracing.StartSpan(ctx, fqdn+"/AccountsClient.Update")
+ defer func() {
+ sc := -1
+ if result.FutureAPI != nil && result.FutureAPI.Response() != nil {
+ sc = result.FutureAPI.Response().StatusCode
+ }
+ tracing.EndSpan(ctx, sc, err)
+ }()
+ }
+ if err := validation.Validate([]validation.Validation{
+ {TargetValue: resourceGroupName,
+ Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil},
+ {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil},
+ {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}}); err != nil {
+ return result, validation.NewError("netapp.AccountsClient", "Update", err.Error())
+ }
+
+ req, err := client.UpdatePreparer(ctx, body, resourceGroupName, accountName)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "netapp.AccountsClient", "Update", nil, "Failure preparing request")
+ return
+ }
+
+ result, err = client.UpdateSender(req)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "netapp.AccountsClient", "Update", result.Response(), "Failure sending request")
+ return
+ }
+
+ return
+}
+
+// UpdatePreparer prepares the Update request.
+func (client AccountsClient) UpdatePreparer(ctx context.Context, body AccountPatch, resourceGroupName string, accountName string) (*http.Request, error) {
+ pathParameters := map[string]interface{}{
+ "accountName": autorest.Encode("path", accountName),
+ "resourceGroupName": autorest.Encode("path", resourceGroupName),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
+ }
+
+ const APIVersion = "2021-04-01-preview"
+ queryParameters := map[string]interface{}{
+ "api-version": APIVersion,
+ }
+
+ body.ID = nil
+ body.Name = nil
+ body.Type = nil
+ preparer := autorest.CreatePreparer(
+ autorest.AsContentType("application/json; charset=utf-8"),
+ autorest.AsPatch(),
+ autorest.WithBaseURL(client.BaseURI),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}", pathParameters),
+ autorest.WithJSON(body),
+ autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare((&http.Request{}).WithContext(ctx))
+}
+
+// UpdateSender sends the Update request. The method will close the
+// http.Response Body if it receives an error.
+func (client AccountsClient) UpdateSender(req *http.Request) (future AccountsUpdateFuture, err error) {
+ var resp *http.Response
+ future.FutureAPI = &azure.Future{}
+ resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client))
+ if err != nil {
+ return
+ }
+ var azf azure.Future
+ azf, err = azure.NewFutureFromResponse(resp)
+ future.FutureAPI = &azf
+ future.Result = future.result
+ return
+}
+
+// UpdateResponder handles the response to the Update request. The method always
+// closes the http.Response Body.
+func (client AccountsClient) UpdateResponder(resp *http.Response) (result Account, err error) {
+ err = autorest.Respond(
+ resp,
+ azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted),
+ autorest.ByUnmarshallingJSON(&result),
+ autorest.ByClosing())
+ result.Response = autorest.Response{Response: resp}
+ return
+}
diff --git a/services/preview/netapp/mgmt/2021-04-01-preview/netapp/backuppolicies.go b/services/preview/netapp/mgmt/2021-04-01-preview/netapp/backuppolicies.go
new file mode 100644
index 000000000000..a43a0e1e57aa
--- /dev/null
+++ b/services/preview/netapp/mgmt/2021-04-01-preview/netapp/backuppolicies.go
@@ -0,0 +1,483 @@
+package netapp
+
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License. See License.txt in the project root for license information.
+//
+// Code generated by Microsoft (R) AutoRest Code Generator.
+// Changes may cause incorrect behavior and will be lost if the code is regenerated.
+
+import (
+ "context"
+ "github.com/Azure/go-autorest/autorest"
+ "github.com/Azure/go-autorest/autorest/azure"
+ "github.com/Azure/go-autorest/autorest/validation"
+ "github.com/Azure/go-autorest/tracing"
+ "net/http"
+)
+
+// BackupPoliciesClient is the microsoft NetApp Files Azure Resource Provider specification
+type BackupPoliciesClient struct {
+ BaseClient
+}
+
+// NewBackupPoliciesClient creates an instance of the BackupPoliciesClient client.
+func NewBackupPoliciesClient(subscriptionID string) BackupPoliciesClient {
+ return NewBackupPoliciesClientWithBaseURI(DefaultBaseURI, subscriptionID)
+}
+
+// NewBackupPoliciesClientWithBaseURI creates an instance of the BackupPoliciesClient client using a custom endpoint.
+// Use this when interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure stack).
+func NewBackupPoliciesClientWithBaseURI(baseURI string, subscriptionID string) BackupPoliciesClient {
+ return BackupPoliciesClient{NewWithBaseURI(baseURI, subscriptionID)}
+}
+
+// Create create a backup policy for Netapp Account
+// Parameters:
+// resourceGroupName - the name of the resource group.
+// accountName - the name of the NetApp account
+// backupPolicyName - backup policy Name which uniquely identify backup policy.
+// body - backup policy object supplied in the body of the operation.
+func (client BackupPoliciesClient) Create(ctx context.Context, resourceGroupName string, accountName string, backupPolicyName string, body BackupPolicy) (result BackupPoliciesCreateFuture, err error) {
+ if tracing.IsEnabled() {
+ ctx = tracing.StartSpan(ctx, fqdn+"/BackupPoliciesClient.Create")
+ defer func() {
+ sc := -1
+ if result.FutureAPI != nil && result.FutureAPI.Response() != nil {
+ sc = result.FutureAPI.Response().StatusCode
+ }
+ tracing.EndSpan(ctx, sc, err)
+ }()
+ }
+ if err := validation.Validate([]validation.Validation{
+ {TargetValue: resourceGroupName,
+ Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil},
+ {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil},
+ {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}},
+ {TargetValue: body,
+ Constraints: []validation.Constraint{{Target: "body.Location", Name: validation.Null, Rule: true, Chain: nil},
+ {Target: "body.BackupPolicyProperties", Name: validation.Null, Rule: true, Chain: nil}}}}); err != nil {
+ return result, validation.NewError("netapp.BackupPoliciesClient", "Create", err.Error())
+ }
+
+ req, err := client.CreatePreparer(ctx, resourceGroupName, accountName, backupPolicyName, body)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "netapp.BackupPoliciesClient", "Create", nil, "Failure preparing request")
+ return
+ }
+
+ result, err = client.CreateSender(req)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "netapp.BackupPoliciesClient", "Create", result.Response(), "Failure sending request")
+ return
+ }
+
+ return
+}
+
+// CreatePreparer prepares the Create request.
+func (client BackupPoliciesClient) CreatePreparer(ctx context.Context, resourceGroupName string, accountName string, backupPolicyName string, body BackupPolicy) (*http.Request, error) {
+ pathParameters := map[string]interface{}{
+ "accountName": autorest.Encode("path", accountName),
+ "backupPolicyName": autorest.Encode("path", backupPolicyName),
+ "resourceGroupName": autorest.Encode("path", resourceGroupName),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
+ }
+
+ const APIVersion = "2021-04-01-preview"
+ queryParameters := map[string]interface{}{
+ "api-version": APIVersion,
+ }
+
+ body.ID = nil
+ body.Name = nil
+ body.Type = nil
+ preparer := autorest.CreatePreparer(
+ autorest.AsContentType("application/json; charset=utf-8"),
+ autorest.AsPut(),
+ autorest.WithBaseURL(client.BaseURI),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/backupPolicies/{backupPolicyName}", pathParameters),
+ autorest.WithJSON(body),
+ autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare((&http.Request{}).WithContext(ctx))
+}
+
+// CreateSender sends the Create request. The method will close the
+// http.Response Body if it receives an error.
+func (client BackupPoliciesClient) CreateSender(req *http.Request) (future BackupPoliciesCreateFuture, err error) {
+ var resp *http.Response
+ future.FutureAPI = &azure.Future{}
+ resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client))
+ if err != nil {
+ return
+ }
+ var azf azure.Future
+ azf, err = azure.NewFutureFromResponse(resp)
+ future.FutureAPI = &azf
+ future.Result = future.result
+ return
+}
+
+// CreateResponder handles the response to the Create request. The method always
+// closes the http.Response Body.
+func (client BackupPoliciesClient) CreateResponder(resp *http.Response) (result BackupPolicy, err error) {
+ err = autorest.Respond(
+ resp,
+ azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated, http.StatusAccepted),
+ autorest.ByUnmarshallingJSON(&result),
+ autorest.ByClosing())
+ result.Response = autorest.Response{Response: resp}
+ return
+}
+
+// Delete delete backup policy
+// Parameters:
+// resourceGroupName - the name of the resource group.
+// accountName - the name of the NetApp account
+// backupPolicyName - backup policy Name which uniquely identify backup policy.
+func (client BackupPoliciesClient) Delete(ctx context.Context, resourceGroupName string, accountName string, backupPolicyName string) (result BackupPoliciesDeleteFuture, err error) {
+ if tracing.IsEnabled() {
+ ctx = tracing.StartSpan(ctx, fqdn+"/BackupPoliciesClient.Delete")
+ defer func() {
+ sc := -1
+ if result.FutureAPI != nil && result.FutureAPI.Response() != nil {
+ sc = result.FutureAPI.Response().StatusCode
+ }
+ tracing.EndSpan(ctx, sc, err)
+ }()
+ }
+ if err := validation.Validate([]validation.Validation{
+ {TargetValue: resourceGroupName,
+ Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil},
+ {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil},
+ {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}}); err != nil {
+ return result, validation.NewError("netapp.BackupPoliciesClient", "Delete", err.Error())
+ }
+
+ req, err := client.DeletePreparer(ctx, resourceGroupName, accountName, backupPolicyName)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "netapp.BackupPoliciesClient", "Delete", nil, "Failure preparing request")
+ return
+ }
+
+ result, err = client.DeleteSender(req)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "netapp.BackupPoliciesClient", "Delete", result.Response(), "Failure sending request")
+ return
+ }
+
+ return
+}
+
+// DeletePreparer prepares the Delete request.
+func (client BackupPoliciesClient) DeletePreparer(ctx context.Context, resourceGroupName string, accountName string, backupPolicyName string) (*http.Request, error) {
+ pathParameters := map[string]interface{}{
+ "accountName": autorest.Encode("path", accountName),
+ "backupPolicyName": autorest.Encode("path", backupPolicyName),
+ "resourceGroupName": autorest.Encode("path", resourceGroupName),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
+ }
+
+ const APIVersion = "2021-04-01-preview"
+ queryParameters := map[string]interface{}{
+ "api-version": APIVersion,
+ }
+
+ preparer := autorest.CreatePreparer(
+ autorest.AsDelete(),
+ autorest.WithBaseURL(client.BaseURI),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/backupPolicies/{backupPolicyName}", pathParameters),
+ autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare((&http.Request{}).WithContext(ctx))
+}
+
+// DeleteSender sends the Delete request. The method will close the
+// http.Response Body if it receives an error.
+func (client BackupPoliciesClient) DeleteSender(req *http.Request) (future BackupPoliciesDeleteFuture, err error) {
+ var resp *http.Response
+ future.FutureAPI = &azure.Future{}
+ resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client))
+ if err != nil {
+ return
+ }
+ var azf azure.Future
+ azf, err = azure.NewFutureFromResponse(resp)
+ future.FutureAPI = &azf
+ future.Result = future.result
+ return
+}
+
+// DeleteResponder handles the response to the Delete request. The method always
+// closes the http.Response Body.
+func (client BackupPoliciesClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) {
+ err = autorest.Respond(
+ resp,
+ azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent),
+ autorest.ByClosing())
+ result.Response = resp
+ return
+}
+
+// Get get a particular backup Policy
+// Parameters:
+// resourceGroupName - the name of the resource group.
+// accountName - the name of the NetApp account
+// backupPolicyName - backup policy Name which uniquely identify backup policy.
+func (client BackupPoliciesClient) Get(ctx context.Context, resourceGroupName string, accountName string, backupPolicyName string) (result BackupPolicy, err error) {
+ if tracing.IsEnabled() {
+ ctx = tracing.StartSpan(ctx, fqdn+"/BackupPoliciesClient.Get")
+ defer func() {
+ sc := -1
+ if result.Response.Response != nil {
+ sc = result.Response.Response.StatusCode
+ }
+ tracing.EndSpan(ctx, sc, err)
+ }()
+ }
+ if err := validation.Validate([]validation.Validation{
+ {TargetValue: resourceGroupName,
+ Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil},
+ {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil},
+ {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}}); err != nil {
+ return result, validation.NewError("netapp.BackupPoliciesClient", "Get", err.Error())
+ }
+
+ req, err := client.GetPreparer(ctx, resourceGroupName, accountName, backupPolicyName)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "netapp.BackupPoliciesClient", "Get", nil, "Failure preparing request")
+ return
+ }
+
+ resp, err := client.GetSender(req)
+ if err != nil {
+ result.Response = autorest.Response{Response: resp}
+ err = autorest.NewErrorWithError(err, "netapp.BackupPoliciesClient", "Get", resp, "Failure sending request")
+ return
+ }
+
+ result, err = client.GetResponder(resp)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "netapp.BackupPoliciesClient", "Get", resp, "Failure responding to request")
+ return
+ }
+
+ return
+}
+
+// GetPreparer prepares the Get request.
+func (client BackupPoliciesClient) GetPreparer(ctx context.Context, resourceGroupName string, accountName string, backupPolicyName string) (*http.Request, error) {
+ pathParameters := map[string]interface{}{
+ "accountName": autorest.Encode("path", accountName),
+ "backupPolicyName": autorest.Encode("path", backupPolicyName),
+ "resourceGroupName": autorest.Encode("path", resourceGroupName),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
+ }
+
+ const APIVersion = "2021-04-01-preview"
+ queryParameters := map[string]interface{}{
+ "api-version": APIVersion,
+ }
+
+ preparer := autorest.CreatePreparer(
+ autorest.AsGet(),
+ autorest.WithBaseURL(client.BaseURI),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/backupPolicies/{backupPolicyName}", pathParameters),
+ autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare((&http.Request{}).WithContext(ctx))
+}
+
+// GetSender sends the Get request. The method will close the
+// http.Response Body if it receives an error.
+func (client BackupPoliciesClient) GetSender(req *http.Request) (*http.Response, error) {
+ return client.Send(req, azure.DoRetryWithRegistration(client.Client))
+}
+
+// GetResponder handles the response to the Get request. The method always
+// closes the http.Response Body.
+func (client BackupPoliciesClient) GetResponder(resp *http.Response) (result BackupPolicy, err error) {
+ err = autorest.Respond(
+ resp,
+ azure.WithErrorUnlessStatusCode(http.StatusOK),
+ autorest.ByUnmarshallingJSON(&result),
+ autorest.ByClosing())
+ result.Response = autorest.Response{Response: resp}
+ return
+}
+
+// List list backup policies for Netapp Account
+// Parameters:
+// resourceGroupName - the name of the resource group.
+// accountName - the name of the NetApp account
+func (client BackupPoliciesClient) List(ctx context.Context, resourceGroupName string, accountName string) (result BackupPoliciesList, err error) {
+ if tracing.IsEnabled() {
+ ctx = tracing.StartSpan(ctx, fqdn+"/BackupPoliciesClient.List")
+ defer func() {
+ sc := -1
+ if result.Response.Response != nil {
+ sc = result.Response.Response.StatusCode
+ }
+ tracing.EndSpan(ctx, sc, err)
+ }()
+ }
+ if err := validation.Validate([]validation.Validation{
+ {TargetValue: resourceGroupName,
+ Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil},
+ {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil},
+ {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}}); err != nil {
+ return result, validation.NewError("netapp.BackupPoliciesClient", "List", err.Error())
+ }
+
+ req, err := client.ListPreparer(ctx, resourceGroupName, accountName)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "netapp.BackupPoliciesClient", "List", nil, "Failure preparing request")
+ return
+ }
+
+ resp, err := client.ListSender(req)
+ if err != nil {
+ result.Response = autorest.Response{Response: resp}
+ err = autorest.NewErrorWithError(err, "netapp.BackupPoliciesClient", "List", resp, "Failure sending request")
+ return
+ }
+
+ result, err = client.ListResponder(resp)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "netapp.BackupPoliciesClient", "List", resp, "Failure responding to request")
+ return
+ }
+
+ return
+}
+
+// ListPreparer prepares the List request.
+func (client BackupPoliciesClient) ListPreparer(ctx context.Context, resourceGroupName string, accountName string) (*http.Request, error) {
+ pathParameters := map[string]interface{}{
+ "accountName": autorest.Encode("path", accountName),
+ "resourceGroupName": autorest.Encode("path", resourceGroupName),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
+ }
+
+ const APIVersion = "2021-04-01-preview"
+ queryParameters := map[string]interface{}{
+ "api-version": APIVersion,
+ }
+
+ preparer := autorest.CreatePreparer(
+ autorest.AsGet(),
+ autorest.WithBaseURL(client.BaseURI),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/backupPolicies", pathParameters),
+ autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare((&http.Request{}).WithContext(ctx))
+}
+
+// ListSender sends the List request. The method will close the
+// http.Response Body if it receives an error.
+func (client BackupPoliciesClient) ListSender(req *http.Request) (*http.Response, error) {
+ return client.Send(req, azure.DoRetryWithRegistration(client.Client))
+}
+
+// ListResponder handles the response to the List request. The method always
+// closes the http.Response Body.
+func (client BackupPoliciesClient) ListResponder(resp *http.Response) (result BackupPoliciesList, err error) {
+ err = autorest.Respond(
+ resp,
+ azure.WithErrorUnlessStatusCode(http.StatusOK),
+ autorest.ByUnmarshallingJSON(&result),
+ autorest.ByClosing())
+ result.Response = autorest.Response{Response: resp}
+ return
+}
+
+// Update patch a backup policy for Netapp Account
+// Parameters:
+// resourceGroupName - the name of the resource group.
+// accountName - the name of the NetApp account
+// backupPolicyName - backup policy Name which uniquely identify backup policy.
+// body - backup policy object supplied in the body of the operation.
+func (client BackupPoliciesClient) Update(ctx context.Context, resourceGroupName string, accountName string, backupPolicyName string, body BackupPolicyPatch) (result BackupPoliciesUpdateFuture, err error) {
+ if tracing.IsEnabled() {
+ ctx = tracing.StartSpan(ctx, fqdn+"/BackupPoliciesClient.Update")
+ defer func() {
+ sc := -1
+ if result.FutureAPI != nil && result.FutureAPI.Response() != nil {
+ sc = result.FutureAPI.Response().StatusCode
+ }
+ tracing.EndSpan(ctx, sc, err)
+ }()
+ }
+ if err := validation.Validate([]validation.Validation{
+ {TargetValue: resourceGroupName,
+ Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil},
+ {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil},
+ {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}}); err != nil {
+ return result, validation.NewError("netapp.BackupPoliciesClient", "Update", err.Error())
+ }
+
+ req, err := client.UpdatePreparer(ctx, resourceGroupName, accountName, backupPolicyName, body)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "netapp.BackupPoliciesClient", "Update", nil, "Failure preparing request")
+ return
+ }
+
+ result, err = client.UpdateSender(req)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "netapp.BackupPoliciesClient", "Update", result.Response(), "Failure sending request")
+ return
+ }
+
+ return
+}
+
+// UpdatePreparer prepares the Update request.
+func (client BackupPoliciesClient) UpdatePreparer(ctx context.Context, resourceGroupName string, accountName string, backupPolicyName string, body BackupPolicyPatch) (*http.Request, error) {
+ pathParameters := map[string]interface{}{
+ "accountName": autorest.Encode("path", accountName),
+ "backupPolicyName": autorest.Encode("path", backupPolicyName),
+ "resourceGroupName": autorest.Encode("path", resourceGroupName),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
+ }
+
+ const APIVersion = "2021-04-01-preview"
+ queryParameters := map[string]interface{}{
+ "api-version": APIVersion,
+ }
+
+ body.ID = nil
+ body.Name = nil
+ body.Type = nil
+ preparer := autorest.CreatePreparer(
+ autorest.AsContentType("application/json; charset=utf-8"),
+ autorest.AsPatch(),
+ autorest.WithBaseURL(client.BaseURI),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/backupPolicies/{backupPolicyName}", pathParameters),
+ autorest.WithJSON(body),
+ autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare((&http.Request{}).WithContext(ctx))
+}
+
+// UpdateSender sends the Update request. The method will close the
+// http.Response Body if it receives an error.
+func (client BackupPoliciesClient) UpdateSender(req *http.Request) (future BackupPoliciesUpdateFuture, err error) {
+ var resp *http.Response
+ future.FutureAPI = &azure.Future{}
+ resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client))
+ if err != nil {
+ return
+ }
+ var azf azure.Future
+ azf, err = azure.NewFutureFromResponse(resp)
+ future.FutureAPI = &azf
+ future.Result = future.result
+ return
+}
+
+// UpdateResponder handles the response to the Update request. The method always
+// closes the http.Response Body.
+func (client BackupPoliciesClient) UpdateResponder(resp *http.Response) (result BackupPolicy, err error) {
+ err = autorest.Respond(
+ resp,
+ azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted),
+ autorest.ByUnmarshallingJSON(&result),
+ autorest.ByClosing())
+ result.Response = autorest.Response{Response: resp}
+ return
+}
diff --git a/services/preview/netapp/mgmt/2021-04-01-preview/netapp/backups.go b/services/preview/netapp/mgmt/2021-04-01-preview/netapp/backups.go
new file mode 100644
index 000000000000..8f8058fd535e
--- /dev/null
+++ b/services/preview/netapp/mgmt/2021-04-01-preview/netapp/backups.go
@@ -0,0 +1,645 @@
+package netapp
+
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License. See License.txt in the project root for license information.
+//
+// Code generated by Microsoft (R) AutoRest Code Generator.
+// Changes may cause incorrect behavior and will be lost if the code is regenerated.
+
+import (
+ "context"
+ "github.com/Azure/go-autorest/autorest"
+ "github.com/Azure/go-autorest/autorest/azure"
+ "github.com/Azure/go-autorest/autorest/validation"
+ "github.com/Azure/go-autorest/tracing"
+ "net/http"
+)
+
+// BackupsClient is the microsoft NetApp Files Azure Resource Provider specification
+type BackupsClient struct {
+ BaseClient
+}
+
+// NewBackupsClient creates an instance of the BackupsClient client.
+func NewBackupsClient(subscriptionID string) BackupsClient {
+ return NewBackupsClientWithBaseURI(DefaultBaseURI, subscriptionID)
+}
+
+// NewBackupsClientWithBaseURI creates an instance of the BackupsClient client using a custom endpoint. Use this when
+// interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure stack).
+func NewBackupsClientWithBaseURI(baseURI string, subscriptionID string) BackupsClient {
+ return BackupsClient{NewWithBaseURI(baseURI, subscriptionID)}
+}
+
+// Create create a backup for the volume
+// Parameters:
+// resourceGroupName - the name of the resource group.
+// accountName - the name of the NetApp account
+// poolName - the name of the capacity pool
+// volumeName - the name of the volume
+// backupName - the name of the backup
+// body - backup object supplied in the body of the operation.
+func (client BackupsClient) Create(ctx context.Context, resourceGroupName string, accountName string, poolName string, volumeName string, backupName string, body Backup) (result BackupsCreateFuture, err error) {
+ if tracing.IsEnabled() {
+ ctx = tracing.StartSpan(ctx, fqdn+"/BackupsClient.Create")
+ defer func() {
+ sc := -1
+ if result.FutureAPI != nil && result.FutureAPI.Response() != nil {
+ sc = result.FutureAPI.Response().StatusCode
+ }
+ tracing.EndSpan(ctx, sc, err)
+ }()
+ }
+ if err := validation.Validate([]validation.Validation{
+ {TargetValue: resourceGroupName,
+ Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil},
+ {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil},
+ {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}},
+ {TargetValue: poolName,
+ Constraints: []validation.Constraint{{Target: "poolName", Name: validation.MaxLength, Rule: 64, Chain: nil},
+ {Target: "poolName", Name: validation.MinLength, Rule: 1, Chain: nil},
+ {Target: "poolName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9][a-zA-Z0-9\-_]{0,63}$`, Chain: nil}}},
+ {TargetValue: volumeName,
+ Constraints: []validation.Constraint{{Target: "volumeName", Name: validation.MaxLength, Rule: 64, Chain: nil},
+ {Target: "volumeName", Name: validation.MinLength, Rule: 1, Chain: nil},
+ {Target: "volumeName", Name: validation.Pattern, Rule: `^[a-zA-Z][a-zA-Z0-9\-_]{0,63}$`, Chain: nil}}},
+ {TargetValue: body,
+ Constraints: []validation.Constraint{{Target: "body.Location", Name: validation.Null, Rule: true, Chain: nil},
+ {Target: "body.BackupProperties", Name: validation.Null, Rule: true,
+ Chain: []validation.Constraint{{Target: "body.BackupProperties.BackupID", Name: validation.Null, Rule: false,
+ Chain: []validation.Constraint{{Target: "body.BackupProperties.BackupID", Name: validation.MaxLength, Rule: 36, Chain: nil},
+ {Target: "body.BackupProperties.BackupID", Name: validation.MinLength, Rule: 36, Chain: nil},
+ {Target: "body.BackupProperties.BackupID", Name: validation.Pattern, Rule: `^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$`, Chain: nil},
+ }},
+ }}}}}); err != nil {
+ return result, validation.NewError("netapp.BackupsClient", "Create", err.Error())
+ }
+
+ req, err := client.CreatePreparer(ctx, resourceGroupName, accountName, poolName, volumeName, backupName, body)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "netapp.BackupsClient", "Create", nil, "Failure preparing request")
+ return
+ }
+
+ result, err = client.CreateSender(req)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "netapp.BackupsClient", "Create", result.Response(), "Failure sending request")
+ return
+ }
+
+ return
+}
+
+// CreatePreparer prepares the Create request.
+func (client BackupsClient) CreatePreparer(ctx context.Context, resourceGroupName string, accountName string, poolName string, volumeName string, backupName string, body Backup) (*http.Request, error) {
+ pathParameters := map[string]interface{}{
+ "accountName": autorest.Encode("path", accountName),
+ "backupName": autorest.Encode("path", backupName),
+ "poolName": autorest.Encode("path", poolName),
+ "resourceGroupName": autorest.Encode("path", resourceGroupName),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
+ "volumeName": autorest.Encode("path", volumeName),
+ }
+
+ const APIVersion = "2021-04-01-preview"
+ queryParameters := map[string]interface{}{
+ "api-version": APIVersion,
+ }
+
+ body.ID = nil
+ body.Name = nil
+ body.Type = nil
+ preparer := autorest.CreatePreparer(
+ autorest.AsContentType("application/json; charset=utf-8"),
+ autorest.AsPut(),
+ autorest.WithBaseURL(client.BaseURI),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/capacityPools/{poolName}/volumes/{volumeName}/backups/{backupName}", pathParameters),
+ autorest.WithJSON(body),
+ autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare((&http.Request{}).WithContext(ctx))
+}
+
+// CreateSender sends the Create request. The method will close the
+// http.Response Body if it receives an error.
+func (client BackupsClient) CreateSender(req *http.Request) (future BackupsCreateFuture, err error) {
+ var resp *http.Response
+ future.FutureAPI = &azure.Future{}
+ resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client))
+ if err != nil {
+ return
+ }
+ var azf azure.Future
+ azf, err = azure.NewFutureFromResponse(resp)
+ future.FutureAPI = &azf
+ future.Result = future.result
+ return
+}
+
+// CreateResponder handles the response to the Create request. The method always
+// closes the http.Response Body.
+func (client BackupsClient) CreateResponder(resp *http.Response) (result Backup, err error) {
+ err = autorest.Respond(
+ resp,
+ azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated, http.StatusAccepted),
+ autorest.ByUnmarshallingJSON(&result),
+ autorest.ByClosing())
+ result.Response = autorest.Response{Response: resp}
+ return
+}
+
+// Delete delete a backup of the volume
+// Parameters:
+// resourceGroupName - the name of the resource group.
+// accountName - the name of the NetApp account
+// poolName - the name of the capacity pool
+// volumeName - the name of the volume
+// backupName - the name of the backup
+func (client BackupsClient) Delete(ctx context.Context, resourceGroupName string, accountName string, poolName string, volumeName string, backupName string) (result BackupsDeleteFuture, err error) {
+ if tracing.IsEnabled() {
+ ctx = tracing.StartSpan(ctx, fqdn+"/BackupsClient.Delete")
+ defer func() {
+ sc := -1
+ if result.FutureAPI != nil && result.FutureAPI.Response() != nil {
+ sc = result.FutureAPI.Response().StatusCode
+ }
+ tracing.EndSpan(ctx, sc, err)
+ }()
+ }
+ if err := validation.Validate([]validation.Validation{
+ {TargetValue: resourceGroupName,
+ Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil},
+ {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil},
+ {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}},
+ {TargetValue: poolName,
+ Constraints: []validation.Constraint{{Target: "poolName", Name: validation.MaxLength, Rule: 64, Chain: nil},
+ {Target: "poolName", Name: validation.MinLength, Rule: 1, Chain: nil},
+ {Target: "poolName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9][a-zA-Z0-9\-_]{0,63}$`, Chain: nil}}},
+ {TargetValue: volumeName,
+ Constraints: []validation.Constraint{{Target: "volumeName", Name: validation.MaxLength, Rule: 64, Chain: nil},
+ {Target: "volumeName", Name: validation.MinLength, Rule: 1, Chain: nil},
+ {Target: "volumeName", Name: validation.Pattern, Rule: `^[a-zA-Z][a-zA-Z0-9\-_]{0,63}$`, Chain: nil}}}}); err != nil {
+ return result, validation.NewError("netapp.BackupsClient", "Delete", err.Error())
+ }
+
+ req, err := client.DeletePreparer(ctx, resourceGroupName, accountName, poolName, volumeName, backupName)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "netapp.BackupsClient", "Delete", nil, "Failure preparing request")
+ return
+ }
+
+ result, err = client.DeleteSender(req)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "netapp.BackupsClient", "Delete", result.Response(), "Failure sending request")
+ return
+ }
+
+ return
+}
+
+// DeletePreparer prepares the Delete request.
+func (client BackupsClient) DeletePreparer(ctx context.Context, resourceGroupName string, accountName string, poolName string, volumeName string, backupName string) (*http.Request, error) {
+ pathParameters := map[string]interface{}{
+ "accountName": autorest.Encode("path", accountName),
+ "backupName": autorest.Encode("path", backupName),
+ "poolName": autorest.Encode("path", poolName),
+ "resourceGroupName": autorest.Encode("path", resourceGroupName),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
+ "volumeName": autorest.Encode("path", volumeName),
+ }
+
+ const APIVersion = "2021-04-01-preview"
+ queryParameters := map[string]interface{}{
+ "api-version": APIVersion,
+ }
+
+ preparer := autorest.CreatePreparer(
+ autorest.AsDelete(),
+ autorest.WithBaseURL(client.BaseURI),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/capacityPools/{poolName}/volumes/{volumeName}/backups/{backupName}", pathParameters),
+ autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare((&http.Request{}).WithContext(ctx))
+}
+
+// DeleteSender sends the Delete request. The method will close the
+// http.Response Body if it receives an error.
+func (client BackupsClient) DeleteSender(req *http.Request) (future BackupsDeleteFuture, err error) {
+ var resp *http.Response
+ future.FutureAPI = &azure.Future{}
+ resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client))
+ if err != nil {
+ return
+ }
+ var azf azure.Future
+ azf, err = azure.NewFutureFromResponse(resp)
+ future.FutureAPI = &azf
+ future.Result = future.result
+ return
+}
+
+// DeleteResponder handles the response to the Delete request. The method always
+// closes the http.Response Body.
+func (client BackupsClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) {
+ err = autorest.Respond(
+ resp,
+ azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent),
+ autorest.ByClosing())
+ result.Response = resp
+ return
+}
+
+// Get gets the specified backup of the volume
+// Parameters:
+// resourceGroupName - the name of the resource group.
+// accountName - the name of the NetApp account
+// poolName - the name of the capacity pool
+// volumeName - the name of the volume
+// backupName - the name of the backup
+func (client BackupsClient) Get(ctx context.Context, resourceGroupName string, accountName string, poolName string, volumeName string, backupName string) (result Backup, err error) {
+ if tracing.IsEnabled() {
+ ctx = tracing.StartSpan(ctx, fqdn+"/BackupsClient.Get")
+ defer func() {
+ sc := -1
+ if result.Response.Response != nil {
+ sc = result.Response.Response.StatusCode
+ }
+ tracing.EndSpan(ctx, sc, err)
+ }()
+ }
+ if err := validation.Validate([]validation.Validation{
+ {TargetValue: resourceGroupName,
+ Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil},
+ {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil},
+ {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}},
+ {TargetValue: poolName,
+ Constraints: []validation.Constraint{{Target: "poolName", Name: validation.MaxLength, Rule: 64, Chain: nil},
+ {Target: "poolName", Name: validation.MinLength, Rule: 1, Chain: nil},
+ {Target: "poolName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9][a-zA-Z0-9\-_]{0,63}$`, Chain: nil}}},
+ {TargetValue: volumeName,
+ Constraints: []validation.Constraint{{Target: "volumeName", Name: validation.MaxLength, Rule: 64, Chain: nil},
+ {Target: "volumeName", Name: validation.MinLength, Rule: 1, Chain: nil},
+ {Target: "volumeName", Name: validation.Pattern, Rule: `^[a-zA-Z][a-zA-Z0-9\-_]{0,63}$`, Chain: nil}}}}); err != nil {
+ return result, validation.NewError("netapp.BackupsClient", "Get", err.Error())
+ }
+
+ req, err := client.GetPreparer(ctx, resourceGroupName, accountName, poolName, volumeName, backupName)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "netapp.BackupsClient", "Get", nil, "Failure preparing request")
+ return
+ }
+
+ resp, err := client.GetSender(req)
+ if err != nil {
+ result.Response = autorest.Response{Response: resp}
+ err = autorest.NewErrorWithError(err, "netapp.BackupsClient", "Get", resp, "Failure sending request")
+ return
+ }
+
+ result, err = client.GetResponder(resp)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "netapp.BackupsClient", "Get", resp, "Failure responding to request")
+ return
+ }
+
+ return
+}
+
+// GetPreparer prepares the Get request.
+func (client BackupsClient) GetPreparer(ctx context.Context, resourceGroupName string, accountName string, poolName string, volumeName string, backupName string) (*http.Request, error) {
+ pathParameters := map[string]interface{}{
+ "accountName": autorest.Encode("path", accountName),
+ "backupName": autorest.Encode("path", backupName),
+ "poolName": autorest.Encode("path", poolName),
+ "resourceGroupName": autorest.Encode("path", resourceGroupName),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
+ "volumeName": autorest.Encode("path", volumeName),
+ }
+
+ const APIVersion = "2021-04-01-preview"
+ queryParameters := map[string]interface{}{
+ "api-version": APIVersion,
+ }
+
+ preparer := autorest.CreatePreparer(
+ autorest.AsGet(),
+ autorest.WithBaseURL(client.BaseURI),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/capacityPools/{poolName}/volumes/{volumeName}/backups/{backupName}", pathParameters),
+ autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare((&http.Request{}).WithContext(ctx))
+}
+
+// GetSender sends the Get request. The method will close the
+// http.Response Body if it receives an error.
+func (client BackupsClient) GetSender(req *http.Request) (*http.Response, error) {
+ return client.Send(req, azure.DoRetryWithRegistration(client.Client))
+}
+
+// GetResponder handles the response to the Get request. The method always
+// closes the http.Response Body.
+func (client BackupsClient) GetResponder(resp *http.Response) (result Backup, err error) {
+ err = autorest.Respond(
+ resp,
+ azure.WithErrorUnlessStatusCode(http.StatusOK),
+ autorest.ByUnmarshallingJSON(&result),
+ autorest.ByClosing())
+ result.Response = autorest.Response{Response: resp}
+ return
+}
+
+// GetStatus get the status of the backup for a volume
+// Parameters:
+// resourceGroupName - the name of the resource group.
+// accountName - the name of the NetApp account
+// poolName - the name of the capacity pool
+// volumeName - the name of the volume
+func (client BackupsClient) GetStatus(ctx context.Context, resourceGroupName string, accountName string, poolName string, volumeName string) (result BackupStatus, err error) {
+ if tracing.IsEnabled() {
+ ctx = tracing.StartSpan(ctx, fqdn+"/BackupsClient.GetStatus")
+ defer func() {
+ sc := -1
+ if result.Response.Response != nil {
+ sc = result.Response.Response.StatusCode
+ }
+ tracing.EndSpan(ctx, sc, err)
+ }()
+ }
+ if err := validation.Validate([]validation.Validation{
+ {TargetValue: resourceGroupName,
+ Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil},
+ {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil},
+ {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}},
+ {TargetValue: poolName,
+ Constraints: []validation.Constraint{{Target: "poolName", Name: validation.MaxLength, Rule: 64, Chain: nil},
+ {Target: "poolName", Name: validation.MinLength, Rule: 1, Chain: nil},
+ {Target: "poolName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9][a-zA-Z0-9\-_]{0,63}$`, Chain: nil}}},
+ {TargetValue: volumeName,
+ Constraints: []validation.Constraint{{Target: "volumeName", Name: validation.MaxLength, Rule: 64, Chain: nil},
+ {Target: "volumeName", Name: validation.MinLength, Rule: 1, Chain: nil},
+ {Target: "volumeName", Name: validation.Pattern, Rule: `^[a-zA-Z][a-zA-Z0-9\-_]{0,63}$`, Chain: nil}}}}); err != nil {
+ return result, validation.NewError("netapp.BackupsClient", "GetStatus", err.Error())
+ }
+
+ req, err := client.GetStatusPreparer(ctx, resourceGroupName, accountName, poolName, volumeName)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "netapp.BackupsClient", "GetStatus", nil, "Failure preparing request")
+ return
+ }
+
+ resp, err := client.GetStatusSender(req)
+ if err != nil {
+ result.Response = autorest.Response{Response: resp}
+ err = autorest.NewErrorWithError(err, "netapp.BackupsClient", "GetStatus", resp, "Failure sending request")
+ return
+ }
+
+ result, err = client.GetStatusResponder(resp)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "netapp.BackupsClient", "GetStatus", resp, "Failure responding to request")
+ return
+ }
+
+ return
+}
+
+// GetStatusPreparer prepares the GetStatus request.
+func (client BackupsClient) GetStatusPreparer(ctx context.Context, resourceGroupName string, accountName string, poolName string, volumeName string) (*http.Request, error) {
+ pathParameters := map[string]interface{}{
+ "accountName": autorest.Encode("path", accountName),
+ "poolName": autorest.Encode("path", poolName),
+ "resourceGroupName": autorest.Encode("path", resourceGroupName),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
+ "volumeName": autorest.Encode("path", volumeName),
+ }
+
+ const APIVersion = "2021-04-01-preview"
+ queryParameters := map[string]interface{}{
+ "api-version": APIVersion,
+ }
+
+ preparer := autorest.CreatePreparer(
+ autorest.AsGet(),
+ autorest.WithBaseURL(client.BaseURI),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/capacityPools/{poolName}/volumes/{volumeName}/backupStatus", pathParameters),
+ autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare((&http.Request{}).WithContext(ctx))
+}
+
+// GetStatusSender sends the GetStatus request. The method will close the
+// http.Response Body if it receives an error.
+func (client BackupsClient) GetStatusSender(req *http.Request) (*http.Response, error) {
+ return client.Send(req, azure.DoRetryWithRegistration(client.Client))
+}
+
+// GetStatusResponder handles the response to the GetStatus request. The method always
+// closes the http.Response Body.
+func (client BackupsClient) GetStatusResponder(resp *http.Response) (result BackupStatus, err error) {
+ err = autorest.Respond(
+ resp,
+ azure.WithErrorUnlessStatusCode(http.StatusOK),
+ autorest.ByUnmarshallingJSON(&result),
+ autorest.ByClosing())
+ result.Response = autorest.Response{Response: resp}
+ return
+}
+
+// List list all backups for a volume
+// Parameters:
+// resourceGroupName - the name of the resource group.
+// accountName - the name of the NetApp account
+// poolName - the name of the capacity pool
+// volumeName - the name of the volume
+func (client BackupsClient) List(ctx context.Context, resourceGroupName string, accountName string, poolName string, volumeName string) (result BackupsList, err error) {
+ if tracing.IsEnabled() {
+ ctx = tracing.StartSpan(ctx, fqdn+"/BackupsClient.List")
+ defer func() {
+ sc := -1
+ if result.Response.Response != nil {
+ sc = result.Response.Response.StatusCode
+ }
+ tracing.EndSpan(ctx, sc, err)
+ }()
+ }
+ if err := validation.Validate([]validation.Validation{
+ {TargetValue: resourceGroupName,
+ Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil},
+ {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil},
+ {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}},
+ {TargetValue: poolName,
+ Constraints: []validation.Constraint{{Target: "poolName", Name: validation.MaxLength, Rule: 64, Chain: nil},
+ {Target: "poolName", Name: validation.MinLength, Rule: 1, Chain: nil},
+ {Target: "poolName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9][a-zA-Z0-9\-_]{0,63}$`, Chain: nil}}},
+ {TargetValue: volumeName,
+ Constraints: []validation.Constraint{{Target: "volumeName", Name: validation.MaxLength, Rule: 64, Chain: nil},
+ {Target: "volumeName", Name: validation.MinLength, Rule: 1, Chain: nil},
+ {Target: "volumeName", Name: validation.Pattern, Rule: `^[a-zA-Z][a-zA-Z0-9\-_]{0,63}$`, Chain: nil}}}}); err != nil {
+ return result, validation.NewError("netapp.BackupsClient", "List", err.Error())
+ }
+
+ req, err := client.ListPreparer(ctx, resourceGroupName, accountName, poolName, volumeName)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "netapp.BackupsClient", "List", nil, "Failure preparing request")
+ return
+ }
+
+ resp, err := client.ListSender(req)
+ if err != nil {
+ result.Response = autorest.Response{Response: resp}
+ err = autorest.NewErrorWithError(err, "netapp.BackupsClient", "List", resp, "Failure sending request")
+ return
+ }
+
+ result, err = client.ListResponder(resp)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "netapp.BackupsClient", "List", resp, "Failure responding to request")
+ return
+ }
+
+ return
+}
+
+// ListPreparer prepares the List request.
+func (client BackupsClient) ListPreparer(ctx context.Context, resourceGroupName string, accountName string, poolName string, volumeName string) (*http.Request, error) {
+ pathParameters := map[string]interface{}{
+ "accountName": autorest.Encode("path", accountName),
+ "poolName": autorest.Encode("path", poolName),
+ "resourceGroupName": autorest.Encode("path", resourceGroupName),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
+ "volumeName": autorest.Encode("path", volumeName),
+ }
+
+ const APIVersion = "2021-04-01-preview"
+ queryParameters := map[string]interface{}{
+ "api-version": APIVersion,
+ }
+
+ preparer := autorest.CreatePreparer(
+ autorest.AsGet(),
+ autorest.WithBaseURL(client.BaseURI),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/capacityPools/{poolName}/volumes/{volumeName}/backups", pathParameters),
+ autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare((&http.Request{}).WithContext(ctx))
+}
+
+// ListSender sends the List request. The method will close the
+// http.Response Body if it receives an error.
+func (client BackupsClient) ListSender(req *http.Request) (*http.Response, error) {
+ return client.Send(req, azure.DoRetryWithRegistration(client.Client))
+}
+
+// ListResponder handles the response to the List request. The method always
+// closes the http.Response Body.
+func (client BackupsClient) ListResponder(resp *http.Response) (result BackupsList, err error) {
+ err = autorest.Respond(
+ resp,
+ azure.WithErrorUnlessStatusCode(http.StatusOK),
+ autorest.ByUnmarshallingJSON(&result),
+ autorest.ByClosing())
+ result.Response = autorest.Response{Response: resp}
+ return
+}
+
+// Update patch a backup for the volume
+// Parameters:
+// resourceGroupName - the name of the resource group.
+// accountName - the name of the NetApp account
+// poolName - the name of the capacity pool
+// volumeName - the name of the volume
+// backupName - the name of the backup
+// body - backup object supplied in the body of the operation.
+func (client BackupsClient) Update(ctx context.Context, resourceGroupName string, accountName string, poolName string, volumeName string, backupName string, body *BackupPatch) (result BackupsUpdateFuture, err error) {
+ if tracing.IsEnabled() {
+ ctx = tracing.StartSpan(ctx, fqdn+"/BackupsClient.Update")
+ defer func() {
+ sc := -1
+ if result.FutureAPI != nil && result.FutureAPI.Response() != nil {
+ sc = result.FutureAPI.Response().StatusCode
+ }
+ tracing.EndSpan(ctx, sc, err)
+ }()
+ }
+ if err := validation.Validate([]validation.Validation{
+ {TargetValue: resourceGroupName,
+ Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil},
+ {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil},
+ {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}},
+ {TargetValue: poolName,
+ Constraints: []validation.Constraint{{Target: "poolName", Name: validation.MaxLength, Rule: 64, Chain: nil},
+ {Target: "poolName", Name: validation.MinLength, Rule: 1, Chain: nil},
+ {Target: "poolName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9][a-zA-Z0-9\-_]{0,63}$`, Chain: nil}}},
+ {TargetValue: volumeName,
+ Constraints: []validation.Constraint{{Target: "volumeName", Name: validation.MaxLength, Rule: 64, Chain: nil},
+ {Target: "volumeName", Name: validation.MinLength, Rule: 1, Chain: nil},
+ {Target: "volumeName", Name: validation.Pattern, Rule: `^[a-zA-Z][a-zA-Z0-9\-_]{0,63}$`, Chain: nil}}}}); err != nil {
+ return result, validation.NewError("netapp.BackupsClient", "Update", err.Error())
+ }
+
+ req, err := client.UpdatePreparer(ctx, resourceGroupName, accountName, poolName, volumeName, backupName, body)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "netapp.BackupsClient", "Update", nil, "Failure preparing request")
+ return
+ }
+
+ result, err = client.UpdateSender(req)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "netapp.BackupsClient", "Update", result.Response(), "Failure sending request")
+ return
+ }
+
+ return
+}
+
+// UpdatePreparer prepares the Update request.
+func (client BackupsClient) UpdatePreparer(ctx context.Context, resourceGroupName string, accountName string, poolName string, volumeName string, backupName string, body *BackupPatch) (*http.Request, error) {
+ pathParameters := map[string]interface{}{
+ "accountName": autorest.Encode("path", accountName),
+ "backupName": autorest.Encode("path", backupName),
+ "poolName": autorest.Encode("path", poolName),
+ "resourceGroupName": autorest.Encode("path", resourceGroupName),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
+ "volumeName": autorest.Encode("path", volumeName),
+ }
+
+ const APIVersion = "2021-04-01-preview"
+ queryParameters := map[string]interface{}{
+ "api-version": APIVersion,
+ }
+
+ preparer := autorest.CreatePreparer(
+ autorest.AsContentType("application/json; charset=utf-8"),
+ autorest.AsPatch(),
+ autorest.WithBaseURL(client.BaseURI),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/capacityPools/{poolName}/volumes/{volumeName}/backups/{backupName}", pathParameters),
+ autorest.WithQueryParameters(queryParameters))
+ if body != nil {
+ preparer = autorest.DecoratePreparer(preparer,
+ autorest.WithJSON(body))
+ }
+ return preparer.Prepare((&http.Request{}).WithContext(ctx))
+}
+
+// UpdateSender sends the Update request. The method will close the
+// http.Response Body if it receives an error.
+func (client BackupsClient) UpdateSender(req *http.Request) (future BackupsUpdateFuture, err error) {
+ var resp *http.Response
+ future.FutureAPI = &azure.Future{}
+ resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client))
+ if err != nil {
+ return
+ }
+ var azf azure.Future
+ azf, err = azure.NewFutureFromResponse(resp)
+ future.FutureAPI = &azf
+ future.Result = future.result
+ return
+}
+
+// UpdateResponder handles the response to the Update request. The method always
+// closes the http.Response Body.
+func (client BackupsClient) UpdateResponder(resp *http.Response) (result Backup, err error) {
+ err = autorest.Respond(
+ resp,
+ azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted),
+ autorest.ByUnmarshallingJSON(&result),
+ autorest.ByClosing())
+ result.Response = autorest.Response{Response: resp}
+ return
+}
diff --git a/services/preview/netapp/mgmt/2021-04-01-preview/netapp/client.go b/services/preview/netapp/mgmt/2021-04-01-preview/netapp/client.go
new file mode 100644
index 000000000000..e18bf974929b
--- /dev/null
+++ b/services/preview/netapp/mgmt/2021-04-01-preview/netapp/client.go
@@ -0,0 +1,41 @@
+// Package netapp implements the Azure ARM Netapp service API version 2021-04-01-preview.
+//
+// Microsoft NetApp Files Azure Resource Provider specification
+package netapp
+
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License. See License.txt in the project root for license information.
+//
+// Code generated by Microsoft (R) AutoRest Code Generator.
+// Changes may cause incorrect behavior and will be lost if the code is regenerated.
+
+import (
+ "github.com/Azure/go-autorest/autorest"
+)
+
+const (
+ // DefaultBaseURI is the default URI used for the service Netapp
+ DefaultBaseURI = "https://management.azure.com"
+)
+
+// BaseClient is the base client for Netapp.
+type BaseClient struct {
+ autorest.Client
+ BaseURI string
+ SubscriptionID string
+}
+
+// New creates an instance of the BaseClient client.
+func New(subscriptionID string) BaseClient {
+ return NewWithBaseURI(DefaultBaseURI, subscriptionID)
+}
+
+// NewWithBaseURI creates an instance of the BaseClient client using a custom endpoint. Use this when interacting with
+// an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure stack).
+func NewWithBaseURI(baseURI string, subscriptionID string) BaseClient {
+ return BaseClient{
+ Client: autorest.NewClientWithUserAgent(UserAgent()),
+ BaseURI: baseURI,
+ SubscriptionID: subscriptionID,
+ }
+}
diff --git a/services/preview/netapp/mgmt/2021-04-01-preview/netapp/enums.go b/services/preview/netapp/mgmt/2021-04-01-preview/netapp/enums.go
new file mode 100644
index 000000000000..f2be670510ca
--- /dev/null
+++ b/services/preview/netapp/mgmt/2021-04-01-preview/netapp/enums.go
@@ -0,0 +1,277 @@
+package netapp
+
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License. See License.txt in the project root for license information.
+//
+// Code generated by Microsoft (R) AutoRest Code Generator.
+// Changes may cause incorrect behavior and will be lost if the code is regenerated.
+
+// ActiveDirectoryStatus enumerates the values for active directory status.
+type ActiveDirectoryStatus string
+
+const (
+ // Created Active Directory created but not in use
+ Created ActiveDirectoryStatus = "Created"
+ // Deleted Active Directory Deleted
+ Deleted ActiveDirectoryStatus = "Deleted"
+ // Error Error with the Active Directory
+ Error ActiveDirectoryStatus = "Error"
+ // InUse Active Directory in use by SMB Volume
+ InUse ActiveDirectoryStatus = "InUse"
+ // Updating Active Directory Updating
+ Updating ActiveDirectoryStatus = "Updating"
+)
+
+// PossibleActiveDirectoryStatusValues returns an array of possible values for the ActiveDirectoryStatus const type.
+func PossibleActiveDirectoryStatusValues() []ActiveDirectoryStatus {
+ return []ActiveDirectoryStatus{Created, Deleted, Error, InUse, Updating}
+}
+
+// BackupType enumerates the values for backup type.
+type BackupType string
+
+const (
+ // Manual Manual backup
+ Manual BackupType = "Manual"
+ // Scheduled Scheduled backup
+ Scheduled BackupType = "Scheduled"
+)
+
+// PossibleBackupTypeValues returns an array of possible values for the BackupType const type.
+func PossibleBackupTypeValues() []BackupType {
+ return []BackupType{Manual, Scheduled}
+}
+
+// CheckNameResourceTypes enumerates the values for check name resource types.
+type CheckNameResourceTypes string
+
+const (
+ // MicrosoftNetAppnetAppAccounts ...
+ MicrosoftNetAppnetAppAccounts CheckNameResourceTypes = "Microsoft.NetApp/netAppAccounts"
+ // MicrosoftNetAppnetAppAccountscapacityPools ...
+ MicrosoftNetAppnetAppAccountscapacityPools CheckNameResourceTypes = "Microsoft.NetApp/netAppAccounts/capacityPools"
+ // MicrosoftNetAppnetAppAccountscapacityPoolsvolumes ...
+ MicrosoftNetAppnetAppAccountscapacityPoolsvolumes CheckNameResourceTypes = "Microsoft.NetApp/netAppAccounts/capacityPools/volumes"
+ // MicrosoftNetAppnetAppAccountscapacityPoolsvolumessnapshots ...
+ MicrosoftNetAppnetAppAccountscapacityPoolsvolumessnapshots CheckNameResourceTypes = "Microsoft.NetApp/netAppAccounts/capacityPools/volumes/snapshots"
+)
+
+// PossibleCheckNameResourceTypesValues returns an array of possible values for the CheckNameResourceTypes const type.
+func PossibleCheckNameResourceTypesValues() []CheckNameResourceTypes {
+ return []CheckNameResourceTypes{MicrosoftNetAppnetAppAccounts, MicrosoftNetAppnetAppAccountscapacityPools, MicrosoftNetAppnetAppAccountscapacityPoolsvolumes, MicrosoftNetAppnetAppAccountscapacityPoolsvolumessnapshots}
+}
+
+// CheckQuotaNameResourceTypes enumerates the values for check quota name resource types.
+type CheckQuotaNameResourceTypes string
+
+const (
+ // CheckQuotaNameResourceTypesMicrosoftNetAppnetAppAccounts ...
+ CheckQuotaNameResourceTypesMicrosoftNetAppnetAppAccounts CheckQuotaNameResourceTypes = "Microsoft.NetApp/netAppAccounts"
+ // CheckQuotaNameResourceTypesMicrosoftNetAppnetAppAccountscapacityPools ...
+ CheckQuotaNameResourceTypesMicrosoftNetAppnetAppAccountscapacityPools CheckQuotaNameResourceTypes = "Microsoft.NetApp/netAppAccounts/capacityPools"
+ // CheckQuotaNameResourceTypesMicrosoftNetAppnetAppAccountscapacityPoolsvolumes ...
+ CheckQuotaNameResourceTypesMicrosoftNetAppnetAppAccountscapacityPoolsvolumes CheckQuotaNameResourceTypes = "Microsoft.NetApp/netAppAccounts/capacityPools/volumes"
+ // CheckQuotaNameResourceTypesMicrosoftNetAppnetAppAccountscapacityPoolsvolumessnapshots ...
+ CheckQuotaNameResourceTypesMicrosoftNetAppnetAppAccountscapacityPoolsvolumessnapshots CheckQuotaNameResourceTypes = "Microsoft.NetApp/netAppAccounts/capacityPools/volumes/snapshots"
+)
+
+// PossibleCheckQuotaNameResourceTypesValues returns an array of possible values for the CheckQuotaNameResourceTypes const type.
+func PossibleCheckQuotaNameResourceTypesValues() []CheckQuotaNameResourceTypes {
+ return []CheckQuotaNameResourceTypes{CheckQuotaNameResourceTypesMicrosoftNetAppnetAppAccounts, CheckQuotaNameResourceTypesMicrosoftNetAppnetAppAccountscapacityPools, CheckQuotaNameResourceTypesMicrosoftNetAppnetAppAccountscapacityPoolsvolumes, CheckQuotaNameResourceTypesMicrosoftNetAppnetAppAccountscapacityPoolsvolumessnapshots}
+}
+
+// CreatedByType enumerates the values for created by type.
+type CreatedByType string
+
+const (
+ // Application ...
+ Application CreatedByType = "Application"
+ // Key ...
+ Key CreatedByType = "Key"
+ // ManagedIdentity ...
+ ManagedIdentity CreatedByType = "ManagedIdentity"
+ // User ...
+ User CreatedByType = "User"
+)
+
+// PossibleCreatedByTypeValues returns an array of possible values for the CreatedByType const type.
+func PossibleCreatedByTypeValues() []CreatedByType {
+ return []CreatedByType{Application, Key, ManagedIdentity, User}
+}
+
+// EndpointType enumerates the values for endpoint type.
+type EndpointType string
+
+const (
+ // Dst ...
+ Dst EndpointType = "dst"
+ // Src ...
+ Src EndpointType = "src"
+)
+
+// PossibleEndpointTypeValues returns an array of possible values for the EndpointType const type.
+func PossibleEndpointTypeValues() []EndpointType {
+ return []EndpointType{Dst, Src}
+}
+
+// InAvailabilityReasonType enumerates the values for in availability reason type.
+type InAvailabilityReasonType string
+
+const (
+ // AlreadyExists ...
+ AlreadyExists InAvailabilityReasonType = "AlreadyExists"
+ // Invalid ...
+ Invalid InAvailabilityReasonType = "Invalid"
+)
+
+// PossibleInAvailabilityReasonTypeValues returns an array of possible values for the InAvailabilityReasonType const type.
+func PossibleInAvailabilityReasonTypeValues() []InAvailabilityReasonType {
+ return []InAvailabilityReasonType{AlreadyExists, Invalid}
+}
+
+// MirrorState enumerates the values for mirror state.
+type MirrorState string
+
+const (
+ // Broken ...
+ Broken MirrorState = "Broken"
+ // Mirrored ...
+ Mirrored MirrorState = "Mirrored"
+ // Uninitialized ...
+ Uninitialized MirrorState = "Uninitialized"
+)
+
+// PossibleMirrorStateValues returns an array of possible values for the MirrorState const type.
+func PossibleMirrorStateValues() []MirrorState {
+ return []MirrorState{Broken, Mirrored, Uninitialized}
+}
+
+// NetworkFeatures enumerates the values for network features.
+type NetworkFeatures string
+
+const (
+ // Basic Basic network feature.
+ Basic NetworkFeatures = "Basic"
+ // Standard Standard network feature.
+ Standard NetworkFeatures = "Standard"
+)
+
+// PossibleNetworkFeaturesValues returns an array of possible values for the NetworkFeatures const type.
+func PossibleNetworkFeaturesValues() []NetworkFeatures {
+ return []NetworkFeatures{Basic, Standard}
+}
+
+// QosType enumerates the values for qos type.
+type QosType string
+
+const (
+ // QosTypeAuto qos type Auto
+ QosTypeAuto QosType = "Auto"
+ // QosTypeManual qos type Manual
+ QosTypeManual QosType = "Manual"
+)
+
+// PossibleQosTypeValues returns an array of possible values for the QosType const type.
+func PossibleQosTypeValues() []QosType {
+ return []QosType{QosTypeAuto, QosTypeManual}
+}
+
+// RegionStorageToNetworkProximity enumerates the values for region storage to network proximity.
+type RegionStorageToNetworkProximity string
+
+const (
+ // Default Basic network connectivity.
+ Default RegionStorageToNetworkProximity = "Default"
+ // T1 Standard T1 network connectivity.
+ T1 RegionStorageToNetworkProximity = "T1"
+ // T1AndT2 Standard T1 and T2 network connectivity.
+ T1AndT2 RegionStorageToNetworkProximity = "T1AndT2"
+ // T2 Standard T2 network connectivity.
+ T2 RegionStorageToNetworkProximity = "T2"
+)
+
+// PossibleRegionStorageToNetworkProximityValues returns an array of possible values for the RegionStorageToNetworkProximity const type.
+func PossibleRegionStorageToNetworkProximityValues() []RegionStorageToNetworkProximity {
+ return []RegionStorageToNetworkProximity{Default, T1, T1AndT2, T2}
+}
+
+// RelationshipStatus enumerates the values for relationship status.
+type RelationshipStatus string
+
+const (
+ // Idle ...
+ Idle RelationshipStatus = "Idle"
+ // Transferring ...
+ Transferring RelationshipStatus = "Transferring"
+)
+
+// PossibleRelationshipStatusValues returns an array of possible values for the RelationshipStatus const type.
+func PossibleRelationshipStatusValues() []RelationshipStatus {
+ return []RelationshipStatus{Idle, Transferring}
+}
+
+// ReplicationSchedule enumerates the values for replication schedule.
+type ReplicationSchedule string
+
+const (
+ // OneZerominutely ...
+ OneZerominutely ReplicationSchedule = "_10minutely"
+ // Daily ...
+ Daily ReplicationSchedule = "daily"
+ // Hourly ...
+ Hourly ReplicationSchedule = "hourly"
+)
+
+// PossibleReplicationScheduleValues returns an array of possible values for the ReplicationSchedule const type.
+func PossibleReplicationScheduleValues() []ReplicationSchedule {
+ return []ReplicationSchedule{OneZerominutely, Daily, Hourly}
+}
+
+// SecurityStyle enumerates the values for security style.
+type SecurityStyle string
+
+const (
+ // Ntfs ...
+ Ntfs SecurityStyle = "ntfs"
+ // Unix ...
+ Unix SecurityStyle = "unix"
+)
+
+// PossibleSecurityStyleValues returns an array of possible values for the SecurityStyle const type.
+func PossibleSecurityStyleValues() []SecurityStyle {
+ return []SecurityStyle{Ntfs, Unix}
+}
+
+// ServiceLevel enumerates the values for service level.
+type ServiceLevel string
+
+const (
+ // ServiceLevelPremium Premium service level
+ ServiceLevelPremium ServiceLevel = "Premium"
+ // ServiceLevelStandard Standard service level
+ ServiceLevelStandard ServiceLevel = "Standard"
+ // ServiceLevelUltra Ultra service level
+ ServiceLevelUltra ServiceLevel = "Ultra"
+)
+
+// PossibleServiceLevelValues returns an array of possible values for the ServiceLevel const type.
+func PossibleServiceLevelValues() []ServiceLevel {
+ return []ServiceLevel{ServiceLevelPremium, ServiceLevelStandard, ServiceLevelUltra}
+}
+
+// VolumeStorageToNetworkProximity enumerates the values for volume storage to network proximity.
+type VolumeStorageToNetworkProximity string
+
+const (
+ // VolumeStorageToNetworkProximityDefault Basic storage to network connectivity.
+ VolumeStorageToNetworkProximityDefault VolumeStorageToNetworkProximity = "Default"
+ // VolumeStorageToNetworkProximityT1 Standard T1 storage to network connectivity.
+ VolumeStorageToNetworkProximityT1 VolumeStorageToNetworkProximity = "T1"
+ // VolumeStorageToNetworkProximityT2 Standard T2 storage to network connectivity.
+ VolumeStorageToNetworkProximityT2 VolumeStorageToNetworkProximity = "T2"
+)
+
+// PossibleVolumeStorageToNetworkProximityValues returns an array of possible values for the VolumeStorageToNetworkProximity const type.
+func PossibleVolumeStorageToNetworkProximityValues() []VolumeStorageToNetworkProximity {
+ return []VolumeStorageToNetworkProximity{VolumeStorageToNetworkProximityDefault, VolumeStorageToNetworkProximityT1, VolumeStorageToNetworkProximityT2}
+}
diff --git a/services/preview/netapp/mgmt/2021-04-01-preview/netapp/models.go b/services/preview/netapp/mgmt/2021-04-01-preview/netapp/models.go
new file mode 100644
index 000000000000..123f31f1176a
--- /dev/null
+++ b/services/preview/netapp/mgmt/2021-04-01-preview/netapp/models.go
@@ -0,0 +1,4195 @@
+package netapp
+
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License. See License.txt in the project root for license information.
+//
+// Code generated by Microsoft (R) AutoRest Code Generator.
+// Changes may cause incorrect behavior and will be lost if the code is regenerated.
+
+import (
+ "context"
+ "encoding/json"
+ "github.com/Azure/go-autorest/autorest"
+ "github.com/Azure/go-autorest/autorest/azure"
+ "github.com/Azure/go-autorest/autorest/date"
+ "github.com/Azure/go-autorest/autorest/to"
+ "github.com/Azure/go-autorest/tracing"
+ "net/http"
+)
+
+// The package's fully qualified name.
+const fqdn = "github.com/Azure/azure-sdk-for-go/services/preview/netapp/mgmt/2021-04-01-preview/netapp"
+
+// Account netApp account resource
+type Account struct {
+ autorest.Response `json:"-"`
+ // Location - Resource location
+ Location *string `json:"location,omitempty"`
+ // ID - READ-ONLY; Resource Id
+ ID *string `json:"id,omitempty"`
+ // Name - READ-ONLY; Resource name
+ Name *string `json:"name,omitempty"`
+ // Type - READ-ONLY; Resource type
+ Type *string `json:"type,omitempty"`
+ // Tags - Resource tags
+ Tags map[string]*string `json:"tags"`
+ // AccountProperties - NetApp Account properties
+ *AccountProperties `json:"properties,omitempty"`
+ // SystemData - READ-ONLY; The system meta data relating to this resource.
+ SystemData *SystemData `json:"systemData,omitempty"`
+}
+
+// MarshalJSON is the custom marshaler for Account.
+func (a Account) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]interface{})
+ if a.Location != nil {
+ objectMap["location"] = a.Location
+ }
+ if a.Tags != nil {
+ objectMap["tags"] = a.Tags
+ }
+ if a.AccountProperties != nil {
+ objectMap["properties"] = a.AccountProperties
+ }
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON is the custom unmarshaler for Account struct.
+func (a *Account) UnmarshalJSON(body []byte) error {
+ var m map[string]*json.RawMessage
+ err := json.Unmarshal(body, &m)
+ if err != nil {
+ return err
+ }
+ for k, v := range m {
+ switch k {
+ case "location":
+ if v != nil {
+ var location string
+ err = json.Unmarshal(*v, &location)
+ if err != nil {
+ return err
+ }
+ a.Location = &location
+ }
+ case "id":
+ if v != nil {
+ var ID string
+ err = json.Unmarshal(*v, &ID)
+ if err != nil {
+ return err
+ }
+ a.ID = &ID
+ }
+ case "name":
+ if v != nil {
+ var name string
+ err = json.Unmarshal(*v, &name)
+ if err != nil {
+ return err
+ }
+ a.Name = &name
+ }
+ case "type":
+ if v != nil {
+ var typeVar string
+ err = json.Unmarshal(*v, &typeVar)
+ if err != nil {
+ return err
+ }
+ a.Type = &typeVar
+ }
+ case "tags":
+ if v != nil {
+ var tags map[string]*string
+ err = json.Unmarshal(*v, &tags)
+ if err != nil {
+ return err
+ }
+ a.Tags = tags
+ }
+ case "properties":
+ if v != nil {
+ var accountProperties AccountProperties
+ err = json.Unmarshal(*v, &accountProperties)
+ if err != nil {
+ return err
+ }
+ a.AccountProperties = &accountProperties
+ }
+ case "systemData":
+ if v != nil {
+ var systemData SystemData
+ err = json.Unmarshal(*v, &systemData)
+ if err != nil {
+ return err
+ }
+ a.SystemData = &systemData
+ }
+ }
+ }
+
+ return nil
+}
+
+// AccountBackupsDeleteFuture an abstraction for monitoring and retrieving the results of a long-running
+// operation.
+type AccountBackupsDeleteFuture struct {
+ azure.FutureAPI
+ // Result returns the result of the asynchronous operation.
+ // If the operation has not completed it will return an error.
+ Result func(AccountBackupsClient) (autorest.Response, error)
+}
+
+// UnmarshalJSON is the custom unmarshaller for CreateFuture.
+func (future *AccountBackupsDeleteFuture) UnmarshalJSON(body []byte) error {
+ var azFuture azure.Future
+ if err := json.Unmarshal(body, &azFuture); err != nil {
+ return err
+ }
+ future.FutureAPI = &azFuture
+ future.Result = future.result
+ return nil
+}
+
+// result is the default implementation for AccountBackupsDeleteFuture.Result.
+func (future *AccountBackupsDeleteFuture) result(client AccountBackupsClient) (ar autorest.Response, err error) {
+ var done bool
+ done, err = future.DoneWithContext(context.Background(), client)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "netapp.AccountBackupsDeleteFuture", "Result", future.Response(), "Polling failure")
+ return
+ }
+ if !done {
+ ar.Response = future.Response()
+ err = azure.NewAsyncOpIncompleteError("netapp.AccountBackupsDeleteFuture")
+ return
+ }
+ ar.Response = future.Response()
+ return
+}
+
+// AccountEncryption encryption settings
+type AccountEncryption struct {
+ // KeySource - Encryption Key Source. Possible values are: 'Microsoft.NetApp'.
+ KeySource *string `json:"keySource,omitempty"`
+}
+
+// AccountList list of NetApp account resources
+type AccountList struct {
+ autorest.Response `json:"-"`
+ // Value - Multiple NetApp accounts
+ Value *[]Account `json:"value,omitempty"`
+ // NextLink - URL to get the next set of results.
+ NextLink *string `json:"nextLink,omitempty"`
+}
+
+// AccountListIterator provides access to a complete listing of Account values.
+type AccountListIterator struct {
+ i int
+ page AccountListPage
+}
+
+// NextWithContext advances to the next value. If there was an error making
+// the request the iterator does not advance and the error is returned.
+func (iter *AccountListIterator) NextWithContext(ctx context.Context) (err error) {
+ if tracing.IsEnabled() {
+ ctx = tracing.StartSpan(ctx, fqdn+"/AccountListIterator.NextWithContext")
+ defer func() {
+ sc := -1
+ if iter.Response().Response.Response != nil {
+ sc = iter.Response().Response.Response.StatusCode
+ }
+ tracing.EndSpan(ctx, sc, err)
+ }()
+ }
+ iter.i++
+ if iter.i < len(iter.page.Values()) {
+ return nil
+ }
+ err = iter.page.NextWithContext(ctx)
+ if err != nil {
+ iter.i--
+ return err
+ }
+ iter.i = 0
+ return nil
+}
+
+// Next advances to the next value. If there was an error making
+// the request the iterator does not advance and the error is returned.
+// Deprecated: Use NextWithContext() instead.
+func (iter *AccountListIterator) Next() error {
+ return iter.NextWithContext(context.Background())
+}
+
+// NotDone returns true if the enumeration should be started or is not yet complete.
+func (iter AccountListIterator) NotDone() bool {
+ return iter.page.NotDone() && iter.i < len(iter.page.Values())
+}
+
+// Response returns the raw server response from the last page request.
+func (iter AccountListIterator) Response() AccountList {
+ return iter.page.Response()
+}
+
+// Value returns the current value or a zero-initialized value if the
+// iterator has advanced beyond the end of the collection.
+func (iter AccountListIterator) Value() Account {
+ if !iter.page.NotDone() {
+ return Account{}
+ }
+ return iter.page.Values()[iter.i]
+}
+
+// Creates a new instance of the AccountListIterator type.
+func NewAccountListIterator(page AccountListPage) AccountListIterator {
+ return AccountListIterator{page: page}
+}
+
+// IsEmpty returns true if the ListResult contains no values.
+func (al AccountList) IsEmpty() bool {
+ return al.Value == nil || len(*al.Value) == 0
+}
+
+// hasNextLink returns true if the NextLink is not empty.
+func (al AccountList) hasNextLink() bool {
+ return al.NextLink != nil && len(*al.NextLink) != 0
+}
+
+// accountListPreparer prepares a request to retrieve the next set of results.
+// It returns nil if no more results exist.
+func (al AccountList) accountListPreparer(ctx context.Context) (*http.Request, error) {
+ if !al.hasNextLink() {
+ return nil, nil
+ }
+ return autorest.Prepare((&http.Request{}).WithContext(ctx),
+ autorest.AsJSON(),
+ autorest.AsGet(),
+ autorest.WithBaseURL(to.String(al.NextLink)))
+}
+
+// AccountListPage contains a page of Account values.
+type AccountListPage struct {
+ fn func(context.Context, AccountList) (AccountList, error)
+ al AccountList
+}
+
+// NextWithContext advances to the next page of values. If there was an error making
+// the request the page does not advance and the error is returned.
+func (page *AccountListPage) NextWithContext(ctx context.Context) (err error) {
+ if tracing.IsEnabled() {
+ ctx = tracing.StartSpan(ctx, fqdn+"/AccountListPage.NextWithContext")
+ defer func() {
+ sc := -1
+ if page.Response().Response.Response != nil {
+ sc = page.Response().Response.Response.StatusCode
+ }
+ tracing.EndSpan(ctx, sc, err)
+ }()
+ }
+ for {
+ next, err := page.fn(ctx, page.al)
+ if err != nil {
+ return err
+ }
+ page.al = next
+ if !next.hasNextLink() || !next.IsEmpty() {
+ break
+ }
+ }
+ return nil
+}
+
+// Next advances to the next page of values. If there was an error making
+// the request the page does not advance and the error is returned.
+// Deprecated: Use NextWithContext() instead.
+func (page *AccountListPage) Next() error {
+ return page.NextWithContext(context.Background())
+}
+
+// NotDone returns true if the page enumeration should be started or is not yet complete.
+func (page AccountListPage) NotDone() bool {
+ return !page.al.IsEmpty()
+}
+
+// Response returns the raw server response from the last page request.
+func (page AccountListPage) Response() AccountList {
+ return page.al
+}
+
+// Values returns the slice of values for the current page or nil if there are no values.
+func (page AccountListPage) Values() []Account {
+ if page.al.IsEmpty() {
+ return nil
+ }
+ return *page.al.Value
+}
+
+// Creates a new instance of the AccountListPage type.
+func NewAccountListPage(cur AccountList, getNextPage func(context.Context, AccountList) (AccountList, error)) AccountListPage {
+ return AccountListPage{
+ fn: getNextPage,
+ al: cur,
+ }
+}
+
+// AccountPatch netApp account patch resource
+type AccountPatch struct {
+ // Location - Resource location
+ Location *string `json:"location,omitempty"`
+ // ID - READ-ONLY; Resource Id
+ ID *string `json:"id,omitempty"`
+ // Name - READ-ONLY; Resource name
+ Name *string `json:"name,omitempty"`
+ // Type - READ-ONLY; Resource type
+ Type *string `json:"type,omitempty"`
+ // Tags - Resource tags
+ Tags map[string]*string `json:"tags"`
+ // AccountProperties - NetApp Account properties
+ *AccountProperties `json:"properties,omitempty"`
+}
+
+// MarshalJSON is the custom marshaler for AccountPatch.
+func (ap AccountPatch) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]interface{})
+ if ap.Location != nil {
+ objectMap["location"] = ap.Location
+ }
+ if ap.Tags != nil {
+ objectMap["tags"] = ap.Tags
+ }
+ if ap.AccountProperties != nil {
+ objectMap["properties"] = ap.AccountProperties
+ }
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON is the custom unmarshaler for AccountPatch struct.
+func (ap *AccountPatch) UnmarshalJSON(body []byte) error {
+ var m map[string]*json.RawMessage
+ err := json.Unmarshal(body, &m)
+ if err != nil {
+ return err
+ }
+ for k, v := range m {
+ switch k {
+ case "location":
+ if v != nil {
+ var location string
+ err = json.Unmarshal(*v, &location)
+ if err != nil {
+ return err
+ }
+ ap.Location = &location
+ }
+ case "id":
+ if v != nil {
+ var ID string
+ err = json.Unmarshal(*v, &ID)
+ if err != nil {
+ return err
+ }
+ ap.ID = &ID
+ }
+ case "name":
+ if v != nil {
+ var name string
+ err = json.Unmarshal(*v, &name)
+ if err != nil {
+ return err
+ }
+ ap.Name = &name
+ }
+ case "type":
+ if v != nil {
+ var typeVar string
+ err = json.Unmarshal(*v, &typeVar)
+ if err != nil {
+ return err
+ }
+ ap.Type = &typeVar
+ }
+ case "tags":
+ if v != nil {
+ var tags map[string]*string
+ err = json.Unmarshal(*v, &tags)
+ if err != nil {
+ return err
+ }
+ ap.Tags = tags
+ }
+ case "properties":
+ if v != nil {
+ var accountProperties AccountProperties
+ err = json.Unmarshal(*v, &accountProperties)
+ if err != nil {
+ return err
+ }
+ ap.AccountProperties = &accountProperties
+ }
+ }
+ }
+
+ return nil
+}
+
+// AccountProperties netApp account properties
+type AccountProperties struct {
+ // ProvisioningState - READ-ONLY; Azure lifecycle management
+ ProvisioningState *string `json:"provisioningState,omitempty"`
+ // ActiveDirectories - Active Directories
+ ActiveDirectories *[]ActiveDirectory `json:"activeDirectories,omitempty"`
+ // Encryption - Encryption settings
+ Encryption *AccountEncryption `json:"encryption,omitempty"`
+}
+
+// MarshalJSON is the custom marshaler for AccountProperties.
+func (ap AccountProperties) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]interface{})
+ if ap.ActiveDirectories != nil {
+ objectMap["activeDirectories"] = ap.ActiveDirectories
+ }
+ if ap.Encryption != nil {
+ objectMap["encryption"] = ap.Encryption
+ }
+ return json.Marshal(objectMap)
+}
+
+// AccountsCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a long-running
+// operation.
+type AccountsCreateOrUpdateFuture struct {
+ azure.FutureAPI
+ // Result returns the result of the asynchronous operation.
+ // If the operation has not completed it will return an error.
+ Result func(AccountsClient) (Account, error)
+}
+
+// UnmarshalJSON is the custom unmarshaller for CreateFuture.
+func (future *AccountsCreateOrUpdateFuture) UnmarshalJSON(body []byte) error {
+ var azFuture azure.Future
+ if err := json.Unmarshal(body, &azFuture); err != nil {
+ return err
+ }
+ future.FutureAPI = &azFuture
+ future.Result = future.result
+ return nil
+}
+
+// result is the default implementation for AccountsCreateOrUpdateFuture.Result.
+func (future *AccountsCreateOrUpdateFuture) result(client AccountsClient) (a Account, err error) {
+ var done bool
+ done, err = future.DoneWithContext(context.Background(), client)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "netapp.AccountsCreateOrUpdateFuture", "Result", future.Response(), "Polling failure")
+ return
+ }
+ if !done {
+ a.Response.Response = future.Response()
+ err = azure.NewAsyncOpIncompleteError("netapp.AccountsCreateOrUpdateFuture")
+ return
+ }
+ sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
+ if a.Response.Response, err = future.GetResult(sender); err == nil && a.Response.Response.StatusCode != http.StatusNoContent {
+ a, err = client.CreateOrUpdateResponder(a.Response.Response)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "netapp.AccountsCreateOrUpdateFuture", "Result", a.Response.Response, "Failure responding to request")
+ }
+ }
+ return
+}
+
+// AccountsDeleteFuture an abstraction for monitoring and retrieving the results of a long-running
+// operation.
+type AccountsDeleteFuture struct {
+ azure.FutureAPI
+ // Result returns the result of the asynchronous operation.
+ // If the operation has not completed it will return an error.
+ Result func(AccountsClient) (autorest.Response, error)
+}
+
+// UnmarshalJSON is the custom unmarshaller for CreateFuture.
+func (future *AccountsDeleteFuture) UnmarshalJSON(body []byte) error {
+ var azFuture azure.Future
+ if err := json.Unmarshal(body, &azFuture); err != nil {
+ return err
+ }
+ future.FutureAPI = &azFuture
+ future.Result = future.result
+ return nil
+}
+
+// result is the default implementation for AccountsDeleteFuture.Result.
+func (future *AccountsDeleteFuture) result(client AccountsClient) (ar autorest.Response, err error) {
+ var done bool
+ done, err = future.DoneWithContext(context.Background(), client)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "netapp.AccountsDeleteFuture", "Result", future.Response(), "Polling failure")
+ return
+ }
+ if !done {
+ ar.Response = future.Response()
+ err = azure.NewAsyncOpIncompleteError("netapp.AccountsDeleteFuture")
+ return
+ }
+ ar.Response = future.Response()
+ return
+}
+
+// AccountsUpdateFuture an abstraction for monitoring and retrieving the results of a long-running
+// operation.
+type AccountsUpdateFuture struct {
+ azure.FutureAPI
+ // Result returns the result of the asynchronous operation.
+ // If the operation has not completed it will return an error.
+ Result func(AccountsClient) (Account, error)
+}
+
+// UnmarshalJSON is the custom unmarshaller for CreateFuture.
+func (future *AccountsUpdateFuture) UnmarshalJSON(body []byte) error {
+ var azFuture azure.Future
+ if err := json.Unmarshal(body, &azFuture); err != nil {
+ return err
+ }
+ future.FutureAPI = &azFuture
+ future.Result = future.result
+ return nil
+}
+
+// result is the default implementation for AccountsUpdateFuture.Result.
+func (future *AccountsUpdateFuture) result(client AccountsClient) (a Account, err error) {
+ var done bool
+ done, err = future.DoneWithContext(context.Background(), client)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "netapp.AccountsUpdateFuture", "Result", future.Response(), "Polling failure")
+ return
+ }
+ if !done {
+ a.Response.Response = future.Response()
+ err = azure.NewAsyncOpIncompleteError("netapp.AccountsUpdateFuture")
+ return
+ }
+ sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
+ if a.Response.Response, err = future.GetResult(sender); err == nil && a.Response.Response.StatusCode != http.StatusNoContent {
+ a, err = client.UpdateResponder(a.Response.Response)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "netapp.AccountsUpdateFuture", "Result", a.Response.Response, "Failure responding to request")
+ }
+ }
+ return
+}
+
+// ActiveDirectory active Directory
+type ActiveDirectory struct {
+ // ActiveDirectoryID - Id of the Active Directory
+ ActiveDirectoryID *string `json:"activeDirectoryId,omitempty"`
+ // Username - Username of Active Directory domain administrator
+ Username *string `json:"username,omitempty"`
+ // Password - Plain text password of Active Directory domain administrator, value is masked in the response
+ Password *string `json:"password,omitempty"`
+ // Domain - Name of the Active Directory domain
+ Domain *string `json:"domain,omitempty"`
+ // DNS - Comma separated list of DNS server IP addresses (IPv4 only) for the Active Directory domain
+ DNS *string `json:"dns,omitempty"`
+ // Status - READ-ONLY; Status of the Active Directory. Possible values include: 'Created', 'InUse', 'Deleted', 'Error', 'Updating'
+ Status ActiveDirectoryStatus `json:"status,omitempty"`
+ // StatusDetails - READ-ONLY; Any details in regards to the Status of the Active Directory
+ StatusDetails *string `json:"statusDetails,omitempty"`
+ // SmbServerName - NetBIOS name of the SMB server. This name will be registered as a computer account in the AD and used to mount volumes
+ SmbServerName *string `json:"smbServerName,omitempty"`
+ // OrganizationalUnit - The Organizational Unit (OU) within the Windows Active Directory
+ OrganizationalUnit *string `json:"organizationalUnit,omitempty"`
+ // Site - The Active Directory site the service will limit Domain Controller discovery to
+ Site *string `json:"site,omitempty"`
+ // BackupOperators - Users to be added to the Built-in Backup Operator active directory group. A list of unique usernames without domain specifier
+ BackupOperators *[]string `json:"backupOperators,omitempty"`
+ // KdcIP - kdc server IP addresses for the active directory machine. This optional parameter is used only while creating kerberos volume.
+ KdcIP *string `json:"kdcIP,omitempty"`
+ // AdName - Name of the active directory machine. This optional parameter is used only while creating kerberos volume
+ AdName *string `json:"adName,omitempty"`
+ // ServerRootCACertificate - When LDAP over SSL/TLS is enabled, the LDAP client is required to have base64 encoded Active Directory Certificate Service's self-signed root CA certificate, this optional parameter is used only for dual protocol with LDAP user-mapping volumes.
+ ServerRootCACertificate *string `json:"serverRootCACertificate,omitempty"`
+ // AesEncryption - If enabled, AES encryption will be enabled for SMB communication.
+ AesEncryption *bool `json:"aesEncryption,omitempty"`
+ // LdapSigning - Specifies whether or not the LDAP traffic needs to be signed.
+ LdapSigning *bool `json:"ldapSigning,omitempty"`
+ // SecurityOperators - Domain Users in the Active directory to be given SeSecurityPrivilege privilege (Needed for SMB Continuously available shares for SQL). A list of unique usernames without domain specifier
+ SecurityOperators *[]string `json:"securityOperators,omitempty"`
+ // LdapOverTLS - Specifies whether or not the LDAP traffic needs to be secured via TLS.
+ LdapOverTLS *bool `json:"ldapOverTLS,omitempty"`
+ // AllowLocalNfsUsersWithLdap - If enabled, NFS client local users can also (in addition to LDAP users) access the NFS volumes.
+ AllowLocalNfsUsersWithLdap *bool `json:"allowLocalNfsUsersWithLdap,omitempty"`
+}
+
+// MarshalJSON is the custom marshaler for ActiveDirectory.
+func (ad ActiveDirectory) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]interface{})
+ if ad.ActiveDirectoryID != nil {
+ objectMap["activeDirectoryId"] = ad.ActiveDirectoryID
+ }
+ if ad.Username != nil {
+ objectMap["username"] = ad.Username
+ }
+ if ad.Password != nil {
+ objectMap["password"] = ad.Password
+ }
+ if ad.Domain != nil {
+ objectMap["domain"] = ad.Domain
+ }
+ if ad.DNS != nil {
+ objectMap["dns"] = ad.DNS
+ }
+ if ad.SmbServerName != nil {
+ objectMap["smbServerName"] = ad.SmbServerName
+ }
+ if ad.OrganizationalUnit != nil {
+ objectMap["organizationalUnit"] = ad.OrganizationalUnit
+ }
+ if ad.Site != nil {
+ objectMap["site"] = ad.Site
+ }
+ if ad.BackupOperators != nil {
+ objectMap["backupOperators"] = ad.BackupOperators
+ }
+ if ad.KdcIP != nil {
+ objectMap["kdcIP"] = ad.KdcIP
+ }
+ if ad.AdName != nil {
+ objectMap["adName"] = ad.AdName
+ }
+ if ad.ServerRootCACertificate != nil {
+ objectMap["serverRootCACertificate"] = ad.ServerRootCACertificate
+ }
+ if ad.AesEncryption != nil {
+ objectMap["aesEncryption"] = ad.AesEncryption
+ }
+ if ad.LdapSigning != nil {
+ objectMap["ldapSigning"] = ad.LdapSigning
+ }
+ if ad.SecurityOperators != nil {
+ objectMap["securityOperators"] = ad.SecurityOperators
+ }
+ if ad.LdapOverTLS != nil {
+ objectMap["ldapOverTLS"] = ad.LdapOverTLS
+ }
+ if ad.AllowLocalNfsUsersWithLdap != nil {
+ objectMap["allowLocalNfsUsersWithLdap"] = ad.AllowLocalNfsUsersWithLdap
+ }
+ return json.Marshal(objectMap)
+}
+
+// AuthorizeRequest authorize request
+type AuthorizeRequest struct {
+ // RemoteVolumeResourceID - Resource id of the remote volume
+ RemoteVolumeResourceID *string `json:"remoteVolumeResourceId,omitempty"`
+}
+
+// Backup backup of a Volume
+type Backup struct {
+ autorest.Response `json:"-"`
+ // Location - Resource location
+ Location *string `json:"location,omitempty"`
+ // ID - READ-ONLY; Resource Id
+ ID *string `json:"id,omitempty"`
+ // Name - READ-ONLY; Resource name
+ Name *string `json:"name,omitempty"`
+ // Type - READ-ONLY; Resource type
+ Type *string `json:"type,omitempty"`
+ // BackupProperties - Backup Properties
+ *BackupProperties `json:"properties,omitempty"`
+}
+
+// MarshalJSON is the custom marshaler for Backup.
+func (b Backup) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]interface{})
+ if b.Location != nil {
+ objectMap["location"] = b.Location
+ }
+ if b.BackupProperties != nil {
+ objectMap["properties"] = b.BackupProperties
+ }
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON is the custom unmarshaler for Backup struct.
+func (b *Backup) UnmarshalJSON(body []byte) error {
+ var m map[string]*json.RawMessage
+ err := json.Unmarshal(body, &m)
+ if err != nil {
+ return err
+ }
+ for k, v := range m {
+ switch k {
+ case "location":
+ if v != nil {
+ var location string
+ err = json.Unmarshal(*v, &location)
+ if err != nil {
+ return err
+ }
+ b.Location = &location
+ }
+ case "id":
+ if v != nil {
+ var ID string
+ err = json.Unmarshal(*v, &ID)
+ if err != nil {
+ return err
+ }
+ b.ID = &ID
+ }
+ case "name":
+ if v != nil {
+ var name string
+ err = json.Unmarshal(*v, &name)
+ if err != nil {
+ return err
+ }
+ b.Name = &name
+ }
+ case "type":
+ if v != nil {
+ var typeVar string
+ err = json.Unmarshal(*v, &typeVar)
+ if err != nil {
+ return err
+ }
+ b.Type = &typeVar
+ }
+ case "properties":
+ if v != nil {
+ var backupProperties BackupProperties
+ err = json.Unmarshal(*v, &backupProperties)
+ if err != nil {
+ return err
+ }
+ b.BackupProperties = &backupProperties
+ }
+ }
+ }
+
+ return nil
+}
+
+// BackupPatch backup patch
+type BackupPatch struct {
+ // Tags - Resource tags
+ Tags map[string]*string `json:"tags"`
+ // BackupProperties - Backup Properties
+ *BackupProperties `json:"properties,omitempty"`
+}
+
+// MarshalJSON is the custom marshaler for BackupPatch.
+func (bp BackupPatch) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]interface{})
+ if bp.Tags != nil {
+ objectMap["tags"] = bp.Tags
+ }
+ if bp.BackupProperties != nil {
+ objectMap["properties"] = bp.BackupProperties
+ }
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON is the custom unmarshaler for BackupPatch struct.
+func (bp *BackupPatch) UnmarshalJSON(body []byte) error {
+ var m map[string]*json.RawMessage
+ err := json.Unmarshal(body, &m)
+ if err != nil {
+ return err
+ }
+ for k, v := range m {
+ switch k {
+ case "tags":
+ if v != nil {
+ var tags map[string]*string
+ err = json.Unmarshal(*v, &tags)
+ if err != nil {
+ return err
+ }
+ bp.Tags = tags
+ }
+ case "properties":
+ if v != nil {
+ var backupProperties BackupProperties
+ err = json.Unmarshal(*v, &backupProperties)
+ if err != nil {
+ return err
+ }
+ bp.BackupProperties = &backupProperties
+ }
+ }
+ }
+
+ return nil
+}
+
+// BackupPoliciesCreateFuture an abstraction for monitoring and retrieving the results of a long-running
+// operation.
+type BackupPoliciesCreateFuture struct {
+ azure.FutureAPI
+ // Result returns the result of the asynchronous operation.
+ // If the operation has not completed it will return an error.
+ Result func(BackupPoliciesClient) (BackupPolicy, error)
+}
+
+// UnmarshalJSON is the custom unmarshaller for CreateFuture.
+func (future *BackupPoliciesCreateFuture) UnmarshalJSON(body []byte) error {
+ var azFuture azure.Future
+ if err := json.Unmarshal(body, &azFuture); err != nil {
+ return err
+ }
+ future.FutureAPI = &azFuture
+ future.Result = future.result
+ return nil
+}
+
+// result is the default implementation for BackupPoliciesCreateFuture.Result.
+func (future *BackupPoliciesCreateFuture) result(client BackupPoliciesClient) (bp BackupPolicy, err error) {
+ var done bool
+ done, err = future.DoneWithContext(context.Background(), client)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "netapp.BackupPoliciesCreateFuture", "Result", future.Response(), "Polling failure")
+ return
+ }
+ if !done {
+ bp.Response.Response = future.Response()
+ err = azure.NewAsyncOpIncompleteError("netapp.BackupPoliciesCreateFuture")
+ return
+ }
+ sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
+ if bp.Response.Response, err = future.GetResult(sender); err == nil && bp.Response.Response.StatusCode != http.StatusNoContent {
+ bp, err = client.CreateResponder(bp.Response.Response)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "netapp.BackupPoliciesCreateFuture", "Result", bp.Response.Response, "Failure responding to request")
+ }
+ }
+ return
+}
+
+// BackupPoliciesDeleteFuture an abstraction for monitoring and retrieving the results of a long-running
+// operation.
+type BackupPoliciesDeleteFuture struct {
+ azure.FutureAPI
+ // Result returns the result of the asynchronous operation.
+ // If the operation has not completed it will return an error.
+ Result func(BackupPoliciesClient) (autorest.Response, error)
+}
+
+// UnmarshalJSON is the custom unmarshaller for CreateFuture.
+func (future *BackupPoliciesDeleteFuture) UnmarshalJSON(body []byte) error {
+ var azFuture azure.Future
+ if err := json.Unmarshal(body, &azFuture); err != nil {
+ return err
+ }
+ future.FutureAPI = &azFuture
+ future.Result = future.result
+ return nil
+}
+
+// result is the default implementation for BackupPoliciesDeleteFuture.Result.
+func (future *BackupPoliciesDeleteFuture) result(client BackupPoliciesClient) (ar autorest.Response, err error) {
+ var done bool
+ done, err = future.DoneWithContext(context.Background(), client)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "netapp.BackupPoliciesDeleteFuture", "Result", future.Response(), "Polling failure")
+ return
+ }
+ if !done {
+ ar.Response = future.Response()
+ err = azure.NewAsyncOpIncompleteError("netapp.BackupPoliciesDeleteFuture")
+ return
+ }
+ ar.Response = future.Response()
+ return
+}
+
+// BackupPoliciesList list of Backup Policies
+type BackupPoliciesList struct {
+ autorest.Response `json:"-"`
+ // Value - A list of backup policies
+ Value *[]BackupPolicy `json:"value,omitempty"`
+}
+
+// BackupPoliciesUpdateFuture an abstraction for monitoring and retrieving the results of a long-running
+// operation.
+type BackupPoliciesUpdateFuture struct {
+ azure.FutureAPI
+ // Result returns the result of the asynchronous operation.
+ // If the operation has not completed it will return an error.
+ Result func(BackupPoliciesClient) (BackupPolicy, error)
+}
+
+// UnmarshalJSON is the custom unmarshaller for CreateFuture.
+func (future *BackupPoliciesUpdateFuture) UnmarshalJSON(body []byte) error {
+ var azFuture azure.Future
+ if err := json.Unmarshal(body, &azFuture); err != nil {
+ return err
+ }
+ future.FutureAPI = &azFuture
+ future.Result = future.result
+ return nil
+}
+
+// result is the default implementation for BackupPoliciesUpdateFuture.Result.
+func (future *BackupPoliciesUpdateFuture) result(client BackupPoliciesClient) (bp BackupPolicy, err error) {
+ var done bool
+ done, err = future.DoneWithContext(context.Background(), client)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "netapp.BackupPoliciesUpdateFuture", "Result", future.Response(), "Polling failure")
+ return
+ }
+ if !done {
+ bp.Response.Response = future.Response()
+ err = azure.NewAsyncOpIncompleteError("netapp.BackupPoliciesUpdateFuture")
+ return
+ }
+ sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
+ if bp.Response.Response, err = future.GetResult(sender); err == nil && bp.Response.Response.StatusCode != http.StatusNoContent {
+ bp, err = client.UpdateResponder(bp.Response.Response)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "netapp.BackupPoliciesUpdateFuture", "Result", bp.Response.Response, "Failure responding to request")
+ }
+ }
+ return
+}
+
+// BackupPolicy backup policy information
+type BackupPolicy struct {
+ autorest.Response `json:"-"`
+ // Location - Resource location
+ Location *string `json:"location,omitempty"`
+ // ID - READ-ONLY; Resource Id
+ ID *string `json:"id,omitempty"`
+ // Name - READ-ONLY; Resource name
+ Name *string `json:"name,omitempty"`
+ // Type - READ-ONLY; Resource type
+ Type *string `json:"type,omitempty"`
+ // Tags - Resource tags
+ Tags map[string]*string `json:"tags"`
+ // BackupPolicyProperties - Backup policy Properties
+ *BackupPolicyProperties `json:"properties,omitempty"`
+}
+
+// MarshalJSON is the custom marshaler for BackupPolicy.
+func (bp BackupPolicy) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]interface{})
+ if bp.Location != nil {
+ objectMap["location"] = bp.Location
+ }
+ if bp.Tags != nil {
+ objectMap["tags"] = bp.Tags
+ }
+ if bp.BackupPolicyProperties != nil {
+ objectMap["properties"] = bp.BackupPolicyProperties
+ }
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON is the custom unmarshaler for BackupPolicy struct.
+func (bp *BackupPolicy) UnmarshalJSON(body []byte) error {
+ var m map[string]*json.RawMessage
+ err := json.Unmarshal(body, &m)
+ if err != nil {
+ return err
+ }
+ for k, v := range m {
+ switch k {
+ case "location":
+ if v != nil {
+ var location string
+ err = json.Unmarshal(*v, &location)
+ if err != nil {
+ return err
+ }
+ bp.Location = &location
+ }
+ case "id":
+ if v != nil {
+ var ID string
+ err = json.Unmarshal(*v, &ID)
+ if err != nil {
+ return err
+ }
+ bp.ID = &ID
+ }
+ case "name":
+ if v != nil {
+ var name string
+ err = json.Unmarshal(*v, &name)
+ if err != nil {
+ return err
+ }
+ bp.Name = &name
+ }
+ case "type":
+ if v != nil {
+ var typeVar string
+ err = json.Unmarshal(*v, &typeVar)
+ if err != nil {
+ return err
+ }
+ bp.Type = &typeVar
+ }
+ case "tags":
+ if v != nil {
+ var tags map[string]*string
+ err = json.Unmarshal(*v, &tags)
+ if err != nil {
+ return err
+ }
+ bp.Tags = tags
+ }
+ case "properties":
+ if v != nil {
+ var backupPolicyProperties BackupPolicyProperties
+ err = json.Unmarshal(*v, &backupPolicyProperties)
+ if err != nil {
+ return err
+ }
+ bp.BackupPolicyProperties = &backupPolicyProperties
+ }
+ }
+ }
+
+ return nil
+}
+
+// BackupPolicyDetails backup policy properties
+type BackupPolicyDetails struct {
+ // Location - Resource location
+ Location *string `json:"location,omitempty"`
+ // ID - READ-ONLY; Resource Id
+ ID *string `json:"id,omitempty"`
+ // Name - READ-ONLY; Resource name
+ Name *string `json:"name,omitempty"`
+ // Type - READ-ONLY; Resource type
+ Type *string `json:"type,omitempty"`
+ // Tags - Resource tags
+ Tags map[string]*string `json:"tags"`
+ // BackupPolicyProperties - Backup policy Properties
+ *BackupPolicyProperties `json:"properties,omitempty"`
+}
+
+// MarshalJSON is the custom marshaler for BackupPolicyDetails.
+func (bpd BackupPolicyDetails) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]interface{})
+ if bpd.Location != nil {
+ objectMap["location"] = bpd.Location
+ }
+ if bpd.Tags != nil {
+ objectMap["tags"] = bpd.Tags
+ }
+ if bpd.BackupPolicyProperties != nil {
+ objectMap["properties"] = bpd.BackupPolicyProperties
+ }
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON is the custom unmarshaler for BackupPolicyDetails struct.
+func (bpd *BackupPolicyDetails) UnmarshalJSON(body []byte) error {
+ var m map[string]*json.RawMessage
+ err := json.Unmarshal(body, &m)
+ if err != nil {
+ return err
+ }
+ for k, v := range m {
+ switch k {
+ case "location":
+ if v != nil {
+ var location string
+ err = json.Unmarshal(*v, &location)
+ if err != nil {
+ return err
+ }
+ bpd.Location = &location
+ }
+ case "id":
+ if v != nil {
+ var ID string
+ err = json.Unmarshal(*v, &ID)
+ if err != nil {
+ return err
+ }
+ bpd.ID = &ID
+ }
+ case "name":
+ if v != nil {
+ var name string
+ err = json.Unmarshal(*v, &name)
+ if err != nil {
+ return err
+ }
+ bpd.Name = &name
+ }
+ case "type":
+ if v != nil {
+ var typeVar string
+ err = json.Unmarshal(*v, &typeVar)
+ if err != nil {
+ return err
+ }
+ bpd.Type = &typeVar
+ }
+ case "tags":
+ if v != nil {
+ var tags map[string]*string
+ err = json.Unmarshal(*v, &tags)
+ if err != nil {
+ return err
+ }
+ bpd.Tags = tags
+ }
+ case "properties":
+ if v != nil {
+ var backupPolicyProperties BackupPolicyProperties
+ err = json.Unmarshal(*v, &backupPolicyProperties)
+ if err != nil {
+ return err
+ }
+ bpd.BackupPolicyProperties = &backupPolicyProperties
+ }
+ }
+ }
+
+ return nil
+}
+
+// BackupPolicyPatch backup policy Details for create and update
+type BackupPolicyPatch struct {
+ // Location - Resource location
+ Location *string `json:"location,omitempty"`
+ // ID - READ-ONLY; Resource Id
+ ID *string `json:"id,omitempty"`
+ // Name - READ-ONLY; Resource name
+ Name *string `json:"name,omitempty"`
+ // Type - READ-ONLY; Resource type
+ Type *string `json:"type,omitempty"`
+ // Tags - Resource tags
+ Tags map[string]*string `json:"tags"`
+ // BackupPolicyProperties - Backup policy Properties
+ *BackupPolicyProperties `json:"properties,omitempty"`
+}
+
+// MarshalJSON is the custom marshaler for BackupPolicyPatch.
+func (bpp BackupPolicyPatch) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]interface{})
+ if bpp.Location != nil {
+ objectMap["location"] = bpp.Location
+ }
+ if bpp.Tags != nil {
+ objectMap["tags"] = bpp.Tags
+ }
+ if bpp.BackupPolicyProperties != nil {
+ objectMap["properties"] = bpp.BackupPolicyProperties
+ }
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON is the custom unmarshaler for BackupPolicyPatch struct.
+func (bpp *BackupPolicyPatch) UnmarshalJSON(body []byte) error {
+ var m map[string]*json.RawMessage
+ err := json.Unmarshal(body, &m)
+ if err != nil {
+ return err
+ }
+ for k, v := range m {
+ switch k {
+ case "location":
+ if v != nil {
+ var location string
+ err = json.Unmarshal(*v, &location)
+ if err != nil {
+ return err
+ }
+ bpp.Location = &location
+ }
+ case "id":
+ if v != nil {
+ var ID string
+ err = json.Unmarshal(*v, &ID)
+ if err != nil {
+ return err
+ }
+ bpp.ID = &ID
+ }
+ case "name":
+ if v != nil {
+ var name string
+ err = json.Unmarshal(*v, &name)
+ if err != nil {
+ return err
+ }
+ bpp.Name = &name
+ }
+ case "type":
+ if v != nil {
+ var typeVar string
+ err = json.Unmarshal(*v, &typeVar)
+ if err != nil {
+ return err
+ }
+ bpp.Type = &typeVar
+ }
+ case "tags":
+ if v != nil {
+ var tags map[string]*string
+ err = json.Unmarshal(*v, &tags)
+ if err != nil {
+ return err
+ }
+ bpp.Tags = tags
+ }
+ case "properties":
+ if v != nil {
+ var backupPolicyProperties BackupPolicyProperties
+ err = json.Unmarshal(*v, &backupPolicyProperties)
+ if err != nil {
+ return err
+ }
+ bpp.BackupPolicyProperties = &backupPolicyProperties
+ }
+ }
+ }
+
+ return nil
+}
+
+// BackupPolicyProperties backup policy properties
+type BackupPolicyProperties struct {
+ // Name - READ-ONLY; Name of backup policy
+ Name *string `json:"name,omitempty"`
+ // ProvisioningState - READ-ONLY; Azure lifecycle management
+ ProvisioningState *string `json:"provisioningState,omitempty"`
+ // DailyBackupsToKeep - Daily backups count to keep
+ DailyBackupsToKeep *int32 `json:"dailyBackupsToKeep,omitempty"`
+ // WeeklyBackupsToKeep - Weekly backups count to keep
+ WeeklyBackupsToKeep *int32 `json:"weeklyBackupsToKeep,omitempty"`
+ // MonthlyBackupsToKeep - Monthly backups count to keep
+ MonthlyBackupsToKeep *int32 `json:"monthlyBackupsToKeep,omitempty"`
+ // YearlyBackupsToKeep - Yearly backups count to keep
+ YearlyBackupsToKeep *int32 `json:"yearlyBackupsToKeep,omitempty"`
+ // VolumesAssigned - Volumes using current backup policy
+ VolumesAssigned *int32 `json:"volumesAssigned,omitempty"`
+ // Enabled - The property to decide policy is enabled or not
+ Enabled *bool `json:"enabled,omitempty"`
+ // VolumeBackups - A list of volumes assigned to this policy
+ VolumeBackups *[]VolumeBackups `json:"volumeBackups,omitempty"`
+}
+
+// MarshalJSON is the custom marshaler for BackupPolicyProperties.
+func (bpp BackupPolicyProperties) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]interface{})
+ if bpp.DailyBackupsToKeep != nil {
+ objectMap["dailyBackupsToKeep"] = bpp.DailyBackupsToKeep
+ }
+ if bpp.WeeklyBackupsToKeep != nil {
+ objectMap["weeklyBackupsToKeep"] = bpp.WeeklyBackupsToKeep
+ }
+ if bpp.MonthlyBackupsToKeep != nil {
+ objectMap["monthlyBackupsToKeep"] = bpp.MonthlyBackupsToKeep
+ }
+ if bpp.YearlyBackupsToKeep != nil {
+ objectMap["yearlyBackupsToKeep"] = bpp.YearlyBackupsToKeep
+ }
+ if bpp.VolumesAssigned != nil {
+ objectMap["volumesAssigned"] = bpp.VolumesAssigned
+ }
+ if bpp.Enabled != nil {
+ objectMap["enabled"] = bpp.Enabled
+ }
+ if bpp.VolumeBackups != nil {
+ objectMap["volumeBackups"] = bpp.VolumeBackups
+ }
+ return json.Marshal(objectMap)
+}
+
+// BackupProperties backup properties
+type BackupProperties struct {
+ // BackupID - READ-ONLY; UUID v4 used to identify the Backup
+ BackupID *string `json:"backupId,omitempty"`
+ // CreationDate - READ-ONLY; The creation date of the backup
+ CreationDate *date.Time `json:"creationDate,omitempty"`
+ // ProvisioningState - READ-ONLY; Azure lifecycle management
+ ProvisioningState *string `json:"provisioningState,omitempty"`
+ // Size - READ-ONLY; Size of backup
+ Size *int64 `json:"size,omitempty"`
+ // Label - Label for backup
+ Label *string `json:"label,omitempty"`
+ // BackupType - READ-ONLY; Type of backup Manual or Scheduled. Possible values include: 'Manual', 'Scheduled'
+ BackupType BackupType `json:"backupType,omitempty"`
+ // FailureReason - READ-ONLY; Failure reason
+ FailureReason *string `json:"failureReason,omitempty"`
+ // VolumeName - READ-ONLY; Volume name
+ VolumeName *string `json:"volumeName,omitempty"`
+ // UseExistingSnapshot - Manual backup an already existing snapshot. This will always be false for scheduled backups and true/false for manual backups
+ UseExistingSnapshot *bool `json:"useExistingSnapshot,omitempty"`
+}
+
+// MarshalJSON is the custom marshaler for BackupProperties.
+func (bp BackupProperties) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]interface{})
+ if bp.Label != nil {
+ objectMap["label"] = bp.Label
+ }
+ if bp.UseExistingSnapshot != nil {
+ objectMap["useExistingSnapshot"] = bp.UseExistingSnapshot
+ }
+ return json.Marshal(objectMap)
+}
+
+// BackupsCreateFuture an abstraction for monitoring and retrieving the results of a long-running
+// operation.
+type BackupsCreateFuture struct {
+ azure.FutureAPI
+ // Result returns the result of the asynchronous operation.
+ // If the operation has not completed it will return an error.
+ Result func(BackupsClient) (Backup, error)
+}
+
+// UnmarshalJSON is the custom unmarshaller for CreateFuture.
+func (future *BackupsCreateFuture) UnmarshalJSON(body []byte) error {
+ var azFuture azure.Future
+ if err := json.Unmarshal(body, &azFuture); err != nil {
+ return err
+ }
+ future.FutureAPI = &azFuture
+ future.Result = future.result
+ return nil
+}
+
+// result is the default implementation for BackupsCreateFuture.Result.
+func (future *BackupsCreateFuture) result(client BackupsClient) (b Backup, err error) {
+ var done bool
+ done, err = future.DoneWithContext(context.Background(), client)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "netapp.BackupsCreateFuture", "Result", future.Response(), "Polling failure")
+ return
+ }
+ if !done {
+ b.Response.Response = future.Response()
+ err = azure.NewAsyncOpIncompleteError("netapp.BackupsCreateFuture")
+ return
+ }
+ sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
+ if b.Response.Response, err = future.GetResult(sender); err == nil && b.Response.Response.StatusCode != http.StatusNoContent {
+ b, err = client.CreateResponder(b.Response.Response)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "netapp.BackupsCreateFuture", "Result", b.Response.Response, "Failure responding to request")
+ }
+ }
+ return
+}
+
+// BackupsDeleteFuture an abstraction for monitoring and retrieving the results of a long-running
+// operation.
+type BackupsDeleteFuture struct {
+ azure.FutureAPI
+ // Result returns the result of the asynchronous operation.
+ // If the operation has not completed it will return an error.
+ Result func(BackupsClient) (autorest.Response, error)
+}
+
+// UnmarshalJSON is the custom unmarshaller for CreateFuture.
+func (future *BackupsDeleteFuture) UnmarshalJSON(body []byte) error {
+ var azFuture azure.Future
+ if err := json.Unmarshal(body, &azFuture); err != nil {
+ return err
+ }
+ future.FutureAPI = &azFuture
+ future.Result = future.result
+ return nil
+}
+
+// result is the default implementation for BackupsDeleteFuture.Result.
+func (future *BackupsDeleteFuture) result(client BackupsClient) (ar autorest.Response, err error) {
+ var done bool
+ done, err = future.DoneWithContext(context.Background(), client)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "netapp.BackupsDeleteFuture", "Result", future.Response(), "Polling failure")
+ return
+ }
+ if !done {
+ ar.Response = future.Response()
+ err = azure.NewAsyncOpIncompleteError("netapp.BackupsDeleteFuture")
+ return
+ }
+ ar.Response = future.Response()
+ return
+}
+
+// BackupsList list of Backups
+type BackupsList struct {
+ autorest.Response `json:"-"`
+ // Value - A list of Backups
+ Value *[]Backup `json:"value,omitempty"`
+}
+
+// BackupStatus backup status
+type BackupStatus struct {
+ autorest.Response `json:"-"`
+ // Healthy - READ-ONLY; Backup health status
+ Healthy *bool `json:"healthy,omitempty"`
+ // RelationshipStatus - READ-ONLY; Status of the backup mirror relationship. Possible values include: 'Idle', 'Transferring'
+ RelationshipStatus RelationshipStatus `json:"relationshipStatus,omitempty"`
+ // MirrorState - READ-ONLY; The status of the backup. Possible values include: 'Uninitialized', 'Mirrored', 'Broken'
+ MirrorState MirrorState `json:"mirrorState,omitempty"`
+ // UnhealthyReason - READ-ONLY; Reason for the unhealthy backup relationship
+ UnhealthyReason *string `json:"unhealthyReason,omitempty"`
+ // ErrorMessage - READ-ONLY; Displays error message if the backup is in an error state
+ ErrorMessage *string `json:"errorMessage,omitempty"`
+}
+
+// MarshalJSON is the custom marshaler for BackupStatus.
+func (bs BackupStatus) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]interface{})
+ return json.Marshal(objectMap)
+}
+
+// BackupsUpdateFuture an abstraction for monitoring and retrieving the results of a long-running
+// operation.
+type BackupsUpdateFuture struct {
+ azure.FutureAPI
+ // Result returns the result of the asynchronous operation.
+ // If the operation has not completed it will return an error.
+ Result func(BackupsClient) (Backup, error)
+}
+
+// UnmarshalJSON is the custom unmarshaller for CreateFuture.
+func (future *BackupsUpdateFuture) UnmarshalJSON(body []byte) error {
+ var azFuture azure.Future
+ if err := json.Unmarshal(body, &azFuture); err != nil {
+ return err
+ }
+ future.FutureAPI = &azFuture
+ future.Result = future.result
+ return nil
+}
+
+// result is the default implementation for BackupsUpdateFuture.Result.
+func (future *BackupsUpdateFuture) result(client BackupsClient) (b Backup, err error) {
+ var done bool
+ done, err = future.DoneWithContext(context.Background(), client)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "netapp.BackupsUpdateFuture", "Result", future.Response(), "Polling failure")
+ return
+ }
+ if !done {
+ b.Response.Response = future.Response()
+ err = azure.NewAsyncOpIncompleteError("netapp.BackupsUpdateFuture")
+ return
+ }
+ sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
+ if b.Response.Response, err = future.GetResult(sender); err == nil && b.Response.Response.StatusCode != http.StatusNoContent {
+ b, err = client.UpdateResponder(b.Response.Response)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "netapp.BackupsUpdateFuture", "Result", b.Response.Response, "Failure responding to request")
+ }
+ }
+ return
+}
+
+// BreakReplicationRequest break replication request
+type BreakReplicationRequest struct {
+ // ForceBreakReplication - If replication is in status transferring and you want to force break the replication, set to true
+ ForceBreakReplication *bool `json:"forceBreakReplication,omitempty"`
+}
+
+// CapacityPool capacity pool resource
+type CapacityPool struct {
+ autorest.Response `json:"-"`
+ // Location - Resource location
+ Location *string `json:"location,omitempty"`
+ // ID - READ-ONLY; Resource Id
+ ID *string `json:"id,omitempty"`
+ // Name - READ-ONLY; Resource name
+ Name *string `json:"name,omitempty"`
+ // Type - READ-ONLY; Resource type
+ Type *string `json:"type,omitempty"`
+ // Tags - Resource tags
+ Tags map[string]*string `json:"tags"`
+ // PoolProperties - Capacity pool properties
+ *PoolProperties `json:"properties,omitempty"`
+}
+
+// MarshalJSON is the custom marshaler for CapacityPool.
+func (cp CapacityPool) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]interface{})
+ if cp.Location != nil {
+ objectMap["location"] = cp.Location
+ }
+ if cp.Tags != nil {
+ objectMap["tags"] = cp.Tags
+ }
+ if cp.PoolProperties != nil {
+ objectMap["properties"] = cp.PoolProperties
+ }
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON is the custom unmarshaler for CapacityPool struct.
+func (cp *CapacityPool) UnmarshalJSON(body []byte) error {
+ var m map[string]*json.RawMessage
+ err := json.Unmarshal(body, &m)
+ if err != nil {
+ return err
+ }
+ for k, v := range m {
+ switch k {
+ case "location":
+ if v != nil {
+ var location string
+ err = json.Unmarshal(*v, &location)
+ if err != nil {
+ return err
+ }
+ cp.Location = &location
+ }
+ case "id":
+ if v != nil {
+ var ID string
+ err = json.Unmarshal(*v, &ID)
+ if err != nil {
+ return err
+ }
+ cp.ID = &ID
+ }
+ case "name":
+ if v != nil {
+ var name string
+ err = json.Unmarshal(*v, &name)
+ if err != nil {
+ return err
+ }
+ cp.Name = &name
+ }
+ case "type":
+ if v != nil {
+ var typeVar string
+ err = json.Unmarshal(*v, &typeVar)
+ if err != nil {
+ return err
+ }
+ cp.Type = &typeVar
+ }
+ case "tags":
+ if v != nil {
+ var tags map[string]*string
+ err = json.Unmarshal(*v, &tags)
+ if err != nil {
+ return err
+ }
+ cp.Tags = tags
+ }
+ case "properties":
+ if v != nil {
+ var poolProperties PoolProperties
+ err = json.Unmarshal(*v, &poolProperties)
+ if err != nil {
+ return err
+ }
+ cp.PoolProperties = &poolProperties
+ }
+ }
+ }
+
+ return nil
+}
+
+// CapacityPoolList list of capacity pool resources
+type CapacityPoolList struct {
+ autorest.Response `json:"-"`
+ // Value - List of Capacity pools
+ Value *[]CapacityPool `json:"value,omitempty"`
+ // NextLink - URL to get the next set of results.
+ NextLink *string `json:"nextLink,omitempty"`
+}
+
+// CapacityPoolListIterator provides access to a complete listing of CapacityPool values.
+type CapacityPoolListIterator struct {
+ i int
+ page CapacityPoolListPage
+}
+
+// NextWithContext advances to the next value. If there was an error making
+// the request the iterator does not advance and the error is returned.
+func (iter *CapacityPoolListIterator) NextWithContext(ctx context.Context) (err error) {
+ if tracing.IsEnabled() {
+ ctx = tracing.StartSpan(ctx, fqdn+"/CapacityPoolListIterator.NextWithContext")
+ defer func() {
+ sc := -1
+ if iter.Response().Response.Response != nil {
+ sc = iter.Response().Response.Response.StatusCode
+ }
+ tracing.EndSpan(ctx, sc, err)
+ }()
+ }
+ iter.i++
+ if iter.i < len(iter.page.Values()) {
+ return nil
+ }
+ err = iter.page.NextWithContext(ctx)
+ if err != nil {
+ iter.i--
+ return err
+ }
+ iter.i = 0
+ return nil
+}
+
+// Next advances to the next value. If there was an error making
+// the request the iterator does not advance and the error is returned.
+// Deprecated: Use NextWithContext() instead.
+func (iter *CapacityPoolListIterator) Next() error {
+ return iter.NextWithContext(context.Background())
+}
+
+// NotDone returns true if the enumeration should be started or is not yet complete.
+func (iter CapacityPoolListIterator) NotDone() bool {
+ return iter.page.NotDone() && iter.i < len(iter.page.Values())
+}
+
+// Response returns the raw server response from the last page request.
+func (iter CapacityPoolListIterator) Response() CapacityPoolList {
+ return iter.page.Response()
+}
+
+// Value returns the current value or a zero-initialized value if the
+// iterator has advanced beyond the end of the collection.
+func (iter CapacityPoolListIterator) Value() CapacityPool {
+ if !iter.page.NotDone() {
+ return CapacityPool{}
+ }
+ return iter.page.Values()[iter.i]
+}
+
+// Creates a new instance of the CapacityPoolListIterator type.
+func NewCapacityPoolListIterator(page CapacityPoolListPage) CapacityPoolListIterator {
+ return CapacityPoolListIterator{page: page}
+}
+
+// IsEmpty returns true if the ListResult contains no values.
+func (cpl CapacityPoolList) IsEmpty() bool {
+ return cpl.Value == nil || len(*cpl.Value) == 0
+}
+
+// hasNextLink returns true if the NextLink is not empty.
+func (cpl CapacityPoolList) hasNextLink() bool {
+ return cpl.NextLink != nil && len(*cpl.NextLink) != 0
+}
+
+// capacityPoolListPreparer prepares a request to retrieve the next set of results.
+// It returns nil if no more results exist.
+func (cpl CapacityPoolList) capacityPoolListPreparer(ctx context.Context) (*http.Request, error) {
+ if !cpl.hasNextLink() {
+ return nil, nil
+ }
+ return autorest.Prepare((&http.Request{}).WithContext(ctx),
+ autorest.AsJSON(),
+ autorest.AsGet(),
+ autorest.WithBaseURL(to.String(cpl.NextLink)))
+}
+
+// CapacityPoolListPage contains a page of CapacityPool values.
+type CapacityPoolListPage struct {
+ fn func(context.Context, CapacityPoolList) (CapacityPoolList, error)
+ cpl CapacityPoolList
+}
+
+// NextWithContext advances to the next page of values. If there was an error making
+// the request the page does not advance and the error is returned.
+func (page *CapacityPoolListPage) NextWithContext(ctx context.Context) (err error) {
+ if tracing.IsEnabled() {
+ ctx = tracing.StartSpan(ctx, fqdn+"/CapacityPoolListPage.NextWithContext")
+ defer func() {
+ sc := -1
+ if page.Response().Response.Response != nil {
+ sc = page.Response().Response.Response.StatusCode
+ }
+ tracing.EndSpan(ctx, sc, err)
+ }()
+ }
+ for {
+ next, err := page.fn(ctx, page.cpl)
+ if err != nil {
+ return err
+ }
+ page.cpl = next
+ if !next.hasNextLink() || !next.IsEmpty() {
+ break
+ }
+ }
+ return nil
+}
+
+// Next advances to the next page of values. If there was an error making
+// the request the page does not advance and the error is returned.
+// Deprecated: Use NextWithContext() instead.
+func (page *CapacityPoolListPage) Next() error {
+ return page.NextWithContext(context.Background())
+}
+
+// NotDone returns true if the page enumeration should be started or is not yet complete.
+func (page CapacityPoolListPage) NotDone() bool {
+ return !page.cpl.IsEmpty()
+}
+
+// Response returns the raw server response from the last page request.
+func (page CapacityPoolListPage) Response() CapacityPoolList {
+ return page.cpl
+}
+
+// Values returns the slice of values for the current page or nil if there are no values.
+func (page CapacityPoolListPage) Values() []CapacityPool {
+ if page.cpl.IsEmpty() {
+ return nil
+ }
+ return *page.cpl.Value
+}
+
+// Creates a new instance of the CapacityPoolListPage type.
+func NewCapacityPoolListPage(cur CapacityPoolList, getNextPage func(context.Context, CapacityPoolList) (CapacityPoolList, error)) CapacityPoolListPage {
+ return CapacityPoolListPage{
+ fn: getNextPage,
+ cpl: cur,
+ }
+}
+
+// CapacityPoolPatch capacity pool patch resource
+type CapacityPoolPatch struct {
+ // Location - Resource location
+ Location *string `json:"location,omitempty"`
+ // ID - READ-ONLY; Resource Id
+ ID *string `json:"id,omitempty"`
+ // Name - READ-ONLY; Resource name
+ Name *string `json:"name,omitempty"`
+ // Type - READ-ONLY; Resource type
+ Type *string `json:"type,omitempty"`
+ // Tags - Resource tags
+ Tags map[string]*string `json:"tags"`
+ // PoolPatchProperties - Capacity pool properties
+ *PoolPatchProperties `json:"properties,omitempty"`
+}
+
+// MarshalJSON is the custom marshaler for CapacityPoolPatch.
+func (cpp CapacityPoolPatch) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]interface{})
+ if cpp.Location != nil {
+ objectMap["location"] = cpp.Location
+ }
+ if cpp.Tags != nil {
+ objectMap["tags"] = cpp.Tags
+ }
+ if cpp.PoolPatchProperties != nil {
+ objectMap["properties"] = cpp.PoolPatchProperties
+ }
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON is the custom unmarshaler for CapacityPoolPatch struct.
+func (cpp *CapacityPoolPatch) UnmarshalJSON(body []byte) error {
+ var m map[string]*json.RawMessage
+ err := json.Unmarshal(body, &m)
+ if err != nil {
+ return err
+ }
+ for k, v := range m {
+ switch k {
+ case "location":
+ if v != nil {
+ var location string
+ err = json.Unmarshal(*v, &location)
+ if err != nil {
+ return err
+ }
+ cpp.Location = &location
+ }
+ case "id":
+ if v != nil {
+ var ID string
+ err = json.Unmarshal(*v, &ID)
+ if err != nil {
+ return err
+ }
+ cpp.ID = &ID
+ }
+ case "name":
+ if v != nil {
+ var name string
+ err = json.Unmarshal(*v, &name)
+ if err != nil {
+ return err
+ }
+ cpp.Name = &name
+ }
+ case "type":
+ if v != nil {
+ var typeVar string
+ err = json.Unmarshal(*v, &typeVar)
+ if err != nil {
+ return err
+ }
+ cpp.Type = &typeVar
+ }
+ case "tags":
+ if v != nil {
+ var tags map[string]*string
+ err = json.Unmarshal(*v, &tags)
+ if err != nil {
+ return err
+ }
+ cpp.Tags = tags
+ }
+ case "properties":
+ if v != nil {
+ var poolPatchProperties PoolPatchProperties
+ err = json.Unmarshal(*v, &poolPatchProperties)
+ if err != nil {
+ return err
+ }
+ cpp.PoolPatchProperties = &poolPatchProperties
+ }
+ }
+ }
+
+ return nil
+}
+
+// CheckAvailabilityResponse information regarding availability of a resource.
+type CheckAvailabilityResponse struct {
+ autorest.Response `json:"-"`
+ // IsAvailable - true
indicates name is valid and available. false
indicates the name is invalid, unavailable, or both.
+ IsAvailable *bool `json:"isAvailable,omitempty"`
+ // Reason - Invalid
indicates the name provided does not match Azure App Service naming requirements. AlreadyExists
indicates that the name is already in use and is therefore unavailable. Possible values include: 'Invalid', 'AlreadyExists'
+ Reason InAvailabilityReasonType `json:"reason,omitempty"`
+ // Message - If reason == invalid, provide the user with the reason why the given name is invalid, and provide the resource naming requirements so that the user can select a valid name. If reason == AlreadyExists, explain that resource name is already in use, and direct them to select a different name.
+ Message *string `json:"message,omitempty"`
+}
+
+// CloudError an error response from the service.
+type CloudError struct {
+ // Error - Cloud error body.
+ Error *CloudErrorBody `json:"error,omitempty"`
+}
+
+// CloudErrorBody an error response from the service.
+type CloudErrorBody struct {
+ // Code - An identifier for the error. Codes are invariant and are intended to be consumed programmatically.
+ Code *string `json:"code,omitempty"`
+ // Message - A message describing the error, intended to be suitable for display in a user interface.
+ Message *string `json:"message,omitempty"`
+}
+
+// DailySchedule daily Schedule properties
+type DailySchedule struct {
+ // SnapshotsToKeep - Daily snapshot count to keep
+ SnapshotsToKeep *int32 `json:"snapshotsToKeep,omitempty"`
+ // Hour - Indicates which hour in UTC timezone a snapshot should be taken
+ Hour *int32 `json:"hour,omitempty"`
+ // Minute - Indicates which minute snapshot should be taken
+ Minute *int32 `json:"minute,omitempty"`
+ // UsedBytes - Resource size in bytes, current storage usage for the volume in bytes
+ UsedBytes *int64 `json:"usedBytes,omitempty"`
+}
+
+// Dimension dimension of blobs, possibly be blob type or access tier.
+type Dimension struct {
+ // Name - Display name of dimension.
+ Name *string `json:"name,omitempty"`
+ // DisplayName - Display name of dimension.
+ DisplayName *string `json:"displayName,omitempty"`
+}
+
+// ExportPolicyRule volume Export Policy Rule
+type ExportPolicyRule struct {
+ // RuleIndex - Order index
+ RuleIndex *int32 `json:"ruleIndex,omitempty"`
+ // UnixReadOnly - Read only access
+ UnixReadOnly *bool `json:"unixReadOnly,omitempty"`
+ // UnixReadWrite - Read and write access
+ UnixReadWrite *bool `json:"unixReadWrite,omitempty"`
+ // Kerberos5ReadOnly - Kerberos5 Read only access. To be use with swagger version 2020-05-01 or later
+ Kerberos5ReadOnly *bool `json:"kerberos5ReadOnly,omitempty"`
+ // Kerberos5ReadWrite - Kerberos5 Read and write access. To be use with swagger version 2020-05-01 or later
+ Kerberos5ReadWrite *bool `json:"kerberos5ReadWrite,omitempty"`
+ // Kerberos5iReadOnly - Kerberos5i Read only access. To be use with swagger version 2020-05-01 or later
+ Kerberos5iReadOnly *bool `json:"kerberos5iReadOnly,omitempty"`
+ // Kerberos5iReadWrite - Kerberos5i Read and write access. To be use with swagger version 2020-05-01 or later
+ Kerberos5iReadWrite *bool `json:"kerberos5iReadWrite,omitempty"`
+ // Kerberos5pReadOnly - Kerberos5p Read only access. To be use with swagger version 2020-05-01 or later
+ Kerberos5pReadOnly *bool `json:"kerberos5pReadOnly,omitempty"`
+ // Kerberos5pReadWrite - Kerberos5p Read and write access. To be use with swagger version 2020-05-01 or later
+ Kerberos5pReadWrite *bool `json:"kerberos5pReadWrite,omitempty"`
+ // Cifs - Allows CIFS protocol
+ Cifs *bool `json:"cifs,omitempty"`
+ // Nfsv3 - Allows NFSv3 protocol. Enable only for NFSv3 type volumes
+ Nfsv3 *bool `json:"nfsv3,omitempty"`
+ // Nfsv41 - Allows NFSv4.1 protocol. Enable only for NFSv4.1 type volumes
+ Nfsv41 *bool `json:"nfsv41,omitempty"`
+ // AllowedClients - Client ingress specification as comma separated string with IPv4 CIDRs, IPv4 host addresses and host names
+ AllowedClients *string `json:"allowedClients,omitempty"`
+ // HasRootAccess - Has root access to volume
+ HasRootAccess *bool `json:"hasRootAccess,omitempty"`
+}
+
+// HourlySchedule hourly Schedule properties
+type HourlySchedule struct {
+ // SnapshotsToKeep - Hourly snapshot count to keep
+ SnapshotsToKeep *int32 `json:"snapshotsToKeep,omitempty"`
+ // Minute - Indicates which minute snapshot should be taken
+ Minute *int32 `json:"minute,omitempty"`
+ // UsedBytes - Resource size in bytes, current storage usage for the volume in bytes
+ UsedBytes *int64 `json:"usedBytes,omitempty"`
+}
+
+// MetricSpecification metric specification of operation.
+type MetricSpecification struct {
+ // Name - Name of metric specification.
+ Name *string `json:"name,omitempty"`
+ // DisplayName - Display name of metric specification.
+ DisplayName *string `json:"displayName,omitempty"`
+ // DisplayDescription - Display description of metric specification.
+ DisplayDescription *string `json:"displayDescription,omitempty"`
+ // Unit - Unit could be Bytes or Count.
+ Unit *string `json:"unit,omitempty"`
+ // Dimensions - Dimensions of blobs, including blob type and access tier.
+ Dimensions *[]Dimension `json:"dimensions,omitempty"`
+ // AggregationType - Aggregation type could be Average.
+ AggregationType *string `json:"aggregationType,omitempty"`
+ // FillGapWithZero - The property to decide fill gap with zero or not.
+ FillGapWithZero *bool `json:"fillGapWithZero,omitempty"`
+ // Category - The category this metric specification belong to, could be Capacity.
+ Category *string `json:"category,omitempty"`
+ // ResourceIDDimensionNameOverride - Account Resource Id.
+ ResourceIDDimensionNameOverride *string `json:"resourceIdDimensionNameOverride,omitempty"`
+}
+
+// MonthlySchedule monthly Schedule properties
+type MonthlySchedule struct {
+ // SnapshotsToKeep - Monthly snapshot count to keep
+ SnapshotsToKeep *int32 `json:"snapshotsToKeep,omitempty"`
+ // DaysOfMonth - Indicates which days of the month snapshot should be taken. A comma delimited string.
+ DaysOfMonth *string `json:"daysOfMonth,omitempty"`
+ // Hour - Indicates which hour in UTC timezone a snapshot should be taken
+ Hour *int32 `json:"hour,omitempty"`
+ // Minute - Indicates which minute snapshot should be taken
+ Minute *int32 `json:"minute,omitempty"`
+ // UsedBytes - Resource size in bytes, current storage usage for the volume in bytes
+ UsedBytes *int64 `json:"usedBytes,omitempty"`
+}
+
+// MountTarget mount Target
+type MountTarget struct {
+ // Location - Resource location
+ Location *string `json:"location,omitempty"`
+ // ID - READ-ONLY; Resource Id
+ ID *string `json:"id,omitempty"`
+ // Name - READ-ONLY; Resource name
+ Name *string `json:"name,omitempty"`
+ // Type - READ-ONLY; Resource type
+ Type *string `json:"type,omitempty"`
+ // Tags - Resource tags
+ Tags map[string]*string `json:"tags"`
+ // MountTargetProperties - Mount Target Properties
+ *MountTargetProperties `json:"properties,omitempty"`
+}
+
+// MarshalJSON is the custom marshaler for MountTarget.
+func (mt MountTarget) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]interface{})
+ if mt.Location != nil {
+ objectMap["location"] = mt.Location
+ }
+ if mt.Tags != nil {
+ objectMap["tags"] = mt.Tags
+ }
+ if mt.MountTargetProperties != nil {
+ objectMap["properties"] = mt.MountTargetProperties
+ }
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON is the custom unmarshaler for MountTarget struct.
+func (mt *MountTarget) UnmarshalJSON(body []byte) error {
+ var m map[string]*json.RawMessage
+ err := json.Unmarshal(body, &m)
+ if err != nil {
+ return err
+ }
+ for k, v := range m {
+ switch k {
+ case "location":
+ if v != nil {
+ var location string
+ err = json.Unmarshal(*v, &location)
+ if err != nil {
+ return err
+ }
+ mt.Location = &location
+ }
+ case "id":
+ if v != nil {
+ var ID string
+ err = json.Unmarshal(*v, &ID)
+ if err != nil {
+ return err
+ }
+ mt.ID = &ID
+ }
+ case "name":
+ if v != nil {
+ var name string
+ err = json.Unmarshal(*v, &name)
+ if err != nil {
+ return err
+ }
+ mt.Name = &name
+ }
+ case "type":
+ if v != nil {
+ var typeVar string
+ err = json.Unmarshal(*v, &typeVar)
+ if err != nil {
+ return err
+ }
+ mt.Type = &typeVar
+ }
+ case "tags":
+ if v != nil {
+ var tags map[string]*string
+ err = json.Unmarshal(*v, &tags)
+ if err != nil {
+ return err
+ }
+ mt.Tags = tags
+ }
+ case "properties":
+ if v != nil {
+ var mountTargetProperties MountTargetProperties
+ err = json.Unmarshal(*v, &mountTargetProperties)
+ if err != nil {
+ return err
+ }
+ mt.MountTargetProperties = &mountTargetProperties
+ }
+ }
+ }
+
+ return nil
+}
+
+// MountTargetProperties mount target properties
+type MountTargetProperties struct {
+ // MountTargetID - READ-ONLY; UUID v4 used to identify the MountTarget
+ MountTargetID *string `json:"mountTargetId,omitempty"`
+ // FileSystemID - UUID v4 used to identify the MountTarget
+ FileSystemID *string `json:"fileSystemId,omitempty"`
+ // IPAddress - READ-ONLY; The mount target's IPv4 address
+ IPAddress *string `json:"ipAddress,omitempty"`
+ // SmbServerFqdn - The SMB server's Fully Qualified Domain Name, FQDN
+ SmbServerFqdn *string `json:"smbServerFqdn,omitempty"`
+}
+
+// MarshalJSON is the custom marshaler for MountTargetProperties.
+func (mtp MountTargetProperties) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]interface{})
+ if mtp.FileSystemID != nil {
+ objectMap["fileSystemId"] = mtp.FileSystemID
+ }
+ if mtp.SmbServerFqdn != nil {
+ objectMap["smbServerFqdn"] = mtp.SmbServerFqdn
+ }
+ return json.Marshal(objectMap)
+}
+
+// Operation microsoft.NetApp REST API operation definition.
+type Operation struct {
+ // Name - Operation name: {provider}/{resource}/{operation}
+ Name *string `json:"name,omitempty"`
+ // Display - Display metadata associated with the operation.
+ Display *OperationDisplay `json:"display,omitempty"`
+ // Origin - The origin of operations.
+ Origin *string `json:"origin,omitempty"`
+ // OperationProperties - Properties of operation, include metric specifications.
+ *OperationProperties `json:"properties,omitempty"`
+}
+
+// MarshalJSON is the custom marshaler for Operation.
+func (o Operation) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]interface{})
+ if o.Name != nil {
+ objectMap["name"] = o.Name
+ }
+ if o.Display != nil {
+ objectMap["display"] = o.Display
+ }
+ if o.Origin != nil {
+ objectMap["origin"] = o.Origin
+ }
+ if o.OperationProperties != nil {
+ objectMap["properties"] = o.OperationProperties
+ }
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON is the custom unmarshaler for Operation struct.
+func (o *Operation) UnmarshalJSON(body []byte) error {
+ var m map[string]*json.RawMessage
+ err := json.Unmarshal(body, &m)
+ if err != nil {
+ return err
+ }
+ for k, v := range m {
+ switch k {
+ case "name":
+ if v != nil {
+ var name string
+ err = json.Unmarshal(*v, &name)
+ if err != nil {
+ return err
+ }
+ o.Name = &name
+ }
+ case "display":
+ if v != nil {
+ var display OperationDisplay
+ err = json.Unmarshal(*v, &display)
+ if err != nil {
+ return err
+ }
+ o.Display = &display
+ }
+ case "origin":
+ if v != nil {
+ var origin string
+ err = json.Unmarshal(*v, &origin)
+ if err != nil {
+ return err
+ }
+ o.Origin = &origin
+ }
+ case "properties":
+ if v != nil {
+ var operationProperties OperationProperties
+ err = json.Unmarshal(*v, &operationProperties)
+ if err != nil {
+ return err
+ }
+ o.OperationProperties = &operationProperties
+ }
+ }
+ }
+
+ return nil
+}
+
+// OperationDisplay display metadata associated with the operation.
+type OperationDisplay struct {
+ // Provider - Service provider: Microsoft NetApp.
+ Provider *string `json:"provider,omitempty"`
+ // Resource - Resource on which the operation is performed etc.
+ Resource *string `json:"resource,omitempty"`
+ // Operation - Type of operation: get, read, delete, etc.
+ Operation *string `json:"operation,omitempty"`
+ // Description - Operation description.
+ Description *string `json:"description,omitempty"`
+}
+
+// OperationListResult result of the request to list Cloud Volume operations. It contains a list of
+// operations and a URL link to get the next set of results.
+type OperationListResult struct {
+ autorest.Response `json:"-"`
+ // Value - List of Storage operations supported by the Storage resource provider.
+ Value *[]Operation `json:"value,omitempty"`
+}
+
+// OperationProperties properties of operation, include metric specifications.
+type OperationProperties struct {
+ // ServiceSpecification - One property of operation, include metric specifications.
+ ServiceSpecification *ServiceSpecification `json:"serviceSpecification,omitempty"`
+}
+
+// PoolChangeRequest pool change request
+type PoolChangeRequest struct {
+ // NewPoolResourceID - Resource id of the pool to move volume to
+ NewPoolResourceID *string `json:"newPoolResourceId,omitempty"`
+}
+
+// PoolPatchProperties patchable pool properties
+type PoolPatchProperties struct {
+ // Size - Provisioned size of the pool (in bytes). Allowed values are in 4TiB chunks (value must be multiply of 4398046511104).
+ Size *int64 `json:"size,omitempty"`
+ // QosType - The qos type of the pool. Possible values include: 'QosTypeAuto', 'QosTypeManual'
+ QosType QosType `json:"qosType,omitempty"`
+}
+
+// PoolProperties pool properties
+type PoolProperties struct {
+ // PoolID - READ-ONLY; UUID v4 used to identify the Pool
+ PoolID *string `json:"poolId,omitempty"`
+ // Size - Provisioned size of the pool (in bytes). Allowed values are in 4TiB chunks (value must be multiply of 4398046511104).
+ Size *int64 `json:"size,omitempty"`
+ // ServiceLevel - The service level of the file system. Possible values include: 'ServiceLevelStandard', 'ServiceLevelPremium', 'ServiceLevelUltra'
+ ServiceLevel ServiceLevel `json:"serviceLevel,omitempty"`
+ // ProvisioningState - READ-ONLY; Azure lifecycle management
+ ProvisioningState *string `json:"provisioningState,omitempty"`
+ // TotalThroughputMibps - READ-ONLY; Total throughput of pool in Mibps
+ TotalThroughputMibps *float64 `json:"totalThroughputMibps,omitempty"`
+ // UtilizedThroughputMibps - READ-ONLY; Utilized throughput of pool in Mibps
+ UtilizedThroughputMibps *float64 `json:"utilizedThroughputMibps,omitempty"`
+ // QosType - The qos type of the pool. Possible values include: 'QosTypeAuto', 'QosTypeManual'
+ QosType QosType `json:"qosType,omitempty"`
+}
+
+// MarshalJSON is the custom marshaler for PoolProperties.
+func (pp PoolProperties) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]interface{})
+ if pp.Size != nil {
+ objectMap["size"] = pp.Size
+ }
+ if pp.ServiceLevel != "" {
+ objectMap["serviceLevel"] = pp.ServiceLevel
+ }
+ if pp.QosType != "" {
+ objectMap["qosType"] = pp.QosType
+ }
+ return json.Marshal(objectMap)
+}
+
+// PoolsCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a long-running
+// operation.
+type PoolsCreateOrUpdateFuture struct {
+ azure.FutureAPI
+ // Result returns the result of the asynchronous operation.
+ // If the operation has not completed it will return an error.
+ Result func(PoolsClient) (CapacityPool, error)
+}
+
+// UnmarshalJSON is the custom unmarshaller for CreateFuture.
+func (future *PoolsCreateOrUpdateFuture) UnmarshalJSON(body []byte) error {
+ var azFuture azure.Future
+ if err := json.Unmarshal(body, &azFuture); err != nil {
+ return err
+ }
+ future.FutureAPI = &azFuture
+ future.Result = future.result
+ return nil
+}
+
+// result is the default implementation for PoolsCreateOrUpdateFuture.Result.
+func (future *PoolsCreateOrUpdateFuture) result(client PoolsClient) (cp CapacityPool, err error) {
+ var done bool
+ done, err = future.DoneWithContext(context.Background(), client)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "netapp.PoolsCreateOrUpdateFuture", "Result", future.Response(), "Polling failure")
+ return
+ }
+ if !done {
+ cp.Response.Response = future.Response()
+ err = azure.NewAsyncOpIncompleteError("netapp.PoolsCreateOrUpdateFuture")
+ return
+ }
+ sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
+ if cp.Response.Response, err = future.GetResult(sender); err == nil && cp.Response.Response.StatusCode != http.StatusNoContent {
+ cp, err = client.CreateOrUpdateResponder(cp.Response.Response)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "netapp.PoolsCreateOrUpdateFuture", "Result", cp.Response.Response, "Failure responding to request")
+ }
+ }
+ return
+}
+
+// PoolsDeleteFuture an abstraction for monitoring and retrieving the results of a long-running operation.
+type PoolsDeleteFuture struct {
+ azure.FutureAPI
+ // Result returns the result of the asynchronous operation.
+ // If the operation has not completed it will return an error.
+ Result func(PoolsClient) (autorest.Response, error)
+}
+
+// UnmarshalJSON is the custom unmarshaller for CreateFuture.
+func (future *PoolsDeleteFuture) UnmarshalJSON(body []byte) error {
+ var azFuture azure.Future
+ if err := json.Unmarshal(body, &azFuture); err != nil {
+ return err
+ }
+ future.FutureAPI = &azFuture
+ future.Result = future.result
+ return nil
+}
+
+// result is the default implementation for PoolsDeleteFuture.Result.
+func (future *PoolsDeleteFuture) result(client PoolsClient) (ar autorest.Response, err error) {
+ var done bool
+ done, err = future.DoneWithContext(context.Background(), client)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "netapp.PoolsDeleteFuture", "Result", future.Response(), "Polling failure")
+ return
+ }
+ if !done {
+ ar.Response = future.Response()
+ err = azure.NewAsyncOpIncompleteError("netapp.PoolsDeleteFuture")
+ return
+ }
+ ar.Response = future.Response()
+ return
+}
+
+// PoolsUpdateFuture an abstraction for monitoring and retrieving the results of a long-running operation.
+type PoolsUpdateFuture struct {
+ azure.FutureAPI
+ // Result returns the result of the asynchronous operation.
+ // If the operation has not completed it will return an error.
+ Result func(PoolsClient) (CapacityPool, error)
+}
+
+// UnmarshalJSON is the custom unmarshaller for CreateFuture.
+func (future *PoolsUpdateFuture) UnmarshalJSON(body []byte) error {
+ var azFuture azure.Future
+ if err := json.Unmarshal(body, &azFuture); err != nil {
+ return err
+ }
+ future.FutureAPI = &azFuture
+ future.Result = future.result
+ return nil
+}
+
+// result is the default implementation for PoolsUpdateFuture.Result.
+func (future *PoolsUpdateFuture) result(client PoolsClient) (cp CapacityPool, err error) {
+ var done bool
+ done, err = future.DoneWithContext(context.Background(), client)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "netapp.PoolsUpdateFuture", "Result", future.Response(), "Polling failure")
+ return
+ }
+ if !done {
+ cp.Response.Response = future.Response()
+ err = azure.NewAsyncOpIncompleteError("netapp.PoolsUpdateFuture")
+ return
+ }
+ sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
+ if cp.Response.Response, err = future.GetResult(sender); err == nil && cp.Response.Response.StatusCode != http.StatusNoContent {
+ cp, err = client.UpdateResponder(cp.Response.Response)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "netapp.PoolsUpdateFuture", "Result", cp.Response.Response, "Failure responding to request")
+ }
+ }
+ return
+}
+
+// QuotaAvailabilityRequest quota availability request content.
+type QuotaAvailabilityRequest struct {
+ // Name - Name of the resource to verify.
+ Name *string `json:"name,omitempty"`
+ // Type - Resource type used for verification. Possible values include: 'CheckQuotaNameResourceTypesMicrosoftNetAppnetAppAccounts', 'CheckQuotaNameResourceTypesMicrosoftNetAppnetAppAccountscapacityPools', 'CheckQuotaNameResourceTypesMicrosoftNetAppnetAppAccountscapacityPoolsvolumes', 'CheckQuotaNameResourceTypesMicrosoftNetAppnetAppAccountscapacityPoolsvolumessnapshots'
+ Type CheckQuotaNameResourceTypes `json:"type,omitempty"`
+ // ResourceGroup - Resource group name.
+ ResourceGroup *string `json:"resourceGroup,omitempty"`
+}
+
+// RegionInfo provides region specific information.
+type RegionInfo struct {
+ autorest.Response `json:"-"`
+ // StorageToNetworkProximity - Provides storage to network proximity information in the region. Possible values include: 'Default', 'T1', 'T2', 'T1AndT2'
+ StorageToNetworkProximity RegionStorageToNetworkProximity `json:"storageToNetworkProximity,omitempty"`
+}
+
+// ReplicationObject replication properties
+type ReplicationObject struct {
+ // ReplicationID - Id
+ ReplicationID *string `json:"replicationId,omitempty"`
+ // EndpointType - Indicates whether the local volume is the source or destination for the Volume Replication. Possible values include: 'Src', 'Dst'
+ EndpointType EndpointType `json:"endpointType,omitempty"`
+ // ReplicationSchedule - Schedule. Possible values include: '10minutely', 'Hourly', 'Daily'
+ ReplicationSchedule ReplicationSchedule `json:"replicationSchedule,omitempty"`
+ // RemoteVolumeResourceID - The resource ID of the remote volume.
+ RemoteVolumeResourceID *string `json:"remoteVolumeResourceId,omitempty"`
+ // RemoteVolumeRegion - The remote region for the other end of the Volume Replication.
+ RemoteVolumeRegion *string `json:"remoteVolumeRegion,omitempty"`
+}
+
+// ReplicationStatus replication status
+type ReplicationStatus struct {
+ autorest.Response `json:"-"`
+ // Healthy - Replication health check
+ Healthy *bool `json:"healthy,omitempty"`
+ // RelationshipStatus - Status of the mirror relationship. Possible values include: 'Idle', 'Transferring'
+ RelationshipStatus RelationshipStatus `json:"relationshipStatus,omitempty"`
+ // MirrorState - The status of the replication. Possible values include: 'Uninitialized', 'Mirrored', 'Broken'
+ MirrorState MirrorState `json:"mirrorState,omitempty"`
+ // TotalProgress - The progress of the replication
+ TotalProgress *string `json:"totalProgress,omitempty"`
+ // ErrorMessage - Displays error message if the replication is in an error state
+ ErrorMessage *string `json:"errorMessage,omitempty"`
+}
+
+// ResourceIdentity identity for the resource.
+type ResourceIdentity struct {
+ // PrincipalID - READ-ONLY; Object id of the identity resource
+ PrincipalID *string `json:"principalId,omitempty"`
+ // TenantID - READ-ONLY; The tenant id of the resource
+ TenantID *string `json:"tenantId,omitempty"`
+ // Type - Type of Identity. Supported values are: 'None', 'SystemAssigned'
+ Type *string `json:"type,omitempty"`
+}
+
+// MarshalJSON is the custom marshaler for ResourceIdentity.
+func (ri ResourceIdentity) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]interface{})
+ if ri.Type != nil {
+ objectMap["type"] = ri.Type
+ }
+ return json.Marshal(objectMap)
+}
+
+// ResourceNameAvailabilityRequest resource name availability request content.
+type ResourceNameAvailabilityRequest struct {
+ // Name - Resource name to verify.
+ Name *string `json:"name,omitempty"`
+ // Type - Resource type used for verification. Possible values include: 'MicrosoftNetAppnetAppAccounts', 'MicrosoftNetAppnetAppAccountscapacityPools', 'MicrosoftNetAppnetAppAccountscapacityPoolsvolumes', 'MicrosoftNetAppnetAppAccountscapacityPoolsvolumessnapshots'
+ Type CheckNameResourceTypes `json:"type,omitempty"`
+ // ResourceGroup - Resource group name.
+ ResourceGroup *string `json:"resourceGroup,omitempty"`
+}
+
+// ServiceSpecification one property of operation, include metric specifications.
+type ServiceSpecification struct {
+ // MetricSpecifications - Metric specifications of operation.
+ MetricSpecifications *[]MetricSpecification `json:"metricSpecifications,omitempty"`
+}
+
+// Snapshot snapshot of a Volume
+type Snapshot struct {
+ autorest.Response `json:"-"`
+ // Location - Resource location
+ Location *string `json:"location,omitempty"`
+ // ID - READ-ONLY; Resource Id
+ ID *string `json:"id,omitempty"`
+ // Name - READ-ONLY; Resource name
+ Name *string `json:"name,omitempty"`
+ // Type - READ-ONLY; Resource type
+ Type *string `json:"type,omitempty"`
+ // SnapshotProperties - Snapshot Properties
+ *SnapshotProperties `json:"properties,omitempty"`
+}
+
+// MarshalJSON is the custom marshaler for Snapshot.
+func (s Snapshot) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]interface{})
+ if s.Location != nil {
+ objectMap["location"] = s.Location
+ }
+ if s.SnapshotProperties != nil {
+ objectMap["properties"] = s.SnapshotProperties
+ }
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON is the custom unmarshaler for Snapshot struct.
+func (s *Snapshot) UnmarshalJSON(body []byte) error {
+ var m map[string]*json.RawMessage
+ err := json.Unmarshal(body, &m)
+ if err != nil {
+ return err
+ }
+ for k, v := range m {
+ switch k {
+ case "location":
+ if v != nil {
+ var location string
+ err = json.Unmarshal(*v, &location)
+ if err != nil {
+ return err
+ }
+ s.Location = &location
+ }
+ case "id":
+ if v != nil {
+ var ID string
+ err = json.Unmarshal(*v, &ID)
+ if err != nil {
+ return err
+ }
+ s.ID = &ID
+ }
+ case "name":
+ if v != nil {
+ var name string
+ err = json.Unmarshal(*v, &name)
+ if err != nil {
+ return err
+ }
+ s.Name = &name
+ }
+ case "type":
+ if v != nil {
+ var typeVar string
+ err = json.Unmarshal(*v, &typeVar)
+ if err != nil {
+ return err
+ }
+ s.Type = &typeVar
+ }
+ case "properties":
+ if v != nil {
+ var snapshotProperties SnapshotProperties
+ err = json.Unmarshal(*v, &snapshotProperties)
+ if err != nil {
+ return err
+ }
+ s.SnapshotProperties = &snapshotProperties
+ }
+ }
+ }
+
+ return nil
+}
+
+// SnapshotPoliciesDeleteFuture an abstraction for monitoring and retrieving the results of a long-running
+// operation.
+type SnapshotPoliciesDeleteFuture struct {
+ azure.FutureAPI
+ // Result returns the result of the asynchronous operation.
+ // If the operation has not completed it will return an error.
+ Result func(SnapshotPoliciesClient) (autorest.Response, error)
+}
+
+// UnmarshalJSON is the custom unmarshaller for CreateFuture.
+func (future *SnapshotPoliciesDeleteFuture) UnmarshalJSON(body []byte) error {
+ var azFuture azure.Future
+ if err := json.Unmarshal(body, &azFuture); err != nil {
+ return err
+ }
+ future.FutureAPI = &azFuture
+ future.Result = future.result
+ return nil
+}
+
+// result is the default implementation for SnapshotPoliciesDeleteFuture.Result.
+func (future *SnapshotPoliciesDeleteFuture) result(client SnapshotPoliciesClient) (ar autorest.Response, err error) {
+ var done bool
+ done, err = future.DoneWithContext(context.Background(), client)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "netapp.SnapshotPoliciesDeleteFuture", "Result", future.Response(), "Polling failure")
+ return
+ }
+ if !done {
+ ar.Response = future.Response()
+ err = azure.NewAsyncOpIncompleteError("netapp.SnapshotPoliciesDeleteFuture")
+ return
+ }
+ ar.Response = future.Response()
+ return
+}
+
+// SnapshotPoliciesList list of Snapshot Policies
+type SnapshotPoliciesList struct {
+ autorest.Response `json:"-"`
+ // Value - A list of snapshot policies
+ Value *[]SnapshotPolicy `json:"value,omitempty"`
+}
+
+// SnapshotPoliciesUpdateFuture an abstraction for monitoring and retrieving the results of a long-running
+// operation.
+type SnapshotPoliciesUpdateFuture struct {
+ azure.FutureAPI
+ // Result returns the result of the asynchronous operation.
+ // If the operation has not completed it will return an error.
+ Result func(SnapshotPoliciesClient) (SnapshotPolicy, error)
+}
+
+// UnmarshalJSON is the custom unmarshaller for CreateFuture.
+func (future *SnapshotPoliciesUpdateFuture) UnmarshalJSON(body []byte) error {
+ var azFuture azure.Future
+ if err := json.Unmarshal(body, &azFuture); err != nil {
+ return err
+ }
+ future.FutureAPI = &azFuture
+ future.Result = future.result
+ return nil
+}
+
+// result is the default implementation for SnapshotPoliciesUpdateFuture.Result.
+func (future *SnapshotPoliciesUpdateFuture) result(client SnapshotPoliciesClient) (sp SnapshotPolicy, err error) {
+ var done bool
+ done, err = future.DoneWithContext(context.Background(), client)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "netapp.SnapshotPoliciesUpdateFuture", "Result", future.Response(), "Polling failure")
+ return
+ }
+ if !done {
+ sp.Response.Response = future.Response()
+ err = azure.NewAsyncOpIncompleteError("netapp.SnapshotPoliciesUpdateFuture")
+ return
+ }
+ sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
+ if sp.Response.Response, err = future.GetResult(sender); err == nil && sp.Response.Response.StatusCode != http.StatusNoContent {
+ sp, err = client.UpdateResponder(sp.Response.Response)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "netapp.SnapshotPoliciesUpdateFuture", "Result", sp.Response.Response, "Failure responding to request")
+ }
+ }
+ return
+}
+
+// SnapshotPolicy snapshot policy information
+type SnapshotPolicy struct {
+ autorest.Response `json:"-"`
+ // Location - Resource location
+ Location *string `json:"location,omitempty"`
+ // ID - READ-ONLY; Resource Id
+ ID *string `json:"id,omitempty"`
+ // Name - READ-ONLY; Resource name
+ Name *string `json:"name,omitempty"`
+ // Type - READ-ONLY; Resource type
+ Type *string `json:"type,omitempty"`
+ // Tags - Resource tags
+ Tags map[string]*string `json:"tags"`
+ // SnapshotPolicyProperties - Snapshot policy Properties
+ *SnapshotPolicyProperties `json:"properties,omitempty"`
+}
+
+// MarshalJSON is the custom marshaler for SnapshotPolicy.
+func (sp SnapshotPolicy) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]interface{})
+ if sp.Location != nil {
+ objectMap["location"] = sp.Location
+ }
+ if sp.Tags != nil {
+ objectMap["tags"] = sp.Tags
+ }
+ if sp.SnapshotPolicyProperties != nil {
+ objectMap["properties"] = sp.SnapshotPolicyProperties
+ }
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON is the custom unmarshaler for SnapshotPolicy struct.
+func (sp *SnapshotPolicy) UnmarshalJSON(body []byte) error {
+ var m map[string]*json.RawMessage
+ err := json.Unmarshal(body, &m)
+ if err != nil {
+ return err
+ }
+ for k, v := range m {
+ switch k {
+ case "location":
+ if v != nil {
+ var location string
+ err = json.Unmarshal(*v, &location)
+ if err != nil {
+ return err
+ }
+ sp.Location = &location
+ }
+ case "id":
+ if v != nil {
+ var ID string
+ err = json.Unmarshal(*v, &ID)
+ if err != nil {
+ return err
+ }
+ sp.ID = &ID
+ }
+ case "name":
+ if v != nil {
+ var name string
+ err = json.Unmarshal(*v, &name)
+ if err != nil {
+ return err
+ }
+ sp.Name = &name
+ }
+ case "type":
+ if v != nil {
+ var typeVar string
+ err = json.Unmarshal(*v, &typeVar)
+ if err != nil {
+ return err
+ }
+ sp.Type = &typeVar
+ }
+ case "tags":
+ if v != nil {
+ var tags map[string]*string
+ err = json.Unmarshal(*v, &tags)
+ if err != nil {
+ return err
+ }
+ sp.Tags = tags
+ }
+ case "properties":
+ if v != nil {
+ var snapshotPolicyProperties SnapshotPolicyProperties
+ err = json.Unmarshal(*v, &snapshotPolicyProperties)
+ if err != nil {
+ return err
+ }
+ sp.SnapshotPolicyProperties = &snapshotPolicyProperties
+ }
+ }
+ }
+
+ return nil
+}
+
+// SnapshotPolicyDetails snapshot policy properties
+type SnapshotPolicyDetails struct {
+ // Location - Resource location
+ Location *string `json:"location,omitempty"`
+ // ID - READ-ONLY; Resource Id
+ ID *string `json:"id,omitempty"`
+ // Name - READ-ONLY; Resource name
+ Name *string `json:"name,omitempty"`
+ // Type - READ-ONLY; Resource type
+ Type *string `json:"type,omitempty"`
+ // Tags - Resource tags
+ Tags map[string]*string `json:"tags"`
+ // SnapshotPolicyProperties - Snapshot policy Properties
+ *SnapshotPolicyProperties `json:"properties,omitempty"`
+}
+
+// MarshalJSON is the custom marshaler for SnapshotPolicyDetails.
+func (spd SnapshotPolicyDetails) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]interface{})
+ if spd.Location != nil {
+ objectMap["location"] = spd.Location
+ }
+ if spd.Tags != nil {
+ objectMap["tags"] = spd.Tags
+ }
+ if spd.SnapshotPolicyProperties != nil {
+ objectMap["properties"] = spd.SnapshotPolicyProperties
+ }
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON is the custom unmarshaler for SnapshotPolicyDetails struct.
+func (spd *SnapshotPolicyDetails) UnmarshalJSON(body []byte) error {
+ var m map[string]*json.RawMessage
+ err := json.Unmarshal(body, &m)
+ if err != nil {
+ return err
+ }
+ for k, v := range m {
+ switch k {
+ case "location":
+ if v != nil {
+ var location string
+ err = json.Unmarshal(*v, &location)
+ if err != nil {
+ return err
+ }
+ spd.Location = &location
+ }
+ case "id":
+ if v != nil {
+ var ID string
+ err = json.Unmarshal(*v, &ID)
+ if err != nil {
+ return err
+ }
+ spd.ID = &ID
+ }
+ case "name":
+ if v != nil {
+ var name string
+ err = json.Unmarshal(*v, &name)
+ if err != nil {
+ return err
+ }
+ spd.Name = &name
+ }
+ case "type":
+ if v != nil {
+ var typeVar string
+ err = json.Unmarshal(*v, &typeVar)
+ if err != nil {
+ return err
+ }
+ spd.Type = &typeVar
+ }
+ case "tags":
+ if v != nil {
+ var tags map[string]*string
+ err = json.Unmarshal(*v, &tags)
+ if err != nil {
+ return err
+ }
+ spd.Tags = tags
+ }
+ case "properties":
+ if v != nil {
+ var snapshotPolicyProperties SnapshotPolicyProperties
+ err = json.Unmarshal(*v, &snapshotPolicyProperties)
+ if err != nil {
+ return err
+ }
+ spd.SnapshotPolicyProperties = &snapshotPolicyProperties
+ }
+ }
+ }
+
+ return nil
+}
+
+// SnapshotPolicyPatch snapshot policy Details for create and update
+type SnapshotPolicyPatch struct {
+ // Location - Resource location
+ Location *string `json:"location,omitempty"`
+ // ID - READ-ONLY; Resource Id
+ ID *string `json:"id,omitempty"`
+ // Name - READ-ONLY; Resource name
+ Name *string `json:"name,omitempty"`
+ // Type - READ-ONLY; Resource type
+ Type *string `json:"type,omitempty"`
+ // Tags - Resource tags
+ Tags map[string]*string `json:"tags"`
+ // SnapshotPolicyProperties - Snapshot Policy properties
+ *SnapshotPolicyProperties `json:"properties,omitempty"`
+}
+
+// MarshalJSON is the custom marshaler for SnapshotPolicyPatch.
+func (spp SnapshotPolicyPatch) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]interface{})
+ if spp.Location != nil {
+ objectMap["location"] = spp.Location
+ }
+ if spp.Tags != nil {
+ objectMap["tags"] = spp.Tags
+ }
+ if spp.SnapshotPolicyProperties != nil {
+ objectMap["properties"] = spp.SnapshotPolicyProperties
+ }
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON is the custom unmarshaler for SnapshotPolicyPatch struct.
+func (spp *SnapshotPolicyPatch) UnmarshalJSON(body []byte) error {
+ var m map[string]*json.RawMessage
+ err := json.Unmarshal(body, &m)
+ if err != nil {
+ return err
+ }
+ for k, v := range m {
+ switch k {
+ case "location":
+ if v != nil {
+ var location string
+ err = json.Unmarshal(*v, &location)
+ if err != nil {
+ return err
+ }
+ spp.Location = &location
+ }
+ case "id":
+ if v != nil {
+ var ID string
+ err = json.Unmarshal(*v, &ID)
+ if err != nil {
+ return err
+ }
+ spp.ID = &ID
+ }
+ case "name":
+ if v != nil {
+ var name string
+ err = json.Unmarshal(*v, &name)
+ if err != nil {
+ return err
+ }
+ spp.Name = &name
+ }
+ case "type":
+ if v != nil {
+ var typeVar string
+ err = json.Unmarshal(*v, &typeVar)
+ if err != nil {
+ return err
+ }
+ spp.Type = &typeVar
+ }
+ case "tags":
+ if v != nil {
+ var tags map[string]*string
+ err = json.Unmarshal(*v, &tags)
+ if err != nil {
+ return err
+ }
+ spp.Tags = tags
+ }
+ case "properties":
+ if v != nil {
+ var snapshotPolicyProperties SnapshotPolicyProperties
+ err = json.Unmarshal(*v, &snapshotPolicyProperties)
+ if err != nil {
+ return err
+ }
+ spp.SnapshotPolicyProperties = &snapshotPolicyProperties
+ }
+ }
+ }
+
+ return nil
+}
+
+// SnapshotPolicyProperties snapshot policy properties
+type SnapshotPolicyProperties struct {
+ // HourlySchedule - Schedule for hourly snapshots
+ HourlySchedule *HourlySchedule `json:"hourlySchedule,omitempty"`
+ // DailySchedule - Schedule for daily snapshots
+ DailySchedule *DailySchedule `json:"dailySchedule,omitempty"`
+ // WeeklySchedule - Schedule for weekly snapshots
+ WeeklySchedule *WeeklySchedule `json:"weeklySchedule,omitempty"`
+ // MonthlySchedule - Schedule for monthly snapshots
+ MonthlySchedule *MonthlySchedule `json:"monthlySchedule,omitempty"`
+ // Enabled - The property to decide policy is enabled or not
+ Enabled *bool `json:"enabled,omitempty"`
+ // ProvisioningState - READ-ONLY; Azure lifecycle management
+ ProvisioningState *string `json:"provisioningState,omitempty"`
+}
+
+// MarshalJSON is the custom marshaler for SnapshotPolicyProperties.
+func (spp SnapshotPolicyProperties) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]interface{})
+ if spp.HourlySchedule != nil {
+ objectMap["hourlySchedule"] = spp.HourlySchedule
+ }
+ if spp.DailySchedule != nil {
+ objectMap["dailySchedule"] = spp.DailySchedule
+ }
+ if spp.WeeklySchedule != nil {
+ objectMap["weeklySchedule"] = spp.WeeklySchedule
+ }
+ if spp.MonthlySchedule != nil {
+ objectMap["monthlySchedule"] = spp.MonthlySchedule
+ }
+ if spp.Enabled != nil {
+ objectMap["enabled"] = spp.Enabled
+ }
+ return json.Marshal(objectMap)
+}
+
+// SnapshotPolicyVolumeList volumes associated with snapshot policy
+type SnapshotPolicyVolumeList struct {
+ autorest.Response `json:"-"`
+ // Value - List of volumes
+ Value *[]interface{} `json:"value,omitempty"`
+}
+
+// SnapshotProperties snapshot properties
+type SnapshotProperties struct {
+ // SnapshotID - READ-ONLY; UUID v4 used to identify the Snapshot
+ SnapshotID *string `json:"snapshotId,omitempty"`
+ // Created - READ-ONLY; The creation date of the snapshot
+ Created *date.Time `json:"created,omitempty"`
+ // ProvisioningState - READ-ONLY; Azure lifecycle management
+ ProvisioningState *string `json:"provisioningState,omitempty"`
+}
+
+// MarshalJSON is the custom marshaler for SnapshotProperties.
+func (sp SnapshotProperties) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]interface{})
+ return json.Marshal(objectMap)
+}
+
+// SnapshotsCreateFuture an abstraction for monitoring and retrieving the results of a long-running
+// operation.
+type SnapshotsCreateFuture struct {
+ azure.FutureAPI
+ // Result returns the result of the asynchronous operation.
+ // If the operation has not completed it will return an error.
+ Result func(SnapshotsClient) (Snapshot, error)
+}
+
+// UnmarshalJSON is the custom unmarshaller for CreateFuture.
+func (future *SnapshotsCreateFuture) UnmarshalJSON(body []byte) error {
+ var azFuture azure.Future
+ if err := json.Unmarshal(body, &azFuture); err != nil {
+ return err
+ }
+ future.FutureAPI = &azFuture
+ future.Result = future.result
+ return nil
+}
+
+// result is the default implementation for SnapshotsCreateFuture.Result.
+func (future *SnapshotsCreateFuture) result(client SnapshotsClient) (s Snapshot, err error) {
+ var done bool
+ done, err = future.DoneWithContext(context.Background(), client)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "netapp.SnapshotsCreateFuture", "Result", future.Response(), "Polling failure")
+ return
+ }
+ if !done {
+ s.Response.Response = future.Response()
+ err = azure.NewAsyncOpIncompleteError("netapp.SnapshotsCreateFuture")
+ return
+ }
+ sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
+ if s.Response.Response, err = future.GetResult(sender); err == nil && s.Response.Response.StatusCode != http.StatusNoContent {
+ s, err = client.CreateResponder(s.Response.Response)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "netapp.SnapshotsCreateFuture", "Result", s.Response.Response, "Failure responding to request")
+ }
+ }
+ return
+}
+
+// SnapshotsDeleteFuture an abstraction for monitoring and retrieving the results of a long-running
+// operation.
+type SnapshotsDeleteFuture struct {
+ azure.FutureAPI
+ // Result returns the result of the asynchronous operation.
+ // If the operation has not completed it will return an error.
+ Result func(SnapshotsClient) (autorest.Response, error)
+}
+
+// UnmarshalJSON is the custom unmarshaller for CreateFuture.
+func (future *SnapshotsDeleteFuture) UnmarshalJSON(body []byte) error {
+ var azFuture azure.Future
+ if err := json.Unmarshal(body, &azFuture); err != nil {
+ return err
+ }
+ future.FutureAPI = &azFuture
+ future.Result = future.result
+ return nil
+}
+
+// result is the default implementation for SnapshotsDeleteFuture.Result.
+func (future *SnapshotsDeleteFuture) result(client SnapshotsClient) (ar autorest.Response, err error) {
+ var done bool
+ done, err = future.DoneWithContext(context.Background(), client)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "netapp.SnapshotsDeleteFuture", "Result", future.Response(), "Polling failure")
+ return
+ }
+ if !done {
+ ar.Response = future.Response()
+ err = azure.NewAsyncOpIncompleteError("netapp.SnapshotsDeleteFuture")
+ return
+ }
+ ar.Response = future.Response()
+ return
+}
+
+// SnapshotsList list of Snapshots
+type SnapshotsList struct {
+ autorest.Response `json:"-"`
+ // Value - A list of Snapshots
+ Value *[]Snapshot `json:"value,omitempty"`
+}
+
+// SnapshotsUpdateFuture an abstraction for monitoring and retrieving the results of a long-running
+// operation.
+type SnapshotsUpdateFuture struct {
+ azure.FutureAPI
+ // Result returns the result of the asynchronous operation.
+ // If the operation has not completed it will return an error.
+ Result func(SnapshotsClient) (Snapshot, error)
+}
+
+// UnmarshalJSON is the custom unmarshaller for CreateFuture.
+func (future *SnapshotsUpdateFuture) UnmarshalJSON(body []byte) error {
+ var azFuture azure.Future
+ if err := json.Unmarshal(body, &azFuture); err != nil {
+ return err
+ }
+ future.FutureAPI = &azFuture
+ future.Result = future.result
+ return nil
+}
+
+// result is the default implementation for SnapshotsUpdateFuture.Result.
+func (future *SnapshotsUpdateFuture) result(client SnapshotsClient) (s Snapshot, err error) {
+ var done bool
+ done, err = future.DoneWithContext(context.Background(), client)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "netapp.SnapshotsUpdateFuture", "Result", future.Response(), "Polling failure")
+ return
+ }
+ if !done {
+ s.Response.Response = future.Response()
+ err = azure.NewAsyncOpIncompleteError("netapp.SnapshotsUpdateFuture")
+ return
+ }
+ sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
+ if s.Response.Response, err = future.GetResult(sender); err == nil && s.Response.Response.StatusCode != http.StatusNoContent {
+ s, err = client.UpdateResponder(s.Response.Response)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "netapp.SnapshotsUpdateFuture", "Result", s.Response.Response, "Failure responding to request")
+ }
+ }
+ return
+}
+
+// SystemData metadata pertaining to creation and last modification of the resource.
+type SystemData struct {
+ // CreatedBy - The identity that created the resource.
+ CreatedBy *string `json:"createdBy,omitempty"`
+ // CreatedByType - The type of identity that created the resource. Possible values include: 'User', 'Application', 'ManagedIdentity', 'Key'
+ CreatedByType CreatedByType `json:"createdByType,omitempty"`
+ // CreatedAt - The timestamp of resource creation (UTC).
+ CreatedAt *date.Time `json:"createdAt,omitempty"`
+ // LastModifiedBy - The identity that last modified the resource.
+ LastModifiedBy *string `json:"lastModifiedBy,omitempty"`
+ // LastModifiedByType - The type of identity that last modified the resource. Possible values include: 'User', 'Application', 'ManagedIdentity', 'Key'
+ LastModifiedByType CreatedByType `json:"lastModifiedByType,omitempty"`
+ // LastModifiedAt - The timestamp of resource last modification (UTC)
+ LastModifiedAt *date.Time `json:"lastModifiedAt,omitempty"`
+}
+
+// Vault vault information
+type Vault struct {
+ // Location - Resource location
+ Location *string `json:"location,omitempty"`
+ // ID - READ-ONLY; Resource Id
+ ID *string `json:"id,omitempty"`
+ // Name - READ-ONLY; Resource name
+ Name *string `json:"name,omitempty"`
+ // Type - READ-ONLY; Resource type
+ Type *string `json:"type,omitempty"`
+ // VaultProperties - Vault Properties
+ *VaultProperties `json:"properties,omitempty"`
+}
+
+// MarshalJSON is the custom marshaler for Vault.
+func (vVar Vault) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]interface{})
+ if vVar.Location != nil {
+ objectMap["location"] = vVar.Location
+ }
+ if vVar.VaultProperties != nil {
+ objectMap["properties"] = vVar.VaultProperties
+ }
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON is the custom unmarshaler for Vault struct.
+func (vVar *Vault) UnmarshalJSON(body []byte) error {
+ var m map[string]*json.RawMessage
+ err := json.Unmarshal(body, &m)
+ if err != nil {
+ return err
+ }
+ for k, v := range m {
+ switch k {
+ case "location":
+ if v != nil {
+ var location string
+ err = json.Unmarshal(*v, &location)
+ if err != nil {
+ return err
+ }
+ vVar.Location = &location
+ }
+ case "id":
+ if v != nil {
+ var ID string
+ err = json.Unmarshal(*v, &ID)
+ if err != nil {
+ return err
+ }
+ vVar.ID = &ID
+ }
+ case "name":
+ if v != nil {
+ var name string
+ err = json.Unmarshal(*v, &name)
+ if err != nil {
+ return err
+ }
+ vVar.Name = &name
+ }
+ case "type":
+ if v != nil {
+ var typeVar string
+ err = json.Unmarshal(*v, &typeVar)
+ if err != nil {
+ return err
+ }
+ vVar.Type = &typeVar
+ }
+ case "properties":
+ if v != nil {
+ var vaultProperties VaultProperties
+ err = json.Unmarshal(*v, &vaultProperties)
+ if err != nil {
+ return err
+ }
+ vVar.VaultProperties = &vaultProperties
+ }
+ }
+ }
+
+ return nil
+}
+
+// VaultList list of Vaults
+type VaultList struct {
+ autorest.Response `json:"-"`
+ // Value - A list of vaults
+ Value *[]Vault `json:"value,omitempty"`
+}
+
+// VaultProperties vault properties
+type VaultProperties struct {
+ // VaultName - Vault Name
+ VaultName *string `json:"vaultName,omitempty"`
+}
+
+// Volume volume resource
+type Volume struct {
+ autorest.Response `json:"-"`
+ // Location - Resource location
+ Location *string `json:"location,omitempty"`
+ // ID - READ-ONLY; Resource Id
+ ID *string `json:"id,omitempty"`
+ // Name - READ-ONLY; Resource name
+ Name *string `json:"name,omitempty"`
+ // Type - READ-ONLY; Resource type
+ Type *string `json:"type,omitempty"`
+ // Tags - Resource tags
+ Tags map[string]*string `json:"tags"`
+ // VolumeProperties - Volume properties
+ *VolumeProperties `json:"properties,omitempty"`
+}
+
+// MarshalJSON is the custom marshaler for Volume.
+func (vVar Volume) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]interface{})
+ if vVar.Location != nil {
+ objectMap["location"] = vVar.Location
+ }
+ if vVar.Tags != nil {
+ objectMap["tags"] = vVar.Tags
+ }
+ if vVar.VolumeProperties != nil {
+ objectMap["properties"] = vVar.VolumeProperties
+ }
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON is the custom unmarshaler for Volume struct.
+func (vVar *Volume) UnmarshalJSON(body []byte) error {
+ var m map[string]*json.RawMessage
+ err := json.Unmarshal(body, &m)
+ if err != nil {
+ return err
+ }
+ for k, v := range m {
+ switch k {
+ case "location":
+ if v != nil {
+ var location string
+ err = json.Unmarshal(*v, &location)
+ if err != nil {
+ return err
+ }
+ vVar.Location = &location
+ }
+ case "id":
+ if v != nil {
+ var ID string
+ err = json.Unmarshal(*v, &ID)
+ if err != nil {
+ return err
+ }
+ vVar.ID = &ID
+ }
+ case "name":
+ if v != nil {
+ var name string
+ err = json.Unmarshal(*v, &name)
+ if err != nil {
+ return err
+ }
+ vVar.Name = &name
+ }
+ case "type":
+ if v != nil {
+ var typeVar string
+ err = json.Unmarshal(*v, &typeVar)
+ if err != nil {
+ return err
+ }
+ vVar.Type = &typeVar
+ }
+ case "tags":
+ if v != nil {
+ var tags map[string]*string
+ err = json.Unmarshal(*v, &tags)
+ if err != nil {
+ return err
+ }
+ vVar.Tags = tags
+ }
+ case "properties":
+ if v != nil {
+ var volumeProperties VolumeProperties
+ err = json.Unmarshal(*v, &volumeProperties)
+ if err != nil {
+ return err
+ }
+ vVar.VolumeProperties = &volumeProperties
+ }
+ }
+ }
+
+ return nil
+}
+
+// VolumeBackupProperties volume Backup Properties
+type VolumeBackupProperties struct {
+ // BackupPolicyID - Backup Policy Resource ID
+ BackupPolicyID *string `json:"backupPolicyId,omitempty"`
+ // PolicyEnforced - Policy Enforced
+ PolicyEnforced *bool `json:"policyEnforced,omitempty"`
+ // VaultID - Vault Resource ID
+ VaultID *string `json:"vaultId,omitempty"`
+ // BackupEnabled - Backup Enabled
+ BackupEnabled *bool `json:"backupEnabled,omitempty"`
+}
+
+// VolumeBackups volume details using the backup policy
+type VolumeBackups struct {
+ // VolumeName - Volume name
+ VolumeName *string `json:"volumeName,omitempty"`
+ // BackupsCount - Total count of backups for volume
+ BackupsCount *int32 `json:"backupsCount,omitempty"`
+ // PolicyEnabled - Policy enabled
+ PolicyEnabled *bool `json:"policyEnabled,omitempty"`
+}
+
+// VolumeList list of volume resources
+type VolumeList struct {
+ autorest.Response `json:"-"`
+ // Value - List of volumes
+ Value *[]Volume `json:"value,omitempty"`
+ // NextLink - URL to get the next set of results.
+ NextLink *string `json:"nextLink,omitempty"`
+}
+
+// VolumeListIterator provides access to a complete listing of Volume values.
+type VolumeListIterator struct {
+ i int
+ page VolumeListPage
+}
+
+// NextWithContext advances to the next value. If there was an error making
+// the request the iterator does not advance and the error is returned.
+func (iter *VolumeListIterator) NextWithContext(ctx context.Context) (err error) {
+ if tracing.IsEnabled() {
+ ctx = tracing.StartSpan(ctx, fqdn+"/VolumeListIterator.NextWithContext")
+ defer func() {
+ sc := -1
+ if iter.Response().Response.Response != nil {
+ sc = iter.Response().Response.Response.StatusCode
+ }
+ tracing.EndSpan(ctx, sc, err)
+ }()
+ }
+ iter.i++
+ if iter.i < len(iter.page.Values()) {
+ return nil
+ }
+ err = iter.page.NextWithContext(ctx)
+ if err != nil {
+ iter.i--
+ return err
+ }
+ iter.i = 0
+ return nil
+}
+
+// Next advances to the next value. If there was an error making
+// the request the iterator does not advance and the error is returned.
+// Deprecated: Use NextWithContext() instead.
+func (iter *VolumeListIterator) Next() error {
+ return iter.NextWithContext(context.Background())
+}
+
+// NotDone returns true if the enumeration should be started or is not yet complete.
+func (iter VolumeListIterator) NotDone() bool {
+ return iter.page.NotDone() && iter.i < len(iter.page.Values())
+}
+
+// Response returns the raw server response from the last page request.
+func (iter VolumeListIterator) Response() VolumeList {
+ return iter.page.Response()
+}
+
+// Value returns the current value or a zero-initialized value if the
+// iterator has advanced beyond the end of the collection.
+func (iter VolumeListIterator) Value() Volume {
+ if !iter.page.NotDone() {
+ return Volume{}
+ }
+ return iter.page.Values()[iter.i]
+}
+
+// Creates a new instance of the VolumeListIterator type.
+func NewVolumeListIterator(page VolumeListPage) VolumeListIterator {
+ return VolumeListIterator{page: page}
+}
+
+// IsEmpty returns true if the ListResult contains no values.
+func (vl VolumeList) IsEmpty() bool {
+ return vl.Value == nil || len(*vl.Value) == 0
+}
+
+// hasNextLink returns true if the NextLink is not empty.
+func (vl VolumeList) hasNextLink() bool {
+ return vl.NextLink != nil && len(*vl.NextLink) != 0
+}
+
+// volumeListPreparer prepares a request to retrieve the next set of results.
+// It returns nil if no more results exist.
+func (vl VolumeList) volumeListPreparer(ctx context.Context) (*http.Request, error) {
+ if !vl.hasNextLink() {
+ return nil, nil
+ }
+ return autorest.Prepare((&http.Request{}).WithContext(ctx),
+ autorest.AsJSON(),
+ autorest.AsGet(),
+ autorest.WithBaseURL(to.String(vl.NextLink)))
+}
+
+// VolumeListPage contains a page of Volume values.
+type VolumeListPage struct {
+ fn func(context.Context, VolumeList) (VolumeList, error)
+ vl VolumeList
+}
+
+// NextWithContext advances to the next page of values. If there was an error making
+// the request the page does not advance and the error is returned.
+func (page *VolumeListPage) NextWithContext(ctx context.Context) (err error) {
+ if tracing.IsEnabled() {
+ ctx = tracing.StartSpan(ctx, fqdn+"/VolumeListPage.NextWithContext")
+ defer func() {
+ sc := -1
+ if page.Response().Response.Response != nil {
+ sc = page.Response().Response.Response.StatusCode
+ }
+ tracing.EndSpan(ctx, sc, err)
+ }()
+ }
+ for {
+ next, err := page.fn(ctx, page.vl)
+ if err != nil {
+ return err
+ }
+ page.vl = next
+ if !next.hasNextLink() || !next.IsEmpty() {
+ break
+ }
+ }
+ return nil
+}
+
+// Next advances to the next page of values. If there was an error making
+// the request the page does not advance and the error is returned.
+// Deprecated: Use NextWithContext() instead.
+func (page *VolumeListPage) Next() error {
+ return page.NextWithContext(context.Background())
+}
+
+// NotDone returns true if the page enumeration should be started or is not yet complete.
+func (page VolumeListPage) NotDone() bool {
+ return !page.vl.IsEmpty()
+}
+
+// Response returns the raw server response from the last page request.
+func (page VolumeListPage) Response() VolumeList {
+ return page.vl
+}
+
+// Values returns the slice of values for the current page or nil if there are no values.
+func (page VolumeListPage) Values() []Volume {
+ if page.vl.IsEmpty() {
+ return nil
+ }
+ return *page.vl.Value
+}
+
+// Creates a new instance of the VolumeListPage type.
+func NewVolumeListPage(cur VolumeList, getNextPage func(context.Context, VolumeList) (VolumeList, error)) VolumeListPage {
+ return VolumeListPage{
+ fn: getNextPage,
+ vl: cur,
+ }
+}
+
+// VolumePatch volume patch resource
+type VolumePatch struct {
+ // Location - Resource location
+ Location *string `json:"location,omitempty"`
+ // ID - READ-ONLY; Resource Id
+ ID *string `json:"id,omitempty"`
+ // Name - READ-ONLY; Resource name
+ Name *string `json:"name,omitempty"`
+ // Type - READ-ONLY; Resource type
+ Type *string `json:"type,omitempty"`
+ // Tags - Resource tags
+ Tags map[string]*string `json:"tags"`
+ // VolumePatchProperties - Patchable volume properties
+ *VolumePatchProperties `json:"properties,omitempty"`
+}
+
+// MarshalJSON is the custom marshaler for VolumePatch.
+func (vp VolumePatch) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]interface{})
+ if vp.Location != nil {
+ objectMap["location"] = vp.Location
+ }
+ if vp.Tags != nil {
+ objectMap["tags"] = vp.Tags
+ }
+ if vp.VolumePatchProperties != nil {
+ objectMap["properties"] = vp.VolumePatchProperties
+ }
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON is the custom unmarshaler for VolumePatch struct.
+func (vp *VolumePatch) UnmarshalJSON(body []byte) error {
+ var m map[string]*json.RawMessage
+ err := json.Unmarshal(body, &m)
+ if err != nil {
+ return err
+ }
+ for k, v := range m {
+ switch k {
+ case "location":
+ if v != nil {
+ var location string
+ err = json.Unmarshal(*v, &location)
+ if err != nil {
+ return err
+ }
+ vp.Location = &location
+ }
+ case "id":
+ if v != nil {
+ var ID string
+ err = json.Unmarshal(*v, &ID)
+ if err != nil {
+ return err
+ }
+ vp.ID = &ID
+ }
+ case "name":
+ if v != nil {
+ var name string
+ err = json.Unmarshal(*v, &name)
+ if err != nil {
+ return err
+ }
+ vp.Name = &name
+ }
+ case "type":
+ if v != nil {
+ var typeVar string
+ err = json.Unmarshal(*v, &typeVar)
+ if err != nil {
+ return err
+ }
+ vp.Type = &typeVar
+ }
+ case "tags":
+ if v != nil {
+ var tags map[string]*string
+ err = json.Unmarshal(*v, &tags)
+ if err != nil {
+ return err
+ }
+ vp.Tags = tags
+ }
+ case "properties":
+ if v != nil {
+ var volumePatchProperties VolumePatchProperties
+ err = json.Unmarshal(*v, &volumePatchProperties)
+ if err != nil {
+ return err
+ }
+ vp.VolumePatchProperties = &volumePatchProperties
+ }
+ }
+ }
+
+ return nil
+}
+
+// VolumePatchProperties patchable volume properties
+type VolumePatchProperties struct {
+ // ServiceLevel - The service level of the file system. Possible values include: 'ServiceLevelStandard', 'ServiceLevelPremium', 'ServiceLevelUltra'
+ ServiceLevel ServiceLevel `json:"serviceLevel,omitempty"`
+ // UsageThreshold - Maximum storage quota allowed for a file system in bytes. This is a soft quota used for alerting only. Minimum size is 100 GiB. Upper limit is 100TiB. Specified in bytes.
+ UsageThreshold *int64 `json:"usageThreshold,omitempty"`
+ // ExportPolicy - Set of export policy rules
+ ExportPolicy *VolumePatchPropertiesExportPolicy `json:"exportPolicy,omitempty"`
+ ThroughputMibps *float64 `json:"throughputMibps,omitempty"`
+ // DataProtection - DataProtection type volumes include an object containing details of the replication
+ DataProtection *VolumePatchPropertiesDataProtection `json:"dataProtection,omitempty"`
+}
+
+// VolumePatchPropertiesDataProtection dataProtection type volumes include an object containing details of
+// the replication
+type VolumePatchPropertiesDataProtection struct {
+ // Backup - Backup Properties
+ Backup *VolumeBackupProperties `json:"backup,omitempty"`
+ // Snapshot - Snapshot properties.
+ Snapshot *VolumeSnapshotProperties `json:"snapshot,omitempty"`
+}
+
+// VolumePatchPropertiesExportPolicy set of export policy rules
+type VolumePatchPropertiesExportPolicy struct {
+ // Rules - Export policy rule
+ Rules *[]ExportPolicyRule `json:"rules,omitempty"`
+}
+
+// VolumeProperties volume properties
+type VolumeProperties struct {
+ // FileSystemID - READ-ONLY; Unique FileSystem Identifier.
+ FileSystemID *string `json:"fileSystemId,omitempty"`
+ // CreationToken - A unique file path for the volume. Used when creating mount targets
+ CreationToken *string `json:"creationToken,omitempty"`
+ // ServiceLevel - The service level of the file system. Possible values include: 'ServiceLevelStandard', 'ServiceLevelPremium', 'ServiceLevelUltra'
+ ServiceLevel ServiceLevel `json:"serviceLevel,omitempty"`
+ // UsageThreshold - Maximum storage quota allowed for a file system in bytes. This is a soft quota used for alerting only. Minimum size is 100 GiB. Upper limit is 100TiB. Specified in bytes.
+ UsageThreshold *int64 `json:"usageThreshold,omitempty"`
+ // ExportPolicy - Set of export policy rules
+ ExportPolicy *VolumePropertiesExportPolicy `json:"exportPolicy,omitempty"`
+ // ProtocolTypes - Set of protocol types, default NFSv3, CIFS for SMB protocol
+ ProtocolTypes *[]string `json:"protocolTypes,omitempty"`
+ // ProvisioningState - READ-ONLY; Azure lifecycle management
+ ProvisioningState *string `json:"provisioningState,omitempty"`
+ // SnapshotID - UUID v4 or resource identifier used to identify the Snapshot.
+ SnapshotID *string `json:"snapshotId,omitempty"`
+ // BackupID - UUID v4 or resource identifier used to identify the Backup.
+ BackupID *string `json:"backupId,omitempty"`
+ // BaremetalTenantID - READ-ONLY; Unique Baremetal Tenant Identifier.
+ BaremetalTenantID *string `json:"baremetalTenantId,omitempty"`
+ // SubnetID - The Azure Resource URI for a delegated subnet. Must have the delegation Microsoft.NetApp/volumes
+ SubnetID *string `json:"subnetId,omitempty"`
+ // NetworkFeatures - Basic network, or Standard features available to the volume. Possible values include: 'Basic', 'Standard'
+ NetworkFeatures NetworkFeatures `json:"networkFeatures,omitempty"`
+ // NetworkSiblingSetID - READ-ONLY; Network Sibling Set ID for the the group of volumes sharing networking resources.
+ NetworkSiblingSetID *string `json:"networkSiblingSetId,omitempty"`
+ // StorageToNetworkProximity - READ-ONLY; Provides storage to network proximity information for the volume. Possible values include: 'VolumeStorageToNetworkProximityDefault', 'VolumeStorageToNetworkProximityT1', 'VolumeStorageToNetworkProximityT2'
+ StorageToNetworkProximity VolumeStorageToNetworkProximity `json:"storageToNetworkProximity,omitempty"`
+ // MountTargets - READ-ONLY; List of mount targets
+ MountTargets *[]MountTargetProperties `json:"mountTargets,omitempty"`
+ // VolumeType - What type of volume is this
+ VolumeType *string `json:"volumeType,omitempty"`
+ // DataProtection - DataProtection type volumes include an object containing details of the replication
+ DataProtection *VolumePropertiesDataProtection `json:"dataProtection,omitempty"`
+ // IsRestoring - Restoring
+ IsRestoring *bool `json:"isRestoring,omitempty"`
+ // SnapshotDirectoryVisible - If enabled (true) the volume will contain a read-only snapshot directory which provides access to each of the volume's snapshots (default to true).
+ SnapshotDirectoryVisible *bool `json:"snapshotDirectoryVisible,omitempty"`
+ // KerberosEnabled - Describe if a volume is KerberosEnabled. To be use with swagger version 2020-05-01 or later
+ KerberosEnabled *bool `json:"kerberosEnabled,omitempty"`
+ // SecurityStyle - The security style of volume, default unix, defaults to ntfs for dual protocol or CIFS protocol. Possible values include: 'Ntfs', 'Unix'
+ SecurityStyle SecurityStyle `json:"securityStyle,omitempty"`
+ // SmbEncryption - Enables encryption for in-flight smb3 data. Only applicable for SMB/DualProtocol volume. To be used with swagger version 2020-08-01 or later
+ SmbEncryption *bool `json:"smbEncryption,omitempty"`
+ // SmbContinuouslyAvailable - Enables continuously available share property for smb volume. Only applicable for SMB volume
+ SmbContinuouslyAvailable *bool `json:"smbContinuouslyAvailable,omitempty"`
+ ThroughputMibps *float64 `json:"throughputMibps,omitempty"`
+ // EncryptionKeySource - Encryption Key Source. Possible values are: 'Microsoft.NetApp'
+ EncryptionKeySource *string `json:"encryptionKeySource,omitempty"`
+ // LdapEnabled - Specifies whether LDAP is enabled or not for a given NFS volume.
+ LdapEnabled *bool `json:"ldapEnabled,omitempty"`
+}
+
+// MarshalJSON is the custom marshaler for VolumeProperties.
+func (vp VolumeProperties) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]interface{})
+ if vp.CreationToken != nil {
+ objectMap["creationToken"] = vp.CreationToken
+ }
+ if vp.ServiceLevel != "" {
+ objectMap["serviceLevel"] = vp.ServiceLevel
+ }
+ if vp.UsageThreshold != nil {
+ objectMap["usageThreshold"] = vp.UsageThreshold
+ }
+ if vp.ExportPolicy != nil {
+ objectMap["exportPolicy"] = vp.ExportPolicy
+ }
+ if vp.ProtocolTypes != nil {
+ objectMap["protocolTypes"] = vp.ProtocolTypes
+ }
+ if vp.SnapshotID != nil {
+ objectMap["snapshotId"] = vp.SnapshotID
+ }
+ if vp.BackupID != nil {
+ objectMap["backupId"] = vp.BackupID
+ }
+ if vp.SubnetID != nil {
+ objectMap["subnetId"] = vp.SubnetID
+ }
+ if vp.NetworkFeatures != "" {
+ objectMap["networkFeatures"] = vp.NetworkFeatures
+ }
+ if vp.VolumeType != nil {
+ objectMap["volumeType"] = vp.VolumeType
+ }
+ if vp.DataProtection != nil {
+ objectMap["dataProtection"] = vp.DataProtection
+ }
+ if vp.IsRestoring != nil {
+ objectMap["isRestoring"] = vp.IsRestoring
+ }
+ if vp.SnapshotDirectoryVisible != nil {
+ objectMap["snapshotDirectoryVisible"] = vp.SnapshotDirectoryVisible
+ }
+ if vp.KerberosEnabled != nil {
+ objectMap["kerberosEnabled"] = vp.KerberosEnabled
+ }
+ if vp.SecurityStyle != "" {
+ objectMap["securityStyle"] = vp.SecurityStyle
+ }
+ if vp.SmbEncryption != nil {
+ objectMap["smbEncryption"] = vp.SmbEncryption
+ }
+ if vp.SmbContinuouslyAvailable != nil {
+ objectMap["smbContinuouslyAvailable"] = vp.SmbContinuouslyAvailable
+ }
+ if vp.ThroughputMibps != nil {
+ objectMap["throughputMibps"] = vp.ThroughputMibps
+ }
+ if vp.EncryptionKeySource != nil {
+ objectMap["encryptionKeySource"] = vp.EncryptionKeySource
+ }
+ if vp.LdapEnabled != nil {
+ objectMap["ldapEnabled"] = vp.LdapEnabled
+ }
+ return json.Marshal(objectMap)
+}
+
+// VolumePropertiesDataProtection dataProtection type volumes include an object containing details of the
+// replication
+type VolumePropertiesDataProtection struct {
+ // Backup - Backup Properties
+ Backup *VolumeBackupProperties `json:"backup,omitempty"`
+ // Replication - Replication properties
+ Replication *ReplicationObject `json:"replication,omitempty"`
+ // Snapshot - Snapshot properties.
+ Snapshot *VolumeSnapshotProperties `json:"snapshot,omitempty"`
+}
+
+// VolumePropertiesExportPolicy set of export policy rules
+type VolumePropertiesExportPolicy struct {
+ // Rules - Export policy rule
+ Rules *[]ExportPolicyRule `json:"rules,omitempty"`
+}
+
+// VolumeRevert revert a volume to the snapshot
+type VolumeRevert struct {
+ // SnapshotID - Resource id of the snapshot
+ SnapshotID *string `json:"snapshotId,omitempty"`
+}
+
+// VolumesAuthorizeReplicationFuture an abstraction for monitoring and retrieving the results of a
+// long-running operation.
+type VolumesAuthorizeReplicationFuture struct {
+ azure.FutureAPI
+ // Result returns the result of the asynchronous operation.
+ // If the operation has not completed it will return an error.
+ Result func(VolumesClient) (autorest.Response, error)
+}
+
+// UnmarshalJSON is the custom unmarshaller for CreateFuture.
+func (future *VolumesAuthorizeReplicationFuture) UnmarshalJSON(body []byte) error {
+ var azFuture azure.Future
+ if err := json.Unmarshal(body, &azFuture); err != nil {
+ return err
+ }
+ future.FutureAPI = &azFuture
+ future.Result = future.result
+ return nil
+}
+
+// result is the default implementation for VolumesAuthorizeReplicationFuture.Result.
+func (future *VolumesAuthorizeReplicationFuture) result(client VolumesClient) (ar autorest.Response, err error) {
+ var done bool
+ done, err = future.DoneWithContext(context.Background(), client)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "netapp.VolumesAuthorizeReplicationFuture", "Result", future.Response(), "Polling failure")
+ return
+ }
+ if !done {
+ ar.Response = future.Response()
+ err = azure.NewAsyncOpIncompleteError("netapp.VolumesAuthorizeReplicationFuture")
+ return
+ }
+ ar.Response = future.Response()
+ return
+}
+
+// VolumesBreakReplicationFuture an abstraction for monitoring and retrieving the results of a long-running
+// operation.
+type VolumesBreakReplicationFuture struct {
+ azure.FutureAPI
+ // Result returns the result of the asynchronous operation.
+ // If the operation has not completed it will return an error.
+ Result func(VolumesClient) (autorest.Response, error)
+}
+
+// UnmarshalJSON is the custom unmarshaller for CreateFuture.
+func (future *VolumesBreakReplicationFuture) UnmarshalJSON(body []byte) error {
+ var azFuture azure.Future
+ if err := json.Unmarshal(body, &azFuture); err != nil {
+ return err
+ }
+ future.FutureAPI = &azFuture
+ future.Result = future.result
+ return nil
+}
+
+// result is the default implementation for VolumesBreakReplicationFuture.Result.
+func (future *VolumesBreakReplicationFuture) result(client VolumesClient) (ar autorest.Response, err error) {
+ var done bool
+ done, err = future.DoneWithContext(context.Background(), client)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "netapp.VolumesBreakReplicationFuture", "Result", future.Response(), "Polling failure")
+ return
+ }
+ if !done {
+ ar.Response = future.Response()
+ err = azure.NewAsyncOpIncompleteError("netapp.VolumesBreakReplicationFuture")
+ return
+ }
+ ar.Response = future.Response()
+ return
+}
+
+// VolumesCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a long-running
+// operation.
+type VolumesCreateOrUpdateFuture struct {
+ azure.FutureAPI
+ // Result returns the result of the asynchronous operation.
+ // If the operation has not completed it will return an error.
+ Result func(VolumesClient) (Volume, error)
+}
+
+// UnmarshalJSON is the custom unmarshaller for CreateFuture.
+func (future *VolumesCreateOrUpdateFuture) UnmarshalJSON(body []byte) error {
+ var azFuture azure.Future
+ if err := json.Unmarshal(body, &azFuture); err != nil {
+ return err
+ }
+ future.FutureAPI = &azFuture
+ future.Result = future.result
+ return nil
+}
+
+// result is the default implementation for VolumesCreateOrUpdateFuture.Result.
+func (future *VolumesCreateOrUpdateFuture) result(client VolumesClient) (vVar Volume, err error) {
+ var done bool
+ done, err = future.DoneWithContext(context.Background(), client)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "netapp.VolumesCreateOrUpdateFuture", "Result", future.Response(), "Polling failure")
+ return
+ }
+ if !done {
+ vVar.Response.Response = future.Response()
+ err = azure.NewAsyncOpIncompleteError("netapp.VolumesCreateOrUpdateFuture")
+ return
+ }
+ sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
+ if vVar.Response.Response, err = future.GetResult(sender); err == nil && vVar.Response.Response.StatusCode != http.StatusNoContent {
+ vVar, err = client.CreateOrUpdateResponder(vVar.Response.Response)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "netapp.VolumesCreateOrUpdateFuture", "Result", vVar.Response.Response, "Failure responding to request")
+ }
+ }
+ return
+}
+
+// VolumesDeleteFuture an abstraction for monitoring and retrieving the results of a long-running
+// operation.
+type VolumesDeleteFuture struct {
+ azure.FutureAPI
+ // Result returns the result of the asynchronous operation.
+ // If the operation has not completed it will return an error.
+ Result func(VolumesClient) (autorest.Response, error)
+}
+
+// UnmarshalJSON is the custom unmarshaller for CreateFuture.
+func (future *VolumesDeleteFuture) UnmarshalJSON(body []byte) error {
+ var azFuture azure.Future
+ if err := json.Unmarshal(body, &azFuture); err != nil {
+ return err
+ }
+ future.FutureAPI = &azFuture
+ future.Result = future.result
+ return nil
+}
+
+// result is the default implementation for VolumesDeleteFuture.Result.
+func (future *VolumesDeleteFuture) result(client VolumesClient) (ar autorest.Response, err error) {
+ var done bool
+ done, err = future.DoneWithContext(context.Background(), client)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "netapp.VolumesDeleteFuture", "Result", future.Response(), "Polling failure")
+ return
+ }
+ if !done {
+ ar.Response = future.Response()
+ err = azure.NewAsyncOpIncompleteError("netapp.VolumesDeleteFuture")
+ return
+ }
+ ar.Response = future.Response()
+ return
+}
+
+// VolumesDeleteReplicationFuture an abstraction for monitoring and retrieving the results of a
+// long-running operation.
+type VolumesDeleteReplicationFuture struct {
+ azure.FutureAPI
+ // Result returns the result of the asynchronous operation.
+ // If the operation has not completed it will return an error.
+ Result func(VolumesClient) (autorest.Response, error)
+}
+
+// UnmarshalJSON is the custom unmarshaller for CreateFuture.
+func (future *VolumesDeleteReplicationFuture) UnmarshalJSON(body []byte) error {
+ var azFuture azure.Future
+ if err := json.Unmarshal(body, &azFuture); err != nil {
+ return err
+ }
+ future.FutureAPI = &azFuture
+ future.Result = future.result
+ return nil
+}
+
+// result is the default implementation for VolumesDeleteReplicationFuture.Result.
+func (future *VolumesDeleteReplicationFuture) result(client VolumesClient) (ar autorest.Response, err error) {
+ var done bool
+ done, err = future.DoneWithContext(context.Background(), client)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "netapp.VolumesDeleteReplicationFuture", "Result", future.Response(), "Polling failure")
+ return
+ }
+ if !done {
+ ar.Response = future.Response()
+ err = azure.NewAsyncOpIncompleteError("netapp.VolumesDeleteReplicationFuture")
+ return
+ }
+ ar.Response = future.Response()
+ return
+}
+
+// VolumeSnapshotProperties volume Snapshot Properties
+type VolumeSnapshotProperties struct {
+ // SnapshotPolicyID - Snapshot Policy ResourceId
+ SnapshotPolicyID *string `json:"snapshotPolicyId,omitempty"`
+}
+
+// VolumesPoolChangeFuture an abstraction for monitoring and retrieving the results of a long-running
+// operation.
+type VolumesPoolChangeFuture struct {
+ azure.FutureAPI
+ // Result returns the result of the asynchronous operation.
+ // If the operation has not completed it will return an error.
+ Result func(VolumesClient) (autorest.Response, error)
+}
+
+// UnmarshalJSON is the custom unmarshaller for CreateFuture.
+func (future *VolumesPoolChangeFuture) UnmarshalJSON(body []byte) error {
+ var azFuture azure.Future
+ if err := json.Unmarshal(body, &azFuture); err != nil {
+ return err
+ }
+ future.FutureAPI = &azFuture
+ future.Result = future.result
+ return nil
+}
+
+// result is the default implementation for VolumesPoolChangeFuture.Result.
+func (future *VolumesPoolChangeFuture) result(client VolumesClient) (ar autorest.Response, err error) {
+ var done bool
+ done, err = future.DoneWithContext(context.Background(), client)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "netapp.VolumesPoolChangeFuture", "Result", future.Response(), "Polling failure")
+ return
+ }
+ if !done {
+ ar.Response = future.Response()
+ err = azure.NewAsyncOpIncompleteError("netapp.VolumesPoolChangeFuture")
+ return
+ }
+ ar.Response = future.Response()
+ return
+}
+
+// VolumesReInitializeReplicationFuture an abstraction for monitoring and retrieving the results of a
+// long-running operation.
+type VolumesReInitializeReplicationFuture struct {
+ azure.FutureAPI
+ // Result returns the result of the asynchronous operation.
+ // If the operation has not completed it will return an error.
+ Result func(VolumesClient) (autorest.Response, error)
+}
+
+// UnmarshalJSON is the custom unmarshaller for CreateFuture.
+func (future *VolumesReInitializeReplicationFuture) UnmarshalJSON(body []byte) error {
+ var azFuture azure.Future
+ if err := json.Unmarshal(body, &azFuture); err != nil {
+ return err
+ }
+ future.FutureAPI = &azFuture
+ future.Result = future.result
+ return nil
+}
+
+// result is the default implementation for VolumesReInitializeReplicationFuture.Result.
+func (future *VolumesReInitializeReplicationFuture) result(client VolumesClient) (ar autorest.Response, err error) {
+ var done bool
+ done, err = future.DoneWithContext(context.Background(), client)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "netapp.VolumesReInitializeReplicationFuture", "Result", future.Response(), "Polling failure")
+ return
+ }
+ if !done {
+ ar.Response = future.Response()
+ err = azure.NewAsyncOpIncompleteError("netapp.VolumesReInitializeReplicationFuture")
+ return
+ }
+ ar.Response = future.Response()
+ return
+}
+
+// VolumesResyncReplicationFuture an abstraction for monitoring and retrieving the results of a
+// long-running operation.
+type VolumesResyncReplicationFuture struct {
+ azure.FutureAPI
+ // Result returns the result of the asynchronous operation.
+ // If the operation has not completed it will return an error.
+ Result func(VolumesClient) (autorest.Response, error)
+}
+
+// UnmarshalJSON is the custom unmarshaller for CreateFuture.
+func (future *VolumesResyncReplicationFuture) UnmarshalJSON(body []byte) error {
+ var azFuture azure.Future
+ if err := json.Unmarshal(body, &azFuture); err != nil {
+ return err
+ }
+ future.FutureAPI = &azFuture
+ future.Result = future.result
+ return nil
+}
+
+// result is the default implementation for VolumesResyncReplicationFuture.Result.
+func (future *VolumesResyncReplicationFuture) result(client VolumesClient) (ar autorest.Response, err error) {
+ var done bool
+ done, err = future.DoneWithContext(context.Background(), client)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "netapp.VolumesResyncReplicationFuture", "Result", future.Response(), "Polling failure")
+ return
+ }
+ if !done {
+ ar.Response = future.Response()
+ err = azure.NewAsyncOpIncompleteError("netapp.VolumesResyncReplicationFuture")
+ return
+ }
+ ar.Response = future.Response()
+ return
+}
+
+// VolumesRevertFuture an abstraction for monitoring and retrieving the results of a long-running
+// operation.
+type VolumesRevertFuture struct {
+ azure.FutureAPI
+ // Result returns the result of the asynchronous operation.
+ // If the operation has not completed it will return an error.
+ Result func(VolumesClient) (autorest.Response, error)
+}
+
+// UnmarshalJSON is the custom unmarshaller for CreateFuture.
+func (future *VolumesRevertFuture) UnmarshalJSON(body []byte) error {
+ var azFuture azure.Future
+ if err := json.Unmarshal(body, &azFuture); err != nil {
+ return err
+ }
+ future.FutureAPI = &azFuture
+ future.Result = future.result
+ return nil
+}
+
+// result is the default implementation for VolumesRevertFuture.Result.
+func (future *VolumesRevertFuture) result(client VolumesClient) (ar autorest.Response, err error) {
+ var done bool
+ done, err = future.DoneWithContext(context.Background(), client)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "netapp.VolumesRevertFuture", "Result", future.Response(), "Polling failure")
+ return
+ }
+ if !done {
+ ar.Response = future.Response()
+ err = azure.NewAsyncOpIncompleteError("netapp.VolumesRevertFuture")
+ return
+ }
+ ar.Response = future.Response()
+ return
+}
+
+// VolumesUpdateFuture an abstraction for monitoring and retrieving the results of a long-running
+// operation.
+type VolumesUpdateFuture struct {
+ azure.FutureAPI
+ // Result returns the result of the asynchronous operation.
+ // If the operation has not completed it will return an error.
+ Result func(VolumesClient) (Volume, error)
+}
+
+// UnmarshalJSON is the custom unmarshaller for CreateFuture.
+func (future *VolumesUpdateFuture) UnmarshalJSON(body []byte) error {
+ var azFuture azure.Future
+ if err := json.Unmarshal(body, &azFuture); err != nil {
+ return err
+ }
+ future.FutureAPI = &azFuture
+ future.Result = future.result
+ return nil
+}
+
+// result is the default implementation for VolumesUpdateFuture.Result.
+func (future *VolumesUpdateFuture) result(client VolumesClient) (vVar Volume, err error) {
+ var done bool
+ done, err = future.DoneWithContext(context.Background(), client)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "netapp.VolumesUpdateFuture", "Result", future.Response(), "Polling failure")
+ return
+ }
+ if !done {
+ vVar.Response.Response = future.Response()
+ err = azure.NewAsyncOpIncompleteError("netapp.VolumesUpdateFuture")
+ return
+ }
+ sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
+ if vVar.Response.Response, err = future.GetResult(sender); err == nil && vVar.Response.Response.StatusCode != http.StatusNoContent {
+ vVar, err = client.UpdateResponder(vVar.Response.Response)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "netapp.VolumesUpdateFuture", "Result", vVar.Response.Response, "Failure responding to request")
+ }
+ }
+ return
+}
+
+// WeeklySchedule weekly Schedule properties, make a snapshot every week at a specific day or days
+type WeeklySchedule struct {
+ // SnapshotsToKeep - Weekly snapshot count to keep
+ SnapshotsToKeep *int32 `json:"snapshotsToKeep,omitempty"`
+ // Day - Indicates which weekdays snapshot should be taken, accepts a comma separated list of week day names in english
+ Day *string `json:"day,omitempty"`
+ // Hour - Indicates which hour in UTC timezone a snapshot should be taken
+ Hour *int32 `json:"hour,omitempty"`
+ // Minute - Indicates which minute snapshot should be taken
+ Minute *int32 `json:"minute,omitempty"`
+ // UsedBytes - Resource size in bytes, current storage usage for the volume in bytes
+ UsedBytes *int64 `json:"usedBytes,omitempty"`
+}
diff --git a/services/preview/netapp/mgmt/2021-04-01-preview/netapp/netappapi/interfaces.go b/services/preview/netapp/mgmt/2021-04-01-preview/netapp/netappapi/interfaces.go
new file mode 100644
index 000000000000..51865633f798
--- /dev/null
+++ b/services/preview/netapp/mgmt/2021-04-01-preview/netapp/netappapi/interfaces.go
@@ -0,0 +1,141 @@
+package netappapi
+
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License. See License.txt in the project root for license information.
+//
+// Code generated by Microsoft (R) AutoRest Code Generator.
+// Changes may cause incorrect behavior and will be lost if the code is regenerated.
+
+import (
+ "context"
+ "github.com/Azure/azure-sdk-for-go/services/preview/netapp/mgmt/2021-04-01-preview/netapp"
+)
+
+// OperationsClientAPI contains the set of methods on the OperationsClient type.
+type OperationsClientAPI interface {
+ List(ctx context.Context) (result netapp.OperationListResult, err error)
+}
+
+var _ OperationsClientAPI = (*netapp.OperationsClient)(nil)
+
+// ResourceClientAPI contains the set of methods on the ResourceClient type.
+type ResourceClientAPI interface {
+ CheckFilePathAvailability(ctx context.Context, body netapp.ResourceNameAvailabilityRequest, location string) (result netapp.CheckAvailabilityResponse, err error)
+ CheckNameAvailability(ctx context.Context, body netapp.ResourceNameAvailabilityRequest, location string) (result netapp.CheckAvailabilityResponse, err error)
+ CheckQuotaAvailability(ctx context.Context, body netapp.QuotaAvailabilityRequest, location string) (result netapp.CheckAvailabilityResponse, err error)
+}
+
+var _ ResourceClientAPI = (*netapp.ResourceClient)(nil)
+
+// ResourceRegionInfoClientAPI contains the set of methods on the ResourceRegionInfoClient type.
+type ResourceRegionInfoClientAPI interface {
+ Get(ctx context.Context, location string) (result netapp.RegionInfo, err error)
+}
+
+var _ ResourceRegionInfoClientAPI = (*netapp.ResourceRegionInfoClient)(nil)
+
+// AccountsClientAPI contains the set of methods on the AccountsClient type.
+type AccountsClientAPI interface {
+ CreateOrUpdate(ctx context.Context, body netapp.Account, resourceGroupName string, accountName string) (result netapp.AccountsCreateOrUpdateFuture, err error)
+ Delete(ctx context.Context, resourceGroupName string, accountName string) (result netapp.AccountsDeleteFuture, err error)
+ Get(ctx context.Context, resourceGroupName string, accountName string) (result netapp.Account, err error)
+ List(ctx context.Context, resourceGroupName string) (result netapp.AccountListPage, err error)
+ ListComplete(ctx context.Context, resourceGroupName string) (result netapp.AccountListIterator, err error)
+ Update(ctx context.Context, body netapp.AccountPatch, resourceGroupName string, accountName string) (result netapp.AccountsUpdateFuture, err error)
+}
+
+var _ AccountsClientAPI = (*netapp.AccountsClient)(nil)
+
+// PoolsClientAPI contains the set of methods on the PoolsClient type.
+type PoolsClientAPI interface {
+ CreateOrUpdate(ctx context.Context, body netapp.CapacityPool, resourceGroupName string, accountName string, poolName string) (result netapp.PoolsCreateOrUpdateFuture, err error)
+ Delete(ctx context.Context, resourceGroupName string, accountName string, poolName string) (result netapp.PoolsDeleteFuture, err error)
+ Get(ctx context.Context, resourceGroupName string, accountName string, poolName string) (result netapp.CapacityPool, err error)
+ List(ctx context.Context, resourceGroupName string, accountName string) (result netapp.CapacityPoolListPage, err error)
+ ListComplete(ctx context.Context, resourceGroupName string, accountName string) (result netapp.CapacityPoolListIterator, err error)
+ Update(ctx context.Context, body netapp.CapacityPoolPatch, resourceGroupName string, accountName string, poolName string) (result netapp.PoolsUpdateFuture, err error)
+}
+
+var _ PoolsClientAPI = (*netapp.PoolsClient)(nil)
+
+// VolumesClientAPI contains the set of methods on the VolumesClient type.
+type VolumesClientAPI interface {
+ AuthorizeReplication(ctx context.Context, resourceGroupName string, accountName string, poolName string, volumeName string, body netapp.AuthorizeRequest) (result netapp.VolumesAuthorizeReplicationFuture, err error)
+ BreakReplication(ctx context.Context, resourceGroupName string, accountName string, poolName string, volumeName string, body *netapp.BreakReplicationRequest) (result netapp.VolumesBreakReplicationFuture, err error)
+ CreateOrUpdate(ctx context.Context, body netapp.Volume, resourceGroupName string, accountName string, poolName string, volumeName string) (result netapp.VolumesCreateOrUpdateFuture, err error)
+ Delete(ctx context.Context, resourceGroupName string, accountName string, poolName string, volumeName string) (result netapp.VolumesDeleteFuture, err error)
+ DeleteReplication(ctx context.Context, resourceGroupName string, accountName string, poolName string, volumeName string) (result netapp.VolumesDeleteReplicationFuture, err error)
+ Get(ctx context.Context, resourceGroupName string, accountName string, poolName string, volumeName string) (result netapp.Volume, err error)
+ List(ctx context.Context, resourceGroupName string, accountName string, poolName string) (result netapp.VolumeListPage, err error)
+ ListComplete(ctx context.Context, resourceGroupName string, accountName string, poolName string) (result netapp.VolumeListIterator, err error)
+ PoolChange(ctx context.Context, resourceGroupName string, accountName string, poolName string, volumeName string, body netapp.PoolChangeRequest) (result netapp.VolumesPoolChangeFuture, err error)
+ ReInitializeReplication(ctx context.Context, resourceGroupName string, accountName string, poolName string, volumeName string) (result netapp.VolumesReInitializeReplicationFuture, err error)
+ ReplicationStatusMethod(ctx context.Context, resourceGroupName string, accountName string, poolName string, volumeName string) (result netapp.ReplicationStatus, err error)
+ ResyncReplication(ctx context.Context, resourceGroupName string, accountName string, poolName string, volumeName string) (result netapp.VolumesResyncReplicationFuture, err error)
+ Revert(ctx context.Context, resourceGroupName string, accountName string, poolName string, volumeName string, body netapp.VolumeRevert) (result netapp.VolumesRevertFuture, err error)
+ Update(ctx context.Context, body netapp.VolumePatch, resourceGroupName string, accountName string, poolName string, volumeName string) (result netapp.VolumesUpdateFuture, err error)
+}
+
+var _ VolumesClientAPI = (*netapp.VolumesClient)(nil)
+
+// SnapshotsClientAPI contains the set of methods on the SnapshotsClient type.
+type SnapshotsClientAPI interface {
+ Create(ctx context.Context, body netapp.Snapshot, resourceGroupName string, accountName string, poolName string, volumeName string, snapshotName string) (result netapp.SnapshotsCreateFuture, err error)
+ Delete(ctx context.Context, resourceGroupName string, accountName string, poolName string, volumeName string, snapshotName string) (result netapp.SnapshotsDeleteFuture, err error)
+ Get(ctx context.Context, resourceGroupName string, accountName string, poolName string, volumeName string, snapshotName string) (result netapp.Snapshot, err error)
+ List(ctx context.Context, resourceGroupName string, accountName string, poolName string, volumeName string) (result netapp.SnapshotsList, err error)
+ Update(ctx context.Context, body interface{}, resourceGroupName string, accountName string, poolName string, volumeName string, snapshotName string) (result netapp.SnapshotsUpdateFuture, err error)
+}
+
+var _ SnapshotsClientAPI = (*netapp.SnapshotsClient)(nil)
+
+// SnapshotPoliciesClientAPI contains the set of methods on the SnapshotPoliciesClient type.
+type SnapshotPoliciesClientAPI interface {
+ Create(ctx context.Context, body netapp.SnapshotPolicy, resourceGroupName string, accountName string, snapshotPolicyName string) (result netapp.SnapshotPolicy, err error)
+ Delete(ctx context.Context, resourceGroupName string, accountName string, snapshotPolicyName string) (result netapp.SnapshotPoliciesDeleteFuture, err error)
+ Get(ctx context.Context, resourceGroupName string, accountName string, snapshotPolicyName string) (result netapp.SnapshotPolicy, err error)
+ List(ctx context.Context, resourceGroupName string, accountName string) (result netapp.SnapshotPoliciesList, err error)
+ ListVolumes(ctx context.Context, resourceGroupName string, accountName string, snapshotPolicyName string) (result netapp.SnapshotPolicyVolumeList, err error)
+ Update(ctx context.Context, body netapp.SnapshotPolicyPatch, resourceGroupName string, accountName string, snapshotPolicyName string) (result netapp.SnapshotPoliciesUpdateFuture, err error)
+}
+
+var _ SnapshotPoliciesClientAPI = (*netapp.SnapshotPoliciesClient)(nil)
+
+// BackupsClientAPI contains the set of methods on the BackupsClient type.
+type BackupsClientAPI interface {
+ Create(ctx context.Context, resourceGroupName string, accountName string, poolName string, volumeName string, backupName string, body netapp.Backup) (result netapp.BackupsCreateFuture, err error)
+ Delete(ctx context.Context, resourceGroupName string, accountName string, poolName string, volumeName string, backupName string) (result netapp.BackupsDeleteFuture, err error)
+ Get(ctx context.Context, resourceGroupName string, accountName string, poolName string, volumeName string, backupName string) (result netapp.Backup, err error)
+ GetStatus(ctx context.Context, resourceGroupName string, accountName string, poolName string, volumeName string) (result netapp.BackupStatus, err error)
+ List(ctx context.Context, resourceGroupName string, accountName string, poolName string, volumeName string) (result netapp.BackupsList, err error)
+ Update(ctx context.Context, resourceGroupName string, accountName string, poolName string, volumeName string, backupName string, body *netapp.BackupPatch) (result netapp.BackupsUpdateFuture, err error)
+}
+
+var _ BackupsClientAPI = (*netapp.BackupsClient)(nil)
+
+// AccountBackupsClientAPI contains the set of methods on the AccountBackupsClient type.
+type AccountBackupsClientAPI interface {
+ Delete(ctx context.Context, resourceGroupName string, accountName string, backupName string) (result netapp.AccountBackupsDeleteFuture, err error)
+ Get(ctx context.Context, resourceGroupName string, accountName string, backupName string) (result netapp.Backup, err error)
+ List(ctx context.Context, resourceGroupName string, accountName string) (result netapp.BackupsList, err error)
+}
+
+var _ AccountBackupsClientAPI = (*netapp.AccountBackupsClient)(nil)
+
+// BackupPoliciesClientAPI contains the set of methods on the BackupPoliciesClient type.
+type BackupPoliciesClientAPI interface {
+ Create(ctx context.Context, resourceGroupName string, accountName string, backupPolicyName string, body netapp.BackupPolicy) (result netapp.BackupPoliciesCreateFuture, err error)
+ Delete(ctx context.Context, resourceGroupName string, accountName string, backupPolicyName string) (result netapp.BackupPoliciesDeleteFuture, err error)
+ Get(ctx context.Context, resourceGroupName string, accountName string, backupPolicyName string) (result netapp.BackupPolicy, err error)
+ List(ctx context.Context, resourceGroupName string, accountName string) (result netapp.BackupPoliciesList, err error)
+ Update(ctx context.Context, resourceGroupName string, accountName string, backupPolicyName string, body netapp.BackupPolicyPatch) (result netapp.BackupPoliciesUpdateFuture, err error)
+}
+
+var _ BackupPoliciesClientAPI = (*netapp.BackupPoliciesClient)(nil)
+
+// VaultsClientAPI contains the set of methods on the VaultsClient type.
+type VaultsClientAPI interface {
+ List(ctx context.Context, resourceGroupName string, accountName string) (result netapp.VaultList, err error)
+}
+
+var _ VaultsClientAPI = (*netapp.VaultsClient)(nil)
diff --git a/services/preview/netapp/mgmt/2021-04-01-preview/netapp/operations.go b/services/preview/netapp/mgmt/2021-04-01-preview/netapp/operations.go
new file mode 100644
index 000000000000..90c5eb1f15e6
--- /dev/null
+++ b/services/preview/netapp/mgmt/2021-04-01-preview/netapp/operations.go
@@ -0,0 +1,98 @@
+package netapp
+
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License. See License.txt in the project root for license information.
+//
+// Code generated by Microsoft (R) AutoRest Code Generator.
+// Changes may cause incorrect behavior and will be lost if the code is regenerated.
+
+import (
+ "context"
+ "github.com/Azure/go-autorest/autorest"
+ "github.com/Azure/go-autorest/autorest/azure"
+ "github.com/Azure/go-autorest/tracing"
+ "net/http"
+)
+
+// OperationsClient is the microsoft NetApp Files Azure Resource Provider specification
+type OperationsClient struct {
+ BaseClient
+}
+
+// NewOperationsClient creates an instance of the OperationsClient client.
+func NewOperationsClient(subscriptionID string) OperationsClient {
+ return NewOperationsClientWithBaseURI(DefaultBaseURI, subscriptionID)
+}
+
+// NewOperationsClientWithBaseURI creates an instance of the OperationsClient client using a custom endpoint. Use this
+// when interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure stack).
+func NewOperationsClientWithBaseURI(baseURI string, subscriptionID string) OperationsClient {
+ return OperationsClient{NewWithBaseURI(baseURI, subscriptionID)}
+}
+
+// List lists all of the available Microsoft.NetApp Rest API operations
+func (client OperationsClient) List(ctx context.Context) (result OperationListResult, err error) {
+ if tracing.IsEnabled() {
+ ctx = tracing.StartSpan(ctx, fqdn+"/OperationsClient.List")
+ defer func() {
+ sc := -1
+ if result.Response.Response != nil {
+ sc = result.Response.Response.StatusCode
+ }
+ tracing.EndSpan(ctx, sc, err)
+ }()
+ }
+ req, err := client.ListPreparer(ctx)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "netapp.OperationsClient", "List", nil, "Failure preparing request")
+ return
+ }
+
+ resp, err := client.ListSender(req)
+ if err != nil {
+ result.Response = autorest.Response{Response: resp}
+ err = autorest.NewErrorWithError(err, "netapp.OperationsClient", "List", resp, "Failure sending request")
+ return
+ }
+
+ result, err = client.ListResponder(resp)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "netapp.OperationsClient", "List", resp, "Failure responding to request")
+ return
+ }
+
+ return
+}
+
+// ListPreparer prepares the List request.
+func (client OperationsClient) ListPreparer(ctx context.Context) (*http.Request, error) {
+ const APIVersion = "2021-04-01-preview"
+ queryParameters := map[string]interface{}{
+ "api-version": APIVersion,
+ }
+
+ preparer := autorest.CreatePreparer(
+ autorest.AsGet(),
+ autorest.WithBaseURL(client.BaseURI),
+ autorest.WithPath("/providers/Microsoft.NetApp/operations"),
+ autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare((&http.Request{}).WithContext(ctx))
+}
+
+// ListSender sends the List request. The method will close the
+// http.Response Body if it receives an error.
+func (client OperationsClient) ListSender(req *http.Request) (*http.Response, error) {
+ return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
+}
+
+// ListResponder handles the response to the List request. The method always
+// closes the http.Response Body.
+func (client OperationsClient) ListResponder(resp *http.Response) (result OperationListResult, err error) {
+ err = autorest.Respond(
+ resp,
+ azure.WithErrorUnlessStatusCode(http.StatusOK),
+ autorest.ByUnmarshallingJSON(&result),
+ autorest.ByClosing())
+ result.Response = autorest.Response{Response: resp}
+ return
+}
diff --git a/services/preview/netapp/mgmt/2021-04-01-preview/netapp/pools.go b/services/preview/netapp/mgmt/2021-04-01-preview/netapp/pools.go
new file mode 100644
index 000000000000..3faf0489d9c2
--- /dev/null
+++ b/services/preview/netapp/mgmt/2021-04-01-preview/netapp/pools.go
@@ -0,0 +1,551 @@
+package netapp
+
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License. See License.txt in the project root for license information.
+//
+// Code generated by Microsoft (R) AutoRest Code Generator.
+// Changes may cause incorrect behavior and will be lost if the code is regenerated.
+
+import (
+ "context"
+ "github.com/Azure/go-autorest/autorest"
+ "github.com/Azure/go-autorest/autorest/azure"
+ "github.com/Azure/go-autorest/autorest/validation"
+ "github.com/Azure/go-autorest/tracing"
+ "net/http"
+)
+
+// PoolsClient is the microsoft NetApp Files Azure Resource Provider specification
+type PoolsClient struct {
+ BaseClient
+}
+
+// NewPoolsClient creates an instance of the PoolsClient client.
+func NewPoolsClient(subscriptionID string) PoolsClient {
+ return NewPoolsClientWithBaseURI(DefaultBaseURI, subscriptionID)
+}
+
+// NewPoolsClientWithBaseURI creates an instance of the PoolsClient client using a custom endpoint. Use this when
+// interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure stack).
+func NewPoolsClientWithBaseURI(baseURI string, subscriptionID string) PoolsClient {
+ return PoolsClient{NewWithBaseURI(baseURI, subscriptionID)}
+}
+
+// CreateOrUpdate create or Update a capacity pool
+// Parameters:
+// body - capacity pool object supplied in the body of the operation.
+// resourceGroupName - the name of the resource group.
+// accountName - the name of the NetApp account
+// poolName - the name of the capacity pool
+func (client PoolsClient) CreateOrUpdate(ctx context.Context, body CapacityPool, resourceGroupName string, accountName string, poolName string) (result PoolsCreateOrUpdateFuture, err error) {
+ if tracing.IsEnabled() {
+ ctx = tracing.StartSpan(ctx, fqdn+"/PoolsClient.CreateOrUpdate")
+ defer func() {
+ sc := -1
+ if result.FutureAPI != nil && result.FutureAPI.Response() != nil {
+ sc = result.FutureAPI.Response().StatusCode
+ }
+ tracing.EndSpan(ctx, sc, err)
+ }()
+ }
+ if err := validation.Validate([]validation.Validation{
+ {TargetValue: body,
+ Constraints: []validation.Constraint{{Target: "body.Location", Name: validation.Null, Rule: true, Chain: nil},
+ {Target: "body.PoolProperties", Name: validation.Null, Rule: true,
+ Chain: []validation.Constraint{{Target: "body.PoolProperties.PoolID", Name: validation.Null, Rule: false,
+ Chain: []validation.Constraint{{Target: "body.PoolProperties.PoolID", Name: validation.MaxLength, Rule: 36, Chain: nil},
+ {Target: "body.PoolProperties.PoolID", Name: validation.MinLength, Rule: 36, Chain: nil},
+ {Target: "body.PoolProperties.PoolID", Name: validation.Pattern, Rule: `^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$`, Chain: nil},
+ }},
+ {Target: "body.PoolProperties.Size", Name: validation.Null, Rule: true,
+ Chain: []validation.Constraint{{Target: "body.PoolProperties.Size", Name: validation.InclusiveMaximum, Rule: int64(549755813888000), Chain: nil},
+ {Target: "body.PoolProperties.Size", Name: validation.InclusiveMinimum, Rule: int64(4398046511104), Chain: nil},
+ }},
+ }}}},
+ {TargetValue: resourceGroupName,
+ Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil},
+ {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil},
+ {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}},
+ {TargetValue: poolName,
+ Constraints: []validation.Constraint{{Target: "poolName", Name: validation.MaxLength, Rule: 64, Chain: nil},
+ {Target: "poolName", Name: validation.MinLength, Rule: 1, Chain: nil},
+ {Target: "poolName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9][a-zA-Z0-9\-_]{0,63}$`, Chain: nil}}}}); err != nil {
+ return result, validation.NewError("netapp.PoolsClient", "CreateOrUpdate", err.Error())
+ }
+
+ req, err := client.CreateOrUpdatePreparer(ctx, body, resourceGroupName, accountName, poolName)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "netapp.PoolsClient", "CreateOrUpdate", nil, "Failure preparing request")
+ return
+ }
+
+ result, err = client.CreateOrUpdateSender(req)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "netapp.PoolsClient", "CreateOrUpdate", result.Response(), "Failure sending request")
+ return
+ }
+
+ return
+}
+
+// CreateOrUpdatePreparer prepares the CreateOrUpdate request.
+func (client PoolsClient) CreateOrUpdatePreparer(ctx context.Context, body CapacityPool, resourceGroupName string, accountName string, poolName string) (*http.Request, error) {
+ pathParameters := map[string]interface{}{
+ "accountName": autorest.Encode("path", accountName),
+ "poolName": autorest.Encode("path", poolName),
+ "resourceGroupName": autorest.Encode("path", resourceGroupName),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
+ }
+
+ const APIVersion = "2021-04-01-preview"
+ queryParameters := map[string]interface{}{
+ "api-version": APIVersion,
+ }
+
+ body.ID = nil
+ body.Name = nil
+ body.Type = nil
+ preparer := autorest.CreatePreparer(
+ autorest.AsContentType("application/json; charset=utf-8"),
+ autorest.AsPut(),
+ autorest.WithBaseURL(client.BaseURI),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/capacityPools/{poolName}", pathParameters),
+ autorest.WithJSON(body),
+ autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare((&http.Request{}).WithContext(ctx))
+}
+
+// CreateOrUpdateSender sends the CreateOrUpdate request. The method will close the
+// http.Response Body if it receives an error.
+func (client PoolsClient) CreateOrUpdateSender(req *http.Request) (future PoolsCreateOrUpdateFuture, err error) {
+ var resp *http.Response
+ future.FutureAPI = &azure.Future{}
+ resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client))
+ if err != nil {
+ return
+ }
+ var azf azure.Future
+ azf, err = azure.NewFutureFromResponse(resp)
+ future.FutureAPI = &azf
+ future.Result = future.result
+ return
+}
+
+// CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always
+// closes the http.Response Body.
+func (client PoolsClient) CreateOrUpdateResponder(resp *http.Response) (result CapacityPool, err error) {
+ err = autorest.Respond(
+ resp,
+ azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated),
+ autorest.ByUnmarshallingJSON(&result),
+ autorest.ByClosing())
+ result.Response = autorest.Response{Response: resp}
+ return
+}
+
+// Delete delete the specified capacity pool
+// Parameters:
+// resourceGroupName - the name of the resource group.
+// accountName - the name of the NetApp account
+// poolName - the name of the capacity pool
+func (client PoolsClient) Delete(ctx context.Context, resourceGroupName string, accountName string, poolName string) (result PoolsDeleteFuture, err error) {
+ if tracing.IsEnabled() {
+ ctx = tracing.StartSpan(ctx, fqdn+"/PoolsClient.Delete")
+ defer func() {
+ sc := -1
+ if result.FutureAPI != nil && result.FutureAPI.Response() != nil {
+ sc = result.FutureAPI.Response().StatusCode
+ }
+ tracing.EndSpan(ctx, sc, err)
+ }()
+ }
+ if err := validation.Validate([]validation.Validation{
+ {TargetValue: resourceGroupName,
+ Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil},
+ {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil},
+ {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}},
+ {TargetValue: poolName,
+ Constraints: []validation.Constraint{{Target: "poolName", Name: validation.MaxLength, Rule: 64, Chain: nil},
+ {Target: "poolName", Name: validation.MinLength, Rule: 1, Chain: nil},
+ {Target: "poolName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9][a-zA-Z0-9\-_]{0,63}$`, Chain: nil}}}}); err != nil {
+ return result, validation.NewError("netapp.PoolsClient", "Delete", err.Error())
+ }
+
+ req, err := client.DeletePreparer(ctx, resourceGroupName, accountName, poolName)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "netapp.PoolsClient", "Delete", nil, "Failure preparing request")
+ return
+ }
+
+ result, err = client.DeleteSender(req)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "netapp.PoolsClient", "Delete", result.Response(), "Failure sending request")
+ return
+ }
+
+ return
+}
+
+// DeletePreparer prepares the Delete request.
+func (client PoolsClient) DeletePreparer(ctx context.Context, resourceGroupName string, accountName string, poolName string) (*http.Request, error) {
+ pathParameters := map[string]interface{}{
+ "accountName": autorest.Encode("path", accountName),
+ "poolName": autorest.Encode("path", poolName),
+ "resourceGroupName": autorest.Encode("path", resourceGroupName),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
+ }
+
+ const APIVersion = "2021-04-01-preview"
+ queryParameters := map[string]interface{}{
+ "api-version": APIVersion,
+ }
+
+ preparer := autorest.CreatePreparer(
+ autorest.AsDelete(),
+ autorest.WithBaseURL(client.BaseURI),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/capacityPools/{poolName}", pathParameters),
+ autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare((&http.Request{}).WithContext(ctx))
+}
+
+// DeleteSender sends the Delete request. The method will close the
+// http.Response Body if it receives an error.
+func (client PoolsClient) DeleteSender(req *http.Request) (future PoolsDeleteFuture, err error) {
+ var resp *http.Response
+ future.FutureAPI = &azure.Future{}
+ resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client))
+ if err != nil {
+ return
+ }
+ var azf azure.Future
+ azf, err = azure.NewFutureFromResponse(resp)
+ future.FutureAPI = &azf
+ future.Result = future.result
+ return
+}
+
+// DeleteResponder handles the response to the Delete request. The method always
+// closes the http.Response Body.
+func (client PoolsClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) {
+ err = autorest.Respond(
+ resp,
+ azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent),
+ autorest.ByClosing())
+ result.Response = resp
+ return
+}
+
+// Get get details of the specified capacity pool
+// Parameters:
+// resourceGroupName - the name of the resource group.
+// accountName - the name of the NetApp account
+// poolName - the name of the capacity pool
+func (client PoolsClient) Get(ctx context.Context, resourceGroupName string, accountName string, poolName string) (result CapacityPool, err error) {
+ if tracing.IsEnabled() {
+ ctx = tracing.StartSpan(ctx, fqdn+"/PoolsClient.Get")
+ defer func() {
+ sc := -1
+ if result.Response.Response != nil {
+ sc = result.Response.Response.StatusCode
+ }
+ tracing.EndSpan(ctx, sc, err)
+ }()
+ }
+ if err := validation.Validate([]validation.Validation{
+ {TargetValue: resourceGroupName,
+ Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil},
+ {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil},
+ {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}},
+ {TargetValue: poolName,
+ Constraints: []validation.Constraint{{Target: "poolName", Name: validation.MaxLength, Rule: 64, Chain: nil},
+ {Target: "poolName", Name: validation.MinLength, Rule: 1, Chain: nil},
+ {Target: "poolName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9][a-zA-Z0-9\-_]{0,63}$`, Chain: nil}}}}); err != nil {
+ return result, validation.NewError("netapp.PoolsClient", "Get", err.Error())
+ }
+
+ req, err := client.GetPreparer(ctx, resourceGroupName, accountName, poolName)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "netapp.PoolsClient", "Get", nil, "Failure preparing request")
+ return
+ }
+
+ resp, err := client.GetSender(req)
+ if err != nil {
+ result.Response = autorest.Response{Response: resp}
+ err = autorest.NewErrorWithError(err, "netapp.PoolsClient", "Get", resp, "Failure sending request")
+ return
+ }
+
+ result, err = client.GetResponder(resp)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "netapp.PoolsClient", "Get", resp, "Failure responding to request")
+ return
+ }
+
+ return
+}
+
+// GetPreparer prepares the Get request.
+func (client PoolsClient) GetPreparer(ctx context.Context, resourceGroupName string, accountName string, poolName string) (*http.Request, error) {
+ pathParameters := map[string]interface{}{
+ "accountName": autorest.Encode("path", accountName),
+ "poolName": autorest.Encode("path", poolName),
+ "resourceGroupName": autorest.Encode("path", resourceGroupName),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
+ }
+
+ const APIVersion = "2021-04-01-preview"
+ queryParameters := map[string]interface{}{
+ "api-version": APIVersion,
+ }
+
+ preparer := autorest.CreatePreparer(
+ autorest.AsGet(),
+ autorest.WithBaseURL(client.BaseURI),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/capacityPools/{poolName}", pathParameters),
+ autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare((&http.Request{}).WithContext(ctx))
+}
+
+// GetSender sends the Get request. The method will close the
+// http.Response Body if it receives an error.
+func (client PoolsClient) GetSender(req *http.Request) (*http.Response, error) {
+ return client.Send(req, azure.DoRetryWithRegistration(client.Client))
+}
+
+// GetResponder handles the response to the Get request. The method always
+// closes the http.Response Body.
+func (client PoolsClient) GetResponder(resp *http.Response) (result CapacityPool, err error) {
+ err = autorest.Respond(
+ resp,
+ azure.WithErrorUnlessStatusCode(http.StatusOK),
+ autorest.ByUnmarshallingJSON(&result),
+ autorest.ByClosing())
+ result.Response = autorest.Response{Response: resp}
+ return
+}
+
+// List list all capacity pools in the NetApp Account
+// Parameters:
+// resourceGroupName - the name of the resource group.
+// accountName - the name of the NetApp account
+func (client PoolsClient) List(ctx context.Context, resourceGroupName string, accountName string) (result CapacityPoolListPage, err error) {
+ if tracing.IsEnabled() {
+ ctx = tracing.StartSpan(ctx, fqdn+"/PoolsClient.List")
+ defer func() {
+ sc := -1
+ if result.cpl.Response.Response != nil {
+ sc = result.cpl.Response.Response.StatusCode
+ }
+ tracing.EndSpan(ctx, sc, err)
+ }()
+ }
+ if err := validation.Validate([]validation.Validation{
+ {TargetValue: resourceGroupName,
+ Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil},
+ {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil},
+ {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}}); err != nil {
+ return result, validation.NewError("netapp.PoolsClient", "List", err.Error())
+ }
+
+ result.fn = client.listNextResults
+ req, err := client.ListPreparer(ctx, resourceGroupName, accountName)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "netapp.PoolsClient", "List", nil, "Failure preparing request")
+ return
+ }
+
+ resp, err := client.ListSender(req)
+ if err != nil {
+ result.cpl.Response = autorest.Response{Response: resp}
+ err = autorest.NewErrorWithError(err, "netapp.PoolsClient", "List", resp, "Failure sending request")
+ return
+ }
+
+ result.cpl, err = client.ListResponder(resp)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "netapp.PoolsClient", "List", resp, "Failure responding to request")
+ return
+ }
+ if result.cpl.hasNextLink() && result.cpl.IsEmpty() {
+ err = result.NextWithContext(ctx)
+ return
+ }
+
+ return
+}
+
+// ListPreparer prepares the List request.
+func (client PoolsClient) ListPreparer(ctx context.Context, resourceGroupName string, accountName string) (*http.Request, error) {
+ pathParameters := map[string]interface{}{
+ "accountName": autorest.Encode("path", accountName),
+ "resourceGroupName": autorest.Encode("path", resourceGroupName),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
+ }
+
+ const APIVersion = "2021-04-01-preview"
+ queryParameters := map[string]interface{}{
+ "api-version": APIVersion,
+ }
+
+ preparer := autorest.CreatePreparer(
+ autorest.AsGet(),
+ autorest.WithBaseURL(client.BaseURI),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/capacityPools", pathParameters),
+ autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare((&http.Request{}).WithContext(ctx))
+}
+
+// ListSender sends the List request. The method will close the
+// http.Response Body if it receives an error.
+func (client PoolsClient) ListSender(req *http.Request) (*http.Response, error) {
+ return client.Send(req, azure.DoRetryWithRegistration(client.Client))
+}
+
+// ListResponder handles the response to the List request. The method always
+// closes the http.Response Body.
+func (client PoolsClient) ListResponder(resp *http.Response) (result CapacityPoolList, err error) {
+ err = autorest.Respond(
+ resp,
+ azure.WithErrorUnlessStatusCode(http.StatusOK),
+ autorest.ByUnmarshallingJSON(&result),
+ autorest.ByClosing())
+ result.Response = autorest.Response{Response: resp}
+ return
+}
+
+// listNextResults retrieves the next set of results, if any.
+func (client PoolsClient) listNextResults(ctx context.Context, lastResults CapacityPoolList) (result CapacityPoolList, err error) {
+ req, err := lastResults.capacityPoolListPreparer(ctx)
+ if err != nil {
+ return result, autorest.NewErrorWithError(err, "netapp.PoolsClient", "listNextResults", nil, "Failure preparing next results request")
+ }
+ if req == nil {
+ return
+ }
+ resp, err := client.ListSender(req)
+ if err != nil {
+ result.Response = autorest.Response{Response: resp}
+ return result, autorest.NewErrorWithError(err, "netapp.PoolsClient", "listNextResults", resp, "Failure sending next results request")
+ }
+ result, err = client.ListResponder(resp)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "netapp.PoolsClient", "listNextResults", resp, "Failure responding to next results request")
+ }
+ return
+}
+
+// ListComplete enumerates all values, automatically crossing page boundaries as required.
+func (client PoolsClient) ListComplete(ctx context.Context, resourceGroupName string, accountName string) (result CapacityPoolListIterator, err error) {
+ if tracing.IsEnabled() {
+ ctx = tracing.StartSpan(ctx, fqdn+"/PoolsClient.List")
+ defer func() {
+ sc := -1
+ if result.Response().Response.Response != nil {
+ sc = result.page.Response().Response.Response.StatusCode
+ }
+ tracing.EndSpan(ctx, sc, err)
+ }()
+ }
+ result.page, err = client.List(ctx, resourceGroupName, accountName)
+ return
+}
+
+// Update patch the specified capacity pool
+// Parameters:
+// body - capacity pool object supplied in the body of the operation.
+// resourceGroupName - the name of the resource group.
+// accountName - the name of the NetApp account
+// poolName - the name of the capacity pool
+func (client PoolsClient) Update(ctx context.Context, body CapacityPoolPatch, resourceGroupName string, accountName string, poolName string) (result PoolsUpdateFuture, err error) {
+ if tracing.IsEnabled() {
+ ctx = tracing.StartSpan(ctx, fqdn+"/PoolsClient.Update")
+ defer func() {
+ sc := -1
+ if result.FutureAPI != nil && result.FutureAPI.Response() != nil {
+ sc = result.FutureAPI.Response().StatusCode
+ }
+ tracing.EndSpan(ctx, sc, err)
+ }()
+ }
+ if err := validation.Validate([]validation.Validation{
+ {TargetValue: resourceGroupName,
+ Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil},
+ {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil},
+ {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}},
+ {TargetValue: poolName,
+ Constraints: []validation.Constraint{{Target: "poolName", Name: validation.MaxLength, Rule: 64, Chain: nil},
+ {Target: "poolName", Name: validation.MinLength, Rule: 1, Chain: nil},
+ {Target: "poolName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9][a-zA-Z0-9\-_]{0,63}$`, Chain: nil}}}}); err != nil {
+ return result, validation.NewError("netapp.PoolsClient", "Update", err.Error())
+ }
+
+ req, err := client.UpdatePreparer(ctx, body, resourceGroupName, accountName, poolName)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "netapp.PoolsClient", "Update", nil, "Failure preparing request")
+ return
+ }
+
+ result, err = client.UpdateSender(req)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "netapp.PoolsClient", "Update", result.Response(), "Failure sending request")
+ return
+ }
+
+ return
+}
+
+// UpdatePreparer prepares the Update request.
+func (client PoolsClient) UpdatePreparer(ctx context.Context, body CapacityPoolPatch, resourceGroupName string, accountName string, poolName string) (*http.Request, error) {
+ pathParameters := map[string]interface{}{
+ "accountName": autorest.Encode("path", accountName),
+ "poolName": autorest.Encode("path", poolName),
+ "resourceGroupName": autorest.Encode("path", resourceGroupName),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
+ }
+
+ const APIVersion = "2021-04-01-preview"
+ queryParameters := map[string]interface{}{
+ "api-version": APIVersion,
+ }
+
+ body.ID = nil
+ body.Name = nil
+ body.Type = nil
+ preparer := autorest.CreatePreparer(
+ autorest.AsContentType("application/json; charset=utf-8"),
+ autorest.AsPatch(),
+ autorest.WithBaseURL(client.BaseURI),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/capacityPools/{poolName}", pathParameters),
+ autorest.WithJSON(body),
+ autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare((&http.Request{}).WithContext(ctx))
+}
+
+// UpdateSender sends the Update request. The method will close the
+// http.Response Body if it receives an error.
+func (client PoolsClient) UpdateSender(req *http.Request) (future PoolsUpdateFuture, err error) {
+ var resp *http.Response
+ future.FutureAPI = &azure.Future{}
+ resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client))
+ if err != nil {
+ return
+ }
+ var azf azure.Future
+ azf, err = azure.NewFutureFromResponse(resp)
+ future.FutureAPI = &azf
+ future.Result = future.result
+ return
+}
+
+// UpdateResponder handles the response to the Update request. The method always
+// closes the http.Response Body.
+func (client PoolsClient) UpdateResponder(resp *http.Response) (result CapacityPool, err error) {
+ err = autorest.Respond(
+ resp,
+ azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted),
+ autorest.ByUnmarshallingJSON(&result),
+ autorest.ByClosing())
+ result.Response = autorest.Response{Response: resp}
+ return
+}
diff --git a/services/preview/netapp/mgmt/2021-04-01-preview/netapp/resource.go b/services/preview/netapp/mgmt/2021-04-01-preview/netapp/resource.go
new file mode 100644
index 000000000000..47fc71159cd4
--- /dev/null
+++ b/services/preview/netapp/mgmt/2021-04-01-preview/netapp/resource.go
@@ -0,0 +1,284 @@
+package netapp
+
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License. See License.txt in the project root for license information.
+//
+// Code generated by Microsoft (R) AutoRest Code Generator.
+// Changes may cause incorrect behavior and will be lost if the code is regenerated.
+
+import (
+ "context"
+ "github.com/Azure/go-autorest/autorest"
+ "github.com/Azure/go-autorest/autorest/azure"
+ "github.com/Azure/go-autorest/autorest/validation"
+ "github.com/Azure/go-autorest/tracing"
+ "net/http"
+)
+
+// ResourceClient is the microsoft NetApp Files Azure Resource Provider specification
+type ResourceClient struct {
+ BaseClient
+}
+
+// NewResourceClient creates an instance of the ResourceClient client.
+func NewResourceClient(subscriptionID string) ResourceClient {
+ return NewResourceClientWithBaseURI(DefaultBaseURI, subscriptionID)
+}
+
+// NewResourceClientWithBaseURI creates an instance of the ResourceClient client using a custom endpoint. Use this
+// when interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure stack).
+func NewResourceClientWithBaseURI(baseURI string, subscriptionID string) ResourceClient {
+ return ResourceClient{NewWithBaseURI(baseURI, subscriptionID)}
+}
+
+// CheckFilePathAvailability check if a file path is available.
+// Parameters:
+// body - file path availability request.
+// location - the location
+func (client ResourceClient) CheckFilePathAvailability(ctx context.Context, body ResourceNameAvailabilityRequest, location string) (result CheckAvailabilityResponse, err error) {
+ if tracing.IsEnabled() {
+ ctx = tracing.StartSpan(ctx, fqdn+"/ResourceClient.CheckFilePathAvailability")
+ defer func() {
+ sc := -1
+ if result.Response.Response != nil {
+ sc = result.Response.Response.StatusCode
+ }
+ tracing.EndSpan(ctx, sc, err)
+ }()
+ }
+ if err := validation.Validate([]validation.Validation{
+ {TargetValue: body,
+ Constraints: []validation.Constraint{{Target: "body.Name", Name: validation.Null, Rule: true, Chain: nil},
+ {Target: "body.ResourceGroup", Name: validation.Null, Rule: true, Chain: nil}}}}); err != nil {
+ return result, validation.NewError("netapp.ResourceClient", "CheckFilePathAvailability", err.Error())
+ }
+
+ req, err := client.CheckFilePathAvailabilityPreparer(ctx, body, location)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "netapp.ResourceClient", "CheckFilePathAvailability", nil, "Failure preparing request")
+ return
+ }
+
+ resp, err := client.CheckFilePathAvailabilitySender(req)
+ if err != nil {
+ result.Response = autorest.Response{Response: resp}
+ err = autorest.NewErrorWithError(err, "netapp.ResourceClient", "CheckFilePathAvailability", resp, "Failure sending request")
+ return
+ }
+
+ result, err = client.CheckFilePathAvailabilityResponder(resp)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "netapp.ResourceClient", "CheckFilePathAvailability", resp, "Failure responding to request")
+ return
+ }
+
+ return
+}
+
+// CheckFilePathAvailabilityPreparer prepares the CheckFilePathAvailability request.
+func (client ResourceClient) CheckFilePathAvailabilityPreparer(ctx context.Context, body ResourceNameAvailabilityRequest, location string) (*http.Request, error) {
+ pathParameters := map[string]interface{}{
+ "location": autorest.Encode("path", location),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
+ }
+
+ const APIVersion = "2021-04-01-preview"
+ queryParameters := map[string]interface{}{
+ "api-version": APIVersion,
+ }
+
+ preparer := autorest.CreatePreparer(
+ autorest.AsContentType("application/json; charset=utf-8"),
+ autorest.AsPost(),
+ autorest.WithBaseURL(client.BaseURI),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.NetApp/locations/{location}/checkFilePathAvailability", pathParameters),
+ autorest.WithJSON(body),
+ autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare((&http.Request{}).WithContext(ctx))
+}
+
+// CheckFilePathAvailabilitySender sends the CheckFilePathAvailability request. The method will close the
+// http.Response Body if it receives an error.
+func (client ResourceClient) CheckFilePathAvailabilitySender(req *http.Request) (*http.Response, error) {
+ return client.Send(req, azure.DoRetryWithRegistration(client.Client))
+}
+
+// CheckFilePathAvailabilityResponder handles the response to the CheckFilePathAvailability request. The method always
+// closes the http.Response Body.
+func (client ResourceClient) CheckFilePathAvailabilityResponder(resp *http.Response) (result CheckAvailabilityResponse, err error) {
+ err = autorest.Respond(
+ resp,
+ azure.WithErrorUnlessStatusCode(http.StatusOK),
+ autorest.ByUnmarshallingJSON(&result),
+ autorest.ByClosing())
+ result.Response = autorest.Response{Response: resp}
+ return
+}
+
+// CheckNameAvailability check if a resource name is available.
+// Parameters:
+// body - name availability request.
+// location - the location
+func (client ResourceClient) CheckNameAvailability(ctx context.Context, body ResourceNameAvailabilityRequest, location string) (result CheckAvailabilityResponse, err error) {
+ if tracing.IsEnabled() {
+ ctx = tracing.StartSpan(ctx, fqdn+"/ResourceClient.CheckNameAvailability")
+ defer func() {
+ sc := -1
+ if result.Response.Response != nil {
+ sc = result.Response.Response.StatusCode
+ }
+ tracing.EndSpan(ctx, sc, err)
+ }()
+ }
+ if err := validation.Validate([]validation.Validation{
+ {TargetValue: body,
+ Constraints: []validation.Constraint{{Target: "body.Name", Name: validation.Null, Rule: true, Chain: nil},
+ {Target: "body.ResourceGroup", Name: validation.Null, Rule: true, Chain: nil}}}}); err != nil {
+ return result, validation.NewError("netapp.ResourceClient", "CheckNameAvailability", err.Error())
+ }
+
+ req, err := client.CheckNameAvailabilityPreparer(ctx, body, location)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "netapp.ResourceClient", "CheckNameAvailability", nil, "Failure preparing request")
+ return
+ }
+
+ resp, err := client.CheckNameAvailabilitySender(req)
+ if err != nil {
+ result.Response = autorest.Response{Response: resp}
+ err = autorest.NewErrorWithError(err, "netapp.ResourceClient", "CheckNameAvailability", resp, "Failure sending request")
+ return
+ }
+
+ result, err = client.CheckNameAvailabilityResponder(resp)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "netapp.ResourceClient", "CheckNameAvailability", resp, "Failure responding to request")
+ return
+ }
+
+ return
+}
+
+// CheckNameAvailabilityPreparer prepares the CheckNameAvailability request.
+func (client ResourceClient) CheckNameAvailabilityPreparer(ctx context.Context, body ResourceNameAvailabilityRequest, location string) (*http.Request, error) {
+ pathParameters := map[string]interface{}{
+ "location": autorest.Encode("path", location),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
+ }
+
+ const APIVersion = "2021-04-01-preview"
+ queryParameters := map[string]interface{}{
+ "api-version": APIVersion,
+ }
+
+ preparer := autorest.CreatePreparer(
+ autorest.AsContentType("application/json; charset=utf-8"),
+ autorest.AsPost(),
+ autorest.WithBaseURL(client.BaseURI),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.NetApp/locations/{location}/checkNameAvailability", pathParameters),
+ autorest.WithJSON(body),
+ autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare((&http.Request{}).WithContext(ctx))
+}
+
+// CheckNameAvailabilitySender sends the CheckNameAvailability request. The method will close the
+// http.Response Body if it receives an error.
+func (client ResourceClient) CheckNameAvailabilitySender(req *http.Request) (*http.Response, error) {
+ return client.Send(req, azure.DoRetryWithRegistration(client.Client))
+}
+
+// CheckNameAvailabilityResponder handles the response to the CheckNameAvailability request. The method always
+// closes the http.Response Body.
+func (client ResourceClient) CheckNameAvailabilityResponder(resp *http.Response) (result CheckAvailabilityResponse, err error) {
+ err = autorest.Respond(
+ resp,
+ azure.WithErrorUnlessStatusCode(http.StatusOK),
+ autorest.ByUnmarshallingJSON(&result),
+ autorest.ByClosing())
+ result.Response = autorest.Response{Response: resp}
+ return
+}
+
+// CheckQuotaAvailability check if a quota is available.
+// Parameters:
+// body - quota availability request.
+// location - the location
+func (client ResourceClient) CheckQuotaAvailability(ctx context.Context, body QuotaAvailabilityRequest, location string) (result CheckAvailabilityResponse, err error) {
+ if tracing.IsEnabled() {
+ ctx = tracing.StartSpan(ctx, fqdn+"/ResourceClient.CheckQuotaAvailability")
+ defer func() {
+ sc := -1
+ if result.Response.Response != nil {
+ sc = result.Response.Response.StatusCode
+ }
+ tracing.EndSpan(ctx, sc, err)
+ }()
+ }
+ if err := validation.Validate([]validation.Validation{
+ {TargetValue: body,
+ Constraints: []validation.Constraint{{Target: "body.Name", Name: validation.Null, Rule: true, Chain: nil},
+ {Target: "body.ResourceGroup", Name: validation.Null, Rule: true, Chain: nil}}}}); err != nil {
+ return result, validation.NewError("netapp.ResourceClient", "CheckQuotaAvailability", err.Error())
+ }
+
+ req, err := client.CheckQuotaAvailabilityPreparer(ctx, body, location)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "netapp.ResourceClient", "CheckQuotaAvailability", nil, "Failure preparing request")
+ return
+ }
+
+ resp, err := client.CheckQuotaAvailabilitySender(req)
+ if err != nil {
+ result.Response = autorest.Response{Response: resp}
+ err = autorest.NewErrorWithError(err, "netapp.ResourceClient", "CheckQuotaAvailability", resp, "Failure sending request")
+ return
+ }
+
+ result, err = client.CheckQuotaAvailabilityResponder(resp)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "netapp.ResourceClient", "CheckQuotaAvailability", resp, "Failure responding to request")
+ return
+ }
+
+ return
+}
+
+// CheckQuotaAvailabilityPreparer prepares the CheckQuotaAvailability request.
+func (client ResourceClient) CheckQuotaAvailabilityPreparer(ctx context.Context, body QuotaAvailabilityRequest, location string) (*http.Request, error) {
+ pathParameters := map[string]interface{}{
+ "location": autorest.Encode("path", location),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
+ }
+
+ const APIVersion = "2021-04-01-preview"
+ queryParameters := map[string]interface{}{
+ "api-version": APIVersion,
+ }
+
+ preparer := autorest.CreatePreparer(
+ autorest.AsContentType("application/json; charset=utf-8"),
+ autorest.AsPost(),
+ autorest.WithBaseURL(client.BaseURI),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.NetApp/locations/{location}/checkQuotaAvailability", pathParameters),
+ autorest.WithJSON(body),
+ autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare((&http.Request{}).WithContext(ctx))
+}
+
+// CheckQuotaAvailabilitySender sends the CheckQuotaAvailability request. The method will close the
+// http.Response Body if it receives an error.
+func (client ResourceClient) CheckQuotaAvailabilitySender(req *http.Request) (*http.Response, error) {
+ return client.Send(req, azure.DoRetryWithRegistration(client.Client))
+}
+
+// CheckQuotaAvailabilityResponder handles the response to the CheckQuotaAvailability request. The method always
+// closes the http.Response Body.
+func (client ResourceClient) CheckQuotaAvailabilityResponder(resp *http.Response) (result CheckAvailabilityResponse, err error) {
+ err = autorest.Respond(
+ resp,
+ azure.WithErrorUnlessStatusCode(http.StatusOK),
+ autorest.ByUnmarshallingJSON(&result),
+ autorest.ByClosing())
+ result.Response = autorest.Response{Response: resp}
+ return
+}
diff --git a/services/preview/netapp/mgmt/2021-04-01-preview/netapp/resourceregioninfo.go b/services/preview/netapp/mgmt/2021-04-01-preview/netapp/resourceregioninfo.go
new file mode 100644
index 000000000000..e196a907e18f
--- /dev/null
+++ b/services/preview/netapp/mgmt/2021-04-01-preview/netapp/resourceregioninfo.go
@@ -0,0 +1,106 @@
+package netapp
+
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License. See License.txt in the project root for license information.
+//
+// Code generated by Microsoft (R) AutoRest Code Generator.
+// Changes may cause incorrect behavior and will be lost if the code is regenerated.
+
+import (
+ "context"
+ "github.com/Azure/go-autorest/autorest"
+ "github.com/Azure/go-autorest/autorest/azure"
+ "github.com/Azure/go-autorest/tracing"
+ "net/http"
+)
+
+// ResourceRegionInfoClient is the microsoft NetApp Files Azure Resource Provider specification
+type ResourceRegionInfoClient struct {
+ BaseClient
+}
+
+// NewResourceRegionInfoClient creates an instance of the ResourceRegionInfoClient client.
+func NewResourceRegionInfoClient(subscriptionID string) ResourceRegionInfoClient {
+ return NewResourceRegionInfoClientWithBaseURI(DefaultBaseURI, subscriptionID)
+}
+
+// NewResourceRegionInfoClientWithBaseURI creates an instance of the ResourceRegionInfoClient client using a custom
+// endpoint. Use this when interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure
+// stack).
+func NewResourceRegionInfoClientWithBaseURI(baseURI string, subscriptionID string) ResourceRegionInfoClient {
+ return ResourceRegionInfoClient{NewWithBaseURI(baseURI, subscriptionID)}
+}
+
+// Get provides storage to network proximity information.
+// Parameters:
+// location - the location
+func (client ResourceRegionInfoClient) Get(ctx context.Context, location string) (result RegionInfo, err error) {
+ if tracing.IsEnabled() {
+ ctx = tracing.StartSpan(ctx, fqdn+"/ResourceRegionInfoClient.Get")
+ defer func() {
+ sc := -1
+ if result.Response.Response != nil {
+ sc = result.Response.Response.StatusCode
+ }
+ tracing.EndSpan(ctx, sc, err)
+ }()
+ }
+ req, err := client.GetPreparer(ctx, location)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "netapp.ResourceRegionInfoClient", "Get", nil, "Failure preparing request")
+ return
+ }
+
+ resp, err := client.GetSender(req)
+ if err != nil {
+ result.Response = autorest.Response{Response: resp}
+ err = autorest.NewErrorWithError(err, "netapp.ResourceRegionInfoClient", "Get", resp, "Failure sending request")
+ return
+ }
+
+ result, err = client.GetResponder(resp)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "netapp.ResourceRegionInfoClient", "Get", resp, "Failure responding to request")
+ return
+ }
+
+ return
+}
+
+// GetPreparer prepares the Get request.
+func (client ResourceRegionInfoClient) GetPreparer(ctx context.Context, location string) (*http.Request, error) {
+ pathParameters := map[string]interface{}{
+ "location": autorest.Encode("path", location),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
+ }
+
+ const APIVersion = "2021-04-01-preview"
+ queryParameters := map[string]interface{}{
+ "api-version": APIVersion,
+ }
+
+ preparer := autorest.CreatePreparer(
+ autorest.AsGet(),
+ autorest.WithBaseURL(client.BaseURI),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.NetApp/locations/{location}/regionInfo", pathParameters),
+ autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare((&http.Request{}).WithContext(ctx))
+}
+
+// GetSender sends the Get request. The method will close the
+// http.Response Body if it receives an error.
+func (client ResourceRegionInfoClient) GetSender(req *http.Request) (*http.Response, error) {
+ return client.Send(req, azure.DoRetryWithRegistration(client.Client))
+}
+
+// GetResponder handles the response to the Get request. The method always
+// closes the http.Response Body.
+func (client ResourceRegionInfoClient) GetResponder(resp *http.Response) (result RegionInfo, err error) {
+ err = autorest.Respond(
+ resp,
+ azure.WithErrorUnlessStatusCode(http.StatusOK),
+ autorest.ByUnmarshallingJSON(&result),
+ autorest.ByClosing())
+ result.Response = autorest.Response{Response: resp}
+ return
+}
diff --git a/services/preview/netapp/mgmt/2021-04-01-preview/netapp/snapshotpolicies.go b/services/preview/netapp/mgmt/2021-04-01-preview/netapp/snapshotpolicies.go
new file mode 100644
index 000000000000..2907aae5e0c8
--- /dev/null
+++ b/services/preview/netapp/mgmt/2021-04-01-preview/netapp/snapshotpolicies.go
@@ -0,0 +1,567 @@
+package netapp
+
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License. See License.txt in the project root for license information.
+//
+// Code generated by Microsoft (R) AutoRest Code Generator.
+// Changes may cause incorrect behavior and will be lost if the code is regenerated.
+
+import (
+ "context"
+ "github.com/Azure/go-autorest/autorest"
+ "github.com/Azure/go-autorest/autorest/azure"
+ "github.com/Azure/go-autorest/autorest/validation"
+ "github.com/Azure/go-autorest/tracing"
+ "net/http"
+)
+
+// SnapshotPoliciesClient is the microsoft NetApp Files Azure Resource Provider specification
+type SnapshotPoliciesClient struct {
+ BaseClient
+}
+
+// NewSnapshotPoliciesClient creates an instance of the SnapshotPoliciesClient client.
+func NewSnapshotPoliciesClient(subscriptionID string) SnapshotPoliciesClient {
+ return NewSnapshotPoliciesClientWithBaseURI(DefaultBaseURI, subscriptionID)
+}
+
+// NewSnapshotPoliciesClientWithBaseURI creates an instance of the SnapshotPoliciesClient client using a custom
+// endpoint. Use this when interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure
+// stack).
+func NewSnapshotPoliciesClientWithBaseURI(baseURI string, subscriptionID string) SnapshotPoliciesClient {
+ return SnapshotPoliciesClient{NewWithBaseURI(baseURI, subscriptionID)}
+}
+
+// Create create a snapshot policy
+// Parameters:
+// body - snapshot policy object supplied in the body of the operation.
+// resourceGroupName - the name of the resource group.
+// accountName - the name of the NetApp account
+// snapshotPolicyName - the name of the snapshot policy target
+func (client SnapshotPoliciesClient) Create(ctx context.Context, body SnapshotPolicy, resourceGroupName string, accountName string, snapshotPolicyName string) (result SnapshotPolicy, err error) {
+ if tracing.IsEnabled() {
+ ctx = tracing.StartSpan(ctx, fqdn+"/SnapshotPoliciesClient.Create")
+ defer func() {
+ sc := -1
+ if result.Response.Response != nil {
+ sc = result.Response.Response.StatusCode
+ }
+ tracing.EndSpan(ctx, sc, err)
+ }()
+ }
+ if err := validation.Validate([]validation.Validation{
+ {TargetValue: body,
+ Constraints: []validation.Constraint{{Target: "body.Location", Name: validation.Null, Rule: true, Chain: nil},
+ {Target: "body.SnapshotPolicyProperties", Name: validation.Null, Rule: true, Chain: nil}}},
+ {TargetValue: resourceGroupName,
+ Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil},
+ {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil},
+ {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}}); err != nil {
+ return result, validation.NewError("netapp.SnapshotPoliciesClient", "Create", err.Error())
+ }
+
+ req, err := client.CreatePreparer(ctx, body, resourceGroupName, accountName, snapshotPolicyName)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "netapp.SnapshotPoliciesClient", "Create", nil, "Failure preparing request")
+ return
+ }
+
+ resp, err := client.CreateSender(req)
+ if err != nil {
+ result.Response = autorest.Response{Response: resp}
+ err = autorest.NewErrorWithError(err, "netapp.SnapshotPoliciesClient", "Create", resp, "Failure sending request")
+ return
+ }
+
+ result, err = client.CreateResponder(resp)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "netapp.SnapshotPoliciesClient", "Create", resp, "Failure responding to request")
+ return
+ }
+
+ return
+}
+
+// CreatePreparer prepares the Create request.
+func (client SnapshotPoliciesClient) CreatePreparer(ctx context.Context, body SnapshotPolicy, resourceGroupName string, accountName string, snapshotPolicyName string) (*http.Request, error) {
+ pathParameters := map[string]interface{}{
+ "accountName": autorest.Encode("path", accountName),
+ "resourceGroupName": autorest.Encode("path", resourceGroupName),
+ "snapshotPolicyName": autorest.Encode("path", snapshotPolicyName),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
+ }
+
+ const APIVersion = "2021-04-01-preview"
+ queryParameters := map[string]interface{}{
+ "api-version": APIVersion,
+ }
+
+ body.ID = nil
+ body.Name = nil
+ body.Type = nil
+ preparer := autorest.CreatePreparer(
+ autorest.AsContentType("application/json; charset=utf-8"),
+ autorest.AsPut(),
+ autorest.WithBaseURL(client.BaseURI),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/snapshotPolicies/{snapshotPolicyName}", pathParameters),
+ autorest.WithJSON(body),
+ autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare((&http.Request{}).WithContext(ctx))
+}
+
+// CreateSender sends the Create request. The method will close the
+// http.Response Body if it receives an error.
+func (client SnapshotPoliciesClient) CreateSender(req *http.Request) (*http.Response, error) {
+ return client.Send(req, azure.DoRetryWithRegistration(client.Client))
+}
+
+// CreateResponder handles the response to the Create request. The method always
+// closes the http.Response Body.
+func (client SnapshotPoliciesClient) CreateResponder(resp *http.Response) (result SnapshotPolicy, err error) {
+ err = autorest.Respond(
+ resp,
+ azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated),
+ autorest.ByUnmarshallingJSON(&result),
+ autorest.ByClosing())
+ result.Response = autorest.Response{Response: resp}
+ return
+}
+
+// Delete delete snapshot policy
+// Parameters:
+// resourceGroupName - the name of the resource group.
+// accountName - the name of the NetApp account
+// snapshotPolicyName - the name of the snapshot policy target
+func (client SnapshotPoliciesClient) Delete(ctx context.Context, resourceGroupName string, accountName string, snapshotPolicyName string) (result SnapshotPoliciesDeleteFuture, err error) {
+ if tracing.IsEnabled() {
+ ctx = tracing.StartSpan(ctx, fqdn+"/SnapshotPoliciesClient.Delete")
+ defer func() {
+ sc := -1
+ if result.FutureAPI != nil && result.FutureAPI.Response() != nil {
+ sc = result.FutureAPI.Response().StatusCode
+ }
+ tracing.EndSpan(ctx, sc, err)
+ }()
+ }
+ if err := validation.Validate([]validation.Validation{
+ {TargetValue: resourceGroupName,
+ Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil},
+ {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil},
+ {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}}); err != nil {
+ return result, validation.NewError("netapp.SnapshotPoliciesClient", "Delete", err.Error())
+ }
+
+ req, err := client.DeletePreparer(ctx, resourceGroupName, accountName, snapshotPolicyName)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "netapp.SnapshotPoliciesClient", "Delete", nil, "Failure preparing request")
+ return
+ }
+
+ result, err = client.DeleteSender(req)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "netapp.SnapshotPoliciesClient", "Delete", result.Response(), "Failure sending request")
+ return
+ }
+
+ return
+}
+
+// DeletePreparer prepares the Delete request.
+func (client SnapshotPoliciesClient) DeletePreparer(ctx context.Context, resourceGroupName string, accountName string, snapshotPolicyName string) (*http.Request, error) {
+ pathParameters := map[string]interface{}{
+ "accountName": autorest.Encode("path", accountName),
+ "resourceGroupName": autorest.Encode("path", resourceGroupName),
+ "snapshotPolicyName": autorest.Encode("path", snapshotPolicyName),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
+ }
+
+ const APIVersion = "2021-04-01-preview"
+ queryParameters := map[string]interface{}{
+ "api-version": APIVersion,
+ }
+
+ preparer := autorest.CreatePreparer(
+ autorest.AsDelete(),
+ autorest.WithBaseURL(client.BaseURI),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/snapshotPolicies/{snapshotPolicyName}", pathParameters),
+ autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare((&http.Request{}).WithContext(ctx))
+}
+
+// DeleteSender sends the Delete request. The method will close the
+// http.Response Body if it receives an error.
+func (client SnapshotPoliciesClient) DeleteSender(req *http.Request) (future SnapshotPoliciesDeleteFuture, err error) {
+ var resp *http.Response
+ future.FutureAPI = &azure.Future{}
+ resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client))
+ if err != nil {
+ return
+ }
+ var azf azure.Future
+ azf, err = azure.NewFutureFromResponse(resp)
+ future.FutureAPI = &azf
+ future.Result = future.result
+ return
+}
+
+// DeleteResponder handles the response to the Delete request. The method always
+// closes the http.Response Body.
+func (client SnapshotPoliciesClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) {
+ err = autorest.Respond(
+ resp,
+ azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent),
+ autorest.ByClosing())
+ result.Response = resp
+ return
+}
+
+// Get get a snapshot Policy
+// Parameters:
+// resourceGroupName - the name of the resource group.
+// accountName - the name of the NetApp account
+// snapshotPolicyName - the name of the snapshot policy target
+func (client SnapshotPoliciesClient) Get(ctx context.Context, resourceGroupName string, accountName string, snapshotPolicyName string) (result SnapshotPolicy, err error) {
+ if tracing.IsEnabled() {
+ ctx = tracing.StartSpan(ctx, fqdn+"/SnapshotPoliciesClient.Get")
+ defer func() {
+ sc := -1
+ if result.Response.Response != nil {
+ sc = result.Response.Response.StatusCode
+ }
+ tracing.EndSpan(ctx, sc, err)
+ }()
+ }
+ if err := validation.Validate([]validation.Validation{
+ {TargetValue: resourceGroupName,
+ Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil},
+ {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil},
+ {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}}); err != nil {
+ return result, validation.NewError("netapp.SnapshotPoliciesClient", "Get", err.Error())
+ }
+
+ req, err := client.GetPreparer(ctx, resourceGroupName, accountName, snapshotPolicyName)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "netapp.SnapshotPoliciesClient", "Get", nil, "Failure preparing request")
+ return
+ }
+
+ resp, err := client.GetSender(req)
+ if err != nil {
+ result.Response = autorest.Response{Response: resp}
+ err = autorest.NewErrorWithError(err, "netapp.SnapshotPoliciesClient", "Get", resp, "Failure sending request")
+ return
+ }
+
+ result, err = client.GetResponder(resp)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "netapp.SnapshotPoliciesClient", "Get", resp, "Failure responding to request")
+ return
+ }
+
+ return
+}
+
+// GetPreparer prepares the Get request.
+func (client SnapshotPoliciesClient) GetPreparer(ctx context.Context, resourceGroupName string, accountName string, snapshotPolicyName string) (*http.Request, error) {
+ pathParameters := map[string]interface{}{
+ "accountName": autorest.Encode("path", accountName),
+ "resourceGroupName": autorest.Encode("path", resourceGroupName),
+ "snapshotPolicyName": autorest.Encode("path", snapshotPolicyName),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
+ }
+
+ const APIVersion = "2021-04-01-preview"
+ queryParameters := map[string]interface{}{
+ "api-version": APIVersion,
+ }
+
+ preparer := autorest.CreatePreparer(
+ autorest.AsGet(),
+ autorest.WithBaseURL(client.BaseURI),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/snapshotPolicies/{snapshotPolicyName}", pathParameters),
+ autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare((&http.Request{}).WithContext(ctx))
+}
+
+// GetSender sends the Get request. The method will close the
+// http.Response Body if it receives an error.
+func (client SnapshotPoliciesClient) GetSender(req *http.Request) (*http.Response, error) {
+ return client.Send(req, azure.DoRetryWithRegistration(client.Client))
+}
+
+// GetResponder handles the response to the Get request. The method always
+// closes the http.Response Body.
+func (client SnapshotPoliciesClient) GetResponder(resp *http.Response) (result SnapshotPolicy, err error) {
+ err = autorest.Respond(
+ resp,
+ azure.WithErrorUnlessStatusCode(http.StatusOK),
+ autorest.ByUnmarshallingJSON(&result),
+ autorest.ByClosing())
+ result.Response = autorest.Response{Response: resp}
+ return
+}
+
+// List list snapshot policy
+// Parameters:
+// resourceGroupName - the name of the resource group.
+// accountName - the name of the NetApp account
+func (client SnapshotPoliciesClient) List(ctx context.Context, resourceGroupName string, accountName string) (result SnapshotPoliciesList, err error) {
+ if tracing.IsEnabled() {
+ ctx = tracing.StartSpan(ctx, fqdn+"/SnapshotPoliciesClient.List")
+ defer func() {
+ sc := -1
+ if result.Response.Response != nil {
+ sc = result.Response.Response.StatusCode
+ }
+ tracing.EndSpan(ctx, sc, err)
+ }()
+ }
+ if err := validation.Validate([]validation.Validation{
+ {TargetValue: resourceGroupName,
+ Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil},
+ {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil},
+ {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}}); err != nil {
+ return result, validation.NewError("netapp.SnapshotPoliciesClient", "List", err.Error())
+ }
+
+ req, err := client.ListPreparer(ctx, resourceGroupName, accountName)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "netapp.SnapshotPoliciesClient", "List", nil, "Failure preparing request")
+ return
+ }
+
+ resp, err := client.ListSender(req)
+ if err != nil {
+ result.Response = autorest.Response{Response: resp}
+ err = autorest.NewErrorWithError(err, "netapp.SnapshotPoliciesClient", "List", resp, "Failure sending request")
+ return
+ }
+
+ result, err = client.ListResponder(resp)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "netapp.SnapshotPoliciesClient", "List", resp, "Failure responding to request")
+ return
+ }
+
+ return
+}
+
+// ListPreparer prepares the List request.
+func (client SnapshotPoliciesClient) ListPreparer(ctx context.Context, resourceGroupName string, accountName string) (*http.Request, error) {
+ pathParameters := map[string]interface{}{
+ "accountName": autorest.Encode("path", accountName),
+ "resourceGroupName": autorest.Encode("path", resourceGroupName),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
+ }
+
+ const APIVersion = "2021-04-01-preview"
+ queryParameters := map[string]interface{}{
+ "api-version": APIVersion,
+ }
+
+ preparer := autorest.CreatePreparer(
+ autorest.AsGet(),
+ autorest.WithBaseURL(client.BaseURI),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/snapshotPolicies", pathParameters),
+ autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare((&http.Request{}).WithContext(ctx))
+}
+
+// ListSender sends the List request. The method will close the
+// http.Response Body if it receives an error.
+func (client SnapshotPoliciesClient) ListSender(req *http.Request) (*http.Response, error) {
+ return client.Send(req, azure.DoRetryWithRegistration(client.Client))
+}
+
+// ListResponder handles the response to the List request. The method always
+// closes the http.Response Body.
+func (client SnapshotPoliciesClient) ListResponder(resp *http.Response) (result SnapshotPoliciesList, err error) {
+ err = autorest.Respond(
+ resp,
+ azure.WithErrorUnlessStatusCode(http.StatusOK),
+ autorest.ByUnmarshallingJSON(&result),
+ autorest.ByClosing())
+ result.Response = autorest.Response{Response: resp}
+ return
+}
+
+// ListVolumes get volumes associated with snapshot policy
+// Parameters:
+// resourceGroupName - the name of the resource group.
+// accountName - the name of the NetApp account
+// snapshotPolicyName - the name of the snapshot policy target
+func (client SnapshotPoliciesClient) ListVolumes(ctx context.Context, resourceGroupName string, accountName string, snapshotPolicyName string) (result SnapshotPolicyVolumeList, err error) {
+ if tracing.IsEnabled() {
+ ctx = tracing.StartSpan(ctx, fqdn+"/SnapshotPoliciesClient.ListVolumes")
+ defer func() {
+ sc := -1
+ if result.Response.Response != nil {
+ sc = result.Response.Response.StatusCode
+ }
+ tracing.EndSpan(ctx, sc, err)
+ }()
+ }
+ if err := validation.Validate([]validation.Validation{
+ {TargetValue: resourceGroupName,
+ Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil},
+ {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil},
+ {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}}); err != nil {
+ return result, validation.NewError("netapp.SnapshotPoliciesClient", "ListVolumes", err.Error())
+ }
+
+ req, err := client.ListVolumesPreparer(ctx, resourceGroupName, accountName, snapshotPolicyName)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "netapp.SnapshotPoliciesClient", "ListVolumes", nil, "Failure preparing request")
+ return
+ }
+
+ resp, err := client.ListVolumesSender(req)
+ if err != nil {
+ result.Response = autorest.Response{Response: resp}
+ err = autorest.NewErrorWithError(err, "netapp.SnapshotPoliciesClient", "ListVolumes", resp, "Failure sending request")
+ return
+ }
+
+ result, err = client.ListVolumesResponder(resp)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "netapp.SnapshotPoliciesClient", "ListVolumes", resp, "Failure responding to request")
+ return
+ }
+
+ return
+}
+
+// ListVolumesPreparer prepares the ListVolumes request.
+func (client SnapshotPoliciesClient) ListVolumesPreparer(ctx context.Context, resourceGroupName string, accountName string, snapshotPolicyName string) (*http.Request, error) {
+ pathParameters := map[string]interface{}{
+ "accountName": autorest.Encode("path", accountName),
+ "resourceGroupName": autorest.Encode("path", resourceGroupName),
+ "snapshotPolicyName": autorest.Encode("path", snapshotPolicyName),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
+ }
+
+ const APIVersion = "2021-04-01-preview"
+ queryParameters := map[string]interface{}{
+ "api-version": APIVersion,
+ }
+
+ preparer := autorest.CreatePreparer(
+ autorest.AsGet(),
+ autorest.WithBaseURL(client.BaseURI),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/snapshotPolicies/{snapshotPolicyName}/volumes", pathParameters),
+ autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare((&http.Request{}).WithContext(ctx))
+}
+
+// ListVolumesSender sends the ListVolumes request. The method will close the
+// http.Response Body if it receives an error.
+func (client SnapshotPoliciesClient) ListVolumesSender(req *http.Request) (*http.Response, error) {
+ return client.Send(req, azure.DoRetryWithRegistration(client.Client))
+}
+
+// ListVolumesResponder handles the response to the ListVolumes request. The method always
+// closes the http.Response Body.
+func (client SnapshotPoliciesClient) ListVolumesResponder(resp *http.Response) (result SnapshotPolicyVolumeList, err error) {
+ err = autorest.Respond(
+ resp,
+ azure.WithErrorUnlessStatusCode(http.StatusOK),
+ autorest.ByUnmarshallingJSON(&result),
+ autorest.ByClosing())
+ result.Response = autorest.Response{Response: resp}
+ return
+}
+
+// Update patch a snapshot policy
+// Parameters:
+// body - snapshot policy object supplied in the body of the operation.
+// resourceGroupName - the name of the resource group.
+// accountName - the name of the NetApp account
+// snapshotPolicyName - the name of the snapshot policy target
+func (client SnapshotPoliciesClient) Update(ctx context.Context, body SnapshotPolicyPatch, resourceGroupName string, accountName string, snapshotPolicyName string) (result SnapshotPoliciesUpdateFuture, err error) {
+ if tracing.IsEnabled() {
+ ctx = tracing.StartSpan(ctx, fqdn+"/SnapshotPoliciesClient.Update")
+ defer func() {
+ sc := -1
+ if result.FutureAPI != nil && result.FutureAPI.Response() != nil {
+ sc = result.FutureAPI.Response().StatusCode
+ }
+ tracing.EndSpan(ctx, sc, err)
+ }()
+ }
+ if err := validation.Validate([]validation.Validation{
+ {TargetValue: resourceGroupName,
+ Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil},
+ {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil},
+ {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}}); err != nil {
+ return result, validation.NewError("netapp.SnapshotPoliciesClient", "Update", err.Error())
+ }
+
+ req, err := client.UpdatePreparer(ctx, body, resourceGroupName, accountName, snapshotPolicyName)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "netapp.SnapshotPoliciesClient", "Update", nil, "Failure preparing request")
+ return
+ }
+
+ result, err = client.UpdateSender(req)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "netapp.SnapshotPoliciesClient", "Update", result.Response(), "Failure sending request")
+ return
+ }
+
+ return
+}
+
+// UpdatePreparer prepares the Update request.
+func (client SnapshotPoliciesClient) UpdatePreparer(ctx context.Context, body SnapshotPolicyPatch, resourceGroupName string, accountName string, snapshotPolicyName string) (*http.Request, error) {
+ pathParameters := map[string]interface{}{
+ "accountName": autorest.Encode("path", accountName),
+ "resourceGroupName": autorest.Encode("path", resourceGroupName),
+ "snapshotPolicyName": autorest.Encode("path", snapshotPolicyName),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
+ }
+
+ const APIVersion = "2021-04-01-preview"
+ queryParameters := map[string]interface{}{
+ "api-version": APIVersion,
+ }
+
+ body.ID = nil
+ body.Name = nil
+ body.Type = nil
+ preparer := autorest.CreatePreparer(
+ autorest.AsContentType("application/json; charset=utf-8"),
+ autorest.AsPatch(),
+ autorest.WithBaseURL(client.BaseURI),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/snapshotPolicies/{snapshotPolicyName}", pathParameters),
+ autorest.WithJSON(body),
+ autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare((&http.Request{}).WithContext(ctx))
+}
+
+// UpdateSender sends the Update request. The method will close the
+// http.Response Body if it receives an error.
+func (client SnapshotPoliciesClient) UpdateSender(req *http.Request) (future SnapshotPoliciesUpdateFuture, err error) {
+ var resp *http.Response
+ future.FutureAPI = &azure.Future{}
+ resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client))
+ if err != nil {
+ return
+ }
+ var azf azure.Future
+ azf, err = azure.NewFutureFromResponse(resp)
+ future.FutureAPI = &azf
+ future.Result = future.result
+ return
+}
+
+// UpdateResponder handles the response to the Update request. The method always
+// closes the http.Response Body.
+func (client SnapshotPoliciesClient) UpdateResponder(resp *http.Response) (result SnapshotPolicy, err error) {
+ err = autorest.Respond(
+ resp,
+ azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted),
+ autorest.ByUnmarshallingJSON(&result),
+ autorest.ByClosing())
+ result.Response = autorest.Response{Response: resp}
+ return
+}
diff --git a/services/preview/netapp/mgmt/2021-04-01-preview/netapp/snapshots.go b/services/preview/netapp/mgmt/2021-04-01-preview/netapp/snapshots.go
new file mode 100644
index 000000000000..a3427567bd26
--- /dev/null
+++ b/services/preview/netapp/mgmt/2021-04-01-preview/netapp/snapshots.go
@@ -0,0 +1,546 @@
+package netapp
+
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License. See License.txt in the project root for license information.
+//
+// Code generated by Microsoft (R) AutoRest Code Generator.
+// Changes may cause incorrect behavior and will be lost if the code is regenerated.
+
+import (
+ "context"
+ "github.com/Azure/go-autorest/autorest"
+ "github.com/Azure/go-autorest/autorest/azure"
+ "github.com/Azure/go-autorest/autorest/validation"
+ "github.com/Azure/go-autorest/tracing"
+ "net/http"
+)
+
+// SnapshotsClient is the microsoft NetApp Files Azure Resource Provider specification
+type SnapshotsClient struct {
+ BaseClient
+}
+
+// NewSnapshotsClient creates an instance of the SnapshotsClient client.
+func NewSnapshotsClient(subscriptionID string) SnapshotsClient {
+ return NewSnapshotsClientWithBaseURI(DefaultBaseURI, subscriptionID)
+}
+
+// NewSnapshotsClientWithBaseURI creates an instance of the SnapshotsClient client using a custom endpoint. Use this
+// when interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure stack).
+func NewSnapshotsClientWithBaseURI(baseURI string, subscriptionID string) SnapshotsClient {
+ return SnapshotsClient{NewWithBaseURI(baseURI, subscriptionID)}
+}
+
+// Create create the specified snapshot within the given volume
+// Parameters:
+// body - snapshot object supplied in the body of the operation.
+// resourceGroupName - the name of the resource group.
+// accountName - the name of the NetApp account
+// poolName - the name of the capacity pool
+// volumeName - the name of the volume
+// snapshotName - the name of the mount target
+func (client SnapshotsClient) Create(ctx context.Context, body Snapshot, resourceGroupName string, accountName string, poolName string, volumeName string, snapshotName string) (result SnapshotsCreateFuture, err error) {
+ if tracing.IsEnabled() {
+ ctx = tracing.StartSpan(ctx, fqdn+"/SnapshotsClient.Create")
+ defer func() {
+ sc := -1
+ if result.FutureAPI != nil && result.FutureAPI.Response() != nil {
+ sc = result.FutureAPI.Response().StatusCode
+ }
+ tracing.EndSpan(ctx, sc, err)
+ }()
+ }
+ if err := validation.Validate([]validation.Validation{
+ {TargetValue: body,
+ Constraints: []validation.Constraint{{Target: "body.Location", Name: validation.Null, Rule: true, Chain: nil},
+ {Target: "body.SnapshotProperties", Name: validation.Null, Rule: false,
+ Chain: []validation.Constraint{{Target: "body.SnapshotProperties.SnapshotID", Name: validation.Null, Rule: false,
+ Chain: []validation.Constraint{{Target: "body.SnapshotProperties.SnapshotID", Name: validation.MaxLength, Rule: 36, Chain: nil},
+ {Target: "body.SnapshotProperties.SnapshotID", Name: validation.MinLength, Rule: 36, Chain: nil},
+ {Target: "body.SnapshotProperties.SnapshotID", Name: validation.Pattern, Rule: `^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$`, Chain: nil},
+ }},
+ }}}},
+ {TargetValue: resourceGroupName,
+ Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil},
+ {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil},
+ {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}},
+ {TargetValue: poolName,
+ Constraints: []validation.Constraint{{Target: "poolName", Name: validation.MaxLength, Rule: 64, Chain: nil},
+ {Target: "poolName", Name: validation.MinLength, Rule: 1, Chain: nil},
+ {Target: "poolName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9][a-zA-Z0-9\-_]{0,63}$`, Chain: nil}}},
+ {TargetValue: volumeName,
+ Constraints: []validation.Constraint{{Target: "volumeName", Name: validation.MaxLength, Rule: 64, Chain: nil},
+ {Target: "volumeName", Name: validation.MinLength, Rule: 1, Chain: nil},
+ {Target: "volumeName", Name: validation.Pattern, Rule: `^[a-zA-Z][a-zA-Z0-9\-_]{0,63}$`, Chain: nil}}}}); err != nil {
+ return result, validation.NewError("netapp.SnapshotsClient", "Create", err.Error())
+ }
+
+ req, err := client.CreatePreparer(ctx, body, resourceGroupName, accountName, poolName, volumeName, snapshotName)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "netapp.SnapshotsClient", "Create", nil, "Failure preparing request")
+ return
+ }
+
+ result, err = client.CreateSender(req)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "netapp.SnapshotsClient", "Create", result.Response(), "Failure sending request")
+ return
+ }
+
+ return
+}
+
+// CreatePreparer prepares the Create request.
+func (client SnapshotsClient) CreatePreparer(ctx context.Context, body Snapshot, resourceGroupName string, accountName string, poolName string, volumeName string, snapshotName string) (*http.Request, error) {
+ pathParameters := map[string]interface{}{
+ "accountName": autorest.Encode("path", accountName),
+ "poolName": autorest.Encode("path", poolName),
+ "resourceGroupName": autorest.Encode("path", resourceGroupName),
+ "snapshotName": autorest.Encode("path", snapshotName),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
+ "volumeName": autorest.Encode("path", volumeName),
+ }
+
+ const APIVersion = "2021-04-01-preview"
+ queryParameters := map[string]interface{}{
+ "api-version": APIVersion,
+ }
+
+ body.ID = nil
+ body.Name = nil
+ body.Type = nil
+ preparer := autorest.CreatePreparer(
+ autorest.AsContentType("application/json; charset=utf-8"),
+ autorest.AsPut(),
+ autorest.WithBaseURL(client.BaseURI),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/capacityPools/{poolName}/volumes/{volumeName}/snapshots/{snapshotName}", pathParameters),
+ autorest.WithJSON(body),
+ autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare((&http.Request{}).WithContext(ctx))
+}
+
+// CreateSender sends the Create request. The method will close the
+// http.Response Body if it receives an error.
+func (client SnapshotsClient) CreateSender(req *http.Request) (future SnapshotsCreateFuture, err error) {
+ var resp *http.Response
+ future.FutureAPI = &azure.Future{}
+ resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client))
+ if err != nil {
+ return
+ }
+ var azf azure.Future
+ azf, err = azure.NewFutureFromResponse(resp)
+ future.FutureAPI = &azf
+ future.Result = future.result
+ return
+}
+
+// CreateResponder handles the response to the Create request. The method always
+// closes the http.Response Body.
+func (client SnapshotsClient) CreateResponder(resp *http.Response) (result Snapshot, err error) {
+ err = autorest.Respond(
+ resp,
+ azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated, http.StatusAccepted),
+ autorest.ByUnmarshallingJSON(&result),
+ autorest.ByClosing())
+ result.Response = autorest.Response{Response: resp}
+ return
+}
+
+// Delete delete snapshot
+// Parameters:
+// resourceGroupName - the name of the resource group.
+// accountName - the name of the NetApp account
+// poolName - the name of the capacity pool
+// volumeName - the name of the volume
+// snapshotName - the name of the mount target
+func (client SnapshotsClient) Delete(ctx context.Context, resourceGroupName string, accountName string, poolName string, volumeName string, snapshotName string) (result SnapshotsDeleteFuture, err error) {
+ if tracing.IsEnabled() {
+ ctx = tracing.StartSpan(ctx, fqdn+"/SnapshotsClient.Delete")
+ defer func() {
+ sc := -1
+ if result.FutureAPI != nil && result.FutureAPI.Response() != nil {
+ sc = result.FutureAPI.Response().StatusCode
+ }
+ tracing.EndSpan(ctx, sc, err)
+ }()
+ }
+ if err := validation.Validate([]validation.Validation{
+ {TargetValue: resourceGroupName,
+ Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil},
+ {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil},
+ {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}},
+ {TargetValue: poolName,
+ Constraints: []validation.Constraint{{Target: "poolName", Name: validation.MaxLength, Rule: 64, Chain: nil},
+ {Target: "poolName", Name: validation.MinLength, Rule: 1, Chain: nil},
+ {Target: "poolName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9][a-zA-Z0-9\-_]{0,63}$`, Chain: nil}}},
+ {TargetValue: volumeName,
+ Constraints: []validation.Constraint{{Target: "volumeName", Name: validation.MaxLength, Rule: 64, Chain: nil},
+ {Target: "volumeName", Name: validation.MinLength, Rule: 1, Chain: nil},
+ {Target: "volumeName", Name: validation.Pattern, Rule: `^[a-zA-Z][a-zA-Z0-9\-_]{0,63}$`, Chain: nil}}}}); err != nil {
+ return result, validation.NewError("netapp.SnapshotsClient", "Delete", err.Error())
+ }
+
+ req, err := client.DeletePreparer(ctx, resourceGroupName, accountName, poolName, volumeName, snapshotName)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "netapp.SnapshotsClient", "Delete", nil, "Failure preparing request")
+ return
+ }
+
+ result, err = client.DeleteSender(req)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "netapp.SnapshotsClient", "Delete", result.Response(), "Failure sending request")
+ return
+ }
+
+ return
+}
+
+// DeletePreparer prepares the Delete request.
+func (client SnapshotsClient) DeletePreparer(ctx context.Context, resourceGroupName string, accountName string, poolName string, volumeName string, snapshotName string) (*http.Request, error) {
+ pathParameters := map[string]interface{}{
+ "accountName": autorest.Encode("path", accountName),
+ "poolName": autorest.Encode("path", poolName),
+ "resourceGroupName": autorest.Encode("path", resourceGroupName),
+ "snapshotName": autorest.Encode("path", snapshotName),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
+ "volumeName": autorest.Encode("path", volumeName),
+ }
+
+ const APIVersion = "2021-04-01-preview"
+ queryParameters := map[string]interface{}{
+ "api-version": APIVersion,
+ }
+
+ preparer := autorest.CreatePreparer(
+ autorest.AsDelete(),
+ autorest.WithBaseURL(client.BaseURI),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/capacityPools/{poolName}/volumes/{volumeName}/snapshots/{snapshotName}", pathParameters),
+ autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare((&http.Request{}).WithContext(ctx))
+}
+
+// DeleteSender sends the Delete request. The method will close the
+// http.Response Body if it receives an error.
+func (client SnapshotsClient) DeleteSender(req *http.Request) (future SnapshotsDeleteFuture, err error) {
+ var resp *http.Response
+ future.FutureAPI = &azure.Future{}
+ resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client))
+ if err != nil {
+ return
+ }
+ var azf azure.Future
+ azf, err = azure.NewFutureFromResponse(resp)
+ future.FutureAPI = &azf
+ future.Result = future.result
+ return
+}
+
+// DeleteResponder handles the response to the Delete request. The method always
+// closes the http.Response Body.
+func (client SnapshotsClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) {
+ err = autorest.Respond(
+ resp,
+ azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent),
+ autorest.ByClosing())
+ result.Response = resp
+ return
+}
+
+// Get get details of the specified snapshot
+// Parameters:
+// resourceGroupName - the name of the resource group.
+// accountName - the name of the NetApp account
+// poolName - the name of the capacity pool
+// volumeName - the name of the volume
+// snapshotName - the name of the mount target
+func (client SnapshotsClient) Get(ctx context.Context, resourceGroupName string, accountName string, poolName string, volumeName string, snapshotName string) (result Snapshot, err error) {
+ if tracing.IsEnabled() {
+ ctx = tracing.StartSpan(ctx, fqdn+"/SnapshotsClient.Get")
+ defer func() {
+ sc := -1
+ if result.Response.Response != nil {
+ sc = result.Response.Response.StatusCode
+ }
+ tracing.EndSpan(ctx, sc, err)
+ }()
+ }
+ if err := validation.Validate([]validation.Validation{
+ {TargetValue: resourceGroupName,
+ Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil},
+ {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil},
+ {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}},
+ {TargetValue: poolName,
+ Constraints: []validation.Constraint{{Target: "poolName", Name: validation.MaxLength, Rule: 64, Chain: nil},
+ {Target: "poolName", Name: validation.MinLength, Rule: 1, Chain: nil},
+ {Target: "poolName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9][a-zA-Z0-9\-_]{0,63}$`, Chain: nil}}},
+ {TargetValue: volumeName,
+ Constraints: []validation.Constraint{{Target: "volumeName", Name: validation.MaxLength, Rule: 64, Chain: nil},
+ {Target: "volumeName", Name: validation.MinLength, Rule: 1, Chain: nil},
+ {Target: "volumeName", Name: validation.Pattern, Rule: `^[a-zA-Z][a-zA-Z0-9\-_]{0,63}$`, Chain: nil}}}}); err != nil {
+ return result, validation.NewError("netapp.SnapshotsClient", "Get", err.Error())
+ }
+
+ req, err := client.GetPreparer(ctx, resourceGroupName, accountName, poolName, volumeName, snapshotName)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "netapp.SnapshotsClient", "Get", nil, "Failure preparing request")
+ return
+ }
+
+ resp, err := client.GetSender(req)
+ if err != nil {
+ result.Response = autorest.Response{Response: resp}
+ err = autorest.NewErrorWithError(err, "netapp.SnapshotsClient", "Get", resp, "Failure sending request")
+ return
+ }
+
+ result, err = client.GetResponder(resp)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "netapp.SnapshotsClient", "Get", resp, "Failure responding to request")
+ return
+ }
+
+ return
+}
+
+// GetPreparer prepares the Get request.
+func (client SnapshotsClient) GetPreparer(ctx context.Context, resourceGroupName string, accountName string, poolName string, volumeName string, snapshotName string) (*http.Request, error) {
+ pathParameters := map[string]interface{}{
+ "accountName": autorest.Encode("path", accountName),
+ "poolName": autorest.Encode("path", poolName),
+ "resourceGroupName": autorest.Encode("path", resourceGroupName),
+ "snapshotName": autorest.Encode("path", snapshotName),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
+ "volumeName": autorest.Encode("path", volumeName),
+ }
+
+ const APIVersion = "2021-04-01-preview"
+ queryParameters := map[string]interface{}{
+ "api-version": APIVersion,
+ }
+
+ preparer := autorest.CreatePreparer(
+ autorest.AsGet(),
+ autorest.WithBaseURL(client.BaseURI),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/capacityPools/{poolName}/volumes/{volumeName}/snapshots/{snapshotName}", pathParameters),
+ autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare((&http.Request{}).WithContext(ctx))
+}
+
+// GetSender sends the Get request. The method will close the
+// http.Response Body if it receives an error.
+func (client SnapshotsClient) GetSender(req *http.Request) (*http.Response, error) {
+ return client.Send(req, azure.DoRetryWithRegistration(client.Client))
+}
+
+// GetResponder handles the response to the Get request. The method always
+// closes the http.Response Body.
+func (client SnapshotsClient) GetResponder(resp *http.Response) (result Snapshot, err error) {
+ err = autorest.Respond(
+ resp,
+ azure.WithErrorUnlessStatusCode(http.StatusOK),
+ autorest.ByUnmarshallingJSON(&result),
+ autorest.ByClosing())
+ result.Response = autorest.Response{Response: resp}
+ return
+}
+
+// List list all snapshots associated with the volume
+// Parameters:
+// resourceGroupName - the name of the resource group.
+// accountName - the name of the NetApp account
+// poolName - the name of the capacity pool
+// volumeName - the name of the volume
+func (client SnapshotsClient) List(ctx context.Context, resourceGroupName string, accountName string, poolName string, volumeName string) (result SnapshotsList, err error) {
+ if tracing.IsEnabled() {
+ ctx = tracing.StartSpan(ctx, fqdn+"/SnapshotsClient.List")
+ defer func() {
+ sc := -1
+ if result.Response.Response != nil {
+ sc = result.Response.Response.StatusCode
+ }
+ tracing.EndSpan(ctx, sc, err)
+ }()
+ }
+ if err := validation.Validate([]validation.Validation{
+ {TargetValue: resourceGroupName,
+ Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil},
+ {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil},
+ {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}},
+ {TargetValue: poolName,
+ Constraints: []validation.Constraint{{Target: "poolName", Name: validation.MaxLength, Rule: 64, Chain: nil},
+ {Target: "poolName", Name: validation.MinLength, Rule: 1, Chain: nil},
+ {Target: "poolName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9][a-zA-Z0-9\-_]{0,63}$`, Chain: nil}}},
+ {TargetValue: volumeName,
+ Constraints: []validation.Constraint{{Target: "volumeName", Name: validation.MaxLength, Rule: 64, Chain: nil},
+ {Target: "volumeName", Name: validation.MinLength, Rule: 1, Chain: nil},
+ {Target: "volumeName", Name: validation.Pattern, Rule: `^[a-zA-Z][a-zA-Z0-9\-_]{0,63}$`, Chain: nil}}}}); err != nil {
+ return result, validation.NewError("netapp.SnapshotsClient", "List", err.Error())
+ }
+
+ req, err := client.ListPreparer(ctx, resourceGroupName, accountName, poolName, volumeName)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "netapp.SnapshotsClient", "List", nil, "Failure preparing request")
+ return
+ }
+
+ resp, err := client.ListSender(req)
+ if err != nil {
+ result.Response = autorest.Response{Response: resp}
+ err = autorest.NewErrorWithError(err, "netapp.SnapshotsClient", "List", resp, "Failure sending request")
+ return
+ }
+
+ result, err = client.ListResponder(resp)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "netapp.SnapshotsClient", "List", resp, "Failure responding to request")
+ return
+ }
+
+ return
+}
+
+// ListPreparer prepares the List request.
+func (client SnapshotsClient) ListPreparer(ctx context.Context, resourceGroupName string, accountName string, poolName string, volumeName string) (*http.Request, error) {
+ pathParameters := map[string]interface{}{
+ "accountName": autorest.Encode("path", accountName),
+ "poolName": autorest.Encode("path", poolName),
+ "resourceGroupName": autorest.Encode("path", resourceGroupName),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
+ "volumeName": autorest.Encode("path", volumeName),
+ }
+
+ const APIVersion = "2021-04-01-preview"
+ queryParameters := map[string]interface{}{
+ "api-version": APIVersion,
+ }
+
+ preparer := autorest.CreatePreparer(
+ autorest.AsGet(),
+ autorest.WithBaseURL(client.BaseURI),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/capacityPools/{poolName}/volumes/{volumeName}/snapshots", pathParameters),
+ autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare((&http.Request{}).WithContext(ctx))
+}
+
+// ListSender sends the List request. The method will close the
+// http.Response Body if it receives an error.
+func (client SnapshotsClient) ListSender(req *http.Request) (*http.Response, error) {
+ return client.Send(req, azure.DoRetryWithRegistration(client.Client))
+}
+
+// ListResponder handles the response to the List request. The method always
+// closes the http.Response Body.
+func (client SnapshotsClient) ListResponder(resp *http.Response) (result SnapshotsList, err error) {
+ err = autorest.Respond(
+ resp,
+ azure.WithErrorUnlessStatusCode(http.StatusOK),
+ autorest.ByUnmarshallingJSON(&result),
+ autorest.ByClosing())
+ result.Response = autorest.Response{Response: resp}
+ return
+}
+
+// Update patch a snapshot
+// Parameters:
+// body - snapshot object supplied in the body of the operation.
+// resourceGroupName - the name of the resource group.
+// accountName - the name of the NetApp account
+// poolName - the name of the capacity pool
+// volumeName - the name of the volume
+// snapshotName - the name of the mount target
+func (client SnapshotsClient) Update(ctx context.Context, body interface{}, resourceGroupName string, accountName string, poolName string, volumeName string, snapshotName string) (result SnapshotsUpdateFuture, err error) {
+ if tracing.IsEnabled() {
+ ctx = tracing.StartSpan(ctx, fqdn+"/SnapshotsClient.Update")
+ defer func() {
+ sc := -1
+ if result.FutureAPI != nil && result.FutureAPI.Response() != nil {
+ sc = result.FutureAPI.Response().StatusCode
+ }
+ tracing.EndSpan(ctx, sc, err)
+ }()
+ }
+ if err := validation.Validate([]validation.Validation{
+ {TargetValue: resourceGroupName,
+ Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil},
+ {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil},
+ {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}},
+ {TargetValue: poolName,
+ Constraints: []validation.Constraint{{Target: "poolName", Name: validation.MaxLength, Rule: 64, Chain: nil},
+ {Target: "poolName", Name: validation.MinLength, Rule: 1, Chain: nil},
+ {Target: "poolName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9][a-zA-Z0-9\-_]{0,63}$`, Chain: nil}}},
+ {TargetValue: volumeName,
+ Constraints: []validation.Constraint{{Target: "volumeName", Name: validation.MaxLength, Rule: 64, Chain: nil},
+ {Target: "volumeName", Name: validation.MinLength, Rule: 1, Chain: nil},
+ {Target: "volumeName", Name: validation.Pattern, Rule: `^[a-zA-Z][a-zA-Z0-9\-_]{0,63}$`, Chain: nil}}}}); err != nil {
+ return result, validation.NewError("netapp.SnapshotsClient", "Update", err.Error())
+ }
+
+ req, err := client.UpdatePreparer(ctx, body, resourceGroupName, accountName, poolName, volumeName, snapshotName)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "netapp.SnapshotsClient", "Update", nil, "Failure preparing request")
+ return
+ }
+
+ result, err = client.UpdateSender(req)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "netapp.SnapshotsClient", "Update", result.Response(), "Failure sending request")
+ return
+ }
+
+ return
+}
+
+// UpdatePreparer prepares the Update request.
+func (client SnapshotsClient) UpdatePreparer(ctx context.Context, body interface{}, resourceGroupName string, accountName string, poolName string, volumeName string, snapshotName string) (*http.Request, error) {
+ pathParameters := map[string]interface{}{
+ "accountName": autorest.Encode("path", accountName),
+ "poolName": autorest.Encode("path", poolName),
+ "resourceGroupName": autorest.Encode("path", resourceGroupName),
+ "snapshotName": autorest.Encode("path", snapshotName),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
+ "volumeName": autorest.Encode("path", volumeName),
+ }
+
+ const APIVersion = "2021-04-01-preview"
+ queryParameters := map[string]interface{}{
+ "api-version": APIVersion,
+ }
+
+ preparer := autorest.CreatePreparer(
+ autorest.AsContentType("application/json; charset=utf-8"),
+ autorest.AsPatch(),
+ autorest.WithBaseURL(client.BaseURI),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/capacityPools/{poolName}/volumes/{volumeName}/snapshots/{snapshotName}", pathParameters),
+ autorest.WithJSON(body),
+ autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare((&http.Request{}).WithContext(ctx))
+}
+
+// UpdateSender sends the Update request. The method will close the
+// http.Response Body if it receives an error.
+func (client SnapshotsClient) UpdateSender(req *http.Request) (future SnapshotsUpdateFuture, err error) {
+ var resp *http.Response
+ future.FutureAPI = &azure.Future{}
+ resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client))
+ if err != nil {
+ return
+ }
+ var azf azure.Future
+ azf, err = azure.NewFutureFromResponse(resp)
+ future.FutureAPI = &azf
+ future.Result = future.result
+ return
+}
+
+// UpdateResponder handles the response to the Update request. The method always
+// closes the http.Response Body.
+func (client SnapshotsClient) UpdateResponder(resp *http.Response) (result Snapshot, err error) {
+ err = autorest.Respond(
+ resp,
+ azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted),
+ autorest.ByUnmarshallingJSON(&result),
+ autorest.ByClosing())
+ result.Response = autorest.Response{Response: resp}
+ return
+}
diff --git a/services/preview/netapp/mgmt/2021-04-01-preview/netapp/vaults.go b/services/preview/netapp/mgmt/2021-04-01-preview/netapp/vaults.go
new file mode 100644
index 000000000000..ff7a618fc9be
--- /dev/null
+++ b/services/preview/netapp/mgmt/2021-04-01-preview/netapp/vaults.go
@@ -0,0 +1,116 @@
+package netapp
+
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License. See License.txt in the project root for license information.
+//
+// Code generated by Microsoft (R) AutoRest Code Generator.
+// Changes may cause incorrect behavior and will be lost if the code is regenerated.
+
+import (
+ "context"
+ "github.com/Azure/go-autorest/autorest"
+ "github.com/Azure/go-autorest/autorest/azure"
+ "github.com/Azure/go-autorest/autorest/validation"
+ "github.com/Azure/go-autorest/tracing"
+ "net/http"
+)
+
+// VaultsClient is the microsoft NetApp Files Azure Resource Provider specification
+type VaultsClient struct {
+ BaseClient
+}
+
+// NewVaultsClient creates an instance of the VaultsClient client.
+func NewVaultsClient(subscriptionID string) VaultsClient {
+ return NewVaultsClientWithBaseURI(DefaultBaseURI, subscriptionID)
+}
+
+// NewVaultsClientWithBaseURI creates an instance of the VaultsClient client using a custom endpoint. Use this when
+// interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure stack).
+func NewVaultsClientWithBaseURI(baseURI string, subscriptionID string) VaultsClient {
+ return VaultsClient{NewWithBaseURI(baseURI, subscriptionID)}
+}
+
+// List list vaults for a Netapp Account
+// Parameters:
+// resourceGroupName - the name of the resource group.
+// accountName - the name of the NetApp account
+func (client VaultsClient) List(ctx context.Context, resourceGroupName string, accountName string) (result VaultList, err error) {
+ if tracing.IsEnabled() {
+ ctx = tracing.StartSpan(ctx, fqdn+"/VaultsClient.List")
+ defer func() {
+ sc := -1
+ if result.Response.Response != nil {
+ sc = result.Response.Response.StatusCode
+ }
+ tracing.EndSpan(ctx, sc, err)
+ }()
+ }
+ if err := validation.Validate([]validation.Validation{
+ {TargetValue: resourceGroupName,
+ Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil},
+ {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil},
+ {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}}); err != nil {
+ return result, validation.NewError("netapp.VaultsClient", "List", err.Error())
+ }
+
+ req, err := client.ListPreparer(ctx, resourceGroupName, accountName)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "netapp.VaultsClient", "List", nil, "Failure preparing request")
+ return
+ }
+
+ resp, err := client.ListSender(req)
+ if err != nil {
+ result.Response = autorest.Response{Response: resp}
+ err = autorest.NewErrorWithError(err, "netapp.VaultsClient", "List", resp, "Failure sending request")
+ return
+ }
+
+ result, err = client.ListResponder(resp)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "netapp.VaultsClient", "List", resp, "Failure responding to request")
+ return
+ }
+
+ return
+}
+
+// ListPreparer prepares the List request.
+func (client VaultsClient) ListPreparer(ctx context.Context, resourceGroupName string, accountName string) (*http.Request, error) {
+ pathParameters := map[string]interface{}{
+ "accountName": autorest.Encode("path", accountName),
+ "resourceGroupName": autorest.Encode("path", resourceGroupName),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
+ }
+
+ const APIVersion = "2021-04-01-preview"
+ queryParameters := map[string]interface{}{
+ "api-version": APIVersion,
+ }
+
+ preparer := autorest.CreatePreparer(
+ autorest.AsGet(),
+ autorest.WithBaseURL(client.BaseURI),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/vaults", pathParameters),
+ autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare((&http.Request{}).WithContext(ctx))
+}
+
+// ListSender sends the List request. The method will close the
+// http.Response Body if it receives an error.
+func (client VaultsClient) ListSender(req *http.Request) (*http.Response, error) {
+ return client.Send(req, azure.DoRetryWithRegistration(client.Client))
+}
+
+// ListResponder handles the response to the List request. The method always
+// closes the http.Response Body.
+func (client VaultsClient) ListResponder(resp *http.Response) (result VaultList, err error) {
+ err = autorest.Respond(
+ resp,
+ azure.WithErrorUnlessStatusCode(http.StatusOK),
+ autorest.ByUnmarshallingJSON(&result),
+ autorest.ByClosing())
+ result.Response = autorest.Response{Response: resp}
+ return
+}
diff --git a/services/preview/netapp/mgmt/2021-04-01-preview/netapp/version.go b/services/preview/netapp/mgmt/2021-04-01-preview/netapp/version.go
new file mode 100644
index 000000000000..469631b19bc8
--- /dev/null
+++ b/services/preview/netapp/mgmt/2021-04-01-preview/netapp/version.go
@@ -0,0 +1,19 @@
+package netapp
+
+import "github.com/Azure/azure-sdk-for-go/version"
+
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License. See License.txt in the project root for license information.
+//
+// Code generated by Microsoft (R) AutoRest Code Generator.
+// Changes may cause incorrect behavior and will be lost if the code is regenerated.
+
+// UserAgent returns the UserAgent string to use when sending http.Requests.
+func UserAgent() string {
+ return "Azure-SDK-For-Go/" + Version() + " netapp/2021-04-01-preview"
+}
+
+// Version returns the semantic version (see http://semver.org) of the client.
+func Version() string {
+ return version.Number
+}
diff --git a/services/preview/netapp/mgmt/2021-04-01-preview/netapp/volumes.go b/services/preview/netapp/mgmt/2021-04-01-preview/netapp/volumes.go
new file mode 100644
index 000000000000..3dbb06ebe9a3
--- /dev/null
+++ b/services/preview/netapp/mgmt/2021-04-01-preview/netapp/volumes.go
@@ -0,0 +1,1411 @@
+package netapp
+
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License. See License.txt in the project root for license information.
+//
+// Code generated by Microsoft (R) AutoRest Code Generator.
+// Changes may cause incorrect behavior and will be lost if the code is regenerated.
+
+import (
+ "context"
+ "github.com/Azure/go-autorest/autorest"
+ "github.com/Azure/go-autorest/autorest/azure"
+ "github.com/Azure/go-autorest/autorest/validation"
+ "github.com/Azure/go-autorest/tracing"
+ "net/http"
+)
+
+// VolumesClient is the microsoft NetApp Files Azure Resource Provider specification
+type VolumesClient struct {
+ BaseClient
+}
+
+// NewVolumesClient creates an instance of the VolumesClient client.
+func NewVolumesClient(subscriptionID string) VolumesClient {
+ return NewVolumesClientWithBaseURI(DefaultBaseURI, subscriptionID)
+}
+
+// NewVolumesClientWithBaseURI creates an instance of the VolumesClient client using a custom endpoint. Use this when
+// interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure stack).
+func NewVolumesClientWithBaseURI(baseURI string, subscriptionID string) VolumesClient {
+ return VolumesClient{NewWithBaseURI(baseURI, subscriptionID)}
+}
+
+// AuthorizeReplication authorize the replication connection on the source volume
+// Parameters:
+// resourceGroupName - the name of the resource group.
+// accountName - the name of the NetApp account
+// poolName - the name of the capacity pool
+// volumeName - the name of the volume
+// body - authorize request object supplied in the body of the operation.
+func (client VolumesClient) AuthorizeReplication(ctx context.Context, resourceGroupName string, accountName string, poolName string, volumeName string, body AuthorizeRequest) (result VolumesAuthorizeReplicationFuture, err error) {
+ if tracing.IsEnabled() {
+ ctx = tracing.StartSpan(ctx, fqdn+"/VolumesClient.AuthorizeReplication")
+ defer func() {
+ sc := -1
+ if result.FutureAPI != nil && result.FutureAPI.Response() != nil {
+ sc = result.FutureAPI.Response().StatusCode
+ }
+ tracing.EndSpan(ctx, sc, err)
+ }()
+ }
+ if err := validation.Validate([]validation.Validation{
+ {TargetValue: resourceGroupName,
+ Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil},
+ {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil},
+ {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}},
+ {TargetValue: poolName,
+ Constraints: []validation.Constraint{{Target: "poolName", Name: validation.MaxLength, Rule: 64, Chain: nil},
+ {Target: "poolName", Name: validation.MinLength, Rule: 1, Chain: nil},
+ {Target: "poolName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9][a-zA-Z0-9\-_]{0,63}$`, Chain: nil}}},
+ {TargetValue: volumeName,
+ Constraints: []validation.Constraint{{Target: "volumeName", Name: validation.MaxLength, Rule: 64, Chain: nil},
+ {Target: "volumeName", Name: validation.MinLength, Rule: 1, Chain: nil},
+ {Target: "volumeName", Name: validation.Pattern, Rule: `^[a-zA-Z][a-zA-Z0-9\-_]{0,63}$`, Chain: nil}}}}); err != nil {
+ return result, validation.NewError("netapp.VolumesClient", "AuthorizeReplication", err.Error())
+ }
+
+ req, err := client.AuthorizeReplicationPreparer(ctx, resourceGroupName, accountName, poolName, volumeName, body)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "netapp.VolumesClient", "AuthorizeReplication", nil, "Failure preparing request")
+ return
+ }
+
+ result, err = client.AuthorizeReplicationSender(req)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "netapp.VolumesClient", "AuthorizeReplication", result.Response(), "Failure sending request")
+ return
+ }
+
+ return
+}
+
+// AuthorizeReplicationPreparer prepares the AuthorizeReplication request.
+func (client VolumesClient) AuthorizeReplicationPreparer(ctx context.Context, resourceGroupName string, accountName string, poolName string, volumeName string, body AuthorizeRequest) (*http.Request, error) {
+ pathParameters := map[string]interface{}{
+ "accountName": autorest.Encode("path", accountName),
+ "poolName": autorest.Encode("path", poolName),
+ "resourceGroupName": autorest.Encode("path", resourceGroupName),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
+ "volumeName": autorest.Encode("path", volumeName),
+ }
+
+ const APIVersion = "2021-04-01-preview"
+ queryParameters := map[string]interface{}{
+ "api-version": APIVersion,
+ }
+
+ preparer := autorest.CreatePreparer(
+ autorest.AsContentType("application/json; charset=utf-8"),
+ autorest.AsPost(),
+ autorest.WithBaseURL(client.BaseURI),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/capacityPools/{poolName}/volumes/{volumeName}/authorizeReplication", pathParameters),
+ autorest.WithJSON(body),
+ autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare((&http.Request{}).WithContext(ctx))
+}
+
+// AuthorizeReplicationSender sends the AuthorizeReplication request. The method will close the
+// http.Response Body if it receives an error.
+func (client VolumesClient) AuthorizeReplicationSender(req *http.Request) (future VolumesAuthorizeReplicationFuture, err error) {
+ var resp *http.Response
+ future.FutureAPI = &azure.Future{}
+ resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client))
+ if err != nil {
+ return
+ }
+ var azf azure.Future
+ azf, err = azure.NewFutureFromResponse(resp)
+ future.FutureAPI = &azf
+ future.Result = future.result
+ return
+}
+
+// AuthorizeReplicationResponder handles the response to the AuthorizeReplication request. The method always
+// closes the http.Response Body.
+func (client VolumesClient) AuthorizeReplicationResponder(resp *http.Response) (result autorest.Response, err error) {
+ err = autorest.Respond(
+ resp,
+ azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted),
+ autorest.ByClosing())
+ result.Response = resp
+ return
+}
+
+// BreakReplication break the replication connection on the destination volume
+// Parameters:
+// resourceGroupName - the name of the resource group.
+// accountName - the name of the NetApp account
+// poolName - the name of the capacity pool
+// volumeName - the name of the volume
+// body - optional body to force break the replication.
+func (client VolumesClient) BreakReplication(ctx context.Context, resourceGroupName string, accountName string, poolName string, volumeName string, body *BreakReplicationRequest) (result VolumesBreakReplicationFuture, err error) {
+ if tracing.IsEnabled() {
+ ctx = tracing.StartSpan(ctx, fqdn+"/VolumesClient.BreakReplication")
+ defer func() {
+ sc := -1
+ if result.FutureAPI != nil && result.FutureAPI.Response() != nil {
+ sc = result.FutureAPI.Response().StatusCode
+ }
+ tracing.EndSpan(ctx, sc, err)
+ }()
+ }
+ if err := validation.Validate([]validation.Validation{
+ {TargetValue: resourceGroupName,
+ Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil},
+ {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil},
+ {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}},
+ {TargetValue: poolName,
+ Constraints: []validation.Constraint{{Target: "poolName", Name: validation.MaxLength, Rule: 64, Chain: nil},
+ {Target: "poolName", Name: validation.MinLength, Rule: 1, Chain: nil},
+ {Target: "poolName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9][a-zA-Z0-9\-_]{0,63}$`, Chain: nil}}},
+ {TargetValue: volumeName,
+ Constraints: []validation.Constraint{{Target: "volumeName", Name: validation.MaxLength, Rule: 64, Chain: nil},
+ {Target: "volumeName", Name: validation.MinLength, Rule: 1, Chain: nil},
+ {Target: "volumeName", Name: validation.Pattern, Rule: `^[a-zA-Z][a-zA-Z0-9\-_]{0,63}$`, Chain: nil}}}}); err != nil {
+ return result, validation.NewError("netapp.VolumesClient", "BreakReplication", err.Error())
+ }
+
+ req, err := client.BreakReplicationPreparer(ctx, resourceGroupName, accountName, poolName, volumeName, body)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "netapp.VolumesClient", "BreakReplication", nil, "Failure preparing request")
+ return
+ }
+
+ result, err = client.BreakReplicationSender(req)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "netapp.VolumesClient", "BreakReplication", result.Response(), "Failure sending request")
+ return
+ }
+
+ return
+}
+
+// BreakReplicationPreparer prepares the BreakReplication request.
+func (client VolumesClient) BreakReplicationPreparer(ctx context.Context, resourceGroupName string, accountName string, poolName string, volumeName string, body *BreakReplicationRequest) (*http.Request, error) {
+ pathParameters := map[string]interface{}{
+ "accountName": autorest.Encode("path", accountName),
+ "poolName": autorest.Encode("path", poolName),
+ "resourceGroupName": autorest.Encode("path", resourceGroupName),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
+ "volumeName": autorest.Encode("path", volumeName),
+ }
+
+ const APIVersion = "2021-04-01-preview"
+ queryParameters := map[string]interface{}{
+ "api-version": APIVersion,
+ }
+
+ preparer := autorest.CreatePreparer(
+ autorest.AsContentType("application/json; charset=utf-8"),
+ autorest.AsPost(),
+ autorest.WithBaseURL(client.BaseURI),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/capacityPools/{poolName}/volumes/{volumeName}/breakReplication", pathParameters),
+ autorest.WithQueryParameters(queryParameters))
+ if body != nil {
+ preparer = autorest.DecoratePreparer(preparer,
+ autorest.WithJSON(body))
+ }
+ return preparer.Prepare((&http.Request{}).WithContext(ctx))
+}
+
+// BreakReplicationSender sends the BreakReplication request. The method will close the
+// http.Response Body if it receives an error.
+func (client VolumesClient) BreakReplicationSender(req *http.Request) (future VolumesBreakReplicationFuture, err error) {
+ var resp *http.Response
+ future.FutureAPI = &azure.Future{}
+ resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client))
+ if err != nil {
+ return
+ }
+ var azf azure.Future
+ azf, err = azure.NewFutureFromResponse(resp)
+ future.FutureAPI = &azf
+ future.Result = future.result
+ return
+}
+
+// BreakReplicationResponder handles the response to the BreakReplication request. The method always
+// closes the http.Response Body.
+func (client VolumesClient) BreakReplicationResponder(resp *http.Response) (result autorest.Response, err error) {
+ err = autorest.Respond(
+ resp,
+ azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted),
+ autorest.ByClosing())
+ result.Response = resp
+ return
+}
+
+// CreateOrUpdate create or update the specified volume within the capacity pool
+// Parameters:
+// body - volume object supplied in the body of the operation.
+// resourceGroupName - the name of the resource group.
+// accountName - the name of the NetApp account
+// poolName - the name of the capacity pool
+// volumeName - the name of the volume
+func (client VolumesClient) CreateOrUpdate(ctx context.Context, body Volume, resourceGroupName string, accountName string, poolName string, volumeName string) (result VolumesCreateOrUpdateFuture, err error) {
+ if tracing.IsEnabled() {
+ ctx = tracing.StartSpan(ctx, fqdn+"/VolumesClient.CreateOrUpdate")
+ defer func() {
+ sc := -1
+ if result.FutureAPI != nil && result.FutureAPI.Response() != nil {
+ sc = result.FutureAPI.Response().StatusCode
+ }
+ tracing.EndSpan(ctx, sc, err)
+ }()
+ }
+ if err := validation.Validate([]validation.Validation{
+ {TargetValue: body,
+ Constraints: []validation.Constraint{{Target: "body.Location", Name: validation.Null, Rule: true, Chain: nil},
+ {Target: "body.VolumeProperties", Name: validation.Null, Rule: true,
+ Chain: []validation.Constraint{{Target: "body.VolumeProperties.FileSystemID", Name: validation.Null, Rule: false,
+ Chain: []validation.Constraint{{Target: "body.VolumeProperties.FileSystemID", Name: validation.MaxLength, Rule: 36, Chain: nil},
+ {Target: "body.VolumeProperties.FileSystemID", Name: validation.MinLength, Rule: 36, Chain: nil},
+ {Target: "body.VolumeProperties.FileSystemID", Name: validation.Pattern, Rule: `^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$`, Chain: nil},
+ }},
+ {Target: "body.VolumeProperties.CreationToken", Name: validation.Null, Rule: true,
+ Chain: []validation.Constraint{{Target: "body.VolumeProperties.CreationToken", Name: validation.MaxLength, Rule: 80, Chain: nil},
+ {Target: "body.VolumeProperties.CreationToken", Name: validation.MinLength, Rule: 1, Chain: nil},
+ {Target: "body.VolumeProperties.CreationToken", Name: validation.Pattern, Rule: `^[a-zA-Z][a-zA-Z0-9\-]{0,79}$`, Chain: nil},
+ }},
+ {Target: "body.VolumeProperties.UsageThreshold", Name: validation.Null, Rule: true,
+ Chain: []validation.Constraint{{Target: "body.VolumeProperties.UsageThreshold", Name: validation.InclusiveMaximum, Rule: int64(109951162777600), Chain: nil},
+ {Target: "body.VolumeProperties.UsageThreshold", Name: validation.InclusiveMinimum, Rule: int64(107374182400), Chain: nil},
+ }},
+ {Target: "body.VolumeProperties.SnapshotID", Name: validation.Null, Rule: false,
+ Chain: []validation.Constraint{{Target: "body.VolumeProperties.SnapshotID", Name: validation.MaxLength, Rule: 36, Chain: nil},
+ {Target: "body.VolumeProperties.SnapshotID", Name: validation.MinLength, Rule: 36, Chain: nil},
+ {Target: "body.VolumeProperties.SnapshotID", Name: validation.Pattern, Rule: `^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}|(\\?([^\/]*[\/])*)([^\/]+)$`, Chain: nil},
+ }},
+ {Target: "body.VolumeProperties.BackupID", Name: validation.Null, Rule: false,
+ Chain: []validation.Constraint{{Target: "body.VolumeProperties.BackupID", Name: validation.MaxLength, Rule: 36, Chain: nil},
+ {Target: "body.VolumeProperties.BackupID", Name: validation.MinLength, Rule: 36, Chain: nil},
+ {Target: "body.VolumeProperties.BackupID", Name: validation.Pattern, Rule: `^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}|(\\?([^\/]*[\/])*)([^\/]+)$`, Chain: nil},
+ }},
+ {Target: "body.VolumeProperties.SubnetID", Name: validation.Null, Rule: true, Chain: nil},
+ {Target: "body.VolumeProperties.NetworkSiblingSetID", Name: validation.Null, Rule: false,
+ Chain: []validation.Constraint{{Target: "body.VolumeProperties.NetworkSiblingSetID", Name: validation.MaxLength, Rule: 36, Chain: nil},
+ {Target: "body.VolumeProperties.NetworkSiblingSetID", Name: validation.MinLength, Rule: 36, Chain: nil},
+ {Target: "body.VolumeProperties.NetworkSiblingSetID", Name: validation.Pattern, Rule: `^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$`, Chain: nil},
+ }},
+ {Target: "body.VolumeProperties.DataProtection", Name: validation.Null, Rule: false,
+ Chain: []validation.Constraint{{Target: "body.VolumeProperties.DataProtection.Replication", Name: validation.Null, Rule: false,
+ Chain: []validation.Constraint{{Target: "body.VolumeProperties.DataProtection.Replication.RemoteVolumeResourceID", Name: validation.Null, Rule: true, Chain: nil}}},
+ }},
+ {Target: "body.VolumeProperties.ThroughputMibps", Name: validation.Null, Rule: false,
+ Chain: []validation.Constraint{{Target: "body.VolumeProperties.ThroughputMibps", Name: validation.InclusiveMaximum, Rule: float64(4500), Chain: nil},
+ {Target: "body.VolumeProperties.ThroughputMibps", Name: validation.InclusiveMinimum, Rule: float64(0), Chain: nil},
+ }},
+ }}}},
+ {TargetValue: resourceGroupName,
+ Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil},
+ {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil},
+ {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}},
+ {TargetValue: poolName,
+ Constraints: []validation.Constraint{{Target: "poolName", Name: validation.MaxLength, Rule: 64, Chain: nil},
+ {Target: "poolName", Name: validation.MinLength, Rule: 1, Chain: nil},
+ {Target: "poolName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9][a-zA-Z0-9\-_]{0,63}$`, Chain: nil}}},
+ {TargetValue: volumeName,
+ Constraints: []validation.Constraint{{Target: "volumeName", Name: validation.MaxLength, Rule: 64, Chain: nil},
+ {Target: "volumeName", Name: validation.MinLength, Rule: 1, Chain: nil},
+ {Target: "volumeName", Name: validation.Pattern, Rule: `^[a-zA-Z][a-zA-Z0-9\-_]{0,63}$`, Chain: nil}}}}); err != nil {
+ return result, validation.NewError("netapp.VolumesClient", "CreateOrUpdate", err.Error())
+ }
+
+ req, err := client.CreateOrUpdatePreparer(ctx, body, resourceGroupName, accountName, poolName, volumeName)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "netapp.VolumesClient", "CreateOrUpdate", nil, "Failure preparing request")
+ return
+ }
+
+ result, err = client.CreateOrUpdateSender(req)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "netapp.VolumesClient", "CreateOrUpdate", result.Response(), "Failure sending request")
+ return
+ }
+
+ return
+}
+
+// CreateOrUpdatePreparer prepares the CreateOrUpdate request.
+func (client VolumesClient) CreateOrUpdatePreparer(ctx context.Context, body Volume, resourceGroupName string, accountName string, poolName string, volumeName string) (*http.Request, error) {
+ pathParameters := map[string]interface{}{
+ "accountName": autorest.Encode("path", accountName),
+ "poolName": autorest.Encode("path", poolName),
+ "resourceGroupName": autorest.Encode("path", resourceGroupName),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
+ "volumeName": autorest.Encode("path", volumeName),
+ }
+
+ const APIVersion = "2021-04-01-preview"
+ queryParameters := map[string]interface{}{
+ "api-version": APIVersion,
+ }
+
+ body.ID = nil
+ body.Name = nil
+ body.Type = nil
+ preparer := autorest.CreatePreparer(
+ autorest.AsContentType("application/json; charset=utf-8"),
+ autorest.AsPut(),
+ autorest.WithBaseURL(client.BaseURI),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/capacityPools/{poolName}/volumes/{volumeName}", pathParameters),
+ autorest.WithJSON(body),
+ autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare((&http.Request{}).WithContext(ctx))
+}
+
+// CreateOrUpdateSender sends the CreateOrUpdate request. The method will close the
+// http.Response Body if it receives an error.
+func (client VolumesClient) CreateOrUpdateSender(req *http.Request) (future VolumesCreateOrUpdateFuture, err error) {
+ var resp *http.Response
+ future.FutureAPI = &azure.Future{}
+ resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client))
+ if err != nil {
+ return
+ }
+ var azf azure.Future
+ azf, err = azure.NewFutureFromResponse(resp)
+ future.FutureAPI = &azf
+ future.Result = future.result
+ return
+}
+
+// CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always
+// closes the http.Response Body.
+func (client VolumesClient) CreateOrUpdateResponder(resp *http.Response) (result Volume, err error) {
+ err = autorest.Respond(
+ resp,
+ azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated, http.StatusAccepted),
+ autorest.ByUnmarshallingJSON(&result),
+ autorest.ByClosing())
+ result.Response = autorest.Response{Response: resp}
+ return
+}
+
+// Delete delete the specified volume
+// Parameters:
+// resourceGroupName - the name of the resource group.
+// accountName - the name of the NetApp account
+// poolName - the name of the capacity pool
+// volumeName - the name of the volume
+func (client VolumesClient) Delete(ctx context.Context, resourceGroupName string, accountName string, poolName string, volumeName string) (result VolumesDeleteFuture, err error) {
+ if tracing.IsEnabled() {
+ ctx = tracing.StartSpan(ctx, fqdn+"/VolumesClient.Delete")
+ defer func() {
+ sc := -1
+ if result.FutureAPI != nil && result.FutureAPI.Response() != nil {
+ sc = result.FutureAPI.Response().StatusCode
+ }
+ tracing.EndSpan(ctx, sc, err)
+ }()
+ }
+ if err := validation.Validate([]validation.Validation{
+ {TargetValue: resourceGroupName,
+ Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil},
+ {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil},
+ {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}},
+ {TargetValue: poolName,
+ Constraints: []validation.Constraint{{Target: "poolName", Name: validation.MaxLength, Rule: 64, Chain: nil},
+ {Target: "poolName", Name: validation.MinLength, Rule: 1, Chain: nil},
+ {Target: "poolName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9][a-zA-Z0-9\-_]{0,63}$`, Chain: nil}}},
+ {TargetValue: volumeName,
+ Constraints: []validation.Constraint{{Target: "volumeName", Name: validation.MaxLength, Rule: 64, Chain: nil},
+ {Target: "volumeName", Name: validation.MinLength, Rule: 1, Chain: nil},
+ {Target: "volumeName", Name: validation.Pattern, Rule: `^[a-zA-Z][a-zA-Z0-9\-_]{0,63}$`, Chain: nil}}}}); err != nil {
+ return result, validation.NewError("netapp.VolumesClient", "Delete", err.Error())
+ }
+
+ req, err := client.DeletePreparer(ctx, resourceGroupName, accountName, poolName, volumeName)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "netapp.VolumesClient", "Delete", nil, "Failure preparing request")
+ return
+ }
+
+ result, err = client.DeleteSender(req)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "netapp.VolumesClient", "Delete", result.Response(), "Failure sending request")
+ return
+ }
+
+ return
+}
+
+// DeletePreparer prepares the Delete request.
+func (client VolumesClient) DeletePreparer(ctx context.Context, resourceGroupName string, accountName string, poolName string, volumeName string) (*http.Request, error) {
+ pathParameters := map[string]interface{}{
+ "accountName": autorest.Encode("path", accountName),
+ "poolName": autorest.Encode("path", poolName),
+ "resourceGroupName": autorest.Encode("path", resourceGroupName),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
+ "volumeName": autorest.Encode("path", volumeName),
+ }
+
+ const APIVersion = "2021-04-01-preview"
+ queryParameters := map[string]interface{}{
+ "api-version": APIVersion,
+ }
+
+ preparer := autorest.CreatePreparer(
+ autorest.AsDelete(),
+ autorest.WithBaseURL(client.BaseURI),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/capacityPools/{poolName}/volumes/{volumeName}", pathParameters),
+ autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare((&http.Request{}).WithContext(ctx))
+}
+
+// DeleteSender sends the Delete request. The method will close the
+// http.Response Body if it receives an error.
+func (client VolumesClient) DeleteSender(req *http.Request) (future VolumesDeleteFuture, err error) {
+ var resp *http.Response
+ future.FutureAPI = &azure.Future{}
+ resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client))
+ if err != nil {
+ return
+ }
+ var azf azure.Future
+ azf, err = azure.NewFutureFromResponse(resp)
+ future.FutureAPI = &azf
+ future.Result = future.result
+ return
+}
+
+// DeleteResponder handles the response to the Delete request. The method always
+// closes the http.Response Body.
+func (client VolumesClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) {
+ err = autorest.Respond(
+ resp,
+ azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent),
+ autorest.ByClosing())
+ result.Response = resp
+ return
+}
+
+// DeleteReplication delete the replication connection on the destination volume, and send release to the source
+// replication
+// Parameters:
+// resourceGroupName - the name of the resource group.
+// accountName - the name of the NetApp account
+// poolName - the name of the capacity pool
+// volumeName - the name of the volume
+func (client VolumesClient) DeleteReplication(ctx context.Context, resourceGroupName string, accountName string, poolName string, volumeName string) (result VolumesDeleteReplicationFuture, err error) {
+ if tracing.IsEnabled() {
+ ctx = tracing.StartSpan(ctx, fqdn+"/VolumesClient.DeleteReplication")
+ defer func() {
+ sc := -1
+ if result.FutureAPI != nil && result.FutureAPI.Response() != nil {
+ sc = result.FutureAPI.Response().StatusCode
+ }
+ tracing.EndSpan(ctx, sc, err)
+ }()
+ }
+ if err := validation.Validate([]validation.Validation{
+ {TargetValue: resourceGroupName,
+ Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil},
+ {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil},
+ {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}},
+ {TargetValue: poolName,
+ Constraints: []validation.Constraint{{Target: "poolName", Name: validation.MaxLength, Rule: 64, Chain: nil},
+ {Target: "poolName", Name: validation.MinLength, Rule: 1, Chain: nil},
+ {Target: "poolName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9][a-zA-Z0-9\-_]{0,63}$`, Chain: nil}}},
+ {TargetValue: volumeName,
+ Constraints: []validation.Constraint{{Target: "volumeName", Name: validation.MaxLength, Rule: 64, Chain: nil},
+ {Target: "volumeName", Name: validation.MinLength, Rule: 1, Chain: nil},
+ {Target: "volumeName", Name: validation.Pattern, Rule: `^[a-zA-Z][a-zA-Z0-9\-_]{0,63}$`, Chain: nil}}}}); err != nil {
+ return result, validation.NewError("netapp.VolumesClient", "DeleteReplication", err.Error())
+ }
+
+ req, err := client.DeleteReplicationPreparer(ctx, resourceGroupName, accountName, poolName, volumeName)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "netapp.VolumesClient", "DeleteReplication", nil, "Failure preparing request")
+ return
+ }
+
+ result, err = client.DeleteReplicationSender(req)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "netapp.VolumesClient", "DeleteReplication", result.Response(), "Failure sending request")
+ return
+ }
+
+ return
+}
+
+// DeleteReplicationPreparer prepares the DeleteReplication request.
+func (client VolumesClient) DeleteReplicationPreparer(ctx context.Context, resourceGroupName string, accountName string, poolName string, volumeName string) (*http.Request, error) {
+ pathParameters := map[string]interface{}{
+ "accountName": autorest.Encode("path", accountName),
+ "poolName": autorest.Encode("path", poolName),
+ "resourceGroupName": autorest.Encode("path", resourceGroupName),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
+ "volumeName": autorest.Encode("path", volumeName),
+ }
+
+ const APIVersion = "2021-04-01-preview"
+ queryParameters := map[string]interface{}{
+ "api-version": APIVersion,
+ }
+
+ preparer := autorest.CreatePreparer(
+ autorest.AsPost(),
+ autorest.WithBaseURL(client.BaseURI),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/capacityPools/{poolName}/volumes/{volumeName}/deleteReplication", pathParameters),
+ autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare((&http.Request{}).WithContext(ctx))
+}
+
+// DeleteReplicationSender sends the DeleteReplication request. The method will close the
+// http.Response Body if it receives an error.
+func (client VolumesClient) DeleteReplicationSender(req *http.Request) (future VolumesDeleteReplicationFuture, err error) {
+ var resp *http.Response
+ future.FutureAPI = &azure.Future{}
+ resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client))
+ if err != nil {
+ return
+ }
+ var azf azure.Future
+ azf, err = azure.NewFutureFromResponse(resp)
+ future.FutureAPI = &azf
+ future.Result = future.result
+ return
+}
+
+// DeleteReplicationResponder handles the response to the DeleteReplication request. The method always
+// closes the http.Response Body.
+func (client VolumesClient) DeleteReplicationResponder(resp *http.Response) (result autorest.Response, err error) {
+ err = autorest.Respond(
+ resp,
+ azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted),
+ autorest.ByClosing())
+ result.Response = resp
+ return
+}
+
+// Get get the details of the specified volume
+// Parameters:
+// resourceGroupName - the name of the resource group.
+// accountName - the name of the NetApp account
+// poolName - the name of the capacity pool
+// volumeName - the name of the volume
+func (client VolumesClient) Get(ctx context.Context, resourceGroupName string, accountName string, poolName string, volumeName string) (result Volume, err error) {
+ if tracing.IsEnabled() {
+ ctx = tracing.StartSpan(ctx, fqdn+"/VolumesClient.Get")
+ defer func() {
+ sc := -1
+ if result.Response.Response != nil {
+ sc = result.Response.Response.StatusCode
+ }
+ tracing.EndSpan(ctx, sc, err)
+ }()
+ }
+ if err := validation.Validate([]validation.Validation{
+ {TargetValue: resourceGroupName,
+ Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil},
+ {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil},
+ {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}},
+ {TargetValue: poolName,
+ Constraints: []validation.Constraint{{Target: "poolName", Name: validation.MaxLength, Rule: 64, Chain: nil},
+ {Target: "poolName", Name: validation.MinLength, Rule: 1, Chain: nil},
+ {Target: "poolName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9][a-zA-Z0-9\-_]{0,63}$`, Chain: nil}}},
+ {TargetValue: volumeName,
+ Constraints: []validation.Constraint{{Target: "volumeName", Name: validation.MaxLength, Rule: 64, Chain: nil},
+ {Target: "volumeName", Name: validation.MinLength, Rule: 1, Chain: nil},
+ {Target: "volumeName", Name: validation.Pattern, Rule: `^[a-zA-Z][a-zA-Z0-9\-_]{0,63}$`, Chain: nil}}}}); err != nil {
+ return result, validation.NewError("netapp.VolumesClient", "Get", err.Error())
+ }
+
+ req, err := client.GetPreparer(ctx, resourceGroupName, accountName, poolName, volumeName)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "netapp.VolumesClient", "Get", nil, "Failure preparing request")
+ return
+ }
+
+ resp, err := client.GetSender(req)
+ if err != nil {
+ result.Response = autorest.Response{Response: resp}
+ err = autorest.NewErrorWithError(err, "netapp.VolumesClient", "Get", resp, "Failure sending request")
+ return
+ }
+
+ result, err = client.GetResponder(resp)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "netapp.VolumesClient", "Get", resp, "Failure responding to request")
+ return
+ }
+
+ return
+}
+
+// GetPreparer prepares the Get request.
+func (client VolumesClient) GetPreparer(ctx context.Context, resourceGroupName string, accountName string, poolName string, volumeName string) (*http.Request, error) {
+ pathParameters := map[string]interface{}{
+ "accountName": autorest.Encode("path", accountName),
+ "poolName": autorest.Encode("path", poolName),
+ "resourceGroupName": autorest.Encode("path", resourceGroupName),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
+ "volumeName": autorest.Encode("path", volumeName),
+ }
+
+ const APIVersion = "2021-04-01-preview"
+ queryParameters := map[string]interface{}{
+ "api-version": APIVersion,
+ }
+
+ preparer := autorest.CreatePreparer(
+ autorest.AsGet(),
+ autorest.WithBaseURL(client.BaseURI),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/capacityPools/{poolName}/volumes/{volumeName}", pathParameters),
+ autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare((&http.Request{}).WithContext(ctx))
+}
+
+// GetSender sends the Get request. The method will close the
+// http.Response Body if it receives an error.
+func (client VolumesClient) GetSender(req *http.Request) (*http.Response, error) {
+ return client.Send(req, azure.DoRetryWithRegistration(client.Client))
+}
+
+// GetResponder handles the response to the Get request. The method always
+// closes the http.Response Body.
+func (client VolumesClient) GetResponder(resp *http.Response) (result Volume, err error) {
+ err = autorest.Respond(
+ resp,
+ azure.WithErrorUnlessStatusCode(http.StatusOK),
+ autorest.ByUnmarshallingJSON(&result),
+ autorest.ByClosing())
+ result.Response = autorest.Response{Response: resp}
+ return
+}
+
+// List list all volumes within the capacity pool
+// Parameters:
+// resourceGroupName - the name of the resource group.
+// accountName - the name of the NetApp account
+// poolName - the name of the capacity pool
+func (client VolumesClient) List(ctx context.Context, resourceGroupName string, accountName string, poolName string) (result VolumeListPage, err error) {
+ if tracing.IsEnabled() {
+ ctx = tracing.StartSpan(ctx, fqdn+"/VolumesClient.List")
+ defer func() {
+ sc := -1
+ if result.vl.Response.Response != nil {
+ sc = result.vl.Response.Response.StatusCode
+ }
+ tracing.EndSpan(ctx, sc, err)
+ }()
+ }
+ if err := validation.Validate([]validation.Validation{
+ {TargetValue: resourceGroupName,
+ Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil},
+ {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil},
+ {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}},
+ {TargetValue: poolName,
+ Constraints: []validation.Constraint{{Target: "poolName", Name: validation.MaxLength, Rule: 64, Chain: nil},
+ {Target: "poolName", Name: validation.MinLength, Rule: 1, Chain: nil},
+ {Target: "poolName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9][a-zA-Z0-9\-_]{0,63}$`, Chain: nil}}}}); err != nil {
+ return result, validation.NewError("netapp.VolumesClient", "List", err.Error())
+ }
+
+ result.fn = client.listNextResults
+ req, err := client.ListPreparer(ctx, resourceGroupName, accountName, poolName)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "netapp.VolumesClient", "List", nil, "Failure preparing request")
+ return
+ }
+
+ resp, err := client.ListSender(req)
+ if err != nil {
+ result.vl.Response = autorest.Response{Response: resp}
+ err = autorest.NewErrorWithError(err, "netapp.VolumesClient", "List", resp, "Failure sending request")
+ return
+ }
+
+ result.vl, err = client.ListResponder(resp)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "netapp.VolumesClient", "List", resp, "Failure responding to request")
+ return
+ }
+ if result.vl.hasNextLink() && result.vl.IsEmpty() {
+ err = result.NextWithContext(ctx)
+ return
+ }
+
+ return
+}
+
+// ListPreparer prepares the List request.
+func (client VolumesClient) ListPreparer(ctx context.Context, resourceGroupName string, accountName string, poolName string) (*http.Request, error) {
+ pathParameters := map[string]interface{}{
+ "accountName": autorest.Encode("path", accountName),
+ "poolName": autorest.Encode("path", poolName),
+ "resourceGroupName": autorest.Encode("path", resourceGroupName),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
+ }
+
+ const APIVersion = "2021-04-01-preview"
+ queryParameters := map[string]interface{}{
+ "api-version": APIVersion,
+ }
+
+ preparer := autorest.CreatePreparer(
+ autorest.AsGet(),
+ autorest.WithBaseURL(client.BaseURI),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/capacityPools/{poolName}/volumes", pathParameters),
+ autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare((&http.Request{}).WithContext(ctx))
+}
+
+// ListSender sends the List request. The method will close the
+// http.Response Body if it receives an error.
+func (client VolumesClient) ListSender(req *http.Request) (*http.Response, error) {
+ return client.Send(req, azure.DoRetryWithRegistration(client.Client))
+}
+
+// ListResponder handles the response to the List request. The method always
+// closes the http.Response Body.
+func (client VolumesClient) ListResponder(resp *http.Response) (result VolumeList, err error) {
+ err = autorest.Respond(
+ resp,
+ azure.WithErrorUnlessStatusCode(http.StatusOK),
+ autorest.ByUnmarshallingJSON(&result),
+ autorest.ByClosing())
+ result.Response = autorest.Response{Response: resp}
+ return
+}
+
+// listNextResults retrieves the next set of results, if any.
+func (client VolumesClient) listNextResults(ctx context.Context, lastResults VolumeList) (result VolumeList, err error) {
+ req, err := lastResults.volumeListPreparer(ctx)
+ if err != nil {
+ return result, autorest.NewErrorWithError(err, "netapp.VolumesClient", "listNextResults", nil, "Failure preparing next results request")
+ }
+ if req == nil {
+ return
+ }
+ resp, err := client.ListSender(req)
+ if err != nil {
+ result.Response = autorest.Response{Response: resp}
+ return result, autorest.NewErrorWithError(err, "netapp.VolumesClient", "listNextResults", resp, "Failure sending next results request")
+ }
+ result, err = client.ListResponder(resp)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "netapp.VolumesClient", "listNextResults", resp, "Failure responding to next results request")
+ }
+ return
+}
+
+// ListComplete enumerates all values, automatically crossing page boundaries as required.
+func (client VolumesClient) ListComplete(ctx context.Context, resourceGroupName string, accountName string, poolName string) (result VolumeListIterator, err error) {
+ if tracing.IsEnabled() {
+ ctx = tracing.StartSpan(ctx, fqdn+"/VolumesClient.List")
+ defer func() {
+ sc := -1
+ if result.Response().Response.Response != nil {
+ sc = result.page.Response().Response.Response.StatusCode
+ }
+ tracing.EndSpan(ctx, sc, err)
+ }()
+ }
+ result.page, err = client.List(ctx, resourceGroupName, accountName, poolName)
+ return
+}
+
+// PoolChange moves volume to another pool
+// Parameters:
+// resourceGroupName - the name of the resource group.
+// accountName - the name of the NetApp account
+// poolName - the name of the capacity pool
+// volumeName - the name of the volume
+// body - move volume to the pool supplied in the body of the operation.
+func (client VolumesClient) PoolChange(ctx context.Context, resourceGroupName string, accountName string, poolName string, volumeName string, body PoolChangeRequest) (result VolumesPoolChangeFuture, err error) {
+ if tracing.IsEnabled() {
+ ctx = tracing.StartSpan(ctx, fqdn+"/VolumesClient.PoolChange")
+ defer func() {
+ sc := -1
+ if result.FutureAPI != nil && result.FutureAPI.Response() != nil {
+ sc = result.FutureAPI.Response().StatusCode
+ }
+ tracing.EndSpan(ctx, sc, err)
+ }()
+ }
+ if err := validation.Validate([]validation.Validation{
+ {TargetValue: resourceGroupName,
+ Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil},
+ {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil},
+ {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}},
+ {TargetValue: poolName,
+ Constraints: []validation.Constraint{{Target: "poolName", Name: validation.MaxLength, Rule: 64, Chain: nil},
+ {Target: "poolName", Name: validation.MinLength, Rule: 1, Chain: nil},
+ {Target: "poolName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9][a-zA-Z0-9\-_]{0,63}$`, Chain: nil}}},
+ {TargetValue: volumeName,
+ Constraints: []validation.Constraint{{Target: "volumeName", Name: validation.MaxLength, Rule: 64, Chain: nil},
+ {Target: "volumeName", Name: validation.MinLength, Rule: 1, Chain: nil},
+ {Target: "volumeName", Name: validation.Pattern, Rule: `^[a-zA-Z][a-zA-Z0-9\-_]{0,63}$`, Chain: nil}}},
+ {TargetValue: body,
+ Constraints: []validation.Constraint{{Target: "body.NewPoolResourceID", Name: validation.Null, Rule: true, Chain: nil}}}}); err != nil {
+ return result, validation.NewError("netapp.VolumesClient", "PoolChange", err.Error())
+ }
+
+ req, err := client.PoolChangePreparer(ctx, resourceGroupName, accountName, poolName, volumeName, body)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "netapp.VolumesClient", "PoolChange", nil, "Failure preparing request")
+ return
+ }
+
+ result, err = client.PoolChangeSender(req)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "netapp.VolumesClient", "PoolChange", result.Response(), "Failure sending request")
+ return
+ }
+
+ return
+}
+
+// PoolChangePreparer prepares the PoolChange request.
+func (client VolumesClient) PoolChangePreparer(ctx context.Context, resourceGroupName string, accountName string, poolName string, volumeName string, body PoolChangeRequest) (*http.Request, error) {
+ pathParameters := map[string]interface{}{
+ "accountName": autorest.Encode("path", accountName),
+ "poolName": autorest.Encode("path", poolName),
+ "resourceGroupName": autorest.Encode("path", resourceGroupName),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
+ "volumeName": autorest.Encode("path", volumeName),
+ }
+
+ const APIVersion = "2021-04-01-preview"
+ queryParameters := map[string]interface{}{
+ "api-version": APIVersion,
+ }
+
+ preparer := autorest.CreatePreparer(
+ autorest.AsContentType("application/json; charset=utf-8"),
+ autorest.AsPost(),
+ autorest.WithBaseURL(client.BaseURI),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/capacityPools/{poolName}/volumes/{volumeName}/poolChange", pathParameters),
+ autorest.WithJSON(body),
+ autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare((&http.Request{}).WithContext(ctx))
+}
+
+// PoolChangeSender sends the PoolChange request. The method will close the
+// http.Response Body if it receives an error.
+func (client VolumesClient) PoolChangeSender(req *http.Request) (future VolumesPoolChangeFuture, err error) {
+ var resp *http.Response
+ future.FutureAPI = &azure.Future{}
+ resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client))
+ if err != nil {
+ return
+ }
+ var azf azure.Future
+ azf, err = azure.NewFutureFromResponse(resp)
+ future.FutureAPI = &azf
+ future.Result = future.result
+ return
+}
+
+// PoolChangeResponder handles the response to the PoolChange request. The method always
+// closes the http.Response Body.
+func (client VolumesClient) PoolChangeResponder(resp *http.Response) (result autorest.Response, err error) {
+ err = autorest.Respond(
+ resp,
+ azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted),
+ autorest.ByClosing())
+ result.Response = resp
+ return
+}
+
+// ReInitializeReplication re-Initializes the replication connection on the destination volume
+// Parameters:
+// resourceGroupName - the name of the resource group.
+// accountName - the name of the NetApp account
+// poolName - the name of the capacity pool
+// volumeName - the name of the volume
+func (client VolumesClient) ReInitializeReplication(ctx context.Context, resourceGroupName string, accountName string, poolName string, volumeName string) (result VolumesReInitializeReplicationFuture, err error) {
+ if tracing.IsEnabled() {
+ ctx = tracing.StartSpan(ctx, fqdn+"/VolumesClient.ReInitializeReplication")
+ defer func() {
+ sc := -1
+ if result.FutureAPI != nil && result.FutureAPI.Response() != nil {
+ sc = result.FutureAPI.Response().StatusCode
+ }
+ tracing.EndSpan(ctx, sc, err)
+ }()
+ }
+ if err := validation.Validate([]validation.Validation{
+ {TargetValue: resourceGroupName,
+ Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil},
+ {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil},
+ {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}},
+ {TargetValue: poolName,
+ Constraints: []validation.Constraint{{Target: "poolName", Name: validation.MaxLength, Rule: 64, Chain: nil},
+ {Target: "poolName", Name: validation.MinLength, Rule: 1, Chain: nil},
+ {Target: "poolName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9][a-zA-Z0-9\-_]{0,63}$`, Chain: nil}}},
+ {TargetValue: volumeName,
+ Constraints: []validation.Constraint{{Target: "volumeName", Name: validation.MaxLength, Rule: 64, Chain: nil},
+ {Target: "volumeName", Name: validation.MinLength, Rule: 1, Chain: nil},
+ {Target: "volumeName", Name: validation.Pattern, Rule: `^[a-zA-Z][a-zA-Z0-9\-_]{0,63}$`, Chain: nil}}}}); err != nil {
+ return result, validation.NewError("netapp.VolumesClient", "ReInitializeReplication", err.Error())
+ }
+
+ req, err := client.ReInitializeReplicationPreparer(ctx, resourceGroupName, accountName, poolName, volumeName)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "netapp.VolumesClient", "ReInitializeReplication", nil, "Failure preparing request")
+ return
+ }
+
+ result, err = client.ReInitializeReplicationSender(req)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "netapp.VolumesClient", "ReInitializeReplication", result.Response(), "Failure sending request")
+ return
+ }
+
+ return
+}
+
+// ReInitializeReplicationPreparer prepares the ReInitializeReplication request.
+func (client VolumesClient) ReInitializeReplicationPreparer(ctx context.Context, resourceGroupName string, accountName string, poolName string, volumeName string) (*http.Request, error) {
+ pathParameters := map[string]interface{}{
+ "accountName": autorest.Encode("path", accountName),
+ "poolName": autorest.Encode("path", poolName),
+ "resourceGroupName": autorest.Encode("path", resourceGroupName),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
+ "volumeName": autorest.Encode("path", volumeName),
+ }
+
+ const APIVersion = "2021-04-01-preview"
+ queryParameters := map[string]interface{}{
+ "api-version": APIVersion,
+ }
+
+ preparer := autorest.CreatePreparer(
+ autorest.AsPost(),
+ autorest.WithBaseURL(client.BaseURI),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/capacityPools/{poolName}/volumes/{volumeName}/reinitializeReplication", pathParameters),
+ autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare((&http.Request{}).WithContext(ctx))
+}
+
+// ReInitializeReplicationSender sends the ReInitializeReplication request. The method will close the
+// http.Response Body if it receives an error.
+func (client VolumesClient) ReInitializeReplicationSender(req *http.Request) (future VolumesReInitializeReplicationFuture, err error) {
+ var resp *http.Response
+ future.FutureAPI = &azure.Future{}
+ resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client))
+ if err != nil {
+ return
+ }
+ var azf azure.Future
+ azf, err = azure.NewFutureFromResponse(resp)
+ future.FutureAPI = &azf
+ future.Result = future.result
+ return
+}
+
+// ReInitializeReplicationResponder handles the response to the ReInitializeReplication request. The method always
+// closes the http.Response Body.
+func (client VolumesClient) ReInitializeReplicationResponder(resp *http.Response) (result autorest.Response, err error) {
+ err = autorest.Respond(
+ resp,
+ azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted),
+ autorest.ByClosing())
+ result.Response = resp
+ return
+}
+
+// ReplicationStatusMethod get the status of the replication
+// Parameters:
+// resourceGroupName - the name of the resource group.
+// accountName - the name of the NetApp account
+// poolName - the name of the capacity pool
+// volumeName - the name of the volume
+func (client VolumesClient) ReplicationStatusMethod(ctx context.Context, resourceGroupName string, accountName string, poolName string, volumeName string) (result ReplicationStatus, err error) {
+ if tracing.IsEnabled() {
+ ctx = tracing.StartSpan(ctx, fqdn+"/VolumesClient.ReplicationStatusMethod")
+ defer func() {
+ sc := -1
+ if result.Response.Response != nil {
+ sc = result.Response.Response.StatusCode
+ }
+ tracing.EndSpan(ctx, sc, err)
+ }()
+ }
+ if err := validation.Validate([]validation.Validation{
+ {TargetValue: resourceGroupName,
+ Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil},
+ {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil},
+ {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}},
+ {TargetValue: poolName,
+ Constraints: []validation.Constraint{{Target: "poolName", Name: validation.MaxLength, Rule: 64, Chain: nil},
+ {Target: "poolName", Name: validation.MinLength, Rule: 1, Chain: nil},
+ {Target: "poolName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9][a-zA-Z0-9\-_]{0,63}$`, Chain: nil}}},
+ {TargetValue: volumeName,
+ Constraints: []validation.Constraint{{Target: "volumeName", Name: validation.MaxLength, Rule: 64, Chain: nil},
+ {Target: "volumeName", Name: validation.MinLength, Rule: 1, Chain: nil},
+ {Target: "volumeName", Name: validation.Pattern, Rule: `^[a-zA-Z][a-zA-Z0-9\-_]{0,63}$`, Chain: nil}}}}); err != nil {
+ return result, validation.NewError("netapp.VolumesClient", "ReplicationStatusMethod", err.Error())
+ }
+
+ req, err := client.ReplicationStatusMethodPreparer(ctx, resourceGroupName, accountName, poolName, volumeName)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "netapp.VolumesClient", "ReplicationStatusMethod", nil, "Failure preparing request")
+ return
+ }
+
+ resp, err := client.ReplicationStatusMethodSender(req)
+ if err != nil {
+ result.Response = autorest.Response{Response: resp}
+ err = autorest.NewErrorWithError(err, "netapp.VolumesClient", "ReplicationStatusMethod", resp, "Failure sending request")
+ return
+ }
+
+ result, err = client.ReplicationStatusMethodResponder(resp)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "netapp.VolumesClient", "ReplicationStatusMethod", resp, "Failure responding to request")
+ return
+ }
+
+ return
+}
+
+// ReplicationStatusMethodPreparer prepares the ReplicationStatusMethod request.
+func (client VolumesClient) ReplicationStatusMethodPreparer(ctx context.Context, resourceGroupName string, accountName string, poolName string, volumeName string) (*http.Request, error) {
+ pathParameters := map[string]interface{}{
+ "accountName": autorest.Encode("path", accountName),
+ "poolName": autorest.Encode("path", poolName),
+ "resourceGroupName": autorest.Encode("path", resourceGroupName),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
+ "volumeName": autorest.Encode("path", volumeName),
+ }
+
+ const APIVersion = "2021-04-01-preview"
+ queryParameters := map[string]interface{}{
+ "api-version": APIVersion,
+ }
+
+ preparer := autorest.CreatePreparer(
+ autorest.AsGet(),
+ autorest.WithBaseURL(client.BaseURI),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/capacityPools/{poolName}/volumes/{volumeName}/replicationStatus", pathParameters),
+ autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare((&http.Request{}).WithContext(ctx))
+}
+
+// ReplicationStatusMethodSender sends the ReplicationStatusMethod request. The method will close the
+// http.Response Body if it receives an error.
+func (client VolumesClient) ReplicationStatusMethodSender(req *http.Request) (*http.Response, error) {
+ return client.Send(req, azure.DoRetryWithRegistration(client.Client))
+}
+
+// ReplicationStatusMethodResponder handles the response to the ReplicationStatusMethod request. The method always
+// closes the http.Response Body.
+func (client VolumesClient) ReplicationStatusMethodResponder(resp *http.Response) (result ReplicationStatus, err error) {
+ err = autorest.Respond(
+ resp,
+ azure.WithErrorUnlessStatusCode(http.StatusOK),
+ autorest.ByUnmarshallingJSON(&result),
+ autorest.ByClosing())
+ result.Response = autorest.Response{Response: resp}
+ return
+}
+
+// ResyncReplication resync the connection on the destination volume. If the operation is ran on the source volume it
+// will reverse-resync the connection and sync from destination to source.
+// Parameters:
+// resourceGroupName - the name of the resource group.
+// accountName - the name of the NetApp account
+// poolName - the name of the capacity pool
+// volumeName - the name of the volume
+func (client VolumesClient) ResyncReplication(ctx context.Context, resourceGroupName string, accountName string, poolName string, volumeName string) (result VolumesResyncReplicationFuture, err error) {
+ if tracing.IsEnabled() {
+ ctx = tracing.StartSpan(ctx, fqdn+"/VolumesClient.ResyncReplication")
+ defer func() {
+ sc := -1
+ if result.FutureAPI != nil && result.FutureAPI.Response() != nil {
+ sc = result.FutureAPI.Response().StatusCode
+ }
+ tracing.EndSpan(ctx, sc, err)
+ }()
+ }
+ if err := validation.Validate([]validation.Validation{
+ {TargetValue: resourceGroupName,
+ Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil},
+ {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil},
+ {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}},
+ {TargetValue: poolName,
+ Constraints: []validation.Constraint{{Target: "poolName", Name: validation.MaxLength, Rule: 64, Chain: nil},
+ {Target: "poolName", Name: validation.MinLength, Rule: 1, Chain: nil},
+ {Target: "poolName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9][a-zA-Z0-9\-_]{0,63}$`, Chain: nil}}},
+ {TargetValue: volumeName,
+ Constraints: []validation.Constraint{{Target: "volumeName", Name: validation.MaxLength, Rule: 64, Chain: nil},
+ {Target: "volumeName", Name: validation.MinLength, Rule: 1, Chain: nil},
+ {Target: "volumeName", Name: validation.Pattern, Rule: `^[a-zA-Z][a-zA-Z0-9\-_]{0,63}$`, Chain: nil}}}}); err != nil {
+ return result, validation.NewError("netapp.VolumesClient", "ResyncReplication", err.Error())
+ }
+
+ req, err := client.ResyncReplicationPreparer(ctx, resourceGroupName, accountName, poolName, volumeName)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "netapp.VolumesClient", "ResyncReplication", nil, "Failure preparing request")
+ return
+ }
+
+ result, err = client.ResyncReplicationSender(req)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "netapp.VolumesClient", "ResyncReplication", result.Response(), "Failure sending request")
+ return
+ }
+
+ return
+}
+
+// ResyncReplicationPreparer prepares the ResyncReplication request.
+func (client VolumesClient) ResyncReplicationPreparer(ctx context.Context, resourceGroupName string, accountName string, poolName string, volumeName string) (*http.Request, error) {
+ pathParameters := map[string]interface{}{
+ "accountName": autorest.Encode("path", accountName),
+ "poolName": autorest.Encode("path", poolName),
+ "resourceGroupName": autorest.Encode("path", resourceGroupName),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
+ "volumeName": autorest.Encode("path", volumeName),
+ }
+
+ const APIVersion = "2021-04-01-preview"
+ queryParameters := map[string]interface{}{
+ "api-version": APIVersion,
+ }
+
+ preparer := autorest.CreatePreparer(
+ autorest.AsPost(),
+ autorest.WithBaseURL(client.BaseURI),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/capacityPools/{poolName}/volumes/{volumeName}/resyncReplication", pathParameters),
+ autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare((&http.Request{}).WithContext(ctx))
+}
+
+// ResyncReplicationSender sends the ResyncReplication request. The method will close the
+// http.Response Body if it receives an error.
+func (client VolumesClient) ResyncReplicationSender(req *http.Request) (future VolumesResyncReplicationFuture, err error) {
+ var resp *http.Response
+ future.FutureAPI = &azure.Future{}
+ resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client))
+ if err != nil {
+ return
+ }
+ var azf azure.Future
+ azf, err = azure.NewFutureFromResponse(resp)
+ future.FutureAPI = &azf
+ future.Result = future.result
+ return
+}
+
+// ResyncReplicationResponder handles the response to the ResyncReplication request. The method always
+// closes the http.Response Body.
+func (client VolumesClient) ResyncReplicationResponder(resp *http.Response) (result autorest.Response, err error) {
+ err = autorest.Respond(
+ resp,
+ azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted),
+ autorest.ByClosing())
+ result.Response = resp
+ return
+}
+
+// Revert revert a volume to the snapshot specified in the body
+// Parameters:
+// resourceGroupName - the name of the resource group.
+// accountName - the name of the NetApp account
+// poolName - the name of the capacity pool
+// volumeName - the name of the volume
+// body - object for snapshot to revert supplied in the body of the operation.
+func (client VolumesClient) Revert(ctx context.Context, resourceGroupName string, accountName string, poolName string, volumeName string, body VolumeRevert) (result VolumesRevertFuture, err error) {
+ if tracing.IsEnabled() {
+ ctx = tracing.StartSpan(ctx, fqdn+"/VolumesClient.Revert")
+ defer func() {
+ sc := -1
+ if result.FutureAPI != nil && result.FutureAPI.Response() != nil {
+ sc = result.FutureAPI.Response().StatusCode
+ }
+ tracing.EndSpan(ctx, sc, err)
+ }()
+ }
+ if err := validation.Validate([]validation.Validation{
+ {TargetValue: resourceGroupName,
+ Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil},
+ {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil},
+ {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}},
+ {TargetValue: poolName,
+ Constraints: []validation.Constraint{{Target: "poolName", Name: validation.MaxLength, Rule: 64, Chain: nil},
+ {Target: "poolName", Name: validation.MinLength, Rule: 1, Chain: nil},
+ {Target: "poolName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9][a-zA-Z0-9\-_]{0,63}$`, Chain: nil}}},
+ {TargetValue: volumeName,
+ Constraints: []validation.Constraint{{Target: "volumeName", Name: validation.MaxLength, Rule: 64, Chain: nil},
+ {Target: "volumeName", Name: validation.MinLength, Rule: 1, Chain: nil},
+ {Target: "volumeName", Name: validation.Pattern, Rule: `^[a-zA-Z][a-zA-Z0-9\-_]{0,63}$`, Chain: nil}}}}); err != nil {
+ return result, validation.NewError("netapp.VolumesClient", "Revert", err.Error())
+ }
+
+ req, err := client.RevertPreparer(ctx, resourceGroupName, accountName, poolName, volumeName, body)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "netapp.VolumesClient", "Revert", nil, "Failure preparing request")
+ return
+ }
+
+ result, err = client.RevertSender(req)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "netapp.VolumesClient", "Revert", result.Response(), "Failure sending request")
+ return
+ }
+
+ return
+}
+
+// RevertPreparer prepares the Revert request.
+func (client VolumesClient) RevertPreparer(ctx context.Context, resourceGroupName string, accountName string, poolName string, volumeName string, body VolumeRevert) (*http.Request, error) {
+ pathParameters := map[string]interface{}{
+ "accountName": autorest.Encode("path", accountName),
+ "poolName": autorest.Encode("path", poolName),
+ "resourceGroupName": autorest.Encode("path", resourceGroupName),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
+ "volumeName": autorest.Encode("path", volumeName),
+ }
+
+ const APIVersion = "2021-04-01-preview"
+ queryParameters := map[string]interface{}{
+ "api-version": APIVersion,
+ }
+
+ preparer := autorest.CreatePreparer(
+ autorest.AsContentType("application/json; charset=utf-8"),
+ autorest.AsPost(),
+ autorest.WithBaseURL(client.BaseURI),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/capacityPools/{poolName}/volumes/{volumeName}/revert", pathParameters),
+ autorest.WithJSON(body),
+ autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare((&http.Request{}).WithContext(ctx))
+}
+
+// RevertSender sends the Revert request. The method will close the
+// http.Response Body if it receives an error.
+func (client VolumesClient) RevertSender(req *http.Request) (future VolumesRevertFuture, err error) {
+ var resp *http.Response
+ future.FutureAPI = &azure.Future{}
+ resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client))
+ if err != nil {
+ return
+ }
+ var azf azure.Future
+ azf, err = azure.NewFutureFromResponse(resp)
+ future.FutureAPI = &azf
+ future.Result = future.result
+ return
+}
+
+// RevertResponder handles the response to the Revert request. The method always
+// closes the http.Response Body.
+func (client VolumesClient) RevertResponder(resp *http.Response) (result autorest.Response, err error) {
+ err = autorest.Respond(
+ resp,
+ azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted),
+ autorest.ByClosing())
+ result.Response = resp
+ return
+}
+
+// Update patch the specified volume
+// Parameters:
+// body - volume object supplied in the body of the operation.
+// resourceGroupName - the name of the resource group.
+// accountName - the name of the NetApp account
+// poolName - the name of the capacity pool
+// volumeName - the name of the volume
+func (client VolumesClient) Update(ctx context.Context, body VolumePatch, resourceGroupName string, accountName string, poolName string, volumeName string) (result VolumesUpdateFuture, err error) {
+ if tracing.IsEnabled() {
+ ctx = tracing.StartSpan(ctx, fqdn+"/VolumesClient.Update")
+ defer func() {
+ sc := -1
+ if result.FutureAPI != nil && result.FutureAPI.Response() != nil {
+ sc = result.FutureAPI.Response().StatusCode
+ }
+ tracing.EndSpan(ctx, sc, err)
+ }()
+ }
+ if err := validation.Validate([]validation.Validation{
+ {TargetValue: resourceGroupName,
+ Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil},
+ {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil},
+ {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}},
+ {TargetValue: poolName,
+ Constraints: []validation.Constraint{{Target: "poolName", Name: validation.MaxLength, Rule: 64, Chain: nil},
+ {Target: "poolName", Name: validation.MinLength, Rule: 1, Chain: nil},
+ {Target: "poolName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9][a-zA-Z0-9\-_]{0,63}$`, Chain: nil}}},
+ {TargetValue: volumeName,
+ Constraints: []validation.Constraint{{Target: "volumeName", Name: validation.MaxLength, Rule: 64, Chain: nil},
+ {Target: "volumeName", Name: validation.MinLength, Rule: 1, Chain: nil},
+ {Target: "volumeName", Name: validation.Pattern, Rule: `^[a-zA-Z][a-zA-Z0-9\-_]{0,63}$`, Chain: nil}}}}); err != nil {
+ return result, validation.NewError("netapp.VolumesClient", "Update", err.Error())
+ }
+
+ req, err := client.UpdatePreparer(ctx, body, resourceGroupName, accountName, poolName, volumeName)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "netapp.VolumesClient", "Update", nil, "Failure preparing request")
+ return
+ }
+
+ result, err = client.UpdateSender(req)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "netapp.VolumesClient", "Update", result.Response(), "Failure sending request")
+ return
+ }
+
+ return
+}
+
+// UpdatePreparer prepares the Update request.
+func (client VolumesClient) UpdatePreparer(ctx context.Context, body VolumePatch, resourceGroupName string, accountName string, poolName string, volumeName string) (*http.Request, error) {
+ pathParameters := map[string]interface{}{
+ "accountName": autorest.Encode("path", accountName),
+ "poolName": autorest.Encode("path", poolName),
+ "resourceGroupName": autorest.Encode("path", resourceGroupName),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
+ "volumeName": autorest.Encode("path", volumeName),
+ }
+
+ const APIVersion = "2021-04-01-preview"
+ queryParameters := map[string]interface{}{
+ "api-version": APIVersion,
+ }
+
+ body.ID = nil
+ body.Name = nil
+ body.Type = nil
+ preparer := autorest.CreatePreparer(
+ autorest.AsContentType("application/json; charset=utf-8"),
+ autorest.AsPatch(),
+ autorest.WithBaseURL(client.BaseURI),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/capacityPools/{poolName}/volumes/{volumeName}", pathParameters),
+ autorest.WithJSON(body),
+ autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare((&http.Request{}).WithContext(ctx))
+}
+
+// UpdateSender sends the Update request. The method will close the
+// http.Response Body if it receives an error.
+func (client VolumesClient) UpdateSender(req *http.Request) (future VolumesUpdateFuture, err error) {
+ var resp *http.Response
+ future.FutureAPI = &azure.Future{}
+ resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client))
+ if err != nil {
+ return
+ }
+ var azf azure.Future
+ azf, err = azure.NewFutureFromResponse(resp)
+ future.FutureAPI = &azf
+ future.Result = future.result
+ return
+}
+
+// UpdateResponder handles the response to the Update request. The method always
+// closes the http.Response Body.
+func (client VolumesClient) UpdateResponder(resp *http.Response) (result Volume, err error) {
+ err = autorest.Respond(
+ resp,
+ azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted),
+ autorest.ByUnmarshallingJSON(&result),
+ autorest.ByClosing())
+ result.Response = autorest.Response{Response: resp}
+ return
+}