зеркало из https://github.com/Azure/ARO-RP.git
[M4/M5/M6] Read Hive kubeconfig from AKS live (#2325)
This commit is contained in:
Родитель
ef6cf43ac8
Коммит
d9e63cceb8
|
@ -14,7 +14,6 @@ import (
|
|||
|
||||
"github.com/Azure/ARO-RP/pkg/database"
|
||||
"github.com/Azure/ARO-RP/pkg/env"
|
||||
"github.com/Azure/ARO-RP/pkg/hive"
|
||||
"github.com/Azure/ARO-RP/pkg/metrics/noop"
|
||||
"github.com/Azure/ARO-RP/pkg/metrics/statsd"
|
||||
"github.com/Azure/ARO-RP/pkg/metrics/statsd/azure"
|
||||
|
@ -115,13 +114,12 @@ func monitor(ctx context.Context, log *logrus.Entry) error {
|
|||
return err
|
||||
}
|
||||
|
||||
hiveRestConfig, err := hive.HiveRestConfig()
|
||||
liveConfig, err := _env.NewLiveConfigManager(ctx)
|
||||
if err != nil {
|
||||
log.Info(err)
|
||||
// TODO(hive): Update to fail once we have Hive everywhere in prod and dev
|
||||
return err
|
||||
}
|
||||
|
||||
mon := pkgmonitor.NewMonitor(log.WithField("component", "monitor"), dialer, dbMonitors, dbOpenShiftClusters, dbSubscriptions, m, clusterm, hiveRestConfig)
|
||||
mon := pkgmonitor.NewMonitor(log.WithField("component", "monitor"), dialer, dbMonitors, dbOpenShiftClusters, dbSubscriptions, m, clusterm, liveConfig)
|
||||
|
||||
return mon.Run(ctx)
|
||||
}
|
||||
|
|
|
@ -19,7 +19,6 @@ import (
|
|||
"github.com/Azure/ARO-RP/pkg/cluster"
|
||||
"github.com/Azure/ARO-RP/pkg/database"
|
||||
"github.com/Azure/ARO-RP/pkg/env"
|
||||
"github.com/Azure/ARO-RP/pkg/hive"
|
||||
"github.com/Azure/ARO-RP/pkg/util/billing"
|
||||
"github.com/Azure/ARO-RP/pkg/util/encryption"
|
||||
utillog "github.com/Azure/ARO-RP/pkg/util/log"
|
||||
|
@ -102,7 +101,7 @@ func (ocb *openShiftClusterBackend) handle(ctx context.Context, log *logrus.Entr
|
|||
return err
|
||||
}
|
||||
|
||||
hiveRestConfig, err := hive.HiveRestConfig()
|
||||
hiveRestConfig, err := ocb.env.LiveConfig().HiveRestConfig(ctx, 1)
|
||||
if err != nil {
|
||||
log.Info(err) // TODO(hive): Update to fail once we have Hive everywhere in prod and dev
|
||||
}
|
||||
|
|
|
@ -22,7 +22,9 @@ import (
|
|||
"github.com/Azure/ARO-RP/pkg/util/billing"
|
||||
"github.com/Azure/ARO-RP/pkg/util/encryption"
|
||||
mock_cluster "github.com/Azure/ARO-RP/pkg/util/mocks/cluster"
|
||||
mock_env "github.com/Azure/ARO-RP/pkg/util/mocks/env"
|
||||
testdatabase "github.com/Azure/ARO-RP/test/database"
|
||||
"github.com/Azure/ARO-RP/test/util/testliveconfig"
|
||||
)
|
||||
|
||||
type backendTestStruct struct {
|
||||
|
@ -277,10 +279,13 @@ func TestBackendTry(t *testing.T) {
|
|||
t.Run(tt.name, func(t *testing.T) {
|
||||
ctx := context.Background()
|
||||
log := logrus.NewEntry(logrus.StandardLogger())
|
||||
tlc := testliveconfig.NewTestLiveConfig(false)
|
||||
|
||||
controller := gomock.NewController(t)
|
||||
defer controller.Finish()
|
||||
manager := mock_cluster.NewMockInterface(controller)
|
||||
_env := mock_env.NewMockInterface(controller)
|
||||
_env.EXPECT().LiveConfig().AnyTimes().Return(tlc)
|
||||
|
||||
dbOpenShiftClusters, clientOpenShiftClusters := testdatabase.NewFakeOpenShiftClusters()
|
||||
dbSubscriptions, _ := testdatabase.NewFakeSubscriptions()
|
||||
|
@ -297,7 +302,7 @@ func TestBackendTry(t *testing.T) {
|
|||
return manager, nil
|
||||
}
|
||||
|
||||
b, err := newBackend(ctx, log, nil, nil, nil, nil, dbOpenShiftClusters, dbSubscriptions, nil, &noop.Noop{})
|
||||
b, err := newBackend(ctx, log, _env, nil, nil, nil, dbOpenShiftClusters, dbSubscriptions, nil, &noop.Noop{})
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
|
|
|
@ -9,7 +9,9 @@ import (
|
|||
"github.com/Azure/go-autorest/autorest"
|
||||
"github.com/sirupsen/logrus"
|
||||
|
||||
"github.com/Azure/ARO-RP/pkg/util/azureclient/mgmt/containerservice"
|
||||
"github.com/Azure/ARO-RP/pkg/util/instancemetadata"
|
||||
"github.com/Azure/ARO-RP/pkg/util/liveconfig"
|
||||
)
|
||||
|
||||
// Core collects basic configuration information which is expected to be
|
||||
|
@ -18,6 +20,7 @@ import (
|
|||
type Core interface {
|
||||
IsLocalDevelopmentMode() bool
|
||||
NewMSIAuthorizer(MSIContext, string) (autorest.Authorizer, error)
|
||||
NewLiveConfigManager(context.Context) (liveconfig.Manager, error)
|
||||
instancemetadata.InstanceMetadata
|
||||
}
|
||||
|
||||
|
@ -31,6 +34,20 @@ func (c *core) IsLocalDevelopmentMode() bool {
|
|||
return c.isLocalDevelopmentMode
|
||||
}
|
||||
|
||||
func (c *core) NewLiveConfigManager(ctx context.Context) (liveconfig.Manager, error) {
|
||||
if c.isLocalDevelopmentMode {
|
||||
return liveconfig.NewDev(), nil
|
||||
}
|
||||
|
||||
msiAuthorizer, err := c.NewMSIAuthorizer(MSIContextRP, c.Environment().ResourceManagerEndpoint)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
mcc := containerservice.NewManagedClustersClient(c.Environment(), c.SubscriptionID(), msiAuthorizer)
|
||||
return liveconfig.NewProd(c.Location(), mcc), nil
|
||||
}
|
||||
|
||||
func NewCore(ctx context.Context, log *logrus.Entry) (Core, error) {
|
||||
isLocalDevelopmentMode := IsLocalDevelopmentMode()
|
||||
if isLocalDevelopmentMode {
|
||||
|
|
|
@ -17,6 +17,7 @@ import (
|
|||
"github.com/Azure/ARO-RP/pkg/proxy"
|
||||
"github.com/Azure/ARO-RP/pkg/util/clientauthorizer"
|
||||
"github.com/Azure/ARO-RP/pkg/util/keyvault"
|
||||
"github.com/Azure/ARO-RP/pkg/util/liveconfig"
|
||||
"github.com/Azure/ARO-RP/pkg/util/refreshable"
|
||||
)
|
||||
|
||||
|
@ -87,6 +88,7 @@ type Interface interface {
|
|||
ACRResourceID() string
|
||||
ACRDomain() string
|
||||
AROOperatorImage() string
|
||||
LiveConfig() liveconfig.Manager
|
||||
|
||||
// VMSku returns SKU for a given vm size. Note that this
|
||||
// returns a pointer to partly populated object.
|
||||
|
|
|
@ -24,6 +24,7 @@ import (
|
|||
"github.com/Azure/ARO-RP/pkg/util/clientauthorizer"
|
||||
"github.com/Azure/ARO-RP/pkg/util/computeskus"
|
||||
"github.com/Azure/ARO-RP/pkg/util/keyvault"
|
||||
"github.com/Azure/ARO-RP/pkg/util/liveconfig"
|
||||
"github.com/Azure/ARO-RP/pkg/util/refreshable"
|
||||
"github.com/Azure/ARO-RP/pkg/util/version"
|
||||
)
|
||||
|
@ -33,6 +34,8 @@ type prod struct {
|
|||
proxy.Dialer
|
||||
ARMHelper
|
||||
|
||||
liveConfig liveconfig.Manager
|
||||
|
||||
armClientAuthorizer clientauthorizer.ClientAuthorizer
|
||||
adminClientAuthorizer clientauthorizer.ClientAuthorizer
|
||||
|
||||
|
@ -210,6 +213,11 @@ func newProd(ctx context.Context, log *logrus.Entry) (*prod, error) {
|
|||
return nil, err
|
||||
}
|
||||
|
||||
p.liveConfig, err = p.Core.NewLiveConfigManager(ctx)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
return p, nil
|
||||
}
|
||||
|
||||
|
@ -358,3 +366,7 @@ func (p *prod) VMSku(vmSize string) (*mgmtcompute.ResourceSku, error) {
|
|||
}
|
||||
return vmsku, nil
|
||||
}
|
||||
|
||||
func (p *prod) LiveConfig() liveconfig.Manager {
|
||||
return p.liveConfig
|
||||
}
|
||||
|
|
|
@ -5,32 +5,12 @@ package hive
|
|||
|
||||
import (
|
||||
"encoding/json"
|
||||
"fmt"
|
||||
"os"
|
||||
|
||||
icazure "github.com/openshift/installer/pkg/asset/installconfig/azure"
|
||||
"k8s.io/client-go/rest"
|
||||
"k8s.io/client-go/tools/clientcmd"
|
||||
|
||||
"github.com/Azure/ARO-RP/pkg/api"
|
||||
)
|
||||
|
||||
const hiveKubeConfigEnvVar = "HIVEKUBECONFIGPATH"
|
||||
|
||||
func HiveRestConfig() (*rest.Config, error) {
|
||||
kubeConfigPath := os.Getenv(hiveKubeConfigEnvVar)
|
||||
if kubeConfigPath == "" {
|
||||
return nil, fmt.Errorf("missing %s env variable", hiveKubeConfigEnvVar)
|
||||
}
|
||||
|
||||
restConfig, err := clientcmd.BuildConfigFromFlags("", kubeConfigPath)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
return restConfig, nil
|
||||
}
|
||||
|
||||
func clusterSPToBytes(subscriptionDoc *api.SubscriptionDocument, oc *api.OpenShiftCluster) ([]byte, error) {
|
||||
return json.Marshal(icazure.Credentials{
|
||||
TenantID: subscriptionDoc.Subscription.Properties.TenantID,
|
||||
|
|
|
@ -11,7 +11,6 @@ import (
|
|||
"time"
|
||||
|
||||
"github.com/sirupsen/logrus"
|
||||
"k8s.io/client-go/rest"
|
||||
|
||||
"github.com/Azure/ARO-RP/pkg/api"
|
||||
"github.com/Azure/ARO-RP/pkg/database"
|
||||
|
@ -20,6 +19,7 @@ import (
|
|||
"github.com/Azure/ARO-RP/pkg/proxy"
|
||||
"github.com/Azure/ARO-RP/pkg/util/bucket"
|
||||
"github.com/Azure/ARO-RP/pkg/util/heartbeat"
|
||||
"github.com/Azure/ARO-RP/pkg/util/liveconfig"
|
||||
)
|
||||
|
||||
type monitor struct {
|
||||
|
@ -44,14 +44,14 @@ type monitor struct {
|
|||
lastChangefeed atomic.Value //time.Time
|
||||
startTime time.Time
|
||||
|
||||
hiveRestConfig *rest.Config
|
||||
liveConfig liveconfig.Manager
|
||||
}
|
||||
|
||||
type Runnable interface {
|
||||
Run(context.Context) error
|
||||
}
|
||||
|
||||
func NewMonitor(log *logrus.Entry, dialer proxy.Dialer, dbMonitors database.Monitors, dbOpenShiftClusters database.OpenShiftClusters, dbSubscriptions database.Subscriptions, m, clusterm metrics.Emitter, hiveRestConfig *rest.Config) Runnable {
|
||||
func NewMonitor(log *logrus.Entry, dialer proxy.Dialer, dbMonitors database.Monitors, dbOpenShiftClusters database.OpenShiftClusters, dbSubscriptions database.Subscriptions, m, clusterm metrics.Emitter, liveConfig liveconfig.Manager) Runnable {
|
||||
return &monitor{
|
||||
baseLog: log,
|
||||
dialer: dialer,
|
||||
|
@ -70,7 +70,7 @@ func NewMonitor(log *logrus.Entry, dialer proxy.Dialer, dbMonitors database.Moni
|
|||
|
||||
startTime: time.Now(),
|
||||
|
||||
hiveRestConfig: hiveRestConfig,
|
||||
liveConfig: liveConfig,
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -198,7 +198,13 @@ func (mon *monitor) workOne(ctx context.Context, log *logrus.Entry, doc *api.Ope
|
|||
return
|
||||
}
|
||||
|
||||
c, err := cluster.NewMonitor(ctx, log, restConfig, doc.OpenShiftCluster, mon.clusterm, mon.hiveRestConfig, hourlyRun)
|
||||
hiveRestConfig, err := mon.liveConfig.HiveRestConfig(ctx, 1)
|
||||
if err != nil {
|
||||
// TODO(hive): Update to fail once we have Hive everywhere in prod and dev
|
||||
log.Info(err)
|
||||
}
|
||||
|
||||
c, err := cluster.NewMonitor(ctx, log, restConfig, doc.OpenShiftCluster, mon.clusterm, hiveRestConfig, hourlyRun)
|
||||
if err != nil {
|
||||
log.Error(err)
|
||||
return
|
||||
|
|
|
@ -0,0 +1,8 @@
|
|||
package containerservice
|
||||
|
||||
// Copyright (c) Microsoft Corporation.
|
||||
// Licensed under the Apache License 2.0.
|
||||
|
||||
//go:generate rm -rf ../../../../util/mocks/$GOPACKAGE
|
||||
//go:generate go run ../../../../../vendor/github.com/golang/mock/mockgen -destination=../../../../util/mocks/azureclient/mgmt/$GOPACKAGE/$GOPACKAGE.go github.com/Azure/ARO-RP/pkg/util/azureclient/mgmt/$GOPACKAGE ManagedClustersClient
|
||||
//go:generate go run ../../../../../vendor/golang.org/x/tools/cmd/goimports -local=github.com/Azure/ARO-RP -e -w ../../../../util/mocks/azureclient/mgmt/$GOPACKAGE/$GOPACKAGE.go
|
|
@ -0,0 +1,19 @@
|
|||
package containerservice
|
||||
|
||||
// Copyright (c) Microsoft Corporation.
|
||||
// Licensed under the Apache License 2.0.
|
||||
|
||||
import (
|
||||
"context"
|
||||
|
||||
mgmtcontainerservice "github.com/Azure/azure-sdk-for-go/services/containerservice/mgmt/2021-10-01/containerservice"
|
||||
)
|
||||
|
||||
// RegistriesAddons contains addons for RegistriesClient
|
||||
type ManagedClustersAddons interface {
|
||||
ListClusterUserCredentials(ctx context.Context, resourceGroupName string, resourceName string, serverFqdn string) (mgmtcontainerservice.CredentialResults, error)
|
||||
}
|
||||
|
||||
func (r *managedClustersClient) ListClusterUserCredentials(ctx context.Context, resourceGroupName string, resourceName string, serverFqdn string) (mgmtcontainerservice.CredentialResults, error) {
|
||||
return r.ManagedClustersClient.ListClusterUserCredentials(ctx, resourceGroupName, resourceName, serverFqdn)
|
||||
}
|
|
@ -0,0 +1,32 @@
|
|||
package containerservice
|
||||
|
||||
// Copyright (c) Microsoft Corporation.
|
||||
// Licensed under the Apache License 2.0.
|
||||
|
||||
import (
|
||||
mgmtcontainerservice "github.com/Azure/azure-sdk-for-go/services/containerservice/mgmt/2021-10-01/containerservice"
|
||||
"github.com/Azure/go-autorest/autorest"
|
||||
|
||||
"github.com/Azure/ARO-RP/pkg/util/azureclient"
|
||||
)
|
||||
|
||||
// ManagedClustersClient is a minimal interface for azure ManagedClustersClient
|
||||
type ManagedClustersClient interface {
|
||||
ManagedClustersAddons
|
||||
}
|
||||
|
||||
type managedClustersClient struct {
|
||||
mgmtcontainerservice.ManagedClustersClient
|
||||
}
|
||||
|
||||
var _ ManagedClustersClient = &managedClustersClient{}
|
||||
|
||||
// NewManagedClustersClient creates a new ManagedClustersClient
|
||||
func NewManagedClustersClient(environment *azureclient.AROEnvironment, subscriptionID string, authorizer autorest.Authorizer) ManagedClustersClient {
|
||||
client := mgmtcontainerservice.NewManagedClustersClientWithBaseURI(environment.ResourceManagerEndpoint, subscriptionID)
|
||||
client.Authorizer = authorizer
|
||||
|
||||
return &managedClustersClient{
|
||||
ManagedClustersClient: client,
|
||||
}
|
||||
}
|
|
@ -0,0 +1,37 @@
|
|||
package liveconfig
|
||||
|
||||
// Copyright (c) Microsoft Corporation.
|
||||
// Licensed under the Apache License 2.0.
|
||||
|
||||
import (
|
||||
"context"
|
||||
"fmt"
|
||||
"os"
|
||||
|
||||
"k8s.io/client-go/rest"
|
||||
"k8s.io/client-go/tools/clientcmd"
|
||||
)
|
||||
|
||||
const (
|
||||
HIVEENVVARIABLE = "HIVEKUBECONFIGPATH"
|
||||
)
|
||||
|
||||
func (d *dev) HiveRestConfig(ctx context.Context, index int) (*rest.Config, error) {
|
||||
// Indexes above 0 have _index appended to them
|
||||
envVar := HIVEENVVARIABLE
|
||||
if index != 0 {
|
||||
envVar = fmt.Sprintf("%s_%d", HIVEENVVARIABLE, index)
|
||||
}
|
||||
|
||||
kubeConfigPath := os.Getenv(envVar)
|
||||
if kubeConfigPath == "" {
|
||||
return nil, fmt.Errorf("missing %s env variable", HIVEENVVARIABLE)
|
||||
}
|
||||
|
||||
restConfig, err := clientcmd.BuildConfigFromFlags("", kubeConfigPath)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
return restConfig, nil
|
||||
}
|
|
@ -0,0 +1,67 @@
|
|||
package liveconfig
|
||||
|
||||
// Copyright (c) Microsoft Corporation.
|
||||
// Licensed under the Apache License 2.0.
|
||||
|
||||
import (
|
||||
"context"
|
||||
"encoding/base64"
|
||||
"fmt"
|
||||
|
||||
mgmtcontainerservice "github.com/Azure/azure-sdk-for-go/services/containerservice/mgmt/2021-10-01/containerservice"
|
||||
"k8s.io/client-go/rest"
|
||||
"k8s.io/client-go/tools/clientcmd"
|
||||
)
|
||||
|
||||
func parseKubeconfig(credentials []mgmtcontainerservice.CredentialResult) (*rest.Config, error) {
|
||||
res := make([]byte, base64.StdEncoding.DecodedLen(len(*credentials[0].Value)))
|
||||
_, err := base64.StdEncoding.Decode(res, *credentials[0].Value)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
clientconfig, err := clientcmd.NewClientConfigFromBytes(res)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
restConfig, err := clientconfig.ClientConfig()
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
return restConfig, nil
|
||||
}
|
||||
|
||||
func (p *prod) HiveRestConfig(ctx context.Context, index int) (*rest.Config, error) {
|
||||
// NOTE: This RWMutex locks on a fetch for any index for simplicity, rather
|
||||
// than a more granular per-index lock. As of the time of writing, multiple
|
||||
// Hive shards are planned but unimplemented elsewhere.
|
||||
p.hiveCredentialsMutex.RLock()
|
||||
cached, ext := p.cachedCredentials[index]
|
||||
p.hiveCredentialsMutex.RUnlock()
|
||||
if ext {
|
||||
return rest.CopyConfig(cached), nil
|
||||
}
|
||||
|
||||
// Lock the RWMutex as we're starting to fetch so that new readers will wait
|
||||
// for the existing Azure API call to be done.
|
||||
p.hiveCredentialsMutex.Lock()
|
||||
defer p.hiveCredentialsMutex.Unlock()
|
||||
|
||||
rpResourceGroup := fmt.Sprintf("rp-%s", p.location)
|
||||
rpResourceName := fmt.Sprintf("aro-aks-cluster-%03d", index)
|
||||
|
||||
res, err := p.managedClusters.ListClusterUserCredentials(ctx, rpResourceGroup, rpResourceName, "")
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
parsed, err := parseKubeconfig(*res.Kubeconfigs)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
p.cachedCredentials[index] = parsed
|
||||
return rest.CopyConfig(parsed), nil
|
||||
}
|
|
@ -0,0 +1,75 @@
|
|||
package liveconfig
|
||||
|
||||
// Copyright (c) Microsoft Corporation.
|
||||
// Licensed under the Apache License 2.0.
|
||||
|
||||
import (
|
||||
"context"
|
||||
"embed"
|
||||
"encoding/base64"
|
||||
"testing"
|
||||
|
||||
mgmtcontainerservice "github.com/Azure/azure-sdk-for-go/services/containerservice/mgmt/2021-10-01/containerservice"
|
||||
"github.com/Azure/go-autorest/autorest/to"
|
||||
"github.com/golang/mock/gomock"
|
||||
|
||||
mock_containerservice "github.com/Azure/ARO-RP/pkg/util/mocks/azureclient/mgmt/containerservice"
|
||||
)
|
||||
|
||||
//go:embed testdata
|
||||
var hiveEmbeddedFiles embed.FS
|
||||
|
||||
func TestProdHive(t *testing.T) {
|
||||
ctx := context.Background()
|
||||
|
||||
controller := gomock.NewController(t)
|
||||
defer controller.Finish()
|
||||
|
||||
mcc := mock_containerservice.NewMockManagedClustersClient(controller)
|
||||
|
||||
kc, err := hiveEmbeddedFiles.ReadFile("testdata/kubeconfig")
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
enc := make([]byte, base64.StdEncoding.EncodedLen(len(kc)))
|
||||
base64.StdEncoding.Encode(enc, kc)
|
||||
|
||||
kcresp := &[]mgmtcontainerservice.CredentialResult{
|
||||
{
|
||||
Name: to.StringPtr("example"),
|
||||
Value: to.ByteSlicePtr(enc),
|
||||
},
|
||||
}
|
||||
|
||||
resp := mgmtcontainerservice.CredentialResults{
|
||||
Kubeconfigs: kcresp,
|
||||
}
|
||||
|
||||
mcc.EXPECT().ListClusterUserCredentials(gomock.Any(), "rp-eastus", "aro-aks-cluster-001", "").Return(resp, nil)
|
||||
|
||||
lc := NewProd("eastus", mcc)
|
||||
|
||||
restConfig, err := lc.HiveRestConfig(ctx, 1)
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
|
||||
// rudimentary loading checks
|
||||
if restConfig.Host != "https://api.crc.testing:6443" {
|
||||
t.Error(restConfig.String())
|
||||
}
|
||||
|
||||
if restConfig.BearerToken != "none" {
|
||||
t.Error(restConfig.String())
|
||||
}
|
||||
|
||||
// Make a second call, so that it uses the cache
|
||||
restConfig2, err := lc.HiveRestConfig(ctx, 1)
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
|
||||
if restConfig2.Host != "https://api.crc.testing:6443" {
|
||||
t.Error(restConfig2.String())
|
||||
}
|
||||
}
|
|
@ -0,0 +1,40 @@
|
|||
package liveconfig
|
||||
|
||||
// Copyright (c) Microsoft Corporation.
|
||||
// Licensed under the Apache License 2.0.
|
||||
|
||||
import (
|
||||
"context"
|
||||
"sync"
|
||||
|
||||
"k8s.io/client-go/rest"
|
||||
|
||||
"github.com/Azure/ARO-RP/pkg/util/azureclient/mgmt/containerservice"
|
||||
)
|
||||
|
||||
type Manager interface {
|
||||
HiveRestConfig(context.Context, int) (*rest.Config, error)
|
||||
}
|
||||
|
||||
type dev struct{}
|
||||
|
||||
func NewDev() Manager {
|
||||
return &dev{}
|
||||
}
|
||||
|
||||
type prod struct {
|
||||
location string
|
||||
managedClusters containerservice.ManagedClustersClient
|
||||
|
||||
hiveCredentialsMutex *sync.RWMutex
|
||||
cachedCredentials map[int]*rest.Config
|
||||
}
|
||||
|
||||
func NewProd(location string, managedClusters containerservice.ManagedClustersClient) Manager {
|
||||
return &prod{
|
||||
location: location,
|
||||
managedClusters: managedClusters,
|
||||
cachedCredentials: make(map[int]*rest.Config),
|
||||
hiveCredentialsMutex: &sync.RWMutex{},
|
||||
}
|
||||
}
|
Различия файлов скрыты, потому что одна или несколько строк слишком длинны
|
@ -0,0 +1,51 @@
|
|||
// Code generated by MockGen. DO NOT EDIT.
|
||||
// Source: github.com/Azure/ARO-RP/pkg/util/azureclient/mgmt/containerservice (interfaces: ManagedClustersClient)
|
||||
|
||||
// Package mock_containerservice is a generated GoMock package.
|
||||
package mock_containerservice
|
||||
|
||||
import (
|
||||
context "context"
|
||||
reflect "reflect"
|
||||
|
||||
containerservice "github.com/Azure/azure-sdk-for-go/services/containerservice/mgmt/2021-10-01/containerservice"
|
||||
gomock "github.com/golang/mock/gomock"
|
||||
)
|
||||
|
||||
// MockManagedClustersClient is a mock of ManagedClustersClient interface.
|
||||
type MockManagedClustersClient struct {
|
||||
ctrl *gomock.Controller
|
||||
recorder *MockManagedClustersClientMockRecorder
|
||||
}
|
||||
|
||||
// MockManagedClustersClientMockRecorder is the mock recorder for MockManagedClustersClient.
|
||||
type MockManagedClustersClientMockRecorder struct {
|
||||
mock *MockManagedClustersClient
|
||||
}
|
||||
|
||||
// NewMockManagedClustersClient creates a new mock instance.
|
||||
func NewMockManagedClustersClient(ctrl *gomock.Controller) *MockManagedClustersClient {
|
||||
mock := &MockManagedClustersClient{ctrl: ctrl}
|
||||
mock.recorder = &MockManagedClustersClientMockRecorder{mock}
|
||||
return mock
|
||||
}
|
||||
|
||||
// EXPECT returns an object that allows the caller to indicate expected use.
|
||||
func (m *MockManagedClustersClient) EXPECT() *MockManagedClustersClientMockRecorder {
|
||||
return m.recorder
|
||||
}
|
||||
|
||||
// ListClusterUserCredentials mocks base method.
|
||||
func (m *MockManagedClustersClient) ListClusterUserCredentials(arg0 context.Context, arg1, arg2, arg3 string) (containerservice.CredentialResults, error) {
|
||||
m.ctrl.T.Helper()
|
||||
ret := m.ctrl.Call(m, "ListClusterUserCredentials", arg0, arg1, arg2, arg3)
|
||||
ret0, _ := ret[0].(containerservice.CredentialResults)
|
||||
ret1, _ := ret[1].(error)
|
||||
return ret0, ret1
|
||||
}
|
||||
|
||||
// ListClusterUserCredentials indicates an expected call of ListClusterUserCredentials.
|
||||
func (mr *MockManagedClustersClientMockRecorder) ListClusterUserCredentials(arg0, arg1, arg2, arg3 interface{}) *gomock.Call {
|
||||
mr.mock.ctrl.T.Helper()
|
||||
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ListClusterUserCredentials", reflect.TypeOf((*MockManagedClustersClient)(nil).ListClusterUserCredentials), arg0, arg1, arg2, arg3)
|
||||
}
|
|
@ -19,6 +19,7 @@ import (
|
|||
azureclient "github.com/Azure/ARO-RP/pkg/util/azureclient"
|
||||
clientauthorizer "github.com/Azure/ARO-RP/pkg/util/clientauthorizer"
|
||||
keyvault "github.com/Azure/ARO-RP/pkg/util/keyvault"
|
||||
liveconfig "github.com/Azure/ARO-RP/pkg/util/liveconfig"
|
||||
refreshable "github.com/Azure/ARO-RP/pkg/util/refreshable"
|
||||
)
|
||||
|
||||
|
@ -101,6 +102,21 @@ func (mr *MockCoreMockRecorder) Location() *gomock.Call {
|
|||
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Location", reflect.TypeOf((*MockCore)(nil).Location))
|
||||
}
|
||||
|
||||
// NewLiveConfigManager mocks base method.
|
||||
func (m *MockCore) NewLiveConfigManager(arg0 context.Context) (liveconfig.Manager, error) {
|
||||
m.ctrl.T.Helper()
|
||||
ret := m.ctrl.Call(m, "NewLiveConfigManager", arg0)
|
||||
ret0, _ := ret[0].(liveconfig.Manager)
|
||||
ret1, _ := ret[1].(error)
|
||||
return ret0, ret1
|
||||
}
|
||||
|
||||
// NewLiveConfigManager indicates an expected call of NewLiveConfigManager.
|
||||
func (mr *MockCoreMockRecorder) NewLiveConfigManager(arg0 interface{}) *gomock.Call {
|
||||
mr.mock.ctrl.T.Helper()
|
||||
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "NewLiveConfigManager", reflect.TypeOf((*MockCore)(nil).NewLiveConfigManager), arg0)
|
||||
}
|
||||
|
||||
// NewMSIAuthorizer mocks base method.
|
||||
func (m *MockCore) NewMSIAuthorizer(arg0 env.MSIContext, arg1 string) (autorest.Authorizer, error) {
|
||||
m.ctrl.T.Helper()
|
||||
|
@ -521,6 +537,20 @@ func (mr *MockInterfaceMockRecorder) Listen() *gomock.Call {
|
|||
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Listen", reflect.TypeOf((*MockInterface)(nil).Listen))
|
||||
}
|
||||
|
||||
// LiveConfig mocks base method.
|
||||
func (m *MockInterface) LiveConfig() liveconfig.Manager {
|
||||
m.ctrl.T.Helper()
|
||||
ret := m.ctrl.Call(m, "LiveConfig")
|
||||
ret0, _ := ret[0].(liveconfig.Manager)
|
||||
return ret0
|
||||
}
|
||||
|
||||
// LiveConfig indicates an expected call of LiveConfig.
|
||||
func (mr *MockInterfaceMockRecorder) LiveConfig() *gomock.Call {
|
||||
mr.mock.ctrl.T.Helper()
|
||||
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "LiveConfig", reflect.TypeOf((*MockInterface)(nil).LiveConfig))
|
||||
}
|
||||
|
||||
// Location mocks base method.
|
||||
func (m *MockInterface) Location() string {
|
||||
m.ctrl.T.Helper()
|
||||
|
@ -535,6 +565,21 @@ func (mr *MockInterfaceMockRecorder) Location() *gomock.Call {
|
|||
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Location", reflect.TypeOf((*MockInterface)(nil).Location))
|
||||
}
|
||||
|
||||
// NewLiveConfigManager mocks base method.
|
||||
func (m *MockInterface) NewLiveConfigManager(arg0 context.Context) (liveconfig.Manager, error) {
|
||||
m.ctrl.T.Helper()
|
||||
ret := m.ctrl.Call(m, "NewLiveConfigManager", arg0)
|
||||
ret0, _ := ret[0].(liveconfig.Manager)
|
||||
ret1, _ := ret[1].(error)
|
||||
return ret0, ret1
|
||||
}
|
||||
|
||||
// NewLiveConfigManager indicates an expected call of NewLiveConfigManager.
|
||||
func (mr *MockInterfaceMockRecorder) NewLiveConfigManager(arg0 interface{}) *gomock.Call {
|
||||
mr.mock.ctrl.T.Helper()
|
||||
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "NewLiveConfigManager", reflect.TypeOf((*MockInterface)(nil).NewLiveConfigManager), arg0)
|
||||
}
|
||||
|
||||
// NewMSIAuthorizer mocks base method.
|
||||
func (m *MockInterface) NewMSIAuthorizer(arg0 env.MSIContext, arg1 string) (autorest.Authorizer, error) {
|
||||
m.ctrl.T.Helper()
|
||||
|
|
|
@ -0,0 +1,29 @@
|
|||
package testliveconfig
|
||||
|
||||
// Copyright (c) Microsoft Corporation.
|
||||
// Licensed under the Apache License 2.0.
|
||||
|
||||
import (
|
||||
"context"
|
||||
"errors"
|
||||
|
||||
"k8s.io/client-go/rest"
|
||||
|
||||
"github.com/Azure/ARO-RP/pkg/util/liveconfig"
|
||||
)
|
||||
|
||||
type testLiveConfig struct {
|
||||
hasHive bool
|
||||
}
|
||||
|
||||
func (t *testLiveConfig) HiveRestConfig(ctx context.Context, shard int) (*rest.Config, error) {
|
||||
if t.hasHive {
|
||||
return &rest.Config{}, nil
|
||||
} else {
|
||||
return nil, errors.New("testLiveConfig does not have a Hive")
|
||||
}
|
||||
}
|
||||
|
||||
func NewTestLiveConfig(hasHive bool) liveconfig.Manager {
|
||||
return &testLiveConfig{hasHive: hasHive}
|
||||
}
|
2
vendor/github.com/Azure/azure-sdk-for-go/services/containerservice/mgmt/2021-10-01/containerservice/CHANGELOG.md
сгенерированный
поставляемый
Normal file
2
vendor/github.com/Azure/azure-sdk-for-go/services/containerservice/mgmt/2021-10-01/containerservice/CHANGELOG.md
сгенерированный
поставляемый
Normal file
|
@ -0,0 +1,2 @@
|
|||
# Change History
|
||||
|
11
vendor/github.com/Azure/azure-sdk-for-go/services/containerservice/mgmt/2021-10-01/containerservice/_meta.json
сгенерированный
поставляемый
Normal file
11
vendor/github.com/Azure/azure-sdk-for-go/services/containerservice/mgmt/2021-10-01/containerservice/_meta.json
сгенерированный
поставляемый
Normal file
|
@ -0,0 +1,11 @@
|
|||
{
|
||||
"commit": "547fc2c120bac50455ab85831747d7041a2cc4ea",
|
||||
"readme": "/_/azure-rest-api-specs/specification/containerservice/resource-manager/readme.md",
|
||||
"tag": "package-2021-10",
|
||||
"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-2021-10 --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/containerservice/resource-manager/readme.md",
|
||||
"additional_properties": {
|
||||
"additional_options": "--go --verbose --use-onever --version=2.0.4421 --go.license-header=MICROSOFT_MIT_NO_VERSION --enum-prefix"
|
||||
}
|
||||
}
|
708
vendor/github.com/Azure/azure-sdk-for-go/services/containerservice/mgmt/2021-10-01/containerservice/agentpools.go
сгенерированный
поставляемый
Normal file
708
vendor/github.com/Azure/azure-sdk-for-go/services/containerservice/mgmt/2021-10-01/containerservice/agentpools.go
сгенерированный
поставляемый
Normal file
|
@ -0,0 +1,708 @@
|
|||
package containerservice
|
||||
|
||||
// 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"
|
||||
)
|
||||
|
||||
// AgentPoolsClient is the the Container Service Client.
|
||||
type AgentPoolsClient struct {
|
||||
BaseClient
|
||||
}
|
||||
|
||||
// NewAgentPoolsClient creates an instance of the AgentPoolsClient client.
|
||||
func NewAgentPoolsClient(subscriptionID string) AgentPoolsClient {
|
||||
return NewAgentPoolsClientWithBaseURI(DefaultBaseURI, subscriptionID)
|
||||
}
|
||||
|
||||
// NewAgentPoolsClientWithBaseURI creates an instance of the AgentPoolsClient 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 NewAgentPoolsClientWithBaseURI(baseURI string, subscriptionID string) AgentPoolsClient {
|
||||
return AgentPoolsClient{NewWithBaseURI(baseURI, subscriptionID)}
|
||||
}
|
||||
|
||||
// CreateOrUpdate sends the create or update request.
|
||||
// Parameters:
|
||||
// resourceGroupName - the name of the resource group.
|
||||
// resourceName - the name of the managed cluster resource.
|
||||
// agentPoolName - the name of the agent pool.
|
||||
// parameters - the agent pool to create or update.
|
||||
func (client AgentPoolsClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, resourceName string, agentPoolName string, parameters AgentPool) (result AgentPoolsCreateOrUpdateFuture, err error) {
|
||||
if tracing.IsEnabled() {
|
||||
ctx = tracing.StartSpan(ctx, fqdn+"/AgentPoolsClient.CreateOrUpdate")
|
||||
defer func() {
|
||||
sc := -1
|
||||
if result.FutureAPI != nil && result.FutureAPI.Response() != nil {
|
||||
sc = result.FutureAPI.Response().StatusCode
|
||||
}
|
||||
tracing.EndSpan(ctx, sc, err)
|
||||
}()
|
||||
}
|
||||
if err := validation.Validate([]validation.Validation{
|
||||
{TargetValue: resourceGroupName,
|
||||
Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}},
|
||||
{TargetValue: resourceName,
|
||||
Constraints: []validation.Constraint{{Target: "resourceName", Name: validation.MaxLength, Rule: 63, Chain: nil},
|
||||
{Target: "resourceName", Name: validation.MinLength, Rule: 1, Chain: nil},
|
||||
{Target: "resourceName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$`, Chain: nil}}},
|
||||
{TargetValue: parameters,
|
||||
Constraints: []validation.Constraint{{Target: "parameters.ManagedClusterAgentPoolProfileProperties", Name: validation.Null, Rule: false,
|
||||
Chain: []validation.Constraint{{Target: "parameters.ManagedClusterAgentPoolProfileProperties.KubeletConfig", Name: validation.Null, Rule: false,
|
||||
Chain: []validation.Constraint{{Target: "parameters.ManagedClusterAgentPoolProfileProperties.KubeletConfig.ContainerLogMaxFiles", Name: validation.Null, Rule: false,
|
||||
Chain: []validation.Constraint{{Target: "parameters.ManagedClusterAgentPoolProfileProperties.KubeletConfig.ContainerLogMaxFiles", Name: validation.InclusiveMinimum, Rule: int64(2), Chain: nil}}},
|
||||
}},
|
||||
}}}}}); err != nil {
|
||||
return result, validation.NewError("containerservice.AgentPoolsClient", "CreateOrUpdate", err.Error())
|
||||
}
|
||||
|
||||
req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, resourceName, agentPoolName, parameters)
|
||||
if err != nil {
|
||||
err = autorest.NewErrorWithError(err, "containerservice.AgentPoolsClient", "CreateOrUpdate", nil, "Failure preparing request")
|
||||
return
|
||||
}
|
||||
|
||||
result, err = client.CreateOrUpdateSender(req)
|
||||
if err != nil {
|
||||
err = autorest.NewErrorWithError(err, "containerservice.AgentPoolsClient", "CreateOrUpdate", result.Response(), "Failure sending request")
|
||||
return
|
||||
}
|
||||
|
||||
return
|
||||
}
|
||||
|
||||
// CreateOrUpdatePreparer prepares the CreateOrUpdate request.
|
||||
func (client AgentPoolsClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, resourceName string, agentPoolName string, parameters AgentPool) (*http.Request, error) {
|
||||
pathParameters := map[string]interface{}{
|
||||
"agentPoolName": autorest.Encode("path", agentPoolName),
|
||||
"resourceGroupName": autorest.Encode("path", resourceGroupName),
|
||||
"resourceName": autorest.Encode("path", resourceName),
|
||||
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
|
||||
}
|
||||
|
||||
const APIVersion = "2021-10-01"
|
||||
queryParameters := map[string]interface{}{
|
||||
"api-version": APIVersion,
|
||||
}
|
||||
|
||||
preparer := autorest.CreatePreparer(
|
||||
autorest.AsContentType("application/json; charset=utf-8"),
|
||||
autorest.AsPut(),
|
||||
autorest.WithBaseURL(client.BaseURI),
|
||||
autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools/{agentPoolName}", pathParameters),
|
||||
autorest.WithJSON(parameters),
|
||||
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 AgentPoolsClient) CreateOrUpdateSender(req *http.Request) (future AgentPoolsCreateOrUpdateFuture, err error) {
|
||||
var resp *http.Response
|
||||
future.FutureAPI = &azure.Future{}
|
||||
resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client))
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
var azf azure.Future
|
||||
azf, err = azure.NewFutureFromResponse(resp)
|
||||
future.FutureAPI = &azf
|
||||
future.Result = future.result
|
||||
return
|
||||
}
|
||||
|
||||
// CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always
|
||||
// closes the http.Response Body.
|
||||
func (client AgentPoolsClient) CreateOrUpdateResponder(resp *http.Response) (result AgentPool, err error) {
|
||||
err = autorest.Respond(
|
||||
resp,
|
||||
azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated),
|
||||
autorest.ByUnmarshallingJSON(&result),
|
||||
autorest.ByClosing())
|
||||
result.Response = autorest.Response{Response: resp}
|
||||
return
|
||||
}
|
||||
|
||||
// Delete sends the delete request.
|
||||
// Parameters:
|
||||
// resourceGroupName - the name of the resource group.
|
||||
// resourceName - the name of the managed cluster resource.
|
||||
// agentPoolName - the name of the agent pool.
|
||||
func (client AgentPoolsClient) Delete(ctx context.Context, resourceGroupName string, resourceName string, agentPoolName string) (result AgentPoolsDeleteFuture, err error) {
|
||||
if tracing.IsEnabled() {
|
||||
ctx = tracing.StartSpan(ctx, fqdn+"/AgentPoolsClient.Delete")
|
||||
defer func() {
|
||||
sc := -1
|
||||
if result.FutureAPI != nil && result.FutureAPI.Response() != nil {
|
||||
sc = result.FutureAPI.Response().StatusCode
|
||||
}
|
||||
tracing.EndSpan(ctx, sc, err)
|
||||
}()
|
||||
}
|
||||
if err := validation.Validate([]validation.Validation{
|
||||
{TargetValue: resourceGroupName,
|
||||
Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}},
|
||||
{TargetValue: resourceName,
|
||||
Constraints: []validation.Constraint{{Target: "resourceName", Name: validation.MaxLength, Rule: 63, Chain: nil},
|
||||
{Target: "resourceName", Name: validation.MinLength, Rule: 1, Chain: nil},
|
||||
{Target: "resourceName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$`, Chain: nil}}}}); err != nil {
|
||||
return result, validation.NewError("containerservice.AgentPoolsClient", "Delete", err.Error())
|
||||
}
|
||||
|
||||
req, err := client.DeletePreparer(ctx, resourceGroupName, resourceName, agentPoolName)
|
||||
if err != nil {
|
||||
err = autorest.NewErrorWithError(err, "containerservice.AgentPoolsClient", "Delete", nil, "Failure preparing request")
|
||||
return
|
||||
}
|
||||
|
||||
result, err = client.DeleteSender(req)
|
||||
if err != nil {
|
||||
err = autorest.NewErrorWithError(err, "containerservice.AgentPoolsClient", "Delete", result.Response(), "Failure sending request")
|
||||
return
|
||||
}
|
||||
|
||||
return
|
||||
}
|
||||
|
||||
// DeletePreparer prepares the Delete request.
|
||||
func (client AgentPoolsClient) DeletePreparer(ctx context.Context, resourceGroupName string, resourceName string, agentPoolName string) (*http.Request, error) {
|
||||
pathParameters := map[string]interface{}{
|
||||
"agentPoolName": autorest.Encode("path", agentPoolName),
|
||||
"resourceGroupName": autorest.Encode("path", resourceGroupName),
|
||||
"resourceName": autorest.Encode("path", resourceName),
|
||||
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
|
||||
}
|
||||
|
||||
const APIVersion = "2021-10-01"
|
||||
queryParameters := map[string]interface{}{
|
||||
"api-version": APIVersion,
|
||||
}
|
||||
|
||||
preparer := autorest.CreatePreparer(
|
||||
autorest.AsDelete(),
|
||||
autorest.WithBaseURL(client.BaseURI),
|
||||
autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools/{agentPoolName}", 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 AgentPoolsClient) DeleteSender(req *http.Request) (future AgentPoolsDeleteFuture, err error) {
|
||||
var resp *http.Response
|
||||
future.FutureAPI = &azure.Future{}
|
||||
resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client))
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
var azf azure.Future
|
||||
azf, err = azure.NewFutureFromResponse(resp)
|
||||
future.FutureAPI = &azf
|
||||
future.Result = future.result
|
||||
return
|
||||
}
|
||||
|
||||
// DeleteResponder handles the response to the Delete request. The method always
|
||||
// closes the http.Response Body.
|
||||
func (client AgentPoolsClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) {
|
||||
err = autorest.Respond(
|
||||
resp,
|
||||
azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent),
|
||||
autorest.ByClosing())
|
||||
result.Response = resp
|
||||
return
|
||||
}
|
||||
|
||||
// Get sends the get request.
|
||||
// Parameters:
|
||||
// resourceGroupName - the name of the resource group.
|
||||
// resourceName - the name of the managed cluster resource.
|
||||
// agentPoolName - the name of the agent pool.
|
||||
func (client AgentPoolsClient) Get(ctx context.Context, resourceGroupName string, resourceName string, agentPoolName string) (result AgentPool, err error) {
|
||||
if tracing.IsEnabled() {
|
||||
ctx = tracing.StartSpan(ctx, fqdn+"/AgentPoolsClient.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.MinLength, Rule: 1, Chain: nil}}},
|
||||
{TargetValue: resourceName,
|
||||
Constraints: []validation.Constraint{{Target: "resourceName", Name: validation.MaxLength, Rule: 63, Chain: nil},
|
||||
{Target: "resourceName", Name: validation.MinLength, Rule: 1, Chain: nil},
|
||||
{Target: "resourceName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$`, Chain: nil}}}}); err != nil {
|
||||
return result, validation.NewError("containerservice.AgentPoolsClient", "Get", err.Error())
|
||||
}
|
||||
|
||||
req, err := client.GetPreparer(ctx, resourceGroupName, resourceName, agentPoolName)
|
||||
if err != nil {
|
||||
err = autorest.NewErrorWithError(err, "containerservice.AgentPoolsClient", "Get", nil, "Failure preparing request")
|
||||
return
|
||||
}
|
||||
|
||||
resp, err := client.GetSender(req)
|
||||
if err != nil {
|
||||
result.Response = autorest.Response{Response: resp}
|
||||
err = autorest.NewErrorWithError(err, "containerservice.AgentPoolsClient", "Get", resp, "Failure sending request")
|
||||
return
|
||||
}
|
||||
|
||||
result, err = client.GetResponder(resp)
|
||||
if err != nil {
|
||||
err = autorest.NewErrorWithError(err, "containerservice.AgentPoolsClient", "Get", resp, "Failure responding to request")
|
||||
return
|
||||
}
|
||||
|
||||
return
|
||||
}
|
||||
|
||||
// GetPreparer prepares the Get request.
|
||||
func (client AgentPoolsClient) GetPreparer(ctx context.Context, resourceGroupName string, resourceName string, agentPoolName string) (*http.Request, error) {
|
||||
pathParameters := map[string]interface{}{
|
||||
"agentPoolName": autorest.Encode("path", agentPoolName),
|
||||
"resourceGroupName": autorest.Encode("path", resourceGroupName),
|
||||
"resourceName": autorest.Encode("path", resourceName),
|
||||
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
|
||||
}
|
||||
|
||||
const APIVersion = "2021-10-01"
|
||||
queryParameters := map[string]interface{}{
|
||||
"api-version": APIVersion,
|
||||
}
|
||||
|
||||
preparer := autorest.CreatePreparer(
|
||||
autorest.AsGet(),
|
||||
autorest.WithBaseURL(client.BaseURI),
|
||||
autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools/{agentPoolName}", 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 AgentPoolsClient) 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 AgentPoolsClient) GetResponder(resp *http.Response) (result AgentPool, err error) {
|
||||
err = autorest.Respond(
|
||||
resp,
|
||||
azure.WithErrorUnlessStatusCode(http.StatusOK),
|
||||
autorest.ByUnmarshallingJSON(&result),
|
||||
autorest.ByClosing())
|
||||
result.Response = autorest.Response{Response: resp}
|
||||
return
|
||||
}
|
||||
|
||||
// GetAvailableAgentPoolVersions see [supported Kubernetes
|
||||
// versions](https://docs.microsoft.com/azure/aks/supported-kubernetes-versions) for more details about the version
|
||||
// lifecycle.
|
||||
// Parameters:
|
||||
// resourceGroupName - the name of the resource group.
|
||||
// resourceName - the name of the managed cluster resource.
|
||||
func (client AgentPoolsClient) GetAvailableAgentPoolVersions(ctx context.Context, resourceGroupName string, resourceName string) (result AgentPoolAvailableVersions, err error) {
|
||||
if tracing.IsEnabled() {
|
||||
ctx = tracing.StartSpan(ctx, fqdn+"/AgentPoolsClient.GetAvailableAgentPoolVersions")
|
||||
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.MinLength, Rule: 1, Chain: nil}}},
|
||||
{TargetValue: resourceName,
|
||||
Constraints: []validation.Constraint{{Target: "resourceName", Name: validation.MaxLength, Rule: 63, Chain: nil},
|
||||
{Target: "resourceName", Name: validation.MinLength, Rule: 1, Chain: nil},
|
||||
{Target: "resourceName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$`, Chain: nil}}}}); err != nil {
|
||||
return result, validation.NewError("containerservice.AgentPoolsClient", "GetAvailableAgentPoolVersions", err.Error())
|
||||
}
|
||||
|
||||
req, err := client.GetAvailableAgentPoolVersionsPreparer(ctx, resourceGroupName, resourceName)
|
||||
if err != nil {
|
||||
err = autorest.NewErrorWithError(err, "containerservice.AgentPoolsClient", "GetAvailableAgentPoolVersions", nil, "Failure preparing request")
|
||||
return
|
||||
}
|
||||
|
||||
resp, err := client.GetAvailableAgentPoolVersionsSender(req)
|
||||
if err != nil {
|
||||
result.Response = autorest.Response{Response: resp}
|
||||
err = autorest.NewErrorWithError(err, "containerservice.AgentPoolsClient", "GetAvailableAgentPoolVersions", resp, "Failure sending request")
|
||||
return
|
||||
}
|
||||
|
||||
result, err = client.GetAvailableAgentPoolVersionsResponder(resp)
|
||||
if err != nil {
|
||||
err = autorest.NewErrorWithError(err, "containerservice.AgentPoolsClient", "GetAvailableAgentPoolVersions", resp, "Failure responding to request")
|
||||
return
|
||||
}
|
||||
|
||||
return
|
||||
}
|
||||
|
||||
// GetAvailableAgentPoolVersionsPreparer prepares the GetAvailableAgentPoolVersions request.
|
||||
func (client AgentPoolsClient) GetAvailableAgentPoolVersionsPreparer(ctx context.Context, resourceGroupName string, resourceName string) (*http.Request, error) {
|
||||
pathParameters := map[string]interface{}{
|
||||
"resourceGroupName": autorest.Encode("path", resourceGroupName),
|
||||
"resourceName": autorest.Encode("path", resourceName),
|
||||
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
|
||||
}
|
||||
|
||||
const APIVersion = "2021-10-01"
|
||||
queryParameters := map[string]interface{}{
|
||||
"api-version": APIVersion,
|
||||
}
|
||||
|
||||
preparer := autorest.CreatePreparer(
|
||||
autorest.AsGet(),
|
||||
autorest.WithBaseURL(client.BaseURI),
|
||||
autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/availableAgentPoolVersions", pathParameters),
|
||||
autorest.WithQueryParameters(queryParameters))
|
||||
return preparer.Prepare((&http.Request{}).WithContext(ctx))
|
||||
}
|
||||
|
||||
// GetAvailableAgentPoolVersionsSender sends the GetAvailableAgentPoolVersions request. The method will close the
|
||||
// http.Response Body if it receives an error.
|
||||
func (client AgentPoolsClient) GetAvailableAgentPoolVersionsSender(req *http.Request) (*http.Response, error) {
|
||||
return client.Send(req, azure.DoRetryWithRegistration(client.Client))
|
||||
}
|
||||
|
||||
// GetAvailableAgentPoolVersionsResponder handles the response to the GetAvailableAgentPoolVersions request. The method always
|
||||
// closes the http.Response Body.
|
||||
func (client AgentPoolsClient) GetAvailableAgentPoolVersionsResponder(resp *http.Response) (result AgentPoolAvailableVersions, err error) {
|
||||
err = autorest.Respond(
|
||||
resp,
|
||||
azure.WithErrorUnlessStatusCode(http.StatusOK),
|
||||
autorest.ByUnmarshallingJSON(&result),
|
||||
autorest.ByClosing())
|
||||
result.Response = autorest.Response{Response: resp}
|
||||
return
|
||||
}
|
||||
|
||||
// GetUpgradeProfile sends the get upgrade profile request.
|
||||
// Parameters:
|
||||
// resourceGroupName - the name of the resource group.
|
||||
// resourceName - the name of the managed cluster resource.
|
||||
// agentPoolName - the name of the agent pool.
|
||||
func (client AgentPoolsClient) GetUpgradeProfile(ctx context.Context, resourceGroupName string, resourceName string, agentPoolName string) (result AgentPoolUpgradeProfile, err error) {
|
||||
if tracing.IsEnabled() {
|
||||
ctx = tracing.StartSpan(ctx, fqdn+"/AgentPoolsClient.GetUpgradeProfile")
|
||||
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.MinLength, Rule: 1, Chain: nil}}},
|
||||
{TargetValue: resourceName,
|
||||
Constraints: []validation.Constraint{{Target: "resourceName", Name: validation.MaxLength, Rule: 63, Chain: nil},
|
||||
{Target: "resourceName", Name: validation.MinLength, Rule: 1, Chain: nil},
|
||||
{Target: "resourceName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$`, Chain: nil}}}}); err != nil {
|
||||
return result, validation.NewError("containerservice.AgentPoolsClient", "GetUpgradeProfile", err.Error())
|
||||
}
|
||||
|
||||
req, err := client.GetUpgradeProfilePreparer(ctx, resourceGroupName, resourceName, agentPoolName)
|
||||
if err != nil {
|
||||
err = autorest.NewErrorWithError(err, "containerservice.AgentPoolsClient", "GetUpgradeProfile", nil, "Failure preparing request")
|
||||
return
|
||||
}
|
||||
|
||||
resp, err := client.GetUpgradeProfileSender(req)
|
||||
if err != nil {
|
||||
result.Response = autorest.Response{Response: resp}
|
||||
err = autorest.NewErrorWithError(err, "containerservice.AgentPoolsClient", "GetUpgradeProfile", resp, "Failure sending request")
|
||||
return
|
||||
}
|
||||
|
||||
result, err = client.GetUpgradeProfileResponder(resp)
|
||||
if err != nil {
|
||||
err = autorest.NewErrorWithError(err, "containerservice.AgentPoolsClient", "GetUpgradeProfile", resp, "Failure responding to request")
|
||||
return
|
||||
}
|
||||
|
||||
return
|
||||
}
|
||||
|
||||
// GetUpgradeProfilePreparer prepares the GetUpgradeProfile request.
|
||||
func (client AgentPoolsClient) GetUpgradeProfilePreparer(ctx context.Context, resourceGroupName string, resourceName string, agentPoolName string) (*http.Request, error) {
|
||||
pathParameters := map[string]interface{}{
|
||||
"agentPoolName": autorest.Encode("path", agentPoolName),
|
||||
"resourceGroupName": autorest.Encode("path", resourceGroupName),
|
||||
"resourceName": autorest.Encode("path", resourceName),
|
||||
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
|
||||
}
|
||||
|
||||
const APIVersion = "2021-10-01"
|
||||
queryParameters := map[string]interface{}{
|
||||
"api-version": APIVersion,
|
||||
}
|
||||
|
||||
preparer := autorest.CreatePreparer(
|
||||
autorest.AsGet(),
|
||||
autorest.WithBaseURL(client.BaseURI),
|
||||
autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools/{agentPoolName}/upgradeProfiles/default", pathParameters),
|
||||
autorest.WithQueryParameters(queryParameters))
|
||||
return preparer.Prepare((&http.Request{}).WithContext(ctx))
|
||||
}
|
||||
|
||||
// GetUpgradeProfileSender sends the GetUpgradeProfile request. The method will close the
|
||||
// http.Response Body if it receives an error.
|
||||
func (client AgentPoolsClient) GetUpgradeProfileSender(req *http.Request) (*http.Response, error) {
|
||||
return client.Send(req, azure.DoRetryWithRegistration(client.Client))
|
||||
}
|
||||
|
||||
// GetUpgradeProfileResponder handles the response to the GetUpgradeProfile request. The method always
|
||||
// closes the http.Response Body.
|
||||
func (client AgentPoolsClient) GetUpgradeProfileResponder(resp *http.Response) (result AgentPoolUpgradeProfile, err error) {
|
||||
err = autorest.Respond(
|
||||
resp,
|
||||
azure.WithErrorUnlessStatusCode(http.StatusOK),
|
||||
autorest.ByUnmarshallingJSON(&result),
|
||||
autorest.ByClosing())
|
||||
result.Response = autorest.Response{Response: resp}
|
||||
return
|
||||
}
|
||||
|
||||
// List sends the list request.
|
||||
// Parameters:
|
||||
// resourceGroupName - the name of the resource group.
|
||||
// resourceName - the name of the managed cluster resource.
|
||||
func (client AgentPoolsClient) List(ctx context.Context, resourceGroupName string, resourceName string) (result AgentPoolListResultPage, err error) {
|
||||
if tracing.IsEnabled() {
|
||||
ctx = tracing.StartSpan(ctx, fqdn+"/AgentPoolsClient.List")
|
||||
defer func() {
|
||||
sc := -1
|
||||
if result.aplr.Response.Response != nil {
|
||||
sc = result.aplr.Response.Response.StatusCode
|
||||
}
|
||||
tracing.EndSpan(ctx, sc, err)
|
||||
}()
|
||||
}
|
||||
if err := validation.Validate([]validation.Validation{
|
||||
{TargetValue: resourceGroupName,
|
||||
Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}},
|
||||
{TargetValue: resourceName,
|
||||
Constraints: []validation.Constraint{{Target: "resourceName", Name: validation.MaxLength, Rule: 63, Chain: nil},
|
||||
{Target: "resourceName", Name: validation.MinLength, Rule: 1, Chain: nil},
|
||||
{Target: "resourceName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$`, Chain: nil}}}}); err != nil {
|
||||
return result, validation.NewError("containerservice.AgentPoolsClient", "List", err.Error())
|
||||
}
|
||||
|
||||
result.fn = client.listNextResults
|
||||
req, err := client.ListPreparer(ctx, resourceGroupName, resourceName)
|
||||
if err != nil {
|
||||
err = autorest.NewErrorWithError(err, "containerservice.AgentPoolsClient", "List", nil, "Failure preparing request")
|
||||
return
|
||||
}
|
||||
|
||||
resp, err := client.ListSender(req)
|
||||
if err != nil {
|
||||
result.aplr.Response = autorest.Response{Response: resp}
|
||||
err = autorest.NewErrorWithError(err, "containerservice.AgentPoolsClient", "List", resp, "Failure sending request")
|
||||
return
|
||||
}
|
||||
|
||||
result.aplr, err = client.ListResponder(resp)
|
||||
if err != nil {
|
||||
err = autorest.NewErrorWithError(err, "containerservice.AgentPoolsClient", "List", resp, "Failure responding to request")
|
||||
return
|
||||
}
|
||||
if result.aplr.hasNextLink() && result.aplr.IsEmpty() {
|
||||
err = result.NextWithContext(ctx)
|
||||
return
|
||||
}
|
||||
|
||||
return
|
||||
}
|
||||
|
||||
// ListPreparer prepares the List request.
|
||||
func (client AgentPoolsClient) ListPreparer(ctx context.Context, resourceGroupName string, resourceName string) (*http.Request, error) {
|
||||
pathParameters := map[string]interface{}{
|
||||
"resourceGroupName": autorest.Encode("path", resourceGroupName),
|
||||
"resourceName": autorest.Encode("path", resourceName),
|
||||
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
|
||||
}
|
||||
|
||||
const APIVersion = "2021-10-01"
|
||||
queryParameters := map[string]interface{}{
|
||||
"api-version": APIVersion,
|
||||
}
|
||||
|
||||
preparer := autorest.CreatePreparer(
|
||||
autorest.AsGet(),
|
||||
autorest.WithBaseURL(client.BaseURI),
|
||||
autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools", 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 AgentPoolsClient) 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 AgentPoolsClient) ListResponder(resp *http.Response) (result AgentPoolListResult, 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 AgentPoolsClient) listNextResults(ctx context.Context, lastResults AgentPoolListResult) (result AgentPoolListResult, err error) {
|
||||
req, err := lastResults.agentPoolListResultPreparer(ctx)
|
||||
if err != nil {
|
||||
return result, autorest.NewErrorWithError(err, "containerservice.AgentPoolsClient", "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, "containerservice.AgentPoolsClient", "listNextResults", resp, "Failure sending next results request")
|
||||
}
|
||||
result, err = client.ListResponder(resp)
|
||||
if err != nil {
|
||||
err = autorest.NewErrorWithError(err, "containerservice.AgentPoolsClient", "listNextResults", resp, "Failure responding to next results request")
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
// ListComplete enumerates all values, automatically crossing page boundaries as required.
|
||||
func (client AgentPoolsClient) ListComplete(ctx context.Context, resourceGroupName string, resourceName string) (result AgentPoolListResultIterator, err error) {
|
||||
if tracing.IsEnabled() {
|
||||
ctx = tracing.StartSpan(ctx, fqdn+"/AgentPoolsClient.List")
|
||||
defer func() {
|
||||
sc := -1
|
||||
if result.Response().Response.Response != nil {
|
||||
sc = result.page.Response().Response.Response.StatusCode
|
||||
}
|
||||
tracing.EndSpan(ctx, sc, err)
|
||||
}()
|
||||
}
|
||||
result.page, err = client.List(ctx, resourceGroupName, resourceName)
|
||||
return
|
||||
}
|
||||
|
||||
// UpgradeNodeImageVersion upgrading the node image version of an agent pool applies the newest OS and runtime updates
|
||||
// to the nodes. AKS provides one new image per week with the latest updates. For more details on node image versions,
|
||||
// see: https://docs.microsoft.com/azure/aks/node-image-upgrade
|
||||
// Parameters:
|
||||
// resourceGroupName - the name of the resource group.
|
||||
// resourceName - the name of the managed cluster resource.
|
||||
// agentPoolName - the name of the agent pool.
|
||||
func (client AgentPoolsClient) UpgradeNodeImageVersion(ctx context.Context, resourceGroupName string, resourceName string, agentPoolName string) (result AgentPoolsUpgradeNodeImageVersionFuture, err error) {
|
||||
if tracing.IsEnabled() {
|
||||
ctx = tracing.StartSpan(ctx, fqdn+"/AgentPoolsClient.UpgradeNodeImageVersion")
|
||||
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.MinLength, Rule: 1, Chain: nil}}},
|
||||
{TargetValue: resourceName,
|
||||
Constraints: []validation.Constraint{{Target: "resourceName", Name: validation.MaxLength, Rule: 63, Chain: nil},
|
||||
{Target: "resourceName", Name: validation.MinLength, Rule: 1, Chain: nil},
|
||||
{Target: "resourceName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$`, Chain: nil}}}}); err != nil {
|
||||
return result, validation.NewError("containerservice.AgentPoolsClient", "UpgradeNodeImageVersion", err.Error())
|
||||
}
|
||||
|
||||
req, err := client.UpgradeNodeImageVersionPreparer(ctx, resourceGroupName, resourceName, agentPoolName)
|
||||
if err != nil {
|
||||
err = autorest.NewErrorWithError(err, "containerservice.AgentPoolsClient", "UpgradeNodeImageVersion", nil, "Failure preparing request")
|
||||
return
|
||||
}
|
||||
|
||||
result, err = client.UpgradeNodeImageVersionSender(req)
|
||||
if err != nil {
|
||||
err = autorest.NewErrorWithError(err, "containerservice.AgentPoolsClient", "UpgradeNodeImageVersion", result.Response(), "Failure sending request")
|
||||
return
|
||||
}
|
||||
|
||||
return
|
||||
}
|
||||
|
||||
// UpgradeNodeImageVersionPreparer prepares the UpgradeNodeImageVersion request.
|
||||
func (client AgentPoolsClient) UpgradeNodeImageVersionPreparer(ctx context.Context, resourceGroupName string, resourceName string, agentPoolName string) (*http.Request, error) {
|
||||
pathParameters := map[string]interface{}{
|
||||
"agentPoolName": autorest.Encode("path", agentPoolName),
|
||||
"resourceGroupName": autorest.Encode("path", resourceGroupName),
|
||||
"resourceName": autorest.Encode("path", resourceName),
|
||||
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
|
||||
}
|
||||
|
||||
const APIVersion = "2021-10-01"
|
||||
queryParameters := map[string]interface{}{
|
||||
"api-version": APIVersion,
|
||||
}
|
||||
|
||||
preparer := autorest.CreatePreparer(
|
||||
autorest.AsPost(),
|
||||
autorest.WithBaseURL(client.BaseURI),
|
||||
autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools/{agentPoolName}/upgradeNodeImageVersion", pathParameters),
|
||||
autorest.WithQueryParameters(queryParameters))
|
||||
return preparer.Prepare((&http.Request{}).WithContext(ctx))
|
||||
}
|
||||
|
||||
// UpgradeNodeImageVersionSender sends the UpgradeNodeImageVersion request. The method will close the
|
||||
// http.Response Body if it receives an error.
|
||||
func (client AgentPoolsClient) UpgradeNodeImageVersionSender(req *http.Request) (future AgentPoolsUpgradeNodeImageVersionFuture, 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
|
||||
}
|
||||
|
||||
// UpgradeNodeImageVersionResponder handles the response to the UpgradeNodeImageVersion request. The method always
|
||||
// closes the http.Response Body.
|
||||
func (client AgentPoolsClient) UpgradeNodeImageVersionResponder(resp *http.Response) (result AgentPool, err error) {
|
||||
err = autorest.Respond(
|
||||
resp,
|
||||
azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted),
|
||||
autorest.ByUnmarshallingJSON(&result),
|
||||
autorest.ByClosing())
|
||||
result.Response = autorest.Response{Response: resp}
|
||||
return
|
||||
}
|
41
vendor/github.com/Azure/azure-sdk-for-go/services/containerservice/mgmt/2021-10-01/containerservice/client.go
сгенерированный
поставляемый
Normal file
41
vendor/github.com/Azure/azure-sdk-for-go/services/containerservice/mgmt/2021-10-01/containerservice/client.go
сгенерированный
поставляемый
Normal file
|
@ -0,0 +1,41 @@
|
|||
// Package containerservice implements the Azure ARM Containerservice service API version 2021-10-01.
|
||||
//
|
||||
// The Container Service Client.
|
||||
package containerservice
|
||||
|
||||
// Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
// Licensed under the MIT License. See License.txt in the project root for license information.
|
||||
//
|
||||
// Code generated by Microsoft (R) AutoRest Code Generator.
|
||||
// Changes may cause incorrect behavior and will be lost if the code is regenerated.
|
||||
|
||||
import (
|
||||
"github.com/Azure/go-autorest/autorest"
|
||||
)
|
||||
|
||||
const (
|
||||
// DefaultBaseURI is the default URI used for the service Containerservice
|
||||
DefaultBaseURI = "https://management.azure.com"
|
||||
)
|
||||
|
||||
// BaseClient is the base client for Containerservice.
|
||||
type BaseClient struct {
|
||||
autorest.Client
|
||||
BaseURI string
|
||||
SubscriptionID string
|
||||
}
|
||||
|
||||
// New creates an instance of the BaseClient client.
|
||||
func New(subscriptionID string) BaseClient {
|
||||
return NewWithBaseURI(DefaultBaseURI, subscriptionID)
|
||||
}
|
||||
|
||||
// NewWithBaseURI creates an instance of the BaseClient client using a custom endpoint. Use this when interacting with
|
||||
// an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure stack).
|
||||
func NewWithBaseURI(baseURI string, subscriptionID string) BaseClient {
|
||||
return BaseClient{
|
||||
Client: autorest.NewClientWithUserAgent(UserAgent()),
|
||||
BaseURI: baseURI,
|
||||
SubscriptionID: subscriptionID,
|
||||
}
|
||||
}
|
963
vendor/github.com/Azure/azure-sdk-for-go/services/containerservice/mgmt/2021-10-01/containerservice/enums.go
сгенерированный
поставляемый
Normal file
963
vendor/github.com/Azure/azure-sdk-for-go/services/containerservice/mgmt/2021-10-01/containerservice/enums.go
сгенерированный
поставляемый
Normal file
|
@ -0,0 +1,963 @@
|
|||
package containerservice
|
||||
|
||||
// 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.
|
||||
|
||||
// AgentPoolMode enumerates the values for agent pool mode.
|
||||
type AgentPoolMode string
|
||||
|
||||
const (
|
||||
// AgentPoolModeSystem System agent pools are primarily for hosting critical system pods such as CoreDNS
|
||||
// and metrics-server. System agent pools osType must be Linux. System agent pools VM SKU must have at
|
||||
// least 2vCPUs and 4GB of memory.
|
||||
AgentPoolModeSystem AgentPoolMode = "System"
|
||||
// AgentPoolModeUser User agent pools are primarily for hosting your application pods.
|
||||
AgentPoolModeUser AgentPoolMode = "User"
|
||||
)
|
||||
|
||||
// PossibleAgentPoolModeValues returns an array of possible values for the AgentPoolMode const type.
|
||||
func PossibleAgentPoolModeValues() []AgentPoolMode {
|
||||
return []AgentPoolMode{AgentPoolModeSystem, AgentPoolModeUser}
|
||||
}
|
||||
|
||||
// AgentPoolType enumerates the values for agent pool type.
|
||||
type AgentPoolType string
|
||||
|
||||
const (
|
||||
// AgentPoolTypeAvailabilitySet Use of this is strongly discouraged.
|
||||
AgentPoolTypeAvailabilitySet AgentPoolType = "AvailabilitySet"
|
||||
// AgentPoolTypeVirtualMachineScaleSets Create an Agent Pool backed by a Virtual Machine Scale Set.
|
||||
AgentPoolTypeVirtualMachineScaleSets AgentPoolType = "VirtualMachineScaleSets"
|
||||
)
|
||||
|
||||
// PossibleAgentPoolTypeValues returns an array of possible values for the AgentPoolType const type.
|
||||
func PossibleAgentPoolTypeValues() []AgentPoolType {
|
||||
return []AgentPoolType{AgentPoolTypeAvailabilitySet, AgentPoolTypeVirtualMachineScaleSets}
|
||||
}
|
||||
|
||||
// Code enumerates the values for code.
|
||||
type Code string
|
||||
|
||||
const (
|
||||
// CodeRunning The cluster is running.
|
||||
CodeRunning Code = "Running"
|
||||
// CodeStopped The cluster is stopped.
|
||||
CodeStopped Code = "Stopped"
|
||||
)
|
||||
|
||||
// PossibleCodeValues returns an array of possible values for the Code const type.
|
||||
func PossibleCodeValues() []Code {
|
||||
return []Code{CodeRunning, CodeStopped}
|
||||
}
|
||||
|
||||
// ConnectionStatus enumerates the values for connection status.
|
||||
type ConnectionStatus string
|
||||
|
||||
const (
|
||||
// ConnectionStatusApproved ...
|
||||
ConnectionStatusApproved ConnectionStatus = "Approved"
|
||||
// ConnectionStatusDisconnected ...
|
||||
ConnectionStatusDisconnected ConnectionStatus = "Disconnected"
|
||||
// ConnectionStatusPending ...
|
||||
ConnectionStatusPending ConnectionStatus = "Pending"
|
||||
// ConnectionStatusRejected ...
|
||||
ConnectionStatusRejected ConnectionStatus = "Rejected"
|
||||
)
|
||||
|
||||
// PossibleConnectionStatusValues returns an array of possible values for the ConnectionStatus const type.
|
||||
func PossibleConnectionStatusValues() []ConnectionStatus {
|
||||
return []ConnectionStatus{ConnectionStatusApproved, ConnectionStatusDisconnected, ConnectionStatusPending, ConnectionStatusRejected}
|
||||
}
|
||||
|
||||
// CreatedByType enumerates the values for created by type.
|
||||
type CreatedByType string
|
||||
|
||||
const (
|
||||
// CreatedByTypeApplication ...
|
||||
CreatedByTypeApplication CreatedByType = "Application"
|
||||
// CreatedByTypeKey ...
|
||||
CreatedByTypeKey CreatedByType = "Key"
|
||||
// CreatedByTypeManagedIdentity ...
|
||||
CreatedByTypeManagedIdentity CreatedByType = "ManagedIdentity"
|
||||
// CreatedByTypeUser ...
|
||||
CreatedByTypeUser CreatedByType = "User"
|
||||
)
|
||||
|
||||
// PossibleCreatedByTypeValues returns an array of possible values for the CreatedByType const type.
|
||||
func PossibleCreatedByTypeValues() []CreatedByType {
|
||||
return []CreatedByType{CreatedByTypeApplication, CreatedByTypeKey, CreatedByTypeManagedIdentity, CreatedByTypeUser}
|
||||
}
|
||||
|
||||
// Expander enumerates the values for expander.
|
||||
type Expander string
|
||||
|
||||
const (
|
||||
// ExpanderLeastWaste Selects the node group that will have the least idle CPU (if tied, unused memory)
|
||||
// after scale-up. This is useful when you have different classes of nodes, for example, high CPU or high
|
||||
// memory nodes, and only want to expand those when there are pending pods that need a lot of those
|
||||
// resources.
|
||||
ExpanderLeastWaste Expander = "least-waste"
|
||||
// ExpanderMostPods Selects the node group that would be able to schedule the most pods when scaling up.
|
||||
// This is useful when you are using nodeSelector to make sure certain pods land on certain nodes. Note
|
||||
// that this won't cause the autoscaler to select bigger nodes vs. smaller, as it can add multiple smaller
|
||||
// nodes at once.
|
||||
ExpanderMostPods Expander = "most-pods"
|
||||
// ExpanderPriority Selects the node group that has the highest priority assigned by the user. It's
|
||||
// configuration is described in more details
|
||||
// [here](https://github.com/kubernetes/autoscaler/blob/master/cluster-autoscaler/expander/priority/readme.md).
|
||||
ExpanderPriority Expander = "priority"
|
||||
// ExpanderRandom Used when you don't have a particular need for the node groups to scale differently.
|
||||
ExpanderRandom Expander = "random"
|
||||
)
|
||||
|
||||
// PossibleExpanderValues returns an array of possible values for the Expander const type.
|
||||
func PossibleExpanderValues() []Expander {
|
||||
return []Expander{ExpanderLeastWaste, ExpanderMostPods, ExpanderPriority, ExpanderRandom}
|
||||
}
|
||||
|
||||
// ExtendedLocationTypes enumerates the values for extended location types.
|
||||
type ExtendedLocationTypes string
|
||||
|
||||
const (
|
||||
// ExtendedLocationTypesEdgeZone ...
|
||||
ExtendedLocationTypesEdgeZone ExtendedLocationTypes = "EdgeZone"
|
||||
)
|
||||
|
||||
// PossibleExtendedLocationTypesValues returns an array of possible values for the ExtendedLocationTypes const type.
|
||||
func PossibleExtendedLocationTypesValues() []ExtendedLocationTypes {
|
||||
return []ExtendedLocationTypes{ExtendedLocationTypesEdgeZone}
|
||||
}
|
||||
|
||||
// GPUInstanceProfile enumerates the values for gpu instance profile.
|
||||
type GPUInstanceProfile string
|
||||
|
||||
const (
|
||||
// GPUInstanceProfileMIG1g ...
|
||||
GPUInstanceProfileMIG1g GPUInstanceProfile = "MIG1g"
|
||||
// GPUInstanceProfileMIG2g ...
|
||||
GPUInstanceProfileMIG2g GPUInstanceProfile = "MIG2g"
|
||||
// GPUInstanceProfileMIG3g ...
|
||||
GPUInstanceProfileMIG3g GPUInstanceProfile = "MIG3g"
|
||||
// GPUInstanceProfileMIG4g ...
|
||||
GPUInstanceProfileMIG4g GPUInstanceProfile = "MIG4g"
|
||||
// GPUInstanceProfileMIG7g ...
|
||||
GPUInstanceProfileMIG7g GPUInstanceProfile = "MIG7g"
|
||||
)
|
||||
|
||||
// PossibleGPUInstanceProfileValues returns an array of possible values for the GPUInstanceProfile const type.
|
||||
func PossibleGPUInstanceProfileValues() []GPUInstanceProfile {
|
||||
return []GPUInstanceProfile{GPUInstanceProfileMIG1g, GPUInstanceProfileMIG2g, GPUInstanceProfileMIG3g, GPUInstanceProfileMIG4g, GPUInstanceProfileMIG7g}
|
||||
}
|
||||
|
||||
// IPFamily enumerates the values for ip family.
|
||||
type IPFamily string
|
||||
|
||||
const (
|
||||
// IPFamilyIPv4 ...
|
||||
IPFamilyIPv4 IPFamily = "IPv4"
|
||||
// IPFamilyIPv6 ...
|
||||
IPFamilyIPv6 IPFamily = "IPv6"
|
||||
)
|
||||
|
||||
// PossibleIPFamilyValues returns an array of possible values for the IPFamily const type.
|
||||
func PossibleIPFamilyValues() []IPFamily {
|
||||
return []IPFamily{IPFamilyIPv4, IPFamilyIPv6}
|
||||
}
|
||||
|
||||
// KubeletDiskType enumerates the values for kubelet disk type.
|
||||
type KubeletDiskType string
|
||||
|
||||
const (
|
||||
// KubeletDiskTypeOS Kubelet will use the OS disk for its data.
|
||||
KubeletDiskTypeOS KubeletDiskType = "OS"
|
||||
// KubeletDiskTypeTemporary Kubelet will use the temporary disk for its data.
|
||||
KubeletDiskTypeTemporary KubeletDiskType = "Temporary"
|
||||
)
|
||||
|
||||
// PossibleKubeletDiskTypeValues returns an array of possible values for the KubeletDiskType const type.
|
||||
func PossibleKubeletDiskTypeValues() []KubeletDiskType {
|
||||
return []KubeletDiskType{KubeletDiskTypeOS, KubeletDiskTypeTemporary}
|
||||
}
|
||||
|
||||
// LicenseType enumerates the values for license type.
|
||||
type LicenseType string
|
||||
|
||||
const (
|
||||
// LicenseTypeNone No additional licensing is applied.
|
||||
LicenseTypeNone LicenseType = "None"
|
||||
// LicenseTypeWindowsServer Enables Azure Hybrid User Benefits for Windows VMs.
|
||||
LicenseTypeWindowsServer LicenseType = "Windows_Server"
|
||||
)
|
||||
|
||||
// PossibleLicenseTypeValues returns an array of possible values for the LicenseType const type.
|
||||
func PossibleLicenseTypeValues() []LicenseType {
|
||||
return []LicenseType{LicenseTypeNone, LicenseTypeWindowsServer}
|
||||
}
|
||||
|
||||
// LoadBalancerSku enumerates the values for load balancer sku.
|
||||
type LoadBalancerSku string
|
||||
|
||||
const (
|
||||
// LoadBalancerSkuBasic Use a basic Load Balancer with limited functionality.
|
||||
LoadBalancerSkuBasic LoadBalancerSku = "basic"
|
||||
// LoadBalancerSkuStandard Use a a standard Load Balancer. This is the recommended Load Balancer SKU. For
|
||||
// more information about on working with the load balancer in the managed cluster, see the [standard Load
|
||||
// Balancer](https://docs.microsoft.com/azure/aks/load-balancer-standard) article.
|
||||
LoadBalancerSkuStandard LoadBalancerSku = "standard"
|
||||
)
|
||||
|
||||
// PossibleLoadBalancerSkuValues returns an array of possible values for the LoadBalancerSku const type.
|
||||
func PossibleLoadBalancerSkuValues() []LoadBalancerSku {
|
||||
return []LoadBalancerSku{LoadBalancerSkuBasic, LoadBalancerSkuStandard}
|
||||
}
|
||||
|
||||
// ManagedClusterPodIdentityProvisioningState enumerates the values for managed cluster pod identity
|
||||
// provisioning state.
|
||||
type ManagedClusterPodIdentityProvisioningState string
|
||||
|
||||
const (
|
||||
// ManagedClusterPodIdentityProvisioningStateAssigned ...
|
||||
ManagedClusterPodIdentityProvisioningStateAssigned ManagedClusterPodIdentityProvisioningState = "Assigned"
|
||||
// ManagedClusterPodIdentityProvisioningStateDeleting ...
|
||||
ManagedClusterPodIdentityProvisioningStateDeleting ManagedClusterPodIdentityProvisioningState = "Deleting"
|
||||
// ManagedClusterPodIdentityProvisioningStateFailed ...
|
||||
ManagedClusterPodIdentityProvisioningStateFailed ManagedClusterPodIdentityProvisioningState = "Failed"
|
||||
// ManagedClusterPodIdentityProvisioningStateUpdating ...
|
||||
ManagedClusterPodIdentityProvisioningStateUpdating ManagedClusterPodIdentityProvisioningState = "Updating"
|
||||
)
|
||||
|
||||
// PossibleManagedClusterPodIdentityProvisioningStateValues returns an array of possible values for the ManagedClusterPodIdentityProvisioningState const type.
|
||||
func PossibleManagedClusterPodIdentityProvisioningStateValues() []ManagedClusterPodIdentityProvisioningState {
|
||||
return []ManagedClusterPodIdentityProvisioningState{ManagedClusterPodIdentityProvisioningStateAssigned, ManagedClusterPodIdentityProvisioningStateDeleting, ManagedClusterPodIdentityProvisioningStateFailed, ManagedClusterPodIdentityProvisioningStateUpdating}
|
||||
}
|
||||
|
||||
// ManagedClusterSKUName enumerates the values for managed cluster sku name.
|
||||
type ManagedClusterSKUName string
|
||||
|
||||
const (
|
||||
// ManagedClusterSKUNameBasic ...
|
||||
ManagedClusterSKUNameBasic ManagedClusterSKUName = "Basic"
|
||||
)
|
||||
|
||||
// PossibleManagedClusterSKUNameValues returns an array of possible values for the ManagedClusterSKUName const type.
|
||||
func PossibleManagedClusterSKUNameValues() []ManagedClusterSKUName {
|
||||
return []ManagedClusterSKUName{ManagedClusterSKUNameBasic}
|
||||
}
|
||||
|
||||
// ManagedClusterSKUTier enumerates the values for managed cluster sku tier.
|
||||
type ManagedClusterSKUTier string
|
||||
|
||||
const (
|
||||
// ManagedClusterSKUTierFree No guaranteed SLA, no additional charges. Free tier clusters have an SLO of
|
||||
// 99.5%.
|
||||
ManagedClusterSKUTierFree ManagedClusterSKUTier = "Free"
|
||||
// ManagedClusterSKUTierPaid Guarantees 99.95% availability of the Kubernetes API server endpoint for
|
||||
// clusters that use Availability Zones and 99.9% of availability for clusters that don't use Availability
|
||||
// Zones.
|
||||
ManagedClusterSKUTierPaid ManagedClusterSKUTier = "Paid"
|
||||
)
|
||||
|
||||
// PossibleManagedClusterSKUTierValues returns an array of possible values for the ManagedClusterSKUTier const type.
|
||||
func PossibleManagedClusterSKUTierValues() []ManagedClusterSKUTier {
|
||||
return []ManagedClusterSKUTier{ManagedClusterSKUTierFree, ManagedClusterSKUTierPaid}
|
||||
}
|
||||
|
||||
// NetworkMode enumerates the values for network mode.
|
||||
type NetworkMode string
|
||||
|
||||
const (
|
||||
// NetworkModeBridge This is no longer supported
|
||||
NetworkModeBridge NetworkMode = "bridge"
|
||||
// NetworkModeTransparent No bridge is created. Intra-VM Pod to Pod communication is through IP routes
|
||||
// created by Azure CNI. See [Transparent Mode](https://docs.microsoft.com/azure/aks/faq#transparent-mode)
|
||||
// for more information.
|
||||
NetworkModeTransparent NetworkMode = "transparent"
|
||||
)
|
||||
|
||||
// PossibleNetworkModeValues returns an array of possible values for the NetworkMode const type.
|
||||
func PossibleNetworkModeValues() []NetworkMode {
|
||||
return []NetworkMode{NetworkModeBridge, NetworkModeTransparent}
|
||||
}
|
||||
|
||||
// NetworkPlugin enumerates the values for network plugin.
|
||||
type NetworkPlugin string
|
||||
|
||||
const (
|
||||
// NetworkPluginAzure Use the Azure CNI network plugin. See [Azure CNI (advanced)
|
||||
// networking](https://docs.microsoft.com/azure/aks/concepts-network#azure-cni-advanced-networking) for
|
||||
// more information.
|
||||
NetworkPluginAzure NetworkPlugin = "azure"
|
||||
// NetworkPluginKubenet Use the Kubenet network plugin. See [Kubenet (basic)
|
||||
// networking](https://docs.microsoft.com/azure/aks/concepts-network#kubenet-basic-networking) for more
|
||||
// information.
|
||||
NetworkPluginKubenet NetworkPlugin = "kubenet"
|
||||
)
|
||||
|
||||
// PossibleNetworkPluginValues returns an array of possible values for the NetworkPlugin const type.
|
||||
func PossibleNetworkPluginValues() []NetworkPlugin {
|
||||
return []NetworkPlugin{NetworkPluginAzure, NetworkPluginKubenet}
|
||||
}
|
||||
|
||||
// NetworkPolicy enumerates the values for network policy.
|
||||
type NetworkPolicy string
|
||||
|
||||
const (
|
||||
// NetworkPolicyAzure Use Azure network policies. See [differences between Azure and Calico
|
||||
// policies](https://docs.microsoft.com/azure/aks/use-network-policies#differences-between-azure-and-calico-policies-and-their-capabilities)
|
||||
// for more information.
|
||||
NetworkPolicyAzure NetworkPolicy = "azure"
|
||||
// NetworkPolicyCalico Use Calico network policies. See [differences between Azure and Calico
|
||||
// policies](https://docs.microsoft.com/azure/aks/use-network-policies#differences-between-azure-and-calico-policies-and-their-capabilities)
|
||||
// for more information.
|
||||
NetworkPolicyCalico NetworkPolicy = "calico"
|
||||
)
|
||||
|
||||
// PossibleNetworkPolicyValues returns an array of possible values for the NetworkPolicy const type.
|
||||
func PossibleNetworkPolicyValues() []NetworkPolicy {
|
||||
return []NetworkPolicy{NetworkPolicyAzure, NetworkPolicyCalico}
|
||||
}
|
||||
|
||||
// OSDiskType enumerates the values for os disk type.
|
||||
type OSDiskType string
|
||||
|
||||
const (
|
||||
// OSDiskTypeEphemeral Ephemeral OS disks are stored only on the host machine, just like a temporary disk.
|
||||
// This provides lower read/write latency, along with faster node scaling and cluster upgrades.
|
||||
OSDiskTypeEphemeral OSDiskType = "Ephemeral"
|
||||
// OSDiskTypeManaged Azure replicates the operating system disk for a virtual machine to Azure storage to
|
||||
// avoid data loss should the VM need to be relocated to another host. Since containers aren't designed to
|
||||
// have local state persisted, this behavior offers limited value while providing some drawbacks, including
|
||||
// slower node provisioning and higher read/write latency.
|
||||
OSDiskTypeManaged OSDiskType = "Managed"
|
||||
)
|
||||
|
||||
// PossibleOSDiskTypeValues returns an array of possible values for the OSDiskType const type.
|
||||
func PossibleOSDiskTypeValues() []OSDiskType {
|
||||
return []OSDiskType{OSDiskTypeEphemeral, OSDiskTypeManaged}
|
||||
}
|
||||
|
||||
// OSSKU enumerates the values for ossku.
|
||||
type OSSKU string
|
||||
|
||||
const (
|
||||
// OSSKUCBLMariner ...
|
||||
OSSKUCBLMariner OSSKU = "CBLMariner"
|
||||
// OSSKUUbuntu ...
|
||||
OSSKUUbuntu OSSKU = "Ubuntu"
|
||||
)
|
||||
|
||||
// PossibleOSSKUValues returns an array of possible values for the OSSKU const type.
|
||||
func PossibleOSSKUValues() []OSSKU {
|
||||
return []OSSKU{OSSKUCBLMariner, OSSKUUbuntu}
|
||||
}
|
||||
|
||||
// OSType enumerates the values for os type.
|
||||
type OSType string
|
||||
|
||||
const (
|
||||
// OSTypeLinux Use Linux.
|
||||
OSTypeLinux OSType = "Linux"
|
||||
// OSTypeWindows Use Windows.
|
||||
OSTypeWindows OSType = "Windows"
|
||||
)
|
||||
|
||||
// PossibleOSTypeValues returns an array of possible values for the OSType const type.
|
||||
func PossibleOSTypeValues() []OSType {
|
||||
return []OSType{OSTypeLinux, OSTypeWindows}
|
||||
}
|
||||
|
||||
// OutboundType enumerates the values for outbound type.
|
||||
type OutboundType string
|
||||
|
||||
const (
|
||||
// OutboundTypeLoadBalancer The load balancer is used for egress through an AKS assigned public IP. This
|
||||
// supports Kubernetes services of type 'loadBalancer'. For more information see [outbound type
|
||||
// loadbalancer](https://docs.microsoft.com/azure/aks/egress-outboundtype#outbound-type-of-loadbalancer).
|
||||
OutboundTypeLoadBalancer OutboundType = "loadBalancer"
|
||||
// OutboundTypeManagedNATGateway The AKS-managed NAT gateway is used for egress.
|
||||
OutboundTypeManagedNATGateway OutboundType = "managedNATGateway"
|
||||
// OutboundTypeUserAssignedNATGateway The user-assigned NAT gateway associated to the cluster subnet is
|
||||
// used for egress. This is an advanced scenario and requires proper network configuration.
|
||||
OutboundTypeUserAssignedNATGateway OutboundType = "userAssignedNATGateway"
|
||||
// OutboundTypeUserDefinedRouting Egress paths must be defined by the user. This is an advanced scenario
|
||||
// and requires proper network configuration. For more information see [outbound type
|
||||
// userDefinedRouting](https://docs.microsoft.com/azure/aks/egress-outboundtype#outbound-type-of-userdefinedrouting).
|
||||
OutboundTypeUserDefinedRouting OutboundType = "userDefinedRouting"
|
||||
)
|
||||
|
||||
// PossibleOutboundTypeValues returns an array of possible values for the OutboundType const type.
|
||||
func PossibleOutboundTypeValues() []OutboundType {
|
||||
return []OutboundType{OutboundTypeLoadBalancer, OutboundTypeManagedNATGateway, OutboundTypeUserAssignedNATGateway, OutboundTypeUserDefinedRouting}
|
||||
}
|
||||
|
||||
// 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}
|
||||
}
|
||||
|
||||
// PublicNetworkAccess enumerates the values for public network access.
|
||||
type PublicNetworkAccess string
|
||||
|
||||
const (
|
||||
// PublicNetworkAccessDisabled ...
|
||||
PublicNetworkAccessDisabled PublicNetworkAccess = "Disabled"
|
||||
// PublicNetworkAccessEnabled ...
|
||||
PublicNetworkAccessEnabled PublicNetworkAccess = "Enabled"
|
||||
)
|
||||
|
||||
// PossiblePublicNetworkAccessValues returns an array of possible values for the PublicNetworkAccess const type.
|
||||
func PossiblePublicNetworkAccessValues() []PublicNetworkAccess {
|
||||
return []PublicNetworkAccess{PublicNetworkAccessDisabled, PublicNetworkAccessEnabled}
|
||||
}
|
||||
|
||||
// ResourceIdentityType enumerates the values for resource identity type.
|
||||
type ResourceIdentityType string
|
||||
|
||||
const (
|
||||
// ResourceIdentityTypeNone Do not use a managed identity for the Managed Cluster, service principal will
|
||||
// be used instead.
|
||||
ResourceIdentityTypeNone ResourceIdentityType = "None"
|
||||
// ResourceIdentityTypeSystemAssigned Use an implicitly created system assigned managed identity to manage
|
||||
// cluster resources. Master components in the control plane such as kube-controller-manager will use the
|
||||
// system assigned managed identity to manipulate Azure resources.
|
||||
ResourceIdentityTypeSystemAssigned ResourceIdentityType = "SystemAssigned"
|
||||
// ResourceIdentityTypeUserAssigned Use a user-specified identity to manage cluster resources. Master
|
||||
// components in the control plane such as kube-controller-manager will use the specified user assigned
|
||||
// managed identity to manipulate Azure resources.
|
||||
ResourceIdentityTypeUserAssigned ResourceIdentityType = "UserAssigned"
|
||||
)
|
||||
|
||||
// PossibleResourceIdentityTypeValues returns an array of possible values for the ResourceIdentityType const type.
|
||||
func PossibleResourceIdentityTypeValues() []ResourceIdentityType {
|
||||
return []ResourceIdentityType{ResourceIdentityTypeNone, ResourceIdentityTypeSystemAssigned, ResourceIdentityTypeUserAssigned}
|
||||
}
|
||||
|
||||
// ScaleDownMode enumerates the values for scale down mode.
|
||||
type ScaleDownMode string
|
||||
|
||||
const (
|
||||
// ScaleDownModeDeallocate Attempt to start deallocated instances (if they exist) during scale up and
|
||||
// deallocate instances during scale down.
|
||||
ScaleDownModeDeallocate ScaleDownMode = "Deallocate"
|
||||
// ScaleDownModeDelete Create new instances during scale up and remove instances during scale down.
|
||||
ScaleDownModeDelete ScaleDownMode = "Delete"
|
||||
)
|
||||
|
||||
// PossibleScaleDownModeValues returns an array of possible values for the ScaleDownMode const type.
|
||||
func PossibleScaleDownModeValues() []ScaleDownMode {
|
||||
return []ScaleDownMode{ScaleDownModeDeallocate, ScaleDownModeDelete}
|
||||
}
|
||||
|
||||
// ScaleSetEvictionPolicy enumerates the values for scale set eviction policy.
|
||||
type ScaleSetEvictionPolicy string
|
||||
|
||||
const (
|
||||
// ScaleSetEvictionPolicyDeallocate Nodes in the underlying Scale Set of the node pool are set to the
|
||||
// stopped-deallocated state upon eviction. Nodes in the stopped-deallocated state count against your
|
||||
// compute quota and can cause issues with cluster scaling or upgrading.
|
||||
ScaleSetEvictionPolicyDeallocate ScaleSetEvictionPolicy = "Deallocate"
|
||||
// ScaleSetEvictionPolicyDelete Nodes in the underlying Scale Set of the node pool are deleted when they're
|
||||
// evicted.
|
||||
ScaleSetEvictionPolicyDelete ScaleSetEvictionPolicy = "Delete"
|
||||
)
|
||||
|
||||
// PossibleScaleSetEvictionPolicyValues returns an array of possible values for the ScaleSetEvictionPolicy const type.
|
||||
func PossibleScaleSetEvictionPolicyValues() []ScaleSetEvictionPolicy {
|
||||
return []ScaleSetEvictionPolicy{ScaleSetEvictionPolicyDeallocate, ScaleSetEvictionPolicyDelete}
|
||||
}
|
||||
|
||||
// ScaleSetPriority enumerates the values for scale set priority.
|
||||
type ScaleSetPriority string
|
||||
|
||||
const (
|
||||
// ScaleSetPriorityRegular Regular VMs will be used.
|
||||
ScaleSetPriorityRegular ScaleSetPriority = "Regular"
|
||||
// ScaleSetPrioritySpot Spot priority VMs will be used. There is no SLA for spot nodes. See [spot on
|
||||
// AKS](https://docs.microsoft.com/azure/aks/spot-node-pool) for more information.
|
||||
ScaleSetPrioritySpot ScaleSetPriority = "Spot"
|
||||
)
|
||||
|
||||
// PossibleScaleSetPriorityValues returns an array of possible values for the ScaleSetPriority const type.
|
||||
func PossibleScaleSetPriorityValues() []ScaleSetPriority {
|
||||
return []ScaleSetPriority{ScaleSetPriorityRegular, ScaleSetPrioritySpot}
|
||||
}
|
||||
|
||||
// SnapshotType enumerates the values for snapshot type.
|
||||
type SnapshotType string
|
||||
|
||||
const (
|
||||
// SnapshotTypeNodePool The snapshot is a snapshot of a node pool.
|
||||
SnapshotTypeNodePool SnapshotType = "NodePool"
|
||||
)
|
||||
|
||||
// PossibleSnapshotTypeValues returns an array of possible values for the SnapshotType const type.
|
||||
func PossibleSnapshotTypeValues() []SnapshotType {
|
||||
return []SnapshotType{SnapshotTypeNodePool}
|
||||
}
|
||||
|
||||
// StorageProfileTypes enumerates the values for storage profile types.
|
||||
type StorageProfileTypes string
|
||||
|
||||
const (
|
||||
// StorageProfileTypesManagedDisks ...
|
||||
StorageProfileTypesManagedDisks StorageProfileTypes = "ManagedDisks"
|
||||
// StorageProfileTypesStorageAccount ...
|
||||
StorageProfileTypesStorageAccount StorageProfileTypes = "StorageAccount"
|
||||
)
|
||||
|
||||
// PossibleStorageProfileTypesValues returns an array of possible values for the StorageProfileTypes const type.
|
||||
func PossibleStorageProfileTypesValues() []StorageProfileTypes {
|
||||
return []StorageProfileTypes{StorageProfileTypesManagedDisks, StorageProfileTypesStorageAccount}
|
||||
}
|
||||
|
||||
// UpgradeChannel enumerates the values for upgrade channel.
|
||||
type UpgradeChannel string
|
||||
|
||||
const (
|
||||
// UpgradeChannelNodeImage Automatically upgrade the node image to the latest version available. Microsoft
|
||||
// provides patches and new images for image nodes frequently (usually weekly), but your running nodes
|
||||
// won't get the new images unless you do a node image upgrade. Turning on the node-image channel will
|
||||
// automatically update your node images whenever a new version is available.
|
||||
UpgradeChannelNodeImage UpgradeChannel = "node-image"
|
||||
// UpgradeChannelNone Disables auto-upgrades and keeps the cluster at its current version of Kubernetes.
|
||||
UpgradeChannelNone UpgradeChannel = "none"
|
||||
// UpgradeChannelPatch Automatically upgrade the cluster to the latest supported patch version when it
|
||||
// becomes available while keeping the minor version the same. For example, if a cluster is running version
|
||||
// 1.17.7 and versions 1.17.9, 1.18.4, 1.18.6, and 1.19.1 are available, your cluster is upgraded to
|
||||
// 1.17.9.
|
||||
UpgradeChannelPatch UpgradeChannel = "patch"
|
||||
// UpgradeChannelRapid Automatically upgrade the cluster to the latest supported patch release on the
|
||||
// latest supported minor version. In cases where the cluster is at a version of Kubernetes that is at an
|
||||
// N-2 minor version where N is the latest supported minor version, the cluster first upgrades to the
|
||||
// latest supported patch version on N-1 minor version. For example, if a cluster is running version 1.17.7
|
||||
// and versions 1.17.9, 1.18.4, 1.18.6, and 1.19.1 are available, your cluster first is upgraded to 1.18.6,
|
||||
// then is upgraded to 1.19.1.
|
||||
UpgradeChannelRapid UpgradeChannel = "rapid"
|
||||
// UpgradeChannelStable Automatically upgrade the cluster to the latest supported patch release on minor
|
||||
// version N-1, where N is the latest supported minor version. For example, if a cluster is running version
|
||||
// 1.17.7 and versions 1.17.9, 1.18.4, 1.18.6, and 1.19.1 are available, your cluster is upgraded to
|
||||
// 1.18.6.
|
||||
UpgradeChannelStable UpgradeChannel = "stable"
|
||||
)
|
||||
|
||||
// PossibleUpgradeChannelValues returns an array of possible values for the UpgradeChannel const type.
|
||||
func PossibleUpgradeChannelValues() []UpgradeChannel {
|
||||
return []UpgradeChannel{UpgradeChannelNodeImage, UpgradeChannelNone, UpgradeChannelPatch, UpgradeChannelRapid, UpgradeChannelStable}
|
||||
}
|
||||
|
||||
// VMSizeTypes enumerates the values for vm size types.
|
||||
type VMSizeTypes string
|
||||
|
||||
const (
|
||||
// VMSizeTypesStandardA1 ...
|
||||
VMSizeTypesStandardA1 VMSizeTypes = "Standard_A1"
|
||||
// VMSizeTypesStandardA10 ...
|
||||
VMSizeTypesStandardA10 VMSizeTypes = "Standard_A10"
|
||||
// VMSizeTypesStandardA11 ...
|
||||
VMSizeTypesStandardA11 VMSizeTypes = "Standard_A11"
|
||||
// VMSizeTypesStandardA1V2 ...
|
||||
VMSizeTypesStandardA1V2 VMSizeTypes = "Standard_A1_v2"
|
||||
// VMSizeTypesStandardA2 ...
|
||||
VMSizeTypesStandardA2 VMSizeTypes = "Standard_A2"
|
||||
// VMSizeTypesStandardA2mV2 ...
|
||||
VMSizeTypesStandardA2mV2 VMSizeTypes = "Standard_A2m_v2"
|
||||
// VMSizeTypesStandardA2V2 ...
|
||||
VMSizeTypesStandardA2V2 VMSizeTypes = "Standard_A2_v2"
|
||||
// VMSizeTypesStandardA3 ...
|
||||
VMSizeTypesStandardA3 VMSizeTypes = "Standard_A3"
|
||||
// VMSizeTypesStandardA4 ...
|
||||
VMSizeTypesStandardA4 VMSizeTypes = "Standard_A4"
|
||||
// VMSizeTypesStandardA4mV2 ...
|
||||
VMSizeTypesStandardA4mV2 VMSizeTypes = "Standard_A4m_v2"
|
||||
// VMSizeTypesStandardA4V2 ...
|
||||
VMSizeTypesStandardA4V2 VMSizeTypes = "Standard_A4_v2"
|
||||
// VMSizeTypesStandardA5 ...
|
||||
VMSizeTypesStandardA5 VMSizeTypes = "Standard_A5"
|
||||
// VMSizeTypesStandardA6 ...
|
||||
VMSizeTypesStandardA6 VMSizeTypes = "Standard_A6"
|
||||
// VMSizeTypesStandardA7 ...
|
||||
VMSizeTypesStandardA7 VMSizeTypes = "Standard_A7"
|
||||
// VMSizeTypesStandardA8 ...
|
||||
VMSizeTypesStandardA8 VMSizeTypes = "Standard_A8"
|
||||
// VMSizeTypesStandardA8mV2 ...
|
||||
VMSizeTypesStandardA8mV2 VMSizeTypes = "Standard_A8m_v2"
|
||||
// VMSizeTypesStandardA8V2 ...
|
||||
VMSizeTypesStandardA8V2 VMSizeTypes = "Standard_A8_v2"
|
||||
// VMSizeTypesStandardA9 ...
|
||||
VMSizeTypesStandardA9 VMSizeTypes = "Standard_A9"
|
||||
// VMSizeTypesStandardB2ms ...
|
||||
VMSizeTypesStandardB2ms VMSizeTypes = "Standard_B2ms"
|
||||
// VMSizeTypesStandardB2s ...
|
||||
VMSizeTypesStandardB2s VMSizeTypes = "Standard_B2s"
|
||||
// VMSizeTypesStandardB4ms ...
|
||||
VMSizeTypesStandardB4ms VMSizeTypes = "Standard_B4ms"
|
||||
// VMSizeTypesStandardB8ms ...
|
||||
VMSizeTypesStandardB8ms VMSizeTypes = "Standard_B8ms"
|
||||
// VMSizeTypesStandardD1 ...
|
||||
VMSizeTypesStandardD1 VMSizeTypes = "Standard_D1"
|
||||
// VMSizeTypesStandardD11 ...
|
||||
VMSizeTypesStandardD11 VMSizeTypes = "Standard_D11"
|
||||
// VMSizeTypesStandardD11V2 ...
|
||||
VMSizeTypesStandardD11V2 VMSizeTypes = "Standard_D11_v2"
|
||||
// VMSizeTypesStandardD11V2Promo ...
|
||||
VMSizeTypesStandardD11V2Promo VMSizeTypes = "Standard_D11_v2_Promo"
|
||||
// VMSizeTypesStandardD12 ...
|
||||
VMSizeTypesStandardD12 VMSizeTypes = "Standard_D12"
|
||||
// VMSizeTypesStandardD12V2 ...
|
||||
VMSizeTypesStandardD12V2 VMSizeTypes = "Standard_D12_v2"
|
||||
// VMSizeTypesStandardD12V2Promo ...
|
||||
VMSizeTypesStandardD12V2Promo VMSizeTypes = "Standard_D12_v2_Promo"
|
||||
// VMSizeTypesStandardD13 ...
|
||||
VMSizeTypesStandardD13 VMSizeTypes = "Standard_D13"
|
||||
// VMSizeTypesStandardD13V2 ...
|
||||
VMSizeTypesStandardD13V2 VMSizeTypes = "Standard_D13_v2"
|
||||
// VMSizeTypesStandardD13V2Promo ...
|
||||
VMSizeTypesStandardD13V2Promo VMSizeTypes = "Standard_D13_v2_Promo"
|
||||
// VMSizeTypesStandardD14 ...
|
||||
VMSizeTypesStandardD14 VMSizeTypes = "Standard_D14"
|
||||
// VMSizeTypesStandardD14V2 ...
|
||||
VMSizeTypesStandardD14V2 VMSizeTypes = "Standard_D14_v2"
|
||||
// VMSizeTypesStandardD14V2Promo ...
|
||||
VMSizeTypesStandardD14V2Promo VMSizeTypes = "Standard_D14_v2_Promo"
|
||||
// VMSizeTypesStandardD15V2 ...
|
||||
VMSizeTypesStandardD15V2 VMSizeTypes = "Standard_D15_v2"
|
||||
// VMSizeTypesStandardD16sV3 ...
|
||||
VMSizeTypesStandardD16sV3 VMSizeTypes = "Standard_D16s_v3"
|
||||
// VMSizeTypesStandardD16V3 ...
|
||||
VMSizeTypesStandardD16V3 VMSizeTypes = "Standard_D16_v3"
|
||||
// VMSizeTypesStandardD1V2 ...
|
||||
VMSizeTypesStandardD1V2 VMSizeTypes = "Standard_D1_v2"
|
||||
// VMSizeTypesStandardD2 ...
|
||||
VMSizeTypesStandardD2 VMSizeTypes = "Standard_D2"
|
||||
// VMSizeTypesStandardD2sV3 ...
|
||||
VMSizeTypesStandardD2sV3 VMSizeTypes = "Standard_D2s_v3"
|
||||
// VMSizeTypesStandardD2V2 ...
|
||||
VMSizeTypesStandardD2V2 VMSizeTypes = "Standard_D2_v2"
|
||||
// VMSizeTypesStandardD2V2Promo ...
|
||||
VMSizeTypesStandardD2V2Promo VMSizeTypes = "Standard_D2_v2_Promo"
|
||||
// VMSizeTypesStandardD2V3 ...
|
||||
VMSizeTypesStandardD2V3 VMSizeTypes = "Standard_D2_v3"
|
||||
// VMSizeTypesStandardD3 ...
|
||||
VMSizeTypesStandardD3 VMSizeTypes = "Standard_D3"
|
||||
// VMSizeTypesStandardD32sV3 ...
|
||||
VMSizeTypesStandardD32sV3 VMSizeTypes = "Standard_D32s_v3"
|
||||
// VMSizeTypesStandardD32V3 ...
|
||||
VMSizeTypesStandardD32V3 VMSizeTypes = "Standard_D32_v3"
|
||||
// VMSizeTypesStandardD3V2 ...
|
||||
VMSizeTypesStandardD3V2 VMSizeTypes = "Standard_D3_v2"
|
||||
// VMSizeTypesStandardD3V2Promo ...
|
||||
VMSizeTypesStandardD3V2Promo VMSizeTypes = "Standard_D3_v2_Promo"
|
||||
// VMSizeTypesStandardD4 ...
|
||||
VMSizeTypesStandardD4 VMSizeTypes = "Standard_D4"
|
||||
// VMSizeTypesStandardD4sV3 ...
|
||||
VMSizeTypesStandardD4sV3 VMSizeTypes = "Standard_D4s_v3"
|
||||
// VMSizeTypesStandardD4V2 ...
|
||||
VMSizeTypesStandardD4V2 VMSizeTypes = "Standard_D4_v2"
|
||||
// VMSizeTypesStandardD4V2Promo ...
|
||||
VMSizeTypesStandardD4V2Promo VMSizeTypes = "Standard_D4_v2_Promo"
|
||||
// VMSizeTypesStandardD4V3 ...
|
||||
VMSizeTypesStandardD4V3 VMSizeTypes = "Standard_D4_v3"
|
||||
// VMSizeTypesStandardD5V2 ...
|
||||
VMSizeTypesStandardD5V2 VMSizeTypes = "Standard_D5_v2"
|
||||
// VMSizeTypesStandardD5V2Promo ...
|
||||
VMSizeTypesStandardD5V2Promo VMSizeTypes = "Standard_D5_v2_Promo"
|
||||
// VMSizeTypesStandardD64sV3 ...
|
||||
VMSizeTypesStandardD64sV3 VMSizeTypes = "Standard_D64s_v3"
|
||||
// VMSizeTypesStandardD64V3 ...
|
||||
VMSizeTypesStandardD64V3 VMSizeTypes = "Standard_D64_v3"
|
||||
// VMSizeTypesStandardD8sV3 ...
|
||||
VMSizeTypesStandardD8sV3 VMSizeTypes = "Standard_D8s_v3"
|
||||
// VMSizeTypesStandardD8V3 ...
|
||||
VMSizeTypesStandardD8V3 VMSizeTypes = "Standard_D8_v3"
|
||||
// VMSizeTypesStandardDS1 ...
|
||||
VMSizeTypesStandardDS1 VMSizeTypes = "Standard_DS1"
|
||||
// VMSizeTypesStandardDS11 ...
|
||||
VMSizeTypesStandardDS11 VMSizeTypes = "Standard_DS11"
|
||||
// VMSizeTypesStandardDS11V2 ...
|
||||
VMSizeTypesStandardDS11V2 VMSizeTypes = "Standard_DS11_v2"
|
||||
// VMSizeTypesStandardDS11V2Promo ...
|
||||
VMSizeTypesStandardDS11V2Promo VMSizeTypes = "Standard_DS11_v2_Promo"
|
||||
// VMSizeTypesStandardDS12 ...
|
||||
VMSizeTypesStandardDS12 VMSizeTypes = "Standard_DS12"
|
||||
// VMSizeTypesStandardDS12V2 ...
|
||||
VMSizeTypesStandardDS12V2 VMSizeTypes = "Standard_DS12_v2"
|
||||
// VMSizeTypesStandardDS12V2Promo ...
|
||||
VMSizeTypesStandardDS12V2Promo VMSizeTypes = "Standard_DS12_v2_Promo"
|
||||
// VMSizeTypesStandardDS13 ...
|
||||
VMSizeTypesStandardDS13 VMSizeTypes = "Standard_DS13"
|
||||
// VMSizeTypesStandardDS132V2 ...
|
||||
VMSizeTypesStandardDS132V2 VMSizeTypes = "Standard_DS13-2_v2"
|
||||
// VMSizeTypesStandardDS134V2 ...
|
||||
VMSizeTypesStandardDS134V2 VMSizeTypes = "Standard_DS13-4_v2"
|
||||
// VMSizeTypesStandardDS13V2 ...
|
||||
VMSizeTypesStandardDS13V2 VMSizeTypes = "Standard_DS13_v2"
|
||||
// VMSizeTypesStandardDS13V2Promo ...
|
||||
VMSizeTypesStandardDS13V2Promo VMSizeTypes = "Standard_DS13_v2_Promo"
|
||||
// VMSizeTypesStandardDS14 ...
|
||||
VMSizeTypesStandardDS14 VMSizeTypes = "Standard_DS14"
|
||||
// VMSizeTypesStandardDS144V2 ...
|
||||
VMSizeTypesStandardDS144V2 VMSizeTypes = "Standard_DS14-4_v2"
|
||||
// VMSizeTypesStandardDS148V2 ...
|
||||
VMSizeTypesStandardDS148V2 VMSizeTypes = "Standard_DS14-8_v2"
|
||||
// VMSizeTypesStandardDS14V2 ...
|
||||
VMSizeTypesStandardDS14V2 VMSizeTypes = "Standard_DS14_v2"
|
||||
// VMSizeTypesStandardDS14V2Promo ...
|
||||
VMSizeTypesStandardDS14V2Promo VMSizeTypes = "Standard_DS14_v2_Promo"
|
||||
// VMSizeTypesStandardDS15V2 ...
|
||||
VMSizeTypesStandardDS15V2 VMSizeTypes = "Standard_DS15_v2"
|
||||
// VMSizeTypesStandardDS1V2 ...
|
||||
VMSizeTypesStandardDS1V2 VMSizeTypes = "Standard_DS1_v2"
|
||||
// VMSizeTypesStandardDS2 ...
|
||||
VMSizeTypesStandardDS2 VMSizeTypes = "Standard_DS2"
|
||||
// VMSizeTypesStandardDS2V2 ...
|
||||
VMSizeTypesStandardDS2V2 VMSizeTypes = "Standard_DS2_v2"
|
||||
// VMSizeTypesStandardDS2V2Promo ...
|
||||
VMSizeTypesStandardDS2V2Promo VMSizeTypes = "Standard_DS2_v2_Promo"
|
||||
// VMSizeTypesStandardDS3 ...
|
||||
VMSizeTypesStandardDS3 VMSizeTypes = "Standard_DS3"
|
||||
// VMSizeTypesStandardDS3V2 ...
|
||||
VMSizeTypesStandardDS3V2 VMSizeTypes = "Standard_DS3_v2"
|
||||
// VMSizeTypesStandardDS3V2Promo ...
|
||||
VMSizeTypesStandardDS3V2Promo VMSizeTypes = "Standard_DS3_v2_Promo"
|
||||
// VMSizeTypesStandardDS4 ...
|
||||
VMSizeTypesStandardDS4 VMSizeTypes = "Standard_DS4"
|
||||
// VMSizeTypesStandardDS4V2 ...
|
||||
VMSizeTypesStandardDS4V2 VMSizeTypes = "Standard_DS4_v2"
|
||||
// VMSizeTypesStandardDS4V2Promo ...
|
||||
VMSizeTypesStandardDS4V2Promo VMSizeTypes = "Standard_DS4_v2_Promo"
|
||||
// VMSizeTypesStandardDS5V2 ...
|
||||
VMSizeTypesStandardDS5V2 VMSizeTypes = "Standard_DS5_v2"
|
||||
// VMSizeTypesStandardDS5V2Promo ...
|
||||
VMSizeTypesStandardDS5V2Promo VMSizeTypes = "Standard_DS5_v2_Promo"
|
||||
// VMSizeTypesStandardE16sV3 ...
|
||||
VMSizeTypesStandardE16sV3 VMSizeTypes = "Standard_E16s_v3"
|
||||
// VMSizeTypesStandardE16V3 ...
|
||||
VMSizeTypesStandardE16V3 VMSizeTypes = "Standard_E16_v3"
|
||||
// VMSizeTypesStandardE2sV3 ...
|
||||
VMSizeTypesStandardE2sV3 VMSizeTypes = "Standard_E2s_v3"
|
||||
// VMSizeTypesStandardE2V3 ...
|
||||
VMSizeTypesStandardE2V3 VMSizeTypes = "Standard_E2_v3"
|
||||
// VMSizeTypesStandardE3216sV3 ...
|
||||
VMSizeTypesStandardE3216sV3 VMSizeTypes = "Standard_E32-16s_v3"
|
||||
// VMSizeTypesStandardE328sV3 ...
|
||||
VMSizeTypesStandardE328sV3 VMSizeTypes = "Standard_E32-8s_v3"
|
||||
// VMSizeTypesStandardE32sV3 ...
|
||||
VMSizeTypesStandardE32sV3 VMSizeTypes = "Standard_E32s_v3"
|
||||
// VMSizeTypesStandardE32V3 ...
|
||||
VMSizeTypesStandardE32V3 VMSizeTypes = "Standard_E32_v3"
|
||||
// VMSizeTypesStandardE4sV3 ...
|
||||
VMSizeTypesStandardE4sV3 VMSizeTypes = "Standard_E4s_v3"
|
||||
// VMSizeTypesStandardE4V3 ...
|
||||
VMSizeTypesStandardE4V3 VMSizeTypes = "Standard_E4_v3"
|
||||
// VMSizeTypesStandardE6416sV3 ...
|
||||
VMSizeTypesStandardE6416sV3 VMSizeTypes = "Standard_E64-16s_v3"
|
||||
// VMSizeTypesStandardE6432sV3 ...
|
||||
VMSizeTypesStandardE6432sV3 VMSizeTypes = "Standard_E64-32s_v3"
|
||||
// VMSizeTypesStandardE64sV3 ...
|
||||
VMSizeTypesStandardE64sV3 VMSizeTypes = "Standard_E64s_v3"
|
||||
// VMSizeTypesStandardE64V3 ...
|
||||
VMSizeTypesStandardE64V3 VMSizeTypes = "Standard_E64_v3"
|
||||
// VMSizeTypesStandardE8sV3 ...
|
||||
VMSizeTypesStandardE8sV3 VMSizeTypes = "Standard_E8s_v3"
|
||||
// VMSizeTypesStandardE8V3 ...
|
||||
VMSizeTypesStandardE8V3 VMSizeTypes = "Standard_E8_v3"
|
||||
// VMSizeTypesStandardF1 ...
|
||||
VMSizeTypesStandardF1 VMSizeTypes = "Standard_F1"
|
||||
// VMSizeTypesStandardF16 ...
|
||||
VMSizeTypesStandardF16 VMSizeTypes = "Standard_F16"
|
||||
// VMSizeTypesStandardF16s ...
|
||||
VMSizeTypesStandardF16s VMSizeTypes = "Standard_F16s"
|
||||
// VMSizeTypesStandardF16sV2 ...
|
||||
VMSizeTypesStandardF16sV2 VMSizeTypes = "Standard_F16s_v2"
|
||||
// VMSizeTypesStandardF1s ...
|
||||
VMSizeTypesStandardF1s VMSizeTypes = "Standard_F1s"
|
||||
// VMSizeTypesStandardF2 ...
|
||||
VMSizeTypesStandardF2 VMSizeTypes = "Standard_F2"
|
||||
// VMSizeTypesStandardF2s ...
|
||||
VMSizeTypesStandardF2s VMSizeTypes = "Standard_F2s"
|
||||
// VMSizeTypesStandardF2sV2 ...
|
||||
VMSizeTypesStandardF2sV2 VMSizeTypes = "Standard_F2s_v2"
|
||||
// VMSizeTypesStandardF32sV2 ...
|
||||
VMSizeTypesStandardF32sV2 VMSizeTypes = "Standard_F32s_v2"
|
||||
// VMSizeTypesStandardF4 ...
|
||||
VMSizeTypesStandardF4 VMSizeTypes = "Standard_F4"
|
||||
// VMSizeTypesStandardF4s ...
|
||||
VMSizeTypesStandardF4s VMSizeTypes = "Standard_F4s"
|
||||
// VMSizeTypesStandardF4sV2 ...
|
||||
VMSizeTypesStandardF4sV2 VMSizeTypes = "Standard_F4s_v2"
|
||||
// VMSizeTypesStandardF64sV2 ...
|
||||
VMSizeTypesStandardF64sV2 VMSizeTypes = "Standard_F64s_v2"
|
||||
// VMSizeTypesStandardF72sV2 ...
|
||||
VMSizeTypesStandardF72sV2 VMSizeTypes = "Standard_F72s_v2"
|
||||
// VMSizeTypesStandardF8 ...
|
||||
VMSizeTypesStandardF8 VMSizeTypes = "Standard_F8"
|
||||
// VMSizeTypesStandardF8s ...
|
||||
VMSizeTypesStandardF8s VMSizeTypes = "Standard_F8s"
|
||||
// VMSizeTypesStandardF8sV2 ...
|
||||
VMSizeTypesStandardF8sV2 VMSizeTypes = "Standard_F8s_v2"
|
||||
// VMSizeTypesStandardG1 ...
|
||||
VMSizeTypesStandardG1 VMSizeTypes = "Standard_G1"
|
||||
// VMSizeTypesStandardG2 ...
|
||||
VMSizeTypesStandardG2 VMSizeTypes = "Standard_G2"
|
||||
// VMSizeTypesStandardG3 ...
|
||||
VMSizeTypesStandardG3 VMSizeTypes = "Standard_G3"
|
||||
// VMSizeTypesStandardG4 ...
|
||||
VMSizeTypesStandardG4 VMSizeTypes = "Standard_G4"
|
||||
// VMSizeTypesStandardG5 ...
|
||||
VMSizeTypesStandardG5 VMSizeTypes = "Standard_G5"
|
||||
// VMSizeTypesStandardGS1 ...
|
||||
VMSizeTypesStandardGS1 VMSizeTypes = "Standard_GS1"
|
||||
// VMSizeTypesStandardGS2 ...
|
||||
VMSizeTypesStandardGS2 VMSizeTypes = "Standard_GS2"
|
||||
// VMSizeTypesStandardGS3 ...
|
||||
VMSizeTypesStandardGS3 VMSizeTypes = "Standard_GS3"
|
||||
// VMSizeTypesStandardGS4 ...
|
||||
VMSizeTypesStandardGS4 VMSizeTypes = "Standard_GS4"
|
||||
// VMSizeTypesStandardGS44 ...
|
||||
VMSizeTypesStandardGS44 VMSizeTypes = "Standard_GS4-4"
|
||||
// VMSizeTypesStandardGS48 ...
|
||||
VMSizeTypesStandardGS48 VMSizeTypes = "Standard_GS4-8"
|
||||
// VMSizeTypesStandardGS5 ...
|
||||
VMSizeTypesStandardGS5 VMSizeTypes = "Standard_GS5"
|
||||
// VMSizeTypesStandardGS516 ...
|
||||
VMSizeTypesStandardGS516 VMSizeTypes = "Standard_GS5-16"
|
||||
// VMSizeTypesStandardGS58 ...
|
||||
VMSizeTypesStandardGS58 VMSizeTypes = "Standard_GS5-8"
|
||||
// VMSizeTypesStandardH16 ...
|
||||
VMSizeTypesStandardH16 VMSizeTypes = "Standard_H16"
|
||||
// VMSizeTypesStandardH16m ...
|
||||
VMSizeTypesStandardH16m VMSizeTypes = "Standard_H16m"
|
||||
// VMSizeTypesStandardH16mr ...
|
||||
VMSizeTypesStandardH16mr VMSizeTypes = "Standard_H16mr"
|
||||
// VMSizeTypesStandardH16r ...
|
||||
VMSizeTypesStandardH16r VMSizeTypes = "Standard_H16r"
|
||||
// VMSizeTypesStandardH8 ...
|
||||
VMSizeTypesStandardH8 VMSizeTypes = "Standard_H8"
|
||||
// VMSizeTypesStandardH8m ...
|
||||
VMSizeTypesStandardH8m VMSizeTypes = "Standard_H8m"
|
||||
// VMSizeTypesStandardL16s ...
|
||||
VMSizeTypesStandardL16s VMSizeTypes = "Standard_L16s"
|
||||
// VMSizeTypesStandardL32s ...
|
||||
VMSizeTypesStandardL32s VMSizeTypes = "Standard_L32s"
|
||||
// VMSizeTypesStandardL4s ...
|
||||
VMSizeTypesStandardL4s VMSizeTypes = "Standard_L4s"
|
||||
// VMSizeTypesStandardL8s ...
|
||||
VMSizeTypesStandardL8s VMSizeTypes = "Standard_L8s"
|
||||
// VMSizeTypesStandardM12832ms ...
|
||||
VMSizeTypesStandardM12832ms VMSizeTypes = "Standard_M128-32ms"
|
||||
// VMSizeTypesStandardM12864ms ...
|
||||
VMSizeTypesStandardM12864ms VMSizeTypes = "Standard_M128-64ms"
|
||||
// VMSizeTypesStandardM128ms ...
|
||||
VMSizeTypesStandardM128ms VMSizeTypes = "Standard_M128ms"
|
||||
// VMSizeTypesStandardM128s ...
|
||||
VMSizeTypesStandardM128s VMSizeTypes = "Standard_M128s"
|
||||
// VMSizeTypesStandardM6416ms ...
|
||||
VMSizeTypesStandardM6416ms VMSizeTypes = "Standard_M64-16ms"
|
||||
// VMSizeTypesStandardM6432ms ...
|
||||
VMSizeTypesStandardM6432ms VMSizeTypes = "Standard_M64-32ms"
|
||||
// VMSizeTypesStandardM64ms ...
|
||||
VMSizeTypesStandardM64ms VMSizeTypes = "Standard_M64ms"
|
||||
// VMSizeTypesStandardM64s ...
|
||||
VMSizeTypesStandardM64s VMSizeTypes = "Standard_M64s"
|
||||
// VMSizeTypesStandardNC12 ...
|
||||
VMSizeTypesStandardNC12 VMSizeTypes = "Standard_NC12"
|
||||
// VMSizeTypesStandardNC12sV2 ...
|
||||
VMSizeTypesStandardNC12sV2 VMSizeTypes = "Standard_NC12s_v2"
|
||||
// VMSizeTypesStandardNC12sV3 ...
|
||||
VMSizeTypesStandardNC12sV3 VMSizeTypes = "Standard_NC12s_v3"
|
||||
// VMSizeTypesStandardNC24 ...
|
||||
VMSizeTypesStandardNC24 VMSizeTypes = "Standard_NC24"
|
||||
// VMSizeTypesStandardNC24r ...
|
||||
VMSizeTypesStandardNC24r VMSizeTypes = "Standard_NC24r"
|
||||
// VMSizeTypesStandardNC24rsV2 ...
|
||||
VMSizeTypesStandardNC24rsV2 VMSizeTypes = "Standard_NC24rs_v2"
|
||||
// VMSizeTypesStandardNC24rsV3 ...
|
||||
VMSizeTypesStandardNC24rsV3 VMSizeTypes = "Standard_NC24rs_v3"
|
||||
// VMSizeTypesStandardNC24sV2 ...
|
||||
VMSizeTypesStandardNC24sV2 VMSizeTypes = "Standard_NC24s_v2"
|
||||
// VMSizeTypesStandardNC24sV3 ...
|
||||
VMSizeTypesStandardNC24sV3 VMSizeTypes = "Standard_NC24s_v3"
|
||||
// VMSizeTypesStandardNC6 ...
|
||||
VMSizeTypesStandardNC6 VMSizeTypes = "Standard_NC6"
|
||||
// VMSizeTypesStandardNC6sV2 ...
|
||||
VMSizeTypesStandardNC6sV2 VMSizeTypes = "Standard_NC6s_v2"
|
||||
// VMSizeTypesStandardNC6sV3 ...
|
||||
VMSizeTypesStandardNC6sV3 VMSizeTypes = "Standard_NC6s_v3"
|
||||
// VMSizeTypesStandardND12s ...
|
||||
VMSizeTypesStandardND12s VMSizeTypes = "Standard_ND12s"
|
||||
// VMSizeTypesStandardND24rs ...
|
||||
VMSizeTypesStandardND24rs VMSizeTypes = "Standard_ND24rs"
|
||||
// VMSizeTypesStandardND24s ...
|
||||
VMSizeTypesStandardND24s VMSizeTypes = "Standard_ND24s"
|
||||
// VMSizeTypesStandardND6s ...
|
||||
VMSizeTypesStandardND6s VMSizeTypes = "Standard_ND6s"
|
||||
// VMSizeTypesStandardNV12 ...
|
||||
VMSizeTypesStandardNV12 VMSizeTypes = "Standard_NV12"
|
||||
// VMSizeTypesStandardNV24 ...
|
||||
VMSizeTypesStandardNV24 VMSizeTypes = "Standard_NV24"
|
||||
// VMSizeTypesStandardNV6 ...
|
||||
VMSizeTypesStandardNV6 VMSizeTypes = "Standard_NV6"
|
||||
)
|
||||
|
||||
// PossibleVMSizeTypesValues returns an array of possible values for the VMSizeTypes const type.
|
||||
func PossibleVMSizeTypesValues() []VMSizeTypes {
|
||||
return []VMSizeTypes{VMSizeTypesStandardA1, VMSizeTypesStandardA10, VMSizeTypesStandardA11, VMSizeTypesStandardA1V2, VMSizeTypesStandardA2, VMSizeTypesStandardA2mV2, VMSizeTypesStandardA2V2, VMSizeTypesStandardA3, VMSizeTypesStandardA4, VMSizeTypesStandardA4mV2, VMSizeTypesStandardA4V2, VMSizeTypesStandardA5, VMSizeTypesStandardA6, VMSizeTypesStandardA7, VMSizeTypesStandardA8, VMSizeTypesStandardA8mV2, VMSizeTypesStandardA8V2, VMSizeTypesStandardA9, VMSizeTypesStandardB2ms, VMSizeTypesStandardB2s, VMSizeTypesStandardB4ms, VMSizeTypesStandardB8ms, VMSizeTypesStandardD1, VMSizeTypesStandardD11, VMSizeTypesStandardD11V2, VMSizeTypesStandardD11V2Promo, VMSizeTypesStandardD12, VMSizeTypesStandardD12V2, VMSizeTypesStandardD12V2Promo, VMSizeTypesStandardD13, VMSizeTypesStandardD13V2, VMSizeTypesStandardD13V2Promo, VMSizeTypesStandardD14, VMSizeTypesStandardD14V2, VMSizeTypesStandardD14V2Promo, VMSizeTypesStandardD15V2, VMSizeTypesStandardD16sV3, VMSizeTypesStandardD16V3, VMSizeTypesStandardD1V2, VMSizeTypesStandardD2, VMSizeTypesStandardD2sV3, VMSizeTypesStandardD2V2, VMSizeTypesStandardD2V2Promo, VMSizeTypesStandardD2V3, VMSizeTypesStandardD3, VMSizeTypesStandardD32sV3, VMSizeTypesStandardD32V3, VMSizeTypesStandardD3V2, VMSizeTypesStandardD3V2Promo, VMSizeTypesStandardD4, VMSizeTypesStandardD4sV3, VMSizeTypesStandardD4V2, VMSizeTypesStandardD4V2Promo, VMSizeTypesStandardD4V3, VMSizeTypesStandardD5V2, VMSizeTypesStandardD5V2Promo, VMSizeTypesStandardD64sV3, VMSizeTypesStandardD64V3, VMSizeTypesStandardD8sV3, VMSizeTypesStandardD8V3, VMSizeTypesStandardDS1, VMSizeTypesStandardDS11, VMSizeTypesStandardDS11V2, VMSizeTypesStandardDS11V2Promo, VMSizeTypesStandardDS12, VMSizeTypesStandardDS12V2, VMSizeTypesStandardDS12V2Promo, VMSizeTypesStandardDS13, VMSizeTypesStandardDS132V2, VMSizeTypesStandardDS134V2, VMSizeTypesStandardDS13V2, VMSizeTypesStandardDS13V2Promo, VMSizeTypesStandardDS14, VMSizeTypesStandardDS144V2, VMSizeTypesStandardDS148V2, VMSizeTypesStandardDS14V2, VMSizeTypesStandardDS14V2Promo, VMSizeTypesStandardDS15V2, VMSizeTypesStandardDS1V2, VMSizeTypesStandardDS2, VMSizeTypesStandardDS2V2, VMSizeTypesStandardDS2V2Promo, VMSizeTypesStandardDS3, VMSizeTypesStandardDS3V2, VMSizeTypesStandardDS3V2Promo, VMSizeTypesStandardDS4, VMSizeTypesStandardDS4V2, VMSizeTypesStandardDS4V2Promo, VMSizeTypesStandardDS5V2, VMSizeTypesStandardDS5V2Promo, VMSizeTypesStandardE16sV3, VMSizeTypesStandardE16V3, VMSizeTypesStandardE2sV3, VMSizeTypesStandardE2V3, VMSizeTypesStandardE3216sV3, VMSizeTypesStandardE328sV3, VMSizeTypesStandardE32sV3, VMSizeTypesStandardE32V3, VMSizeTypesStandardE4sV3, VMSizeTypesStandardE4V3, VMSizeTypesStandardE6416sV3, VMSizeTypesStandardE6432sV3, VMSizeTypesStandardE64sV3, VMSizeTypesStandardE64V3, VMSizeTypesStandardE8sV3, VMSizeTypesStandardE8V3, VMSizeTypesStandardF1, VMSizeTypesStandardF16, VMSizeTypesStandardF16s, VMSizeTypesStandardF16sV2, VMSizeTypesStandardF1s, VMSizeTypesStandardF2, VMSizeTypesStandardF2s, VMSizeTypesStandardF2sV2, VMSizeTypesStandardF32sV2, VMSizeTypesStandardF4, VMSizeTypesStandardF4s, VMSizeTypesStandardF4sV2, VMSizeTypesStandardF64sV2, VMSizeTypesStandardF72sV2, VMSizeTypesStandardF8, VMSizeTypesStandardF8s, VMSizeTypesStandardF8sV2, VMSizeTypesStandardG1, VMSizeTypesStandardG2, VMSizeTypesStandardG3, VMSizeTypesStandardG4, VMSizeTypesStandardG5, VMSizeTypesStandardGS1, VMSizeTypesStandardGS2, VMSizeTypesStandardGS3, VMSizeTypesStandardGS4, VMSizeTypesStandardGS44, VMSizeTypesStandardGS48, VMSizeTypesStandardGS5, VMSizeTypesStandardGS516, VMSizeTypesStandardGS58, VMSizeTypesStandardH16, VMSizeTypesStandardH16m, VMSizeTypesStandardH16mr, VMSizeTypesStandardH16r, VMSizeTypesStandardH8, VMSizeTypesStandardH8m, VMSizeTypesStandardL16s, VMSizeTypesStandardL32s, VMSizeTypesStandardL4s, VMSizeTypesStandardL8s, VMSizeTypesStandardM12832ms, VMSizeTypesStandardM12864ms, VMSizeTypesStandardM128ms, VMSizeTypesStandardM128s, VMSizeTypesStandardM6416ms, VMSizeTypesStandardM6432ms, VMSizeTypesStandardM64ms, VMSizeTypesStandardM64s, VMSizeTypesStandardNC12, VMSizeTypesStandardNC12sV2, VMSizeTypesStandardNC12sV3, VMSizeTypesStandardNC24, VMSizeTypesStandardNC24r, VMSizeTypesStandardNC24rsV2, VMSizeTypesStandardNC24rsV3, VMSizeTypesStandardNC24sV2, VMSizeTypesStandardNC24sV3, VMSizeTypesStandardNC6, VMSizeTypesStandardNC6sV2, VMSizeTypesStandardNC6sV3, VMSizeTypesStandardND12s, VMSizeTypesStandardND24rs, VMSizeTypesStandardND24s, VMSizeTypesStandardND6s, VMSizeTypesStandardNV12, VMSizeTypesStandardNV24, VMSizeTypesStandardNV6}
|
||||
}
|
||||
|
||||
// WeekDay enumerates the values for week day.
|
||||
type WeekDay string
|
||||
|
||||
const (
|
||||
// WeekDayFriday ...
|
||||
WeekDayFriday WeekDay = "Friday"
|
||||
// WeekDayMonday ...
|
||||
WeekDayMonday WeekDay = "Monday"
|
||||
// WeekDaySaturday ...
|
||||
WeekDaySaturday WeekDay = "Saturday"
|
||||
// WeekDaySunday ...
|
||||
WeekDaySunday WeekDay = "Sunday"
|
||||
// WeekDayThursday ...
|
||||
WeekDayThursday WeekDay = "Thursday"
|
||||
// WeekDayTuesday ...
|
||||
WeekDayTuesday WeekDay = "Tuesday"
|
||||
// WeekDayWednesday ...
|
||||
WeekDayWednesday WeekDay = "Wednesday"
|
||||
)
|
||||
|
||||
// PossibleWeekDayValues returns an array of possible values for the WeekDay const type.
|
||||
func PossibleWeekDayValues() []WeekDay {
|
||||
return []WeekDay{WeekDayFriday, WeekDayMonday, WeekDaySaturday, WeekDaySunday, WeekDayThursday, WeekDayTuesday, WeekDayWednesday}
|
||||
}
|
||||
|
||||
// WorkloadRuntime enumerates the values for workload runtime.
|
||||
type WorkloadRuntime string
|
||||
|
||||
const (
|
||||
// WorkloadRuntimeOCIContainer Nodes will use Kubelet to run standard OCI container workloads.
|
||||
WorkloadRuntimeOCIContainer WorkloadRuntime = "OCIContainer"
|
||||
// WorkloadRuntimeWasmWasi Nodes will use Krustlet to run WASM workloads using the WASI provider (Preview).
|
||||
WorkloadRuntimeWasmWasi WorkloadRuntime = "WasmWasi"
|
||||
)
|
||||
|
||||
// PossibleWorkloadRuntimeValues returns an array of possible values for the WorkloadRuntime const type.
|
||||
func PossibleWorkloadRuntimeValues() []WorkloadRuntime {
|
||||
return []WorkloadRuntime{WorkloadRuntimeOCIContainer, WorkloadRuntimeWasmWasi}
|
||||
}
|
428
vendor/github.com/Azure/azure-sdk-for-go/services/containerservice/mgmt/2021-10-01/containerservice/maintenanceconfigurations.go
сгенерированный
поставляемый
Normal file
428
vendor/github.com/Azure/azure-sdk-for-go/services/containerservice/mgmt/2021-10-01/containerservice/maintenanceconfigurations.go
сгенерированный
поставляемый
Normal file
|
@ -0,0 +1,428 @@
|
|||
package containerservice
|
||||
|
||||
// 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"
|
||||
)
|
||||
|
||||
// MaintenanceConfigurationsClient is the the Container Service Client.
|
||||
type MaintenanceConfigurationsClient struct {
|
||||
BaseClient
|
||||
}
|
||||
|
||||
// NewMaintenanceConfigurationsClient creates an instance of the MaintenanceConfigurationsClient client.
|
||||
func NewMaintenanceConfigurationsClient(subscriptionID string) MaintenanceConfigurationsClient {
|
||||
return NewMaintenanceConfigurationsClientWithBaseURI(DefaultBaseURI, subscriptionID)
|
||||
}
|
||||
|
||||
// NewMaintenanceConfigurationsClientWithBaseURI creates an instance of the MaintenanceConfigurationsClient 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 NewMaintenanceConfigurationsClientWithBaseURI(baseURI string, subscriptionID string) MaintenanceConfigurationsClient {
|
||||
return MaintenanceConfigurationsClient{NewWithBaseURI(baseURI, subscriptionID)}
|
||||
}
|
||||
|
||||
// CreateOrUpdate sends the create or update request.
|
||||
// Parameters:
|
||||
// resourceGroupName - the name of the resource group.
|
||||
// resourceName - the name of the managed cluster resource.
|
||||
// configName - the name of the maintenance configuration.
|
||||
// parameters - the maintenance configuration to create or update.
|
||||
func (client MaintenanceConfigurationsClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, resourceName string, configName string, parameters MaintenanceConfiguration) (result MaintenanceConfiguration, err error) {
|
||||
if tracing.IsEnabled() {
|
||||
ctx = tracing.StartSpan(ctx, fqdn+"/MaintenanceConfigurationsClient.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.MinLength, Rule: 1, Chain: nil}}},
|
||||
{TargetValue: resourceName,
|
||||
Constraints: []validation.Constraint{{Target: "resourceName", Name: validation.MaxLength, Rule: 63, Chain: nil},
|
||||
{Target: "resourceName", Name: validation.MinLength, Rule: 1, Chain: nil},
|
||||
{Target: "resourceName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$`, Chain: nil}}}}); err != nil {
|
||||
return result, validation.NewError("containerservice.MaintenanceConfigurationsClient", "CreateOrUpdate", err.Error())
|
||||
}
|
||||
|
||||
req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, resourceName, configName, parameters)
|
||||
if err != nil {
|
||||
err = autorest.NewErrorWithError(err, "containerservice.MaintenanceConfigurationsClient", "CreateOrUpdate", nil, "Failure preparing request")
|
||||
return
|
||||
}
|
||||
|
||||
resp, err := client.CreateOrUpdateSender(req)
|
||||
if err != nil {
|
||||
result.Response = autorest.Response{Response: resp}
|
||||
err = autorest.NewErrorWithError(err, "containerservice.MaintenanceConfigurationsClient", "CreateOrUpdate", resp, "Failure sending request")
|
||||
return
|
||||
}
|
||||
|
||||
result, err = client.CreateOrUpdateResponder(resp)
|
||||
if err != nil {
|
||||
err = autorest.NewErrorWithError(err, "containerservice.MaintenanceConfigurationsClient", "CreateOrUpdate", resp, "Failure responding to request")
|
||||
return
|
||||
}
|
||||
|
||||
return
|
||||
}
|
||||
|
||||
// CreateOrUpdatePreparer prepares the CreateOrUpdate request.
|
||||
func (client MaintenanceConfigurationsClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, resourceName string, configName string, parameters MaintenanceConfiguration) (*http.Request, error) {
|
||||
pathParameters := map[string]interface{}{
|
||||
"configName": autorest.Encode("path", configName),
|
||||
"resourceGroupName": autorest.Encode("path", resourceGroupName),
|
||||
"resourceName": autorest.Encode("path", resourceName),
|
||||
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
|
||||
}
|
||||
|
||||
const APIVersion = "2021-10-01"
|
||||
queryParameters := map[string]interface{}{
|
||||
"api-version": APIVersion,
|
||||
}
|
||||
|
||||
parameters.SystemData = nil
|
||||
preparer := autorest.CreatePreparer(
|
||||
autorest.AsContentType("application/json; charset=utf-8"),
|
||||
autorest.AsPut(),
|
||||
autorest.WithBaseURL(client.BaseURI),
|
||||
autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/maintenanceConfigurations/{configName}", pathParameters),
|
||||
autorest.WithJSON(parameters),
|
||||
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 MaintenanceConfigurationsClient) 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 MaintenanceConfigurationsClient) CreateOrUpdateResponder(resp *http.Response) (result MaintenanceConfiguration, err error) {
|
||||
err = autorest.Respond(
|
||||
resp,
|
||||
azure.WithErrorUnlessStatusCode(http.StatusOK),
|
||||
autorest.ByUnmarshallingJSON(&result),
|
||||
autorest.ByClosing())
|
||||
result.Response = autorest.Response{Response: resp}
|
||||
return
|
||||
}
|
||||
|
||||
// Delete sends the delete request.
|
||||
// Parameters:
|
||||
// resourceGroupName - the name of the resource group.
|
||||
// resourceName - the name of the managed cluster resource.
|
||||
// configName - the name of the maintenance configuration.
|
||||
func (client MaintenanceConfigurationsClient) Delete(ctx context.Context, resourceGroupName string, resourceName string, configName string) (result autorest.Response, err error) {
|
||||
if tracing.IsEnabled() {
|
||||
ctx = tracing.StartSpan(ctx, fqdn+"/MaintenanceConfigurationsClient.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.MinLength, Rule: 1, Chain: nil}}},
|
||||
{TargetValue: resourceName,
|
||||
Constraints: []validation.Constraint{{Target: "resourceName", Name: validation.MaxLength, Rule: 63, Chain: nil},
|
||||
{Target: "resourceName", Name: validation.MinLength, Rule: 1, Chain: nil},
|
||||
{Target: "resourceName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$`, Chain: nil}}}}); err != nil {
|
||||
return result, validation.NewError("containerservice.MaintenanceConfigurationsClient", "Delete", err.Error())
|
||||
}
|
||||
|
||||
req, err := client.DeletePreparer(ctx, resourceGroupName, resourceName, configName)
|
||||
if err != nil {
|
||||
err = autorest.NewErrorWithError(err, "containerservice.MaintenanceConfigurationsClient", "Delete", nil, "Failure preparing request")
|
||||
return
|
||||
}
|
||||
|
||||
resp, err := client.DeleteSender(req)
|
||||
if err != nil {
|
||||
result.Response = resp
|
||||
err = autorest.NewErrorWithError(err, "containerservice.MaintenanceConfigurationsClient", "Delete", resp, "Failure sending request")
|
||||
return
|
||||
}
|
||||
|
||||
result, err = client.DeleteResponder(resp)
|
||||
if err != nil {
|
||||
err = autorest.NewErrorWithError(err, "containerservice.MaintenanceConfigurationsClient", "Delete", resp, "Failure responding to request")
|
||||
return
|
||||
}
|
||||
|
||||
return
|
||||
}
|
||||
|
||||
// DeletePreparer prepares the Delete request.
|
||||
func (client MaintenanceConfigurationsClient) DeletePreparer(ctx context.Context, resourceGroupName string, resourceName string, configName string) (*http.Request, error) {
|
||||
pathParameters := map[string]interface{}{
|
||||
"configName": autorest.Encode("path", configName),
|
||||
"resourceGroupName": autorest.Encode("path", resourceGroupName),
|
||||
"resourceName": autorest.Encode("path", resourceName),
|
||||
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
|
||||
}
|
||||
|
||||
const APIVersion = "2021-10-01"
|
||||
queryParameters := map[string]interface{}{
|
||||
"api-version": APIVersion,
|
||||
}
|
||||
|
||||
preparer := autorest.CreatePreparer(
|
||||
autorest.AsDelete(),
|
||||
autorest.WithBaseURL(client.BaseURI),
|
||||
autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/maintenanceConfigurations/{configName}", 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 MaintenanceConfigurationsClient) 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 MaintenanceConfigurationsClient) 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 sends the get request.
|
||||
// Parameters:
|
||||
// resourceGroupName - the name of the resource group.
|
||||
// resourceName - the name of the managed cluster resource.
|
||||
// configName - the name of the maintenance configuration.
|
||||
func (client MaintenanceConfigurationsClient) Get(ctx context.Context, resourceGroupName string, resourceName string, configName string) (result MaintenanceConfiguration, err error) {
|
||||
if tracing.IsEnabled() {
|
||||
ctx = tracing.StartSpan(ctx, fqdn+"/MaintenanceConfigurationsClient.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.MinLength, Rule: 1, Chain: nil}}},
|
||||
{TargetValue: resourceName,
|
||||
Constraints: []validation.Constraint{{Target: "resourceName", Name: validation.MaxLength, Rule: 63, Chain: nil},
|
||||
{Target: "resourceName", Name: validation.MinLength, Rule: 1, Chain: nil},
|
||||
{Target: "resourceName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$`, Chain: nil}}}}); err != nil {
|
||||
return result, validation.NewError("containerservice.MaintenanceConfigurationsClient", "Get", err.Error())
|
||||
}
|
||||
|
||||
req, err := client.GetPreparer(ctx, resourceGroupName, resourceName, configName)
|
||||
if err != nil {
|
||||
err = autorest.NewErrorWithError(err, "containerservice.MaintenanceConfigurationsClient", "Get", nil, "Failure preparing request")
|
||||
return
|
||||
}
|
||||
|
||||
resp, err := client.GetSender(req)
|
||||
if err != nil {
|
||||
result.Response = autorest.Response{Response: resp}
|
||||
err = autorest.NewErrorWithError(err, "containerservice.MaintenanceConfigurationsClient", "Get", resp, "Failure sending request")
|
||||
return
|
||||
}
|
||||
|
||||
result, err = client.GetResponder(resp)
|
||||
if err != nil {
|
||||
err = autorest.NewErrorWithError(err, "containerservice.MaintenanceConfigurationsClient", "Get", resp, "Failure responding to request")
|
||||
return
|
||||
}
|
||||
|
||||
return
|
||||
}
|
||||
|
||||
// GetPreparer prepares the Get request.
|
||||
func (client MaintenanceConfigurationsClient) GetPreparer(ctx context.Context, resourceGroupName string, resourceName string, configName string) (*http.Request, error) {
|
||||
pathParameters := map[string]interface{}{
|
||||
"configName": autorest.Encode("path", configName),
|
||||
"resourceGroupName": autorest.Encode("path", resourceGroupName),
|
||||
"resourceName": autorest.Encode("path", resourceName),
|
||||
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
|
||||
}
|
||||
|
||||
const APIVersion = "2021-10-01"
|
||||
queryParameters := map[string]interface{}{
|
||||
"api-version": APIVersion,
|
||||
}
|
||||
|
||||
preparer := autorest.CreatePreparer(
|
||||
autorest.AsGet(),
|
||||
autorest.WithBaseURL(client.BaseURI),
|
||||
autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/maintenanceConfigurations/{configName}", 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 MaintenanceConfigurationsClient) 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 MaintenanceConfigurationsClient) GetResponder(resp *http.Response) (result MaintenanceConfiguration, err error) {
|
||||
err = autorest.Respond(
|
||||
resp,
|
||||
azure.WithErrorUnlessStatusCode(http.StatusOK),
|
||||
autorest.ByUnmarshallingJSON(&result),
|
||||
autorest.ByClosing())
|
||||
result.Response = autorest.Response{Response: resp}
|
||||
return
|
||||
}
|
||||
|
||||
// ListByManagedCluster sends the list by managed cluster request.
|
||||
// Parameters:
|
||||
// resourceGroupName - the name of the resource group.
|
||||
// resourceName - the name of the managed cluster resource.
|
||||
func (client MaintenanceConfigurationsClient) ListByManagedCluster(ctx context.Context, resourceGroupName string, resourceName string) (result MaintenanceConfigurationListResultPage, err error) {
|
||||
if tracing.IsEnabled() {
|
||||
ctx = tracing.StartSpan(ctx, fqdn+"/MaintenanceConfigurationsClient.ListByManagedCluster")
|
||||
defer func() {
|
||||
sc := -1
|
||||
if result.mclr.Response.Response != nil {
|
||||
sc = result.mclr.Response.Response.StatusCode
|
||||
}
|
||||
tracing.EndSpan(ctx, sc, err)
|
||||
}()
|
||||
}
|
||||
if err := validation.Validate([]validation.Validation{
|
||||
{TargetValue: resourceGroupName,
|
||||
Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}},
|
||||
{TargetValue: resourceName,
|
||||
Constraints: []validation.Constraint{{Target: "resourceName", Name: validation.MaxLength, Rule: 63, Chain: nil},
|
||||
{Target: "resourceName", Name: validation.MinLength, Rule: 1, Chain: nil},
|
||||
{Target: "resourceName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$`, Chain: nil}}}}); err != nil {
|
||||
return result, validation.NewError("containerservice.MaintenanceConfigurationsClient", "ListByManagedCluster", err.Error())
|
||||
}
|
||||
|
||||
result.fn = client.listByManagedClusterNextResults
|
||||
req, err := client.ListByManagedClusterPreparer(ctx, resourceGroupName, resourceName)
|
||||
if err != nil {
|
||||
err = autorest.NewErrorWithError(err, "containerservice.MaintenanceConfigurationsClient", "ListByManagedCluster", nil, "Failure preparing request")
|
||||
return
|
||||
}
|
||||
|
||||
resp, err := client.ListByManagedClusterSender(req)
|
||||
if err != nil {
|
||||
result.mclr.Response = autorest.Response{Response: resp}
|
||||
err = autorest.NewErrorWithError(err, "containerservice.MaintenanceConfigurationsClient", "ListByManagedCluster", resp, "Failure sending request")
|
||||
return
|
||||
}
|
||||
|
||||
result.mclr, err = client.ListByManagedClusterResponder(resp)
|
||||
if err != nil {
|
||||
err = autorest.NewErrorWithError(err, "containerservice.MaintenanceConfigurationsClient", "ListByManagedCluster", resp, "Failure responding to request")
|
||||
return
|
||||
}
|
||||
if result.mclr.hasNextLink() && result.mclr.IsEmpty() {
|
||||
err = result.NextWithContext(ctx)
|
||||
return
|
||||
}
|
||||
|
||||
return
|
||||
}
|
||||
|
||||
// ListByManagedClusterPreparer prepares the ListByManagedCluster request.
|
||||
func (client MaintenanceConfigurationsClient) ListByManagedClusterPreparer(ctx context.Context, resourceGroupName string, resourceName string) (*http.Request, error) {
|
||||
pathParameters := map[string]interface{}{
|
||||
"resourceGroupName": autorest.Encode("path", resourceGroupName),
|
||||
"resourceName": autorest.Encode("path", resourceName),
|
||||
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
|
||||
}
|
||||
|
||||
const APIVersion = "2021-10-01"
|
||||
queryParameters := map[string]interface{}{
|
||||
"api-version": APIVersion,
|
||||
}
|
||||
|
||||
preparer := autorest.CreatePreparer(
|
||||
autorest.AsGet(),
|
||||
autorest.WithBaseURL(client.BaseURI),
|
||||
autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/maintenanceConfigurations", pathParameters),
|
||||
autorest.WithQueryParameters(queryParameters))
|
||||
return preparer.Prepare((&http.Request{}).WithContext(ctx))
|
||||
}
|
||||
|
||||
// ListByManagedClusterSender sends the ListByManagedCluster request. The method will close the
|
||||
// http.Response Body if it receives an error.
|
||||
func (client MaintenanceConfigurationsClient) ListByManagedClusterSender(req *http.Request) (*http.Response, error) {
|
||||
return client.Send(req, azure.DoRetryWithRegistration(client.Client))
|
||||
}
|
||||
|
||||
// ListByManagedClusterResponder handles the response to the ListByManagedCluster request. The method always
|
||||
// closes the http.Response Body.
|
||||
func (client MaintenanceConfigurationsClient) ListByManagedClusterResponder(resp *http.Response) (result MaintenanceConfigurationListResult, err error) {
|
||||
err = autorest.Respond(
|
||||
resp,
|
||||
azure.WithErrorUnlessStatusCode(http.StatusOK),
|
||||
autorest.ByUnmarshallingJSON(&result),
|
||||
autorest.ByClosing())
|
||||
result.Response = autorest.Response{Response: resp}
|
||||
return
|
||||
}
|
||||
|
||||
// listByManagedClusterNextResults retrieves the next set of results, if any.
|
||||
func (client MaintenanceConfigurationsClient) listByManagedClusterNextResults(ctx context.Context, lastResults MaintenanceConfigurationListResult) (result MaintenanceConfigurationListResult, err error) {
|
||||
req, err := lastResults.maintenanceConfigurationListResultPreparer(ctx)
|
||||
if err != nil {
|
||||
return result, autorest.NewErrorWithError(err, "containerservice.MaintenanceConfigurationsClient", "listByManagedClusterNextResults", nil, "Failure preparing next results request")
|
||||
}
|
||||
if req == nil {
|
||||
return
|
||||
}
|
||||
resp, err := client.ListByManagedClusterSender(req)
|
||||
if err != nil {
|
||||
result.Response = autorest.Response{Response: resp}
|
||||
return result, autorest.NewErrorWithError(err, "containerservice.MaintenanceConfigurationsClient", "listByManagedClusterNextResults", resp, "Failure sending next results request")
|
||||
}
|
||||
result, err = client.ListByManagedClusterResponder(resp)
|
||||
if err != nil {
|
||||
err = autorest.NewErrorWithError(err, "containerservice.MaintenanceConfigurationsClient", "listByManagedClusterNextResults", resp, "Failure responding to next results request")
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
// ListByManagedClusterComplete enumerates all values, automatically crossing page boundaries as required.
|
||||
func (client MaintenanceConfigurationsClient) ListByManagedClusterComplete(ctx context.Context, resourceGroupName string, resourceName string) (result MaintenanceConfigurationListResultIterator, err error) {
|
||||
if tracing.IsEnabled() {
|
||||
ctx = tracing.StartSpan(ctx, fqdn+"/MaintenanceConfigurationsClient.ListByManagedCluster")
|
||||
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.ListByManagedCluster(ctx, resourceGroupName, resourceName)
|
||||
return
|
||||
}
|
1969
vendor/github.com/Azure/azure-sdk-for-go/services/containerservice/mgmt/2021-10-01/containerservice/managedclusters.go
сгенерированный
поставляемый
Normal file
1969
vendor/github.com/Azure/azure-sdk-for-go/services/containerservice/mgmt/2021-10-01/containerservice/managedclusters.go
сгенерированный
поставляемый
Normal file
Разница между файлами не показана из-за своего большого размера
Загрузить разницу
3983
vendor/github.com/Azure/azure-sdk-for-go/services/containerservice/mgmt/2021-10-01/containerservice/models.go
сгенерированный
поставляемый
Normal file
3983
vendor/github.com/Azure/azure-sdk-for-go/services/containerservice/mgmt/2021-10-01/containerservice/models.go
сгенерированный
поставляемый
Normal file
Разница между файлами не показана из-за своего большого размера
Загрузить разницу
98
vendor/github.com/Azure/azure-sdk-for-go/services/containerservice/mgmt/2021-10-01/containerservice/operations.go
сгенерированный
поставляемый
Normal file
98
vendor/github.com/Azure/azure-sdk-for-go/services/containerservice/mgmt/2021-10-01/containerservice/operations.go
сгенерированный
поставляемый
Normal file
|
@ -0,0 +1,98 @@
|
|||
package containerservice
|
||||
|
||||
// Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
// Licensed under the MIT License. See License.txt in the project root for license information.
|
||||
//
|
||||
// Code generated by Microsoft (R) AutoRest Code Generator.
|
||||
// Changes may cause incorrect behavior and will be lost if the code is regenerated.
|
||||
|
||||
import (
|
||||
"context"
|
||||
"github.com/Azure/go-autorest/autorest"
|
||||
"github.com/Azure/go-autorest/autorest/azure"
|
||||
"github.com/Azure/go-autorest/tracing"
|
||||
"net/http"
|
||||
)
|
||||
|
||||
// OperationsClient is the the Container Service Client.
|
||||
type OperationsClient struct {
|
||||
BaseClient
|
||||
}
|
||||
|
||||
// NewOperationsClient creates an instance of the OperationsClient client.
|
||||
func NewOperationsClient(subscriptionID string) OperationsClient {
|
||||
return NewOperationsClientWithBaseURI(DefaultBaseURI, subscriptionID)
|
||||
}
|
||||
|
||||
// NewOperationsClientWithBaseURI creates an instance of the OperationsClient client using a custom endpoint. Use this
|
||||
// when interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure stack).
|
||||
func NewOperationsClientWithBaseURI(baseURI string, subscriptionID string) OperationsClient {
|
||||
return OperationsClient{NewWithBaseURI(baseURI, subscriptionID)}
|
||||
}
|
||||
|
||||
// List sends the list request.
|
||||
func (client OperationsClient) List(ctx context.Context) (result OperationListResult, err error) {
|
||||
if tracing.IsEnabled() {
|
||||
ctx = tracing.StartSpan(ctx, fqdn+"/OperationsClient.List")
|
||||
defer func() {
|
||||
sc := -1
|
||||
if result.Response.Response != nil {
|
||||
sc = result.Response.Response.StatusCode
|
||||
}
|
||||
tracing.EndSpan(ctx, sc, err)
|
||||
}()
|
||||
}
|
||||
req, err := client.ListPreparer(ctx)
|
||||
if err != nil {
|
||||
err = autorest.NewErrorWithError(err, "containerservice.OperationsClient", "List", nil, "Failure preparing request")
|
||||
return
|
||||
}
|
||||
|
||||
resp, err := client.ListSender(req)
|
||||
if err != nil {
|
||||
result.Response = autorest.Response{Response: resp}
|
||||
err = autorest.NewErrorWithError(err, "containerservice.OperationsClient", "List", resp, "Failure sending request")
|
||||
return
|
||||
}
|
||||
|
||||
result, err = client.ListResponder(resp)
|
||||
if err != nil {
|
||||
err = autorest.NewErrorWithError(err, "containerservice.OperationsClient", "List", resp, "Failure responding to request")
|
||||
return
|
||||
}
|
||||
|
||||
return
|
||||
}
|
||||
|
||||
// ListPreparer prepares the List request.
|
||||
func (client OperationsClient) ListPreparer(ctx context.Context) (*http.Request, error) {
|
||||
const APIVersion = "2021-10-01"
|
||||
queryParameters := map[string]interface{}{
|
||||
"api-version": APIVersion,
|
||||
}
|
||||
|
||||
preparer := autorest.CreatePreparer(
|
||||
autorest.AsGet(),
|
||||
autorest.WithBaseURL(client.BaseURI),
|
||||
autorest.WithPath("/providers/Microsoft.ContainerService/operations"),
|
||||
autorest.WithQueryParameters(queryParameters))
|
||||
return preparer.Prepare((&http.Request{}).WithContext(ctx))
|
||||
}
|
||||
|
||||
// ListSender sends the List request. The method will close the
|
||||
// http.Response Body if it receives an error.
|
||||
func (client OperationsClient) ListSender(req *http.Request) (*http.Response, error) {
|
||||
return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
|
||||
}
|
||||
|
||||
// ListResponder handles the response to the List request. The method always
|
||||
// closes the http.Response Body.
|
||||
func (client OperationsClient) ListResponder(resp *http.Response) (result OperationListResult, err error) {
|
||||
err = autorest.Respond(
|
||||
resp,
|
||||
azure.WithErrorUnlessStatusCode(http.StatusOK),
|
||||
autorest.ByUnmarshallingJSON(&result),
|
||||
autorest.ByClosing())
|
||||
result.Response = autorest.Response{Response: resp}
|
||||
return
|
||||
}
|
394
vendor/github.com/Azure/azure-sdk-for-go/services/containerservice/mgmt/2021-10-01/containerservice/privateendpointconnections.go
сгенерированный
поставляемый
Normal file
394
vendor/github.com/Azure/azure-sdk-for-go/services/containerservice/mgmt/2021-10-01/containerservice/privateendpointconnections.go
сгенерированный
поставляемый
Normal file
|
@ -0,0 +1,394 @@
|
|||
package containerservice
|
||||
|
||||
// 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"
|
||||
)
|
||||
|
||||
// PrivateEndpointConnectionsClient is the the Container Service Client.
|
||||
type PrivateEndpointConnectionsClient struct {
|
||||
BaseClient
|
||||
}
|
||||
|
||||
// NewPrivateEndpointConnectionsClient creates an instance of the PrivateEndpointConnectionsClient client.
|
||||
func NewPrivateEndpointConnectionsClient(subscriptionID string) PrivateEndpointConnectionsClient {
|
||||
return NewPrivateEndpointConnectionsClientWithBaseURI(DefaultBaseURI, subscriptionID)
|
||||
}
|
||||
|
||||
// NewPrivateEndpointConnectionsClientWithBaseURI creates an instance of the PrivateEndpointConnectionsClient 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 NewPrivateEndpointConnectionsClientWithBaseURI(baseURI string, subscriptionID string) PrivateEndpointConnectionsClient {
|
||||
return PrivateEndpointConnectionsClient{NewWithBaseURI(baseURI, subscriptionID)}
|
||||
}
|
||||
|
||||
// Delete sends the delete request.
|
||||
// Parameters:
|
||||
// resourceGroupName - the name of the resource group.
|
||||
// resourceName - the name of the managed cluster resource.
|
||||
// privateEndpointConnectionName - the name of the private endpoint connection.
|
||||
func (client PrivateEndpointConnectionsClient) Delete(ctx context.Context, resourceGroupName string, resourceName string, privateEndpointConnectionName string) (result PrivateEndpointConnectionsDeleteFuture, err error) {
|
||||
if tracing.IsEnabled() {
|
||||
ctx = tracing.StartSpan(ctx, fqdn+"/PrivateEndpointConnectionsClient.Delete")
|
||||
defer func() {
|
||||
sc := -1
|
||||
if result.FutureAPI != nil && result.FutureAPI.Response() != nil {
|
||||
sc = result.FutureAPI.Response().StatusCode
|
||||
}
|
||||
tracing.EndSpan(ctx, sc, err)
|
||||
}()
|
||||
}
|
||||
if err := validation.Validate([]validation.Validation{
|
||||
{TargetValue: resourceGroupName,
|
||||
Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}},
|
||||
{TargetValue: resourceName,
|
||||
Constraints: []validation.Constraint{{Target: "resourceName", Name: validation.MaxLength, Rule: 63, Chain: nil},
|
||||
{Target: "resourceName", Name: validation.MinLength, Rule: 1, Chain: nil},
|
||||
{Target: "resourceName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$`, Chain: nil}}}}); err != nil {
|
||||
return result, validation.NewError("containerservice.PrivateEndpointConnectionsClient", "Delete", err.Error())
|
||||
}
|
||||
|
||||
req, err := client.DeletePreparer(ctx, resourceGroupName, resourceName, privateEndpointConnectionName)
|
||||
if err != nil {
|
||||
err = autorest.NewErrorWithError(err, "containerservice.PrivateEndpointConnectionsClient", "Delete", nil, "Failure preparing request")
|
||||
return
|
||||
}
|
||||
|
||||
result, err = client.DeleteSender(req)
|
||||
if err != nil {
|
||||
err = autorest.NewErrorWithError(err, "containerservice.PrivateEndpointConnectionsClient", "Delete", result.Response(), "Failure sending request")
|
||||
return
|
||||
}
|
||||
|
||||
return
|
||||
}
|
||||
|
||||
// DeletePreparer prepares the Delete request.
|
||||
func (client PrivateEndpointConnectionsClient) DeletePreparer(ctx context.Context, resourceGroupName string, resourceName string, privateEndpointConnectionName string) (*http.Request, error) {
|
||||
pathParameters := map[string]interface{}{
|
||||
"privateEndpointConnectionName": autorest.Encode("path", privateEndpointConnectionName),
|
||||
"resourceGroupName": autorest.Encode("path", resourceGroupName),
|
||||
"resourceName": autorest.Encode("path", resourceName),
|
||||
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
|
||||
}
|
||||
|
||||
const APIVersion = "2021-10-01"
|
||||
queryParameters := map[string]interface{}{
|
||||
"api-version": APIVersion,
|
||||
}
|
||||
|
||||
preparer := autorest.CreatePreparer(
|
||||
autorest.AsDelete(),
|
||||
autorest.WithBaseURL(client.BaseURI),
|
||||
autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/privateEndpointConnections/{privateEndpointConnectionName}", 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 PrivateEndpointConnectionsClient) DeleteSender(req *http.Request) (future PrivateEndpointConnectionsDeleteFuture, err error) {
|
||||
var resp *http.Response
|
||||
future.FutureAPI = &azure.Future{}
|
||||
resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client))
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
var azf azure.Future
|
||||
azf, err = azure.NewFutureFromResponse(resp)
|
||||
future.FutureAPI = &azf
|
||||
future.Result = future.result
|
||||
return
|
||||
}
|
||||
|
||||
// DeleteResponder handles the response to the Delete request. The method always
|
||||
// closes the http.Response Body.
|
||||
func (client PrivateEndpointConnectionsClient) 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 to learn more about private clusters, see: https://docs.microsoft.com/azure/aks/private-clusters
|
||||
// Parameters:
|
||||
// resourceGroupName - the name of the resource group.
|
||||
// resourceName - the name of the managed cluster resource.
|
||||
// privateEndpointConnectionName - the name of the private endpoint connection.
|
||||
func (client PrivateEndpointConnectionsClient) Get(ctx context.Context, resourceGroupName string, resourceName string, privateEndpointConnectionName string) (result PrivateEndpointConnection, err error) {
|
||||
if tracing.IsEnabled() {
|
||||
ctx = tracing.StartSpan(ctx, fqdn+"/PrivateEndpointConnectionsClient.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.MinLength, Rule: 1, Chain: nil}}},
|
||||
{TargetValue: resourceName,
|
||||
Constraints: []validation.Constraint{{Target: "resourceName", Name: validation.MaxLength, Rule: 63, Chain: nil},
|
||||
{Target: "resourceName", Name: validation.MinLength, Rule: 1, Chain: nil},
|
||||
{Target: "resourceName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$`, Chain: nil}}}}); err != nil {
|
||||
return result, validation.NewError("containerservice.PrivateEndpointConnectionsClient", "Get", err.Error())
|
||||
}
|
||||
|
||||
req, err := client.GetPreparer(ctx, resourceGroupName, resourceName, privateEndpointConnectionName)
|
||||
if err != nil {
|
||||
err = autorest.NewErrorWithError(err, "containerservice.PrivateEndpointConnectionsClient", "Get", nil, "Failure preparing request")
|
||||
return
|
||||
}
|
||||
|
||||
resp, err := client.GetSender(req)
|
||||
if err != nil {
|
||||
result.Response = autorest.Response{Response: resp}
|
||||
err = autorest.NewErrorWithError(err, "containerservice.PrivateEndpointConnectionsClient", "Get", resp, "Failure sending request")
|
||||
return
|
||||
}
|
||||
|
||||
result, err = client.GetResponder(resp)
|
||||
if err != nil {
|
||||
err = autorest.NewErrorWithError(err, "containerservice.PrivateEndpointConnectionsClient", "Get", resp, "Failure responding to request")
|
||||
return
|
||||
}
|
||||
|
||||
return
|
||||
}
|
||||
|
||||
// GetPreparer prepares the Get request.
|
||||
func (client PrivateEndpointConnectionsClient) GetPreparer(ctx context.Context, resourceGroupName string, resourceName string, privateEndpointConnectionName string) (*http.Request, error) {
|
||||
pathParameters := map[string]interface{}{
|
||||
"privateEndpointConnectionName": autorest.Encode("path", privateEndpointConnectionName),
|
||||
"resourceGroupName": autorest.Encode("path", resourceGroupName),
|
||||
"resourceName": autorest.Encode("path", resourceName),
|
||||
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
|
||||
}
|
||||
|
||||
const APIVersion = "2021-10-01"
|
||||
queryParameters := map[string]interface{}{
|
||||
"api-version": APIVersion,
|
||||
}
|
||||
|
||||
preparer := autorest.CreatePreparer(
|
||||
autorest.AsGet(),
|
||||
autorest.WithBaseURL(client.BaseURI),
|
||||
autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/privateEndpointConnections/{privateEndpointConnectionName}", 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 PrivateEndpointConnectionsClient) 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 PrivateEndpointConnectionsClient) GetResponder(resp *http.Response) (result PrivateEndpointConnection, err error) {
|
||||
err = autorest.Respond(
|
||||
resp,
|
||||
azure.WithErrorUnlessStatusCode(http.StatusOK),
|
||||
autorest.ByUnmarshallingJSON(&result),
|
||||
autorest.ByClosing())
|
||||
result.Response = autorest.Response{Response: resp}
|
||||
return
|
||||
}
|
||||
|
||||
// List to learn more about private clusters, see: https://docs.microsoft.com/azure/aks/private-clusters
|
||||
// Parameters:
|
||||
// resourceGroupName - the name of the resource group.
|
||||
// resourceName - the name of the managed cluster resource.
|
||||
func (client PrivateEndpointConnectionsClient) List(ctx context.Context, resourceGroupName string, resourceName string) (result PrivateEndpointConnectionListResult, err error) {
|
||||
if tracing.IsEnabled() {
|
||||
ctx = tracing.StartSpan(ctx, fqdn+"/PrivateEndpointConnectionsClient.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.MinLength, Rule: 1, Chain: nil}}},
|
||||
{TargetValue: resourceName,
|
||||
Constraints: []validation.Constraint{{Target: "resourceName", Name: validation.MaxLength, Rule: 63, Chain: nil},
|
||||
{Target: "resourceName", Name: validation.MinLength, Rule: 1, Chain: nil},
|
||||
{Target: "resourceName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$`, Chain: nil}}}}); err != nil {
|
||||
return result, validation.NewError("containerservice.PrivateEndpointConnectionsClient", "List", err.Error())
|
||||
}
|
||||
|
||||
req, err := client.ListPreparer(ctx, resourceGroupName, resourceName)
|
||||
if err != nil {
|
||||
err = autorest.NewErrorWithError(err, "containerservice.PrivateEndpointConnectionsClient", "List", nil, "Failure preparing request")
|
||||
return
|
||||
}
|
||||
|
||||
resp, err := client.ListSender(req)
|
||||
if err != nil {
|
||||
result.Response = autorest.Response{Response: resp}
|
||||
err = autorest.NewErrorWithError(err, "containerservice.PrivateEndpointConnectionsClient", "List", resp, "Failure sending request")
|
||||
return
|
||||
}
|
||||
|
||||
result, err = client.ListResponder(resp)
|
||||
if err != nil {
|
||||
err = autorest.NewErrorWithError(err, "containerservice.PrivateEndpointConnectionsClient", "List", resp, "Failure responding to request")
|
||||
return
|
||||
}
|
||||
|
||||
return
|
||||
}
|
||||
|
||||
// ListPreparer prepares the List request.
|
||||
func (client PrivateEndpointConnectionsClient) ListPreparer(ctx context.Context, resourceGroupName string, resourceName string) (*http.Request, error) {
|
||||
pathParameters := map[string]interface{}{
|
||||
"resourceGroupName": autorest.Encode("path", resourceGroupName),
|
||||
"resourceName": autorest.Encode("path", resourceName),
|
||||
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
|
||||
}
|
||||
|
||||
const APIVersion = "2021-10-01"
|
||||
queryParameters := map[string]interface{}{
|
||||
"api-version": APIVersion,
|
||||
}
|
||||
|
||||
preparer := autorest.CreatePreparer(
|
||||
autorest.AsGet(),
|
||||
autorest.WithBaseURL(client.BaseURI),
|
||||
autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/privateEndpointConnections", 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 PrivateEndpointConnectionsClient) 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 PrivateEndpointConnectionsClient) ListResponder(resp *http.Response) (result PrivateEndpointConnectionListResult, err error) {
|
||||
err = autorest.Respond(
|
||||
resp,
|
||||
azure.WithErrorUnlessStatusCode(http.StatusOK),
|
||||
autorest.ByUnmarshallingJSON(&result),
|
||||
autorest.ByClosing())
|
||||
result.Response = autorest.Response{Response: resp}
|
||||
return
|
||||
}
|
||||
|
||||
// Update sends the update request.
|
||||
// Parameters:
|
||||
// resourceGroupName - the name of the resource group.
|
||||
// resourceName - the name of the managed cluster resource.
|
||||
// privateEndpointConnectionName - the name of the private endpoint connection.
|
||||
// parameters - the updated private endpoint connection.
|
||||
func (client PrivateEndpointConnectionsClient) Update(ctx context.Context, resourceGroupName string, resourceName string, privateEndpointConnectionName string, parameters PrivateEndpointConnection) (result PrivateEndpointConnection, err error) {
|
||||
if tracing.IsEnabled() {
|
||||
ctx = tracing.StartSpan(ctx, fqdn+"/PrivateEndpointConnectionsClient.Update")
|
||||
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.MinLength, Rule: 1, Chain: nil}}},
|
||||
{TargetValue: resourceName,
|
||||
Constraints: []validation.Constraint{{Target: "resourceName", Name: validation.MaxLength, Rule: 63, Chain: nil},
|
||||
{Target: "resourceName", Name: validation.MinLength, Rule: 1, Chain: nil},
|
||||
{Target: "resourceName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$`, Chain: nil}}},
|
||||
{TargetValue: parameters,
|
||||
Constraints: []validation.Constraint{{Target: "parameters.PrivateEndpointConnectionProperties", Name: validation.Null, Rule: false,
|
||||
Chain: []validation.Constraint{{Target: "parameters.PrivateEndpointConnectionProperties.PrivateLinkServiceConnectionState", Name: validation.Null, Rule: true, Chain: nil}}}}}}); err != nil {
|
||||
return result, validation.NewError("containerservice.PrivateEndpointConnectionsClient", "Update", err.Error())
|
||||
}
|
||||
|
||||
req, err := client.UpdatePreparer(ctx, resourceGroupName, resourceName, privateEndpointConnectionName, parameters)
|
||||
if err != nil {
|
||||
err = autorest.NewErrorWithError(err, "containerservice.PrivateEndpointConnectionsClient", "Update", nil, "Failure preparing request")
|
||||
return
|
||||
}
|
||||
|
||||
resp, err := client.UpdateSender(req)
|
||||
if err != nil {
|
||||
result.Response = autorest.Response{Response: resp}
|
||||
err = autorest.NewErrorWithError(err, "containerservice.PrivateEndpointConnectionsClient", "Update", resp, "Failure sending request")
|
||||
return
|
||||
}
|
||||
|
||||
result, err = client.UpdateResponder(resp)
|
||||
if err != nil {
|
||||
err = autorest.NewErrorWithError(err, "containerservice.PrivateEndpointConnectionsClient", "Update", resp, "Failure responding to request")
|
||||
return
|
||||
}
|
||||
|
||||
return
|
||||
}
|
||||
|
||||
// UpdatePreparer prepares the Update request.
|
||||
func (client PrivateEndpointConnectionsClient) UpdatePreparer(ctx context.Context, resourceGroupName string, resourceName string, privateEndpointConnectionName string, parameters PrivateEndpointConnection) (*http.Request, error) {
|
||||
pathParameters := map[string]interface{}{
|
||||
"privateEndpointConnectionName": autorest.Encode("path", privateEndpointConnectionName),
|
||||
"resourceGroupName": autorest.Encode("path", resourceGroupName),
|
||||
"resourceName": autorest.Encode("path", resourceName),
|
||||
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
|
||||
}
|
||||
|
||||
const APIVersion = "2021-10-01"
|
||||
queryParameters := map[string]interface{}{
|
||||
"api-version": APIVersion,
|
||||
}
|
||||
|
||||
parameters.ID = nil
|
||||
parameters.Name = nil
|
||||
parameters.Type = nil
|
||||
preparer := autorest.CreatePreparer(
|
||||
autorest.AsContentType("application/json; charset=utf-8"),
|
||||
autorest.AsPut(),
|
||||
autorest.WithBaseURL(client.BaseURI),
|
||||
autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/privateEndpointConnections/{privateEndpointConnectionName}", pathParameters),
|
||||
autorest.WithJSON(parameters),
|
||||
autorest.WithQueryParameters(queryParameters))
|
||||
return preparer.Prepare((&http.Request{}).WithContext(ctx))
|
||||
}
|
||||
|
||||
// UpdateSender sends the Update request. The method will close the
|
||||
// http.Response Body if it receives an error.
|
||||
func (client PrivateEndpointConnectionsClient) UpdateSender(req *http.Request) (*http.Response, error) {
|
||||
return client.Send(req, azure.DoRetryWithRegistration(client.Client))
|
||||
}
|
||||
|
||||
// UpdateResponder handles the response to the Update request. The method always
|
||||
// closes the http.Response Body.
|
||||
func (client PrivateEndpointConnectionsClient) UpdateResponder(resp *http.Response) (result PrivateEndpointConnection, err error) {
|
||||
err = autorest.Respond(
|
||||
resp,
|
||||
azure.WithErrorUnlessStatusCode(http.StatusOK),
|
||||
autorest.ByUnmarshallingJSON(&result),
|
||||
autorest.ByClosing())
|
||||
result.Response = autorest.Response{Response: resp}
|
||||
return
|
||||
}
|
119
vendor/github.com/Azure/azure-sdk-for-go/services/containerservice/mgmt/2021-10-01/containerservice/privatelinkresources.go
сгенерированный
поставляемый
Normal file
119
vendor/github.com/Azure/azure-sdk-for-go/services/containerservice/mgmt/2021-10-01/containerservice/privatelinkresources.go
сгенерированный
поставляемый
Normal file
|
@ -0,0 +1,119 @@
|
|||
package containerservice
|
||||
|
||||
// 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"
|
||||
)
|
||||
|
||||
// PrivateLinkResourcesClient is the the Container Service Client.
|
||||
type PrivateLinkResourcesClient struct {
|
||||
BaseClient
|
||||
}
|
||||
|
||||
// NewPrivateLinkResourcesClient creates an instance of the PrivateLinkResourcesClient client.
|
||||
func NewPrivateLinkResourcesClient(subscriptionID string) PrivateLinkResourcesClient {
|
||||
return NewPrivateLinkResourcesClientWithBaseURI(DefaultBaseURI, subscriptionID)
|
||||
}
|
||||
|
||||
// NewPrivateLinkResourcesClientWithBaseURI creates an instance of the PrivateLinkResourcesClient 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 NewPrivateLinkResourcesClientWithBaseURI(baseURI string, subscriptionID string) PrivateLinkResourcesClient {
|
||||
return PrivateLinkResourcesClient{NewWithBaseURI(baseURI, subscriptionID)}
|
||||
}
|
||||
|
||||
// List to learn more about private clusters, see: https://docs.microsoft.com/azure/aks/private-clusters
|
||||
// Parameters:
|
||||
// resourceGroupName - the name of the resource group.
|
||||
// resourceName - the name of the managed cluster resource.
|
||||
func (client PrivateLinkResourcesClient) List(ctx context.Context, resourceGroupName string, resourceName string) (result PrivateLinkResourcesListResult, err error) {
|
||||
if tracing.IsEnabled() {
|
||||
ctx = tracing.StartSpan(ctx, fqdn+"/PrivateLinkResourcesClient.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.MinLength, Rule: 1, Chain: nil}}},
|
||||
{TargetValue: resourceName,
|
||||
Constraints: []validation.Constraint{{Target: "resourceName", Name: validation.MaxLength, Rule: 63, Chain: nil},
|
||||
{Target: "resourceName", Name: validation.MinLength, Rule: 1, Chain: nil},
|
||||
{Target: "resourceName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$`, Chain: nil}}}}); err != nil {
|
||||
return result, validation.NewError("containerservice.PrivateLinkResourcesClient", "List", err.Error())
|
||||
}
|
||||
|
||||
req, err := client.ListPreparer(ctx, resourceGroupName, resourceName)
|
||||
if err != nil {
|
||||
err = autorest.NewErrorWithError(err, "containerservice.PrivateLinkResourcesClient", "List", nil, "Failure preparing request")
|
||||
return
|
||||
}
|
||||
|
||||
resp, err := client.ListSender(req)
|
||||
if err != nil {
|
||||
result.Response = autorest.Response{Response: resp}
|
||||
err = autorest.NewErrorWithError(err, "containerservice.PrivateLinkResourcesClient", "List", resp, "Failure sending request")
|
||||
return
|
||||
}
|
||||
|
||||
result, err = client.ListResponder(resp)
|
||||
if err != nil {
|
||||
err = autorest.NewErrorWithError(err, "containerservice.PrivateLinkResourcesClient", "List", resp, "Failure responding to request")
|
||||
return
|
||||
}
|
||||
|
||||
return
|
||||
}
|
||||
|
||||
// ListPreparer prepares the List request.
|
||||
func (client PrivateLinkResourcesClient) ListPreparer(ctx context.Context, resourceGroupName string, resourceName string) (*http.Request, error) {
|
||||
pathParameters := map[string]interface{}{
|
||||
"resourceGroupName": autorest.Encode("path", resourceGroupName),
|
||||
"resourceName": autorest.Encode("path", resourceName),
|
||||
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
|
||||
}
|
||||
|
||||
const APIVersion = "2021-10-01"
|
||||
queryParameters := map[string]interface{}{
|
||||
"api-version": APIVersion,
|
||||
}
|
||||
|
||||
preparer := autorest.CreatePreparer(
|
||||
autorest.AsGet(),
|
||||
autorest.WithBaseURL(client.BaseURI),
|
||||
autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/privateLinkResources", 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 PrivateLinkResourcesClient) 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 PrivateLinkResourcesClient) ListResponder(resp *http.Response) (result PrivateLinkResourcesListResult, err error) {
|
||||
err = autorest.Respond(
|
||||
resp,
|
||||
azure.WithErrorUnlessStatusCode(http.StatusOK),
|
||||
autorest.ByUnmarshallingJSON(&result),
|
||||
autorest.ByClosing())
|
||||
result.Response = autorest.Response{Response: resp}
|
||||
return
|
||||
}
|
123
vendor/github.com/Azure/azure-sdk-for-go/services/containerservice/mgmt/2021-10-01/containerservice/resolveprivatelinkserviceid.go
сгенерированный
поставляемый
Normal file
123
vendor/github.com/Azure/azure-sdk-for-go/services/containerservice/mgmt/2021-10-01/containerservice/resolveprivatelinkserviceid.go
сгенерированный
поставляемый
Normal file
|
@ -0,0 +1,123 @@
|
|||
package containerservice
|
||||
|
||||
// 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"
|
||||
)
|
||||
|
||||
// ResolvePrivateLinkServiceIDClient is the the Container Service Client.
|
||||
type ResolvePrivateLinkServiceIDClient struct {
|
||||
BaseClient
|
||||
}
|
||||
|
||||
// NewResolvePrivateLinkServiceIDClient creates an instance of the ResolvePrivateLinkServiceIDClient client.
|
||||
func NewResolvePrivateLinkServiceIDClient(subscriptionID string) ResolvePrivateLinkServiceIDClient {
|
||||
return NewResolvePrivateLinkServiceIDClientWithBaseURI(DefaultBaseURI, subscriptionID)
|
||||
}
|
||||
|
||||
// NewResolvePrivateLinkServiceIDClientWithBaseURI creates an instance of the ResolvePrivateLinkServiceIDClient 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 NewResolvePrivateLinkServiceIDClientWithBaseURI(baseURI string, subscriptionID string) ResolvePrivateLinkServiceIDClient {
|
||||
return ResolvePrivateLinkServiceIDClient{NewWithBaseURI(baseURI, subscriptionID)}
|
||||
}
|
||||
|
||||
// POST sends the post request.
|
||||
// Parameters:
|
||||
// resourceGroupName - the name of the resource group.
|
||||
// resourceName - the name of the managed cluster resource.
|
||||
// parameters - parameters required in order to resolve a private link service ID.
|
||||
func (client ResolvePrivateLinkServiceIDClient) POST(ctx context.Context, resourceGroupName string, resourceName string, parameters PrivateLinkResource) (result PrivateLinkResource, err error) {
|
||||
if tracing.IsEnabled() {
|
||||
ctx = tracing.StartSpan(ctx, fqdn+"/ResolvePrivateLinkServiceIDClient.POST")
|
||||
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.MinLength, Rule: 1, Chain: nil}}},
|
||||
{TargetValue: resourceName,
|
||||
Constraints: []validation.Constraint{{Target: "resourceName", Name: validation.MaxLength, Rule: 63, Chain: nil},
|
||||
{Target: "resourceName", Name: validation.MinLength, Rule: 1, Chain: nil},
|
||||
{Target: "resourceName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$`, Chain: nil}}}}); err != nil {
|
||||
return result, validation.NewError("containerservice.ResolvePrivateLinkServiceIDClient", "POST", err.Error())
|
||||
}
|
||||
|
||||
req, err := client.POSTPreparer(ctx, resourceGroupName, resourceName, parameters)
|
||||
if err != nil {
|
||||
err = autorest.NewErrorWithError(err, "containerservice.ResolvePrivateLinkServiceIDClient", "POST", nil, "Failure preparing request")
|
||||
return
|
||||
}
|
||||
|
||||
resp, err := client.POSTSender(req)
|
||||
if err != nil {
|
||||
result.Response = autorest.Response{Response: resp}
|
||||
err = autorest.NewErrorWithError(err, "containerservice.ResolvePrivateLinkServiceIDClient", "POST", resp, "Failure sending request")
|
||||
return
|
||||
}
|
||||
|
||||
result, err = client.POSTResponder(resp)
|
||||
if err != nil {
|
||||
err = autorest.NewErrorWithError(err, "containerservice.ResolvePrivateLinkServiceIDClient", "POST", resp, "Failure responding to request")
|
||||
return
|
||||
}
|
||||
|
||||
return
|
||||
}
|
||||
|
||||
// POSTPreparer prepares the POST request.
|
||||
func (client ResolvePrivateLinkServiceIDClient) POSTPreparer(ctx context.Context, resourceGroupName string, resourceName string, parameters PrivateLinkResource) (*http.Request, error) {
|
||||
pathParameters := map[string]interface{}{
|
||||
"resourceGroupName": autorest.Encode("path", resourceGroupName),
|
||||
"resourceName": autorest.Encode("path", resourceName),
|
||||
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
|
||||
}
|
||||
|
||||
const APIVersion = "2021-10-01"
|
||||
queryParameters := map[string]interface{}{
|
||||
"api-version": APIVersion,
|
||||
}
|
||||
|
||||
parameters.PrivateLinkServiceID = nil
|
||||
preparer := autorest.CreatePreparer(
|
||||
autorest.AsContentType("application/json; charset=utf-8"),
|
||||
autorest.AsPost(),
|
||||
autorest.WithBaseURL(client.BaseURI),
|
||||
autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/resolvePrivateLinkServiceId", pathParameters),
|
||||
autorest.WithJSON(parameters),
|
||||
autorest.WithQueryParameters(queryParameters))
|
||||
return preparer.Prepare((&http.Request{}).WithContext(ctx))
|
||||
}
|
||||
|
||||
// POSTSender sends the POST request. The method will close the
|
||||
// http.Response Body if it receives an error.
|
||||
func (client ResolvePrivateLinkServiceIDClient) POSTSender(req *http.Request) (*http.Response, error) {
|
||||
return client.Send(req, azure.DoRetryWithRegistration(client.Client))
|
||||
}
|
||||
|
||||
// POSTResponder handles the response to the POST request. The method always
|
||||
// closes the http.Response Body.
|
||||
func (client ResolvePrivateLinkServiceIDClient) POSTResponder(resp *http.Response) (result PrivateLinkResource, err error) {
|
||||
err = autorest.Respond(
|
||||
resp,
|
||||
azure.WithErrorUnlessStatusCode(http.StatusOK),
|
||||
autorest.ByUnmarshallingJSON(&result),
|
||||
autorest.ByClosing())
|
||||
result.Response = autorest.Response{Response: resp}
|
||||
return
|
||||
}
|
617
vendor/github.com/Azure/azure-sdk-for-go/services/containerservice/mgmt/2021-10-01/containerservice/snapshots.go
сгенерированный
поставляемый
Normal file
617
vendor/github.com/Azure/azure-sdk-for-go/services/containerservice/mgmt/2021-10-01/containerservice/snapshots.go
сгенерированный
поставляемый
Normal file
|
@ -0,0 +1,617 @@
|
|||
package containerservice
|
||||
|
||||
// Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
// Licensed under the MIT License. See License.txt in the project root for license information.
|
||||
//
|
||||
// Code generated by Microsoft (R) AutoRest Code Generator.
|
||||
// Changes may cause incorrect behavior and will be lost if the code is regenerated.
|
||||
|
||||
import (
|
||||
"context"
|
||||
"github.com/Azure/go-autorest/autorest"
|
||||
"github.com/Azure/go-autorest/autorest/azure"
|
||||
"github.com/Azure/go-autorest/autorest/validation"
|
||||
"github.com/Azure/go-autorest/tracing"
|
||||
"net/http"
|
||||
)
|
||||
|
||||
// SnapshotsClient is the the Container Service Client.
|
||||
type SnapshotsClient struct {
|
||||
BaseClient
|
||||
}
|
||||
|
||||
// NewSnapshotsClient creates an instance of the SnapshotsClient client.
|
||||
func NewSnapshotsClient(subscriptionID string) SnapshotsClient {
|
||||
return NewSnapshotsClientWithBaseURI(DefaultBaseURI, subscriptionID)
|
||||
}
|
||||
|
||||
// NewSnapshotsClientWithBaseURI creates an instance of the SnapshotsClient client using a custom endpoint. Use this
|
||||
// when interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure stack).
|
||||
func NewSnapshotsClientWithBaseURI(baseURI string, subscriptionID string) SnapshotsClient {
|
||||
return SnapshotsClient{NewWithBaseURI(baseURI, subscriptionID)}
|
||||
}
|
||||
|
||||
// CreateOrUpdate sends the create or update request.
|
||||
// Parameters:
|
||||
// resourceGroupName - the name of the resource group.
|
||||
// resourceName - the name of the managed cluster resource.
|
||||
// parameters - the snapshot to create or update.
|
||||
func (client SnapshotsClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, resourceName string, parameters Snapshot) (result Snapshot, err error) {
|
||||
if tracing.IsEnabled() {
|
||||
ctx = tracing.StartSpan(ctx, fqdn+"/SnapshotsClient.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.MinLength, Rule: 1, Chain: nil}}},
|
||||
{TargetValue: resourceName,
|
||||
Constraints: []validation.Constraint{{Target: "resourceName", Name: validation.MaxLength, Rule: 63, Chain: nil},
|
||||
{Target: "resourceName", Name: validation.MinLength, Rule: 1, Chain: nil},
|
||||
{Target: "resourceName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$`, Chain: nil}}}}); err != nil {
|
||||
return result, validation.NewError("containerservice.SnapshotsClient", "CreateOrUpdate", err.Error())
|
||||
}
|
||||
|
||||
req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, resourceName, parameters)
|
||||
if err != nil {
|
||||
err = autorest.NewErrorWithError(err, "containerservice.SnapshotsClient", "CreateOrUpdate", nil, "Failure preparing request")
|
||||
return
|
||||
}
|
||||
|
||||
resp, err := client.CreateOrUpdateSender(req)
|
||||
if err != nil {
|
||||
result.Response = autorest.Response{Response: resp}
|
||||
err = autorest.NewErrorWithError(err, "containerservice.SnapshotsClient", "CreateOrUpdate", resp, "Failure sending request")
|
||||
return
|
||||
}
|
||||
|
||||
result, err = client.CreateOrUpdateResponder(resp)
|
||||
if err != nil {
|
||||
err = autorest.NewErrorWithError(err, "containerservice.SnapshotsClient", "CreateOrUpdate", resp, "Failure responding to request")
|
||||
return
|
||||
}
|
||||
|
||||
return
|
||||
}
|
||||
|
||||
// CreateOrUpdatePreparer prepares the CreateOrUpdate request.
|
||||
func (client SnapshotsClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, resourceName string, parameters Snapshot) (*http.Request, error) {
|
||||
pathParameters := map[string]interface{}{
|
||||
"resourceGroupName": autorest.Encode("path", resourceGroupName),
|
||||
"resourceName": autorest.Encode("path", resourceName),
|
||||
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
|
||||
}
|
||||
|
||||
const APIVersion = "2021-10-01"
|
||||
queryParameters := map[string]interface{}{
|
||||
"api-version": APIVersion,
|
||||
}
|
||||
|
||||
parameters.SystemData = nil
|
||||
preparer := autorest.CreatePreparer(
|
||||
autorest.AsContentType("application/json; charset=utf-8"),
|
||||
autorest.AsPut(),
|
||||
autorest.WithBaseURL(client.BaseURI),
|
||||
autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/snapshots/{resourceName}", pathParameters),
|
||||
autorest.WithJSON(parameters),
|
||||
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 SnapshotsClient) 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 SnapshotsClient) CreateOrUpdateResponder(resp *http.Response) (result Snapshot, err error) {
|
||||
err = autorest.Respond(
|
||||
resp,
|
||||
azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated),
|
||||
autorest.ByUnmarshallingJSON(&result),
|
||||
autorest.ByClosing())
|
||||
result.Response = autorest.Response{Response: resp}
|
||||
return
|
||||
}
|
||||
|
||||
// Delete sends the delete request.
|
||||
// Parameters:
|
||||
// resourceGroupName - the name of the resource group.
|
||||
// resourceName - the name of the managed cluster resource.
|
||||
func (client SnapshotsClient) Delete(ctx context.Context, resourceGroupName string, resourceName string) (result autorest.Response, err error) {
|
||||
if tracing.IsEnabled() {
|
||||
ctx = tracing.StartSpan(ctx, fqdn+"/SnapshotsClient.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.MinLength, Rule: 1, Chain: nil}}},
|
||||
{TargetValue: resourceName,
|
||||
Constraints: []validation.Constraint{{Target: "resourceName", Name: validation.MaxLength, Rule: 63, Chain: nil},
|
||||
{Target: "resourceName", Name: validation.MinLength, Rule: 1, Chain: nil},
|
||||
{Target: "resourceName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$`, Chain: nil}}}}); err != nil {
|
||||
return result, validation.NewError("containerservice.SnapshotsClient", "Delete", err.Error())
|
||||
}
|
||||
|
||||
req, err := client.DeletePreparer(ctx, resourceGroupName, resourceName)
|
||||
if err != nil {
|
||||
err = autorest.NewErrorWithError(err, "containerservice.SnapshotsClient", "Delete", nil, "Failure preparing request")
|
||||
return
|
||||
}
|
||||
|
||||
resp, err := client.DeleteSender(req)
|
||||
if err != nil {
|
||||
result.Response = resp
|
||||
err = autorest.NewErrorWithError(err, "containerservice.SnapshotsClient", "Delete", resp, "Failure sending request")
|
||||
return
|
||||
}
|
||||
|
||||
result, err = client.DeleteResponder(resp)
|
||||
if err != nil {
|
||||
err = autorest.NewErrorWithError(err, "containerservice.SnapshotsClient", "Delete", resp, "Failure responding to request")
|
||||
return
|
||||
}
|
||||
|
||||
return
|
||||
}
|
||||
|
||||
// DeletePreparer prepares the Delete request.
|
||||
func (client SnapshotsClient) DeletePreparer(ctx context.Context, resourceGroupName string, resourceName string) (*http.Request, error) {
|
||||
pathParameters := map[string]interface{}{
|
||||
"resourceGroupName": autorest.Encode("path", resourceGroupName),
|
||||
"resourceName": autorest.Encode("path", resourceName),
|
||||
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
|
||||
}
|
||||
|
||||
const APIVersion = "2021-10-01"
|
||||
queryParameters := map[string]interface{}{
|
||||
"api-version": APIVersion,
|
||||
}
|
||||
|
||||
preparer := autorest.CreatePreparer(
|
||||
autorest.AsDelete(),
|
||||
autorest.WithBaseURL(client.BaseURI),
|
||||
autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/snapshots/{resourceName}", pathParameters),
|
||||
autorest.WithQueryParameters(queryParameters))
|
||||
return preparer.Prepare((&http.Request{}).WithContext(ctx))
|
||||
}
|
||||
|
||||
// DeleteSender sends the Delete request. The method will close the
|
||||
// http.Response Body if it receives an error.
|
||||
func (client SnapshotsClient) DeleteSender(req *http.Request) (*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 SnapshotsClient) 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 sends the get request.
|
||||
// Parameters:
|
||||
// resourceGroupName - the name of the resource group.
|
||||
// resourceName - the name of the managed cluster resource.
|
||||
func (client SnapshotsClient) Get(ctx context.Context, resourceGroupName string, resourceName string) (result Snapshot, err error) {
|
||||
if tracing.IsEnabled() {
|
||||
ctx = tracing.StartSpan(ctx, fqdn+"/SnapshotsClient.Get")
|
||||
defer func() {
|
||||
sc := -1
|
||||
if result.Response.Response != nil {
|
||||
sc = result.Response.Response.StatusCode
|
||||
}
|
||||
tracing.EndSpan(ctx, sc, err)
|
||||
}()
|
||||
}
|
||||
if err := validation.Validate([]validation.Validation{
|
||||
{TargetValue: resourceGroupName,
|
||||
Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}},
|
||||
{TargetValue: resourceName,
|
||||
Constraints: []validation.Constraint{{Target: "resourceName", Name: validation.MaxLength, Rule: 63, Chain: nil},
|
||||
{Target: "resourceName", Name: validation.MinLength, Rule: 1, Chain: nil},
|
||||
{Target: "resourceName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$`, Chain: nil}}}}); err != nil {
|
||||
return result, validation.NewError("containerservice.SnapshotsClient", "Get", err.Error())
|
||||
}
|
||||
|
||||
req, err := client.GetPreparer(ctx, resourceGroupName, resourceName)
|
||||
if err != nil {
|
||||
err = autorest.NewErrorWithError(err, "containerservice.SnapshotsClient", "Get", nil, "Failure preparing request")
|
||||
return
|
||||
}
|
||||
|
||||
resp, err := client.GetSender(req)
|
||||
if err != nil {
|
||||
result.Response = autorest.Response{Response: resp}
|
||||
err = autorest.NewErrorWithError(err, "containerservice.SnapshotsClient", "Get", resp, "Failure sending request")
|
||||
return
|
||||
}
|
||||
|
||||
result, err = client.GetResponder(resp)
|
||||
if err != nil {
|
||||
err = autorest.NewErrorWithError(err, "containerservice.SnapshotsClient", "Get", resp, "Failure responding to request")
|
||||
return
|
||||
}
|
||||
|
||||
return
|
||||
}
|
||||
|
||||
// GetPreparer prepares the Get request.
|
||||
func (client SnapshotsClient) GetPreparer(ctx context.Context, resourceGroupName string, resourceName string) (*http.Request, error) {
|
||||
pathParameters := map[string]interface{}{
|
||||
"resourceGroupName": autorest.Encode("path", resourceGroupName),
|
||||
"resourceName": autorest.Encode("path", resourceName),
|
||||
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
|
||||
}
|
||||
|
||||
const APIVersion = "2021-10-01"
|
||||
queryParameters := map[string]interface{}{
|
||||
"api-version": APIVersion,
|
||||
}
|
||||
|
||||
preparer := autorest.CreatePreparer(
|
||||
autorest.AsGet(),
|
||||
autorest.WithBaseURL(client.BaseURI),
|
||||
autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/snapshots/{resourceName}", pathParameters),
|
||||
autorest.WithQueryParameters(queryParameters))
|
||||
return preparer.Prepare((&http.Request{}).WithContext(ctx))
|
||||
}
|
||||
|
||||
// GetSender sends the Get request. The method will close the
|
||||
// http.Response Body if it receives an error.
|
||||
func (client SnapshotsClient) GetSender(req *http.Request) (*http.Response, error) {
|
||||
return client.Send(req, azure.DoRetryWithRegistration(client.Client))
|
||||
}
|
||||
|
||||
// GetResponder handles the response to the Get request. The method always
|
||||
// closes the http.Response Body.
|
||||
func (client SnapshotsClient) GetResponder(resp *http.Response) (result Snapshot, err error) {
|
||||
err = autorest.Respond(
|
||||
resp,
|
||||
azure.WithErrorUnlessStatusCode(http.StatusOK),
|
||||
autorest.ByUnmarshallingJSON(&result),
|
||||
autorest.ByClosing())
|
||||
result.Response = autorest.Response{Response: resp}
|
||||
return
|
||||
}
|
||||
|
||||
// List sends the list request.
|
||||
func (client SnapshotsClient) List(ctx context.Context) (result SnapshotListResultPage, err error) {
|
||||
if tracing.IsEnabled() {
|
||||
ctx = tracing.StartSpan(ctx, fqdn+"/SnapshotsClient.List")
|
||||
defer func() {
|
||||
sc := -1
|
||||
if result.slr.Response.Response != nil {
|
||||
sc = result.slr.Response.Response.StatusCode
|
||||
}
|
||||
tracing.EndSpan(ctx, sc, err)
|
||||
}()
|
||||
}
|
||||
result.fn = client.listNextResults
|
||||
req, err := client.ListPreparer(ctx)
|
||||
if err != nil {
|
||||
err = autorest.NewErrorWithError(err, "containerservice.SnapshotsClient", "List", nil, "Failure preparing request")
|
||||
return
|
||||
}
|
||||
|
||||
resp, err := client.ListSender(req)
|
||||
if err != nil {
|
||||
result.slr.Response = autorest.Response{Response: resp}
|
||||
err = autorest.NewErrorWithError(err, "containerservice.SnapshotsClient", "List", resp, "Failure sending request")
|
||||
return
|
||||
}
|
||||
|
||||
result.slr, err = client.ListResponder(resp)
|
||||
if err != nil {
|
||||
err = autorest.NewErrorWithError(err, "containerservice.SnapshotsClient", "List", resp, "Failure responding to request")
|
||||
return
|
||||
}
|
||||
if result.slr.hasNextLink() && result.slr.IsEmpty() {
|
||||
err = result.NextWithContext(ctx)
|
||||
return
|
||||
}
|
||||
|
||||
return
|
||||
}
|
||||
|
||||
// ListPreparer prepares the List request.
|
||||
func (client SnapshotsClient) ListPreparer(ctx context.Context) (*http.Request, error) {
|
||||
pathParameters := map[string]interface{}{
|
||||
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
|
||||
}
|
||||
|
||||
const APIVersion = "2021-10-01"
|
||||
queryParameters := map[string]interface{}{
|
||||
"api-version": APIVersion,
|
||||
}
|
||||
|
||||
preparer := autorest.CreatePreparer(
|
||||
autorest.AsGet(),
|
||||
autorest.WithBaseURL(client.BaseURI),
|
||||
autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.ContainerService/snapshots", pathParameters),
|
||||
autorest.WithQueryParameters(queryParameters))
|
||||
return preparer.Prepare((&http.Request{}).WithContext(ctx))
|
||||
}
|
||||
|
||||
// ListSender sends the List request. The method will close the
|
||||
// http.Response Body if it receives an error.
|
||||
func (client SnapshotsClient) ListSender(req *http.Request) (*http.Response, error) {
|
||||
return client.Send(req, azure.DoRetryWithRegistration(client.Client))
|
||||
}
|
||||
|
||||
// ListResponder handles the response to the List request. The method always
|
||||
// closes the http.Response Body.
|
||||
func (client SnapshotsClient) ListResponder(resp *http.Response) (result SnapshotListResult, 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 SnapshotsClient) listNextResults(ctx context.Context, lastResults SnapshotListResult) (result SnapshotListResult, err error) {
|
||||
req, err := lastResults.snapshotListResultPreparer(ctx)
|
||||
if err != nil {
|
||||
return result, autorest.NewErrorWithError(err, "containerservice.SnapshotsClient", "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, "containerservice.SnapshotsClient", "listNextResults", resp, "Failure sending next results request")
|
||||
}
|
||||
result, err = client.ListResponder(resp)
|
||||
if err != nil {
|
||||
err = autorest.NewErrorWithError(err, "containerservice.SnapshotsClient", "listNextResults", resp, "Failure responding to next results request")
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
// ListComplete enumerates all values, automatically crossing page boundaries as required.
|
||||
func (client SnapshotsClient) ListComplete(ctx context.Context) (result SnapshotListResultIterator, err error) {
|
||||
if tracing.IsEnabled() {
|
||||
ctx = tracing.StartSpan(ctx, fqdn+"/SnapshotsClient.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
|
||||
}
|
||||
|
||||
// ListByResourceGroup sends the list by resource group request.
|
||||
// Parameters:
|
||||
// resourceGroupName - the name of the resource group.
|
||||
func (client SnapshotsClient) ListByResourceGroup(ctx context.Context, resourceGroupName string) (result SnapshotListResultPage, err error) {
|
||||
if tracing.IsEnabled() {
|
||||
ctx = tracing.StartSpan(ctx, fqdn+"/SnapshotsClient.ListByResourceGroup")
|
||||
defer func() {
|
||||
sc := -1
|
||||
if result.slr.Response.Response != nil {
|
||||
sc = result.slr.Response.Response.StatusCode
|
||||
}
|
||||
tracing.EndSpan(ctx, sc, err)
|
||||
}()
|
||||
}
|
||||
if err := validation.Validate([]validation.Validation{
|
||||
{TargetValue: resourceGroupName,
|
||||
Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}}); err != nil {
|
||||
return result, validation.NewError("containerservice.SnapshotsClient", "ListByResourceGroup", err.Error())
|
||||
}
|
||||
|
||||
result.fn = client.listByResourceGroupNextResults
|
||||
req, err := client.ListByResourceGroupPreparer(ctx, resourceGroupName)
|
||||
if err != nil {
|
||||
err = autorest.NewErrorWithError(err, "containerservice.SnapshotsClient", "ListByResourceGroup", nil, "Failure preparing request")
|
||||
return
|
||||
}
|
||||
|
||||
resp, err := client.ListByResourceGroupSender(req)
|
||||
if err != nil {
|
||||
result.slr.Response = autorest.Response{Response: resp}
|
||||
err = autorest.NewErrorWithError(err, "containerservice.SnapshotsClient", "ListByResourceGroup", resp, "Failure sending request")
|
||||
return
|
||||
}
|
||||
|
||||
result.slr, err = client.ListByResourceGroupResponder(resp)
|
||||
if err != nil {
|
||||
err = autorest.NewErrorWithError(err, "containerservice.SnapshotsClient", "ListByResourceGroup", resp, "Failure responding to request")
|
||||
return
|
||||
}
|
||||
if result.slr.hasNextLink() && result.slr.IsEmpty() {
|
||||
err = result.NextWithContext(ctx)
|
||||
return
|
||||
}
|
||||
|
||||
return
|
||||
}
|
||||
|
||||
// ListByResourceGroupPreparer prepares the ListByResourceGroup request.
|
||||
func (client SnapshotsClient) ListByResourceGroupPreparer(ctx context.Context, resourceGroupName string) (*http.Request, error) {
|
||||
pathParameters := map[string]interface{}{
|
||||
"resourceGroupName": autorest.Encode("path", resourceGroupName),
|
||||
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
|
||||
}
|
||||
|
||||
const APIVersion = "2021-10-01"
|
||||
queryParameters := map[string]interface{}{
|
||||
"api-version": APIVersion,
|
||||
}
|
||||
|
||||
preparer := autorest.CreatePreparer(
|
||||
autorest.AsGet(),
|
||||
autorest.WithBaseURL(client.BaseURI),
|
||||
autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/snapshots", pathParameters),
|
||||
autorest.WithQueryParameters(queryParameters))
|
||||
return preparer.Prepare((&http.Request{}).WithContext(ctx))
|
||||
}
|
||||
|
||||
// ListByResourceGroupSender sends the ListByResourceGroup request. The method will close the
|
||||
// http.Response Body if it receives an error.
|
||||
func (client SnapshotsClient) ListByResourceGroupSender(req *http.Request) (*http.Response, error) {
|
||||
return client.Send(req, azure.DoRetryWithRegistration(client.Client))
|
||||
}
|
||||
|
||||
// ListByResourceGroupResponder handles the response to the ListByResourceGroup request. The method always
|
||||
// closes the http.Response Body.
|
||||
func (client SnapshotsClient) ListByResourceGroupResponder(resp *http.Response) (result SnapshotListResult, err error) {
|
||||
err = autorest.Respond(
|
||||
resp,
|
||||
azure.WithErrorUnlessStatusCode(http.StatusOK),
|
||||
autorest.ByUnmarshallingJSON(&result),
|
||||
autorest.ByClosing())
|
||||
result.Response = autorest.Response{Response: resp}
|
||||
return
|
||||
}
|
||||
|
||||
// listByResourceGroupNextResults retrieves the next set of results, if any.
|
||||
func (client SnapshotsClient) listByResourceGroupNextResults(ctx context.Context, lastResults SnapshotListResult) (result SnapshotListResult, err error) {
|
||||
req, err := lastResults.snapshotListResultPreparer(ctx)
|
||||
if err != nil {
|
||||
return result, autorest.NewErrorWithError(err, "containerservice.SnapshotsClient", "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, "containerservice.SnapshotsClient", "listByResourceGroupNextResults", resp, "Failure sending next results request")
|
||||
}
|
||||
result, err = client.ListByResourceGroupResponder(resp)
|
||||
if err != nil {
|
||||
err = autorest.NewErrorWithError(err, "containerservice.SnapshotsClient", "listByResourceGroupNextResults", resp, "Failure responding to next results request")
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
// ListByResourceGroupComplete enumerates all values, automatically crossing page boundaries as required.
|
||||
func (client SnapshotsClient) ListByResourceGroupComplete(ctx context.Context, resourceGroupName string) (result SnapshotListResultIterator, err error) {
|
||||
if tracing.IsEnabled() {
|
||||
ctx = tracing.StartSpan(ctx, fqdn+"/SnapshotsClient.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
|
||||
}
|
||||
|
||||
// UpdateTags sends the update tags request.
|
||||
// Parameters:
|
||||
// resourceGroupName - the name of the resource group.
|
||||
// resourceName - the name of the managed cluster resource.
|
||||
// parameters - parameters supplied to the Update snapshot Tags operation.
|
||||
func (client SnapshotsClient) UpdateTags(ctx context.Context, resourceGroupName string, resourceName string, parameters TagsObject) (result Snapshot, err error) {
|
||||
if tracing.IsEnabled() {
|
||||
ctx = tracing.StartSpan(ctx, fqdn+"/SnapshotsClient.UpdateTags")
|
||||
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.MinLength, Rule: 1, Chain: nil}}},
|
||||
{TargetValue: resourceName,
|
||||
Constraints: []validation.Constraint{{Target: "resourceName", Name: validation.MaxLength, Rule: 63, Chain: nil},
|
||||
{Target: "resourceName", Name: validation.MinLength, Rule: 1, Chain: nil},
|
||||
{Target: "resourceName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$`, Chain: nil}}}}); err != nil {
|
||||
return result, validation.NewError("containerservice.SnapshotsClient", "UpdateTags", err.Error())
|
||||
}
|
||||
|
||||
req, err := client.UpdateTagsPreparer(ctx, resourceGroupName, resourceName, parameters)
|
||||
if err != nil {
|
||||
err = autorest.NewErrorWithError(err, "containerservice.SnapshotsClient", "UpdateTags", nil, "Failure preparing request")
|
||||
return
|
||||
}
|
||||
|
||||
resp, err := client.UpdateTagsSender(req)
|
||||
if err != nil {
|
||||
result.Response = autorest.Response{Response: resp}
|
||||
err = autorest.NewErrorWithError(err, "containerservice.SnapshotsClient", "UpdateTags", resp, "Failure sending request")
|
||||
return
|
||||
}
|
||||
|
||||
result, err = client.UpdateTagsResponder(resp)
|
||||
if err != nil {
|
||||
err = autorest.NewErrorWithError(err, "containerservice.SnapshotsClient", "UpdateTags", resp, "Failure responding to request")
|
||||
return
|
||||
}
|
||||
|
||||
return
|
||||
}
|
||||
|
||||
// UpdateTagsPreparer prepares the UpdateTags request.
|
||||
func (client SnapshotsClient) UpdateTagsPreparer(ctx context.Context, resourceGroupName string, resourceName string, parameters TagsObject) (*http.Request, error) {
|
||||
pathParameters := map[string]interface{}{
|
||||
"resourceGroupName": autorest.Encode("path", resourceGroupName),
|
||||
"resourceName": autorest.Encode("path", resourceName),
|
||||
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
|
||||
}
|
||||
|
||||
const APIVersion = "2021-10-01"
|
||||
queryParameters := map[string]interface{}{
|
||||
"api-version": APIVersion,
|
||||
}
|
||||
|
||||
preparer := autorest.CreatePreparer(
|
||||
autorest.AsContentType("application/json; charset=utf-8"),
|
||||
autorest.AsPatch(),
|
||||
autorest.WithBaseURL(client.BaseURI),
|
||||
autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/snapshots/{resourceName}", pathParameters),
|
||||
autorest.WithJSON(parameters),
|
||||
autorest.WithQueryParameters(queryParameters))
|
||||
return preparer.Prepare((&http.Request{}).WithContext(ctx))
|
||||
}
|
||||
|
||||
// UpdateTagsSender sends the UpdateTags request. The method will close the
|
||||
// http.Response Body if it receives an error.
|
||||
func (client SnapshotsClient) UpdateTagsSender(req *http.Request) (*http.Response, error) {
|
||||
return client.Send(req, azure.DoRetryWithRegistration(client.Client))
|
||||
}
|
||||
|
||||
// UpdateTagsResponder handles the response to the UpdateTags request. The method always
|
||||
// closes the http.Response Body.
|
||||
func (client SnapshotsClient) UpdateTagsResponder(resp *http.Response) (result Snapshot, err error) {
|
||||
err = autorest.Respond(
|
||||
resp,
|
||||
azure.WithErrorUnlessStatusCode(http.StatusOK),
|
||||
autorest.ByUnmarshallingJSON(&result),
|
||||
autorest.ByClosing())
|
||||
result.Response = autorest.Response{Response: resp}
|
||||
return
|
||||
}
|
19
vendor/github.com/Azure/azure-sdk-for-go/services/containerservice/mgmt/2021-10-01/containerservice/version.go
сгенерированный
поставляемый
Normal file
19
vendor/github.com/Azure/azure-sdk-for-go/services/containerservice/mgmt/2021-10-01/containerservice/version.go
сгенерированный
поставляемый
Normal file
|
@ -0,0 +1,19 @@
|
|||
package containerservice
|
||||
|
||||
import "github.com/Azure/azure-sdk-for-go/version"
|
||||
|
||||
// Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
// Licensed under the MIT License. See License.txt in the project root for license information.
|
||||
//
|
||||
// Code generated by Microsoft (R) AutoRest Code Generator.
|
||||
// Changes may cause incorrect behavior and will be lost if the code is regenerated.
|
||||
|
||||
// UserAgent returns the UserAgent string to use when sending http.Requests.
|
||||
func UserAgent() string {
|
||||
return "Azure-SDK-For-Go/" + Version() + " containerservice/2021-10-01"
|
||||
}
|
||||
|
||||
// Version returns the semantic version (see http://semver.org) of the client.
|
||||
func Version() string {
|
||||
return version.Number
|
||||
}
|
|
@ -25,6 +25,7 @@ github.com/Azure/azure-sdk-for-go/profiles/2018-03-01/resources/mgmt/subscriptio
|
|||
github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2017-03-30/compute
|
||||
github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2018-10-01/compute
|
||||
github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2020-06-01/compute
|
||||
github.com/Azure/azure-sdk-for-go/services/containerservice/mgmt/2021-10-01/containerservice
|
||||
github.com/Azure/azure-sdk-for-go/services/cosmos-db/mgmt/2021-01-15/documentdb
|
||||
github.com/Azure/azure-sdk-for-go/services/dns/mgmt/2016-04-01/dns
|
||||
github.com/Azure/azure-sdk-for-go/services/dns/mgmt/2018-05-01/dns
|
||||
|
|
Загрузка…
Ссылка в новой задаче