зеркало из https://github.com/Azure/ARO-RP.git
ARO-4373 update mgmtstorage sdk to 2019-06-01 for disabling allowSharedKeyAccess
This commit is contained in:
Родитель
a485dcbf50
Коммит
90fde763c3
|
@ -9,7 +9,7 @@ import (
|
|||
|
||||
mgmtnetwork "github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-08-01/network"
|
||||
mgmtauthorization "github.com/Azure/azure-sdk-for-go/services/preview/authorization/mgmt/2018-09-01-preview/authorization"
|
||||
mgmtstorage "github.com/Azure/azure-sdk-for-go/services/storage/mgmt/2019-06-01/storage"
|
||||
mgmtstorage "github.com/Azure/azure-sdk-for-go/services/storage/mgmt/2021-09-01/storage"
|
||||
"github.com/Azure/go-autorest/autorest/to"
|
||||
|
||||
"github.com/Azure/ARO-RP/pkg/api"
|
||||
|
@ -88,11 +88,11 @@ func (m *manager) storageAccount(name, region string, ocpSubnets []string, encry
|
|||
virtualNetworkRules := []mgmtstorage.VirtualNetworkRule{
|
||||
{
|
||||
VirtualNetworkResourceID: to.StringPtr("/subscriptions/" + m.env.SubscriptionID() + "/resourceGroups/" + m.env.ResourceGroup() + "/providers/Microsoft.Network/virtualNetworks/rp-pe-vnet-001/subnets/rp-pe-subnet"),
|
||||
Action: mgmtstorage.Allow,
|
||||
Action: mgmtstorage.ActionAllow,
|
||||
},
|
||||
{
|
||||
VirtualNetworkResourceID: to.StringPtr("/subscriptions/" + m.env.SubscriptionID() + "/resourceGroups/" + m.env.ResourceGroup() + "/providers/Microsoft.Network/virtualNetworks/rp-vnet/subnets/rp-subnet"),
|
||||
Action: mgmtstorage.Allow,
|
||||
Action: mgmtstorage.ActionAllow,
|
||||
},
|
||||
}
|
||||
|
||||
|
@ -100,7 +100,7 @@ func (m *manager) storageAccount(name, region string, ocpSubnets []string, encry
|
|||
for _, subnet := range ocpSubnets {
|
||||
virtualNetworkRules = append(virtualNetworkRules, mgmtstorage.VirtualNetworkRule{
|
||||
VirtualNetworkResourceID: to.StringPtr(subnet),
|
||||
Action: mgmtstorage.Allow,
|
||||
Action: mgmtstorage.ActionAllow,
|
||||
})
|
||||
}
|
||||
|
||||
|
@ -110,7 +110,7 @@ func (m *manager) storageAccount(name, region string, ocpSubnets []string, encry
|
|||
if m.installViaHive && strings.Index(name, "cluster") == 0 {
|
||||
virtualNetworkRules = append(virtualNetworkRules, mgmtstorage.VirtualNetworkRule{
|
||||
VirtualNetworkResourceID: to.StringPtr(fmt.Sprintf("/subscriptions/%s/resourceGroups/%s/providers/Microsoft.Network/virtualNetworks/aks-net/subnets/PodSubnet-%03d", m.env.SubscriptionID(), m.env.ResourceGroup(), hiveShard)),
|
||||
Action: mgmtstorage.Allow,
|
||||
Action: mgmtstorage.ActionAllow,
|
||||
})
|
||||
}
|
||||
|
||||
|
@ -120,21 +120,21 @@ func (m *manager) storageAccount(name, region string, ocpSubnets []string, encry
|
|||
if !m.env.IsLocalDevelopmentMode() {
|
||||
virtualNetworkRules = append(virtualNetworkRules, mgmtstorage.VirtualNetworkRule{
|
||||
VirtualNetworkResourceID: to.StringPtr("/subscriptions/" + m.env.SubscriptionID() + "/resourceGroups/" + m.env.GatewayResourceGroup() + "/providers/Microsoft.Network/virtualNetworks/gateway-vnet/subnets/gateway-subnet"),
|
||||
Action: mgmtstorage.Allow,
|
||||
Action: mgmtstorage.ActionAllow,
|
||||
})
|
||||
}
|
||||
|
||||
sa := &mgmtstorage.Account{
|
||||
Kind: mgmtstorage.StorageV2,
|
||||
Kind: mgmtstorage.KindStorageV2,
|
||||
Sku: &mgmtstorage.Sku{
|
||||
Name: "Standard_LRS",
|
||||
},
|
||||
AccountProperties: &mgmtstorage.AccountProperties{
|
||||
AllowBlobPublicAccess: to.BoolPtr(false),
|
||||
EnableHTTPSTrafficOnly: to.BoolPtr(true),
|
||||
MinimumTLSVersion: mgmtstorage.TLS12,
|
||||
MinimumTLSVersion: mgmtstorage.MinimumTLSVersionTLS12,
|
||||
NetworkRuleSet: &mgmtstorage.NetworkRuleSet{
|
||||
Bypass: mgmtstorage.AzureServices,
|
||||
Bypass: mgmtstorage.BypassAzureServices,
|
||||
VirtualNetworkRules: &virtualNetworkRules,
|
||||
DefaultAction: "Deny",
|
||||
},
|
||||
|
|
|
@ -9,7 +9,7 @@ import (
|
|||
"io"
|
||||
"strings"
|
||||
|
||||
mgmtstorage "github.com/Azure/azure-sdk-for-go/services/storage/mgmt/2019-06-01/storage"
|
||||
mgmtstorage "github.com/Azure/azure-sdk-for-go/services/storage/mgmt/2021-09-01/storage"
|
||||
"github.com/sirupsen/logrus"
|
||||
|
||||
"github.com/Azure/ARO-RP/pkg/env"
|
||||
|
|
|
@ -6,7 +6,7 @@ package cluster
|
|||
import (
|
||||
"context"
|
||||
|
||||
mgmtstorage "github.com/Azure/azure-sdk-for-go/services/storage/mgmt/2019-06-01/storage"
|
||||
mgmtstorage "github.com/Azure/azure-sdk-for-go/services/storage/mgmt/2021-09-01/storage"
|
||||
azstorage "github.com/Azure/azure-sdk-for-go/storage"
|
||||
|
||||
"github.com/Azure/ARO-RP/pkg/util/stringutils"
|
||||
|
|
|
@ -18,8 +18,9 @@
|
|||
"properties": {
|
||||
"accessTier": "Hot",
|
||||
"supportsHttpsTrafficOnly": true,
|
||||
"allowBlobPublicAccess": true,
|
||||
"minimumTlsVersion": "TLS1_2"
|
||||
"allowBlobPublicAccess": false,
|
||||
"minimumTlsVersion": "TLS1_2",
|
||||
"allowSharedKeyAccess": false
|
||||
},
|
||||
"tags": {
|
||||
"Az.Sec.AnonymousBlobAccessEnforcement::Skip": "PublicRelease"
|
||||
|
@ -27,7 +28,7 @@
|
|||
"location": "[resourceGroup().location]",
|
||||
"name": "[concat(take(substring(parameters('storageAccountDomain'), 0, indexOf(parameters('storageAccountDomain'), '.')), 21), 'oic')]",
|
||||
"type": "Microsoft.Storage/storageAccounts",
|
||||
"apiVersion": "2019-06-01"
|
||||
"apiVersion": "2021-09-01"
|
||||
},
|
||||
{
|
||||
"name": "[concat(concat(take(substring(parameters('storageAccountDomain'), 0, indexOf(parameters('storageAccountDomain'), '.')), 21), 'oic'), '/Microsoft.Authorization/', guid(resourceId('Microsoft.Storage/storageAccounts', concat(take(substring(parameters('storageAccountDomain'), 0, indexOf(parameters('storageAccountDomain'), '.')), 21), 'oic'))))]",
|
||||
|
|
|
@ -110,7 +110,7 @@
|
|||
"location": "[resourceGroup().location]",
|
||||
"name": "[parameters('rpVersionStorageAccountName')]",
|
||||
"type": "Microsoft.Storage/storageAccounts",
|
||||
"apiVersion": "2019-06-01"
|
||||
"apiVersion": "2021-09-01"
|
||||
},
|
||||
{
|
||||
"properties": {
|
||||
|
@ -119,7 +119,7 @@
|
|||
},
|
||||
"name": "[concat(parameters('rpVersionStorageAccountName'), '/default/rpversion')]",
|
||||
"type": "Microsoft.Storage/storageAccounts/blobServices/containers",
|
||||
"apiVersion": "2019-06-01",
|
||||
"apiVersion": "2021-09-01",
|
||||
"dependsOn": [
|
||||
"[resourceId('Microsoft.Storage/storageAccounts', parameters('rpVersionStorageAccountName'))]"
|
||||
]
|
||||
|
@ -131,7 +131,7 @@
|
|||
},
|
||||
"name": "[concat(parameters('rpVersionStorageAccountName'), '/default/ocpversions')]",
|
||||
"type": "Microsoft.Storage/storageAccounts/blobServices/containers",
|
||||
"apiVersion": "2019-06-01",
|
||||
"apiVersion": "2021-09-01",
|
||||
"dependsOn": [
|
||||
"[resourceId('Microsoft.Storage/storageAccounts', parameters('rpVersionStorageAccountName'))]"
|
||||
]
|
||||
|
|
|
@ -8,7 +8,7 @@ import (
|
|||
mgmtkeyvault "github.com/Azure/azure-sdk-for-go/services/keyvault/mgmt/2019-09-01/keyvault"
|
||||
mgmtnetwork "github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-08-01/network"
|
||||
mgmtinsights "github.com/Azure/azure-sdk-for-go/services/preview/monitor/mgmt/2018-03-01/insights"
|
||||
mgmtstorage "github.com/Azure/azure-sdk-for-go/services/storage/mgmt/2019-06-01/storage"
|
||||
mgmtstorage "github.com/Azure/azure-sdk-for-go/services/storage/mgmt/2021-09-01/storage"
|
||||
"github.com/Azure/go-autorest/autorest/to"
|
||||
|
||||
"github.com/Azure/ARO-RP/pkg/util/arm"
|
||||
|
|
|
@ -6,7 +6,7 @@ package generator
|
|||
import (
|
||||
"fmt"
|
||||
|
||||
mgmtstorage "github.com/Azure/azure-sdk-for-go/services/storage/mgmt/2019-06-01/storage"
|
||||
mgmtstorage "github.com/Azure/azure-sdk-for-go/services/storage/mgmt/2021-09-01/storage"
|
||||
"github.com/Azure/go-autorest/autorest/to"
|
||||
|
||||
"github.com/Azure/ARO-RP/pkg/util/arm"
|
||||
|
@ -23,15 +23,17 @@ var (
|
|||
|
||||
func (g *generator) oicStorageAccount() *arm.Resource {
|
||||
storageAccount := &mgmtstorage.Account{
|
||||
Kind: mgmtstorage.StorageV2,
|
||||
Kind: mgmtstorage.KindStorageV2,
|
||||
Sku: &mgmtstorage.Sku{
|
||||
Name: "Standard_LRS",
|
||||
},
|
||||
AccountProperties: &mgmtstorage.AccountProperties{
|
||||
AllowBlobPublicAccess: to.BoolPtr(true),
|
||||
AllowBlobPublicAccess: to.BoolPtr(false),
|
||||
EnableHTTPSTrafficOnly: to.BoolPtr(true),
|
||||
MinimumTLSVersion: mgmtstorage.TLS12,
|
||||
AccessTier: mgmtstorage.Hot,
|
||||
MinimumTLSVersion: mgmtstorage.MinimumTLSVersionTLS12,
|
||||
AccessTier: mgmtstorage.AccessTierHot,
|
||||
AllowSharedKeyAccess: to.BoolPtr(false),
|
||||
// Production has Public Network Access Disabled as OIDC Storage Account will be accessed via Azure Front Door
|
||||
},
|
||||
Name: to.StringPtr(fmt.Sprintf("[%s]", storageAccountName)),
|
||||
Location: to.StringPtr("[resourceGroup().location]"),
|
||||
|
|
|
@ -16,7 +16,7 @@ import (
|
|||
mgmtauthorization "github.com/Azure/azure-sdk-for-go/services/preview/authorization/mgmt/2018-09-01-preview/authorization"
|
||||
mgmtcontainerregistry "github.com/Azure/azure-sdk-for-go/services/preview/containerregistry/mgmt/2020-11-01-preview/containerregistry"
|
||||
mgmtinsights "github.com/Azure/azure-sdk-for-go/services/preview/monitor/mgmt/2018-03-01/insights"
|
||||
mgmtstorage "github.com/Azure/azure-sdk-for-go/services/storage/mgmt/2019-06-01/storage"
|
||||
mgmtstorage "github.com/Azure/azure-sdk-for-go/services/storage/mgmt/2021-09-01/storage"
|
||||
"github.com/Azure/go-autorest/autorest/to"
|
||||
|
||||
"github.com/Azure/ARO-RP/pkg/env"
|
||||
|
|
|
@ -9,7 +9,7 @@ import (
|
|||
"net/url"
|
||||
"time"
|
||||
|
||||
mgmtstorage "github.com/Azure/azure-sdk-for-go/services/storage/mgmt/2019-06-01/storage"
|
||||
mgmtstorage "github.com/Azure/azure-sdk-for-go/services/storage/mgmt/2021-09-01/storage"
|
||||
azstorage "github.com/Azure/azure-sdk-for-go/storage"
|
||||
"github.com/Azure/go-autorest/autorest/date"
|
||||
)
|
||||
|
@ -20,10 +20,10 @@ func (d *deployer) SaveVersion(ctx context.Context) error {
|
|||
t := time.Now().UTC().Truncate(time.Second)
|
||||
res, err := d.globalaccounts.ListAccountSAS(
|
||||
ctx, *d.config.Configuration.GlobalResourceGroupName, *d.config.Configuration.RPVersionStorageAccountName, mgmtstorage.AccountSasParameters{
|
||||
Services: mgmtstorage.B,
|
||||
Services: mgmtstorage.ServicesB,
|
||||
ResourceTypes: mgmtstorage.SignedResourceTypesO,
|
||||
Permissions: "cw", // create and write
|
||||
Protocols: mgmtstorage.HTTPS,
|
||||
Protocols: mgmtstorage.HTTPProtocolHTTPS,
|
||||
SharedAccessStartTime: &date.Time{Time: t},
|
||||
SharedAccessExpiryTime: &date.Time{Time: t.Add(24 * time.Hour)},
|
||||
})
|
||||
|
|
|
@ -13,7 +13,7 @@ import (
|
|||
"time"
|
||||
|
||||
mgmtcompute "github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2020-06-01/compute"
|
||||
mgmtstorage "github.com/Azure/azure-sdk-for-go/services/storage/mgmt/2019-06-01/storage"
|
||||
mgmtstorage "github.com/Azure/azure-sdk-for-go/services/storage/mgmt/2021-09-01/storage"
|
||||
azstorage "github.com/Azure/azure-sdk-for-go/storage"
|
||||
"github.com/Azure/go-autorest/autorest/date"
|
||||
"github.com/sirupsen/logrus"
|
||||
|
@ -46,10 +46,10 @@ func (a *azureActions) VMSerialConsole(ctx context.Context, w http.ResponseWrite
|
|||
t := time.Now().UTC().Truncate(time.Second)
|
||||
res, err := a.storageAccounts.ListAccountSAS(
|
||||
ctx, clusterRGName, "cluster"+a.oc.Properties.StorageSuffix, mgmtstorage.AccountSasParameters{
|
||||
Services: mgmtstorage.B,
|
||||
Services: mgmtstorage.ServicesB,
|
||||
ResourceTypes: mgmtstorage.SignedResourceTypesO,
|
||||
Permissions: mgmtstorage.R,
|
||||
Protocols: mgmtstorage.HTTPS,
|
||||
Permissions: mgmtstorage.PermissionsR,
|
||||
Protocols: mgmtstorage.HTTPProtocolHTTPS,
|
||||
SharedAccessStartTime: &date.Time{Time: t},
|
||||
SharedAccessExpiryTime: &date.Time{Time: t.Add(24 * time.Hour)},
|
||||
})
|
||||
|
|
|
@ -8,7 +8,7 @@ import (
|
|||
"fmt"
|
||||
"strings"
|
||||
|
||||
mgmtstorage "github.com/Azure/azure-sdk-for-go/services/storage/mgmt/2019-06-01/storage"
|
||||
mgmtstorage "github.com/Azure/azure-sdk-for-go/services/storage/mgmt/2021-09-01/storage"
|
||||
"github.com/Azure/go-autorest/autorest/to"
|
||||
imageregistryv1 "github.com/openshift/api/imageregistry/v1"
|
||||
"k8s.io/apimachinery/pkg/types"
|
||||
|
@ -102,7 +102,7 @@ func (r *reconcileManager) reconcileAccounts(ctx context.Context) error {
|
|||
if !found {
|
||||
*account.AccountProperties.NetworkRuleSet.VirtualNetworkRules = append(*account.AccountProperties.NetworkRuleSet.VirtualNetworkRules, mgmtstorage.VirtualNetworkRule{
|
||||
VirtualNetworkResourceID: to.StringPtr(subnet),
|
||||
Action: mgmtstorage.Allow,
|
||||
Action: mgmtstorage.ActionAllow,
|
||||
})
|
||||
changed = true
|
||||
}
|
||||
|
|
|
@ -10,7 +10,7 @@ import (
|
|||
"testing"
|
||||
|
||||
mgmtnetwork "github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-08-01/network"
|
||||
mgmtstorage "github.com/Azure/azure-sdk-for-go/services/storage/mgmt/2019-06-01/storage"
|
||||
mgmtstorage "github.com/Azure/azure-sdk-for-go/services/storage/mgmt/2021-09-01/storage"
|
||||
"github.com/Azure/go-autorest/autorest"
|
||||
"github.com/Azure/go-autorest/autorest/to"
|
||||
"github.com/golang/mock/gomock"
|
||||
|
@ -74,7 +74,7 @@ func getValidAccount(virtualNetworkResourceIDs []string) *mgmtstorage.Account {
|
|||
for _, rule := range virtualNetworkResourceIDs {
|
||||
*account.AccountProperties.NetworkRuleSet.VirtualNetworkRules = append(*account.AccountProperties.NetworkRuleSet.VirtualNetworkRules, mgmtstorage.VirtualNetworkRule{
|
||||
VirtualNetworkResourceID: to.StringPtr(rule),
|
||||
Action: mgmtstorage.Allow,
|
||||
Action: mgmtstorage.ActionAllow,
|
||||
})
|
||||
}
|
||||
return account
|
||||
|
|
|
@ -27,7 +27,7 @@ var apiVersions = map[string]string{
|
|||
"microsoft.network": "2020-08-01",
|
||||
"microsoft.network/dnszones": "2018-05-01",
|
||||
"microsoft.network/privatednszones": "2018-09-01",
|
||||
"microsoft.storage": "2019-06-01",
|
||||
"microsoft.storage": "2021-09-01",
|
||||
}
|
||||
|
||||
// APIVersion gets the APIVersion from a full resource type
|
||||
|
|
|
@ -6,7 +6,7 @@ package storage
|
|||
import (
|
||||
"context"
|
||||
|
||||
mgmtstorage "github.com/Azure/azure-sdk-for-go/services/storage/mgmt/2019-06-01/storage"
|
||||
mgmtstorage "github.com/Azure/azure-sdk-for-go/services/storage/mgmt/2021-09-01/storage"
|
||||
"github.com/Azure/go-autorest/autorest"
|
||||
|
||||
"github.com/Azure/ARO-RP/pkg/util/azureclient"
|
||||
|
|
|
@ -8,7 +8,7 @@ import (
|
|||
context "context"
|
||||
reflect "reflect"
|
||||
|
||||
storage "github.com/Azure/azure-sdk-for-go/services/storage/mgmt/2019-06-01/storage"
|
||||
storage "github.com/Azure/azure-sdk-for-go/services/storage/mgmt/2021-09-01/storage"
|
||||
gomock "github.com/golang/mock/gomock"
|
||||
)
|
||||
|
||||
|
|
|
@ -8,7 +8,7 @@ import (
|
|||
context "context"
|
||||
reflect "reflect"
|
||||
|
||||
storage "github.com/Azure/azure-sdk-for-go/services/storage/mgmt/2019-06-01/storage"
|
||||
storage "github.com/Azure/azure-sdk-for-go/services/storage/mgmt/2021-09-01/storage"
|
||||
storage0 "github.com/Azure/azure-sdk-for-go/storage"
|
||||
gomock "github.com/golang/mock/gomock"
|
||||
)
|
||||
|
|
|
@ -9,7 +9,7 @@ import (
|
|||
"net/url"
|
||||
"time"
|
||||
|
||||
mgmtstorage "github.com/Azure/azure-sdk-for-go/services/storage/mgmt/2019-06-01/storage"
|
||||
mgmtstorage "github.com/Azure/azure-sdk-for-go/services/storage/mgmt/2021-09-01/storage"
|
||||
azstorage "github.com/Azure/azure-sdk-for-go/storage"
|
||||
"github.com/Azure/go-autorest/autorest"
|
||||
"github.com/Azure/go-autorest/autorest/date"
|
||||
|
@ -62,10 +62,10 @@ func getCorrectErrWhenTooManyRequests(err error) error {
|
|||
func (m *manager) BlobService(ctx context.Context, resourceGroup, account string, p mgmtstorage.Permissions, r mgmtstorage.SignedResourceTypes) (*azstorage.BlobStorageClient, error) {
|
||||
t := time.Now().UTC().Truncate(time.Second)
|
||||
res, err := m.storageAccounts.ListAccountSAS(ctx, resourceGroup, account, mgmtstorage.AccountSasParameters{
|
||||
Services: mgmtstorage.B,
|
||||
Services: mgmtstorage.ServicesB,
|
||||
ResourceTypes: r,
|
||||
Permissions: p,
|
||||
Protocols: mgmtstorage.HTTPS,
|
||||
Protocols: mgmtstorage.HTTPProtocolHTTPS,
|
||||
SharedAccessStartTime: &date.Time{Time: t},
|
||||
SharedAccessExpiryTime: &date.Time{Time: t.Add(24 * time.Hour)},
|
||||
})
|
||||
|
|
|
@ -12,7 +12,7 @@ import (
|
|||
. "github.com/onsi/gomega"
|
||||
|
||||
mgmtnetwork "github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-08-01/network"
|
||||
"github.com/Azure/azure-sdk-for-go/services/storage/mgmt/2019-06-01/storage"
|
||||
"github.com/Azure/azure-sdk-for-go/services/storage/mgmt/2021-09-01/storage"
|
||||
"github.com/Azure/go-autorest/autorest/azure"
|
||||
"github.com/Azure/go-autorest/autorest/to"
|
||||
appsv1 "k8s.io/api/apps/v1"
|
||||
|
@ -156,7 +156,7 @@ var _ = Describe("Cluster", Serial, func() {
|
|||
g.Expect(account.NetworkRuleSet.VirtualNetworkRules).NotTo(BeNil())
|
||||
|
||||
for _, rule := range *account.NetworkRuleSet.VirtualNetworkRules {
|
||||
if rule.Action == storage.Allow && rule.VirtualNetworkResourceID != nil {
|
||||
if rule.Action == storage.ActionAllow && rule.VirtualNetworkResourceID != nil {
|
||||
nAclSubnets = append(nAclSubnets, strings.ToLower(*rule.VirtualNetworkResourceID))
|
||||
}
|
||||
}
|
||||
|
|
784
vendor/github.com/Azure/azure-sdk-for-go/services/storage/mgmt/2019-06-01/storage/enums.go
сгенерированный
поставляемый
784
vendor/github.com/Azure/azure-sdk-for-go/services/storage/mgmt/2019-06-01/storage/enums.go
сгенерированный
поставляемый
|
@ -1,784 +0,0 @@
|
|||
package storage
|
||||
|
||||
// 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.
|
||||
|
||||
// AccessTier enumerates the values for access tier.
|
||||
type AccessTier string
|
||||
|
||||
const (
|
||||
// Cool ...
|
||||
Cool AccessTier = "Cool"
|
||||
// Hot ...
|
||||
Hot AccessTier = "Hot"
|
||||
)
|
||||
|
||||
// PossibleAccessTierValues returns an array of possible values for the AccessTier const type.
|
||||
func PossibleAccessTierValues() []AccessTier {
|
||||
return []AccessTier{Cool, Hot}
|
||||
}
|
||||
|
||||
// AccountExpand enumerates the values for account expand.
|
||||
type AccountExpand string
|
||||
|
||||
const (
|
||||
// AccountExpandBlobRestoreStatus ...
|
||||
AccountExpandBlobRestoreStatus AccountExpand = "blobRestoreStatus"
|
||||
// AccountExpandGeoReplicationStats ...
|
||||
AccountExpandGeoReplicationStats AccountExpand = "geoReplicationStats"
|
||||
)
|
||||
|
||||
// PossibleAccountExpandValues returns an array of possible values for the AccountExpand const type.
|
||||
func PossibleAccountExpandValues() []AccountExpand {
|
||||
return []AccountExpand{AccountExpandBlobRestoreStatus, AccountExpandGeoReplicationStats}
|
||||
}
|
||||
|
||||
// AccountStatus enumerates the values for account status.
|
||||
type AccountStatus string
|
||||
|
||||
const (
|
||||
// Available ...
|
||||
Available AccountStatus = "available"
|
||||
// Unavailable ...
|
||||
Unavailable AccountStatus = "unavailable"
|
||||
)
|
||||
|
||||
// PossibleAccountStatusValues returns an array of possible values for the AccountStatus const type.
|
||||
func PossibleAccountStatusValues() []AccountStatus {
|
||||
return []AccountStatus{Available, Unavailable}
|
||||
}
|
||||
|
||||
// Action enumerates the values for action.
|
||||
type Action string
|
||||
|
||||
const (
|
||||
// Allow ...
|
||||
Allow Action = "Allow"
|
||||
)
|
||||
|
||||
// PossibleActionValues returns an array of possible values for the Action const type.
|
||||
func PossibleActionValues() []Action {
|
||||
return []Action{Allow}
|
||||
}
|
||||
|
||||
// Action1 enumerates the values for action 1.
|
||||
type Action1 string
|
||||
|
||||
const (
|
||||
// Acquire ...
|
||||
Acquire Action1 = "Acquire"
|
||||
// Break ...
|
||||
Break Action1 = "Break"
|
||||
// Change ...
|
||||
Change Action1 = "Change"
|
||||
// Release ...
|
||||
Release Action1 = "Release"
|
||||
// Renew ...
|
||||
Renew Action1 = "Renew"
|
||||
)
|
||||
|
||||
// PossibleAction1Values returns an array of possible values for the Action1 const type.
|
||||
func PossibleAction1Values() []Action1 {
|
||||
return []Action1{Acquire, Break, Change, Release, Renew}
|
||||
}
|
||||
|
||||
// BlobRestoreProgressStatus enumerates the values for blob restore progress status.
|
||||
type BlobRestoreProgressStatus string
|
||||
|
||||
const (
|
||||
// Complete ...
|
||||
Complete BlobRestoreProgressStatus = "Complete"
|
||||
// Failed ...
|
||||
Failed BlobRestoreProgressStatus = "Failed"
|
||||
// InProgress ...
|
||||
InProgress BlobRestoreProgressStatus = "InProgress"
|
||||
)
|
||||
|
||||
// PossibleBlobRestoreProgressStatusValues returns an array of possible values for the BlobRestoreProgressStatus const type.
|
||||
func PossibleBlobRestoreProgressStatusValues() []BlobRestoreProgressStatus {
|
||||
return []BlobRestoreProgressStatus{Complete, Failed, InProgress}
|
||||
}
|
||||
|
||||
// Bypass enumerates the values for bypass.
|
||||
type Bypass string
|
||||
|
||||
const (
|
||||
// AzureServices ...
|
||||
AzureServices Bypass = "AzureServices"
|
||||
// Logging ...
|
||||
Logging Bypass = "Logging"
|
||||
// Metrics ...
|
||||
Metrics Bypass = "Metrics"
|
||||
// None ...
|
||||
None Bypass = "None"
|
||||
)
|
||||
|
||||
// PossibleBypassValues returns an array of possible values for the Bypass const type.
|
||||
func PossibleBypassValues() []Bypass {
|
||||
return []Bypass{AzureServices, Logging, Metrics, None}
|
||||
}
|
||||
|
||||
// DefaultAction enumerates the values for default action.
|
||||
type DefaultAction string
|
||||
|
||||
const (
|
||||
// DefaultActionAllow ...
|
||||
DefaultActionAllow DefaultAction = "Allow"
|
||||
// DefaultActionDeny ...
|
||||
DefaultActionDeny DefaultAction = "Deny"
|
||||
)
|
||||
|
||||
// PossibleDefaultActionValues returns an array of possible values for the DefaultAction const type.
|
||||
func PossibleDefaultActionValues() []DefaultAction {
|
||||
return []DefaultAction{DefaultActionAllow, DefaultActionDeny}
|
||||
}
|
||||
|
||||
// DirectoryServiceOptions enumerates the values for directory service options.
|
||||
type DirectoryServiceOptions string
|
||||
|
||||
const (
|
||||
// DirectoryServiceOptionsAADDS ...
|
||||
DirectoryServiceOptionsAADDS DirectoryServiceOptions = "AADDS"
|
||||
// DirectoryServiceOptionsAD ...
|
||||
DirectoryServiceOptionsAD DirectoryServiceOptions = "AD"
|
||||
// DirectoryServiceOptionsNone ...
|
||||
DirectoryServiceOptionsNone DirectoryServiceOptions = "None"
|
||||
)
|
||||
|
||||
// PossibleDirectoryServiceOptionsValues returns an array of possible values for the DirectoryServiceOptions const type.
|
||||
func PossibleDirectoryServiceOptionsValues() []DirectoryServiceOptions {
|
||||
return []DirectoryServiceOptions{DirectoryServiceOptionsAADDS, DirectoryServiceOptionsAD, DirectoryServiceOptionsNone}
|
||||
}
|
||||
|
||||
// EnabledProtocols enumerates the values for enabled protocols.
|
||||
type EnabledProtocols string
|
||||
|
||||
const (
|
||||
// NFS ...
|
||||
NFS EnabledProtocols = "NFS"
|
||||
// SMB ...
|
||||
SMB EnabledProtocols = "SMB"
|
||||
)
|
||||
|
||||
// PossibleEnabledProtocolsValues returns an array of possible values for the EnabledProtocols const type.
|
||||
func PossibleEnabledProtocolsValues() []EnabledProtocols {
|
||||
return []EnabledProtocols{NFS, SMB}
|
||||
}
|
||||
|
||||
// EncryptionScopeSource enumerates the values for encryption scope source.
|
||||
type EncryptionScopeSource string
|
||||
|
||||
const (
|
||||
// MicrosoftKeyVault ...
|
||||
MicrosoftKeyVault EncryptionScopeSource = "Microsoft.KeyVault"
|
||||
// MicrosoftStorage ...
|
||||
MicrosoftStorage EncryptionScopeSource = "Microsoft.Storage"
|
||||
)
|
||||
|
||||
// PossibleEncryptionScopeSourceValues returns an array of possible values for the EncryptionScopeSource const type.
|
||||
func PossibleEncryptionScopeSourceValues() []EncryptionScopeSource {
|
||||
return []EncryptionScopeSource{MicrosoftKeyVault, MicrosoftStorage}
|
||||
}
|
||||
|
||||
// EncryptionScopeState enumerates the values for encryption scope state.
|
||||
type EncryptionScopeState string
|
||||
|
||||
const (
|
||||
// Disabled ...
|
||||
Disabled EncryptionScopeState = "Disabled"
|
||||
// Enabled ...
|
||||
Enabled EncryptionScopeState = "Enabled"
|
||||
)
|
||||
|
||||
// PossibleEncryptionScopeStateValues returns an array of possible values for the EncryptionScopeState const type.
|
||||
func PossibleEncryptionScopeStateValues() []EncryptionScopeState {
|
||||
return []EncryptionScopeState{Disabled, Enabled}
|
||||
}
|
||||
|
||||
// GeoReplicationStatus enumerates the values for geo replication status.
|
||||
type GeoReplicationStatus string
|
||||
|
||||
const (
|
||||
// GeoReplicationStatusBootstrap ...
|
||||
GeoReplicationStatusBootstrap GeoReplicationStatus = "Bootstrap"
|
||||
// GeoReplicationStatusLive ...
|
||||
GeoReplicationStatusLive GeoReplicationStatus = "Live"
|
||||
// GeoReplicationStatusUnavailable ...
|
||||
GeoReplicationStatusUnavailable GeoReplicationStatus = "Unavailable"
|
||||
)
|
||||
|
||||
// PossibleGeoReplicationStatusValues returns an array of possible values for the GeoReplicationStatus const type.
|
||||
func PossibleGeoReplicationStatusValues() []GeoReplicationStatus {
|
||||
return []GeoReplicationStatus{GeoReplicationStatusBootstrap, GeoReplicationStatusLive, GeoReplicationStatusUnavailable}
|
||||
}
|
||||
|
||||
// GetShareExpand enumerates the values for get share expand.
|
||||
type GetShareExpand string
|
||||
|
||||
const (
|
||||
// Stats ...
|
||||
Stats GetShareExpand = "stats"
|
||||
)
|
||||
|
||||
// PossibleGetShareExpandValues returns an array of possible values for the GetShareExpand const type.
|
||||
func PossibleGetShareExpandValues() []GetShareExpand {
|
||||
return []GetShareExpand{Stats}
|
||||
}
|
||||
|
||||
// HTTPProtocol enumerates the values for http protocol.
|
||||
type HTTPProtocol string
|
||||
|
||||
const (
|
||||
// HTTPS ...
|
||||
HTTPS HTTPProtocol = "https"
|
||||
// Httpshttp ...
|
||||
Httpshttp HTTPProtocol = "https,http"
|
||||
)
|
||||
|
||||
// PossibleHTTPProtocolValues returns an array of possible values for the HTTPProtocol const type.
|
||||
func PossibleHTTPProtocolValues() []HTTPProtocol {
|
||||
return []HTTPProtocol{HTTPS, Httpshttp}
|
||||
}
|
||||
|
||||
// ImmutabilityPolicyState enumerates the values for immutability policy state.
|
||||
type ImmutabilityPolicyState string
|
||||
|
||||
const (
|
||||
// Locked ...
|
||||
Locked ImmutabilityPolicyState = "Locked"
|
||||
// Unlocked ...
|
||||
Unlocked ImmutabilityPolicyState = "Unlocked"
|
||||
)
|
||||
|
||||
// PossibleImmutabilityPolicyStateValues returns an array of possible values for the ImmutabilityPolicyState const type.
|
||||
func PossibleImmutabilityPolicyStateValues() []ImmutabilityPolicyState {
|
||||
return []ImmutabilityPolicyState{Locked, Unlocked}
|
||||
}
|
||||
|
||||
// ImmutabilityPolicyUpdateType enumerates the values for immutability policy update type.
|
||||
type ImmutabilityPolicyUpdateType string
|
||||
|
||||
const (
|
||||
// Extend ...
|
||||
Extend ImmutabilityPolicyUpdateType = "extend"
|
||||
// Lock ...
|
||||
Lock ImmutabilityPolicyUpdateType = "lock"
|
||||
// Put ...
|
||||
Put ImmutabilityPolicyUpdateType = "put"
|
||||
)
|
||||
|
||||
// PossibleImmutabilityPolicyUpdateTypeValues returns an array of possible values for the ImmutabilityPolicyUpdateType const type.
|
||||
func PossibleImmutabilityPolicyUpdateTypeValues() []ImmutabilityPolicyUpdateType {
|
||||
return []ImmutabilityPolicyUpdateType{Extend, Lock, Put}
|
||||
}
|
||||
|
||||
// KeyPermission enumerates the values for key permission.
|
||||
type KeyPermission string
|
||||
|
||||
const (
|
||||
// Full ...
|
||||
Full KeyPermission = "Full"
|
||||
// Read ...
|
||||
Read KeyPermission = "Read"
|
||||
)
|
||||
|
||||
// PossibleKeyPermissionValues returns an array of possible values for the KeyPermission const type.
|
||||
func PossibleKeyPermissionValues() []KeyPermission {
|
||||
return []KeyPermission{Full, Read}
|
||||
}
|
||||
|
||||
// KeySource enumerates the values for key source.
|
||||
type KeySource string
|
||||
|
||||
const (
|
||||
// KeySourceMicrosoftKeyvault ...
|
||||
KeySourceMicrosoftKeyvault KeySource = "Microsoft.Keyvault"
|
||||
// KeySourceMicrosoftStorage ...
|
||||
KeySourceMicrosoftStorage KeySource = "Microsoft.Storage"
|
||||
)
|
||||
|
||||
// PossibleKeySourceValues returns an array of possible values for the KeySource const type.
|
||||
func PossibleKeySourceValues() []KeySource {
|
||||
return []KeySource{KeySourceMicrosoftKeyvault, KeySourceMicrosoftStorage}
|
||||
}
|
||||
|
||||
// KeyType enumerates the values for key type.
|
||||
type KeyType string
|
||||
|
||||
const (
|
||||
// KeyTypeAccount ...
|
||||
KeyTypeAccount KeyType = "Account"
|
||||
// KeyTypeService ...
|
||||
KeyTypeService KeyType = "Service"
|
||||
)
|
||||
|
||||
// PossibleKeyTypeValues returns an array of possible values for the KeyType const type.
|
||||
func PossibleKeyTypeValues() []KeyType {
|
||||
return []KeyType{KeyTypeAccount, KeyTypeService}
|
||||
}
|
||||
|
||||
// Kind enumerates the values for kind.
|
||||
type Kind string
|
||||
|
||||
const (
|
||||
// BlobStorage ...
|
||||
BlobStorage Kind = "BlobStorage"
|
||||
// BlockBlobStorage ...
|
||||
BlockBlobStorage Kind = "BlockBlobStorage"
|
||||
// FileStorage ...
|
||||
FileStorage Kind = "FileStorage"
|
||||
// Storage ...
|
||||
Storage Kind = "Storage"
|
||||
// StorageV2 ...
|
||||
StorageV2 Kind = "StorageV2"
|
||||
)
|
||||
|
||||
// PossibleKindValues returns an array of possible values for the Kind const type.
|
||||
func PossibleKindValues() []Kind {
|
||||
return []Kind{BlobStorage, BlockBlobStorage, FileStorage, Storage, StorageV2}
|
||||
}
|
||||
|
||||
// LargeFileSharesState enumerates the values for large file shares state.
|
||||
type LargeFileSharesState string
|
||||
|
||||
const (
|
||||
// LargeFileSharesStateDisabled ...
|
||||
LargeFileSharesStateDisabled LargeFileSharesState = "Disabled"
|
||||
// LargeFileSharesStateEnabled ...
|
||||
LargeFileSharesStateEnabled LargeFileSharesState = "Enabled"
|
||||
)
|
||||
|
||||
// PossibleLargeFileSharesStateValues returns an array of possible values for the LargeFileSharesState const type.
|
||||
func PossibleLargeFileSharesStateValues() []LargeFileSharesState {
|
||||
return []LargeFileSharesState{LargeFileSharesStateDisabled, LargeFileSharesStateEnabled}
|
||||
}
|
||||
|
||||
// LeaseDuration enumerates the values for lease duration.
|
||||
type LeaseDuration string
|
||||
|
||||
const (
|
||||
// Fixed ...
|
||||
Fixed LeaseDuration = "Fixed"
|
||||
// Infinite ...
|
||||
Infinite LeaseDuration = "Infinite"
|
||||
)
|
||||
|
||||
// PossibleLeaseDurationValues returns an array of possible values for the LeaseDuration const type.
|
||||
func PossibleLeaseDurationValues() []LeaseDuration {
|
||||
return []LeaseDuration{Fixed, Infinite}
|
||||
}
|
||||
|
||||
// LeaseState enumerates the values for lease state.
|
||||
type LeaseState string
|
||||
|
||||
const (
|
||||
// LeaseStateAvailable ...
|
||||
LeaseStateAvailable LeaseState = "Available"
|
||||
// LeaseStateBreaking ...
|
||||
LeaseStateBreaking LeaseState = "Breaking"
|
||||
// LeaseStateBroken ...
|
||||
LeaseStateBroken LeaseState = "Broken"
|
||||
// LeaseStateExpired ...
|
||||
LeaseStateExpired LeaseState = "Expired"
|
||||
// LeaseStateLeased ...
|
||||
LeaseStateLeased LeaseState = "Leased"
|
||||
)
|
||||
|
||||
// PossibleLeaseStateValues returns an array of possible values for the LeaseState const type.
|
||||
func PossibleLeaseStateValues() []LeaseState {
|
||||
return []LeaseState{LeaseStateAvailable, LeaseStateBreaking, LeaseStateBroken, LeaseStateExpired, LeaseStateLeased}
|
||||
}
|
||||
|
||||
// LeaseStatus enumerates the values for lease status.
|
||||
type LeaseStatus string
|
||||
|
||||
const (
|
||||
// LeaseStatusLocked ...
|
||||
LeaseStatusLocked LeaseStatus = "Locked"
|
||||
// LeaseStatusUnlocked ...
|
||||
LeaseStatusUnlocked LeaseStatus = "Unlocked"
|
||||
)
|
||||
|
||||
// PossibleLeaseStatusValues returns an array of possible values for the LeaseStatus const type.
|
||||
func PossibleLeaseStatusValues() []LeaseStatus {
|
||||
return []LeaseStatus{LeaseStatusLocked, LeaseStatusUnlocked}
|
||||
}
|
||||
|
||||
// ListContainersInclude enumerates the values for list containers include.
|
||||
type ListContainersInclude string
|
||||
|
||||
const (
|
||||
// Deleted ...
|
||||
Deleted ListContainersInclude = "deleted"
|
||||
)
|
||||
|
||||
// PossibleListContainersIncludeValues returns an array of possible values for the ListContainersInclude const type.
|
||||
func PossibleListContainersIncludeValues() []ListContainersInclude {
|
||||
return []ListContainersInclude{Deleted}
|
||||
}
|
||||
|
||||
// ListKeyExpand enumerates the values for list key expand.
|
||||
type ListKeyExpand string
|
||||
|
||||
const (
|
||||
// Kerb ...
|
||||
Kerb ListKeyExpand = "kerb"
|
||||
)
|
||||
|
||||
// PossibleListKeyExpandValues returns an array of possible values for the ListKeyExpand const type.
|
||||
func PossibleListKeyExpandValues() []ListKeyExpand {
|
||||
return []ListKeyExpand{Kerb}
|
||||
}
|
||||
|
||||
// ListSharesExpand enumerates the values for list shares expand.
|
||||
type ListSharesExpand string
|
||||
|
||||
const (
|
||||
// ListSharesExpandDeleted ...
|
||||
ListSharesExpandDeleted ListSharesExpand = "deleted"
|
||||
)
|
||||
|
||||
// PossibleListSharesExpandValues returns an array of possible values for the ListSharesExpand const type.
|
||||
func PossibleListSharesExpandValues() []ListSharesExpand {
|
||||
return []ListSharesExpand{ListSharesExpandDeleted}
|
||||
}
|
||||
|
||||
// MinimumTLSVersion enumerates the values for minimum tls version.
|
||||
type MinimumTLSVersion string
|
||||
|
||||
const (
|
||||
// TLS10 ...
|
||||
TLS10 MinimumTLSVersion = "TLS1_0"
|
||||
// TLS11 ...
|
||||
TLS11 MinimumTLSVersion = "TLS1_1"
|
||||
// TLS12 ...
|
||||
TLS12 MinimumTLSVersion = "TLS1_2"
|
||||
)
|
||||
|
||||
// PossibleMinimumTLSVersionValues returns an array of possible values for the MinimumTLSVersion const type.
|
||||
func PossibleMinimumTLSVersionValues() []MinimumTLSVersion {
|
||||
return []MinimumTLSVersion{TLS10, TLS11, TLS12}
|
||||
}
|
||||
|
||||
// Permissions enumerates the values for permissions.
|
||||
type Permissions string
|
||||
|
||||
const (
|
||||
// A ...
|
||||
A Permissions = "a"
|
||||
// C ...
|
||||
C Permissions = "c"
|
||||
// D ...
|
||||
D Permissions = "d"
|
||||
// L ...
|
||||
L Permissions = "l"
|
||||
// P ...
|
||||
P Permissions = "p"
|
||||
// R ...
|
||||
R Permissions = "r"
|
||||
// U ...
|
||||
U Permissions = "u"
|
||||
// W ...
|
||||
W Permissions = "w"
|
||||
)
|
||||
|
||||
// PossiblePermissionsValues returns an array of possible values for the Permissions const type.
|
||||
func PossiblePermissionsValues() []Permissions {
|
||||
return []Permissions{A, C, D, L, P, R, U, W}
|
||||
}
|
||||
|
||||
// PrivateEndpointConnectionProvisioningState enumerates the values for private endpoint connection
|
||||
// provisioning state.
|
||||
type PrivateEndpointConnectionProvisioningState string
|
||||
|
||||
const (
|
||||
// PrivateEndpointConnectionProvisioningStateCreating ...
|
||||
PrivateEndpointConnectionProvisioningStateCreating PrivateEndpointConnectionProvisioningState = "Creating"
|
||||
// PrivateEndpointConnectionProvisioningStateDeleting ...
|
||||
PrivateEndpointConnectionProvisioningStateDeleting PrivateEndpointConnectionProvisioningState = "Deleting"
|
||||
// PrivateEndpointConnectionProvisioningStateFailed ...
|
||||
PrivateEndpointConnectionProvisioningStateFailed PrivateEndpointConnectionProvisioningState = "Failed"
|
||||
// PrivateEndpointConnectionProvisioningStateSucceeded ...
|
||||
PrivateEndpointConnectionProvisioningStateSucceeded PrivateEndpointConnectionProvisioningState = "Succeeded"
|
||||
)
|
||||
|
||||
// PossiblePrivateEndpointConnectionProvisioningStateValues returns an array of possible values for the PrivateEndpointConnectionProvisioningState const type.
|
||||
func PossiblePrivateEndpointConnectionProvisioningStateValues() []PrivateEndpointConnectionProvisioningState {
|
||||
return []PrivateEndpointConnectionProvisioningState{PrivateEndpointConnectionProvisioningStateCreating, PrivateEndpointConnectionProvisioningStateDeleting, PrivateEndpointConnectionProvisioningStateFailed, PrivateEndpointConnectionProvisioningStateSucceeded}
|
||||
}
|
||||
|
||||
// PrivateEndpointServiceConnectionStatus enumerates the values for private endpoint service connection status.
|
||||
type PrivateEndpointServiceConnectionStatus string
|
||||
|
||||
const (
|
||||
// Approved ...
|
||||
Approved PrivateEndpointServiceConnectionStatus = "Approved"
|
||||
// Pending ...
|
||||
Pending PrivateEndpointServiceConnectionStatus = "Pending"
|
||||
// Rejected ...
|
||||
Rejected PrivateEndpointServiceConnectionStatus = "Rejected"
|
||||
)
|
||||
|
||||
// PossiblePrivateEndpointServiceConnectionStatusValues returns an array of possible values for the PrivateEndpointServiceConnectionStatus const type.
|
||||
func PossiblePrivateEndpointServiceConnectionStatusValues() []PrivateEndpointServiceConnectionStatus {
|
||||
return []PrivateEndpointServiceConnectionStatus{Approved, Pending, Rejected}
|
||||
}
|
||||
|
||||
// ProvisioningState enumerates the values for provisioning state.
|
||||
type ProvisioningState string
|
||||
|
||||
const (
|
||||
// Creating ...
|
||||
Creating ProvisioningState = "Creating"
|
||||
// ResolvingDNS ...
|
||||
ResolvingDNS ProvisioningState = "ResolvingDNS"
|
||||
// Succeeded ...
|
||||
Succeeded ProvisioningState = "Succeeded"
|
||||
)
|
||||
|
||||
// PossibleProvisioningStateValues returns an array of possible values for the ProvisioningState const type.
|
||||
func PossibleProvisioningStateValues() []ProvisioningState {
|
||||
return []ProvisioningState{Creating, ResolvingDNS, Succeeded}
|
||||
}
|
||||
|
||||
// PublicAccess enumerates the values for public access.
|
||||
type PublicAccess string
|
||||
|
||||
const (
|
||||
// PublicAccessBlob ...
|
||||
PublicAccessBlob PublicAccess = "Blob"
|
||||
// PublicAccessContainer ...
|
||||
PublicAccessContainer PublicAccess = "Container"
|
||||
// PublicAccessNone ...
|
||||
PublicAccessNone PublicAccess = "None"
|
||||
)
|
||||
|
||||
// PossiblePublicAccessValues returns an array of possible values for the PublicAccess const type.
|
||||
func PossiblePublicAccessValues() []PublicAccess {
|
||||
return []PublicAccess{PublicAccessBlob, PublicAccessContainer, PublicAccessNone}
|
||||
}
|
||||
|
||||
// Reason enumerates the values for reason.
|
||||
type Reason string
|
||||
|
||||
const (
|
||||
// AccountNameInvalid ...
|
||||
AccountNameInvalid Reason = "AccountNameInvalid"
|
||||
// AlreadyExists ...
|
||||
AlreadyExists Reason = "AlreadyExists"
|
||||
)
|
||||
|
||||
// PossibleReasonValues returns an array of possible values for the Reason const type.
|
||||
func PossibleReasonValues() []Reason {
|
||||
return []Reason{AccountNameInvalid, AlreadyExists}
|
||||
}
|
||||
|
||||
// ReasonCode enumerates the values for reason code.
|
||||
type ReasonCode string
|
||||
|
||||
const (
|
||||
// NotAvailableForSubscription ...
|
||||
NotAvailableForSubscription ReasonCode = "NotAvailableForSubscription"
|
||||
// QuotaID ...
|
||||
QuotaID ReasonCode = "QuotaId"
|
||||
)
|
||||
|
||||
// PossibleReasonCodeValues returns an array of possible values for the ReasonCode const type.
|
||||
func PossibleReasonCodeValues() []ReasonCode {
|
||||
return []ReasonCode{NotAvailableForSubscription, QuotaID}
|
||||
}
|
||||
|
||||
// RootSquashType enumerates the values for root squash type.
|
||||
type RootSquashType string
|
||||
|
||||
const (
|
||||
// AllSquash ...
|
||||
AllSquash RootSquashType = "AllSquash"
|
||||
// NoRootSquash ...
|
||||
NoRootSquash RootSquashType = "NoRootSquash"
|
||||
// RootSquash ...
|
||||
RootSquash RootSquashType = "RootSquash"
|
||||
)
|
||||
|
||||
// PossibleRootSquashTypeValues returns an array of possible values for the RootSquashType const type.
|
||||
func PossibleRootSquashTypeValues() []RootSquashType {
|
||||
return []RootSquashType{AllSquash, NoRootSquash, RootSquash}
|
||||
}
|
||||
|
||||
// RoutingChoice enumerates the values for routing choice.
|
||||
type RoutingChoice string
|
||||
|
||||
const (
|
||||
// InternetRouting ...
|
||||
InternetRouting RoutingChoice = "InternetRouting"
|
||||
// MicrosoftRouting ...
|
||||
MicrosoftRouting RoutingChoice = "MicrosoftRouting"
|
||||
)
|
||||
|
||||
// PossibleRoutingChoiceValues returns an array of possible values for the RoutingChoice const type.
|
||||
func PossibleRoutingChoiceValues() []RoutingChoice {
|
||||
return []RoutingChoice{InternetRouting, MicrosoftRouting}
|
||||
}
|
||||
|
||||
// Services enumerates the values for services.
|
||||
type Services string
|
||||
|
||||
const (
|
||||
// B ...
|
||||
B Services = "b"
|
||||
// F ...
|
||||
F Services = "f"
|
||||
// Q ...
|
||||
Q Services = "q"
|
||||
// T ...
|
||||
T Services = "t"
|
||||
)
|
||||
|
||||
// PossibleServicesValues returns an array of possible values for the Services const type.
|
||||
func PossibleServicesValues() []Services {
|
||||
return []Services{B, F, Q, T}
|
||||
}
|
||||
|
||||
// ShareAccessTier enumerates the values for share access tier.
|
||||
type ShareAccessTier string
|
||||
|
||||
const (
|
||||
// ShareAccessTierCool ...
|
||||
ShareAccessTierCool ShareAccessTier = "Cool"
|
||||
// ShareAccessTierHot ...
|
||||
ShareAccessTierHot ShareAccessTier = "Hot"
|
||||
// ShareAccessTierPremium ...
|
||||
ShareAccessTierPremium ShareAccessTier = "Premium"
|
||||
// ShareAccessTierTransactionOptimized ...
|
||||
ShareAccessTierTransactionOptimized ShareAccessTier = "TransactionOptimized"
|
||||
)
|
||||
|
||||
// PossibleShareAccessTierValues returns an array of possible values for the ShareAccessTier const type.
|
||||
func PossibleShareAccessTierValues() []ShareAccessTier {
|
||||
return []ShareAccessTier{ShareAccessTierCool, ShareAccessTierHot, ShareAccessTierPremium, ShareAccessTierTransactionOptimized}
|
||||
}
|
||||
|
||||
// SignedResource enumerates the values for signed resource.
|
||||
type SignedResource string
|
||||
|
||||
const (
|
||||
// SignedResourceB ...
|
||||
SignedResourceB SignedResource = "b"
|
||||
// SignedResourceC ...
|
||||
SignedResourceC SignedResource = "c"
|
||||
// SignedResourceF ...
|
||||
SignedResourceF SignedResource = "f"
|
||||
// SignedResourceS ...
|
||||
SignedResourceS SignedResource = "s"
|
||||
)
|
||||
|
||||
// PossibleSignedResourceValues returns an array of possible values for the SignedResource const type.
|
||||
func PossibleSignedResourceValues() []SignedResource {
|
||||
return []SignedResource{SignedResourceB, SignedResourceC, SignedResourceF, SignedResourceS}
|
||||
}
|
||||
|
||||
// SignedResourceTypes enumerates the values for signed resource types.
|
||||
type SignedResourceTypes string
|
||||
|
||||
const (
|
||||
// SignedResourceTypesC ...
|
||||
SignedResourceTypesC SignedResourceTypes = "c"
|
||||
// SignedResourceTypesO ...
|
||||
SignedResourceTypesO SignedResourceTypes = "o"
|
||||
// SignedResourceTypesS ...
|
||||
SignedResourceTypesS SignedResourceTypes = "s"
|
||||
)
|
||||
|
||||
// PossibleSignedResourceTypesValues returns an array of possible values for the SignedResourceTypes const type.
|
||||
func PossibleSignedResourceTypesValues() []SignedResourceTypes {
|
||||
return []SignedResourceTypes{SignedResourceTypesC, SignedResourceTypesO, SignedResourceTypesS}
|
||||
}
|
||||
|
||||
// SkuName enumerates the values for sku name.
|
||||
type SkuName string
|
||||
|
||||
const (
|
||||
// PremiumLRS ...
|
||||
PremiumLRS SkuName = "Premium_LRS"
|
||||
// PremiumZRS ...
|
||||
PremiumZRS SkuName = "Premium_ZRS"
|
||||
// StandardGRS ...
|
||||
StandardGRS SkuName = "Standard_GRS"
|
||||
// StandardGZRS ...
|
||||
StandardGZRS SkuName = "Standard_GZRS"
|
||||
// StandardLRS ...
|
||||
StandardLRS SkuName = "Standard_LRS"
|
||||
// StandardRAGRS ...
|
||||
StandardRAGRS SkuName = "Standard_RAGRS"
|
||||
// StandardRAGZRS ...
|
||||
StandardRAGZRS SkuName = "Standard_RAGZRS"
|
||||
// StandardZRS ...
|
||||
StandardZRS SkuName = "Standard_ZRS"
|
||||
)
|
||||
|
||||
// PossibleSkuNameValues returns an array of possible values for the SkuName const type.
|
||||
func PossibleSkuNameValues() []SkuName {
|
||||
return []SkuName{PremiumLRS, PremiumZRS, StandardGRS, StandardGZRS, StandardLRS, StandardRAGRS, StandardRAGZRS, StandardZRS}
|
||||
}
|
||||
|
||||
// SkuTier enumerates the values for sku tier.
|
||||
type SkuTier string
|
||||
|
||||
const (
|
||||
// Premium ...
|
||||
Premium SkuTier = "Premium"
|
||||
// Standard ...
|
||||
Standard SkuTier = "Standard"
|
||||
)
|
||||
|
||||
// PossibleSkuTierValues returns an array of possible values for the SkuTier const type.
|
||||
func PossibleSkuTierValues() []SkuTier {
|
||||
return []SkuTier{Premium, Standard}
|
||||
}
|
||||
|
||||
// State enumerates the values for state.
|
||||
type State string
|
||||
|
||||
const (
|
||||
// StateDeprovisioning ...
|
||||
StateDeprovisioning State = "deprovisioning"
|
||||
// StateFailed ...
|
||||
StateFailed State = "failed"
|
||||
// StateNetworkSourceDeleted ...
|
||||
StateNetworkSourceDeleted State = "networkSourceDeleted"
|
||||
// StateProvisioning ...
|
||||
StateProvisioning State = "provisioning"
|
||||
// StateSucceeded ...
|
||||
StateSucceeded State = "succeeded"
|
||||
)
|
||||
|
||||
// PossibleStateValues returns an array of possible values for the State const type.
|
||||
func PossibleStateValues() []State {
|
||||
return []State{StateDeprovisioning, StateFailed, StateNetworkSourceDeleted, StateProvisioning, StateSucceeded}
|
||||
}
|
||||
|
||||
// UsageUnit enumerates the values for usage unit.
|
||||
type UsageUnit string
|
||||
|
||||
const (
|
||||
// Bytes ...
|
||||
Bytes UsageUnit = "Bytes"
|
||||
// BytesPerSecond ...
|
||||
BytesPerSecond UsageUnit = "BytesPerSecond"
|
||||
// Count ...
|
||||
Count UsageUnit = "Count"
|
||||
// CountsPerSecond ...
|
||||
CountsPerSecond UsageUnit = "CountsPerSecond"
|
||||
// Percent ...
|
||||
Percent UsageUnit = "Percent"
|
||||
// Seconds ...
|
||||
Seconds UsageUnit = "Seconds"
|
||||
)
|
||||
|
||||
// PossibleUsageUnitValues returns an array of possible values for the UsageUnit const type.
|
||||
func PossibleUsageUnitValues() []UsageUnit {
|
||||
return []UsageUnit{Bytes, BytesPerSecond, Count, CountsPerSecond, Percent, Seconds}
|
||||
}
|
|
@ -1,11 +1,11 @@
|
|||
{
|
||||
"commit": "3c764635e7d442b3e74caf593029fcd440b3ef82",
|
||||
"commit": "a1a224b54f05debfa94fd19477ed820c64f0f9fc",
|
||||
"readme": "/_/azure-rest-api-specs/specification/storage/resource-manager/readme.md",
|
||||
"tag": "package-2019-06",
|
||||
"tag": "package-2021-09",
|
||||
"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-2019-06 --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/storage/resource-manager/readme.md",
|
||||
"autorest_command": "autorest --use=@microsoft.azure/autorest.go@2.1.187 --tag=package-2021-09 --go-sdk-folder=/_/azure-sdk-for-go --go --verbose --use-onever --version=2.0.4421 --go.license-header=MICROSOFT_MIT_NO_VERSION --enum-prefix /_/azure-rest-api-specs/specification/storage/resource-manager/readme.md",
|
||||
"additional_properties": {
|
||||
"additional_options": "--go --verbose --use-onever --version=2.0.4421 --go.license-header=MICROSOFT_MIT_NO_VERSION"
|
||||
"additional_options": "--go --verbose --use-onever --version=2.0.4421 --go.license-header=MICROSOFT_MIT_NO_VERSION --enum-prefix"
|
||||
}
|
||||
}
|
|
@ -31,6 +31,99 @@ func NewAccountsClientWithBaseURI(baseURI string, subscriptionID string) Account
|
|||
return AccountsClient{NewWithBaseURI(baseURI, subscriptionID)}
|
||||
}
|
||||
|
||||
// AbortHierarchicalNamespaceMigration abort live Migration of storage account to enable Hns
|
||||
// Parameters:
|
||||
// resourceGroupName - the name of the resource group within the user's subscription. The name is case
|
||||
// insensitive.
|
||||
// accountName - the name of the storage account within the specified resource group. Storage account names
|
||||
// must be between 3 and 24 characters in length and use numbers and lower-case letters only.
|
||||
func (client AccountsClient) AbortHierarchicalNamespaceMigration(ctx context.Context, resourceGroupName string, accountName string) (result AccountsAbortHierarchicalNamespaceMigrationFuture, err error) {
|
||||
if tracing.IsEnabled() {
|
||||
ctx = tracing.StartSpan(ctx, fqdn+"/AccountsClient.AbortHierarchicalNamespaceMigration")
|
||||
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: accountName,
|
||||
Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 24, Chain: nil},
|
||||
{Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}}},
|
||||
{TargetValue: client.SubscriptionID,
|
||||
Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}}); err != nil {
|
||||
return result, validation.NewError("storage.AccountsClient", "AbortHierarchicalNamespaceMigration", err.Error())
|
||||
}
|
||||
|
||||
req, err := client.AbortHierarchicalNamespaceMigrationPreparer(ctx, resourceGroupName, accountName)
|
||||
if err != nil {
|
||||
err = autorest.NewErrorWithError(err, "storage.AccountsClient", "AbortHierarchicalNamespaceMigration", nil, "Failure preparing request")
|
||||
return
|
||||
}
|
||||
|
||||
result, err = client.AbortHierarchicalNamespaceMigrationSender(req)
|
||||
if err != nil {
|
||||
err = autorest.NewErrorWithError(err, "storage.AccountsClient", "AbortHierarchicalNamespaceMigration", result.Response(), "Failure sending request")
|
||||
return
|
||||
}
|
||||
|
||||
return
|
||||
}
|
||||
|
||||
// AbortHierarchicalNamespaceMigrationPreparer prepares the AbortHierarchicalNamespaceMigration request.
|
||||
func (client AccountsClient) AbortHierarchicalNamespaceMigrationPreparer(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-09-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.Storage/storageAccounts/{accountName}/aborthnsonmigration", pathParameters),
|
||||
autorest.WithQueryParameters(queryParameters))
|
||||
return preparer.Prepare((&http.Request{}).WithContext(ctx))
|
||||
}
|
||||
|
||||
// AbortHierarchicalNamespaceMigrationSender sends the AbortHierarchicalNamespaceMigration request. The method will close the
|
||||
// http.Response Body if it receives an error.
|
||||
func (client AccountsClient) AbortHierarchicalNamespaceMigrationSender(req *http.Request) (future AccountsAbortHierarchicalNamespaceMigrationFuture, 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
|
||||
}
|
||||
|
||||
// AbortHierarchicalNamespaceMigrationResponder handles the response to the AbortHierarchicalNamespaceMigration request. The method always
|
||||
// closes the http.Response Body.
|
||||
func (client AccountsClient) AbortHierarchicalNamespaceMigrationResponder(resp *http.Response) (result autorest.Response, err error) {
|
||||
err = autorest.Respond(
|
||||
resp,
|
||||
azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted),
|
||||
autorest.ByClosing())
|
||||
result.Response = resp
|
||||
return
|
||||
}
|
||||
|
||||
// CheckNameAvailability checks that the storage account name is valid and is not already in use.
|
||||
// Parameters:
|
||||
// accountName - the name of the storage account within the specified resource group. Storage account names
|
||||
|
@ -83,7 +176,7 @@ func (client AccountsClient) CheckNameAvailabilityPreparer(ctx context.Context,
|
|||
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
|
||||
}
|
||||
|
||||
const APIVersion = "2019-06-01"
|
||||
const APIVersion = "2021-09-01"
|
||||
queryParameters := map[string]interface{}{
|
||||
"api-version": APIVersion,
|
||||
}
|
||||
|
@ -148,11 +241,15 @@ func (client AccountsClient) Create(ctx context.Context, resourceGroupName strin
|
|||
{TargetValue: parameters,
|
||||
Constraints: []validation.Constraint{{Target: "parameters.Sku", Name: validation.Null, Rule: true, Chain: nil},
|
||||
{Target: "parameters.Location", Name: validation.Null, Rule: true, Chain: nil},
|
||||
{Target: "parameters.Identity", Name: validation.Null, Rule: false,
|
||||
Chain: []validation.Constraint{{Target: "parameters.Identity.Type", Name: validation.Null, Rule: true, Chain: nil}}},
|
||||
{Target: "parameters.AccountPropertiesCreateParameters", Name: validation.Null, Rule: false,
|
||||
Chain: []validation.Constraint{{Target: "parameters.AccountPropertiesCreateParameters.CustomDomain", Name: validation.Null, Rule: false,
|
||||
Chain: []validation.Constraint{{Target: "parameters.AccountPropertiesCreateParameters.CustomDomain.Name", Name: validation.Null, Rule: true, Chain: nil}}},
|
||||
Chain: []validation.Constraint{{Target: "parameters.AccountPropertiesCreateParameters.SasPolicy", Name: validation.Null, Rule: false,
|
||||
Chain: []validation.Constraint{{Target: "parameters.AccountPropertiesCreateParameters.SasPolicy.SasExpirationPeriod", Name: validation.Null, Rule: true, Chain: nil},
|
||||
{Target: "parameters.AccountPropertiesCreateParameters.SasPolicy.ExpirationAction", Name: validation.Null, Rule: true, Chain: nil},
|
||||
}},
|
||||
{Target: "parameters.AccountPropertiesCreateParameters.KeyPolicy", Name: validation.Null, Rule: false,
|
||||
Chain: []validation.Constraint{{Target: "parameters.AccountPropertiesCreateParameters.KeyPolicy.KeyExpirationPeriodInDays", Name: validation.Null, Rule: true, Chain: nil}}},
|
||||
{Target: "parameters.AccountPropertiesCreateParameters.CustomDomain", Name: validation.Null, Rule: false,
|
||||
Chain: []validation.Constraint{{Target: "parameters.AccountPropertiesCreateParameters.CustomDomain.Name", Name: validation.Null, Rule: true, Chain: nil}}},
|
||||
{Target: "parameters.AccountPropertiesCreateParameters.AzureFilesIdentityBasedAuthentication", Name: validation.Null, Rule: false,
|
||||
Chain: []validation.Constraint{{Target: "parameters.AccountPropertiesCreateParameters.AzureFilesIdentityBasedAuthentication.ActiveDirectoryProperties", Name: validation.Null, Rule: false,
|
||||
Chain: []validation.Constraint{{Target: "parameters.AccountPropertiesCreateParameters.AzureFilesIdentityBasedAuthentication.ActiveDirectoryProperties.DomainName", Name: validation.Null, Rule: true, Chain: nil},
|
||||
|
@ -163,6 +260,14 @@ func (client AccountsClient) Create(ctx context.Context, resourceGroupName strin
|
|||
{Target: "parameters.AccountPropertiesCreateParameters.AzureFilesIdentityBasedAuthentication.ActiveDirectoryProperties.AzureStorageSid", Name: validation.Null, Rule: true, Chain: nil},
|
||||
}},
|
||||
}},
|
||||
{Target: "parameters.AccountPropertiesCreateParameters.ImmutableStorageWithVersioning", Name: validation.Null, Rule: false,
|
||||
Chain: []validation.Constraint{{Target: "parameters.AccountPropertiesCreateParameters.ImmutableStorageWithVersioning.ImmutabilityPolicy", Name: validation.Null, Rule: false,
|
||||
Chain: []validation.Constraint{{Target: "parameters.AccountPropertiesCreateParameters.ImmutableStorageWithVersioning.ImmutabilityPolicy.ImmutabilityPeriodSinceCreationInDays", Name: validation.Null, Rule: false,
|
||||
Chain: []validation.Constraint{{Target: "parameters.AccountPropertiesCreateParameters.ImmutableStorageWithVersioning.ImmutabilityPolicy.ImmutabilityPeriodSinceCreationInDays", Name: validation.InclusiveMaximum, Rule: int64(146000), Chain: nil},
|
||||
{Target: "parameters.AccountPropertiesCreateParameters.ImmutableStorageWithVersioning.ImmutabilityPolicy.ImmutabilityPeriodSinceCreationInDays", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil},
|
||||
}},
|
||||
}},
|
||||
}},
|
||||
}}}},
|
||||
{TargetValue: client.SubscriptionID,
|
||||
Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}}); err != nil {
|
||||
|
@ -192,7 +297,7 @@ func (client AccountsClient) CreatePreparer(ctx context.Context, resourceGroupNa
|
|||
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
|
||||
}
|
||||
|
||||
const APIVersion = "2019-06-01"
|
||||
const APIVersion = "2021-09-01"
|
||||
queryParameters := map[string]interface{}{
|
||||
"api-version": APIVersion,
|
||||
}
|
||||
|
@ -295,7 +400,7 @@ func (client AccountsClient) DeletePreparer(ctx context.Context, resourceGroupNa
|
|||
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
|
||||
}
|
||||
|
||||
const APIVersion = "2019-06-01"
|
||||
const APIVersion = "2021-09-01"
|
||||
queryParameters := map[string]interface{}{
|
||||
"api-version": APIVersion,
|
||||
}
|
||||
|
@ -380,7 +485,7 @@ func (client AccountsClient) FailoverPreparer(ctx context.Context, resourceGroup
|
|||
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
|
||||
}
|
||||
|
||||
const APIVersion = "2019-06-01"
|
||||
const APIVersion = "2021-09-01"
|
||||
queryParameters := map[string]interface{}{
|
||||
"api-version": APIVersion,
|
||||
}
|
||||
|
@ -483,7 +588,7 @@ func (client AccountsClient) GetPropertiesPreparer(ctx context.Context, resource
|
|||
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
|
||||
}
|
||||
|
||||
const APIVersion = "2019-06-01"
|
||||
const APIVersion = "2021-09-01"
|
||||
queryParameters := map[string]interface{}{
|
||||
"api-version": APIVersion,
|
||||
}
|
||||
|
@ -517,6 +622,103 @@ func (client AccountsClient) GetPropertiesResponder(resp *http.Response) (result
|
|||
return
|
||||
}
|
||||
|
||||
// HierarchicalNamespaceMigration live Migration of storage account to enable Hns
|
||||
// Parameters:
|
||||
// resourceGroupName - the name of the resource group within the user's subscription. The name is case
|
||||
// insensitive.
|
||||
// accountName - the name of the storage account within the specified resource group. Storage account names
|
||||
// must be between 3 and 24 characters in length and use numbers and lower-case letters only.
|
||||
// requestType - required. Hierarchical namespace migration type can either be a hierarchical namespace
|
||||
// validation request 'HnsOnValidationRequest' or a hydration request 'HnsOnHydrationRequest'. The validation
|
||||
// request will validate the migration whereas the hydration request will migrate the account.
|
||||
func (client AccountsClient) HierarchicalNamespaceMigration(ctx context.Context, resourceGroupName string, accountName string, requestType string) (result AccountsHierarchicalNamespaceMigrationFuture, err error) {
|
||||
if tracing.IsEnabled() {
|
||||
ctx = tracing.StartSpan(ctx, fqdn+"/AccountsClient.HierarchicalNamespaceMigration")
|
||||
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: accountName,
|
||||
Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 24, Chain: nil},
|
||||
{Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}}},
|
||||
{TargetValue: client.SubscriptionID,
|
||||
Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}}); err != nil {
|
||||
return result, validation.NewError("storage.AccountsClient", "HierarchicalNamespaceMigration", err.Error())
|
||||
}
|
||||
|
||||
req, err := client.HierarchicalNamespaceMigrationPreparer(ctx, resourceGroupName, accountName, requestType)
|
||||
if err != nil {
|
||||
err = autorest.NewErrorWithError(err, "storage.AccountsClient", "HierarchicalNamespaceMigration", nil, "Failure preparing request")
|
||||
return
|
||||
}
|
||||
|
||||
result, err = client.HierarchicalNamespaceMigrationSender(req)
|
||||
if err != nil {
|
||||
err = autorest.NewErrorWithError(err, "storage.AccountsClient", "HierarchicalNamespaceMigration", result.Response(), "Failure sending request")
|
||||
return
|
||||
}
|
||||
|
||||
return
|
||||
}
|
||||
|
||||
// HierarchicalNamespaceMigrationPreparer prepares the HierarchicalNamespaceMigration request.
|
||||
func (client AccountsClient) HierarchicalNamespaceMigrationPreparer(ctx context.Context, resourceGroupName string, accountName string, requestType 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-09-01"
|
||||
queryParameters := map[string]interface{}{
|
||||
"api-version": APIVersion,
|
||||
"requestType": autorest.Encode("query", requestType),
|
||||
}
|
||||
|
||||
preparer := autorest.CreatePreparer(
|
||||
autorest.AsPost(),
|
||||
autorest.WithBaseURL(client.BaseURI),
|
||||
autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/hnsonmigration", pathParameters),
|
||||
autorest.WithQueryParameters(queryParameters))
|
||||
return preparer.Prepare((&http.Request{}).WithContext(ctx))
|
||||
}
|
||||
|
||||
// HierarchicalNamespaceMigrationSender sends the HierarchicalNamespaceMigration request. The method will close the
|
||||
// http.Response Body if it receives an error.
|
||||
func (client AccountsClient) HierarchicalNamespaceMigrationSender(req *http.Request) (future AccountsHierarchicalNamespaceMigrationFuture, 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
|
||||
}
|
||||
|
||||
// HierarchicalNamespaceMigrationResponder handles the response to the HierarchicalNamespaceMigration request. The method always
|
||||
// closes the http.Response Body.
|
||||
func (client AccountsClient) HierarchicalNamespaceMigrationResponder(resp *http.Response) (result autorest.Response, err error) {
|
||||
err = autorest.Respond(
|
||||
resp,
|
||||
azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted),
|
||||
autorest.ByClosing())
|
||||
result.Response = resp
|
||||
return
|
||||
}
|
||||
|
||||
// List lists all the storage accounts available under the subscription. Note that storage keys are not returned; use
|
||||
// the ListKeys operation for this.
|
||||
func (client AccountsClient) List(ctx context.Context) (result AccountListResultPage, err error) {
|
||||
|
@ -569,7 +771,7 @@ func (client AccountsClient) ListPreparer(ctx context.Context) (*http.Request, e
|
|||
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
|
||||
}
|
||||
|
||||
const APIVersion = "2019-06-01"
|
||||
const APIVersion = "2021-09-01"
|
||||
queryParameters := map[string]interface{}{
|
||||
"api-version": APIVersion,
|
||||
}
|
||||
|
@ -700,7 +902,7 @@ func (client AccountsClient) ListAccountSASPreparer(ctx context.Context, resourc
|
|||
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
|
||||
}
|
||||
|
||||
const APIVersion = "2019-06-01"
|
||||
const APIVersion = "2021-09-01"
|
||||
queryParameters := map[string]interface{}{
|
||||
"api-version": APIVersion,
|
||||
}
|
||||
|
@ -738,13 +940,13 @@ func (client AccountsClient) ListAccountSASResponder(resp *http.Response) (resul
|
|||
// Parameters:
|
||||
// resourceGroupName - the name of the resource group within the user's subscription. The name is case
|
||||
// insensitive.
|
||||
func (client AccountsClient) ListByResourceGroup(ctx context.Context, resourceGroupName string) (result AccountListResult, err error) {
|
||||
func (client AccountsClient) ListByResourceGroup(ctx context.Context, resourceGroupName string) (result AccountListResultPage, err error) {
|
||||
if tracing.IsEnabled() {
|
||||
ctx = tracing.StartSpan(ctx, fqdn+"/AccountsClient.ListByResourceGroup")
|
||||
defer func() {
|
||||
sc := -1
|
||||
if result.Response.Response != nil {
|
||||
sc = result.Response.Response.StatusCode
|
||||
if result.alr.Response.Response != nil {
|
||||
sc = result.alr.Response.Response.StatusCode
|
||||
}
|
||||
tracing.EndSpan(ctx, sc, err)
|
||||
}()
|
||||
|
@ -759,6 +961,7 @@ func (client AccountsClient) ListByResourceGroup(ctx context.Context, resourceGr
|
|||
return result, validation.NewError("storage.AccountsClient", "ListByResourceGroup", err.Error())
|
||||
}
|
||||
|
||||
result.fn = client.listByResourceGroupNextResults
|
||||
req, err := client.ListByResourceGroupPreparer(ctx, resourceGroupName)
|
||||
if err != nil {
|
||||
err = autorest.NewErrorWithError(err, "storage.AccountsClient", "ListByResourceGroup", nil, "Failure preparing request")
|
||||
|
@ -767,16 +970,20 @@ func (client AccountsClient) ListByResourceGroup(ctx context.Context, resourceGr
|
|||
|
||||
resp, err := client.ListByResourceGroupSender(req)
|
||||
if err != nil {
|
||||
result.Response = autorest.Response{Response: resp}
|
||||
result.alr.Response = autorest.Response{Response: resp}
|
||||
err = autorest.NewErrorWithError(err, "storage.AccountsClient", "ListByResourceGroup", resp, "Failure sending request")
|
||||
return
|
||||
}
|
||||
|
||||
result, err = client.ListByResourceGroupResponder(resp)
|
||||
result.alr, err = client.ListByResourceGroupResponder(resp)
|
||||
if err != nil {
|
||||
err = autorest.NewErrorWithError(err, "storage.AccountsClient", "ListByResourceGroup", resp, "Failure responding to request")
|
||||
return
|
||||
}
|
||||
if result.alr.hasNextLink() && result.alr.IsEmpty() {
|
||||
err = result.NextWithContext(ctx)
|
||||
return
|
||||
}
|
||||
|
||||
return
|
||||
}
|
||||
|
@ -788,7 +995,7 @@ func (client AccountsClient) ListByResourceGroupPreparer(ctx context.Context, re
|
|||
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
|
||||
}
|
||||
|
||||
const APIVersion = "2019-06-01"
|
||||
const APIVersion = "2021-09-01"
|
||||
queryParameters := map[string]interface{}{
|
||||
"api-version": APIVersion,
|
||||
}
|
||||
|
@ -819,6 +1026,43 @@ func (client AccountsClient) ListByResourceGroupResponder(resp *http.Response) (
|
|||
return
|
||||
}
|
||||
|
||||
// listByResourceGroupNextResults retrieves the next set of results, if any.
|
||||
func (client AccountsClient) listByResourceGroupNextResults(ctx context.Context, lastResults AccountListResult) (result AccountListResult, err error) {
|
||||
req, err := lastResults.accountListResultPreparer(ctx)
|
||||
if err != nil {
|
||||
return result, autorest.NewErrorWithError(err, "storage.AccountsClient", "listByResourceGroupNextResults", nil, "Failure preparing next results request")
|
||||
}
|
||||
if req == nil {
|
||||
return
|
||||
}
|
||||
resp, err := client.ListByResourceGroupSender(req)
|
||||
if err != nil {
|
||||
result.Response = autorest.Response{Response: resp}
|
||||
return result, autorest.NewErrorWithError(err, "storage.AccountsClient", "listByResourceGroupNextResults", resp, "Failure sending next results request")
|
||||
}
|
||||
result, err = client.ListByResourceGroupResponder(resp)
|
||||
if err != nil {
|
||||
err = autorest.NewErrorWithError(err, "storage.AccountsClient", "listByResourceGroupNextResults", resp, "Failure responding to next results request")
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
// ListByResourceGroupComplete enumerates all values, automatically crossing page boundaries as required.
|
||||
func (client AccountsClient) ListByResourceGroupComplete(ctx context.Context, resourceGroupName string) (result AccountListResultIterator, err error) {
|
||||
if tracing.IsEnabled() {
|
||||
ctx = tracing.StartSpan(ctx, fqdn+"/AccountsClient.ListByResourceGroup")
|
||||
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.ListByResourceGroup(ctx, resourceGroupName)
|
||||
return
|
||||
}
|
||||
|
||||
// ListKeys lists the access keys or Kerberos keys (if active directory enabled) for the specified storage account.
|
||||
// Parameters:
|
||||
// resourceGroupName - the name of the resource group within the user's subscription. The name is case
|
||||
|
@ -880,7 +1124,7 @@ func (client AccountsClient) ListKeysPreparer(ctx context.Context, resourceGroup
|
|||
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
|
||||
}
|
||||
|
||||
const APIVersion = "2019-06-01"
|
||||
const APIVersion = "2021-09-01"
|
||||
queryParameters := map[string]interface{}{
|
||||
"api-version": APIVersion,
|
||||
}
|
||||
|
@ -979,7 +1223,7 @@ func (client AccountsClient) ListServiceSASPreparer(ctx context.Context, resourc
|
|||
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
|
||||
}
|
||||
|
||||
const APIVersion = "2019-06-01"
|
||||
const APIVersion = "2021-09-01"
|
||||
queryParameters := map[string]interface{}{
|
||||
"api-version": APIVersion,
|
||||
}
|
||||
|
@ -1075,7 +1319,7 @@ func (client AccountsClient) RegenerateKeyPreparer(ctx context.Context, resource
|
|||
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
|
||||
}
|
||||
|
||||
const APIVersion = "2019-06-01"
|
||||
const APIVersion = "2021-09-01"
|
||||
queryParameters := map[string]interface{}{
|
||||
"api-version": APIVersion,
|
||||
}
|
||||
|
@ -1165,7 +1409,7 @@ func (client AccountsClient) RestoreBlobRangesPreparer(ctx context.Context, reso
|
|||
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
|
||||
}
|
||||
|
||||
const APIVersion = "2019-06-01"
|
||||
const APIVersion = "2021-09-01"
|
||||
queryParameters := map[string]interface{}{
|
||||
"api-version": APIVersion,
|
||||
}
|
||||
|
@ -1268,7 +1512,7 @@ func (client AccountsClient) RevokeUserDelegationKeysPreparer(ctx context.Contex
|
|||
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
|
||||
}
|
||||
|
||||
const APIVersion = "2019-06-01"
|
||||
const APIVersion = "2021-09-01"
|
||||
queryParameters := map[string]interface{}{
|
||||
"api-version": APIVersion,
|
||||
}
|
||||
|
@ -1364,7 +1608,7 @@ func (client AccountsClient) UpdatePreparer(ctx context.Context, resourceGroupNa
|
|||
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
|
||||
}
|
||||
|
||||
const APIVersion = "2019-06-01"
|
||||
const APIVersion = "2021-09-01"
|
||||
queryParameters := map[string]interface{}{
|
||||
"api-version": APIVersion,
|
||||
}
|
|
@ -102,7 +102,7 @@ func (client BlobContainersClient) ClearLegalHoldPreparer(ctx context.Context, r
|
|||
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
|
||||
}
|
||||
|
||||
const APIVersion = "2019-06-01"
|
||||
const APIVersion = "2021-09-01"
|
||||
queryParameters := map[string]interface{}{
|
||||
"api-version": APIVersion,
|
||||
}
|
||||
|
@ -206,7 +206,7 @@ func (client BlobContainersClient) CreatePreparer(ctx context.Context, resourceG
|
|||
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
|
||||
}
|
||||
|
||||
const APIVersion = "2019-06-01"
|
||||
const APIVersion = "2021-09-01"
|
||||
queryParameters := map[string]interface{}{
|
||||
"api-version": APIVersion,
|
||||
}
|
||||
|
@ -315,7 +315,7 @@ func (client BlobContainersClient) CreateOrUpdateImmutabilityPolicyPreparer(ctx
|
|||
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
|
||||
}
|
||||
|
||||
const APIVersion = "2019-06-01"
|
||||
const APIVersion = "2021-09-01"
|
||||
queryParameters := map[string]interface{}{
|
||||
"api-version": APIVersion,
|
||||
}
|
||||
|
@ -422,7 +422,7 @@ func (client BlobContainersClient) DeletePreparer(ctx context.Context, resourceG
|
|||
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
|
||||
}
|
||||
|
||||
const APIVersion = "2019-06-01"
|
||||
const APIVersion = "2021-09-01"
|
||||
queryParameters := map[string]interface{}{
|
||||
"api-version": APIVersion,
|
||||
}
|
||||
|
@ -526,7 +526,7 @@ func (client BlobContainersClient) DeleteImmutabilityPolicyPreparer(ctx context.
|
|||
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
|
||||
}
|
||||
|
||||
const APIVersion = "2019-06-01"
|
||||
const APIVersion = "2021-09-01"
|
||||
queryParameters := map[string]interface{}{
|
||||
"api-version": APIVersion,
|
||||
}
|
||||
|
@ -633,7 +633,7 @@ func (client BlobContainersClient) ExtendImmutabilityPolicyPreparer(ctx context.
|
|||
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
|
||||
}
|
||||
|
||||
const APIVersion = "2019-06-01"
|
||||
const APIVersion = "2021-09-01"
|
||||
queryParameters := map[string]interface{}{
|
||||
"api-version": APIVersion,
|
||||
}
|
||||
|
@ -737,7 +737,7 @@ func (client BlobContainersClient) GetPreparer(ctx context.Context, resourceGrou
|
|||
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
|
||||
}
|
||||
|
||||
const APIVersion = "2019-06-01"
|
||||
const APIVersion = "2021-09-01"
|
||||
queryParameters := map[string]interface{}{
|
||||
"api-version": APIVersion,
|
||||
}
|
||||
|
@ -840,7 +840,7 @@ func (client BlobContainersClient) GetImmutabilityPolicyPreparer(ctx context.Con
|
|||
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
|
||||
}
|
||||
|
||||
const APIVersion = "2019-06-01"
|
||||
const APIVersion = "2021-09-01"
|
||||
queryParameters := map[string]interface{}{
|
||||
"api-version": APIVersion,
|
||||
}
|
||||
|
@ -944,7 +944,7 @@ func (client BlobContainersClient) LeasePreparer(ctx context.Context, resourceGr
|
|||
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
|
||||
}
|
||||
|
||||
const APIVersion = "2019-06-01"
|
||||
const APIVersion = "2021-09-01"
|
||||
queryParameters := map[string]interface{}{
|
||||
"api-version": APIVersion,
|
||||
}
|
||||
|
@ -1049,7 +1049,7 @@ func (client BlobContainersClient) ListPreparer(ctx context.Context, resourceGro
|
|||
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
|
||||
}
|
||||
|
||||
const APIVersion = "2019-06-01"
|
||||
const APIVersion = "2021-09-01"
|
||||
queryParameters := map[string]interface{}{
|
||||
"api-version": APIVersion,
|
||||
}
|
||||
|
@ -1197,7 +1197,7 @@ func (client BlobContainersClient) LockImmutabilityPolicyPreparer(ctx context.Co
|
|||
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
|
||||
}
|
||||
|
||||
const APIVersion = "2019-06-01"
|
||||
const APIVersion = "2021-09-01"
|
||||
queryParameters := map[string]interface{}{
|
||||
"api-version": APIVersion,
|
||||
}
|
||||
|
@ -1229,6 +1229,108 @@ func (client BlobContainersClient) LockImmutabilityPolicyResponder(resp *http.Re
|
|||
return
|
||||
}
|
||||
|
||||
// ObjectLevelWorm this operation migrates a blob container from container level WORM to object level immutability
|
||||
// enabled container. Prerequisites require a container level immutability policy either in locked or unlocked state,
|
||||
// Account level versioning must be enabled and there should be no Legal hold on the container.
|
||||
// Parameters:
|
||||
// resourceGroupName - the name of the resource group within the user's subscription. The name is case
|
||||
// insensitive.
|
||||
// accountName - the name of the storage account within the specified resource group. Storage account names
|
||||
// must be between 3 and 24 characters in length and use numbers and lower-case letters only.
|
||||
// containerName - the name of the blob container within the specified storage account. Blob container names
|
||||
// must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every
|
||||
// dash (-) character must be immediately preceded and followed by a letter or number.
|
||||
func (client BlobContainersClient) ObjectLevelWorm(ctx context.Context, resourceGroupName string, accountName string, containerName string) (result BlobContainersObjectLevelWormFuture, err error) {
|
||||
if tracing.IsEnabled() {
|
||||
ctx = tracing.StartSpan(ctx, fqdn+"/BlobContainersClient.ObjectLevelWorm")
|
||||
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: accountName,
|
||||
Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 24, Chain: nil},
|
||||
{Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}}},
|
||||
{TargetValue: containerName,
|
||||
Constraints: []validation.Constraint{{Target: "containerName", Name: validation.MaxLength, Rule: 63, Chain: nil},
|
||||
{Target: "containerName", Name: validation.MinLength, Rule: 3, Chain: nil}}},
|
||||
{TargetValue: client.SubscriptionID,
|
||||
Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}}); err != nil {
|
||||
return result, validation.NewError("storage.BlobContainersClient", "ObjectLevelWorm", err.Error())
|
||||
}
|
||||
|
||||
req, err := client.ObjectLevelWormPreparer(ctx, resourceGroupName, accountName, containerName)
|
||||
if err != nil {
|
||||
err = autorest.NewErrorWithError(err, "storage.BlobContainersClient", "ObjectLevelWorm", nil, "Failure preparing request")
|
||||
return
|
||||
}
|
||||
|
||||
result, err = client.ObjectLevelWormSender(req)
|
||||
if err != nil {
|
||||
err = autorest.NewErrorWithError(err, "storage.BlobContainersClient", "ObjectLevelWorm", result.Response(), "Failure sending request")
|
||||
return
|
||||
}
|
||||
|
||||
return
|
||||
}
|
||||
|
||||
// ObjectLevelWormPreparer prepares the ObjectLevelWorm request.
|
||||
func (client BlobContainersClient) ObjectLevelWormPreparer(ctx context.Context, resourceGroupName string, accountName string, containerName string) (*http.Request, error) {
|
||||
pathParameters := map[string]interface{}{
|
||||
"accountName": autorest.Encode("path", accountName),
|
||||
"containerName": autorest.Encode("path", containerName),
|
||||
"resourceGroupName": autorest.Encode("path", resourceGroupName),
|
||||
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
|
||||
}
|
||||
|
||||
const APIVersion = "2021-09-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.Storage/storageAccounts/{accountName}/blobServices/default/containers/{containerName}/migrate", pathParameters),
|
||||
autorest.WithQueryParameters(queryParameters))
|
||||
return preparer.Prepare((&http.Request{}).WithContext(ctx))
|
||||
}
|
||||
|
||||
// ObjectLevelWormSender sends the ObjectLevelWorm request. The method will close the
|
||||
// http.Response Body if it receives an error.
|
||||
func (client BlobContainersClient) ObjectLevelWormSender(req *http.Request) (future BlobContainersObjectLevelWormFuture, 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
|
||||
}
|
||||
|
||||
// ObjectLevelWormResponder handles the response to the ObjectLevelWorm request. The method always
|
||||
// closes the http.Response Body.
|
||||
func (client BlobContainersClient) ObjectLevelWormResponder(resp *http.Response) (result autorest.Response, err error) {
|
||||
err = autorest.Respond(
|
||||
resp,
|
||||
azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted),
|
||||
autorest.ByClosing())
|
||||
result.Response = resp
|
||||
return
|
||||
}
|
||||
|
||||
// SetLegalHold sets legal hold tags. Setting the same tag results in an idempotent operation. SetLegalHold follows an
|
||||
// append pattern and does not clear out the existing tags that are not specified in the request.
|
||||
// Parameters:
|
||||
|
@ -1300,7 +1402,7 @@ func (client BlobContainersClient) SetLegalHoldPreparer(ctx context.Context, res
|
|||
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
|
||||
}
|
||||
|
||||
const APIVersion = "2019-06-01"
|
||||
const APIVersion = "2021-09-01"
|
||||
queryParameters := map[string]interface{}{
|
||||
"api-version": APIVersion,
|
||||
}
|
||||
|
@ -1403,7 +1505,7 @@ func (client BlobContainersClient) UpdatePreparer(ctx context.Context, resourceG
|
|||
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
|
||||
}
|
||||
|
||||
const APIVersion = "2019-06-01"
|
||||
const APIVersion = "2021-09-01"
|
||||
queryParameters := map[string]interface{}{
|
||||
"api-version": APIVersion,
|
||||
}
|
410
vendor/github.com/Azure/azure-sdk-for-go/services/storage/mgmt/2021-09-01/storage/blobinventorypolicies.go
сгенерированный
поставляемый
Normal file
410
vendor/github.com/Azure/azure-sdk-for-go/services/storage/mgmt/2021-09-01/storage/blobinventorypolicies.go
сгенерированный
поставляемый
Normal file
|
@ -0,0 +1,410 @@
|
|||
package storage
|
||||
|
||||
// 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"
|
||||
)
|
||||
|
||||
// BlobInventoryPoliciesClient is the the Azure Storage Management API.
|
||||
type BlobInventoryPoliciesClient struct {
|
||||
BaseClient
|
||||
}
|
||||
|
||||
// NewBlobInventoryPoliciesClient creates an instance of the BlobInventoryPoliciesClient client.
|
||||
func NewBlobInventoryPoliciesClient(subscriptionID string) BlobInventoryPoliciesClient {
|
||||
return NewBlobInventoryPoliciesClientWithBaseURI(DefaultBaseURI, subscriptionID)
|
||||
}
|
||||
|
||||
// NewBlobInventoryPoliciesClientWithBaseURI creates an instance of the BlobInventoryPoliciesClient 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 NewBlobInventoryPoliciesClientWithBaseURI(baseURI string, subscriptionID string) BlobInventoryPoliciesClient {
|
||||
return BlobInventoryPoliciesClient{NewWithBaseURI(baseURI, subscriptionID)}
|
||||
}
|
||||
|
||||
// CreateOrUpdate sets the blob inventory policy to the specified storage account.
|
||||
// Parameters:
|
||||
// resourceGroupName - the name of the resource group within the user's subscription. The name is case
|
||||
// insensitive.
|
||||
// accountName - the name of the storage account within the specified resource group. Storage account names
|
||||
// must be between 3 and 24 characters in length and use numbers and lower-case letters only.
|
||||
// properties - the blob inventory policy set to a storage account.
|
||||
func (client BlobInventoryPoliciesClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, accountName string, properties BlobInventoryPolicy) (result BlobInventoryPolicy, err error) {
|
||||
if tracing.IsEnabled() {
|
||||
ctx = tracing.StartSpan(ctx, fqdn+"/BlobInventoryPoliciesClient.CreateOrUpdate")
|
||||
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: accountName,
|
||||
Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 24, Chain: nil},
|
||||
{Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}}},
|
||||
{TargetValue: client.SubscriptionID,
|
||||
Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}},
|
||||
{TargetValue: properties,
|
||||
Constraints: []validation.Constraint{{Target: "properties.BlobInventoryPolicyProperties", Name: validation.Null, Rule: false,
|
||||
Chain: []validation.Constraint{{Target: "properties.BlobInventoryPolicyProperties.Policy", Name: validation.Null, Rule: true,
|
||||
Chain: []validation.Constraint{{Target: "properties.BlobInventoryPolicyProperties.Policy.Enabled", Name: validation.Null, Rule: true, Chain: nil},
|
||||
{Target: "properties.BlobInventoryPolicyProperties.Policy.Type", Name: validation.Null, Rule: true, Chain: nil},
|
||||
{Target: "properties.BlobInventoryPolicyProperties.Policy.Rules", Name: validation.Null, Rule: true, Chain: nil},
|
||||
}},
|
||||
}}}}}); err != nil {
|
||||
return result, validation.NewError("storage.BlobInventoryPoliciesClient", "CreateOrUpdate", err.Error())
|
||||
}
|
||||
|
||||
req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, accountName, properties)
|
||||
if err != nil {
|
||||
err = autorest.NewErrorWithError(err, "storage.BlobInventoryPoliciesClient", "CreateOrUpdate", nil, "Failure preparing request")
|
||||
return
|
||||
}
|
||||
|
||||
resp, err := client.CreateOrUpdateSender(req)
|
||||
if err != nil {
|
||||
result.Response = autorest.Response{Response: resp}
|
||||
err = autorest.NewErrorWithError(err, "storage.BlobInventoryPoliciesClient", "CreateOrUpdate", resp, "Failure sending request")
|
||||
return
|
||||
}
|
||||
|
||||
result, err = client.CreateOrUpdateResponder(resp)
|
||||
if err != nil {
|
||||
err = autorest.NewErrorWithError(err, "storage.BlobInventoryPoliciesClient", "CreateOrUpdate", resp, "Failure responding to request")
|
||||
return
|
||||
}
|
||||
|
||||
return
|
||||
}
|
||||
|
||||
// CreateOrUpdatePreparer prepares the CreateOrUpdate request.
|
||||
func (client BlobInventoryPoliciesClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, accountName string, properties BlobInventoryPolicy) (*http.Request, error) {
|
||||
pathParameters := map[string]interface{}{
|
||||
"accountName": autorest.Encode("path", accountName),
|
||||
"blobInventoryPolicyName": autorest.Encode("path", "default"),
|
||||
"resourceGroupName": autorest.Encode("path", resourceGroupName),
|
||||
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
|
||||
}
|
||||
|
||||
const APIVersion = "2021-09-01"
|
||||
queryParameters := map[string]interface{}{
|
||||
"api-version": APIVersion,
|
||||
}
|
||||
|
||||
preparer := autorest.CreatePreparer(
|
||||
autorest.AsContentType("application/json; charset=utf-8"),
|
||||
autorest.AsPut(),
|
||||
autorest.WithBaseURL(client.BaseURI),
|
||||
autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/inventoryPolicies/{blobInventoryPolicyName}", pathParameters),
|
||||
autorest.WithJSON(properties),
|
||||
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 BlobInventoryPoliciesClient) CreateOrUpdateSender(req *http.Request) (*http.Response, error) {
|
||||
return client.Send(req, azure.DoRetryWithRegistration(client.Client))
|
||||
}
|
||||
|
||||
// CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always
|
||||
// closes the http.Response Body.
|
||||
func (client BlobInventoryPoliciesClient) CreateOrUpdateResponder(resp *http.Response) (result BlobInventoryPolicy, err error) {
|
||||
err = autorest.Respond(
|
||||
resp,
|
||||
azure.WithErrorUnlessStatusCode(http.StatusOK),
|
||||
autorest.ByUnmarshallingJSON(&result),
|
||||
autorest.ByClosing())
|
||||
result.Response = autorest.Response{Response: resp}
|
||||
return
|
||||
}
|
||||
|
||||
// Delete deletes the blob inventory policy associated with the specified storage account.
|
||||
// Parameters:
|
||||
// resourceGroupName - the name of the resource group within the user's subscription. The name is case
|
||||
// insensitive.
|
||||
// accountName - the name of the storage account within the specified resource group. Storage account names
|
||||
// must be between 3 and 24 characters in length and use numbers and lower-case letters only.
|
||||
func (client BlobInventoryPoliciesClient) Delete(ctx context.Context, resourceGroupName string, accountName string) (result autorest.Response, err error) {
|
||||
if tracing.IsEnabled() {
|
||||
ctx = tracing.StartSpan(ctx, fqdn+"/BlobInventoryPoliciesClient.Delete")
|
||||
defer func() {
|
||||
sc := -1
|
||||
if result.Response != nil {
|
||||
sc = result.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: accountName,
|
||||
Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 24, Chain: nil},
|
||||
{Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}}},
|
||||
{TargetValue: client.SubscriptionID,
|
||||
Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}}); err != nil {
|
||||
return result, validation.NewError("storage.BlobInventoryPoliciesClient", "Delete", err.Error())
|
||||
}
|
||||
|
||||
req, err := client.DeletePreparer(ctx, resourceGroupName, accountName)
|
||||
if err != nil {
|
||||
err = autorest.NewErrorWithError(err, "storage.BlobInventoryPoliciesClient", "Delete", nil, "Failure preparing request")
|
||||
return
|
||||
}
|
||||
|
||||
resp, err := client.DeleteSender(req)
|
||||
if err != nil {
|
||||
result.Response = resp
|
||||
err = autorest.NewErrorWithError(err, "storage.BlobInventoryPoliciesClient", "Delete", resp, "Failure sending request")
|
||||
return
|
||||
}
|
||||
|
||||
result, err = client.DeleteResponder(resp)
|
||||
if err != nil {
|
||||
err = autorest.NewErrorWithError(err, "storage.BlobInventoryPoliciesClient", "Delete", resp, "Failure responding to request")
|
||||
return
|
||||
}
|
||||
|
||||
return
|
||||
}
|
||||
|
||||
// DeletePreparer prepares the Delete request.
|
||||
func (client BlobInventoryPoliciesClient) DeletePreparer(ctx context.Context, resourceGroupName string, accountName string) (*http.Request, error) {
|
||||
pathParameters := map[string]interface{}{
|
||||
"accountName": autorest.Encode("path", accountName),
|
||||
"blobInventoryPolicyName": autorest.Encode("path", "default"),
|
||||
"resourceGroupName": autorest.Encode("path", resourceGroupName),
|
||||
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
|
||||
}
|
||||
|
||||
const APIVersion = "2021-09-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.Storage/storageAccounts/{accountName}/inventoryPolicies/{blobInventoryPolicyName}", 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 BlobInventoryPoliciesClient) DeleteSender(req *http.Request) (*http.Response, error) {
|
||||
return client.Send(req, azure.DoRetryWithRegistration(client.Client))
|
||||
}
|
||||
|
||||
// DeleteResponder handles the response to the Delete request. The method always
|
||||
// closes the http.Response Body.
|
||||
func (client BlobInventoryPoliciesClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) {
|
||||
err = autorest.Respond(
|
||||
resp,
|
||||
azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent),
|
||||
autorest.ByClosing())
|
||||
result.Response = resp
|
||||
return
|
||||
}
|
||||
|
||||
// Get gets the blob inventory policy associated with the specified storage account.
|
||||
// Parameters:
|
||||
// resourceGroupName - the name of the resource group within the user's subscription. The name is case
|
||||
// insensitive.
|
||||
// accountName - the name of the storage account within the specified resource group. Storage account names
|
||||
// must be between 3 and 24 characters in length and use numbers and lower-case letters only.
|
||||
func (client BlobInventoryPoliciesClient) Get(ctx context.Context, resourceGroupName string, accountName string) (result BlobInventoryPolicy, err error) {
|
||||
if tracing.IsEnabled() {
|
||||
ctx = tracing.StartSpan(ctx, fqdn+"/BlobInventoryPoliciesClient.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: accountName,
|
||||
Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 24, Chain: nil},
|
||||
{Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}}},
|
||||
{TargetValue: client.SubscriptionID,
|
||||
Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}}); err != nil {
|
||||
return result, validation.NewError("storage.BlobInventoryPoliciesClient", "Get", err.Error())
|
||||
}
|
||||
|
||||
req, err := client.GetPreparer(ctx, resourceGroupName, accountName)
|
||||
if err != nil {
|
||||
err = autorest.NewErrorWithError(err, "storage.BlobInventoryPoliciesClient", "Get", nil, "Failure preparing request")
|
||||
return
|
||||
}
|
||||
|
||||
resp, err := client.GetSender(req)
|
||||
if err != nil {
|
||||
result.Response = autorest.Response{Response: resp}
|
||||
err = autorest.NewErrorWithError(err, "storage.BlobInventoryPoliciesClient", "Get", resp, "Failure sending request")
|
||||
return
|
||||
}
|
||||
|
||||
result, err = client.GetResponder(resp)
|
||||
if err != nil {
|
||||
err = autorest.NewErrorWithError(err, "storage.BlobInventoryPoliciesClient", "Get", resp, "Failure responding to request")
|
||||
return
|
||||
}
|
||||
|
||||
return
|
||||
}
|
||||
|
||||
// GetPreparer prepares the Get request.
|
||||
func (client BlobInventoryPoliciesClient) GetPreparer(ctx context.Context, resourceGroupName string, accountName string) (*http.Request, error) {
|
||||
pathParameters := map[string]interface{}{
|
||||
"accountName": autorest.Encode("path", accountName),
|
||||
"blobInventoryPolicyName": autorest.Encode("path", "default"),
|
||||
"resourceGroupName": autorest.Encode("path", resourceGroupName),
|
||||
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
|
||||
}
|
||||
|
||||
const APIVersion = "2021-09-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.Storage/storageAccounts/{accountName}/inventoryPolicies/{blobInventoryPolicyName}", 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 BlobInventoryPoliciesClient) 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 BlobInventoryPoliciesClient) GetResponder(resp *http.Response) (result BlobInventoryPolicy, err error) {
|
||||
err = autorest.Respond(
|
||||
resp,
|
||||
azure.WithErrorUnlessStatusCode(http.StatusOK),
|
||||
autorest.ByUnmarshallingJSON(&result),
|
||||
autorest.ByClosing())
|
||||
result.Response = autorest.Response{Response: resp}
|
||||
return
|
||||
}
|
||||
|
||||
// List gets the blob inventory policy associated with the specified storage account.
|
||||
// Parameters:
|
||||
// resourceGroupName - the name of the resource group within the user's subscription. The name is case
|
||||
// insensitive.
|
||||
// accountName - the name of the storage account within the specified resource group. Storage account names
|
||||
// must be between 3 and 24 characters in length and use numbers and lower-case letters only.
|
||||
func (client BlobInventoryPoliciesClient) List(ctx context.Context, resourceGroupName string, accountName string) (result ListBlobInventoryPolicy, err error) {
|
||||
if tracing.IsEnabled() {
|
||||
ctx = tracing.StartSpan(ctx, fqdn+"/BlobInventoryPoliciesClient.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: accountName,
|
||||
Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 24, Chain: nil},
|
||||
{Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}}},
|
||||
{TargetValue: client.SubscriptionID,
|
||||
Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}}); err != nil {
|
||||
return result, validation.NewError("storage.BlobInventoryPoliciesClient", "List", err.Error())
|
||||
}
|
||||
|
||||
req, err := client.ListPreparer(ctx, resourceGroupName, accountName)
|
||||
if err != nil {
|
||||
err = autorest.NewErrorWithError(err, "storage.BlobInventoryPoliciesClient", "List", nil, "Failure preparing request")
|
||||
return
|
||||
}
|
||||
|
||||
resp, err := client.ListSender(req)
|
||||
if err != nil {
|
||||
result.Response = autorest.Response{Response: resp}
|
||||
err = autorest.NewErrorWithError(err, "storage.BlobInventoryPoliciesClient", "List", resp, "Failure sending request")
|
||||
return
|
||||
}
|
||||
|
||||
result, err = client.ListResponder(resp)
|
||||
if err != nil {
|
||||
err = autorest.NewErrorWithError(err, "storage.BlobInventoryPoliciesClient", "List", resp, "Failure responding to request")
|
||||
return
|
||||
}
|
||||
|
||||
return
|
||||
}
|
||||
|
||||
// ListPreparer prepares the List request.
|
||||
func (client BlobInventoryPoliciesClient) 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-09-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.Storage/storageAccounts/{accountName}/inventoryPolicies", 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 BlobInventoryPoliciesClient) 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 BlobInventoryPoliciesClient) ListResponder(resp *http.Response) (result ListBlobInventoryPolicy, err error) {
|
||||
err = autorest.Respond(
|
||||
resp,
|
||||
azure.WithErrorUnlessStatusCode(http.StatusOK),
|
||||
autorest.ByUnmarshallingJSON(&result),
|
||||
autorest.ByClosing())
|
||||
result.Response = autorest.Response{Response: resp}
|
||||
return
|
||||
}
|
|
@ -93,7 +93,7 @@ func (client BlobServicesClient) GetServicePropertiesPreparer(ctx context.Contex
|
|||
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
|
||||
}
|
||||
|
||||
const APIVersion = "2019-06-01"
|
||||
const APIVersion = "2021-09-01"
|
||||
queryParameters := map[string]interface{}{
|
||||
"api-version": APIVersion,
|
||||
}
|
||||
|
@ -184,7 +184,7 @@ func (client BlobServicesClient) ListPreparer(ctx context.Context, resourceGroup
|
|||
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
|
||||
}
|
||||
|
||||
const APIVersion = "2019-06-01"
|
||||
const APIVersion = "2021-09-01"
|
||||
queryParameters := map[string]interface{}{
|
||||
"api-version": APIVersion,
|
||||
}
|
||||
|
@ -253,6 +253,12 @@ func (client BlobServicesClient) SetServiceProperties(ctx context.Context, resou
|
|||
{Target: "parameters.BlobServicePropertiesProperties.DeleteRetentionPolicy.Days", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil},
|
||||
}},
|
||||
}},
|
||||
{Target: "parameters.BlobServicePropertiesProperties.ChangeFeed", Name: validation.Null, Rule: false,
|
||||
Chain: []validation.Constraint{{Target: "parameters.BlobServicePropertiesProperties.ChangeFeed.RetentionInDays", Name: validation.Null, Rule: false,
|
||||
Chain: []validation.Constraint{{Target: "parameters.BlobServicePropertiesProperties.ChangeFeed.RetentionInDays", Name: validation.InclusiveMaximum, Rule: int64(146000), Chain: nil},
|
||||
{Target: "parameters.BlobServicePropertiesProperties.ChangeFeed.RetentionInDays", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil},
|
||||
}},
|
||||
}},
|
||||
{Target: "parameters.BlobServicePropertiesProperties.RestorePolicy", Name: validation.Null, Rule: false,
|
||||
Chain: []validation.Constraint{{Target: "parameters.BlobServicePropertiesProperties.RestorePolicy.Enabled", Name: validation.Null, Rule: true, Chain: nil},
|
||||
{Target: "parameters.BlobServicePropertiesProperties.RestorePolicy.Days", Name: validation.Null, Rule: false,
|
||||
|
@ -266,6 +272,8 @@ func (client BlobServicesClient) SetServiceProperties(ctx context.Context, resou
|
|||
{Target: "parameters.BlobServicePropertiesProperties.ContainerDeleteRetentionPolicy.Days", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil},
|
||||
}},
|
||||
}},
|
||||
{Target: "parameters.BlobServicePropertiesProperties.LastAccessTimeTrackingPolicy", Name: validation.Null, Rule: false,
|
||||
Chain: []validation.Constraint{{Target: "parameters.BlobServicePropertiesProperties.LastAccessTimeTrackingPolicy.Enable", Name: validation.Null, Rule: true, Chain: nil}}},
|
||||
}}}}}); err != nil {
|
||||
return result, validation.NewError("storage.BlobServicesClient", "SetServiceProperties", err.Error())
|
||||
}
|
||||
|
@ -301,7 +309,7 @@ func (client BlobServicesClient) SetServicePropertiesPreparer(ctx context.Contex
|
|||
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
|
||||
}
|
||||
|
||||
const APIVersion = "2019-06-01"
|
||||
const APIVersion = "2021-09-01"
|
||||
queryParameters := map[string]interface{}{
|
||||
"api-version": APIVersion,
|
||||
}
|
|
@ -1,4 +1,4 @@
|
|||
// Package storage implements the Azure ARM Storage service API version 2019-06-01.
|
||||
// Package storage implements the Azure ARM Storage service API version 2021-09-01.
|
||||
//
|
||||
// The Azure Storage Management API.
|
||||
package storage
|
236
vendor/github.com/Azure/azure-sdk-for-go/services/storage/mgmt/2021-09-01/storage/deletedaccounts.go
сгенерированный
поставляемый
Normal file
236
vendor/github.com/Azure/azure-sdk-for-go/services/storage/mgmt/2021-09-01/storage/deletedaccounts.go
сгенерированный
поставляемый
Normal file
|
@ -0,0 +1,236 @@
|
|||
package storage
|
||||
|
||||
// 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"
|
||||
)
|
||||
|
||||
// DeletedAccountsClient is the the Azure Storage Management API.
|
||||
type DeletedAccountsClient struct {
|
||||
BaseClient
|
||||
}
|
||||
|
||||
// NewDeletedAccountsClient creates an instance of the DeletedAccountsClient client.
|
||||
func NewDeletedAccountsClient(subscriptionID string) DeletedAccountsClient {
|
||||
return NewDeletedAccountsClientWithBaseURI(DefaultBaseURI, subscriptionID)
|
||||
}
|
||||
|
||||
// NewDeletedAccountsClientWithBaseURI creates an instance of the DeletedAccountsClient 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 NewDeletedAccountsClientWithBaseURI(baseURI string, subscriptionID string) DeletedAccountsClient {
|
||||
return DeletedAccountsClient{NewWithBaseURI(baseURI, subscriptionID)}
|
||||
}
|
||||
|
||||
// Get get properties of specified deleted account resource.
|
||||
// Parameters:
|
||||
// deletedAccountName - name of the deleted storage account.
|
||||
// location - the location of the deleted storage account.
|
||||
func (client DeletedAccountsClient) Get(ctx context.Context, deletedAccountName string, location string) (result DeletedAccount, err error) {
|
||||
if tracing.IsEnabled() {
|
||||
ctx = tracing.StartSpan(ctx, fqdn+"/DeletedAccountsClient.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: deletedAccountName,
|
||||
Constraints: []validation.Constraint{{Target: "deletedAccountName", Name: validation.MaxLength, Rule: 24, Chain: nil},
|
||||
{Target: "deletedAccountName", Name: validation.MinLength, Rule: 3, Chain: nil}}},
|
||||
{TargetValue: client.SubscriptionID,
|
||||
Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}}); err != nil {
|
||||
return result, validation.NewError("storage.DeletedAccountsClient", "Get", err.Error())
|
||||
}
|
||||
|
||||
req, err := client.GetPreparer(ctx, deletedAccountName, location)
|
||||
if err != nil {
|
||||
err = autorest.NewErrorWithError(err, "storage.DeletedAccountsClient", "Get", nil, "Failure preparing request")
|
||||
return
|
||||
}
|
||||
|
||||
resp, err := client.GetSender(req)
|
||||
if err != nil {
|
||||
result.Response = autorest.Response{Response: resp}
|
||||
err = autorest.NewErrorWithError(err, "storage.DeletedAccountsClient", "Get", resp, "Failure sending request")
|
||||
return
|
||||
}
|
||||
|
||||
result, err = client.GetResponder(resp)
|
||||
if err != nil {
|
||||
err = autorest.NewErrorWithError(err, "storage.DeletedAccountsClient", "Get", resp, "Failure responding to request")
|
||||
return
|
||||
}
|
||||
|
||||
return
|
||||
}
|
||||
|
||||
// GetPreparer prepares the Get request.
|
||||
func (client DeletedAccountsClient) GetPreparer(ctx context.Context, deletedAccountName string, location string) (*http.Request, error) {
|
||||
pathParameters := map[string]interface{}{
|
||||
"deletedAccountName": autorest.Encode("path", deletedAccountName),
|
||||
"location": autorest.Encode("path", location),
|
||||
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
|
||||
}
|
||||
|
||||
const APIVersion = "2021-09-01"
|
||||
queryParameters := map[string]interface{}{
|
||||
"api-version": APIVersion,
|
||||
}
|
||||
|
||||
preparer := autorest.CreatePreparer(
|
||||
autorest.AsGet(),
|
||||
autorest.WithBaseURL(client.BaseURI),
|
||||
autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.Storage/locations/{location}/deletedAccounts/{deletedAccountName}", 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 DeletedAccountsClient) 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 DeletedAccountsClient) GetResponder(resp *http.Response) (result DeletedAccount, err error) {
|
||||
err = autorest.Respond(
|
||||
resp,
|
||||
azure.WithErrorUnlessStatusCode(http.StatusOK),
|
||||
autorest.ByUnmarshallingJSON(&result),
|
||||
autorest.ByClosing())
|
||||
result.Response = autorest.Response{Response: resp}
|
||||
return
|
||||
}
|
||||
|
||||
// List lists deleted accounts under the subscription.
|
||||
func (client DeletedAccountsClient) List(ctx context.Context) (result DeletedAccountListResultPage, err error) {
|
||||
if tracing.IsEnabled() {
|
||||
ctx = tracing.StartSpan(ctx, fqdn+"/DeletedAccountsClient.List")
|
||||
defer func() {
|
||||
sc := -1
|
||||
if result.dalr.Response.Response != nil {
|
||||
sc = result.dalr.Response.Response.StatusCode
|
||||
}
|
||||
tracing.EndSpan(ctx, sc, err)
|
||||
}()
|
||||
}
|
||||
if err := validation.Validate([]validation.Validation{
|
||||
{TargetValue: client.SubscriptionID,
|
||||
Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}}); err != nil {
|
||||
return result, validation.NewError("storage.DeletedAccountsClient", "List", err.Error())
|
||||
}
|
||||
|
||||
result.fn = client.listNextResults
|
||||
req, err := client.ListPreparer(ctx)
|
||||
if err != nil {
|
||||
err = autorest.NewErrorWithError(err, "storage.DeletedAccountsClient", "List", nil, "Failure preparing request")
|
||||
return
|
||||
}
|
||||
|
||||
resp, err := client.ListSender(req)
|
||||
if err != nil {
|
||||
result.dalr.Response = autorest.Response{Response: resp}
|
||||
err = autorest.NewErrorWithError(err, "storage.DeletedAccountsClient", "List", resp, "Failure sending request")
|
||||
return
|
||||
}
|
||||
|
||||
result.dalr, err = client.ListResponder(resp)
|
||||
if err != nil {
|
||||
err = autorest.NewErrorWithError(err, "storage.DeletedAccountsClient", "List", resp, "Failure responding to request")
|
||||
return
|
||||
}
|
||||
if result.dalr.hasNextLink() && result.dalr.IsEmpty() {
|
||||
err = result.NextWithContext(ctx)
|
||||
return
|
||||
}
|
||||
|
||||
return
|
||||
}
|
||||
|
||||
// ListPreparer prepares the List request.
|
||||
func (client DeletedAccountsClient) ListPreparer(ctx context.Context) (*http.Request, error) {
|
||||
pathParameters := map[string]interface{}{
|
||||
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
|
||||
}
|
||||
|
||||
const APIVersion = "2021-09-01"
|
||||
queryParameters := map[string]interface{}{
|
||||
"api-version": APIVersion,
|
||||
}
|
||||
|
||||
preparer := autorest.CreatePreparer(
|
||||
autorest.AsGet(),
|
||||
autorest.WithBaseURL(client.BaseURI),
|
||||
autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.Storage/deletedAccounts", 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 DeletedAccountsClient) 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 DeletedAccountsClient) ListResponder(resp *http.Response) (result DeletedAccountListResult, 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 DeletedAccountsClient) listNextResults(ctx context.Context, lastResults DeletedAccountListResult) (result DeletedAccountListResult, err error) {
|
||||
req, err := lastResults.deletedAccountListResultPreparer(ctx)
|
||||
if err != nil {
|
||||
return result, autorest.NewErrorWithError(err, "storage.DeletedAccountsClient", "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, "storage.DeletedAccountsClient", "listNextResults", resp, "Failure sending next results request")
|
||||
}
|
||||
result, err = client.ListResponder(resp)
|
||||
if err != nil {
|
||||
err = autorest.NewErrorWithError(err, "storage.DeletedAccountsClient", "listNextResults", resp, "Failure responding to next results request")
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
// ListComplete enumerates all values, automatically crossing page boundaries as required.
|
||||
func (client DeletedAccountsClient) ListComplete(ctx context.Context) (result DeletedAccountListResultIterator, err error) {
|
||||
if tracing.IsEnabled() {
|
||||
ctx = tracing.StartSpan(ctx, fqdn+"/DeletedAccountsClient.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)
|
||||
return
|
||||
}
|
|
@ -99,7 +99,7 @@ func (client EncryptionScopesClient) GetPreparer(ctx context.Context, resourceGr
|
|||
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
|
||||
}
|
||||
|
||||
const APIVersion = "2019-06-01"
|
||||
const APIVersion = "2021-09-01"
|
||||
queryParameters := map[string]interface{}{
|
||||
"api-version": APIVersion,
|
||||
}
|
||||
|
@ -195,7 +195,7 @@ func (client EncryptionScopesClient) ListPreparer(ctx context.Context, resourceG
|
|||
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
|
||||
}
|
||||
|
||||
const APIVersion = "2019-06-01"
|
||||
const APIVersion = "2021-09-01"
|
||||
queryParameters := map[string]interface{}{
|
||||
"api-version": APIVersion,
|
||||
}
|
||||
|
@ -332,7 +332,7 @@ func (client EncryptionScopesClient) PatchPreparer(ctx context.Context, resource
|
|||
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
|
||||
}
|
||||
|
||||
const APIVersion = "2019-06-01"
|
||||
const APIVersion = "2021-09-01"
|
||||
queryParameters := map[string]interface{}{
|
||||
"api-version": APIVersion,
|
||||
}
|
||||
|
@ -435,7 +435,7 @@ func (client EncryptionScopesClient) PutPreparer(ctx context.Context, resourceGr
|
|||
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
|
||||
}
|
||||
|
||||
const APIVersion = "2019-06-01"
|
||||
const APIVersion = "2021-09-01"
|
||||
queryParameters := map[string]interface{}{
|
||||
"api-version": APIVersion,
|
||||
}
|
1018
vendor/github.com/Azure/azure-sdk-for-go/services/storage/mgmt/2021-09-01/storage/enums.go
сгенерированный
поставляемый
Normal file
1018
vendor/github.com/Azure/azure-sdk-for-go/services/storage/mgmt/2021-09-01/storage/enums.go
сгенерированный
поставляемый
Normal file
Разница между файлами не показана из-за своего большого размера
Загрузить разницу
|
@ -93,7 +93,7 @@ func (client FileServicesClient) GetServicePropertiesPreparer(ctx context.Contex
|
|||
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
|
||||
}
|
||||
|
||||
const APIVersion = "2019-06-01"
|
||||
const APIVersion = "2021-09-01"
|
||||
queryParameters := map[string]interface{}{
|
||||
"api-version": APIVersion,
|
||||
}
|
||||
|
@ -184,7 +184,7 @@ func (client FileServicesClient) ListPreparer(ctx context.Context, resourceGroup
|
|||
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
|
||||
}
|
||||
|
||||
const APIVersion = "2019-06-01"
|
||||
const APIVersion = "2021-09-01"
|
||||
queryParameters := map[string]interface{}{
|
||||
"api-version": APIVersion,
|
||||
}
|
||||
|
@ -288,7 +288,7 @@ func (client FileServicesClient) SetServicePropertiesPreparer(ctx context.Contex
|
|||
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
|
||||
}
|
||||
|
||||
const APIVersion = "2019-06-01"
|
||||
const APIVersion = "2021-09-01"
|
||||
queryParameters := map[string]interface{}{
|
||||
"api-version": APIVersion,
|
||||
}
|
|
@ -42,7 +42,9 @@ func NewFileSharesClientWithBaseURI(baseURI string, subscriptionID string) FileS
|
|||
// between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-)
|
||||
// character must be immediately preceded and followed by a letter or number.
|
||||
// fileShare - properties of the file share to create.
|
||||
func (client FileSharesClient) Create(ctx context.Context, resourceGroupName string, accountName string, shareName string, fileShare FileShare) (result FileShare, err error) {
|
||||
// expand - optional, used to expand the properties within share's properties. Valid values are: snapshots.
|
||||
// Should be passed as a string with delimiter ','
|
||||
func (client FileSharesClient) Create(ctx context.Context, resourceGroupName string, accountName string, shareName string, fileShare FileShare, expand string) (result FileShare, err error) {
|
||||
if tracing.IsEnabled() {
|
||||
ctx = tracing.StartSpan(ctx, fqdn+"/FileSharesClient.Create")
|
||||
defer func() {
|
||||
|
@ -76,7 +78,7 @@ func (client FileSharesClient) Create(ctx context.Context, resourceGroupName str
|
|||
return result, validation.NewError("storage.FileSharesClient", "Create", err.Error())
|
||||
}
|
||||
|
||||
req, err := client.CreatePreparer(ctx, resourceGroupName, accountName, shareName, fileShare)
|
||||
req, err := client.CreatePreparer(ctx, resourceGroupName, accountName, shareName, fileShare, expand)
|
||||
if err != nil {
|
||||
err = autorest.NewErrorWithError(err, "storage.FileSharesClient", "Create", nil, "Failure preparing request")
|
||||
return
|
||||
|
@ -99,7 +101,7 @@ func (client FileSharesClient) Create(ctx context.Context, resourceGroupName str
|
|||
}
|
||||
|
||||
// CreatePreparer prepares the Create request.
|
||||
func (client FileSharesClient) CreatePreparer(ctx context.Context, resourceGroupName string, accountName string, shareName string, fileShare FileShare) (*http.Request, error) {
|
||||
func (client FileSharesClient) CreatePreparer(ctx context.Context, resourceGroupName string, accountName string, shareName string, fileShare FileShare, expand string) (*http.Request, error) {
|
||||
pathParameters := map[string]interface{}{
|
||||
"accountName": autorest.Encode("path", accountName),
|
||||
"resourceGroupName": autorest.Encode("path", resourceGroupName),
|
||||
|
@ -107,10 +109,13 @@ func (client FileSharesClient) CreatePreparer(ctx context.Context, resourceGroup
|
|||
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
|
||||
}
|
||||
|
||||
const APIVersion = "2019-06-01"
|
||||
const APIVersion = "2021-09-01"
|
||||
queryParameters := map[string]interface{}{
|
||||
"api-version": APIVersion,
|
||||
}
|
||||
if len(expand) > 0 {
|
||||
queryParameters["$expand"] = autorest.Encode("query", expand)
|
||||
}
|
||||
|
||||
preparer := autorest.CreatePreparer(
|
||||
autorest.AsContentType("application/json; charset=utf-8"),
|
||||
|
@ -149,7 +154,13 @@ func (client FileSharesClient) CreateResponder(resp *http.Response) (result File
|
|||
// shareName - the name of the file share within the specified storage account. File share names must be
|
||||
// between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-)
|
||||
// character must be immediately preceded and followed by a letter or number.
|
||||
func (client FileSharesClient) Delete(ctx context.Context, resourceGroupName string, accountName string, shareName string) (result autorest.Response, err error) {
|
||||
// xMsSnapshot - optional, used to delete a snapshot.
|
||||
// include - optional. Valid values are: snapshots, leased-snapshots, none. The default value is snapshots. For
|
||||
// 'snapshots', the file share is deleted including all of its file share snapshots. If the file share contains
|
||||
// leased-snapshots, the deletion fails. For 'leased-snapshots', the file share is deleted included all of its
|
||||
// file share snapshots (leased/unleased). For 'none', the file share is deleted if it has no share snapshots.
|
||||
// If the file share contains any snapshots (leased or unleased), the deletion fails.
|
||||
func (client FileSharesClient) Delete(ctx context.Context, resourceGroupName string, accountName string, shareName string, xMsSnapshot string, include string) (result autorest.Response, err error) {
|
||||
if tracing.IsEnabled() {
|
||||
ctx = tracing.StartSpan(ctx, fqdn+"/FileSharesClient.Delete")
|
||||
defer func() {
|
||||
|
@ -176,7 +187,7 @@ func (client FileSharesClient) Delete(ctx context.Context, resourceGroupName str
|
|||
return result, validation.NewError("storage.FileSharesClient", "Delete", err.Error())
|
||||
}
|
||||
|
||||
req, err := client.DeletePreparer(ctx, resourceGroupName, accountName, shareName)
|
||||
req, err := client.DeletePreparer(ctx, resourceGroupName, accountName, shareName, xMsSnapshot, include)
|
||||
if err != nil {
|
||||
err = autorest.NewErrorWithError(err, "storage.FileSharesClient", "Delete", nil, "Failure preparing request")
|
||||
return
|
||||
|
@ -199,7 +210,7 @@ func (client FileSharesClient) Delete(ctx context.Context, resourceGroupName str
|
|||
}
|
||||
|
||||
// DeletePreparer prepares the Delete request.
|
||||
func (client FileSharesClient) DeletePreparer(ctx context.Context, resourceGroupName string, accountName string, shareName string) (*http.Request, error) {
|
||||
func (client FileSharesClient) DeletePreparer(ctx context.Context, resourceGroupName string, accountName string, shareName string, xMsSnapshot string, include string) (*http.Request, error) {
|
||||
pathParameters := map[string]interface{}{
|
||||
"accountName": autorest.Encode("path", accountName),
|
||||
"resourceGroupName": autorest.Encode("path", resourceGroupName),
|
||||
|
@ -207,16 +218,23 @@ func (client FileSharesClient) DeletePreparer(ctx context.Context, resourceGroup
|
|||
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
|
||||
}
|
||||
|
||||
const APIVersion = "2019-06-01"
|
||||
const APIVersion = "2021-09-01"
|
||||
queryParameters := map[string]interface{}{
|
||||
"api-version": APIVersion,
|
||||
}
|
||||
if len(include) > 0 {
|
||||
queryParameters["$include"] = autorest.Encode("query", include)
|
||||
}
|
||||
|
||||
preparer := autorest.CreatePreparer(
|
||||
autorest.AsDelete(),
|
||||
autorest.WithBaseURL(client.BaseURI),
|
||||
autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/fileServices/default/shares/{shareName}", pathParameters),
|
||||
autorest.WithQueryParameters(queryParameters))
|
||||
if len(xMsSnapshot) > 0 {
|
||||
preparer = autorest.DecoratePreparer(preparer,
|
||||
autorest.WithHeader("x-ms-snapshot", autorest.String(xMsSnapshot)))
|
||||
}
|
||||
return preparer.Prepare((&http.Request{}).WithContext(ctx))
|
||||
}
|
||||
|
||||
|
@ -246,8 +264,10 @@ func (client FileSharesClient) DeleteResponder(resp *http.Response) (result auto
|
|||
// shareName - the name of the file share within the specified storage account. File share names must be
|
||||
// between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-)
|
||||
// character must be immediately preceded and followed by a letter or number.
|
||||
// expand - optional, used to expand the properties within share's properties.
|
||||
func (client FileSharesClient) Get(ctx context.Context, resourceGroupName string, accountName string, shareName string, expand GetShareExpand) (result FileShare, err error) {
|
||||
// expand - optional, used to expand the properties within share's properties. Valid values are: stats. Should
|
||||
// be passed as a string with delimiter ','.
|
||||
// xMsSnapshot - optional, used to retrieve properties of a snapshot.
|
||||
func (client FileSharesClient) Get(ctx context.Context, resourceGroupName string, accountName string, shareName string, expand string, xMsSnapshot string) (result FileShare, err error) {
|
||||
if tracing.IsEnabled() {
|
||||
ctx = tracing.StartSpan(ctx, fqdn+"/FileSharesClient.Get")
|
||||
defer func() {
|
||||
|
@ -274,7 +294,7 @@ func (client FileSharesClient) Get(ctx context.Context, resourceGroupName string
|
|||
return result, validation.NewError("storage.FileSharesClient", "Get", err.Error())
|
||||
}
|
||||
|
||||
req, err := client.GetPreparer(ctx, resourceGroupName, accountName, shareName, expand)
|
||||
req, err := client.GetPreparer(ctx, resourceGroupName, accountName, shareName, expand, xMsSnapshot)
|
||||
if err != nil {
|
||||
err = autorest.NewErrorWithError(err, "storage.FileSharesClient", "Get", nil, "Failure preparing request")
|
||||
return
|
||||
|
@ -297,7 +317,7 @@ func (client FileSharesClient) Get(ctx context.Context, resourceGroupName string
|
|||
}
|
||||
|
||||
// GetPreparer prepares the Get request.
|
||||
func (client FileSharesClient) GetPreparer(ctx context.Context, resourceGroupName string, accountName string, shareName string, expand GetShareExpand) (*http.Request, error) {
|
||||
func (client FileSharesClient) GetPreparer(ctx context.Context, resourceGroupName string, accountName string, shareName string, expand string, xMsSnapshot string) (*http.Request, error) {
|
||||
pathParameters := map[string]interface{}{
|
||||
"accountName": autorest.Encode("path", accountName),
|
||||
"resourceGroupName": autorest.Encode("path", resourceGroupName),
|
||||
|
@ -305,11 +325,11 @@ func (client FileSharesClient) GetPreparer(ctx context.Context, resourceGroupNam
|
|||
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
|
||||
}
|
||||
|
||||
const APIVersion = "2019-06-01"
|
||||
const APIVersion = "2021-09-01"
|
||||
queryParameters := map[string]interface{}{
|
||||
"api-version": APIVersion,
|
||||
}
|
||||
if len(string(expand)) > 0 {
|
||||
if len(expand) > 0 {
|
||||
queryParameters["$expand"] = autorest.Encode("query", expand)
|
||||
}
|
||||
|
||||
|
@ -318,6 +338,10 @@ func (client FileSharesClient) GetPreparer(ctx context.Context, resourceGroupNam
|
|||
autorest.WithBaseURL(client.BaseURI),
|
||||
autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/fileServices/default/shares/{shareName}", pathParameters),
|
||||
autorest.WithQueryParameters(queryParameters))
|
||||
if len(xMsSnapshot) > 0 {
|
||||
preparer = autorest.DecoratePreparer(preparer,
|
||||
autorest.WithHeader("x-ms-snapshot", autorest.String(xMsSnapshot)))
|
||||
}
|
||||
return preparer.Prepare((&http.Request{}).WithContext(ctx))
|
||||
}
|
||||
|
||||
|
@ -339,6 +363,116 @@ func (client FileSharesClient) GetResponder(resp *http.Response) (result FileSha
|
|||
return
|
||||
}
|
||||
|
||||
// Lease the Lease Share operation establishes and manages a lock on a share for delete operations. The lock duration
|
||||
// can be 15 to 60 seconds, or can be infinite.
|
||||
// Parameters:
|
||||
// resourceGroupName - the name of the resource group within the user's subscription. The name is case
|
||||
// insensitive.
|
||||
// accountName - the name of the storage account within the specified resource group. Storage account names
|
||||
// must be between 3 and 24 characters in length and use numbers and lower-case letters only.
|
||||
// shareName - the name of the file share within the specified storage account. File share names must be
|
||||
// between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-)
|
||||
// character must be immediately preceded and followed by a letter or number.
|
||||
// parameters - lease Share request body.
|
||||
// xMsSnapshot - optional. Specify the snapshot time to lease a snapshot.
|
||||
func (client FileSharesClient) Lease(ctx context.Context, resourceGroupName string, accountName string, shareName string, parameters *LeaseShareRequest, xMsSnapshot string) (result LeaseShareResponse, err error) {
|
||||
if tracing.IsEnabled() {
|
||||
ctx = tracing.StartSpan(ctx, fqdn+"/FileSharesClient.Lease")
|
||||
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: accountName,
|
||||
Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 24, Chain: nil},
|
||||
{Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}}},
|
||||
{TargetValue: shareName,
|
||||
Constraints: []validation.Constraint{{Target: "shareName", Name: validation.MaxLength, Rule: 63, Chain: nil},
|
||||
{Target: "shareName", Name: validation.MinLength, Rule: 3, Chain: nil}}},
|
||||
{TargetValue: client.SubscriptionID,
|
||||
Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}}); err != nil {
|
||||
return result, validation.NewError("storage.FileSharesClient", "Lease", err.Error())
|
||||
}
|
||||
|
||||
req, err := client.LeasePreparer(ctx, resourceGroupName, accountName, shareName, parameters, xMsSnapshot)
|
||||
if err != nil {
|
||||
err = autorest.NewErrorWithError(err, "storage.FileSharesClient", "Lease", nil, "Failure preparing request")
|
||||
return
|
||||
}
|
||||
|
||||
resp, err := client.LeaseSender(req)
|
||||
if err != nil {
|
||||
result.Response = autorest.Response{Response: resp}
|
||||
err = autorest.NewErrorWithError(err, "storage.FileSharesClient", "Lease", resp, "Failure sending request")
|
||||
return
|
||||
}
|
||||
|
||||
result, err = client.LeaseResponder(resp)
|
||||
if err != nil {
|
||||
err = autorest.NewErrorWithError(err, "storage.FileSharesClient", "Lease", resp, "Failure responding to request")
|
||||
return
|
||||
}
|
||||
|
||||
return
|
||||
}
|
||||
|
||||
// LeasePreparer prepares the Lease request.
|
||||
func (client FileSharesClient) LeasePreparer(ctx context.Context, resourceGroupName string, accountName string, shareName string, parameters *LeaseShareRequest, xMsSnapshot string) (*http.Request, error) {
|
||||
pathParameters := map[string]interface{}{
|
||||
"accountName": autorest.Encode("path", accountName),
|
||||
"resourceGroupName": autorest.Encode("path", resourceGroupName),
|
||||
"shareName": autorest.Encode("path", shareName),
|
||||
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
|
||||
}
|
||||
|
||||
const APIVersion = "2021-09-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.Storage/storageAccounts/{accountName}/fileServices/default/shares/{shareName}/lease", pathParameters),
|
||||
autorest.WithQueryParameters(queryParameters))
|
||||
if parameters != nil {
|
||||
preparer = autorest.DecoratePreparer(preparer,
|
||||
autorest.WithJSON(parameters))
|
||||
}
|
||||
if len(xMsSnapshot) > 0 {
|
||||
preparer = autorest.DecoratePreparer(preparer,
|
||||
autorest.WithHeader("x-ms-snapshot", autorest.String(xMsSnapshot)))
|
||||
}
|
||||
return preparer.Prepare((&http.Request{}).WithContext(ctx))
|
||||
}
|
||||
|
||||
// LeaseSender sends the Lease request. The method will close the
|
||||
// http.Response Body if it receives an error.
|
||||
func (client FileSharesClient) LeaseSender(req *http.Request) (*http.Response, error) {
|
||||
return client.Send(req, azure.DoRetryWithRegistration(client.Client))
|
||||
}
|
||||
|
||||
// LeaseResponder handles the response to the Lease request. The method always
|
||||
// closes the http.Response Body.
|
||||
func (client FileSharesClient) LeaseResponder(resp *http.Response) (result LeaseShareResponse, err error) {
|
||||
err = autorest.Respond(
|
||||
resp,
|
||||
azure.WithErrorUnlessStatusCode(http.StatusOK),
|
||||
autorest.ByUnmarshallingJSON(&result),
|
||||
autorest.ByClosing())
|
||||
result.Response = autorest.Response{Response: resp}
|
||||
return
|
||||
}
|
||||
|
||||
// List lists all shares.
|
||||
// Parameters:
|
||||
// resourceGroupName - the name of the resource group within the user's subscription. The name is case
|
||||
|
@ -347,8 +481,9 @@ func (client FileSharesClient) GetResponder(resp *http.Response) (result FileSha
|
|||
// must be between 3 and 24 characters in length and use numbers and lower-case letters only.
|
||||
// maxpagesize - optional. Specified maximum number of shares that can be included in the list.
|
||||
// filter - optional. When specified, only share names starting with the filter will be listed.
|
||||
// expand - optional, used to expand the properties within share's properties.
|
||||
func (client FileSharesClient) List(ctx context.Context, resourceGroupName string, accountName string, maxpagesize string, filter string, expand ListSharesExpand) (result FileShareItemsPage, err error) {
|
||||
// expand - optional, used to expand the properties within share's properties. Valid values are: deleted,
|
||||
// snapshots. Should be passed as a string with delimiter ','
|
||||
func (client FileSharesClient) List(ctx context.Context, resourceGroupName string, accountName string, maxpagesize string, filter string, expand string) (result FileShareItemsPage, err error) {
|
||||
if tracing.IsEnabled() {
|
||||
ctx = tracing.StartSpan(ctx, fqdn+"/FileSharesClient.List")
|
||||
defer func() {
|
||||
|
@ -400,14 +535,14 @@ func (client FileSharesClient) List(ctx context.Context, resourceGroupName strin
|
|||
}
|
||||
|
||||
// ListPreparer prepares the List request.
|
||||
func (client FileSharesClient) ListPreparer(ctx context.Context, resourceGroupName string, accountName string, maxpagesize string, filter string, expand ListSharesExpand) (*http.Request, error) {
|
||||
func (client FileSharesClient) ListPreparer(ctx context.Context, resourceGroupName string, accountName string, maxpagesize string, filter string, expand 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 = "2019-06-01"
|
||||
const APIVersion = "2021-09-01"
|
||||
queryParameters := map[string]interface{}{
|
||||
"api-version": APIVersion,
|
||||
}
|
||||
|
@ -417,7 +552,7 @@ func (client FileSharesClient) ListPreparer(ctx context.Context, resourceGroupNa
|
|||
if len(filter) > 0 {
|
||||
queryParameters["$filter"] = autorest.Encode("query", filter)
|
||||
}
|
||||
if len(string(expand)) > 0 {
|
||||
if len(expand) > 0 {
|
||||
queryParameters["$expand"] = autorest.Encode("query", expand)
|
||||
}
|
||||
|
||||
|
@ -469,7 +604,7 @@ func (client FileSharesClient) listNextResults(ctx context.Context, lastResults
|
|||
}
|
||||
|
||||
// ListComplete enumerates all values, automatically crossing page boundaries as required.
|
||||
func (client FileSharesClient) ListComplete(ctx context.Context, resourceGroupName string, accountName string, maxpagesize string, filter string, expand ListSharesExpand) (result FileShareItemsIterator, err error) {
|
||||
func (client FileSharesClient) ListComplete(ctx context.Context, resourceGroupName string, accountName string, maxpagesize string, filter string, expand string) (result FileShareItemsIterator, err error) {
|
||||
if tracing.IsEnabled() {
|
||||
ctx = tracing.StartSpan(ctx, fqdn+"/FileSharesClient.List")
|
||||
defer func() {
|
||||
|
@ -554,7 +689,7 @@ func (client FileSharesClient) RestorePreparer(ctx context.Context, resourceGrou
|
|||
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
|
||||
}
|
||||
|
||||
const APIVersion = "2019-06-01"
|
||||
const APIVersion = "2021-09-01"
|
||||
queryParameters := map[string]interface{}{
|
||||
"api-version": APIVersion,
|
||||
}
|
||||
|
@ -655,7 +790,7 @@ func (client FileSharesClient) UpdatePreparer(ctx context.Context, resourceGroup
|
|||
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
|
||||
}
|
||||
|
||||
const APIVersion = "2019-06-01"
|
||||
const APIVersion = "2021-09-01"
|
||||
queryParameters := map[string]interface{}{
|
||||
"api-version": APIVersion,
|
||||
}
|
610
vendor/github.com/Azure/azure-sdk-for-go/services/storage/mgmt/2021-09-01/storage/localusers.go
сгенерированный
поставляемый
Normal file
610
vendor/github.com/Azure/azure-sdk-for-go/services/storage/mgmt/2021-09-01/storage/localusers.go
сгенерированный
поставляемый
Normal file
|
@ -0,0 +1,610 @@
|
|||
package storage
|
||||
|
||||
// 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"
|
||||
)
|
||||
|
||||
// LocalUsersClient is the the Azure Storage Management API.
|
||||
type LocalUsersClient struct {
|
||||
BaseClient
|
||||
}
|
||||
|
||||
// NewLocalUsersClient creates an instance of the LocalUsersClient client.
|
||||
func NewLocalUsersClient(subscriptionID string) LocalUsersClient {
|
||||
return NewLocalUsersClientWithBaseURI(DefaultBaseURI, subscriptionID)
|
||||
}
|
||||
|
||||
// NewLocalUsersClientWithBaseURI creates an instance of the LocalUsersClient 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 NewLocalUsersClientWithBaseURI(baseURI string, subscriptionID string) LocalUsersClient {
|
||||
return LocalUsersClient{NewWithBaseURI(baseURI, subscriptionID)}
|
||||
}
|
||||
|
||||
// CreateOrUpdate create or update the properties of a local user associated with the storage account
|
||||
// Parameters:
|
||||
// resourceGroupName - the name of the resource group within the user's subscription. The name is case
|
||||
// insensitive.
|
||||
// accountName - the name of the storage account within the specified resource group. Storage account names
|
||||
// must be between 3 and 24 characters in length and use numbers and lower-case letters only.
|
||||
// username - the name of local user. The username must contain lowercase letters and numbers only. It must be
|
||||
// unique only within the storage account.
|
||||
// properties - the local user associated with a storage account.
|
||||
func (client LocalUsersClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, accountName string, username string, properties LocalUser) (result LocalUser, err error) {
|
||||
if tracing.IsEnabled() {
|
||||
ctx = tracing.StartSpan(ctx, fqdn+"/LocalUsersClient.CreateOrUpdate")
|
||||
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: accountName,
|
||||
Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 24, Chain: nil},
|
||||
{Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}}},
|
||||
{TargetValue: client.SubscriptionID,
|
||||
Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}},
|
||||
{TargetValue: username,
|
||||
Constraints: []validation.Constraint{{Target: "username", Name: validation.MaxLength, Rule: 64, Chain: nil},
|
||||
{Target: "username", Name: validation.MinLength, Rule: 3, Chain: nil}}}}); err != nil {
|
||||
return result, validation.NewError("storage.LocalUsersClient", "CreateOrUpdate", err.Error())
|
||||
}
|
||||
|
||||
req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, accountName, username, properties)
|
||||
if err != nil {
|
||||
err = autorest.NewErrorWithError(err, "storage.LocalUsersClient", "CreateOrUpdate", nil, "Failure preparing request")
|
||||
return
|
||||
}
|
||||
|
||||
resp, err := client.CreateOrUpdateSender(req)
|
||||
if err != nil {
|
||||
result.Response = autorest.Response{Response: resp}
|
||||
err = autorest.NewErrorWithError(err, "storage.LocalUsersClient", "CreateOrUpdate", resp, "Failure sending request")
|
||||
return
|
||||
}
|
||||
|
||||
result, err = client.CreateOrUpdateResponder(resp)
|
||||
if err != nil {
|
||||
err = autorest.NewErrorWithError(err, "storage.LocalUsersClient", "CreateOrUpdate", resp, "Failure responding to request")
|
||||
return
|
||||
}
|
||||
|
||||
return
|
||||
}
|
||||
|
||||
// CreateOrUpdatePreparer prepares the CreateOrUpdate request.
|
||||
func (client LocalUsersClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, accountName string, username string, properties LocalUser) (*http.Request, error) {
|
||||
pathParameters := map[string]interface{}{
|
||||
"accountName": autorest.Encode("path", accountName),
|
||||
"resourceGroupName": autorest.Encode("path", resourceGroupName),
|
||||
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
|
||||
"username": autorest.Encode("path", username),
|
||||
}
|
||||
|
||||
const APIVersion = "2021-09-01"
|
||||
queryParameters := map[string]interface{}{
|
||||
"api-version": APIVersion,
|
||||
}
|
||||
|
||||
preparer := autorest.CreatePreparer(
|
||||
autorest.AsContentType("application/json; charset=utf-8"),
|
||||
autorest.AsPut(),
|
||||
autorest.WithBaseURL(client.BaseURI),
|
||||
autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/localUsers/{username}", pathParameters),
|
||||
autorest.WithJSON(properties),
|
||||
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 LocalUsersClient) CreateOrUpdateSender(req *http.Request) (*http.Response, error) {
|
||||
return client.Send(req, azure.DoRetryWithRegistration(client.Client))
|
||||
}
|
||||
|
||||
// CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always
|
||||
// closes the http.Response Body.
|
||||
func (client LocalUsersClient) CreateOrUpdateResponder(resp *http.Response) (result LocalUser, err error) {
|
||||
err = autorest.Respond(
|
||||
resp,
|
||||
azure.WithErrorUnlessStatusCode(http.StatusOK),
|
||||
autorest.ByUnmarshallingJSON(&result),
|
||||
autorest.ByClosing())
|
||||
result.Response = autorest.Response{Response: resp}
|
||||
return
|
||||
}
|
||||
|
||||
// Delete deletes the local user associated with the specified storage account.
|
||||
// Parameters:
|
||||
// resourceGroupName - the name of the resource group within the user's subscription. The name is case
|
||||
// insensitive.
|
||||
// accountName - the name of the storage account within the specified resource group. Storage account names
|
||||
// must be between 3 and 24 characters in length and use numbers and lower-case letters only.
|
||||
// username - the name of local user. The username must contain lowercase letters and numbers only. It must be
|
||||
// unique only within the storage account.
|
||||
func (client LocalUsersClient) Delete(ctx context.Context, resourceGroupName string, accountName string, username string) (result autorest.Response, err error) {
|
||||
if tracing.IsEnabled() {
|
||||
ctx = tracing.StartSpan(ctx, fqdn+"/LocalUsersClient.Delete")
|
||||
defer func() {
|
||||
sc := -1
|
||||
if result.Response != nil {
|
||||
sc = result.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: accountName,
|
||||
Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 24, Chain: nil},
|
||||
{Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}}},
|
||||
{TargetValue: client.SubscriptionID,
|
||||
Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}},
|
||||
{TargetValue: username,
|
||||
Constraints: []validation.Constraint{{Target: "username", Name: validation.MaxLength, Rule: 64, Chain: nil},
|
||||
{Target: "username", Name: validation.MinLength, Rule: 3, Chain: nil}}}}); err != nil {
|
||||
return result, validation.NewError("storage.LocalUsersClient", "Delete", err.Error())
|
||||
}
|
||||
|
||||
req, err := client.DeletePreparer(ctx, resourceGroupName, accountName, username)
|
||||
if err != nil {
|
||||
err = autorest.NewErrorWithError(err, "storage.LocalUsersClient", "Delete", nil, "Failure preparing request")
|
||||
return
|
||||
}
|
||||
|
||||
resp, err := client.DeleteSender(req)
|
||||
if err != nil {
|
||||
result.Response = resp
|
||||
err = autorest.NewErrorWithError(err, "storage.LocalUsersClient", "Delete", resp, "Failure sending request")
|
||||
return
|
||||
}
|
||||
|
||||
result, err = client.DeleteResponder(resp)
|
||||
if err != nil {
|
||||
err = autorest.NewErrorWithError(err, "storage.LocalUsersClient", "Delete", resp, "Failure responding to request")
|
||||
return
|
||||
}
|
||||
|
||||
return
|
||||
}
|
||||
|
||||
// DeletePreparer prepares the Delete request.
|
||||
func (client LocalUsersClient) DeletePreparer(ctx context.Context, resourceGroupName string, accountName string, username string) (*http.Request, error) {
|
||||
pathParameters := map[string]interface{}{
|
||||
"accountName": autorest.Encode("path", accountName),
|
||||
"resourceGroupName": autorest.Encode("path", resourceGroupName),
|
||||
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
|
||||
"username": autorest.Encode("path", username),
|
||||
}
|
||||
|
||||
const APIVersion = "2021-09-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.Storage/storageAccounts/{accountName}/localUsers/{username}", 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 LocalUsersClient) DeleteSender(req *http.Request) (*http.Response, error) {
|
||||
return client.Send(req, azure.DoRetryWithRegistration(client.Client))
|
||||
}
|
||||
|
||||
// DeleteResponder handles the response to the Delete request. The method always
|
||||
// closes the http.Response Body.
|
||||
func (client LocalUsersClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) {
|
||||
err = autorest.Respond(
|
||||
resp,
|
||||
azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent),
|
||||
autorest.ByClosing())
|
||||
result.Response = resp
|
||||
return
|
||||
}
|
||||
|
||||
// Get get the local user of the storage account by username.
|
||||
// Parameters:
|
||||
// resourceGroupName - the name of the resource group within the user's subscription. The name is case
|
||||
// insensitive.
|
||||
// accountName - the name of the storage account within the specified resource group. Storage account names
|
||||
// must be between 3 and 24 characters in length and use numbers and lower-case letters only.
|
||||
// username - the name of local user. The username must contain lowercase letters and numbers only. It must be
|
||||
// unique only within the storage account.
|
||||
func (client LocalUsersClient) Get(ctx context.Context, resourceGroupName string, accountName string, username string) (result LocalUser, err error) {
|
||||
if tracing.IsEnabled() {
|
||||
ctx = tracing.StartSpan(ctx, fqdn+"/LocalUsersClient.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: accountName,
|
||||
Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 24, Chain: nil},
|
||||
{Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}}},
|
||||
{TargetValue: client.SubscriptionID,
|
||||
Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}},
|
||||
{TargetValue: username,
|
||||
Constraints: []validation.Constraint{{Target: "username", Name: validation.MaxLength, Rule: 64, Chain: nil},
|
||||
{Target: "username", Name: validation.MinLength, Rule: 3, Chain: nil}}}}); err != nil {
|
||||
return result, validation.NewError("storage.LocalUsersClient", "Get", err.Error())
|
||||
}
|
||||
|
||||
req, err := client.GetPreparer(ctx, resourceGroupName, accountName, username)
|
||||
if err != nil {
|
||||
err = autorest.NewErrorWithError(err, "storage.LocalUsersClient", "Get", nil, "Failure preparing request")
|
||||
return
|
||||
}
|
||||
|
||||
resp, err := client.GetSender(req)
|
||||
if err != nil {
|
||||
result.Response = autorest.Response{Response: resp}
|
||||
err = autorest.NewErrorWithError(err, "storage.LocalUsersClient", "Get", resp, "Failure sending request")
|
||||
return
|
||||
}
|
||||
|
||||
result, err = client.GetResponder(resp)
|
||||
if err != nil {
|
||||
err = autorest.NewErrorWithError(err, "storage.LocalUsersClient", "Get", resp, "Failure responding to request")
|
||||
return
|
||||
}
|
||||
|
||||
return
|
||||
}
|
||||
|
||||
// GetPreparer prepares the Get request.
|
||||
func (client LocalUsersClient) GetPreparer(ctx context.Context, resourceGroupName string, accountName string, username string) (*http.Request, error) {
|
||||
pathParameters := map[string]interface{}{
|
||||
"accountName": autorest.Encode("path", accountName),
|
||||
"resourceGroupName": autorest.Encode("path", resourceGroupName),
|
||||
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
|
||||
"username": autorest.Encode("path", username),
|
||||
}
|
||||
|
||||
const APIVersion = "2021-09-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.Storage/storageAccounts/{accountName}/localUsers/{username}", 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 LocalUsersClient) 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 LocalUsersClient) GetResponder(resp *http.Response) (result LocalUser, err error) {
|
||||
err = autorest.Respond(
|
||||
resp,
|
||||
azure.WithErrorUnlessStatusCode(http.StatusOK),
|
||||
autorest.ByUnmarshallingJSON(&result),
|
||||
autorest.ByClosing())
|
||||
result.Response = autorest.Response{Response: resp}
|
||||
return
|
||||
}
|
||||
|
||||
// List list the local users associated with the storage account.
|
||||
// Parameters:
|
||||
// resourceGroupName - the name of the resource group within the user's subscription. The name is case
|
||||
// insensitive.
|
||||
// accountName - the name of the storage account within the specified resource group. Storage account names
|
||||
// must be between 3 and 24 characters in length and use numbers and lower-case letters only.
|
||||
func (client LocalUsersClient) List(ctx context.Context, resourceGroupName string, accountName string) (result LocalUsers, err error) {
|
||||
if tracing.IsEnabled() {
|
||||
ctx = tracing.StartSpan(ctx, fqdn+"/LocalUsersClient.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: accountName,
|
||||
Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 24, Chain: nil},
|
||||
{Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}}},
|
||||
{TargetValue: client.SubscriptionID,
|
||||
Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}}); err != nil {
|
||||
return result, validation.NewError("storage.LocalUsersClient", "List", err.Error())
|
||||
}
|
||||
|
||||
req, err := client.ListPreparer(ctx, resourceGroupName, accountName)
|
||||
if err != nil {
|
||||
err = autorest.NewErrorWithError(err, "storage.LocalUsersClient", "List", nil, "Failure preparing request")
|
||||
return
|
||||
}
|
||||
|
||||
resp, err := client.ListSender(req)
|
||||
if err != nil {
|
||||
result.Response = autorest.Response{Response: resp}
|
||||
err = autorest.NewErrorWithError(err, "storage.LocalUsersClient", "List", resp, "Failure sending request")
|
||||
return
|
||||
}
|
||||
|
||||
result, err = client.ListResponder(resp)
|
||||
if err != nil {
|
||||
err = autorest.NewErrorWithError(err, "storage.LocalUsersClient", "List", resp, "Failure responding to request")
|
||||
return
|
||||
}
|
||||
|
||||
return
|
||||
}
|
||||
|
||||
// ListPreparer prepares the List request.
|
||||
func (client LocalUsersClient) 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-09-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.Storage/storageAccounts/{accountName}/localUsers", 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 LocalUsersClient) 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 LocalUsersClient) ListResponder(resp *http.Response) (result LocalUsers, err error) {
|
||||
err = autorest.Respond(
|
||||
resp,
|
||||
azure.WithErrorUnlessStatusCode(http.StatusOK),
|
||||
autorest.ByUnmarshallingJSON(&result),
|
||||
autorest.ByClosing())
|
||||
result.Response = autorest.Response{Response: resp}
|
||||
return
|
||||
}
|
||||
|
||||
// ListKeys list SSH authorized keys and shared key of the local user.
|
||||
// Parameters:
|
||||
// resourceGroupName - the name of the resource group within the user's subscription. The name is case
|
||||
// insensitive.
|
||||
// accountName - the name of the storage account within the specified resource group. Storage account names
|
||||
// must be between 3 and 24 characters in length and use numbers and lower-case letters only.
|
||||
// username - the name of local user. The username must contain lowercase letters and numbers only. It must be
|
||||
// unique only within the storage account.
|
||||
func (client LocalUsersClient) ListKeys(ctx context.Context, resourceGroupName string, accountName string, username string) (result LocalUserKeys, err error) {
|
||||
if tracing.IsEnabled() {
|
||||
ctx = tracing.StartSpan(ctx, fqdn+"/LocalUsersClient.ListKeys")
|
||||
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: accountName,
|
||||
Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 24, Chain: nil},
|
||||
{Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}}},
|
||||
{TargetValue: client.SubscriptionID,
|
||||
Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}},
|
||||
{TargetValue: username,
|
||||
Constraints: []validation.Constraint{{Target: "username", Name: validation.MaxLength, Rule: 64, Chain: nil},
|
||||
{Target: "username", Name: validation.MinLength, Rule: 3, Chain: nil}}}}); err != nil {
|
||||
return result, validation.NewError("storage.LocalUsersClient", "ListKeys", err.Error())
|
||||
}
|
||||
|
||||
req, err := client.ListKeysPreparer(ctx, resourceGroupName, accountName, username)
|
||||
if err != nil {
|
||||
err = autorest.NewErrorWithError(err, "storage.LocalUsersClient", "ListKeys", nil, "Failure preparing request")
|
||||
return
|
||||
}
|
||||
|
||||
resp, err := client.ListKeysSender(req)
|
||||
if err != nil {
|
||||
result.Response = autorest.Response{Response: resp}
|
||||
err = autorest.NewErrorWithError(err, "storage.LocalUsersClient", "ListKeys", resp, "Failure sending request")
|
||||
return
|
||||
}
|
||||
|
||||
result, err = client.ListKeysResponder(resp)
|
||||
if err != nil {
|
||||
err = autorest.NewErrorWithError(err, "storage.LocalUsersClient", "ListKeys", resp, "Failure responding to request")
|
||||
return
|
||||
}
|
||||
|
||||
return
|
||||
}
|
||||
|
||||
// ListKeysPreparer prepares the ListKeys request.
|
||||
func (client LocalUsersClient) ListKeysPreparer(ctx context.Context, resourceGroupName string, accountName string, username string) (*http.Request, error) {
|
||||
pathParameters := map[string]interface{}{
|
||||
"accountName": autorest.Encode("path", accountName),
|
||||
"resourceGroupName": autorest.Encode("path", resourceGroupName),
|
||||
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
|
||||
"username": autorest.Encode("path", username),
|
||||
}
|
||||
|
||||
const APIVersion = "2021-09-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.Storage/storageAccounts/{accountName}/localUsers/{username}/listKeys", pathParameters),
|
||||
autorest.WithQueryParameters(queryParameters))
|
||||
return preparer.Prepare((&http.Request{}).WithContext(ctx))
|
||||
}
|
||||
|
||||
// ListKeysSender sends the ListKeys request. The method will close the
|
||||
// http.Response Body if it receives an error.
|
||||
func (client LocalUsersClient) ListKeysSender(req *http.Request) (*http.Response, error) {
|
||||
return client.Send(req, azure.DoRetryWithRegistration(client.Client))
|
||||
}
|
||||
|
||||
// ListKeysResponder handles the response to the ListKeys request. The method always
|
||||
// closes the http.Response Body.
|
||||
func (client LocalUsersClient) ListKeysResponder(resp *http.Response) (result LocalUserKeys, err error) {
|
||||
err = autorest.Respond(
|
||||
resp,
|
||||
azure.WithErrorUnlessStatusCode(http.StatusOK),
|
||||
autorest.ByUnmarshallingJSON(&result),
|
||||
autorest.ByClosing())
|
||||
result.Response = autorest.Response{Response: resp}
|
||||
return
|
||||
}
|
||||
|
||||
// RegeneratePassword regenerate the local user SSH password.
|
||||
// Parameters:
|
||||
// resourceGroupName - the name of the resource group within the user's subscription. The name is case
|
||||
// insensitive.
|
||||
// accountName - the name of the storage account within the specified resource group. Storage account names
|
||||
// must be between 3 and 24 characters in length and use numbers and lower-case letters only.
|
||||
// username - the name of local user. The username must contain lowercase letters and numbers only. It must be
|
||||
// unique only within the storage account.
|
||||
func (client LocalUsersClient) RegeneratePassword(ctx context.Context, resourceGroupName string, accountName string, username string) (result LocalUserRegeneratePasswordResult, err error) {
|
||||
if tracing.IsEnabled() {
|
||||
ctx = tracing.StartSpan(ctx, fqdn+"/LocalUsersClient.RegeneratePassword")
|
||||
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: accountName,
|
||||
Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 24, Chain: nil},
|
||||
{Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}}},
|
||||
{TargetValue: client.SubscriptionID,
|
||||
Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}},
|
||||
{TargetValue: username,
|
||||
Constraints: []validation.Constraint{{Target: "username", Name: validation.MaxLength, Rule: 64, Chain: nil},
|
||||
{Target: "username", Name: validation.MinLength, Rule: 3, Chain: nil}}}}); err != nil {
|
||||
return result, validation.NewError("storage.LocalUsersClient", "RegeneratePassword", err.Error())
|
||||
}
|
||||
|
||||
req, err := client.RegeneratePasswordPreparer(ctx, resourceGroupName, accountName, username)
|
||||
if err != nil {
|
||||
err = autorest.NewErrorWithError(err, "storage.LocalUsersClient", "RegeneratePassword", nil, "Failure preparing request")
|
||||
return
|
||||
}
|
||||
|
||||
resp, err := client.RegeneratePasswordSender(req)
|
||||
if err != nil {
|
||||
result.Response = autorest.Response{Response: resp}
|
||||
err = autorest.NewErrorWithError(err, "storage.LocalUsersClient", "RegeneratePassword", resp, "Failure sending request")
|
||||
return
|
||||
}
|
||||
|
||||
result, err = client.RegeneratePasswordResponder(resp)
|
||||
if err != nil {
|
||||
err = autorest.NewErrorWithError(err, "storage.LocalUsersClient", "RegeneratePassword", resp, "Failure responding to request")
|
||||
return
|
||||
}
|
||||
|
||||
return
|
||||
}
|
||||
|
||||
// RegeneratePasswordPreparer prepares the RegeneratePassword request.
|
||||
func (client LocalUsersClient) RegeneratePasswordPreparer(ctx context.Context, resourceGroupName string, accountName string, username string) (*http.Request, error) {
|
||||
pathParameters := map[string]interface{}{
|
||||
"accountName": autorest.Encode("path", accountName),
|
||||
"resourceGroupName": autorest.Encode("path", resourceGroupName),
|
||||
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
|
||||
"username": autorest.Encode("path", username),
|
||||
}
|
||||
|
||||
const APIVersion = "2021-09-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.Storage/storageAccounts/{accountName}/localUsers/{username}/regeneratePassword", pathParameters),
|
||||
autorest.WithQueryParameters(queryParameters))
|
||||
return preparer.Prepare((&http.Request{}).WithContext(ctx))
|
||||
}
|
||||
|
||||
// RegeneratePasswordSender sends the RegeneratePassword request. The method will close the
|
||||
// http.Response Body if it receives an error.
|
||||
func (client LocalUsersClient) RegeneratePasswordSender(req *http.Request) (*http.Response, error) {
|
||||
return client.Send(req, azure.DoRetryWithRegistration(client.Client))
|
||||
}
|
||||
|
||||
// RegeneratePasswordResponder handles the response to the RegeneratePassword request. The method always
|
||||
// closes the http.Response Body.
|
||||
func (client LocalUsersClient) RegeneratePasswordResponder(resp *http.Response) (result LocalUserRegeneratePasswordResult, err error) {
|
||||
err = autorest.Respond(
|
||||
resp,
|
||||
azure.WithErrorUnlessStatusCode(http.StatusOK),
|
||||
autorest.ByUnmarshallingJSON(&result),
|
||||
autorest.ByClosing())
|
||||
result.Response = autorest.Response{Response: resp}
|
||||
return
|
||||
}
|
|
@ -99,7 +99,7 @@ func (client ManagementPoliciesClient) CreateOrUpdatePreparer(ctx context.Contex
|
|||
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
|
||||
}
|
||||
|
||||
const APIVersion = "2019-06-01"
|
||||
const APIVersion = "2021-09-01"
|
||||
queryParameters := map[string]interface{}{
|
||||
"api-version": APIVersion,
|
||||
}
|
||||
|
@ -193,7 +193,7 @@ func (client ManagementPoliciesClient) DeletePreparer(ctx context.Context, resou
|
|||
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
|
||||
}
|
||||
|
||||
const APIVersion = "2019-06-01"
|
||||
const APIVersion = "2021-09-01"
|
||||
queryParameters := map[string]interface{}{
|
||||
"api-version": APIVersion,
|
||||
}
|
||||
|
@ -284,7 +284,7 @@ func (client ManagementPoliciesClient) GetPreparer(ctx context.Context, resource
|
|||
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
|
||||
}
|
||||
|
||||
const APIVersion = "2019-06-01"
|
||||
const APIVersion = "2021-09-01"
|
||||
queryParameters := map[string]interface{}{
|
||||
"api-version": APIVersion,
|
||||
}
|
Разница между файлами не показана из-за своего большого размера
Загрузить разницу
|
@ -38,7 +38,10 @@ func NewObjectReplicationPoliciesClientWithBaseURI(baseURI string, subscriptionI
|
|||
// insensitive.
|
||||
// accountName - the name of the storage account within the specified resource group. Storage account names
|
||||
// must be between 3 and 24 characters in length and use numbers and lower-case letters only.
|
||||
// objectReplicationPolicyID - the ID of object replication policy or 'default' if the policy ID is unknown.
|
||||
// objectReplicationPolicyID - for the destination account, provide the value 'default'. Configure the policy
|
||||
// on the destination account first. For the source account, provide the value of the policy ID that is
|
||||
// returned when you download the policy that was defined on the destination account. The policy is downloaded
|
||||
// as a JSON file.
|
||||
// properties - the object replication policy set to a storage account. A unique policy ID will be created if
|
||||
// absent.
|
||||
func (client ObjectReplicationPoliciesClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, accountName string, objectReplicationPolicyID string, properties ObjectReplicationPolicy) (result ObjectReplicationPolicy, err error) {
|
||||
|
@ -103,7 +106,7 @@ func (client ObjectReplicationPoliciesClient) CreateOrUpdatePreparer(ctx context
|
|||
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
|
||||
}
|
||||
|
||||
const APIVersion = "2019-06-01"
|
||||
const APIVersion = "2021-09-01"
|
||||
queryParameters := map[string]interface{}{
|
||||
"api-version": APIVersion,
|
||||
}
|
||||
|
@ -142,7 +145,10 @@ func (client ObjectReplicationPoliciesClient) CreateOrUpdateResponder(resp *http
|
|||
// insensitive.
|
||||
// accountName - the name of the storage account within the specified resource group. Storage account names
|
||||
// must be between 3 and 24 characters in length and use numbers and lower-case letters only.
|
||||
// objectReplicationPolicyID - the ID of object replication policy or 'default' if the policy ID is unknown.
|
||||
// objectReplicationPolicyID - for the destination account, provide the value 'default'. Configure the policy
|
||||
// on the destination account first. For the source account, provide the value of the policy ID that is
|
||||
// returned when you download the policy that was defined on the destination account. The policy is downloaded
|
||||
// as a JSON file.
|
||||
func (client ObjectReplicationPoliciesClient) Delete(ctx context.Context, resourceGroupName string, accountName string, objectReplicationPolicyID string) (result autorest.Response, err error) {
|
||||
if tracing.IsEnabled() {
|
||||
ctx = tracing.StartSpan(ctx, fqdn+"/ObjectReplicationPoliciesClient.Delete")
|
||||
|
@ -200,7 +206,7 @@ func (client ObjectReplicationPoliciesClient) DeletePreparer(ctx context.Context
|
|||
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
|
||||
}
|
||||
|
||||
const APIVersion = "2019-06-01"
|
||||
const APIVersion = "2021-09-01"
|
||||
queryParameters := map[string]interface{}{
|
||||
"api-version": APIVersion,
|
||||
}
|
||||
|
@ -236,7 +242,10 @@ func (client ObjectReplicationPoliciesClient) DeleteResponder(resp *http.Respons
|
|||
// insensitive.
|
||||
// accountName - the name of the storage account within the specified resource group. Storage account names
|
||||
// must be between 3 and 24 characters in length and use numbers and lower-case letters only.
|
||||
// objectReplicationPolicyID - the ID of object replication policy or 'default' if the policy ID is unknown.
|
||||
// objectReplicationPolicyID - for the destination account, provide the value 'default'. Configure the policy
|
||||
// on the destination account first. For the source account, provide the value of the policy ID that is
|
||||
// returned when you download the policy that was defined on the destination account. The policy is downloaded
|
||||
// as a JSON file.
|
||||
func (client ObjectReplicationPoliciesClient) Get(ctx context.Context, resourceGroupName string, accountName string, objectReplicationPolicyID string) (result ObjectReplicationPolicy, err error) {
|
||||
if tracing.IsEnabled() {
|
||||
ctx = tracing.StartSpan(ctx, fqdn+"/ObjectReplicationPoliciesClient.Get")
|
||||
|
@ -294,7 +303,7 @@ func (client ObjectReplicationPoliciesClient) GetPreparer(ctx context.Context, r
|
|||
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
|
||||
}
|
||||
|
||||
const APIVersion = "2019-06-01"
|
||||
const APIVersion = "2021-09-01"
|
||||
queryParameters := map[string]interface{}{
|
||||
"api-version": APIVersion,
|
||||
}
|
||||
|
@ -385,7 +394,7 @@ func (client ObjectReplicationPoliciesClient) ListPreparer(ctx context.Context,
|
|||
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
|
||||
}
|
||||
|
||||
const APIVersion = "2019-06-01"
|
||||
const APIVersion = "2021-09-01"
|
||||
queryParameters := map[string]interface{}{
|
||||
"api-version": APIVersion,
|
||||
}
|
|
@ -66,7 +66,7 @@ func (client OperationsClient) List(ctx context.Context) (result OperationListRe
|
|||
|
||||
// ListPreparer prepares the List request.
|
||||
func (client OperationsClient) ListPreparer(ctx context.Context) (*http.Request, error) {
|
||||
const APIVersion = "2019-06-01"
|
||||
const APIVersion = "2021-09-01"
|
||||
queryParameters := map[string]interface{}{
|
||||
"api-version": APIVersion,
|
||||
}
|
|
@ -95,7 +95,7 @@ func (client PrivateEndpointConnectionsClient) DeletePreparer(ctx context.Contex
|
|||
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
|
||||
}
|
||||
|
||||
const APIVersion = "2019-06-01"
|
||||
const APIVersion = "2021-09-01"
|
||||
queryParameters := map[string]interface{}{
|
||||
"api-version": APIVersion,
|
||||
}
|
||||
|
@ -188,7 +188,7 @@ func (client PrivateEndpointConnectionsClient) GetPreparer(ctx context.Context,
|
|||
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
|
||||
}
|
||||
|
||||
const APIVersion = "2019-06-01"
|
||||
const APIVersion = "2021-09-01"
|
||||
queryParameters := map[string]interface{}{
|
||||
"api-version": APIVersion,
|
||||
}
|
||||
|
@ -279,7 +279,7 @@ func (client PrivateEndpointConnectionsClient) ListPreparer(ctx context.Context,
|
|||
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
|
||||
}
|
||||
|
||||
const APIVersion = "2019-06-01"
|
||||
const APIVersion = "2021-09-01"
|
||||
queryParameters := map[string]interface{}{
|
||||
"api-version": APIVersion,
|
||||
}
|
||||
|
@ -377,7 +377,7 @@ func (client PrivateEndpointConnectionsClient) PutPreparer(ctx context.Context,
|
|||
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
|
||||
}
|
||||
|
||||
const APIVersion = "2019-06-01"
|
||||
const APIVersion = "2021-09-01"
|
||||
queryParameters := map[string]interface{}{
|
||||
"api-version": APIVersion,
|
||||
}
|
|
@ -92,7 +92,7 @@ func (client PrivateLinkResourcesClient) ListByStorageAccountPreparer(ctx contex
|
|||
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
|
||||
}
|
||||
|
||||
const APIVersion = "2019-06-01"
|
||||
const APIVersion = "2021-09-01"
|
||||
queryParameters := map[string]interface{}{
|
||||
"api-version": APIVersion,
|
||||
}
|
|
@ -99,7 +99,7 @@ func (client QueueClient) CreatePreparer(ctx context.Context, resourceGroupName
|
|||
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
|
||||
}
|
||||
|
||||
const APIVersion = "2019-06-01"
|
||||
const APIVersion = "2021-09-01"
|
||||
queryParameters := map[string]interface{}{
|
||||
"api-version": APIVersion,
|
||||
}
|
||||
|
@ -199,7 +199,7 @@ func (client QueueClient) DeletePreparer(ctx context.Context, resourceGroupName
|
|||
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
|
||||
}
|
||||
|
||||
const APIVersion = "2019-06-01"
|
||||
const APIVersion = "2021-09-01"
|
||||
queryParameters := map[string]interface{}{
|
||||
"api-version": APIVersion,
|
||||
}
|
||||
|
@ -296,7 +296,7 @@ func (client QueueClient) GetPreparer(ctx context.Context, resourceGroupName str
|
|||
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
|
||||
}
|
||||
|
||||
const APIVersion = "2019-06-01"
|
||||
const APIVersion = "2021-09-01"
|
||||
queryParameters := map[string]interface{}{
|
||||
"api-version": APIVersion,
|
||||
}
|
||||
|
@ -395,7 +395,7 @@ func (client QueueClient) ListPreparer(ctx context.Context, resourceGroupName st
|
|||
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
|
||||
}
|
||||
|
||||
const APIVersion = "2019-06-01"
|
||||
const APIVersion = "2021-09-01"
|
||||
queryParameters := map[string]interface{}{
|
||||
"api-version": APIVersion,
|
||||
}
|
||||
|
@ -537,7 +537,7 @@ func (client QueueClient) UpdatePreparer(ctx context.Context, resourceGroupName
|
|||
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
|
||||
}
|
||||
|
||||
const APIVersion = "2019-06-01"
|
||||
const APIVersion = "2021-09-01"
|
||||
queryParameters := map[string]interface{}{
|
||||
"api-version": APIVersion,
|
||||
}
|
|
@ -93,7 +93,7 @@ func (client QueueServicesClient) GetServicePropertiesPreparer(ctx context.Conte
|
|||
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
|
||||
}
|
||||
|
||||
const APIVersion = "2019-06-01"
|
||||
const APIVersion = "2021-09-01"
|
||||
queryParameters := map[string]interface{}{
|
||||
"api-version": APIVersion,
|
||||
}
|
||||
|
@ -184,7 +184,7 @@ func (client QueueServicesClient) ListPreparer(ctx context.Context, resourceGrou
|
|||
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
|
||||
}
|
||||
|
||||
const APIVersion = "2019-06-01"
|
||||
const APIVersion = "2021-09-01"
|
||||
queryParameters := map[string]interface{}{
|
||||
"api-version": APIVersion,
|
||||
}
|
||||
|
@ -279,7 +279,7 @@ func (client QueueServicesClient) SetServicePropertiesPreparer(ctx context.Conte
|
|||
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
|
||||
}
|
||||
|
||||
const APIVersion = "2019-06-01"
|
||||
const APIVersion = "2021-09-01"
|
||||
queryParameters := map[string]interface{}{
|
||||
"api-version": APIVersion,
|
||||
}
|
|
@ -77,7 +77,7 @@ func (client SkusClient) ListPreparer(ctx context.Context) (*http.Request, error
|
|||
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
|
||||
}
|
||||
|
||||
const APIVersion = "2019-06-01"
|
||||
const APIVersion = "2021-09-01"
|
||||
queryParameters := map[string]interface{}{
|
||||
"api-version": APIVersion,
|
||||
}
|
|
@ -39,7 +39,8 @@ func NewTableClientWithBaseURI(baseURI string, subscriptionID string) TableClien
|
|||
// must be between 3 and 24 characters in length and use numbers and lower-case letters only.
|
||||
// tableName - a table name must be unique within a storage account and must be between 3 and 63 characters.The
|
||||
// name must comprise of only alphanumeric characters and it cannot begin with a numeric character.
|
||||
func (client TableClient) Create(ctx context.Context, resourceGroupName string, accountName string, tableName string) (result Table, err error) {
|
||||
// parameters - the parameters to provide to create a table.
|
||||
func (client TableClient) Create(ctx context.Context, resourceGroupName string, accountName string, tableName string, parameters *Table) (result Table, err error) {
|
||||
if tracing.IsEnabled() {
|
||||
ctx = tracing.StartSpan(ctx, fqdn+"/TableClient.Create")
|
||||
defer func() {
|
||||
|
@ -67,7 +68,7 @@ func (client TableClient) Create(ctx context.Context, resourceGroupName string,
|
|||
return result, validation.NewError("storage.TableClient", "Create", err.Error())
|
||||
}
|
||||
|
||||
req, err := client.CreatePreparer(ctx, resourceGroupName, accountName, tableName)
|
||||
req, err := client.CreatePreparer(ctx, resourceGroupName, accountName, tableName, parameters)
|
||||
if err != nil {
|
||||
err = autorest.NewErrorWithError(err, "storage.TableClient", "Create", nil, "Failure preparing request")
|
||||
return
|
||||
|
@ -90,7 +91,7 @@ func (client TableClient) Create(ctx context.Context, resourceGroupName string,
|
|||
}
|
||||
|
||||
// CreatePreparer prepares the Create request.
|
||||
func (client TableClient) CreatePreparer(ctx context.Context, resourceGroupName string, accountName string, tableName string) (*http.Request, error) {
|
||||
func (client TableClient) CreatePreparer(ctx context.Context, resourceGroupName string, accountName string, tableName string, parameters *Table) (*http.Request, error) {
|
||||
pathParameters := map[string]interface{}{
|
||||
"accountName": autorest.Encode("path", accountName),
|
||||
"resourceGroupName": autorest.Encode("path", resourceGroupName),
|
||||
|
@ -98,16 +99,21 @@ func (client TableClient) CreatePreparer(ctx context.Context, resourceGroupName
|
|||
"tableName": autorest.Encode("path", tableName),
|
||||
}
|
||||
|
||||
const APIVersion = "2019-06-01"
|
||||
const APIVersion = "2021-09-01"
|
||||
queryParameters := map[string]interface{}{
|
||||
"api-version": APIVersion,
|
||||
}
|
||||
|
||||
preparer := autorest.CreatePreparer(
|
||||
autorest.AsContentType("application/json; charset=utf-8"),
|
||||
autorest.AsPut(),
|
||||
autorest.WithBaseURL(client.BaseURI),
|
||||
autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/tableServices/default/tables/{tableName}", pathParameters),
|
||||
autorest.WithQueryParameters(queryParameters))
|
||||
if parameters != nil {
|
||||
preparer = autorest.DecoratePreparer(preparer,
|
||||
autorest.WithJSON(parameters))
|
||||
}
|
||||
return preparer.Prepare((&http.Request{}).WithContext(ctx))
|
||||
}
|
||||
|
||||
|
@ -196,7 +202,7 @@ func (client TableClient) DeletePreparer(ctx context.Context, resourceGroupName
|
|||
"tableName": autorest.Encode("path", tableName),
|
||||
}
|
||||
|
||||
const APIVersion = "2019-06-01"
|
||||
const APIVersion = "2021-09-01"
|
||||
queryParameters := map[string]interface{}{
|
||||
"api-version": APIVersion,
|
||||
}
|
||||
|
@ -293,7 +299,7 @@ func (client TableClient) GetPreparer(ctx context.Context, resourceGroupName str
|
|||
"tableName": autorest.Encode("path", tableName),
|
||||
}
|
||||
|
||||
const APIVersion = "2019-06-01"
|
||||
const APIVersion = "2021-09-01"
|
||||
queryParameters := map[string]interface{}{
|
||||
"api-version": APIVersion,
|
||||
}
|
||||
|
@ -389,7 +395,7 @@ func (client TableClient) ListPreparer(ctx context.Context, resourceGroupName st
|
|||
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
|
||||
}
|
||||
|
||||
const APIVersion = "2019-06-01"
|
||||
const APIVersion = "2021-09-01"
|
||||
queryParameters := map[string]interface{}{
|
||||
"api-version": APIVersion,
|
||||
}
|
||||
|
@ -465,7 +471,8 @@ func (client TableClient) ListComplete(ctx context.Context, resourceGroupName st
|
|||
// must be between 3 and 24 characters in length and use numbers and lower-case letters only.
|
||||
// tableName - a table name must be unique within a storage account and must be between 3 and 63 characters.The
|
||||
// name must comprise of only alphanumeric characters and it cannot begin with a numeric character.
|
||||
func (client TableClient) Update(ctx context.Context, resourceGroupName string, accountName string, tableName string) (result Table, err error) {
|
||||
// parameters - the parameters to provide to create a table.
|
||||
func (client TableClient) Update(ctx context.Context, resourceGroupName string, accountName string, tableName string, parameters *Table) (result Table, err error) {
|
||||
if tracing.IsEnabled() {
|
||||
ctx = tracing.StartSpan(ctx, fqdn+"/TableClient.Update")
|
||||
defer func() {
|
||||
|
@ -493,7 +500,7 @@ func (client TableClient) Update(ctx context.Context, resourceGroupName string,
|
|||
return result, validation.NewError("storage.TableClient", "Update", err.Error())
|
||||
}
|
||||
|
||||
req, err := client.UpdatePreparer(ctx, resourceGroupName, accountName, tableName)
|
||||
req, err := client.UpdatePreparer(ctx, resourceGroupName, accountName, tableName, parameters)
|
||||
if err != nil {
|
||||
err = autorest.NewErrorWithError(err, "storage.TableClient", "Update", nil, "Failure preparing request")
|
||||
return
|
||||
|
@ -516,7 +523,7 @@ func (client TableClient) Update(ctx context.Context, resourceGroupName string,
|
|||
}
|
||||
|
||||
// UpdatePreparer prepares the Update request.
|
||||
func (client TableClient) UpdatePreparer(ctx context.Context, resourceGroupName string, accountName string, tableName string) (*http.Request, error) {
|
||||
func (client TableClient) UpdatePreparer(ctx context.Context, resourceGroupName string, accountName string, tableName string, parameters *Table) (*http.Request, error) {
|
||||
pathParameters := map[string]interface{}{
|
||||
"accountName": autorest.Encode("path", accountName),
|
||||
"resourceGroupName": autorest.Encode("path", resourceGroupName),
|
||||
|
@ -524,16 +531,21 @@ func (client TableClient) UpdatePreparer(ctx context.Context, resourceGroupName
|
|||
"tableName": autorest.Encode("path", tableName),
|
||||
}
|
||||
|
||||
const APIVersion = "2019-06-01"
|
||||
const APIVersion = "2021-09-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.Storage/storageAccounts/{accountName}/tableServices/default/tables/{tableName}", pathParameters),
|
||||
autorest.WithQueryParameters(queryParameters))
|
||||
if parameters != nil {
|
||||
preparer = autorest.DecoratePreparer(preparer,
|
||||
autorest.WithJSON(parameters))
|
||||
}
|
||||
return preparer.Prepare((&http.Request{}).WithContext(ctx))
|
||||
}
|
||||
|
|
@ -93,7 +93,7 @@ func (client TableServicesClient) GetServicePropertiesPreparer(ctx context.Conte
|
|||
"tableServiceName": autorest.Encode("path", "default"),
|
||||
}
|
||||
|
||||
const APIVersion = "2019-06-01"
|
||||
const APIVersion = "2021-09-01"
|
||||
queryParameters := map[string]interface{}{
|
||||
"api-version": APIVersion,
|
||||
}
|
||||
|
@ -184,7 +184,7 @@ func (client TableServicesClient) ListPreparer(ctx context.Context, resourceGrou
|
|||
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
|
||||
}
|
||||
|
||||
const APIVersion = "2019-06-01"
|
||||
const APIVersion = "2021-09-01"
|
||||
queryParameters := map[string]interface{}{
|
||||
"api-version": APIVersion,
|
||||
}
|
||||
|
@ -279,7 +279,7 @@ func (client TableServicesClient) SetServicePropertiesPreparer(ctx context.Conte
|
|||
"tableServiceName": autorest.Encode("path", "default"),
|
||||
}
|
||||
|
||||
const APIVersion = "2019-06-01"
|
||||
const APIVersion = "2021-09-01"
|
||||
queryParameters := map[string]interface{}{
|
||||
"api-version": APIVersion,
|
||||
}
|
|
@ -80,7 +80,7 @@ func (client UsagesClient) ListByLocationPreparer(ctx context.Context, location
|
|||
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
|
||||
}
|
||||
|
||||
const APIVersion = "2019-06-01"
|
||||
const APIVersion = "2021-09-01"
|
||||
queryParameters := map[string]interface{}{
|
||||
"api-version": APIVersion,
|
||||
}
|
|
@ -10,7 +10,7 @@ import "github.com/Azure/azure-sdk-for-go/version"
|
|||
|
||||
// UserAgent returns the UserAgent string to use when sending http.Requests.
|
||||
func UserAgent() string {
|
||||
return "Azure-SDK-For-Go/" + Version() + " storage/2019-06-01"
|
||||
return "Azure-SDK-For-Go/" + Version() + " storage/2021-09-01"
|
||||
}
|
||||
|
||||
// Version returns the semantic version (see http://semver.org) of the client.
|
|
@ -16,7 +16,7 @@ github.com/Azure/azure-sdk-for-go/services/preview/containerregistry/mgmt/2020-1
|
|||
github.com/Azure/azure-sdk-for-go/services/preview/monitor/mgmt/2018-03-01/insights
|
||||
github.com/Azure/azure-sdk-for-go/services/privatedns/mgmt/2018-09-01/privatedns
|
||||
github.com/Azure/azure-sdk-for-go/services/resources/mgmt/2019-07-01/features
|
||||
github.com/Azure/azure-sdk-for-go/services/storage/mgmt/2019-06-01/storage
|
||||
github.com/Azure/azure-sdk-for-go/services/storage/mgmt/2021-09-01/storage
|
||||
github.com/Azure/azure-sdk-for-go/storage
|
||||
github.com/Azure/azure-sdk-for-go/version
|
||||
# github.com/Azure/azure-sdk-for-go/sdk/azcore v1.11.1
|
||||
|
|
Загрузка…
Ссылка в новой задаче