diff --git a/sdk/containerservice/armcontainerservice/CHANGELOG.md b/sdk/containerservice/armcontainerservice/CHANGELOG.md new file mode 100644 index 000000000000..c7196df9ed8b --- /dev/null +++ b/sdk/containerservice/armcontainerservice/CHANGELOG.md @@ -0,0 +1,3 @@ +# Release History + +## v0.1.0 (released) diff --git a/sdk/containerservice/armcontainerservice/README.md b/sdk/containerservice/armcontainerservice/README.md new file mode 100644 index 000000000000..ace0e16570a2 --- /dev/null +++ b/sdk/containerservice/armcontainerservice/README.md @@ -0,0 +1,76 @@ +# Azure Container Service Module for Go + +[![PkgGoDev](https://pkg.go.dev/badge/github.com/Azure/azure-sdk-for-go/sdk/containerservice/armcontainerservice)](https://pkg.go.dev/github.com/Azure/azure-sdk-for-go/sdk/containerservice/armcontainerservice) + +The `armcontainerservice` module provides operations for working with Azure Container Service. + +[Source code](https://github.com/Azure/azure-sdk-for-go/tree/main/sdk/containerservice/armcontainerservice) + +# Getting started + +## Prerequisites + +- an [Azure subscription](https://azure.microsoft.com/free/) +- Go 1.13 or above + +## Install the package + +This project uses [Go modules](https://github.com/golang/go/wiki/Modules) for versioning and dependency management. + +Install the Azure Container Service module: + +```sh +go get github.com/Azure/azure-sdk-for-go/sdk/containerservice/armcontainerservice +``` + +## Authorization + +When creating a client, you will need to provide a credential for authenticating with Azure Container Service. The `azidentity` module provides facilities for various ways of authenticating with Azure including client/secret, certificate, managed identity, and more. + +```go +cred, err := azidentity.NewDefaultAzureCredential(nil) +``` + +For more information on authentication, please see the documentation for `azidentity` at [pkg.go.dev/github.com/Azure/azure-sdk-for-go/sdk/azidentity](https://pkg.go.dev/github.com/Azure/azure-sdk-for-go/sdk/azidentity). + +## Connecting to Azure Container Service + +Once you have a credential, create a connection to the desired ARM endpoint. The `armcore` module provides facilities for connecting with ARM endpoints including public and sovereign clouds as well as Azure Stack. + +```go +con := armcore.NewDefaultConnection(cred, nil) +``` + +For more information on ARM connections, please see the documentation for `armcore` at [pkg.go.dev/github.com/Azure/azure-sdk-for-go/sdk/armcore](https://pkg.go.dev/github.com/Azure/azure-sdk-for-go/sdk/armcore). + +## Clients + +Azure Container Service modules consist of one or more clients. A client groups a set of related APIs, providing access to its functionality within the specified subscription. Create one or more clients to access the APIs you require using your `armcore.Connection`. + +```go +client := armcontainerservice.NewManagedClustersClient(con, "") +``` + +## Provide Feedback + +If you encounter bugs or have suggestions, please +[open an issue](https://github.com/Azure/azure-sdk-for-go/issues) and assign the `Container Service` label. + +# Contributing + +This project welcomes contributions and suggestions. Most contributions require +you to agree to a Contributor License Agreement (CLA) declaring that you have +the right to, and actually do, grant us the rights to use your contribution. +For details, visit [https://cla.microsoft.com](https://cla.microsoft.com). + +When you submit a pull request, a CLA-bot will automatically determine whether +you need to provide a CLA and decorate the PR appropriately (e.g., label, +comment). Simply follow the instructions provided by the bot. You will only +need to do this once across all repos using our CLA. + +This project has adopted the +[Microsoft Open Source Code of Conduct](https://opensource.microsoft.com/codeofconduct/). +For more information, see the +[Code of Conduct FAQ](https://opensource.microsoft.com/codeofconduct/faq/) +or contact [opencode@microsoft.com](mailto:opencode@microsoft.com) with any +additional questions or comments. \ No newline at end of file diff --git a/sdk/containerservice/armcontainerservice/autorest.md b/sdk/containerservice/armcontainerservice/autorest.md new file mode 100644 index 000000000000..ce4b7f6ceb69 --- /dev/null +++ b/sdk/containerservice/armcontainerservice/autorest.md @@ -0,0 +1,10 @@ +### AutoRest Configuration + +> see https://aka.ms/autorest + +``` yaml +require: +- https://github.com/Azure/azure-rest-api-specs/blob/a331a455fd31e022f8df07105058ae586a02ab03/specification/containerservice/resource-manager/readme.md +- https://github.com/Azure/azure-rest-api-specs/blob/a331a455fd31e022f8df07105058ae586a02ab03/specification/containerservice/resource-manager/readme.go.md +module-version: 0.1.0 +``` \ No newline at end of file diff --git a/sdk/containerservice/armcontainerservice/build.go b/sdk/containerservice/armcontainerservice/build.go new file mode 100644 index 000000000000..60395150930c --- /dev/null +++ b/sdk/containerservice/armcontainerservice/build.go @@ -0,0 +1,7 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. + +// This file enables 'go generate' to regenerate this specific SDK +//go:generate pwsh.exe ../../../eng/scripts/build.ps1 -skipBuild -format -tidy -generate armcontainerservice + +package armcontainerservice diff --git a/sdk/containerservice/armcontainerservice/ci.yml b/sdk/containerservice/armcontainerservice/ci.yml index 3fdd60cf0177..23b7e2f191c0 100644 --- a/sdk/containerservice/armcontainerservice/ci.yml +++ b/sdk/containerservice/armcontainerservice/ci.yml @@ -2,14 +2,14 @@ trigger: paths: include: - - sdk/containerservice/armcontainerservice + - sdk/containerservice/armcontainerservice/ pr: paths: include: - - sdk/containerservice/armcontainerservice + - sdk/containerservice/armcontainerservice/ stages: -- template: ../../../eng/pipelines/templates/jobs/archetype-sdk-client.yml +- template: /eng/pipelines/templates/jobs/archetype-sdk-client.yml parameters: ServiceDirectory: 'containerservice/armcontainerservice' diff --git a/sdk/containerservice/armcontainerservice/go.mod b/sdk/containerservice/armcontainerservice/go.mod new file mode 100644 index 000000000000..8dacde99a608 --- /dev/null +++ b/sdk/containerservice/armcontainerservice/go.mod @@ -0,0 +1,9 @@ +module github.com/Azure/azure-sdk-for-go/sdk/containerservice/armcontainerservice + +go 1.13 + +require ( + github.com/Azure/azure-sdk-for-go v56.1.0+incompatible + github.com/Azure/azure-sdk-for-go/sdk/armcore v0.8.0 + github.com/Azure/azure-sdk-for-go/sdk/azcore v0.16.2 +) diff --git a/sdk/containerservice/armcontainerservice/go.sum b/sdk/containerservice/armcontainerservice/go.sum new file mode 100644 index 000000000000..9e02912957fd --- /dev/null +++ b/sdk/containerservice/armcontainerservice/go.sum @@ -0,0 +1,20 @@ +github.com/Azure/azure-sdk-for-go v56.1.0+incompatible h1:Ofcecdw3F1ZqnpDEZcLzH9Hq0P4Y5Si8+EioXJSamJs= +github.com/Azure/azure-sdk-for-go v56.1.0+incompatible/go.mod h1:9XXNKU+eRnpl9moKnB4QOLf1HestfXbmab5FXxiDBjc= +github.com/Azure/azure-sdk-for-go/sdk/armcore v0.8.0 h1:HQQoaSGOh32mpoRkpLDjkngMwYJqkxu93FRx0epdLHE= +github.com/Azure/azure-sdk-for-go/sdk/armcore v0.8.0/go.mod h1:BSKvHb/5cy8j4hahIInXH92X/2zGJ3TxKF6b9pw1Btg= +github.com/Azure/azure-sdk-for-go/sdk/azcore v0.16.2 h1:UC4vfOhW2l0f2QOCQpOxJS4/K6oKFy2tQZE+uWU1MEo= +github.com/Azure/azure-sdk-for-go/sdk/azcore v0.16.2/go.mod h1:MVdrcUC4Hup35qHym3VdzoW+NBgBxrta9Vei97jRtM8= +github.com/Azure/azure-sdk-for-go/sdk/internal v0.5.1 h1:vx8McI56N5oLSQu8xa+xdiE0fjQq8W8Zt49vHP8Rygw= +github.com/Azure/azure-sdk-for-go/sdk/internal v0.5.1/go.mod h1:k4KbFSunV/+0hOHL1vyFaPsiYQ1Vmvy1TBpmtvCDLZM= +golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= +golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= +golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= +golang.org/x/net v0.0.0-20201010224723-4f7140c49acb h1:mUVeFHoDKis5nxCAzoAi7E8Ghb86EXh/RK6wtvJIqRY= +golang.org/x/net v0.0.0-20201010224723-4f7140c49acb/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= +golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= +golang.org/x/text v0.3.3 h1:cokOdA+Jmi5PJGXLlLllQSgYigAEfHXJAERHVMaCc2k= +golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= +golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= diff --git a/sdk/containerservice/armcontainerservice/go_mod_tidy_hack.go b/sdk/containerservice/armcontainerservice/go_mod_tidy_hack.go new file mode 100644 index 000000000000..ee44c661aeb8 --- /dev/null +++ b/sdk/containerservice/armcontainerservice/go_mod_tidy_hack.go @@ -0,0 +1,12 @@ +// +build modhack + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. + +// This file, and the github.com/Azure/azure-sdk-for-go import, won't actually become part of +// the resultant binary. + +package armcontainerservice + +// Necessary for safely adding multi-module repo. See: https://github.com/golang/go/wiki/Modules#is-it-possible-to-add-a-module-to-a-multi-module-repository +import _ "github.com/Azure/azure-sdk-for-go" diff --git a/sdk/containerservice/armcontainerservice/zz_generated_agentpools_client.go b/sdk/containerservice/armcontainerservice/zz_generated_agentpools_client.go new file mode 100644 index 000000000000..0e64020df0a7 --- /dev/null +++ b/sdk/containerservice/armcontainerservice/zz_generated_agentpools_client.go @@ -0,0 +1,632 @@ +// +build go1.13 + +// 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. + +package armcontainerservice + +import ( + "context" + "errors" + "fmt" + "github.com/Azure/azure-sdk-for-go/sdk/armcore" + "github.com/Azure/azure-sdk-for-go/sdk/azcore" + "net/http" + "net/url" + "strings" + "time" +) + +// AgentPoolsClient contains the methods for the AgentPools group. +// Don't use this type directly, use NewAgentPoolsClient() instead. +type AgentPoolsClient struct { + con *armcore.Connection + subscriptionID string +} + +// NewAgentPoolsClient creates a new instance of AgentPoolsClient with the specified values. +func NewAgentPoolsClient(con *armcore.Connection, subscriptionID string) *AgentPoolsClient { + return &AgentPoolsClient{con: con, subscriptionID: subscriptionID} +} + +// BeginCreateOrUpdate - Creates or updates an agent pool in the specified managed cluster. +// If the operation fails it returns the *CloudError error type. +func (client *AgentPoolsClient) BeginCreateOrUpdate(ctx context.Context, resourceGroupName string, resourceName string, agentPoolName string, parameters AgentPool, options *AgentPoolsBeginCreateOrUpdateOptions) (AgentPoolsCreateOrUpdatePollerResponse, error) { + resp, err := client.createOrUpdate(ctx, resourceGroupName, resourceName, agentPoolName, parameters, options) + if err != nil { + return AgentPoolsCreateOrUpdatePollerResponse{}, err + } + result := AgentPoolsCreateOrUpdatePollerResponse{ + RawResponse: resp.Response, + } + pt, err := armcore.NewLROPoller("AgentPoolsClient.CreateOrUpdate", "", resp, client.con.Pipeline(), client.createOrUpdateHandleError) + if err != nil { + return AgentPoolsCreateOrUpdatePollerResponse{}, err + } + poller := &agentPoolsCreateOrUpdatePoller{ + pt: pt, + } + result.Poller = poller + result.PollUntilDone = func(ctx context.Context, frequency time.Duration) (AgentPoolsCreateOrUpdateResponse, error) { + return poller.pollUntilDone(ctx, frequency) + } + return result, nil +} + +// ResumeCreateOrUpdate creates a new AgentPoolsCreateOrUpdatePoller from the specified resume token. +// token - The value must come from a previous call to AgentPoolsCreateOrUpdatePoller.ResumeToken(). +func (client *AgentPoolsClient) ResumeCreateOrUpdate(ctx context.Context, token string) (AgentPoolsCreateOrUpdatePollerResponse, error) { + pt, err := armcore.NewLROPollerFromResumeToken("AgentPoolsClient.CreateOrUpdate", token, client.con.Pipeline(), client.createOrUpdateHandleError) + if err != nil { + return AgentPoolsCreateOrUpdatePollerResponse{}, err + } + poller := &agentPoolsCreateOrUpdatePoller{ + pt: pt, + } + resp, err := poller.Poll(ctx) + if err != nil { + return AgentPoolsCreateOrUpdatePollerResponse{}, err + } + result := AgentPoolsCreateOrUpdatePollerResponse{ + RawResponse: resp, + } + result.Poller = poller + result.PollUntilDone = func(ctx context.Context, frequency time.Duration) (AgentPoolsCreateOrUpdateResponse, error) { + return poller.pollUntilDone(ctx, frequency) + } + return result, nil +} + +// CreateOrUpdate - Creates or updates an agent pool in the specified managed cluster. +// If the operation fails it returns the *CloudError error type. +func (client *AgentPoolsClient) createOrUpdate(ctx context.Context, resourceGroupName string, resourceName string, agentPoolName string, parameters AgentPool, options *AgentPoolsBeginCreateOrUpdateOptions) (*azcore.Response, error) { + req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, resourceName, agentPoolName, parameters, options) + if err != nil { + return nil, err + } + resp, err := client.con.Pipeline().Do(req) + if err != nil { + return nil, err + } + if !resp.HasStatusCode(http.StatusOK, http.StatusCreated) { + return nil, client.createOrUpdateHandleError(resp) + } + return resp, nil +} + +// createOrUpdateCreateRequest creates the CreateOrUpdate request. +func (client *AgentPoolsClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, resourceName string, agentPoolName string, parameters AgentPool, options *AgentPoolsBeginCreateOrUpdateOptions) (*azcore.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools/{agentPoolName}" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if resourceName == "" { + return nil, errors.New("parameter resourceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceName}", url.PathEscape(resourceName)) + if agentPoolName == "" { + return nil, errors.New("parameter agentPoolName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{agentPoolName}", url.PathEscape(agentPoolName)) + req, err := azcore.NewRequest(ctx, http.MethodPut, azcore.JoinPaths(client.con.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + req.Telemetry(telemetryInfo) + reqQP := req.URL.Query() + reqQP.Set("api-version", "2021-07-01") + req.URL.RawQuery = reqQP.Encode() + req.Header.Set("Accept", "application/json") + return req, req.MarshalAsJSON(parameters) +} + +// createOrUpdateHandleError handles the CreateOrUpdate error response. +func (client *AgentPoolsClient) createOrUpdateHandleError(resp *azcore.Response) error { + body, err := resp.Payload() + if err != nil { + return azcore.NewResponseError(err, resp.Response) + } + errType := CloudError{raw: string(body)} + if err := resp.UnmarshalAsJSON(&errType); err != nil { + return azcore.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp.Response) + } + return azcore.NewResponseError(&errType, resp.Response) +} + +// BeginDelete - Deletes an agent pool in the specified managed cluster. +// If the operation fails it returns the *CloudError error type. +func (client *AgentPoolsClient) BeginDelete(ctx context.Context, resourceGroupName string, resourceName string, agentPoolName string, options *AgentPoolsBeginDeleteOptions) (AgentPoolsDeletePollerResponse, error) { + resp, err := client.deleteOperation(ctx, resourceGroupName, resourceName, agentPoolName, options) + if err != nil { + return AgentPoolsDeletePollerResponse{}, err + } + result := AgentPoolsDeletePollerResponse{ + RawResponse: resp.Response, + } + pt, err := armcore.NewLROPoller("AgentPoolsClient.Delete", "", resp, client.con.Pipeline(), client.deleteHandleError) + if err != nil { + return AgentPoolsDeletePollerResponse{}, err + } + poller := &agentPoolsDeletePoller{ + pt: pt, + } + result.Poller = poller + result.PollUntilDone = func(ctx context.Context, frequency time.Duration) (AgentPoolsDeleteResponse, error) { + return poller.pollUntilDone(ctx, frequency) + } + return result, nil +} + +// ResumeDelete creates a new AgentPoolsDeletePoller from the specified resume token. +// token - The value must come from a previous call to AgentPoolsDeletePoller.ResumeToken(). +func (client *AgentPoolsClient) ResumeDelete(ctx context.Context, token string) (AgentPoolsDeletePollerResponse, error) { + pt, err := armcore.NewLROPollerFromResumeToken("AgentPoolsClient.Delete", token, client.con.Pipeline(), client.deleteHandleError) + if err != nil { + return AgentPoolsDeletePollerResponse{}, err + } + poller := &agentPoolsDeletePoller{ + pt: pt, + } + resp, err := poller.Poll(ctx) + if err != nil { + return AgentPoolsDeletePollerResponse{}, err + } + result := AgentPoolsDeletePollerResponse{ + RawResponse: resp, + } + result.Poller = poller + result.PollUntilDone = func(ctx context.Context, frequency time.Duration) (AgentPoolsDeleteResponse, error) { + return poller.pollUntilDone(ctx, frequency) + } + return result, nil +} + +// Delete - Deletes an agent pool in the specified managed cluster. +// If the operation fails it returns the *CloudError error type. +func (client *AgentPoolsClient) deleteOperation(ctx context.Context, resourceGroupName string, resourceName string, agentPoolName string, options *AgentPoolsBeginDeleteOptions) (*azcore.Response, error) { + req, err := client.deleteCreateRequest(ctx, resourceGroupName, resourceName, agentPoolName, options) + if err != nil { + return nil, err + } + resp, err := client.con.Pipeline().Do(req) + if err != nil { + return nil, err + } + if !resp.HasStatusCode(http.StatusAccepted, http.StatusNoContent) { + return nil, client.deleteHandleError(resp) + } + return resp, nil +} + +// deleteCreateRequest creates the Delete request. +func (client *AgentPoolsClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, resourceName string, agentPoolName string, options *AgentPoolsBeginDeleteOptions) (*azcore.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools/{agentPoolName}" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if resourceName == "" { + return nil, errors.New("parameter resourceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceName}", url.PathEscape(resourceName)) + if agentPoolName == "" { + return nil, errors.New("parameter agentPoolName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{agentPoolName}", url.PathEscape(agentPoolName)) + req, err := azcore.NewRequest(ctx, http.MethodDelete, azcore.JoinPaths(client.con.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + req.Telemetry(telemetryInfo) + reqQP := req.URL.Query() + reqQP.Set("api-version", "2021-07-01") + req.URL.RawQuery = reqQP.Encode() + req.Header.Set("Accept", "application/json") + return req, nil +} + +// deleteHandleError handles the Delete error response. +func (client *AgentPoolsClient) deleteHandleError(resp *azcore.Response) error { + body, err := resp.Payload() + if err != nil { + return azcore.NewResponseError(err, resp.Response) + } + errType := CloudError{raw: string(body)} + if err := resp.UnmarshalAsJSON(&errType); err != nil { + return azcore.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp.Response) + } + return azcore.NewResponseError(&errType, resp.Response) +} + +// Get - Gets the specified managed cluster agent pool. +// If the operation fails it returns the *CloudError error type. +func (client *AgentPoolsClient) Get(ctx context.Context, resourceGroupName string, resourceName string, agentPoolName string, options *AgentPoolsGetOptions) (AgentPoolsGetResponse, error) { + req, err := client.getCreateRequest(ctx, resourceGroupName, resourceName, agentPoolName, options) + if err != nil { + return AgentPoolsGetResponse{}, err + } + resp, err := client.con.Pipeline().Do(req) + if err != nil { + return AgentPoolsGetResponse{}, err + } + if !resp.HasStatusCode(http.StatusOK) { + return AgentPoolsGetResponse{}, client.getHandleError(resp) + } + return client.getHandleResponse(resp) +} + +// getCreateRequest creates the Get request. +func (client *AgentPoolsClient) getCreateRequest(ctx context.Context, resourceGroupName string, resourceName string, agentPoolName string, options *AgentPoolsGetOptions) (*azcore.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools/{agentPoolName}" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if resourceName == "" { + return nil, errors.New("parameter resourceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceName}", url.PathEscape(resourceName)) + if agentPoolName == "" { + return nil, errors.New("parameter agentPoolName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{agentPoolName}", url.PathEscape(agentPoolName)) + req, err := azcore.NewRequest(ctx, http.MethodGet, azcore.JoinPaths(client.con.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + req.Telemetry(telemetryInfo) + reqQP := req.URL.Query() + reqQP.Set("api-version", "2021-07-01") + req.URL.RawQuery = reqQP.Encode() + req.Header.Set("Accept", "application/json") + return req, nil +} + +// getHandleResponse handles the Get response. +func (client *AgentPoolsClient) getHandleResponse(resp *azcore.Response) (AgentPoolsGetResponse, error) { + result := AgentPoolsGetResponse{RawResponse: resp.Response} + if err := resp.UnmarshalAsJSON(&result.AgentPool); err != nil { + return AgentPoolsGetResponse{}, err + } + return result, nil +} + +// getHandleError handles the Get error response. +func (client *AgentPoolsClient) getHandleError(resp *azcore.Response) error { + body, err := resp.Payload() + if err != nil { + return azcore.NewResponseError(err, resp.Response) + } + errType := CloudError{raw: string(body)} + if err := resp.UnmarshalAsJSON(&errType); err != nil { + return azcore.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp.Response) + } + return azcore.NewResponseError(&errType, resp.Response) +} + +// GetAvailableAgentPoolVersions - See supported Kubernetes versions [https://docs.microsoft.com/azure/aks/supported-kubernetes-versions] for more details +// about the version lifecycle. +// If the operation fails it returns a generic error. +func (client *AgentPoolsClient) GetAvailableAgentPoolVersions(ctx context.Context, resourceGroupName string, resourceName string, options *AgentPoolsGetAvailableAgentPoolVersionsOptions) (AgentPoolsGetAvailableAgentPoolVersionsResponse, error) { + req, err := client.getAvailableAgentPoolVersionsCreateRequest(ctx, resourceGroupName, resourceName, options) + if err != nil { + return AgentPoolsGetAvailableAgentPoolVersionsResponse{}, err + } + resp, err := client.con.Pipeline().Do(req) + if err != nil { + return AgentPoolsGetAvailableAgentPoolVersionsResponse{}, err + } + if !resp.HasStatusCode(http.StatusOK) { + return AgentPoolsGetAvailableAgentPoolVersionsResponse{}, client.getAvailableAgentPoolVersionsHandleError(resp) + } + return client.getAvailableAgentPoolVersionsHandleResponse(resp) +} + +// getAvailableAgentPoolVersionsCreateRequest creates the GetAvailableAgentPoolVersions request. +func (client *AgentPoolsClient) getAvailableAgentPoolVersionsCreateRequest(ctx context.Context, resourceGroupName string, resourceName string, options *AgentPoolsGetAvailableAgentPoolVersionsOptions) (*azcore.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/availableAgentPoolVersions" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if resourceName == "" { + return nil, errors.New("parameter resourceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceName}", url.PathEscape(resourceName)) + req, err := azcore.NewRequest(ctx, http.MethodGet, azcore.JoinPaths(client.con.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + req.Telemetry(telemetryInfo) + reqQP := req.URL.Query() + reqQP.Set("api-version", "2021-07-01") + req.URL.RawQuery = reqQP.Encode() + req.Header.Set("Accept", "application/json") + return req, nil +} + +// getAvailableAgentPoolVersionsHandleResponse handles the GetAvailableAgentPoolVersions response. +func (client *AgentPoolsClient) getAvailableAgentPoolVersionsHandleResponse(resp *azcore.Response) (AgentPoolsGetAvailableAgentPoolVersionsResponse, error) { + result := AgentPoolsGetAvailableAgentPoolVersionsResponse{RawResponse: resp.Response} + if err := resp.UnmarshalAsJSON(&result.AgentPoolAvailableVersions); err != nil { + return AgentPoolsGetAvailableAgentPoolVersionsResponse{}, err + } + return result, nil +} + +// getAvailableAgentPoolVersionsHandleError handles the GetAvailableAgentPoolVersions error response. +func (client *AgentPoolsClient) getAvailableAgentPoolVersionsHandleError(resp *azcore.Response) error { + body, err := resp.Payload() + if err != nil { + return azcore.NewResponseError(err, resp.Response) + } + if len(body) == 0 { + return azcore.NewResponseError(errors.New(resp.Status), resp.Response) + } + return azcore.NewResponseError(errors.New(string(body)), resp.Response) +} + +// GetUpgradeProfile - Gets the upgrade profile for an agent pool. +// If the operation fails it returns the *CloudError error type. +func (client *AgentPoolsClient) GetUpgradeProfile(ctx context.Context, resourceGroupName string, resourceName string, agentPoolName string, options *AgentPoolsGetUpgradeProfileOptions) (AgentPoolsGetUpgradeProfileResponse, error) { + req, err := client.getUpgradeProfileCreateRequest(ctx, resourceGroupName, resourceName, agentPoolName, options) + if err != nil { + return AgentPoolsGetUpgradeProfileResponse{}, err + } + resp, err := client.con.Pipeline().Do(req) + if err != nil { + return AgentPoolsGetUpgradeProfileResponse{}, err + } + if !resp.HasStatusCode(http.StatusOK) { + return AgentPoolsGetUpgradeProfileResponse{}, client.getUpgradeProfileHandleError(resp) + } + return client.getUpgradeProfileHandleResponse(resp) +} + +// getUpgradeProfileCreateRequest creates the GetUpgradeProfile request. +func (client *AgentPoolsClient) getUpgradeProfileCreateRequest(ctx context.Context, resourceGroupName string, resourceName string, agentPoolName string, options *AgentPoolsGetUpgradeProfileOptions) (*azcore.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools/{agentPoolName}/upgradeProfiles/default" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if resourceName == "" { + return nil, errors.New("parameter resourceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceName}", url.PathEscape(resourceName)) + if agentPoolName == "" { + return nil, errors.New("parameter agentPoolName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{agentPoolName}", url.PathEscape(agentPoolName)) + req, err := azcore.NewRequest(ctx, http.MethodGet, azcore.JoinPaths(client.con.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + req.Telemetry(telemetryInfo) + reqQP := req.URL.Query() + reqQP.Set("api-version", "2021-07-01") + req.URL.RawQuery = reqQP.Encode() + req.Header.Set("Accept", "application/json") + return req, nil +} + +// getUpgradeProfileHandleResponse handles the GetUpgradeProfile response. +func (client *AgentPoolsClient) getUpgradeProfileHandleResponse(resp *azcore.Response) (AgentPoolsGetUpgradeProfileResponse, error) { + result := AgentPoolsGetUpgradeProfileResponse{RawResponse: resp.Response} + if err := resp.UnmarshalAsJSON(&result.AgentPoolUpgradeProfile); err != nil { + return AgentPoolsGetUpgradeProfileResponse{}, err + } + return result, nil +} + +// getUpgradeProfileHandleError handles the GetUpgradeProfile error response. +func (client *AgentPoolsClient) getUpgradeProfileHandleError(resp *azcore.Response) error { + body, err := resp.Payload() + if err != nil { + return azcore.NewResponseError(err, resp.Response) + } + errType := CloudError{raw: string(body)} + if err := resp.UnmarshalAsJSON(&errType); err != nil { + return azcore.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp.Response) + } + return azcore.NewResponseError(&errType, resp.Response) +} + +// List - Gets a list of agent pools in the specified managed cluster. +// If the operation fails it returns the *CloudError error type. +func (client *AgentPoolsClient) List(resourceGroupName string, resourceName string, options *AgentPoolsListOptions) AgentPoolsListPager { + return &agentPoolsListPager{ + client: client, + requester: func(ctx context.Context) (*azcore.Request, error) { + return client.listCreateRequest(ctx, resourceGroupName, resourceName, options) + }, + advancer: func(ctx context.Context, resp AgentPoolsListResponse) (*azcore.Request, error) { + return azcore.NewRequest(ctx, http.MethodGet, *resp.AgentPoolListResult.NextLink) + }, + } +} + +// listCreateRequest creates the List request. +func (client *AgentPoolsClient) listCreateRequest(ctx context.Context, resourceGroupName string, resourceName string, options *AgentPoolsListOptions) (*azcore.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if resourceName == "" { + return nil, errors.New("parameter resourceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceName}", url.PathEscape(resourceName)) + req, err := azcore.NewRequest(ctx, http.MethodGet, azcore.JoinPaths(client.con.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + req.Telemetry(telemetryInfo) + reqQP := req.URL.Query() + reqQP.Set("api-version", "2021-07-01") + req.URL.RawQuery = reqQP.Encode() + req.Header.Set("Accept", "application/json") + return req, nil +} + +// listHandleResponse handles the List response. +func (client *AgentPoolsClient) listHandleResponse(resp *azcore.Response) (AgentPoolsListResponse, error) { + result := AgentPoolsListResponse{RawResponse: resp.Response} + if err := resp.UnmarshalAsJSON(&result.AgentPoolListResult); err != nil { + return AgentPoolsListResponse{}, err + } + return result, nil +} + +// listHandleError handles the List error response. +func (client *AgentPoolsClient) listHandleError(resp *azcore.Response) error { + body, err := resp.Payload() + if err != nil { + return azcore.NewResponseError(err, resp.Response) + } + errType := CloudError{raw: string(body)} + if err := resp.UnmarshalAsJSON(&errType); err != nil { + return azcore.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp.Response) + } + return azcore.NewResponseError(&errType, resp.Response) +} + +// BeginUpgradeNodeImageVersion - 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 +// If the operation fails it returns the *CloudError error type. +func (client *AgentPoolsClient) BeginUpgradeNodeImageVersion(ctx context.Context, resourceGroupName string, resourceName string, agentPoolName string, options *AgentPoolsBeginUpgradeNodeImageVersionOptions) (AgentPoolsUpgradeNodeImageVersionPollerResponse, error) { + resp, err := client.upgradeNodeImageVersion(ctx, resourceGroupName, resourceName, agentPoolName, options) + if err != nil { + return AgentPoolsUpgradeNodeImageVersionPollerResponse{}, err + } + result := AgentPoolsUpgradeNodeImageVersionPollerResponse{ + RawResponse: resp.Response, + } + pt, err := armcore.NewLROPoller("AgentPoolsClient.UpgradeNodeImageVersion", "", resp, client.con.Pipeline(), client.upgradeNodeImageVersionHandleError) + if err != nil { + return AgentPoolsUpgradeNodeImageVersionPollerResponse{}, err + } + poller := &agentPoolsUpgradeNodeImageVersionPoller{ + pt: pt, + } + result.Poller = poller + result.PollUntilDone = func(ctx context.Context, frequency time.Duration) (AgentPoolsUpgradeNodeImageVersionResponse, error) { + return poller.pollUntilDone(ctx, frequency) + } + return result, nil +} + +// ResumeUpgradeNodeImageVersion creates a new AgentPoolsUpgradeNodeImageVersionPoller from the specified resume token. +// token - The value must come from a previous call to AgentPoolsUpgradeNodeImageVersionPoller.ResumeToken(). +func (client *AgentPoolsClient) ResumeUpgradeNodeImageVersion(ctx context.Context, token string) (AgentPoolsUpgradeNodeImageVersionPollerResponse, error) { + pt, err := armcore.NewLROPollerFromResumeToken("AgentPoolsClient.UpgradeNodeImageVersion", token, client.con.Pipeline(), client.upgradeNodeImageVersionHandleError) + if err != nil { + return AgentPoolsUpgradeNodeImageVersionPollerResponse{}, err + } + poller := &agentPoolsUpgradeNodeImageVersionPoller{ + pt: pt, + } + resp, err := poller.Poll(ctx) + if err != nil { + return AgentPoolsUpgradeNodeImageVersionPollerResponse{}, err + } + result := AgentPoolsUpgradeNodeImageVersionPollerResponse{ + RawResponse: resp, + } + result.Poller = poller + result.PollUntilDone = func(ctx context.Context, frequency time.Duration) (AgentPoolsUpgradeNodeImageVersionResponse, error) { + return poller.pollUntilDone(ctx, frequency) + } + return result, nil +} + +// 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 +// If the operation fails it returns the *CloudError error type. +func (client *AgentPoolsClient) upgradeNodeImageVersion(ctx context.Context, resourceGroupName string, resourceName string, agentPoolName string, options *AgentPoolsBeginUpgradeNodeImageVersionOptions) (*azcore.Response, error) { + req, err := client.upgradeNodeImageVersionCreateRequest(ctx, resourceGroupName, resourceName, agentPoolName, options) + if err != nil { + return nil, err + } + resp, err := client.con.Pipeline().Do(req) + if err != nil { + return nil, err + } + if !resp.HasStatusCode(http.StatusOK, http.StatusAccepted) { + return nil, client.upgradeNodeImageVersionHandleError(resp) + } + return resp, nil +} + +// upgradeNodeImageVersionCreateRequest creates the UpgradeNodeImageVersion request. +func (client *AgentPoolsClient) upgradeNodeImageVersionCreateRequest(ctx context.Context, resourceGroupName string, resourceName string, agentPoolName string, options *AgentPoolsBeginUpgradeNodeImageVersionOptions) (*azcore.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools/{agentPoolName}/upgradeNodeImageVersion" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if resourceName == "" { + return nil, errors.New("parameter resourceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceName}", url.PathEscape(resourceName)) + if agentPoolName == "" { + return nil, errors.New("parameter agentPoolName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{agentPoolName}", url.PathEscape(agentPoolName)) + req, err := azcore.NewRequest(ctx, http.MethodPost, azcore.JoinPaths(client.con.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + req.Telemetry(telemetryInfo) + reqQP := req.URL.Query() + reqQP.Set("api-version", "2021-07-01") + req.URL.RawQuery = reqQP.Encode() + req.Header.Set("Accept", "application/json") + return req, nil +} + +// upgradeNodeImageVersionHandleError handles the UpgradeNodeImageVersion error response. +func (client *AgentPoolsClient) upgradeNodeImageVersionHandleError(resp *azcore.Response) error { + body, err := resp.Payload() + if err != nil { + return azcore.NewResponseError(err, resp.Response) + } + errType := CloudError{raw: string(body)} + if err := resp.UnmarshalAsJSON(&errType); err != nil { + return azcore.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp.Response) + } + return azcore.NewResponseError(&errType, resp.Response) +} diff --git a/sdk/containerservice/armcontainerservice/zz_generated_constants.go b/sdk/containerservice/armcontainerservice/zz_generated_constants.go new file mode 100644 index 000000000000..248cf49394aa --- /dev/null +++ b/sdk/containerservice/armcontainerservice/zz_generated_constants.go @@ -0,0 +1,1136 @@ +// +build go1.13 + +// 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. + +package armcontainerservice + +const telemetryInfo = "azsdk-go-armcontainerservice/v0.1.0" + +// AgentPoolMode - A cluster must have at least one 'System' Agent Pool at all times. For additional information on agent pool restrictions and best practices, +// see: https://docs.microsoft.com/azure/aks/use-system-pools +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 the possible values for the AgentPoolMode const type. +func PossibleAgentPoolModeValues() []AgentPoolMode { + return []AgentPoolMode{ + AgentPoolModeSystem, + AgentPoolModeUser, + } +} + +// ToPtr returns a *AgentPoolMode pointing to the current value. +func (c AgentPoolMode) ToPtr() *AgentPoolMode { + return &c +} + +// AgentPoolType - The type of Agent Pool. +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 the possible values for the AgentPoolType const type. +func PossibleAgentPoolTypeValues() []AgentPoolType { + return []AgentPoolType{ + AgentPoolTypeAvailabilitySet, + AgentPoolTypeVirtualMachineScaleSets, + } +} + +// ToPtr returns a *AgentPoolType pointing to the current value. +func (c AgentPoolType) ToPtr() *AgentPoolType { + return &c +} + +// Code - Tells whether the cluster is Running or Stopped +type Code string + +const ( + // CodeRunning - The cluster is running. + CodeRunning Code = "Running" + // CodeStopped - The cluster is stopped. + CodeStopped Code = "Stopped" +) + +// PossibleCodeValues returns the possible values for the Code const type. +func PossibleCodeValues() []Code { + return []Code{ + CodeRunning, + CodeStopped, + } +} + +// ToPtr returns a *Code pointing to the current value. +func (c Code) ToPtr() *Code { + return &c +} + +// ConnectionStatus - The private link service connection status. +type ConnectionStatus string + +const ( + ConnectionStatusApproved ConnectionStatus = "Approved" + ConnectionStatusDisconnected ConnectionStatus = "Disconnected" + ConnectionStatusPending ConnectionStatus = "Pending" + ConnectionStatusRejected ConnectionStatus = "Rejected" +) + +// PossibleConnectionStatusValues returns the possible values for the ConnectionStatus const type. +func PossibleConnectionStatusValues() []ConnectionStatus { + return []ConnectionStatus{ + ConnectionStatusApproved, + ConnectionStatusDisconnected, + ConnectionStatusPending, + ConnectionStatusRejected, + } +} + +// ToPtr returns a *ConnectionStatus pointing to the current value. +func (c ConnectionStatus) ToPtr() *ConnectionStatus { + return &c +} + +// ContainerServiceStorageProfileTypes - Specifies what kind of storage to use. If omitted, the default will be chosen on your behalf based on the choice +// of orchestrator. +type ContainerServiceStorageProfileTypes string + +const ( + ContainerServiceStorageProfileTypesManagedDisks ContainerServiceStorageProfileTypes = "ManagedDisks" + ContainerServiceStorageProfileTypesStorageAccount ContainerServiceStorageProfileTypes = "StorageAccount" +) + +// PossibleContainerServiceStorageProfileTypesValues returns the possible values for the ContainerServiceStorageProfileTypes const type. +func PossibleContainerServiceStorageProfileTypesValues() []ContainerServiceStorageProfileTypes { + return []ContainerServiceStorageProfileTypes{ + ContainerServiceStorageProfileTypesManagedDisks, + ContainerServiceStorageProfileTypesStorageAccount, + } +} + +// ToPtr returns a *ContainerServiceStorageProfileTypes pointing to the current value. +func (c ContainerServiceStorageProfileTypes) ToPtr() *ContainerServiceStorageProfileTypes { + return &c +} + +// ContainerServiceVMSizeTypes - Size of agent VMs. Note: This is no longer maintained. +type ContainerServiceVMSizeTypes string + +const ( + ContainerServiceVMSizeTypesStandardA1 ContainerServiceVMSizeTypes = "Standard_A1" + ContainerServiceVMSizeTypesStandardA10 ContainerServiceVMSizeTypes = "Standard_A10" + ContainerServiceVMSizeTypesStandardA11 ContainerServiceVMSizeTypes = "Standard_A11" + ContainerServiceVMSizeTypesStandardA1V2 ContainerServiceVMSizeTypes = "Standard_A1_v2" + ContainerServiceVMSizeTypesStandardA2 ContainerServiceVMSizeTypes = "Standard_A2" + ContainerServiceVMSizeTypesStandardA2MV2 ContainerServiceVMSizeTypes = "Standard_A2m_v2" + ContainerServiceVMSizeTypesStandardA2V2 ContainerServiceVMSizeTypes = "Standard_A2_v2" + ContainerServiceVMSizeTypesStandardA3 ContainerServiceVMSizeTypes = "Standard_A3" + ContainerServiceVMSizeTypesStandardA4 ContainerServiceVMSizeTypes = "Standard_A4" + ContainerServiceVMSizeTypesStandardA4MV2 ContainerServiceVMSizeTypes = "Standard_A4m_v2" + ContainerServiceVMSizeTypesStandardA4V2 ContainerServiceVMSizeTypes = "Standard_A4_v2" + ContainerServiceVMSizeTypesStandardA5 ContainerServiceVMSizeTypes = "Standard_A5" + ContainerServiceVMSizeTypesStandardA6 ContainerServiceVMSizeTypes = "Standard_A6" + ContainerServiceVMSizeTypesStandardA7 ContainerServiceVMSizeTypes = "Standard_A7" + ContainerServiceVMSizeTypesStandardA8 ContainerServiceVMSizeTypes = "Standard_A8" + ContainerServiceVMSizeTypesStandardA8MV2 ContainerServiceVMSizeTypes = "Standard_A8m_v2" + ContainerServiceVMSizeTypesStandardA8V2 ContainerServiceVMSizeTypes = "Standard_A8_v2" + ContainerServiceVMSizeTypesStandardA9 ContainerServiceVMSizeTypes = "Standard_A9" + ContainerServiceVMSizeTypesStandardB2Ms ContainerServiceVMSizeTypes = "Standard_B2ms" + ContainerServiceVMSizeTypesStandardB2S ContainerServiceVMSizeTypes = "Standard_B2s" + ContainerServiceVMSizeTypesStandardB4Ms ContainerServiceVMSizeTypes = "Standard_B4ms" + ContainerServiceVMSizeTypesStandardB8Ms ContainerServiceVMSizeTypes = "Standard_B8ms" + ContainerServiceVMSizeTypesStandardD1 ContainerServiceVMSizeTypes = "Standard_D1" + ContainerServiceVMSizeTypesStandardD11 ContainerServiceVMSizeTypes = "Standard_D11" + ContainerServiceVMSizeTypesStandardD11V2 ContainerServiceVMSizeTypes = "Standard_D11_v2" + ContainerServiceVMSizeTypesStandardD11V2Promo ContainerServiceVMSizeTypes = "Standard_D11_v2_Promo" + ContainerServiceVMSizeTypesStandardD12 ContainerServiceVMSizeTypes = "Standard_D12" + ContainerServiceVMSizeTypesStandardD12V2 ContainerServiceVMSizeTypes = "Standard_D12_v2" + ContainerServiceVMSizeTypesStandardD12V2Promo ContainerServiceVMSizeTypes = "Standard_D12_v2_Promo" + ContainerServiceVMSizeTypesStandardD13 ContainerServiceVMSizeTypes = "Standard_D13" + ContainerServiceVMSizeTypesStandardD13V2 ContainerServiceVMSizeTypes = "Standard_D13_v2" + ContainerServiceVMSizeTypesStandardD13V2Promo ContainerServiceVMSizeTypes = "Standard_D13_v2_Promo" + ContainerServiceVMSizeTypesStandardD14 ContainerServiceVMSizeTypes = "Standard_D14" + ContainerServiceVMSizeTypesStandardD14V2 ContainerServiceVMSizeTypes = "Standard_D14_v2" + ContainerServiceVMSizeTypesStandardD14V2Promo ContainerServiceVMSizeTypes = "Standard_D14_v2_Promo" + ContainerServiceVMSizeTypesStandardD15V2 ContainerServiceVMSizeTypes = "Standard_D15_v2" + ContainerServiceVMSizeTypesStandardD16SV3 ContainerServiceVMSizeTypes = "Standard_D16s_v3" + ContainerServiceVMSizeTypesStandardD16V3 ContainerServiceVMSizeTypes = "Standard_D16_v3" + ContainerServiceVMSizeTypesStandardD1V2 ContainerServiceVMSizeTypes = "Standard_D1_v2" + ContainerServiceVMSizeTypesStandardD2 ContainerServiceVMSizeTypes = "Standard_D2" + ContainerServiceVMSizeTypesStandardD2SV3 ContainerServiceVMSizeTypes = "Standard_D2s_v3" + ContainerServiceVMSizeTypesStandardD2V2 ContainerServiceVMSizeTypes = "Standard_D2_v2" + ContainerServiceVMSizeTypesStandardD2V2Promo ContainerServiceVMSizeTypes = "Standard_D2_v2_Promo" + ContainerServiceVMSizeTypesStandardD2V3 ContainerServiceVMSizeTypes = "Standard_D2_v3" + ContainerServiceVMSizeTypesStandardD3 ContainerServiceVMSizeTypes = "Standard_D3" + ContainerServiceVMSizeTypesStandardD32SV3 ContainerServiceVMSizeTypes = "Standard_D32s_v3" + ContainerServiceVMSizeTypesStandardD32V3 ContainerServiceVMSizeTypes = "Standard_D32_v3" + ContainerServiceVMSizeTypesStandardD3V2 ContainerServiceVMSizeTypes = "Standard_D3_v2" + ContainerServiceVMSizeTypesStandardD3V2Promo ContainerServiceVMSizeTypes = "Standard_D3_v2_Promo" + ContainerServiceVMSizeTypesStandardD4 ContainerServiceVMSizeTypes = "Standard_D4" + ContainerServiceVMSizeTypesStandardD4SV3 ContainerServiceVMSizeTypes = "Standard_D4s_v3" + ContainerServiceVMSizeTypesStandardD4V2 ContainerServiceVMSizeTypes = "Standard_D4_v2" + ContainerServiceVMSizeTypesStandardD4V2Promo ContainerServiceVMSizeTypes = "Standard_D4_v2_Promo" + ContainerServiceVMSizeTypesStandardD4V3 ContainerServiceVMSizeTypes = "Standard_D4_v3" + ContainerServiceVMSizeTypesStandardD5V2 ContainerServiceVMSizeTypes = "Standard_D5_v2" + ContainerServiceVMSizeTypesStandardD5V2Promo ContainerServiceVMSizeTypes = "Standard_D5_v2_Promo" + ContainerServiceVMSizeTypesStandardD64SV3 ContainerServiceVMSizeTypes = "Standard_D64s_v3" + ContainerServiceVMSizeTypesStandardD64V3 ContainerServiceVMSizeTypes = "Standard_D64_v3" + ContainerServiceVMSizeTypesStandardD8SV3 ContainerServiceVMSizeTypes = "Standard_D8s_v3" + ContainerServiceVMSizeTypesStandardD8V3 ContainerServiceVMSizeTypes = "Standard_D8_v3" + ContainerServiceVMSizeTypesStandardDS1 ContainerServiceVMSizeTypes = "Standard_DS1" + ContainerServiceVMSizeTypesStandardDS11 ContainerServiceVMSizeTypes = "Standard_DS11" + ContainerServiceVMSizeTypesStandardDS11V2 ContainerServiceVMSizeTypes = "Standard_DS11_v2" + ContainerServiceVMSizeTypesStandardDS11V2Promo ContainerServiceVMSizeTypes = "Standard_DS11_v2_Promo" + ContainerServiceVMSizeTypesStandardDS12 ContainerServiceVMSizeTypes = "Standard_DS12" + ContainerServiceVMSizeTypesStandardDS12V2 ContainerServiceVMSizeTypes = "Standard_DS12_v2" + ContainerServiceVMSizeTypesStandardDS12V2Promo ContainerServiceVMSizeTypes = "Standard_DS12_v2_Promo" + ContainerServiceVMSizeTypesStandardDS13 ContainerServiceVMSizeTypes = "Standard_DS13" + ContainerServiceVMSizeTypesStandardDS132V2 ContainerServiceVMSizeTypes = "Standard_DS13-2_v2" + ContainerServiceVMSizeTypesStandardDS134V2 ContainerServiceVMSizeTypes = "Standard_DS13-4_v2" + ContainerServiceVMSizeTypesStandardDS13V2 ContainerServiceVMSizeTypes = "Standard_DS13_v2" + ContainerServiceVMSizeTypesStandardDS13V2Promo ContainerServiceVMSizeTypes = "Standard_DS13_v2_Promo" + ContainerServiceVMSizeTypesStandardDS14 ContainerServiceVMSizeTypes = "Standard_DS14" + ContainerServiceVMSizeTypesStandardDS144V2 ContainerServiceVMSizeTypes = "Standard_DS14-4_v2" + ContainerServiceVMSizeTypesStandardDS148V2 ContainerServiceVMSizeTypes = "Standard_DS14-8_v2" + ContainerServiceVMSizeTypesStandardDS14V2 ContainerServiceVMSizeTypes = "Standard_DS14_v2" + ContainerServiceVMSizeTypesStandardDS14V2Promo ContainerServiceVMSizeTypes = "Standard_DS14_v2_Promo" + ContainerServiceVMSizeTypesStandardDS15V2 ContainerServiceVMSizeTypes = "Standard_DS15_v2" + ContainerServiceVMSizeTypesStandardDS1V2 ContainerServiceVMSizeTypes = "Standard_DS1_v2" + ContainerServiceVMSizeTypesStandardDS2 ContainerServiceVMSizeTypes = "Standard_DS2" + ContainerServiceVMSizeTypesStandardDS2V2 ContainerServiceVMSizeTypes = "Standard_DS2_v2" + ContainerServiceVMSizeTypesStandardDS2V2Promo ContainerServiceVMSizeTypes = "Standard_DS2_v2_Promo" + ContainerServiceVMSizeTypesStandardDS3 ContainerServiceVMSizeTypes = "Standard_DS3" + ContainerServiceVMSizeTypesStandardDS3V2 ContainerServiceVMSizeTypes = "Standard_DS3_v2" + ContainerServiceVMSizeTypesStandardDS3V2Promo ContainerServiceVMSizeTypes = "Standard_DS3_v2_Promo" + ContainerServiceVMSizeTypesStandardDS4 ContainerServiceVMSizeTypes = "Standard_DS4" + ContainerServiceVMSizeTypesStandardDS4V2 ContainerServiceVMSizeTypes = "Standard_DS4_v2" + ContainerServiceVMSizeTypesStandardDS4V2Promo ContainerServiceVMSizeTypes = "Standard_DS4_v2_Promo" + ContainerServiceVMSizeTypesStandardDS5V2 ContainerServiceVMSizeTypes = "Standard_DS5_v2" + ContainerServiceVMSizeTypesStandardDS5V2Promo ContainerServiceVMSizeTypes = "Standard_DS5_v2_Promo" + ContainerServiceVMSizeTypesStandardE16SV3 ContainerServiceVMSizeTypes = "Standard_E16s_v3" + ContainerServiceVMSizeTypesStandardE16V3 ContainerServiceVMSizeTypes = "Standard_E16_v3" + ContainerServiceVMSizeTypesStandardE2SV3 ContainerServiceVMSizeTypes = "Standard_E2s_v3" + ContainerServiceVMSizeTypesStandardE2V3 ContainerServiceVMSizeTypes = "Standard_E2_v3" + ContainerServiceVMSizeTypesStandardE3216SV3 ContainerServiceVMSizeTypes = "Standard_E32-16s_v3" + ContainerServiceVMSizeTypesStandardE328SV3 ContainerServiceVMSizeTypes = "Standard_E32-8s_v3" + ContainerServiceVMSizeTypesStandardE32SV3 ContainerServiceVMSizeTypes = "Standard_E32s_v3" + ContainerServiceVMSizeTypesStandardE32V3 ContainerServiceVMSizeTypes = "Standard_E32_v3" + ContainerServiceVMSizeTypesStandardE4SV3 ContainerServiceVMSizeTypes = "Standard_E4s_v3" + ContainerServiceVMSizeTypesStandardE4V3 ContainerServiceVMSizeTypes = "Standard_E4_v3" + ContainerServiceVMSizeTypesStandardE6416SV3 ContainerServiceVMSizeTypes = "Standard_E64-16s_v3" + ContainerServiceVMSizeTypesStandardE6432SV3 ContainerServiceVMSizeTypes = "Standard_E64-32s_v3" + ContainerServiceVMSizeTypesStandardE64SV3 ContainerServiceVMSizeTypes = "Standard_E64s_v3" + ContainerServiceVMSizeTypesStandardE64V3 ContainerServiceVMSizeTypes = "Standard_E64_v3" + ContainerServiceVMSizeTypesStandardE8SV3 ContainerServiceVMSizeTypes = "Standard_E8s_v3" + ContainerServiceVMSizeTypesStandardE8V3 ContainerServiceVMSizeTypes = "Standard_E8_v3" + ContainerServiceVMSizeTypesStandardF1 ContainerServiceVMSizeTypes = "Standard_F1" + ContainerServiceVMSizeTypesStandardF16 ContainerServiceVMSizeTypes = "Standard_F16" + ContainerServiceVMSizeTypesStandardF16S ContainerServiceVMSizeTypes = "Standard_F16s" + ContainerServiceVMSizeTypesStandardF16SV2 ContainerServiceVMSizeTypes = "Standard_F16s_v2" + ContainerServiceVMSizeTypesStandardF1S ContainerServiceVMSizeTypes = "Standard_F1s" + ContainerServiceVMSizeTypesStandardF2 ContainerServiceVMSizeTypes = "Standard_F2" + ContainerServiceVMSizeTypesStandardF2S ContainerServiceVMSizeTypes = "Standard_F2s" + ContainerServiceVMSizeTypesStandardF2SV2 ContainerServiceVMSizeTypes = "Standard_F2s_v2" + ContainerServiceVMSizeTypesStandardF32SV2 ContainerServiceVMSizeTypes = "Standard_F32s_v2" + ContainerServiceVMSizeTypesStandardF4 ContainerServiceVMSizeTypes = "Standard_F4" + ContainerServiceVMSizeTypesStandardF4S ContainerServiceVMSizeTypes = "Standard_F4s" + ContainerServiceVMSizeTypesStandardF4SV2 ContainerServiceVMSizeTypes = "Standard_F4s_v2" + ContainerServiceVMSizeTypesStandardF64SV2 ContainerServiceVMSizeTypes = "Standard_F64s_v2" + ContainerServiceVMSizeTypesStandardF72SV2 ContainerServiceVMSizeTypes = "Standard_F72s_v2" + ContainerServiceVMSizeTypesStandardF8 ContainerServiceVMSizeTypes = "Standard_F8" + ContainerServiceVMSizeTypesStandardF8S ContainerServiceVMSizeTypes = "Standard_F8s" + ContainerServiceVMSizeTypesStandardF8SV2 ContainerServiceVMSizeTypes = "Standard_F8s_v2" + ContainerServiceVMSizeTypesStandardG1 ContainerServiceVMSizeTypes = "Standard_G1" + ContainerServiceVMSizeTypesStandardG2 ContainerServiceVMSizeTypes = "Standard_G2" + ContainerServiceVMSizeTypesStandardG3 ContainerServiceVMSizeTypes = "Standard_G3" + ContainerServiceVMSizeTypesStandardG4 ContainerServiceVMSizeTypes = "Standard_G4" + ContainerServiceVMSizeTypesStandardG5 ContainerServiceVMSizeTypes = "Standard_G5" + ContainerServiceVMSizeTypesStandardGS1 ContainerServiceVMSizeTypes = "Standard_GS1" + ContainerServiceVMSizeTypesStandardGS2 ContainerServiceVMSizeTypes = "Standard_GS2" + ContainerServiceVMSizeTypesStandardGS3 ContainerServiceVMSizeTypes = "Standard_GS3" + ContainerServiceVMSizeTypesStandardGS4 ContainerServiceVMSizeTypes = "Standard_GS4" + ContainerServiceVMSizeTypesStandardGS44 ContainerServiceVMSizeTypes = "Standard_GS4-4" + ContainerServiceVMSizeTypesStandardGS48 ContainerServiceVMSizeTypes = "Standard_GS4-8" + ContainerServiceVMSizeTypesStandardGS5 ContainerServiceVMSizeTypes = "Standard_GS5" + ContainerServiceVMSizeTypesStandardGS516 ContainerServiceVMSizeTypes = "Standard_GS5-16" + ContainerServiceVMSizeTypesStandardGS58 ContainerServiceVMSizeTypes = "Standard_GS5-8" + ContainerServiceVMSizeTypesStandardH16 ContainerServiceVMSizeTypes = "Standard_H16" + ContainerServiceVMSizeTypesStandardH16M ContainerServiceVMSizeTypes = "Standard_H16m" + ContainerServiceVMSizeTypesStandardH16Mr ContainerServiceVMSizeTypes = "Standard_H16mr" + ContainerServiceVMSizeTypesStandardH16R ContainerServiceVMSizeTypes = "Standard_H16r" + ContainerServiceVMSizeTypesStandardH8 ContainerServiceVMSizeTypes = "Standard_H8" + ContainerServiceVMSizeTypesStandardH8M ContainerServiceVMSizeTypes = "Standard_H8m" + ContainerServiceVMSizeTypesStandardL16S ContainerServiceVMSizeTypes = "Standard_L16s" + ContainerServiceVMSizeTypesStandardL32S ContainerServiceVMSizeTypes = "Standard_L32s" + ContainerServiceVMSizeTypesStandardL4S ContainerServiceVMSizeTypes = "Standard_L4s" + ContainerServiceVMSizeTypesStandardL8S ContainerServiceVMSizeTypes = "Standard_L8s" + ContainerServiceVMSizeTypesStandardM12832Ms ContainerServiceVMSizeTypes = "Standard_M128-32ms" + ContainerServiceVMSizeTypesStandardM12864Ms ContainerServiceVMSizeTypes = "Standard_M128-64ms" + ContainerServiceVMSizeTypesStandardM128Ms ContainerServiceVMSizeTypes = "Standard_M128ms" + ContainerServiceVMSizeTypesStandardM128S ContainerServiceVMSizeTypes = "Standard_M128s" + ContainerServiceVMSizeTypesStandardM6416Ms ContainerServiceVMSizeTypes = "Standard_M64-16ms" + ContainerServiceVMSizeTypesStandardM6432Ms ContainerServiceVMSizeTypes = "Standard_M64-32ms" + ContainerServiceVMSizeTypesStandardM64Ms ContainerServiceVMSizeTypes = "Standard_M64ms" + ContainerServiceVMSizeTypesStandardM64S ContainerServiceVMSizeTypes = "Standard_M64s" + ContainerServiceVMSizeTypesStandardNC12 ContainerServiceVMSizeTypes = "Standard_NC12" + ContainerServiceVMSizeTypesStandardNC12SV2 ContainerServiceVMSizeTypes = "Standard_NC12s_v2" + ContainerServiceVMSizeTypesStandardNC12SV3 ContainerServiceVMSizeTypes = "Standard_NC12s_v3" + ContainerServiceVMSizeTypesStandardNC24 ContainerServiceVMSizeTypes = "Standard_NC24" + ContainerServiceVMSizeTypesStandardNC24R ContainerServiceVMSizeTypes = "Standard_NC24r" + ContainerServiceVMSizeTypesStandardNC24RsV2 ContainerServiceVMSizeTypes = "Standard_NC24rs_v2" + ContainerServiceVMSizeTypesStandardNC24RsV3 ContainerServiceVMSizeTypes = "Standard_NC24rs_v3" + ContainerServiceVMSizeTypesStandardNC24SV2 ContainerServiceVMSizeTypes = "Standard_NC24s_v2" + ContainerServiceVMSizeTypesStandardNC24SV3 ContainerServiceVMSizeTypes = "Standard_NC24s_v3" + ContainerServiceVMSizeTypesStandardNC6 ContainerServiceVMSizeTypes = "Standard_NC6" + ContainerServiceVMSizeTypesStandardNC6SV2 ContainerServiceVMSizeTypes = "Standard_NC6s_v2" + ContainerServiceVMSizeTypesStandardNC6SV3 ContainerServiceVMSizeTypes = "Standard_NC6s_v3" + ContainerServiceVMSizeTypesStandardND12S ContainerServiceVMSizeTypes = "Standard_ND12s" + ContainerServiceVMSizeTypesStandardND24Rs ContainerServiceVMSizeTypes = "Standard_ND24rs" + ContainerServiceVMSizeTypesStandardND24S ContainerServiceVMSizeTypes = "Standard_ND24s" + ContainerServiceVMSizeTypesStandardND6S ContainerServiceVMSizeTypes = "Standard_ND6s" + ContainerServiceVMSizeTypesStandardNV12 ContainerServiceVMSizeTypes = "Standard_NV12" + ContainerServiceVMSizeTypesStandardNV24 ContainerServiceVMSizeTypes = "Standard_NV24" + ContainerServiceVMSizeTypesStandardNV6 ContainerServiceVMSizeTypes = "Standard_NV6" +) + +// PossibleContainerServiceVMSizeTypesValues returns the possible values for the ContainerServiceVMSizeTypes const type. +func PossibleContainerServiceVMSizeTypesValues() []ContainerServiceVMSizeTypes { + return []ContainerServiceVMSizeTypes{ + ContainerServiceVMSizeTypesStandardA1, + ContainerServiceVMSizeTypesStandardA10, + ContainerServiceVMSizeTypesStandardA11, + ContainerServiceVMSizeTypesStandardA1V2, + ContainerServiceVMSizeTypesStandardA2, + ContainerServiceVMSizeTypesStandardA2MV2, + ContainerServiceVMSizeTypesStandardA2V2, + ContainerServiceVMSizeTypesStandardA3, + ContainerServiceVMSizeTypesStandardA4, + ContainerServiceVMSizeTypesStandardA4MV2, + ContainerServiceVMSizeTypesStandardA4V2, + ContainerServiceVMSizeTypesStandardA5, + ContainerServiceVMSizeTypesStandardA6, + ContainerServiceVMSizeTypesStandardA7, + ContainerServiceVMSizeTypesStandardA8, + ContainerServiceVMSizeTypesStandardA8MV2, + ContainerServiceVMSizeTypesStandardA8V2, + ContainerServiceVMSizeTypesStandardA9, + ContainerServiceVMSizeTypesStandardB2Ms, + ContainerServiceVMSizeTypesStandardB2S, + ContainerServiceVMSizeTypesStandardB4Ms, + ContainerServiceVMSizeTypesStandardB8Ms, + ContainerServiceVMSizeTypesStandardD1, + ContainerServiceVMSizeTypesStandardD11, + ContainerServiceVMSizeTypesStandardD11V2, + ContainerServiceVMSizeTypesStandardD11V2Promo, + ContainerServiceVMSizeTypesStandardD12, + ContainerServiceVMSizeTypesStandardD12V2, + ContainerServiceVMSizeTypesStandardD12V2Promo, + ContainerServiceVMSizeTypesStandardD13, + ContainerServiceVMSizeTypesStandardD13V2, + ContainerServiceVMSizeTypesStandardD13V2Promo, + ContainerServiceVMSizeTypesStandardD14, + ContainerServiceVMSizeTypesStandardD14V2, + ContainerServiceVMSizeTypesStandardD14V2Promo, + ContainerServiceVMSizeTypesStandardD15V2, + ContainerServiceVMSizeTypesStandardD16SV3, + ContainerServiceVMSizeTypesStandardD16V3, + ContainerServiceVMSizeTypesStandardD1V2, + ContainerServiceVMSizeTypesStandardD2, + ContainerServiceVMSizeTypesStandardD2SV3, + ContainerServiceVMSizeTypesStandardD2V2, + ContainerServiceVMSizeTypesStandardD2V2Promo, + ContainerServiceVMSizeTypesStandardD2V3, + ContainerServiceVMSizeTypesStandardD3, + ContainerServiceVMSizeTypesStandardD32SV3, + ContainerServiceVMSizeTypesStandardD32V3, + ContainerServiceVMSizeTypesStandardD3V2, + ContainerServiceVMSizeTypesStandardD3V2Promo, + ContainerServiceVMSizeTypesStandardD4, + ContainerServiceVMSizeTypesStandardD4SV3, + ContainerServiceVMSizeTypesStandardD4V2, + ContainerServiceVMSizeTypesStandardD4V2Promo, + ContainerServiceVMSizeTypesStandardD4V3, + ContainerServiceVMSizeTypesStandardD5V2, + ContainerServiceVMSizeTypesStandardD5V2Promo, + ContainerServiceVMSizeTypesStandardD64SV3, + ContainerServiceVMSizeTypesStandardD64V3, + ContainerServiceVMSizeTypesStandardD8SV3, + ContainerServiceVMSizeTypesStandardD8V3, + ContainerServiceVMSizeTypesStandardDS1, + ContainerServiceVMSizeTypesStandardDS11, + ContainerServiceVMSizeTypesStandardDS11V2, + ContainerServiceVMSizeTypesStandardDS11V2Promo, + ContainerServiceVMSizeTypesStandardDS12, + ContainerServiceVMSizeTypesStandardDS12V2, + ContainerServiceVMSizeTypesStandardDS12V2Promo, + ContainerServiceVMSizeTypesStandardDS13, + ContainerServiceVMSizeTypesStandardDS132V2, + ContainerServiceVMSizeTypesStandardDS134V2, + ContainerServiceVMSizeTypesStandardDS13V2, + ContainerServiceVMSizeTypesStandardDS13V2Promo, + ContainerServiceVMSizeTypesStandardDS14, + ContainerServiceVMSizeTypesStandardDS144V2, + ContainerServiceVMSizeTypesStandardDS148V2, + ContainerServiceVMSizeTypesStandardDS14V2, + ContainerServiceVMSizeTypesStandardDS14V2Promo, + ContainerServiceVMSizeTypesStandardDS15V2, + ContainerServiceVMSizeTypesStandardDS1V2, + ContainerServiceVMSizeTypesStandardDS2, + ContainerServiceVMSizeTypesStandardDS2V2, + ContainerServiceVMSizeTypesStandardDS2V2Promo, + ContainerServiceVMSizeTypesStandardDS3, + ContainerServiceVMSizeTypesStandardDS3V2, + ContainerServiceVMSizeTypesStandardDS3V2Promo, + ContainerServiceVMSizeTypesStandardDS4, + ContainerServiceVMSizeTypesStandardDS4V2, + ContainerServiceVMSizeTypesStandardDS4V2Promo, + ContainerServiceVMSizeTypesStandardDS5V2, + ContainerServiceVMSizeTypesStandardDS5V2Promo, + ContainerServiceVMSizeTypesStandardE16SV3, + ContainerServiceVMSizeTypesStandardE16V3, + ContainerServiceVMSizeTypesStandardE2SV3, + ContainerServiceVMSizeTypesStandardE2V3, + ContainerServiceVMSizeTypesStandardE3216SV3, + ContainerServiceVMSizeTypesStandardE328SV3, + ContainerServiceVMSizeTypesStandardE32SV3, + ContainerServiceVMSizeTypesStandardE32V3, + ContainerServiceVMSizeTypesStandardE4SV3, + ContainerServiceVMSizeTypesStandardE4V3, + ContainerServiceVMSizeTypesStandardE6416SV3, + ContainerServiceVMSizeTypesStandardE6432SV3, + ContainerServiceVMSizeTypesStandardE64SV3, + ContainerServiceVMSizeTypesStandardE64V3, + ContainerServiceVMSizeTypesStandardE8SV3, + ContainerServiceVMSizeTypesStandardE8V3, + ContainerServiceVMSizeTypesStandardF1, + ContainerServiceVMSizeTypesStandardF16, + ContainerServiceVMSizeTypesStandardF16S, + ContainerServiceVMSizeTypesStandardF16SV2, + ContainerServiceVMSizeTypesStandardF1S, + ContainerServiceVMSizeTypesStandardF2, + ContainerServiceVMSizeTypesStandardF2S, + ContainerServiceVMSizeTypesStandardF2SV2, + ContainerServiceVMSizeTypesStandardF32SV2, + ContainerServiceVMSizeTypesStandardF4, + ContainerServiceVMSizeTypesStandardF4S, + ContainerServiceVMSizeTypesStandardF4SV2, + ContainerServiceVMSizeTypesStandardF64SV2, + ContainerServiceVMSizeTypesStandardF72SV2, + ContainerServiceVMSizeTypesStandardF8, + ContainerServiceVMSizeTypesStandardF8S, + ContainerServiceVMSizeTypesStandardF8SV2, + ContainerServiceVMSizeTypesStandardG1, + ContainerServiceVMSizeTypesStandardG2, + ContainerServiceVMSizeTypesStandardG3, + ContainerServiceVMSizeTypesStandardG4, + ContainerServiceVMSizeTypesStandardG5, + ContainerServiceVMSizeTypesStandardGS1, + ContainerServiceVMSizeTypesStandardGS2, + ContainerServiceVMSizeTypesStandardGS3, + ContainerServiceVMSizeTypesStandardGS4, + ContainerServiceVMSizeTypesStandardGS44, + ContainerServiceVMSizeTypesStandardGS48, + ContainerServiceVMSizeTypesStandardGS5, + ContainerServiceVMSizeTypesStandardGS516, + ContainerServiceVMSizeTypesStandardGS58, + ContainerServiceVMSizeTypesStandardH16, + ContainerServiceVMSizeTypesStandardH16M, + ContainerServiceVMSizeTypesStandardH16Mr, + ContainerServiceVMSizeTypesStandardH16R, + ContainerServiceVMSizeTypesStandardH8, + ContainerServiceVMSizeTypesStandardH8M, + ContainerServiceVMSizeTypesStandardL16S, + ContainerServiceVMSizeTypesStandardL32S, + ContainerServiceVMSizeTypesStandardL4S, + ContainerServiceVMSizeTypesStandardL8S, + ContainerServiceVMSizeTypesStandardM12832Ms, + ContainerServiceVMSizeTypesStandardM12864Ms, + ContainerServiceVMSizeTypesStandardM128Ms, + ContainerServiceVMSizeTypesStandardM128S, + ContainerServiceVMSizeTypesStandardM6416Ms, + ContainerServiceVMSizeTypesStandardM6432Ms, + ContainerServiceVMSizeTypesStandardM64Ms, + ContainerServiceVMSizeTypesStandardM64S, + ContainerServiceVMSizeTypesStandardNC12, + ContainerServiceVMSizeTypesStandardNC12SV2, + ContainerServiceVMSizeTypesStandardNC12SV3, + ContainerServiceVMSizeTypesStandardNC24, + ContainerServiceVMSizeTypesStandardNC24R, + ContainerServiceVMSizeTypesStandardNC24RsV2, + ContainerServiceVMSizeTypesStandardNC24RsV3, + ContainerServiceVMSizeTypesStandardNC24SV2, + ContainerServiceVMSizeTypesStandardNC24SV3, + ContainerServiceVMSizeTypesStandardNC6, + ContainerServiceVMSizeTypesStandardNC6SV2, + ContainerServiceVMSizeTypesStandardNC6SV3, + ContainerServiceVMSizeTypesStandardND12S, + ContainerServiceVMSizeTypesStandardND24Rs, + ContainerServiceVMSizeTypesStandardND24S, + ContainerServiceVMSizeTypesStandardND6S, + ContainerServiceVMSizeTypesStandardNV12, + ContainerServiceVMSizeTypesStandardNV24, + ContainerServiceVMSizeTypesStandardNV6, + } +} + +// ToPtr returns a *ContainerServiceVMSizeTypes pointing to the current value. +func (c ContainerServiceVMSizeTypes) ToPtr() *ContainerServiceVMSizeTypes { + return &c +} + +// Count - Number of masters (VMs) in the container service cluster. Allowed values are 1, 3, and 5. The default value is 1. +type Count int32 + +const ( + CountOne Count = 1 + CountThree Count = 3 + CountFive Count = 5 +) + +// PossibleCountValues returns the possible values for the Count const type. +func PossibleCountValues() []Count { + return []Count{ + CountOne, + CountThree, + CountFive, + } +} + +// ToPtr returns a *Count pointing to the current value. +func (c Count) ToPtr() *Count { + return &c +} + +// CreatedByType - The type of identity that created the resource. +type CreatedByType string + +const ( + CreatedByTypeApplication CreatedByType = "Application" + CreatedByTypeKey CreatedByType = "Key" + CreatedByTypeManagedIdentity CreatedByType = "ManagedIdentity" + CreatedByTypeUser CreatedByType = "User" +) + +// PossibleCreatedByTypeValues returns the possible values for the CreatedByType const type. +func PossibleCreatedByTypeValues() []CreatedByType { + return []CreatedByType{ + CreatedByTypeApplication, + CreatedByTypeKey, + CreatedByTypeManagedIdentity, + CreatedByTypeUser, + } +} + +// ToPtr returns a *CreatedByType pointing to the current value. +func (c CreatedByType) ToPtr() *CreatedByType { + return &c +} + +// Expander - If not specified, the default is 'random'. See expanders [https://github.com/kubernetes/autoscaler/blob/master/cluster-autoscaler/FAQ.md#what-are-expanders] +// for more information. +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 the possible values for the Expander const type. +func PossibleExpanderValues() []Expander { + return []Expander{ + ExpanderLeastWaste, + ExpanderMostPods, + ExpanderPriority, + ExpanderRandom, + } +} + +// ToPtr returns a *Expander pointing to the current value. +func (c Expander) ToPtr() *Expander { + return &c +} + +// ExtendedLocationTypes - The type of extendedLocation. +type ExtendedLocationTypes string + +const ( + ExtendedLocationTypesEdgeZone ExtendedLocationTypes = "EdgeZone" +) + +// PossibleExtendedLocationTypesValues returns the possible values for the ExtendedLocationTypes const type. +func PossibleExtendedLocationTypesValues() []ExtendedLocationTypes { + return []ExtendedLocationTypes{ + ExtendedLocationTypesEdgeZone, + } +} + +// ToPtr returns a *ExtendedLocationTypes pointing to the current value. +func (c ExtendedLocationTypes) ToPtr() *ExtendedLocationTypes { + return &c +} + +// GPUInstanceProfile - GPUInstanceProfile to be used to specify GPU MIG instance profile for supported GPU VM SKU. +type GPUInstanceProfile string + +const ( + GPUInstanceProfileMIG1G GPUInstanceProfile = "MIG1g" + GPUInstanceProfileMIG2G GPUInstanceProfile = "MIG2g" + GPUInstanceProfileMIG3G GPUInstanceProfile = "MIG3g" + GPUInstanceProfileMIG4G GPUInstanceProfile = "MIG4g" + GPUInstanceProfileMIG7G GPUInstanceProfile = "MIG7g" +) + +// PossibleGPUInstanceProfileValues returns the possible values for the GPUInstanceProfile const type. +func PossibleGPUInstanceProfileValues() []GPUInstanceProfile { + return []GPUInstanceProfile{ + GPUInstanceProfileMIG1G, + GPUInstanceProfileMIG2G, + GPUInstanceProfileMIG3G, + GPUInstanceProfileMIG4G, + GPUInstanceProfileMIG7G, + } +} + +// ToPtr returns a *GPUInstanceProfile pointing to the current value. +func (c GPUInstanceProfile) ToPtr() *GPUInstanceProfile { + return &c +} + +// KubeletDiskType - Determines the placement of emptyDir volumes, container runtime data root, and Kubelet ephemeral storage. +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 the possible values for the KubeletDiskType const type. +func PossibleKubeletDiskTypeValues() []KubeletDiskType { + return []KubeletDiskType{ + KubeletDiskTypeOS, + KubeletDiskTypeTemporary, + } +} + +// ToPtr returns a *KubeletDiskType pointing to the current value. +func (c KubeletDiskType) ToPtr() *KubeletDiskType { + return &c +} + +// LicenseType - The license type to use for Windows VMs. See Azure Hybrid User Benefits [https://azure.microsoft.com/pricing/hybrid-benefit/faq/] for more +// details. +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 the possible values for the LicenseType const type. +func PossibleLicenseTypeValues() []LicenseType { + return []LicenseType{ + LicenseTypeNone, + LicenseTypeWindowsServer, + } +} + +// ToPtr returns a *LicenseType pointing to the current value. +func (c LicenseType) ToPtr() *LicenseType { + return &c +} + +// LoadBalancerSKU - The default is 'standard'. See Azure Load Balancer SKUs [https://docs.microsoft.com/azure/load-balancer/skus] for more information +// about the differences between load balancer SKUs. +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 the possible values for the LoadBalancerSKU const type. +func PossibleLoadBalancerSKUValues() []LoadBalancerSKU { + return []LoadBalancerSKU{ + LoadBalancerSKUBasic, + LoadBalancerSKUStandard, + } +} + +// ToPtr returns a *LoadBalancerSKU pointing to the current value. +func (c LoadBalancerSKU) ToPtr() *LoadBalancerSKU { + return &c +} + +// ManagedClusterPodIdentityProvisioningState - The current provisioning state of the pod identity. +type ManagedClusterPodIdentityProvisioningState string + +const ( + ManagedClusterPodIdentityProvisioningStateAssigned ManagedClusterPodIdentityProvisioningState = "Assigned" + ManagedClusterPodIdentityProvisioningStateDeleting ManagedClusterPodIdentityProvisioningState = "Deleting" + ManagedClusterPodIdentityProvisioningStateFailed ManagedClusterPodIdentityProvisioningState = "Failed" + ManagedClusterPodIdentityProvisioningStateUpdating ManagedClusterPodIdentityProvisioningState = "Updating" +) + +// PossibleManagedClusterPodIdentityProvisioningStateValues returns the possible values for the ManagedClusterPodIdentityProvisioningState const type. +func PossibleManagedClusterPodIdentityProvisioningStateValues() []ManagedClusterPodIdentityProvisioningState { + return []ManagedClusterPodIdentityProvisioningState{ + ManagedClusterPodIdentityProvisioningStateAssigned, + ManagedClusterPodIdentityProvisioningStateDeleting, + ManagedClusterPodIdentityProvisioningStateFailed, + ManagedClusterPodIdentityProvisioningStateUpdating, + } +} + +// ToPtr returns a *ManagedClusterPodIdentityProvisioningState pointing to the current value. +func (c ManagedClusterPodIdentityProvisioningState) ToPtr() *ManagedClusterPodIdentityProvisioningState { + return &c +} + +// ManagedClusterSKUName - The name of a managed cluster SKU. +type ManagedClusterSKUName string + +const ( + ManagedClusterSKUNameBasic ManagedClusterSKUName = "Basic" +) + +// PossibleManagedClusterSKUNameValues returns the possible values for the ManagedClusterSKUName const type. +func PossibleManagedClusterSKUNameValues() []ManagedClusterSKUName { + return []ManagedClusterSKUName{ + ManagedClusterSKUNameBasic, + } +} + +// ToPtr returns a *ManagedClusterSKUName pointing to the current value. +func (c ManagedClusterSKUName) ToPtr() *ManagedClusterSKUName { + return &c +} + +// ManagedClusterSKUTier - If not specified, the default is 'Free'. See uptime SLA [https://docs.microsoft.com/azure/aks/uptime-sla] for more details. +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 the possible values for the ManagedClusterSKUTier const type. +func PossibleManagedClusterSKUTierValues() []ManagedClusterSKUTier { + return []ManagedClusterSKUTier{ + ManagedClusterSKUTierFree, + ManagedClusterSKUTierPaid, + } +} + +// ToPtr returns a *ManagedClusterSKUTier pointing to the current value. +func (c ManagedClusterSKUTier) ToPtr() *ManagedClusterSKUTier { + return &c +} + +// NetworkMode - This cannot be specified if networkPlugin is anything other than 'azure'. +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 the possible values for the NetworkMode const type. +func PossibleNetworkModeValues() []NetworkMode { + return []NetworkMode{ + NetworkModeBridge, + NetworkModeTransparent, + } +} + +// ToPtr returns a *NetworkMode pointing to the current value. +func (c NetworkMode) ToPtr() *NetworkMode { + return &c +} + +// NetworkPlugin - Network plugin used for building the Kubernetes network. +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 the possible values for the NetworkPlugin const type. +func PossibleNetworkPluginValues() []NetworkPlugin { + return []NetworkPlugin{ + NetworkPluginAzure, + NetworkPluginKubenet, + } +} + +// ToPtr returns a *NetworkPlugin pointing to the current value. +func (c NetworkPlugin) ToPtr() *NetworkPlugin { + return &c +} + +// NetworkPolicy - Network policy used for building the Kubernetes network. +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 the possible values for the NetworkPolicy const type. +func PossibleNetworkPolicyValues() []NetworkPolicy { + return []NetworkPolicy{ + NetworkPolicyAzure, + NetworkPolicyCalico, + } +} + +// ToPtr returns a *NetworkPolicy pointing to the current value. +func (c NetworkPolicy) ToPtr() *NetworkPolicy { + return &c +} + +// OSDiskType - The default is 'Ephemeral' if the VM supports it and has a cache disk larger than the requested OSDiskSizeGB. Otherwise, defaults to 'Managed'. +// May not be changed after creation. For more information +// see Ephemeral OS [https://docs.microsoft.com/azure/aks/cluster-configuration#ephemeral-os]. +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 the possible values for the OSDiskType const type. +func PossibleOSDiskTypeValues() []OSDiskType { + return []OSDiskType{ + OSDiskTypeEphemeral, + OSDiskTypeManaged, + } +} + +// ToPtr returns a *OSDiskType pointing to the current value. +func (c OSDiskType) ToPtr() *OSDiskType { + return &c +} + +// OSSKU - Specifies an OS SKU. This value must not be specified if OSType is Windows. +type OSSKU string + +const ( + OSSKUCBLMariner OSSKU = "CBLMariner" + OSSKUUbuntu OSSKU = "Ubuntu" +) + +// PossibleOSSKUValues returns the possible values for the OSSKU const type. +func PossibleOSSKUValues() []OSSKU { + return []OSSKU{ + OSSKUCBLMariner, + OSSKUUbuntu, + } +} + +// ToPtr returns a *OSSKU pointing to the current value. +func (c OSSKU) ToPtr() *OSSKU { + return &c +} + +// OSType - The operating system type. The default is Linux. +type OSType string + +const ( + // OSTypeLinux - Use Linux. + OSTypeLinux OSType = "Linux" + // OSTypeWindows - Use Windows. + OSTypeWindows OSType = "Windows" +) + +// PossibleOSTypeValues returns the possible values for the OSType const type. +func PossibleOSTypeValues() []OSType { + return []OSType{ + OSTypeLinux, + OSTypeWindows, + } +} + +// ToPtr returns a *OSType pointing to the current value. +func (c OSType) ToPtr() *OSType { + return &c +} + +// OutboundType - This can only be set at cluster creation time and cannot be changed later. For more information see egress outbound type [https://docs.microsoft.com/azure/aks/egress-outboundtype]. +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 the possible values for the OutboundType const type. +func PossibleOutboundTypeValues() []OutboundType { + return []OutboundType{ + OutboundTypeLoadBalancer, + OutboundTypeManagedNATGateway, + OutboundTypeUserAssignedNATGateway, + OutboundTypeUserDefinedRouting, + } +} + +// ToPtr returns a *OutboundType pointing to the current value. +func (c OutboundType) ToPtr() *OutboundType { + return &c +} + +// PrivateEndpointConnectionProvisioningState - The current provisioning state. +type PrivateEndpointConnectionProvisioningState string + +const ( + PrivateEndpointConnectionProvisioningStateCreating PrivateEndpointConnectionProvisioningState = "Creating" + PrivateEndpointConnectionProvisioningStateDeleting PrivateEndpointConnectionProvisioningState = "Deleting" + PrivateEndpointConnectionProvisioningStateFailed PrivateEndpointConnectionProvisioningState = "Failed" + PrivateEndpointConnectionProvisioningStateSucceeded PrivateEndpointConnectionProvisioningState = "Succeeded" +) + +// PossiblePrivateEndpointConnectionProvisioningStateValues returns the possible values for the PrivateEndpointConnectionProvisioningState const type. +func PossiblePrivateEndpointConnectionProvisioningStateValues() []PrivateEndpointConnectionProvisioningState { + return []PrivateEndpointConnectionProvisioningState{ + PrivateEndpointConnectionProvisioningStateCreating, + PrivateEndpointConnectionProvisioningStateDeleting, + PrivateEndpointConnectionProvisioningStateFailed, + PrivateEndpointConnectionProvisioningStateSucceeded, + } +} + +// ToPtr returns a *PrivateEndpointConnectionProvisioningState pointing to the current value. +func (c PrivateEndpointConnectionProvisioningState) ToPtr() *PrivateEndpointConnectionProvisioningState { + return &c +} + +// ResourceIdentityType - For more information see use managed identities in AKS [https://docs.microsoft.com/azure/aks/use-managed-identity]. +type ResourceIdentityType string + +const ( + // 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" + // ResourceIdentityTypeNone - Do not use a managed identity for the Managed Cluster, service principal will be used instead. + ResourceIdentityTypeNone ResourceIdentityType = "None" +) + +// PossibleResourceIdentityTypeValues returns the possible values for the ResourceIdentityType const type. +func PossibleResourceIdentityTypeValues() []ResourceIdentityType { + return []ResourceIdentityType{ + ResourceIdentityTypeSystemAssigned, + ResourceIdentityTypeUserAssigned, + ResourceIdentityTypeNone, + } +} + +// ToPtr returns a *ResourceIdentityType pointing to the current value. +func (c ResourceIdentityType) ToPtr() *ResourceIdentityType { + return &c +} + +// ScaleDownMode - Describes how VMs are added to or removed from Agent Pools. See billing states [https://docs.microsoft.com/azure/virtual-machines/states-billing]. +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 the possible values for the ScaleDownMode const type. +func PossibleScaleDownModeValues() []ScaleDownMode { + return []ScaleDownMode{ + ScaleDownModeDeallocate, + ScaleDownModeDelete, + } +} + +// ToPtr returns a *ScaleDownMode pointing to the current value. +func (c ScaleDownMode) ToPtr() *ScaleDownMode { + return &c +} + +// ScaleSetEvictionPolicy - The eviction policy specifies what to do with the VM when it is evicted. The default is Delete. For more information about eviction +// see spot VMs +// [https://docs.microsoft.com/azure/virtual-machines/spot-vms] +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 the possible values for the ScaleSetEvictionPolicy const type. +func PossibleScaleSetEvictionPolicyValues() []ScaleSetEvictionPolicy { + return []ScaleSetEvictionPolicy{ + ScaleSetEvictionPolicyDeallocate, + ScaleSetEvictionPolicyDelete, + } +} + +// ToPtr returns a *ScaleSetEvictionPolicy pointing to the current value. +func (c ScaleSetEvictionPolicy) ToPtr() *ScaleSetEvictionPolicy { + return &c +} + +// ScaleSetPriority - The Virtual Machine 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 the possible values for the ScaleSetPriority const type. +func PossibleScaleSetPriorityValues() []ScaleSetPriority { + return []ScaleSetPriority{ + ScaleSetPriorityRegular, + ScaleSetPrioritySpot, + } +} + +// ToPtr returns a *ScaleSetPriority pointing to the current value. +func (c ScaleSetPriority) ToPtr() *ScaleSetPriority { + return &c +} + +// UpgradeChannel - For more information see setting the AKS cluster auto-upgrade channel [https://docs.microsoft.com/azure/aks/upgrade-cluster#set-auto-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 the possible values for the UpgradeChannel const type. +func PossibleUpgradeChannelValues() []UpgradeChannel { + return []UpgradeChannel{ + UpgradeChannelNodeImage, + UpgradeChannelNone, + UpgradeChannelPatch, + UpgradeChannelRapid, + UpgradeChannelStable, + } +} + +// ToPtr returns a *UpgradeChannel pointing to the current value. +func (c UpgradeChannel) ToPtr() *UpgradeChannel { + return &c +} + +// WeekDay - The weekday enum. +type WeekDay string + +const ( + WeekDayFriday WeekDay = "Friday" + WeekDayMonday WeekDay = "Monday" + WeekDaySaturday WeekDay = "Saturday" + WeekDaySunday WeekDay = "Sunday" + WeekDayThursday WeekDay = "Thursday" + WeekDayTuesday WeekDay = "Tuesday" + WeekDayWednesday WeekDay = "Wednesday" +) + +// PossibleWeekDayValues returns the possible values for the WeekDay const type. +func PossibleWeekDayValues() []WeekDay { + return []WeekDay{ + WeekDayFriday, + WeekDayMonday, + WeekDaySaturday, + WeekDaySunday, + WeekDayThursday, + WeekDayTuesday, + WeekDayWednesday, + } +} + +// ToPtr returns a *WeekDay pointing to the current value. +func (c WeekDay) ToPtr() *WeekDay { + return &c +} diff --git a/sdk/containerservice/armcontainerservice/zz_generated_maintenanceconfigurations_client.go b/sdk/containerservice/armcontainerservice/zz_generated_maintenanceconfigurations_client.go new file mode 100644 index 000000000000..abadbf3ce79f --- /dev/null +++ b/sdk/containerservice/armcontainerservice/zz_generated_maintenanceconfigurations_client.go @@ -0,0 +1,295 @@ +// +build go1.13 + +// 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. + +package armcontainerservice + +import ( + "context" + "errors" + "fmt" + "github.com/Azure/azure-sdk-for-go/sdk/armcore" + "github.com/Azure/azure-sdk-for-go/sdk/azcore" + "net/http" + "net/url" + "strings" +) + +// MaintenanceConfigurationsClient contains the methods for the MaintenanceConfigurations group. +// Don't use this type directly, use NewMaintenanceConfigurationsClient() instead. +type MaintenanceConfigurationsClient struct { + con *armcore.Connection + subscriptionID string +} + +// NewMaintenanceConfigurationsClient creates a new instance of MaintenanceConfigurationsClient with the specified values. +func NewMaintenanceConfigurationsClient(con *armcore.Connection, subscriptionID string) *MaintenanceConfigurationsClient { + return &MaintenanceConfigurationsClient{con: con, subscriptionID: subscriptionID} +} + +// CreateOrUpdate - Creates or updates a maintenance configuration in the specified managed cluster. +// If the operation fails it returns the *CloudError error type. +func (client *MaintenanceConfigurationsClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, resourceName string, configName string, parameters MaintenanceConfiguration, options *MaintenanceConfigurationsCreateOrUpdateOptions) (MaintenanceConfigurationsCreateOrUpdateResponse, error) { + req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, resourceName, configName, parameters, options) + if err != nil { + return MaintenanceConfigurationsCreateOrUpdateResponse{}, err + } + resp, err := client.con.Pipeline().Do(req) + if err != nil { + return MaintenanceConfigurationsCreateOrUpdateResponse{}, err + } + if !resp.HasStatusCode(http.StatusOK) { + return MaintenanceConfigurationsCreateOrUpdateResponse{}, client.createOrUpdateHandleError(resp) + } + return client.createOrUpdateHandleResponse(resp) +} + +// createOrUpdateCreateRequest creates the CreateOrUpdate request. +func (client *MaintenanceConfigurationsClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, resourceName string, configName string, parameters MaintenanceConfiguration, options *MaintenanceConfigurationsCreateOrUpdateOptions) (*azcore.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/maintenanceConfigurations/{configName}" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if resourceName == "" { + return nil, errors.New("parameter resourceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceName}", url.PathEscape(resourceName)) + if configName == "" { + return nil, errors.New("parameter configName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{configName}", url.PathEscape(configName)) + req, err := azcore.NewRequest(ctx, http.MethodPut, azcore.JoinPaths(client.con.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + req.Telemetry(telemetryInfo) + reqQP := req.URL.Query() + reqQP.Set("api-version", "2021-07-01") + req.URL.RawQuery = reqQP.Encode() + req.Header.Set("Accept", "application/json") + return req, req.MarshalAsJSON(parameters) +} + +// createOrUpdateHandleResponse handles the CreateOrUpdate response. +func (client *MaintenanceConfigurationsClient) createOrUpdateHandleResponse(resp *azcore.Response) (MaintenanceConfigurationsCreateOrUpdateResponse, error) { + result := MaintenanceConfigurationsCreateOrUpdateResponse{RawResponse: resp.Response} + if err := resp.UnmarshalAsJSON(&result.MaintenanceConfiguration); err != nil { + return MaintenanceConfigurationsCreateOrUpdateResponse{}, err + } + return result, nil +} + +// createOrUpdateHandleError handles the CreateOrUpdate error response. +func (client *MaintenanceConfigurationsClient) createOrUpdateHandleError(resp *azcore.Response) error { + body, err := resp.Payload() + if err != nil { + return azcore.NewResponseError(err, resp.Response) + } + errType := CloudError{raw: string(body)} + if err := resp.UnmarshalAsJSON(&errType); err != nil { + return azcore.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp.Response) + } + return azcore.NewResponseError(&errType, resp.Response) +} + +// Delete - Deletes a maintenance configuration. +// If the operation fails it returns the *CloudError error type. +func (client *MaintenanceConfigurationsClient) Delete(ctx context.Context, resourceGroupName string, resourceName string, configName string, options *MaintenanceConfigurationsDeleteOptions) (MaintenanceConfigurationsDeleteResponse, error) { + req, err := client.deleteCreateRequest(ctx, resourceGroupName, resourceName, configName, options) + if err != nil { + return MaintenanceConfigurationsDeleteResponse{}, err + } + resp, err := client.con.Pipeline().Do(req) + if err != nil { + return MaintenanceConfigurationsDeleteResponse{}, err + } + if !resp.HasStatusCode(http.StatusOK, http.StatusNoContent) { + return MaintenanceConfigurationsDeleteResponse{}, client.deleteHandleError(resp) + } + return MaintenanceConfigurationsDeleteResponse{RawResponse: resp.Response}, nil +} + +// deleteCreateRequest creates the Delete request. +func (client *MaintenanceConfigurationsClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, resourceName string, configName string, options *MaintenanceConfigurationsDeleteOptions) (*azcore.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/maintenanceConfigurations/{configName}" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if resourceName == "" { + return nil, errors.New("parameter resourceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceName}", url.PathEscape(resourceName)) + if configName == "" { + return nil, errors.New("parameter configName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{configName}", url.PathEscape(configName)) + req, err := azcore.NewRequest(ctx, http.MethodDelete, azcore.JoinPaths(client.con.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + req.Telemetry(telemetryInfo) + reqQP := req.URL.Query() + reqQP.Set("api-version", "2021-07-01") + req.URL.RawQuery = reqQP.Encode() + req.Header.Set("Accept", "application/json") + return req, nil +} + +// deleteHandleError handles the Delete error response. +func (client *MaintenanceConfigurationsClient) deleteHandleError(resp *azcore.Response) error { + body, err := resp.Payload() + if err != nil { + return azcore.NewResponseError(err, resp.Response) + } + errType := CloudError{raw: string(body)} + if err := resp.UnmarshalAsJSON(&errType); err != nil { + return azcore.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp.Response) + } + return azcore.NewResponseError(&errType, resp.Response) +} + +// Get - Gets the specified maintenance configuration of a managed cluster. +// If the operation fails it returns the *CloudError error type. +func (client *MaintenanceConfigurationsClient) Get(ctx context.Context, resourceGroupName string, resourceName string, configName string, options *MaintenanceConfigurationsGetOptions) (MaintenanceConfigurationsGetResponse, error) { + req, err := client.getCreateRequest(ctx, resourceGroupName, resourceName, configName, options) + if err != nil { + return MaintenanceConfigurationsGetResponse{}, err + } + resp, err := client.con.Pipeline().Do(req) + if err != nil { + return MaintenanceConfigurationsGetResponse{}, err + } + if !resp.HasStatusCode(http.StatusOK) { + return MaintenanceConfigurationsGetResponse{}, client.getHandleError(resp) + } + return client.getHandleResponse(resp) +} + +// getCreateRequest creates the Get request. +func (client *MaintenanceConfigurationsClient) getCreateRequest(ctx context.Context, resourceGroupName string, resourceName string, configName string, options *MaintenanceConfigurationsGetOptions) (*azcore.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/maintenanceConfigurations/{configName}" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if resourceName == "" { + return nil, errors.New("parameter resourceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceName}", url.PathEscape(resourceName)) + if configName == "" { + return nil, errors.New("parameter configName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{configName}", url.PathEscape(configName)) + req, err := azcore.NewRequest(ctx, http.MethodGet, azcore.JoinPaths(client.con.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + req.Telemetry(telemetryInfo) + reqQP := req.URL.Query() + reqQP.Set("api-version", "2021-07-01") + req.URL.RawQuery = reqQP.Encode() + req.Header.Set("Accept", "application/json") + return req, nil +} + +// getHandleResponse handles the Get response. +func (client *MaintenanceConfigurationsClient) getHandleResponse(resp *azcore.Response) (MaintenanceConfigurationsGetResponse, error) { + result := MaintenanceConfigurationsGetResponse{RawResponse: resp.Response} + if err := resp.UnmarshalAsJSON(&result.MaintenanceConfiguration); err != nil { + return MaintenanceConfigurationsGetResponse{}, err + } + return result, nil +} + +// getHandleError handles the Get error response. +func (client *MaintenanceConfigurationsClient) getHandleError(resp *azcore.Response) error { + body, err := resp.Payload() + if err != nil { + return azcore.NewResponseError(err, resp.Response) + } + errType := CloudError{raw: string(body)} + if err := resp.UnmarshalAsJSON(&errType); err != nil { + return azcore.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp.Response) + } + return azcore.NewResponseError(&errType, resp.Response) +} + +// ListByManagedCluster - Gets a list of maintenance configurations in the specified managed cluster. +// If the operation fails it returns the *CloudError error type. +func (client *MaintenanceConfigurationsClient) ListByManagedCluster(resourceGroupName string, resourceName string, options *MaintenanceConfigurationsListByManagedClusterOptions) MaintenanceConfigurationsListByManagedClusterPager { + return &maintenanceConfigurationsListByManagedClusterPager{ + client: client, + requester: func(ctx context.Context) (*azcore.Request, error) { + return client.listByManagedClusterCreateRequest(ctx, resourceGroupName, resourceName, options) + }, + advancer: func(ctx context.Context, resp MaintenanceConfigurationsListByManagedClusterResponse) (*azcore.Request, error) { + return azcore.NewRequest(ctx, http.MethodGet, *resp.MaintenanceConfigurationListResult.NextLink) + }, + } +} + +// listByManagedClusterCreateRequest creates the ListByManagedCluster request. +func (client *MaintenanceConfigurationsClient) listByManagedClusterCreateRequest(ctx context.Context, resourceGroupName string, resourceName string, options *MaintenanceConfigurationsListByManagedClusterOptions) (*azcore.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/maintenanceConfigurations" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if resourceName == "" { + return nil, errors.New("parameter resourceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceName}", url.PathEscape(resourceName)) + req, err := azcore.NewRequest(ctx, http.MethodGet, azcore.JoinPaths(client.con.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + req.Telemetry(telemetryInfo) + reqQP := req.URL.Query() + reqQP.Set("api-version", "2021-07-01") + req.URL.RawQuery = reqQP.Encode() + req.Header.Set("Accept", "application/json") + return req, nil +} + +// listByManagedClusterHandleResponse handles the ListByManagedCluster response. +func (client *MaintenanceConfigurationsClient) listByManagedClusterHandleResponse(resp *azcore.Response) (MaintenanceConfigurationsListByManagedClusterResponse, error) { + result := MaintenanceConfigurationsListByManagedClusterResponse{RawResponse: resp.Response} + if err := resp.UnmarshalAsJSON(&result.MaintenanceConfigurationListResult); err != nil { + return MaintenanceConfigurationsListByManagedClusterResponse{}, err + } + return result, nil +} + +// listByManagedClusterHandleError handles the ListByManagedCluster error response. +func (client *MaintenanceConfigurationsClient) listByManagedClusterHandleError(resp *azcore.Response) error { + body, err := resp.Payload() + if err != nil { + return azcore.NewResponseError(err, resp.Response) + } + errType := CloudError{raw: string(body)} + if err := resp.UnmarshalAsJSON(&errType); err != nil { + return azcore.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp.Response) + } + return azcore.NewResponseError(&errType, resp.Response) +} diff --git a/sdk/containerservice/armcontainerservice/zz_generated_managedclusters_client.go b/sdk/containerservice/armcontainerservice/zz_generated_managedclusters_client.go new file mode 100644 index 000000000000..87f1c66fa72f --- /dev/null +++ b/sdk/containerservice/armcontainerservice/zz_generated_managedclusters_client.go @@ -0,0 +1,1711 @@ +// +build go1.13 + +// 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. + +package armcontainerservice + +import ( + "context" + "errors" + "fmt" + "github.com/Azure/azure-sdk-for-go/sdk/armcore" + "github.com/Azure/azure-sdk-for-go/sdk/azcore" + "net/http" + "net/url" + "strings" + "time" +) + +// ManagedClustersClient contains the methods for the ManagedClusters group. +// Don't use this type directly, use NewManagedClustersClient() instead. +type ManagedClustersClient struct { + con *armcore.Connection + subscriptionID string +} + +// NewManagedClustersClient creates a new instance of ManagedClustersClient with the specified values. +func NewManagedClustersClient(con *armcore.Connection, subscriptionID string) *ManagedClustersClient { + return &ManagedClustersClient{con: con, subscriptionID: subscriptionID} +} + +// BeginCreateOrUpdate - Creates or updates a managed cluster. +// If the operation fails it returns the *CloudError error type. +func (client *ManagedClustersClient) BeginCreateOrUpdate(ctx context.Context, resourceGroupName string, resourceName string, parameters ManagedCluster, options *ManagedClustersBeginCreateOrUpdateOptions) (ManagedClustersCreateOrUpdatePollerResponse, error) { + resp, err := client.createOrUpdate(ctx, resourceGroupName, resourceName, parameters, options) + if err != nil { + return ManagedClustersCreateOrUpdatePollerResponse{}, err + } + result := ManagedClustersCreateOrUpdatePollerResponse{ + RawResponse: resp.Response, + } + pt, err := armcore.NewLROPoller("ManagedClustersClient.CreateOrUpdate", "", resp, client.con.Pipeline(), client.createOrUpdateHandleError) + if err != nil { + return ManagedClustersCreateOrUpdatePollerResponse{}, err + } + poller := &managedClustersCreateOrUpdatePoller{ + pt: pt, + } + result.Poller = poller + result.PollUntilDone = func(ctx context.Context, frequency time.Duration) (ManagedClustersCreateOrUpdateResponse, error) { + return poller.pollUntilDone(ctx, frequency) + } + return result, nil +} + +// ResumeCreateOrUpdate creates a new ManagedClustersCreateOrUpdatePoller from the specified resume token. +// token - The value must come from a previous call to ManagedClustersCreateOrUpdatePoller.ResumeToken(). +func (client *ManagedClustersClient) ResumeCreateOrUpdate(ctx context.Context, token string) (ManagedClustersCreateOrUpdatePollerResponse, error) { + pt, err := armcore.NewLROPollerFromResumeToken("ManagedClustersClient.CreateOrUpdate", token, client.con.Pipeline(), client.createOrUpdateHandleError) + if err != nil { + return ManagedClustersCreateOrUpdatePollerResponse{}, err + } + poller := &managedClustersCreateOrUpdatePoller{ + pt: pt, + } + resp, err := poller.Poll(ctx) + if err != nil { + return ManagedClustersCreateOrUpdatePollerResponse{}, err + } + result := ManagedClustersCreateOrUpdatePollerResponse{ + RawResponse: resp, + } + result.Poller = poller + result.PollUntilDone = func(ctx context.Context, frequency time.Duration) (ManagedClustersCreateOrUpdateResponse, error) { + return poller.pollUntilDone(ctx, frequency) + } + return result, nil +} + +// CreateOrUpdate - Creates or updates a managed cluster. +// If the operation fails it returns the *CloudError error type. +func (client *ManagedClustersClient) createOrUpdate(ctx context.Context, resourceGroupName string, resourceName string, parameters ManagedCluster, options *ManagedClustersBeginCreateOrUpdateOptions) (*azcore.Response, error) { + req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, resourceName, parameters, options) + if err != nil { + return nil, err + } + resp, err := client.con.Pipeline().Do(req) + if err != nil { + return nil, err + } + if !resp.HasStatusCode(http.StatusOK, http.StatusCreated) { + return nil, client.createOrUpdateHandleError(resp) + } + return resp, nil +} + +// createOrUpdateCreateRequest creates the CreateOrUpdate request. +func (client *ManagedClustersClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, resourceName string, parameters ManagedCluster, options *ManagedClustersBeginCreateOrUpdateOptions) (*azcore.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if resourceName == "" { + return nil, errors.New("parameter resourceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceName}", url.PathEscape(resourceName)) + req, err := azcore.NewRequest(ctx, http.MethodPut, azcore.JoinPaths(client.con.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + req.Telemetry(telemetryInfo) + reqQP := req.URL.Query() + reqQP.Set("api-version", "2021-07-01") + req.URL.RawQuery = reqQP.Encode() + req.Header.Set("Accept", "application/json") + return req, req.MarshalAsJSON(parameters) +} + +// createOrUpdateHandleError handles the CreateOrUpdate error response. +func (client *ManagedClustersClient) createOrUpdateHandleError(resp *azcore.Response) error { + body, err := resp.Payload() + if err != nil { + return azcore.NewResponseError(err, resp.Response) + } + errType := CloudError{raw: string(body)} + if err := resp.UnmarshalAsJSON(&errType); err != nil { + return azcore.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp.Response) + } + return azcore.NewResponseError(&errType, resp.Response) +} + +// BeginDelete - Deletes a managed cluster. +// If the operation fails it returns the *CloudError error type. +func (client *ManagedClustersClient) BeginDelete(ctx context.Context, resourceGroupName string, resourceName string, options *ManagedClustersBeginDeleteOptions) (ManagedClustersDeletePollerResponse, error) { + resp, err := client.deleteOperation(ctx, resourceGroupName, resourceName, options) + if err != nil { + return ManagedClustersDeletePollerResponse{}, err + } + result := ManagedClustersDeletePollerResponse{ + RawResponse: resp.Response, + } + pt, err := armcore.NewLROPoller("ManagedClustersClient.Delete", "", resp, client.con.Pipeline(), client.deleteHandleError) + if err != nil { + return ManagedClustersDeletePollerResponse{}, err + } + poller := &managedClustersDeletePoller{ + pt: pt, + } + result.Poller = poller + result.PollUntilDone = func(ctx context.Context, frequency time.Duration) (ManagedClustersDeleteResponse, error) { + return poller.pollUntilDone(ctx, frequency) + } + return result, nil +} + +// ResumeDelete creates a new ManagedClustersDeletePoller from the specified resume token. +// token - The value must come from a previous call to ManagedClustersDeletePoller.ResumeToken(). +func (client *ManagedClustersClient) ResumeDelete(ctx context.Context, token string) (ManagedClustersDeletePollerResponse, error) { + pt, err := armcore.NewLROPollerFromResumeToken("ManagedClustersClient.Delete", token, client.con.Pipeline(), client.deleteHandleError) + if err != nil { + return ManagedClustersDeletePollerResponse{}, err + } + poller := &managedClustersDeletePoller{ + pt: pt, + } + resp, err := poller.Poll(ctx) + if err != nil { + return ManagedClustersDeletePollerResponse{}, err + } + result := ManagedClustersDeletePollerResponse{ + RawResponse: resp, + } + result.Poller = poller + result.PollUntilDone = func(ctx context.Context, frequency time.Duration) (ManagedClustersDeleteResponse, error) { + return poller.pollUntilDone(ctx, frequency) + } + return result, nil +} + +// Delete - Deletes a managed cluster. +// If the operation fails it returns the *CloudError error type. +func (client *ManagedClustersClient) deleteOperation(ctx context.Context, resourceGroupName string, resourceName string, options *ManagedClustersBeginDeleteOptions) (*azcore.Response, error) { + req, err := client.deleteCreateRequest(ctx, resourceGroupName, resourceName, options) + if err != nil { + return nil, err + } + resp, err := client.con.Pipeline().Do(req) + if err != nil { + return nil, err + } + if !resp.HasStatusCode(http.StatusAccepted, http.StatusNoContent) { + return nil, client.deleteHandleError(resp) + } + return resp, nil +} + +// deleteCreateRequest creates the Delete request. +func (client *ManagedClustersClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, resourceName string, options *ManagedClustersBeginDeleteOptions) (*azcore.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if resourceName == "" { + return nil, errors.New("parameter resourceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceName}", url.PathEscape(resourceName)) + req, err := azcore.NewRequest(ctx, http.MethodDelete, azcore.JoinPaths(client.con.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + req.Telemetry(telemetryInfo) + reqQP := req.URL.Query() + reqQP.Set("api-version", "2021-07-01") + req.URL.RawQuery = reqQP.Encode() + req.Header.Set("Accept", "application/json") + return req, nil +} + +// deleteHandleError handles the Delete error response. +func (client *ManagedClustersClient) deleteHandleError(resp *azcore.Response) error { + body, err := resp.Payload() + if err != nil { + return azcore.NewResponseError(err, resp.Response) + } + errType := CloudError{raw: string(body)} + if err := resp.UnmarshalAsJSON(&errType); err != nil { + return azcore.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp.Response) + } + return azcore.NewResponseError(&errType, resp.Response) +} + +// Get - Gets a managed cluster. +// If the operation fails it returns the *CloudError error type. +func (client *ManagedClustersClient) Get(ctx context.Context, resourceGroupName string, resourceName string, options *ManagedClustersGetOptions) (ManagedClustersGetResponse, error) { + req, err := client.getCreateRequest(ctx, resourceGroupName, resourceName, options) + if err != nil { + return ManagedClustersGetResponse{}, err + } + resp, err := client.con.Pipeline().Do(req) + if err != nil { + return ManagedClustersGetResponse{}, err + } + if !resp.HasStatusCode(http.StatusOK) { + return ManagedClustersGetResponse{}, client.getHandleError(resp) + } + return client.getHandleResponse(resp) +} + +// getCreateRequest creates the Get request. +func (client *ManagedClustersClient) getCreateRequest(ctx context.Context, resourceGroupName string, resourceName string, options *ManagedClustersGetOptions) (*azcore.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if resourceName == "" { + return nil, errors.New("parameter resourceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceName}", url.PathEscape(resourceName)) + req, err := azcore.NewRequest(ctx, http.MethodGet, azcore.JoinPaths(client.con.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + req.Telemetry(telemetryInfo) + reqQP := req.URL.Query() + reqQP.Set("api-version", "2021-07-01") + req.URL.RawQuery = reqQP.Encode() + req.Header.Set("Accept", "application/json") + return req, nil +} + +// getHandleResponse handles the Get response. +func (client *ManagedClustersClient) getHandleResponse(resp *azcore.Response) (ManagedClustersGetResponse, error) { + result := ManagedClustersGetResponse{RawResponse: resp.Response} + if err := resp.UnmarshalAsJSON(&result.ManagedCluster); err != nil { + return ManagedClustersGetResponse{}, err + } + return result, nil +} + +// getHandleError handles the Get error response. +func (client *ManagedClustersClient) getHandleError(resp *azcore.Response) error { + body, err := resp.Payload() + if err != nil { + return azcore.NewResponseError(err, resp.Response) + } + errType := CloudError{raw: string(body)} + if err := resp.UnmarshalAsJSON(&errType); err != nil { + return azcore.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp.Response) + } + return azcore.NewResponseError(&errType, resp.Response) +} + +// GetAccessProfile - WARNING: This API will be deprecated. Instead use ListClusterUserCredentials [https://docs.microsoft.com/rest/api/aks/managedclusters/listclusterusercredentials] +// or ListClusterAdminCredentials +// [https://docs.microsoft.com/rest/api/aks/managedclusters/listclusteradmincredentials] . +// If the operation fails it returns the *CloudError error type. +func (client *ManagedClustersClient) GetAccessProfile(ctx context.Context, resourceGroupName string, resourceName string, roleName string, options *ManagedClustersGetAccessProfileOptions) (ManagedClustersGetAccessProfileResponse, error) { + req, err := client.getAccessProfileCreateRequest(ctx, resourceGroupName, resourceName, roleName, options) + if err != nil { + return ManagedClustersGetAccessProfileResponse{}, err + } + resp, err := client.con.Pipeline().Do(req) + if err != nil { + return ManagedClustersGetAccessProfileResponse{}, err + } + if !resp.HasStatusCode(http.StatusOK) { + return ManagedClustersGetAccessProfileResponse{}, client.getAccessProfileHandleError(resp) + } + return client.getAccessProfileHandleResponse(resp) +} + +// getAccessProfileCreateRequest creates the GetAccessProfile request. +func (client *ManagedClustersClient) getAccessProfileCreateRequest(ctx context.Context, resourceGroupName string, resourceName string, roleName string, options *ManagedClustersGetAccessProfileOptions) (*azcore.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/accessProfiles/{roleName}/listCredential" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if resourceName == "" { + return nil, errors.New("parameter resourceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceName}", url.PathEscape(resourceName)) + if roleName == "" { + return nil, errors.New("parameter roleName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{roleName}", url.PathEscape(roleName)) + req, err := azcore.NewRequest(ctx, http.MethodPost, azcore.JoinPaths(client.con.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + req.Telemetry(telemetryInfo) + reqQP := req.URL.Query() + reqQP.Set("api-version", "2021-07-01") + req.URL.RawQuery = reqQP.Encode() + req.Header.Set("Accept", "application/json") + return req, nil +} + +// getAccessProfileHandleResponse handles the GetAccessProfile response. +func (client *ManagedClustersClient) getAccessProfileHandleResponse(resp *azcore.Response) (ManagedClustersGetAccessProfileResponse, error) { + result := ManagedClustersGetAccessProfileResponse{RawResponse: resp.Response} + if err := resp.UnmarshalAsJSON(&result.ManagedClusterAccessProfile); err != nil { + return ManagedClustersGetAccessProfileResponse{}, err + } + return result, nil +} + +// getAccessProfileHandleError handles the GetAccessProfile error response. +func (client *ManagedClustersClient) getAccessProfileHandleError(resp *azcore.Response) error { + body, err := resp.Payload() + if err != nil { + return azcore.NewResponseError(err, resp.Response) + } + errType := CloudError{raw: string(body)} + if err := resp.UnmarshalAsJSON(&errType); err != nil { + return azcore.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp.Response) + } + return azcore.NewResponseError(&errType, resp.Response) +} + +// GetCommandResult - Gets the results of a command which has been run on the Managed Cluster. +// If the operation fails it returns the *CloudError error type. +func (client *ManagedClustersClient) GetCommandResult(ctx context.Context, resourceGroupName string, resourceName string, commandID string, options *ManagedClustersGetCommandResultOptions) (ManagedClustersGetCommandResultResponse, error) { + req, err := client.getCommandResultCreateRequest(ctx, resourceGroupName, resourceName, commandID, options) + if err != nil { + return ManagedClustersGetCommandResultResponse{}, err + } + resp, err := client.con.Pipeline().Do(req) + if err != nil { + return ManagedClustersGetCommandResultResponse{}, err + } + if !resp.HasStatusCode(http.StatusOK, http.StatusAccepted) { + return ManagedClustersGetCommandResultResponse{}, client.getCommandResultHandleError(resp) + } + return client.getCommandResultHandleResponse(resp) +} + +// getCommandResultCreateRequest creates the GetCommandResult request. +func (client *ManagedClustersClient) getCommandResultCreateRequest(ctx context.Context, resourceGroupName string, resourceName string, commandID string, options *ManagedClustersGetCommandResultOptions) (*azcore.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/commandResults/{commandId}" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if resourceName == "" { + return nil, errors.New("parameter resourceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceName}", url.PathEscape(resourceName)) + if commandID == "" { + return nil, errors.New("parameter commandID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{commandId}", url.PathEscape(commandID)) + req, err := azcore.NewRequest(ctx, http.MethodGet, azcore.JoinPaths(client.con.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + req.Telemetry(telemetryInfo) + reqQP := req.URL.Query() + reqQP.Set("api-version", "2021-07-01") + req.URL.RawQuery = reqQP.Encode() + req.Header.Set("Accept", "application/json") + return req, nil +} + +// getCommandResultHandleResponse handles the GetCommandResult response. +func (client *ManagedClustersClient) getCommandResultHandleResponse(resp *azcore.Response) (ManagedClustersGetCommandResultResponse, error) { + result := ManagedClustersGetCommandResultResponse{RawResponse: resp.Response} + if err := resp.UnmarshalAsJSON(&result.RunCommandResult); err != nil { + return ManagedClustersGetCommandResultResponse{}, err + } + return result, nil +} + +// getCommandResultHandleError handles the GetCommandResult error response. +func (client *ManagedClustersClient) getCommandResultHandleError(resp *azcore.Response) error { + body, err := resp.Payload() + if err != nil { + return azcore.NewResponseError(err, resp.Response) + } + errType := CloudError{raw: string(body)} + if err := resp.UnmarshalAsJSON(&errType); err != nil { + return azcore.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp.Response) + } + return azcore.NewResponseError(&errType, resp.Response) +} + +// GetOSOptions - Gets supported OS options in the specified subscription. +// If the operation fails it returns the *CloudError error type. +func (client *ManagedClustersClient) GetOSOptions(ctx context.Context, location string, options *ManagedClustersGetOSOptionsOptions) (ManagedClustersGetOSOptionsResponse, error) { + req, err := client.getOSOptionsCreateRequest(ctx, location, options) + if err != nil { + return ManagedClustersGetOSOptionsResponse{}, err + } + resp, err := client.con.Pipeline().Do(req) + if err != nil { + return ManagedClustersGetOSOptionsResponse{}, err + } + if !resp.HasStatusCode(http.StatusOK) { + return ManagedClustersGetOSOptionsResponse{}, client.getOSOptionsHandleError(resp) + } + return client.getOSOptionsHandleResponse(resp) +} + +// getOSOptionsCreateRequest creates the GetOSOptions request. +func (client *ManagedClustersClient) getOSOptionsCreateRequest(ctx context.Context, location string, options *ManagedClustersGetOSOptionsOptions) (*azcore.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.ContainerService/locations/{location}/osOptions/default" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + if location == "" { + return nil, errors.New("parameter location cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{location}", url.PathEscape(location)) + req, err := azcore.NewRequest(ctx, http.MethodGet, azcore.JoinPaths(client.con.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + req.Telemetry(telemetryInfo) + reqQP := req.URL.Query() + reqQP.Set("api-version", "2021-07-01") + if options != nil && options.ResourceType != nil { + reqQP.Set("resource-type", *options.ResourceType) + } + req.URL.RawQuery = reqQP.Encode() + req.Header.Set("Accept", "application/json") + return req, nil +} + +// getOSOptionsHandleResponse handles the GetOSOptions response. +func (client *ManagedClustersClient) getOSOptionsHandleResponse(resp *azcore.Response) (ManagedClustersGetOSOptionsResponse, error) { + result := ManagedClustersGetOSOptionsResponse{RawResponse: resp.Response} + if err := resp.UnmarshalAsJSON(&result.OSOptionProfile); err != nil { + return ManagedClustersGetOSOptionsResponse{}, err + } + return result, nil +} + +// getOSOptionsHandleError handles the GetOSOptions error response. +func (client *ManagedClustersClient) getOSOptionsHandleError(resp *azcore.Response) error { + body, err := resp.Payload() + if err != nil { + return azcore.NewResponseError(err, resp.Response) + } + errType := CloudError{raw: string(body)} + if err := resp.UnmarshalAsJSON(&errType); err != nil { + return azcore.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp.Response) + } + return azcore.NewResponseError(&errType, resp.Response) +} + +// GetUpgradeProfile - Gets the upgrade profile of a managed cluster. +// If the operation fails it returns the *CloudError error type. +func (client *ManagedClustersClient) GetUpgradeProfile(ctx context.Context, resourceGroupName string, resourceName string, options *ManagedClustersGetUpgradeProfileOptions) (ManagedClustersGetUpgradeProfileResponse, error) { + req, err := client.getUpgradeProfileCreateRequest(ctx, resourceGroupName, resourceName, options) + if err != nil { + return ManagedClustersGetUpgradeProfileResponse{}, err + } + resp, err := client.con.Pipeline().Do(req) + if err != nil { + return ManagedClustersGetUpgradeProfileResponse{}, err + } + if !resp.HasStatusCode(http.StatusOK) { + return ManagedClustersGetUpgradeProfileResponse{}, client.getUpgradeProfileHandleError(resp) + } + return client.getUpgradeProfileHandleResponse(resp) +} + +// getUpgradeProfileCreateRequest creates the GetUpgradeProfile request. +func (client *ManagedClustersClient) getUpgradeProfileCreateRequest(ctx context.Context, resourceGroupName string, resourceName string, options *ManagedClustersGetUpgradeProfileOptions) (*azcore.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/upgradeProfiles/default" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if resourceName == "" { + return nil, errors.New("parameter resourceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceName}", url.PathEscape(resourceName)) + req, err := azcore.NewRequest(ctx, http.MethodGet, azcore.JoinPaths(client.con.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + req.Telemetry(telemetryInfo) + reqQP := req.URL.Query() + reqQP.Set("api-version", "2021-07-01") + req.URL.RawQuery = reqQP.Encode() + req.Header.Set("Accept", "application/json") + return req, nil +} + +// getUpgradeProfileHandleResponse handles the GetUpgradeProfile response. +func (client *ManagedClustersClient) getUpgradeProfileHandleResponse(resp *azcore.Response) (ManagedClustersGetUpgradeProfileResponse, error) { + result := ManagedClustersGetUpgradeProfileResponse{RawResponse: resp.Response} + if err := resp.UnmarshalAsJSON(&result.ManagedClusterUpgradeProfile); err != nil { + return ManagedClustersGetUpgradeProfileResponse{}, err + } + return result, nil +} + +// getUpgradeProfileHandleError handles the GetUpgradeProfile error response. +func (client *ManagedClustersClient) getUpgradeProfileHandleError(resp *azcore.Response) error { + body, err := resp.Payload() + if err != nil { + return azcore.NewResponseError(err, resp.Response) + } + errType := CloudError{raw: string(body)} + if err := resp.UnmarshalAsJSON(&errType); err != nil { + return azcore.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp.Response) + } + return azcore.NewResponseError(&errType, resp.Response) +} + +// List - Gets a list of managed clusters in the specified subscription. +// If the operation fails it returns the *CloudError error type. +func (client *ManagedClustersClient) List(options *ManagedClustersListOptions) ManagedClustersListPager { + return &managedClustersListPager{ + client: client, + requester: func(ctx context.Context) (*azcore.Request, error) { + return client.listCreateRequest(ctx, options) + }, + advancer: func(ctx context.Context, resp ManagedClustersListResponse) (*azcore.Request, error) { + return azcore.NewRequest(ctx, http.MethodGet, *resp.ManagedClusterListResult.NextLink) + }, + } +} + +// listCreateRequest creates the List request. +func (client *ManagedClustersClient) listCreateRequest(ctx context.Context, options *ManagedClustersListOptions) (*azcore.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.ContainerService/managedClusters" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := azcore.NewRequest(ctx, http.MethodGet, azcore.JoinPaths(client.con.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + req.Telemetry(telemetryInfo) + reqQP := req.URL.Query() + reqQP.Set("api-version", "2021-07-01") + req.URL.RawQuery = reqQP.Encode() + req.Header.Set("Accept", "application/json") + return req, nil +} + +// listHandleResponse handles the List response. +func (client *ManagedClustersClient) listHandleResponse(resp *azcore.Response) (ManagedClustersListResponse, error) { + result := ManagedClustersListResponse{RawResponse: resp.Response} + if err := resp.UnmarshalAsJSON(&result.ManagedClusterListResult); err != nil { + return ManagedClustersListResponse{}, err + } + return result, nil +} + +// listHandleError handles the List error response. +func (client *ManagedClustersClient) listHandleError(resp *azcore.Response) error { + body, err := resp.Payload() + if err != nil { + return azcore.NewResponseError(err, resp.Response) + } + errType := CloudError{raw: string(body)} + if err := resp.UnmarshalAsJSON(&errType); err != nil { + return azcore.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp.Response) + } + return azcore.NewResponseError(&errType, resp.Response) +} + +// ListByResourceGroup - Lists managed clusters in the specified subscription and resource group. +// If the operation fails it returns the *CloudError error type. +func (client *ManagedClustersClient) ListByResourceGroup(resourceGroupName string, options *ManagedClustersListByResourceGroupOptions) ManagedClustersListByResourceGroupPager { + return &managedClustersListByResourceGroupPager{ + client: client, + requester: func(ctx context.Context) (*azcore.Request, error) { + return client.listByResourceGroupCreateRequest(ctx, resourceGroupName, options) + }, + advancer: func(ctx context.Context, resp ManagedClustersListByResourceGroupResponse) (*azcore.Request, error) { + return azcore.NewRequest(ctx, http.MethodGet, *resp.ManagedClusterListResult.NextLink) + }, + } +} + +// listByResourceGroupCreateRequest creates the ListByResourceGroup request. +func (client *ManagedClustersClient) listByResourceGroupCreateRequest(ctx context.Context, resourceGroupName string, options *ManagedClustersListByResourceGroupOptions) (*azcore.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + req, err := azcore.NewRequest(ctx, http.MethodGet, azcore.JoinPaths(client.con.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + req.Telemetry(telemetryInfo) + reqQP := req.URL.Query() + reqQP.Set("api-version", "2021-07-01") + req.URL.RawQuery = reqQP.Encode() + req.Header.Set("Accept", "application/json") + return req, nil +} + +// listByResourceGroupHandleResponse handles the ListByResourceGroup response. +func (client *ManagedClustersClient) listByResourceGroupHandleResponse(resp *azcore.Response) (ManagedClustersListByResourceGroupResponse, error) { + result := ManagedClustersListByResourceGroupResponse{RawResponse: resp.Response} + if err := resp.UnmarshalAsJSON(&result.ManagedClusterListResult); err != nil { + return ManagedClustersListByResourceGroupResponse{}, err + } + return result, nil +} + +// listByResourceGroupHandleError handles the ListByResourceGroup error response. +func (client *ManagedClustersClient) listByResourceGroupHandleError(resp *azcore.Response) error { + body, err := resp.Payload() + if err != nil { + return azcore.NewResponseError(err, resp.Response) + } + errType := CloudError{raw: string(body)} + if err := resp.UnmarshalAsJSON(&errType); err != nil { + return azcore.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp.Response) + } + return azcore.NewResponseError(&errType, resp.Response) +} + +// ListClusterAdminCredentials - Lists the admin credentials of a managed cluster. +// If the operation fails it returns the *CloudError error type. +func (client *ManagedClustersClient) ListClusterAdminCredentials(ctx context.Context, resourceGroupName string, resourceName string, options *ManagedClustersListClusterAdminCredentialsOptions) (ManagedClustersListClusterAdminCredentialsResponse, error) { + req, err := client.listClusterAdminCredentialsCreateRequest(ctx, resourceGroupName, resourceName, options) + if err != nil { + return ManagedClustersListClusterAdminCredentialsResponse{}, err + } + resp, err := client.con.Pipeline().Do(req) + if err != nil { + return ManagedClustersListClusterAdminCredentialsResponse{}, err + } + if !resp.HasStatusCode(http.StatusOK) { + return ManagedClustersListClusterAdminCredentialsResponse{}, client.listClusterAdminCredentialsHandleError(resp) + } + return client.listClusterAdminCredentialsHandleResponse(resp) +} + +// listClusterAdminCredentialsCreateRequest creates the ListClusterAdminCredentials request. +func (client *ManagedClustersClient) listClusterAdminCredentialsCreateRequest(ctx context.Context, resourceGroupName string, resourceName string, options *ManagedClustersListClusterAdminCredentialsOptions) (*azcore.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/listClusterAdminCredential" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if resourceName == "" { + return nil, errors.New("parameter resourceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceName}", url.PathEscape(resourceName)) + req, err := azcore.NewRequest(ctx, http.MethodPost, azcore.JoinPaths(client.con.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + req.Telemetry(telemetryInfo) + reqQP := req.URL.Query() + reqQP.Set("api-version", "2021-07-01") + if options != nil && options.ServerFqdn != nil { + reqQP.Set("server-fqdn", *options.ServerFqdn) + } + req.URL.RawQuery = reqQP.Encode() + req.Header.Set("Accept", "application/json") + return req, nil +} + +// listClusterAdminCredentialsHandleResponse handles the ListClusterAdminCredentials response. +func (client *ManagedClustersClient) listClusterAdminCredentialsHandleResponse(resp *azcore.Response) (ManagedClustersListClusterAdminCredentialsResponse, error) { + result := ManagedClustersListClusterAdminCredentialsResponse{RawResponse: resp.Response} + if err := resp.UnmarshalAsJSON(&result.CredentialResults); err != nil { + return ManagedClustersListClusterAdminCredentialsResponse{}, err + } + return result, nil +} + +// listClusterAdminCredentialsHandleError handles the ListClusterAdminCredentials error response. +func (client *ManagedClustersClient) listClusterAdminCredentialsHandleError(resp *azcore.Response) error { + body, err := resp.Payload() + if err != nil { + return azcore.NewResponseError(err, resp.Response) + } + errType := CloudError{raw: string(body)} + if err := resp.UnmarshalAsJSON(&errType); err != nil { + return azcore.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp.Response) + } + return azcore.NewResponseError(&errType, resp.Response) +} + +// ListClusterMonitoringUserCredentials - Lists the cluster monitoring user credentials of a managed cluster. +// If the operation fails it returns the *CloudError error type. +func (client *ManagedClustersClient) ListClusterMonitoringUserCredentials(ctx context.Context, resourceGroupName string, resourceName string, options *ManagedClustersListClusterMonitoringUserCredentialsOptions) (ManagedClustersListClusterMonitoringUserCredentialsResponse, error) { + req, err := client.listClusterMonitoringUserCredentialsCreateRequest(ctx, resourceGroupName, resourceName, options) + if err != nil { + return ManagedClustersListClusterMonitoringUserCredentialsResponse{}, err + } + resp, err := client.con.Pipeline().Do(req) + if err != nil { + return ManagedClustersListClusterMonitoringUserCredentialsResponse{}, err + } + if !resp.HasStatusCode(http.StatusOK) { + return ManagedClustersListClusterMonitoringUserCredentialsResponse{}, client.listClusterMonitoringUserCredentialsHandleError(resp) + } + return client.listClusterMonitoringUserCredentialsHandleResponse(resp) +} + +// listClusterMonitoringUserCredentialsCreateRequest creates the ListClusterMonitoringUserCredentials request. +func (client *ManagedClustersClient) listClusterMonitoringUserCredentialsCreateRequest(ctx context.Context, resourceGroupName string, resourceName string, options *ManagedClustersListClusterMonitoringUserCredentialsOptions) (*azcore.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/listClusterMonitoringUserCredential" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if resourceName == "" { + return nil, errors.New("parameter resourceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceName}", url.PathEscape(resourceName)) + req, err := azcore.NewRequest(ctx, http.MethodPost, azcore.JoinPaths(client.con.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + req.Telemetry(telemetryInfo) + reqQP := req.URL.Query() + reqQP.Set("api-version", "2021-07-01") + if options != nil && options.ServerFqdn != nil { + reqQP.Set("server-fqdn", *options.ServerFqdn) + } + req.URL.RawQuery = reqQP.Encode() + req.Header.Set("Accept", "application/json") + return req, nil +} + +// listClusterMonitoringUserCredentialsHandleResponse handles the ListClusterMonitoringUserCredentials response. +func (client *ManagedClustersClient) listClusterMonitoringUserCredentialsHandleResponse(resp *azcore.Response) (ManagedClustersListClusterMonitoringUserCredentialsResponse, error) { + result := ManagedClustersListClusterMonitoringUserCredentialsResponse{RawResponse: resp.Response} + if err := resp.UnmarshalAsJSON(&result.CredentialResults); err != nil { + return ManagedClustersListClusterMonitoringUserCredentialsResponse{}, err + } + return result, nil +} + +// listClusterMonitoringUserCredentialsHandleError handles the ListClusterMonitoringUserCredentials error response. +func (client *ManagedClustersClient) listClusterMonitoringUserCredentialsHandleError(resp *azcore.Response) error { + body, err := resp.Payload() + if err != nil { + return azcore.NewResponseError(err, resp.Response) + } + errType := CloudError{raw: string(body)} + if err := resp.UnmarshalAsJSON(&errType); err != nil { + return azcore.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp.Response) + } + return azcore.NewResponseError(&errType, resp.Response) +} + +// ListClusterUserCredentials - Lists the user credentials of a managed cluster. +// If the operation fails it returns the *CloudError error type. +func (client *ManagedClustersClient) ListClusterUserCredentials(ctx context.Context, resourceGroupName string, resourceName string, options *ManagedClustersListClusterUserCredentialsOptions) (ManagedClustersListClusterUserCredentialsResponse, error) { + req, err := client.listClusterUserCredentialsCreateRequest(ctx, resourceGroupName, resourceName, options) + if err != nil { + return ManagedClustersListClusterUserCredentialsResponse{}, err + } + resp, err := client.con.Pipeline().Do(req) + if err != nil { + return ManagedClustersListClusterUserCredentialsResponse{}, err + } + if !resp.HasStatusCode(http.StatusOK) { + return ManagedClustersListClusterUserCredentialsResponse{}, client.listClusterUserCredentialsHandleError(resp) + } + return client.listClusterUserCredentialsHandleResponse(resp) +} + +// listClusterUserCredentialsCreateRequest creates the ListClusterUserCredentials request. +func (client *ManagedClustersClient) listClusterUserCredentialsCreateRequest(ctx context.Context, resourceGroupName string, resourceName string, options *ManagedClustersListClusterUserCredentialsOptions) (*azcore.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/listClusterUserCredential" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if resourceName == "" { + return nil, errors.New("parameter resourceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceName}", url.PathEscape(resourceName)) + req, err := azcore.NewRequest(ctx, http.MethodPost, azcore.JoinPaths(client.con.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + req.Telemetry(telemetryInfo) + reqQP := req.URL.Query() + reqQP.Set("api-version", "2021-07-01") + if options != nil && options.ServerFqdn != nil { + reqQP.Set("server-fqdn", *options.ServerFqdn) + } + req.URL.RawQuery = reqQP.Encode() + req.Header.Set("Accept", "application/json") + return req, nil +} + +// listClusterUserCredentialsHandleResponse handles the ListClusterUserCredentials response. +func (client *ManagedClustersClient) listClusterUserCredentialsHandleResponse(resp *azcore.Response) (ManagedClustersListClusterUserCredentialsResponse, error) { + result := ManagedClustersListClusterUserCredentialsResponse{RawResponse: resp.Response} + if err := resp.UnmarshalAsJSON(&result.CredentialResults); err != nil { + return ManagedClustersListClusterUserCredentialsResponse{}, err + } + return result, nil +} + +// listClusterUserCredentialsHandleError handles the ListClusterUserCredentials error response. +func (client *ManagedClustersClient) listClusterUserCredentialsHandleError(resp *azcore.Response) error { + body, err := resp.Payload() + if err != nil { + return azcore.NewResponseError(err, resp.Response) + } + errType := CloudError{raw: string(body)} + if err := resp.UnmarshalAsJSON(&errType); err != nil { + return azcore.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp.Response) + } + return azcore.NewResponseError(&errType, resp.Response) +} + +// ListOutboundNetworkDependenciesEndpoints - Gets a list of egress endpoints (network endpoints of all outbound dependencies) in the specified managed +// cluster. The operation returns properties of each egress endpoint. +// If the operation fails it returns the *CloudError error type. +func (client *ManagedClustersClient) ListOutboundNetworkDependenciesEndpoints(resourceGroupName string, resourceName string, options *ManagedClustersListOutboundNetworkDependenciesEndpointsOptions) ManagedClustersListOutboundNetworkDependenciesEndpointsPager { + return &managedClustersListOutboundNetworkDependenciesEndpointsPager{ + client: client, + requester: func(ctx context.Context) (*azcore.Request, error) { + return client.listOutboundNetworkDependenciesEndpointsCreateRequest(ctx, resourceGroupName, resourceName, options) + }, + advancer: func(ctx context.Context, resp ManagedClustersListOutboundNetworkDependenciesEndpointsResponse) (*azcore.Request, error) { + return azcore.NewRequest(ctx, http.MethodGet, *resp.OutboundEnvironmentEndpointCollection.NextLink) + }, + } +} + +// listOutboundNetworkDependenciesEndpointsCreateRequest creates the ListOutboundNetworkDependenciesEndpoints request. +func (client *ManagedClustersClient) listOutboundNetworkDependenciesEndpointsCreateRequest(ctx context.Context, resourceGroupName string, resourceName string, options *ManagedClustersListOutboundNetworkDependenciesEndpointsOptions) (*azcore.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/outboundNetworkDependenciesEndpoints" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if resourceName == "" { + return nil, errors.New("parameter resourceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceName}", url.PathEscape(resourceName)) + req, err := azcore.NewRequest(ctx, http.MethodGet, azcore.JoinPaths(client.con.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + req.Telemetry(telemetryInfo) + reqQP := req.URL.Query() + reqQP.Set("api-version", "2021-07-01") + req.URL.RawQuery = reqQP.Encode() + req.Header.Set("Accept", "application/json") + return req, nil +} + +// listOutboundNetworkDependenciesEndpointsHandleResponse handles the ListOutboundNetworkDependenciesEndpoints response. +func (client *ManagedClustersClient) listOutboundNetworkDependenciesEndpointsHandleResponse(resp *azcore.Response) (ManagedClustersListOutboundNetworkDependenciesEndpointsResponse, error) { + result := ManagedClustersListOutboundNetworkDependenciesEndpointsResponse{RawResponse: resp.Response} + if err := resp.UnmarshalAsJSON(&result.OutboundEnvironmentEndpointCollection); err != nil { + return ManagedClustersListOutboundNetworkDependenciesEndpointsResponse{}, err + } + return result, nil +} + +// listOutboundNetworkDependenciesEndpointsHandleError handles the ListOutboundNetworkDependenciesEndpoints error response. +func (client *ManagedClustersClient) listOutboundNetworkDependenciesEndpointsHandleError(resp *azcore.Response) error { + body, err := resp.Payload() + if err != nil { + return azcore.NewResponseError(err, resp.Response) + } + errType := CloudError{raw: string(body)} + if err := resp.UnmarshalAsJSON(&errType); err != nil { + return azcore.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp.Response) + } + return azcore.NewResponseError(&errType, resp.Response) +} + +// BeginResetAADProfile - Reset the AAD Profile of a managed cluster. +// If the operation fails it returns the *CloudError error type. +func (client *ManagedClustersClient) BeginResetAADProfile(ctx context.Context, resourceGroupName string, resourceName string, parameters ManagedClusterAADProfile, options *ManagedClustersBeginResetAADProfileOptions) (ManagedClustersResetAADProfilePollerResponse, error) { + resp, err := client.resetAADProfile(ctx, resourceGroupName, resourceName, parameters, options) + if err != nil { + return ManagedClustersResetAADProfilePollerResponse{}, err + } + result := ManagedClustersResetAADProfilePollerResponse{ + RawResponse: resp.Response, + } + pt, err := armcore.NewLROPoller("ManagedClustersClient.ResetAADProfile", "", resp, client.con.Pipeline(), client.resetAADProfileHandleError) + if err != nil { + return ManagedClustersResetAADProfilePollerResponse{}, err + } + poller := &managedClustersResetAADProfilePoller{ + pt: pt, + } + result.Poller = poller + result.PollUntilDone = func(ctx context.Context, frequency time.Duration) (ManagedClustersResetAADProfileResponse, error) { + return poller.pollUntilDone(ctx, frequency) + } + return result, nil +} + +// ResumeResetAADProfile creates a new ManagedClustersResetAADProfilePoller from the specified resume token. +// token - The value must come from a previous call to ManagedClustersResetAADProfilePoller.ResumeToken(). +func (client *ManagedClustersClient) ResumeResetAADProfile(ctx context.Context, token string) (ManagedClustersResetAADProfilePollerResponse, error) { + pt, err := armcore.NewLROPollerFromResumeToken("ManagedClustersClient.ResetAADProfile", token, client.con.Pipeline(), client.resetAADProfileHandleError) + if err != nil { + return ManagedClustersResetAADProfilePollerResponse{}, err + } + poller := &managedClustersResetAADProfilePoller{ + pt: pt, + } + resp, err := poller.Poll(ctx) + if err != nil { + return ManagedClustersResetAADProfilePollerResponse{}, err + } + result := ManagedClustersResetAADProfilePollerResponse{ + RawResponse: resp, + } + result.Poller = poller + result.PollUntilDone = func(ctx context.Context, frequency time.Duration) (ManagedClustersResetAADProfileResponse, error) { + return poller.pollUntilDone(ctx, frequency) + } + return result, nil +} + +// ResetAADProfile - Reset the AAD Profile of a managed cluster. +// If the operation fails it returns the *CloudError error type. +func (client *ManagedClustersClient) resetAADProfile(ctx context.Context, resourceGroupName string, resourceName string, parameters ManagedClusterAADProfile, options *ManagedClustersBeginResetAADProfileOptions) (*azcore.Response, error) { + req, err := client.resetAADProfileCreateRequest(ctx, resourceGroupName, resourceName, parameters, options) + if err != nil { + return nil, err + } + resp, err := client.con.Pipeline().Do(req) + if err != nil { + return nil, err + } + if !resp.HasStatusCode(http.StatusOK, http.StatusAccepted) { + return nil, client.resetAADProfileHandleError(resp) + } + return resp, nil +} + +// resetAADProfileCreateRequest creates the ResetAADProfile request. +func (client *ManagedClustersClient) resetAADProfileCreateRequest(ctx context.Context, resourceGroupName string, resourceName string, parameters ManagedClusterAADProfile, options *ManagedClustersBeginResetAADProfileOptions) (*azcore.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/resetAADProfile" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if resourceName == "" { + return nil, errors.New("parameter resourceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceName}", url.PathEscape(resourceName)) + req, err := azcore.NewRequest(ctx, http.MethodPost, azcore.JoinPaths(client.con.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + req.Telemetry(telemetryInfo) + reqQP := req.URL.Query() + reqQP.Set("api-version", "2021-07-01") + req.URL.RawQuery = reqQP.Encode() + req.Header.Set("Accept", "application/json") + return req, req.MarshalAsJSON(parameters) +} + +// resetAADProfileHandleError handles the ResetAADProfile error response. +func (client *ManagedClustersClient) resetAADProfileHandleError(resp *azcore.Response) error { + body, err := resp.Payload() + if err != nil { + return azcore.NewResponseError(err, resp.Response) + } + errType := CloudError{raw: string(body)} + if err := resp.UnmarshalAsJSON(&errType); err != nil { + return azcore.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp.Response) + } + return azcore.NewResponseError(&errType, resp.Response) +} + +// BeginResetServicePrincipalProfile - This action cannot be performed on a cluster that is not using a service principal +// If the operation fails it returns the *CloudError error type. +func (client *ManagedClustersClient) BeginResetServicePrincipalProfile(ctx context.Context, resourceGroupName string, resourceName string, parameters ManagedClusterServicePrincipalProfile, options *ManagedClustersBeginResetServicePrincipalProfileOptions) (ManagedClustersResetServicePrincipalProfilePollerResponse, error) { + resp, err := client.resetServicePrincipalProfile(ctx, resourceGroupName, resourceName, parameters, options) + if err != nil { + return ManagedClustersResetServicePrincipalProfilePollerResponse{}, err + } + result := ManagedClustersResetServicePrincipalProfilePollerResponse{ + RawResponse: resp.Response, + } + pt, err := armcore.NewLROPoller("ManagedClustersClient.ResetServicePrincipalProfile", "", resp, client.con.Pipeline(), client.resetServicePrincipalProfileHandleError) + if err != nil { + return ManagedClustersResetServicePrincipalProfilePollerResponse{}, err + } + poller := &managedClustersResetServicePrincipalProfilePoller{ + pt: pt, + } + result.Poller = poller + result.PollUntilDone = func(ctx context.Context, frequency time.Duration) (ManagedClustersResetServicePrincipalProfileResponse, error) { + return poller.pollUntilDone(ctx, frequency) + } + return result, nil +} + +// ResumeResetServicePrincipalProfile creates a new ManagedClustersResetServicePrincipalProfilePoller from the specified resume token. +// token - The value must come from a previous call to ManagedClustersResetServicePrincipalProfilePoller.ResumeToken(). +func (client *ManagedClustersClient) ResumeResetServicePrincipalProfile(ctx context.Context, token string) (ManagedClustersResetServicePrincipalProfilePollerResponse, error) { + pt, err := armcore.NewLROPollerFromResumeToken("ManagedClustersClient.ResetServicePrincipalProfile", token, client.con.Pipeline(), client.resetServicePrincipalProfileHandleError) + if err != nil { + return ManagedClustersResetServicePrincipalProfilePollerResponse{}, err + } + poller := &managedClustersResetServicePrincipalProfilePoller{ + pt: pt, + } + resp, err := poller.Poll(ctx) + if err != nil { + return ManagedClustersResetServicePrincipalProfilePollerResponse{}, err + } + result := ManagedClustersResetServicePrincipalProfilePollerResponse{ + RawResponse: resp, + } + result.Poller = poller + result.PollUntilDone = func(ctx context.Context, frequency time.Duration) (ManagedClustersResetServicePrincipalProfileResponse, error) { + return poller.pollUntilDone(ctx, frequency) + } + return result, nil +} + +// ResetServicePrincipalProfile - This action cannot be performed on a cluster that is not using a service principal +// If the operation fails it returns the *CloudError error type. +func (client *ManagedClustersClient) resetServicePrincipalProfile(ctx context.Context, resourceGroupName string, resourceName string, parameters ManagedClusterServicePrincipalProfile, options *ManagedClustersBeginResetServicePrincipalProfileOptions) (*azcore.Response, error) { + req, err := client.resetServicePrincipalProfileCreateRequest(ctx, resourceGroupName, resourceName, parameters, options) + if err != nil { + return nil, err + } + resp, err := client.con.Pipeline().Do(req) + if err != nil { + return nil, err + } + if !resp.HasStatusCode(http.StatusOK, http.StatusAccepted) { + return nil, client.resetServicePrincipalProfileHandleError(resp) + } + return resp, nil +} + +// resetServicePrincipalProfileCreateRequest creates the ResetServicePrincipalProfile request. +func (client *ManagedClustersClient) resetServicePrincipalProfileCreateRequest(ctx context.Context, resourceGroupName string, resourceName string, parameters ManagedClusterServicePrincipalProfile, options *ManagedClustersBeginResetServicePrincipalProfileOptions) (*azcore.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/resetServicePrincipalProfile" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if resourceName == "" { + return nil, errors.New("parameter resourceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceName}", url.PathEscape(resourceName)) + req, err := azcore.NewRequest(ctx, http.MethodPost, azcore.JoinPaths(client.con.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + req.Telemetry(telemetryInfo) + reqQP := req.URL.Query() + reqQP.Set("api-version", "2021-07-01") + req.URL.RawQuery = reqQP.Encode() + req.Header.Set("Accept", "application/json") + return req, req.MarshalAsJSON(parameters) +} + +// resetServicePrincipalProfileHandleError handles the ResetServicePrincipalProfile error response. +func (client *ManagedClustersClient) resetServicePrincipalProfileHandleError(resp *azcore.Response) error { + body, err := resp.Payload() + if err != nil { + return azcore.NewResponseError(err, resp.Response) + } + errType := CloudError{raw: string(body)} + if err := resp.UnmarshalAsJSON(&errType); err != nil { + return azcore.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp.Response) + } + return azcore.NewResponseError(&errType, resp.Response) +} + +// BeginRotateClusterCertificates - See Certificate rotation [https://docs.microsoft.com/azure/aks/certificate-rotation] for more details about rotating +// managed cluster certificates. +// If the operation fails it returns the *CloudError error type. +func (client *ManagedClustersClient) BeginRotateClusterCertificates(ctx context.Context, resourceGroupName string, resourceName string, options *ManagedClustersBeginRotateClusterCertificatesOptions) (ManagedClustersRotateClusterCertificatesPollerResponse, error) { + resp, err := client.rotateClusterCertificates(ctx, resourceGroupName, resourceName, options) + if err != nil { + return ManagedClustersRotateClusterCertificatesPollerResponse{}, err + } + result := ManagedClustersRotateClusterCertificatesPollerResponse{ + RawResponse: resp.Response, + } + pt, err := armcore.NewLROPoller("ManagedClustersClient.RotateClusterCertificates", "", resp, client.con.Pipeline(), client.rotateClusterCertificatesHandleError) + if err != nil { + return ManagedClustersRotateClusterCertificatesPollerResponse{}, err + } + poller := &managedClustersRotateClusterCertificatesPoller{ + pt: pt, + } + result.Poller = poller + result.PollUntilDone = func(ctx context.Context, frequency time.Duration) (ManagedClustersRotateClusterCertificatesResponse, error) { + return poller.pollUntilDone(ctx, frequency) + } + return result, nil +} + +// ResumeRotateClusterCertificates creates a new ManagedClustersRotateClusterCertificatesPoller from the specified resume token. +// token - The value must come from a previous call to ManagedClustersRotateClusterCertificatesPoller.ResumeToken(). +func (client *ManagedClustersClient) ResumeRotateClusterCertificates(ctx context.Context, token string) (ManagedClustersRotateClusterCertificatesPollerResponse, error) { + pt, err := armcore.NewLROPollerFromResumeToken("ManagedClustersClient.RotateClusterCertificates", token, client.con.Pipeline(), client.rotateClusterCertificatesHandleError) + if err != nil { + return ManagedClustersRotateClusterCertificatesPollerResponse{}, err + } + poller := &managedClustersRotateClusterCertificatesPoller{ + pt: pt, + } + resp, err := poller.Poll(ctx) + if err != nil { + return ManagedClustersRotateClusterCertificatesPollerResponse{}, err + } + result := ManagedClustersRotateClusterCertificatesPollerResponse{ + RawResponse: resp, + } + result.Poller = poller + result.PollUntilDone = func(ctx context.Context, frequency time.Duration) (ManagedClustersRotateClusterCertificatesResponse, error) { + return poller.pollUntilDone(ctx, frequency) + } + return result, nil +} + +// RotateClusterCertificates - See Certificate rotation [https://docs.microsoft.com/azure/aks/certificate-rotation] for more details about rotating managed +// cluster certificates. +// If the operation fails it returns the *CloudError error type. +func (client *ManagedClustersClient) rotateClusterCertificates(ctx context.Context, resourceGroupName string, resourceName string, options *ManagedClustersBeginRotateClusterCertificatesOptions) (*azcore.Response, error) { + req, err := client.rotateClusterCertificatesCreateRequest(ctx, resourceGroupName, resourceName, options) + if err != nil { + return nil, err + } + resp, err := client.con.Pipeline().Do(req) + if err != nil { + return nil, err + } + if !resp.HasStatusCode(http.StatusAccepted, http.StatusNoContent) { + return nil, client.rotateClusterCertificatesHandleError(resp) + } + return resp, nil +} + +// rotateClusterCertificatesCreateRequest creates the RotateClusterCertificates request. +func (client *ManagedClustersClient) rotateClusterCertificatesCreateRequest(ctx context.Context, resourceGroupName string, resourceName string, options *ManagedClustersBeginRotateClusterCertificatesOptions) (*azcore.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/rotateClusterCertificates" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if resourceName == "" { + return nil, errors.New("parameter resourceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceName}", url.PathEscape(resourceName)) + req, err := azcore.NewRequest(ctx, http.MethodPost, azcore.JoinPaths(client.con.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + req.Telemetry(telemetryInfo) + reqQP := req.URL.Query() + reqQP.Set("api-version", "2021-07-01") + req.URL.RawQuery = reqQP.Encode() + req.Header.Set("Accept", "application/json") + return req, nil +} + +// rotateClusterCertificatesHandleError handles the RotateClusterCertificates error response. +func (client *ManagedClustersClient) rotateClusterCertificatesHandleError(resp *azcore.Response) error { + body, err := resp.Payload() + if err != nil { + return azcore.NewResponseError(err, resp.Response) + } + errType := CloudError{raw: string(body)} + if err := resp.UnmarshalAsJSON(&errType); err != nil { + return azcore.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp.Response) + } + return azcore.NewResponseError(&errType, resp.Response) +} + +// BeginRunCommand - AKS will create a pod to run the command. This is primarily useful for private clusters. For more information see AKS Run Command +// [https://docs.microsoft.com/azure/aks/private-clusters#aks-run-command-preview]. +// If the operation fails it returns the *CloudError error type. +func (client *ManagedClustersClient) BeginRunCommand(ctx context.Context, resourceGroupName string, resourceName string, requestPayload RunCommandRequest, options *ManagedClustersBeginRunCommandOptions) (ManagedClustersRunCommandPollerResponse, error) { + resp, err := client.runCommand(ctx, resourceGroupName, resourceName, requestPayload, options) + if err != nil { + return ManagedClustersRunCommandPollerResponse{}, err + } + result := ManagedClustersRunCommandPollerResponse{ + RawResponse: resp.Response, + } + pt, err := armcore.NewLROPoller("ManagedClustersClient.RunCommand", "", resp, client.con.Pipeline(), client.runCommandHandleError) + if err != nil { + return ManagedClustersRunCommandPollerResponse{}, err + } + poller := &managedClustersRunCommandPoller{ + pt: pt, + } + result.Poller = poller + result.PollUntilDone = func(ctx context.Context, frequency time.Duration) (ManagedClustersRunCommandResponse, error) { + return poller.pollUntilDone(ctx, frequency) + } + return result, nil +} + +// ResumeRunCommand creates a new ManagedClustersRunCommandPoller from the specified resume token. +// token - The value must come from a previous call to ManagedClustersRunCommandPoller.ResumeToken(). +func (client *ManagedClustersClient) ResumeRunCommand(ctx context.Context, token string) (ManagedClustersRunCommandPollerResponse, error) { + pt, err := armcore.NewLROPollerFromResumeToken("ManagedClustersClient.RunCommand", token, client.con.Pipeline(), client.runCommandHandleError) + if err != nil { + return ManagedClustersRunCommandPollerResponse{}, err + } + poller := &managedClustersRunCommandPoller{ + pt: pt, + } + resp, err := poller.Poll(ctx) + if err != nil { + return ManagedClustersRunCommandPollerResponse{}, err + } + result := ManagedClustersRunCommandPollerResponse{ + RawResponse: resp, + } + result.Poller = poller + result.PollUntilDone = func(ctx context.Context, frequency time.Duration) (ManagedClustersRunCommandResponse, error) { + return poller.pollUntilDone(ctx, frequency) + } + return result, nil +} + +// RunCommand - AKS will create a pod to run the command. This is primarily useful for private clusters. For more information see AKS Run Command +// [https://docs.microsoft.com/azure/aks/private-clusters#aks-run-command-preview]. +// If the operation fails it returns the *CloudError error type. +func (client *ManagedClustersClient) runCommand(ctx context.Context, resourceGroupName string, resourceName string, requestPayload RunCommandRequest, options *ManagedClustersBeginRunCommandOptions) (*azcore.Response, error) { + req, err := client.runCommandCreateRequest(ctx, resourceGroupName, resourceName, requestPayload, options) + if err != nil { + return nil, err + } + resp, err := client.con.Pipeline().Do(req) + if err != nil { + return nil, err + } + if !resp.HasStatusCode(http.StatusOK, http.StatusAccepted) { + return nil, client.runCommandHandleError(resp) + } + return resp, nil +} + +// runCommandCreateRequest creates the RunCommand request. +func (client *ManagedClustersClient) runCommandCreateRequest(ctx context.Context, resourceGroupName string, resourceName string, requestPayload RunCommandRequest, options *ManagedClustersBeginRunCommandOptions) (*azcore.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/runCommand" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if resourceName == "" { + return nil, errors.New("parameter resourceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceName}", url.PathEscape(resourceName)) + req, err := azcore.NewRequest(ctx, http.MethodPost, azcore.JoinPaths(client.con.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + req.Telemetry(telemetryInfo) + reqQP := req.URL.Query() + reqQP.Set("api-version", "2021-07-01") + req.URL.RawQuery = reqQP.Encode() + req.Header.Set("Accept", "application/json") + return req, req.MarshalAsJSON(requestPayload) +} + +// runCommandHandleError handles the RunCommand error response. +func (client *ManagedClustersClient) runCommandHandleError(resp *azcore.Response) error { + body, err := resp.Payload() + if err != nil { + return azcore.NewResponseError(err, resp.Response) + } + errType := CloudError{raw: string(body)} + if err := resp.UnmarshalAsJSON(&errType); err != nil { + return azcore.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp.Response) + } + return azcore.NewResponseError(&errType, resp.Response) +} + +// BeginStart - See starting a cluster [https://docs.microsoft.com/azure/aks/start-stop-cluster] for more details about starting a cluster. +// If the operation fails it returns the *CloudError error type. +func (client *ManagedClustersClient) BeginStart(ctx context.Context, resourceGroupName string, resourceName string, options *ManagedClustersBeginStartOptions) (ManagedClustersStartPollerResponse, error) { + resp, err := client.start(ctx, resourceGroupName, resourceName, options) + if err != nil { + return ManagedClustersStartPollerResponse{}, err + } + result := ManagedClustersStartPollerResponse{ + RawResponse: resp.Response, + } + pt, err := armcore.NewLROPoller("ManagedClustersClient.Start", "", resp, client.con.Pipeline(), client.startHandleError) + if err != nil { + return ManagedClustersStartPollerResponse{}, err + } + poller := &managedClustersStartPoller{ + pt: pt, + } + result.Poller = poller + result.PollUntilDone = func(ctx context.Context, frequency time.Duration) (ManagedClustersStartResponse, error) { + return poller.pollUntilDone(ctx, frequency) + } + return result, nil +} + +// ResumeStart creates a new ManagedClustersStartPoller from the specified resume token. +// token - The value must come from a previous call to ManagedClustersStartPoller.ResumeToken(). +func (client *ManagedClustersClient) ResumeStart(ctx context.Context, token string) (ManagedClustersStartPollerResponse, error) { + pt, err := armcore.NewLROPollerFromResumeToken("ManagedClustersClient.Start", token, client.con.Pipeline(), client.startHandleError) + if err != nil { + return ManagedClustersStartPollerResponse{}, err + } + poller := &managedClustersStartPoller{ + pt: pt, + } + resp, err := poller.Poll(ctx) + if err != nil { + return ManagedClustersStartPollerResponse{}, err + } + result := ManagedClustersStartPollerResponse{ + RawResponse: resp, + } + result.Poller = poller + result.PollUntilDone = func(ctx context.Context, frequency time.Duration) (ManagedClustersStartResponse, error) { + return poller.pollUntilDone(ctx, frequency) + } + return result, nil +} + +// Start - See starting a cluster [https://docs.microsoft.com/azure/aks/start-stop-cluster] for more details about starting a cluster. +// If the operation fails it returns the *CloudError error type. +func (client *ManagedClustersClient) start(ctx context.Context, resourceGroupName string, resourceName string, options *ManagedClustersBeginStartOptions) (*azcore.Response, error) { + req, err := client.startCreateRequest(ctx, resourceGroupName, resourceName, options) + if err != nil { + return nil, err + } + resp, err := client.con.Pipeline().Do(req) + if err != nil { + return nil, err + } + if !resp.HasStatusCode(http.StatusAccepted, http.StatusNoContent) { + return nil, client.startHandleError(resp) + } + return resp, nil +} + +// startCreateRequest creates the Start request. +func (client *ManagedClustersClient) startCreateRequest(ctx context.Context, resourceGroupName string, resourceName string, options *ManagedClustersBeginStartOptions) (*azcore.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/start" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if resourceName == "" { + return nil, errors.New("parameter resourceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceName}", url.PathEscape(resourceName)) + req, err := azcore.NewRequest(ctx, http.MethodPost, azcore.JoinPaths(client.con.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + req.Telemetry(telemetryInfo) + reqQP := req.URL.Query() + reqQP.Set("api-version", "2021-07-01") + req.URL.RawQuery = reqQP.Encode() + req.Header.Set("Accept", "application/json") + return req, nil +} + +// startHandleError handles the Start error response. +func (client *ManagedClustersClient) startHandleError(resp *azcore.Response) error { + body, err := resp.Payload() + if err != nil { + return azcore.NewResponseError(err, resp.Response) + } + errType := CloudError{raw: string(body)} + if err := resp.UnmarshalAsJSON(&errType); err != nil { + return azcore.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp.Response) + } + return azcore.NewResponseError(&errType, resp.Response) +} + +// BeginStop - This can only be performed on Azure Virtual Machine Scale set backed clusters. Stopping a cluster stops the control plane and agent nodes +// entirely, while maintaining all object and cluster state. A +// cluster does not accrue charges while it is stopped. See stopping a cluster [https://docs.microsoft.com/azure/aks/start-stop-cluster] for more details +// about stopping a cluster. +// If the operation fails it returns the *CloudError error type. +func (client *ManagedClustersClient) BeginStop(ctx context.Context, resourceGroupName string, resourceName string, options *ManagedClustersBeginStopOptions) (ManagedClustersStopPollerResponse, error) { + resp, err := client.stop(ctx, resourceGroupName, resourceName, options) + if err != nil { + return ManagedClustersStopPollerResponse{}, err + } + result := ManagedClustersStopPollerResponse{ + RawResponse: resp.Response, + } + pt, err := armcore.NewLROPoller("ManagedClustersClient.Stop", "", resp, client.con.Pipeline(), client.stopHandleError) + if err != nil { + return ManagedClustersStopPollerResponse{}, err + } + poller := &managedClustersStopPoller{ + pt: pt, + } + result.Poller = poller + result.PollUntilDone = func(ctx context.Context, frequency time.Duration) (ManagedClustersStopResponse, error) { + return poller.pollUntilDone(ctx, frequency) + } + return result, nil +} + +// ResumeStop creates a new ManagedClustersStopPoller from the specified resume token. +// token - The value must come from a previous call to ManagedClustersStopPoller.ResumeToken(). +func (client *ManagedClustersClient) ResumeStop(ctx context.Context, token string) (ManagedClustersStopPollerResponse, error) { + pt, err := armcore.NewLROPollerFromResumeToken("ManagedClustersClient.Stop", token, client.con.Pipeline(), client.stopHandleError) + if err != nil { + return ManagedClustersStopPollerResponse{}, err + } + poller := &managedClustersStopPoller{ + pt: pt, + } + resp, err := poller.Poll(ctx) + if err != nil { + return ManagedClustersStopPollerResponse{}, err + } + result := ManagedClustersStopPollerResponse{ + RawResponse: resp, + } + result.Poller = poller + result.PollUntilDone = func(ctx context.Context, frequency time.Duration) (ManagedClustersStopResponse, error) { + return poller.pollUntilDone(ctx, frequency) + } + return result, nil +} + +// Stop - This can only be performed on Azure Virtual Machine Scale set backed clusters. Stopping a cluster stops the control plane and agent nodes entirely, +// while maintaining all object and cluster state. A +// cluster does not accrue charges while it is stopped. See stopping a cluster [https://docs.microsoft.com/azure/aks/start-stop-cluster] for more details +// about stopping a cluster. +// If the operation fails it returns the *CloudError error type. +func (client *ManagedClustersClient) stop(ctx context.Context, resourceGroupName string, resourceName string, options *ManagedClustersBeginStopOptions) (*azcore.Response, error) { + req, err := client.stopCreateRequest(ctx, resourceGroupName, resourceName, options) + if err != nil { + return nil, err + } + resp, err := client.con.Pipeline().Do(req) + if err != nil { + return nil, err + } + if !resp.HasStatusCode(http.StatusAccepted, http.StatusNoContent) { + return nil, client.stopHandleError(resp) + } + return resp, nil +} + +// stopCreateRequest creates the Stop request. +func (client *ManagedClustersClient) stopCreateRequest(ctx context.Context, resourceGroupName string, resourceName string, options *ManagedClustersBeginStopOptions) (*azcore.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/stop" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if resourceName == "" { + return nil, errors.New("parameter resourceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceName}", url.PathEscape(resourceName)) + req, err := azcore.NewRequest(ctx, http.MethodPost, azcore.JoinPaths(client.con.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + req.Telemetry(telemetryInfo) + reqQP := req.URL.Query() + reqQP.Set("api-version", "2021-07-01") + req.URL.RawQuery = reqQP.Encode() + req.Header.Set("Accept", "application/json") + return req, nil +} + +// stopHandleError handles the Stop error response. +func (client *ManagedClustersClient) stopHandleError(resp *azcore.Response) error { + body, err := resp.Payload() + if err != nil { + return azcore.NewResponseError(err, resp.Response) + } + errType := CloudError{raw: string(body)} + if err := resp.UnmarshalAsJSON(&errType); err != nil { + return azcore.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp.Response) + } + return azcore.NewResponseError(&errType, resp.Response) +} + +// BeginUpdateTags - Updates tags on a managed cluster. +// If the operation fails it returns the *CloudError error type. +func (client *ManagedClustersClient) BeginUpdateTags(ctx context.Context, resourceGroupName string, resourceName string, parameters TagsObject, options *ManagedClustersBeginUpdateTagsOptions) (ManagedClustersUpdateTagsPollerResponse, error) { + resp, err := client.updateTags(ctx, resourceGroupName, resourceName, parameters, options) + if err != nil { + return ManagedClustersUpdateTagsPollerResponse{}, err + } + result := ManagedClustersUpdateTagsPollerResponse{ + RawResponse: resp.Response, + } + pt, err := armcore.NewLROPoller("ManagedClustersClient.UpdateTags", "", resp, client.con.Pipeline(), client.updateTagsHandleError) + if err != nil { + return ManagedClustersUpdateTagsPollerResponse{}, err + } + poller := &managedClustersUpdateTagsPoller{ + pt: pt, + } + result.Poller = poller + result.PollUntilDone = func(ctx context.Context, frequency time.Duration) (ManagedClustersUpdateTagsResponse, error) { + return poller.pollUntilDone(ctx, frequency) + } + return result, nil +} + +// ResumeUpdateTags creates a new ManagedClustersUpdateTagsPoller from the specified resume token. +// token - The value must come from a previous call to ManagedClustersUpdateTagsPoller.ResumeToken(). +func (client *ManagedClustersClient) ResumeUpdateTags(ctx context.Context, token string) (ManagedClustersUpdateTagsPollerResponse, error) { + pt, err := armcore.NewLROPollerFromResumeToken("ManagedClustersClient.UpdateTags", token, client.con.Pipeline(), client.updateTagsHandleError) + if err != nil { + return ManagedClustersUpdateTagsPollerResponse{}, err + } + poller := &managedClustersUpdateTagsPoller{ + pt: pt, + } + resp, err := poller.Poll(ctx) + if err != nil { + return ManagedClustersUpdateTagsPollerResponse{}, err + } + result := ManagedClustersUpdateTagsPollerResponse{ + RawResponse: resp, + } + result.Poller = poller + result.PollUntilDone = func(ctx context.Context, frequency time.Duration) (ManagedClustersUpdateTagsResponse, error) { + return poller.pollUntilDone(ctx, frequency) + } + return result, nil +} + +// UpdateTags - Updates tags on a managed cluster. +// If the operation fails it returns the *CloudError error type. +func (client *ManagedClustersClient) updateTags(ctx context.Context, resourceGroupName string, resourceName string, parameters TagsObject, options *ManagedClustersBeginUpdateTagsOptions) (*azcore.Response, error) { + req, err := client.updateTagsCreateRequest(ctx, resourceGroupName, resourceName, parameters, options) + if err != nil { + return nil, err + } + resp, err := client.con.Pipeline().Do(req) + if err != nil { + return nil, err + } + if !resp.HasStatusCode(http.StatusOK) { + return nil, client.updateTagsHandleError(resp) + } + return resp, nil +} + +// updateTagsCreateRequest creates the UpdateTags request. +func (client *ManagedClustersClient) updateTagsCreateRequest(ctx context.Context, resourceGroupName string, resourceName string, parameters TagsObject, options *ManagedClustersBeginUpdateTagsOptions) (*azcore.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if resourceName == "" { + return nil, errors.New("parameter resourceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceName}", url.PathEscape(resourceName)) + req, err := azcore.NewRequest(ctx, http.MethodPatch, azcore.JoinPaths(client.con.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + req.Telemetry(telemetryInfo) + reqQP := req.URL.Query() + reqQP.Set("api-version", "2021-07-01") + req.URL.RawQuery = reqQP.Encode() + req.Header.Set("Accept", "application/json") + return req, req.MarshalAsJSON(parameters) +} + +// updateTagsHandleError handles the UpdateTags error response. +func (client *ManagedClustersClient) updateTagsHandleError(resp *azcore.Response) error { + body, err := resp.Payload() + if err != nil { + return azcore.NewResponseError(err, resp.Response) + } + errType := CloudError{raw: string(body)} + if err := resp.UnmarshalAsJSON(&errType); err != nil { + return azcore.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp.Response) + } + return azcore.NewResponseError(&errType, resp.Response) +} diff --git a/sdk/containerservice/armcontainerservice/zz_generated_models.go b/sdk/containerservice/armcontainerservice/zz_generated_models.go new file mode 100644 index 000000000000..2df4d50f8e8c --- /dev/null +++ b/sdk/containerservice/armcontainerservice/zz_generated_models.go @@ -0,0 +1,2290 @@ +// +build go1.13 + +// 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. + +package armcontainerservice + +import ( + "encoding/json" + "github.com/Azure/azure-sdk-for-go/sdk/azcore" + "reflect" + "time" +) + +// AccessProfile - Profile for enabling a user to access a managed cluster. +type AccessProfile struct { + // Base64-encoded Kubernetes configuration file. + KubeConfig []byte `json:"kubeConfig,omitempty"` +} + +// MarshalJSON implements the json.Marshaller interface for type AccessProfile. +func (a AccessProfile) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populateByteArray(objectMap, "kubeConfig", a.KubeConfig, azcore.Base64StdFormat) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type AccessProfile. +func (a *AccessProfile) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return err + } + for key, val := range rawMsg { + var err error + switch key { + case "kubeConfig": + err = azcore.DecodeByteArray(string(val), &a.KubeConfig, azcore.Base64StdFormat) + delete(rawMsg, key) + } + if err != nil { + return err + } + } + return nil +} + +// AgentPool - Agent Pool. +type AgentPool struct { + SubResource + // Properties of an agent pool. + Properties *ManagedClusterAgentPoolProfileProperties `json:"properties,omitempty"` +} + +// AgentPoolAvailableVersions - The list of available versions for an agent pool. +type AgentPoolAvailableVersions struct { + // REQUIRED; Properties of agent pool available versions. + Properties *AgentPoolAvailableVersionsProperties `json:"properties,omitempty"` + + // READ-ONLY; The ID of the agent pool version list. + ID *string `json:"id,omitempty" azure:"ro"` + + // READ-ONLY; The name of the agent pool version list. + Name *string `json:"name,omitempty" azure:"ro"` + + // READ-ONLY; Type of the agent pool version list. + Type *string `json:"type,omitempty" azure:"ro"` +} + +// AgentPoolAvailableVersionsProperties - The list of available agent pool versions. +type AgentPoolAvailableVersionsProperties struct { + // List of versions available for agent pool. + AgentPoolVersions []*AgentPoolAvailableVersionsPropertiesAgentPoolVersionsItem `json:"agentPoolVersions,omitempty"` +} + +// MarshalJSON implements the json.Marshaller interface for type AgentPoolAvailableVersionsProperties. +func (a AgentPoolAvailableVersionsProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "agentPoolVersions", a.AgentPoolVersions) + return json.Marshal(objectMap) +} + +type AgentPoolAvailableVersionsPropertiesAgentPoolVersionsItem struct { + // Whether this version is the default agent pool version. + Default *bool `json:"default,omitempty"` + + // Whether Kubernetes version is currently in preview. + IsPreview *bool `json:"isPreview,omitempty"` + + // The Kubernetes version (major.minor.patch). + KubernetesVersion *string `json:"kubernetesVersion,omitempty"` +} + +// AgentPoolListResult - The response from the List Agent Pools operation. +type AgentPoolListResult struct { + // The list of agent pools. + Value []*AgentPool `json:"value,omitempty"` + + // READ-ONLY; The URL to get the next set of agent pool results. + NextLink *string `json:"nextLink,omitempty" azure:"ro"` +} + +// MarshalJSON implements the json.Marshaller interface for type AgentPoolListResult. +func (a AgentPoolListResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "nextLink", a.NextLink) + populate(objectMap, "value", a.Value) + return json.Marshal(objectMap) +} + +// AgentPoolUpgradeProfile - The list of available upgrades for an agent pool. +type AgentPoolUpgradeProfile struct { + // REQUIRED; The properties of the agent pool upgrade profile. + Properties *AgentPoolUpgradeProfileProperties `json:"properties,omitempty"` + + // READ-ONLY; The ID of the agent pool upgrade profile. + ID *string `json:"id,omitempty" azure:"ro"` + + // READ-ONLY; The name of the agent pool upgrade profile. + Name *string `json:"name,omitempty" azure:"ro"` + + // READ-ONLY; The type of the agent pool upgrade profile. + Type *string `json:"type,omitempty" azure:"ro"` +} + +// AgentPoolUpgradeProfileProperties - The list of available upgrade versions. +type AgentPoolUpgradeProfileProperties struct { + // REQUIRED; The Kubernetes version (major.minor.patch). + KubernetesVersion *string `json:"kubernetesVersion,omitempty"` + + // REQUIRED; The operating system type. The default is Linux. + OSType *OSType `json:"osType,omitempty"` + + // The latest AKS supported node image version. + LatestNodeImageVersion *string `json:"latestNodeImageVersion,omitempty"` + + // List of orchestrator types and versions available for upgrade. + Upgrades []*AgentPoolUpgradeProfilePropertiesUpgradesItem `json:"upgrades,omitempty"` +} + +// MarshalJSON implements the json.Marshaller interface for type AgentPoolUpgradeProfileProperties. +func (a AgentPoolUpgradeProfileProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "kubernetesVersion", a.KubernetesVersion) + populate(objectMap, "latestNodeImageVersion", a.LatestNodeImageVersion) + populate(objectMap, "osType", a.OSType) + populate(objectMap, "upgrades", a.Upgrades) + return json.Marshal(objectMap) +} + +type AgentPoolUpgradeProfilePropertiesUpgradesItem struct { + // Whether the Kubernetes version is currently in preview. + IsPreview *bool `json:"isPreview,omitempty"` + + // The Kubernetes version (major.minor.patch). + KubernetesVersion *string `json:"kubernetesVersion,omitempty"` +} + +// AgentPoolUpgradeSettings - Settings for upgrading an agentpool +type AgentPoolUpgradeSettings struct { + // This can either be set to an integer (e.g. '5') or a percentage (e.g. '50%'). If a percentage is specified, it is the percentage of the total agent pool + // size at the time of the upgrade. For + // percentages, fractional nodes are rounded up. If not specified, the default is 1. For more information, including best practices, see: + // https://docs.microsoft.com/azure/aks/upgrade-cluster#customize-node-surge-upgrade + MaxSurge *string `json:"maxSurge,omitempty"` +} + +// AgentPoolsBeginCreateOrUpdateOptions contains the optional parameters for the AgentPools.BeginCreateOrUpdate method. +type AgentPoolsBeginCreateOrUpdateOptions struct { + // placeholder for future optional parameters +} + +// AgentPoolsBeginDeleteOptions contains the optional parameters for the AgentPools.BeginDelete method. +type AgentPoolsBeginDeleteOptions struct { + // placeholder for future optional parameters +} + +// AgentPoolsBeginUpgradeNodeImageVersionOptions contains the optional parameters for the AgentPools.BeginUpgradeNodeImageVersion method. +type AgentPoolsBeginUpgradeNodeImageVersionOptions struct { + // placeholder for future optional parameters +} + +// AgentPoolsGetAvailableAgentPoolVersionsOptions contains the optional parameters for the AgentPools.GetAvailableAgentPoolVersions method. +type AgentPoolsGetAvailableAgentPoolVersionsOptions struct { + // placeholder for future optional parameters +} + +// AgentPoolsGetOptions contains the optional parameters for the AgentPools.Get method. +type AgentPoolsGetOptions struct { + // placeholder for future optional parameters +} + +// AgentPoolsGetUpgradeProfileOptions contains the optional parameters for the AgentPools.GetUpgradeProfile method. +type AgentPoolsGetUpgradeProfileOptions struct { + // placeholder for future optional parameters +} + +// AgentPoolsListOptions contains the optional parameters for the AgentPools.List method. +type AgentPoolsListOptions struct { + // placeholder for future optional parameters +} + +// CloudError - An error response from the Container service. +// Implements the error and azcore.HTTPResponse interfaces. +type CloudError struct { + raw string + // Details about the error. + InnerError *CloudErrorBody `json:"error,omitempty"` +} + +// Error implements the error interface for type CloudError. +// The contents of the error text are not contractual and subject to change. +func (e CloudError) Error() string { + return e.raw +} + +// CloudErrorBody - An error response from the Container service. +type CloudErrorBody struct { + // An identifier for the error. Codes are invariant and are intended to be consumed programmatically. + Code *string `json:"code,omitempty"` + + // A list of additional details about the error. + Details []*CloudErrorBody `json:"details,omitempty"` + + // A message describing the error, intended to be suitable for display in a user interface. + Message *string `json:"message,omitempty"` + + // The target of the particular error. For example, the name of the property in error. + Target *string `json:"target,omitempty"` +} + +// MarshalJSON implements the json.Marshaller interface for type CloudErrorBody. +func (c CloudErrorBody) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "code", c.Code) + populate(objectMap, "details", c.Details) + populate(objectMap, "message", c.Message) + populate(objectMap, "target", c.Target) + return json.Marshal(objectMap) +} + +// CommandResultProperties - The results of a run command +type CommandResultProperties struct { + // READ-ONLY; The exit code of the command + ExitCode *int32 `json:"exitCode,omitempty" azure:"ro"` + + // READ-ONLY; The time when the command finished. + FinishedAt *time.Time `json:"finishedAt,omitempty" azure:"ro"` + + // READ-ONLY; The command output. + Logs *string `json:"logs,omitempty" azure:"ro"` + + // READ-ONLY; provisioning State + ProvisioningState *string `json:"provisioningState,omitempty" azure:"ro"` + + // READ-ONLY; An explanation of why provisioningState is set to failed (if so). + Reason *string `json:"reason,omitempty" azure:"ro"` + + // READ-ONLY; The time when the command started. + StartedAt *time.Time `json:"startedAt,omitempty" azure:"ro"` +} + +// MarshalJSON implements the json.Marshaller interface for type CommandResultProperties. +func (c CommandResultProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "exitCode", c.ExitCode) + populate(objectMap, "finishedAt", (*timeRFC3339)(c.FinishedAt)) + populate(objectMap, "logs", c.Logs) + populate(objectMap, "provisioningState", c.ProvisioningState) + populate(objectMap, "reason", c.Reason) + populate(objectMap, "startedAt", (*timeRFC3339)(c.StartedAt)) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type CommandResultProperties. +func (c *CommandResultProperties) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return err + } + for key, val := range rawMsg { + var err error + switch key { + case "exitCode": + err = unpopulate(val, &c.ExitCode) + delete(rawMsg, key) + case "finishedAt": + var aux timeRFC3339 + err = unpopulate(val, &aux) + c.FinishedAt = (*time.Time)(&aux) + delete(rawMsg, key) + case "logs": + err = unpopulate(val, &c.Logs) + delete(rawMsg, key) + case "provisioningState": + err = unpopulate(val, &c.ProvisioningState) + delete(rawMsg, key) + case "reason": + err = unpopulate(val, &c.Reason) + delete(rawMsg, key) + case "startedAt": + var aux timeRFC3339 + err = unpopulate(val, &aux) + c.StartedAt = (*time.Time)(&aux) + delete(rawMsg, key) + } + if err != nil { + return err + } + } + return nil +} + +// ContainerServiceDiagnosticsProfile - Profile for diagnostics on the container service cluster. +type ContainerServiceDiagnosticsProfile struct { + // REQUIRED; Profile for diagnostics on the container service VMs. + VMDiagnostics *ContainerServiceVMDiagnostics `json:"vmDiagnostics,omitempty"` +} + +// ContainerServiceLinuxProfile - Profile for Linux VMs in the container service cluster. +type ContainerServiceLinuxProfile struct { + // REQUIRED; The administrator username to use for Linux VMs. + AdminUsername *string `json:"adminUsername,omitempty"` + + // REQUIRED; The SSH configuration for Linux-based VMs running on Azure. + SSH *ContainerServiceSSHConfiguration `json:"ssh,omitempty"` +} + +// ContainerServiceMasterProfile - Profile for the container service master. +type ContainerServiceMasterProfile struct { + // REQUIRED; DNS prefix to be used to create the FQDN for the master pool. + DNSPrefix *string `json:"dnsPrefix,omitempty"` + + // REQUIRED; Size of agent VMs. + VMSize *ContainerServiceVMSizeTypes `json:"vmSize,omitempty"` + + // Number of masters (VMs) in the container service cluster. Allowed values are 1, 3, and 5. The default value is 1. + Count *Count `json:"count,omitempty"` + + // FirstConsecutiveStaticIP used to specify the first static ip of masters. + FirstConsecutiveStaticIP *string `json:"firstConsecutiveStaticIP,omitempty"` + + // OS Disk Size in GB to be used to specify the disk size for every machine in this master/agent pool. If you specify 0, it will apply the default osDisk + // size according to the vmSize specified. + OSDiskSizeGB *int32 `json:"osDiskSizeGB,omitempty"` + + // Storage profile specifies what kind of storage used. Choose from StorageAccount and ManagedDisks. Leave it empty, we will choose for you based on the + // orchestrator choice. + StorageProfile *ContainerServiceStorageProfileTypes `json:"storageProfile,omitempty"` + + // VNet SubnetID specifies the VNet's subnet identifier. + VnetSubnetID *string `json:"vnetSubnetID,omitempty"` + + // READ-ONLY; FQDN for the master pool. + Fqdn *string `json:"fqdn,omitempty" azure:"ro"` +} + +// ContainerServiceNetworkProfile - Profile of network configuration. +type ContainerServiceNetworkProfile struct { + // An IP address assigned to the Kubernetes DNS service. It must be within the Kubernetes service address range specified in serviceCidr. + DNSServiceIP *string `json:"dnsServiceIP,omitempty"` + + // A CIDR notation IP range assigned to the Docker bridge network. It must not overlap with any Subnet IP ranges or the Kubernetes service address range. + DockerBridgeCidr *string `json:"dockerBridgeCidr,omitempty"` + + // Profile of the cluster load balancer. + LoadBalancerProfile *ManagedClusterLoadBalancerProfile `json:"loadBalancerProfile,omitempty"` + + // The default is 'standard'. See Azure Load Balancer SKUs [https://docs.microsoft.com/azure/load-balancer/skus] for more information about the differences + // between load balancer SKUs. + LoadBalancerSKU *LoadBalancerSKU `json:"loadBalancerSku,omitempty"` + + // Profile of the cluster NAT gateway. + NatGatewayProfile *ManagedClusterNATGatewayProfile `json:"natGatewayProfile,omitempty"` + + // This cannot be specified if networkPlugin is anything other than 'azure'. + NetworkMode *NetworkMode `json:"networkMode,omitempty"` + + // Network plugin used for building the Kubernetes network. + NetworkPlugin *NetworkPlugin `json:"networkPlugin,omitempty"` + + // Network policy used for building the Kubernetes network. + NetworkPolicy *NetworkPolicy `json:"networkPolicy,omitempty"` + + // This can only be set at cluster creation time and cannot be changed later. For more information see egress outbound type [https://docs.microsoft.com/azure/aks/egress-outboundtype]. + OutboundType *OutboundType `json:"outboundType,omitempty"` + + // A CIDR notation IP range from which to assign pod IPs when kubenet is used. + PodCidr *string `json:"podCidr,omitempty"` + + // A CIDR notation IP range from which to assign service cluster IPs. It must not overlap with any Subnet IP ranges. + ServiceCidr *string `json:"serviceCidr,omitempty"` +} + +// ContainerServiceSSHConfiguration - SSH configuration for Linux-based VMs running on Azure. +type ContainerServiceSSHConfiguration struct { + // REQUIRED; The list of SSH public keys used to authenticate with Linux-based VMs. A maximum of 1 key may be specified. + PublicKeys []*ContainerServiceSSHPublicKey `json:"publicKeys,omitempty"` +} + +// MarshalJSON implements the json.Marshaller interface for type ContainerServiceSSHConfiguration. +func (c ContainerServiceSSHConfiguration) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "publicKeys", c.PublicKeys) + return json.Marshal(objectMap) +} + +// ContainerServiceSSHPublicKey - Contains information about SSH certificate public key data. +type ContainerServiceSSHPublicKey struct { + // REQUIRED; Certificate public key used to authenticate with VMs through SSH. The certificate must be in PEM format with or without headers. + KeyData *string `json:"keyData,omitempty"` +} + +// ContainerServiceVMDiagnostics - Profile for diagnostics on the container service VMs. +type ContainerServiceVMDiagnostics struct { + // REQUIRED; Whether the VM diagnostic agent is provisioned on the VM. + Enabled *bool `json:"enabled,omitempty"` + + // READ-ONLY; The URI of the storage account where diagnostics are stored. + StorageURI *string `json:"storageUri,omitempty" azure:"ro"` +} + +// CredentialResult - The credential result response. +type CredentialResult struct { + // READ-ONLY; The name of the credential. + Name *string `json:"name,omitempty" azure:"ro"` + + // READ-ONLY; Base64-encoded Kubernetes configuration file. + Value []byte `json:"value,omitempty" azure:"ro"` +} + +// MarshalJSON implements the json.Marshaller interface for type CredentialResult. +func (c CredentialResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "name", c.Name) + populateByteArray(objectMap, "value", c.Value, azcore.Base64StdFormat) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type CredentialResult. +func (c *CredentialResult) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return err + } + for key, val := range rawMsg { + var err error + switch key { + case "name": + err = unpopulate(val, &c.Name) + delete(rawMsg, key) + case "value": + err = azcore.DecodeByteArray(string(val), &c.Value, azcore.Base64StdFormat) + delete(rawMsg, key) + } + if err != nil { + return err + } + } + return nil +} + +// CredentialResults - The list credential result response. +type CredentialResults struct { + // READ-ONLY; Base64-encoded Kubernetes configuration file. + Kubeconfigs []*CredentialResult `json:"kubeconfigs,omitempty" azure:"ro"` +} + +// MarshalJSON implements the json.Marshaller interface for type CredentialResults. +func (c CredentialResults) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "kubeconfigs", c.Kubeconfigs) + return json.Marshal(objectMap) +} + +// EndpointDependency - A domain name that AKS agent nodes are reaching at. +type EndpointDependency struct { + // The domain name of the dependency. + DomainName *string `json:"domainName,omitempty"` + + // The Ports and Protocols used when connecting to domainName. + EndpointDetails []*EndpointDetail `json:"endpointDetails,omitempty"` +} + +// MarshalJSON implements the json.Marshaller interface for type EndpointDependency. +func (e EndpointDependency) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "domainName", e.DomainName) + populate(objectMap, "endpointDetails", e.EndpointDetails) + return json.Marshal(objectMap) +} + +// EndpointDetail - connect information from the AKS agent nodes to a single endpoint. +type EndpointDetail struct { + // Description of the detail + Description *string `json:"description,omitempty"` + + // An IP Address that Domain Name currently resolves to. + IPAddress *string `json:"ipAddress,omitempty"` + + // The port an endpoint is connected to. + Port *int32 `json:"port,omitempty"` + + // The protocol used for connection + Protocol *string `json:"protocol,omitempty"` +} + +// ExtendedLocation - The complex type of the extended location. +type ExtendedLocation struct { + // The name of the extended location. + Name *string `json:"name,omitempty"` + + // The type of the extended location. + Type *ExtendedLocationTypes `json:"type,omitempty"` +} + +// KubeletConfig - See AKS custom node configuration [https://docs.microsoft.com/azure/aks/custom-node-configuration] for more details. +type KubeletConfig struct { + // Allowed list of unsafe sysctls or unsafe sysctl patterns (ending in *). + AllowedUnsafeSysctls []*string `json:"allowedUnsafeSysctls,omitempty"` + + // The default is true. + CPUCfsQuota *bool `json:"cpuCfsQuota,omitempty"` + + // The default is '100ms.' Valid values are a sequence of decimal numbers with an optional fraction and a unit suffix. For example: '300ms', '2h45m'. Supported + // units are 'ns', 'us', 'ms', 's', 'm', and + // 'h'. + CPUCfsQuotaPeriod *string `json:"cpuCfsQuotaPeriod,omitempty"` + + // The default is 'none'. See Kubernetes CPU management policies [https://kubernetes.io/docs/tasks/administer-cluster/cpu-management-policies/#cpu-management-policies] + // for more information. Allowed + // values are 'none' and 'static'. + CPUManagerPolicy *string `json:"cpuManagerPolicy,omitempty"` + + // The maximum number of container log files that can be present for a container. The number must be ≥ 2. + ContainerLogMaxFiles *int32 `json:"containerLogMaxFiles,omitempty"` + + // The maximum size (e.g. 10Mi) of container log file before it is rotated. + ContainerLogMaxSizeMB *int32 `json:"containerLogMaxSizeMB,omitempty"` + + // If set to true it will make the Kubelet fail to start if swap is enabled on the node. + FailSwapOn *bool `json:"failSwapOn,omitempty"` + + // To disable image garbage collection, set to 100. The default is 85% + ImageGcHighThreshold *int32 `json:"imageGcHighThreshold,omitempty"` + + // This cannot be set higher than imageGcHighThreshold. The default is 80% + ImageGcLowThreshold *int32 `json:"imageGcLowThreshold,omitempty"` + + // The maximum number of processes per pod. + PodMaxPids *int32 `json:"podMaxPids,omitempty"` + + // For more information see Kubernetes Topology Manager [https://kubernetes.io/docs/tasks/administer-cluster/topology-manager]. The default is 'none'. Allowed + // values are 'none', 'best-effort', + // 'restricted', and 'single-numa-node'. + TopologyManagerPolicy *string `json:"topologyManagerPolicy,omitempty"` +} + +// MarshalJSON implements the json.Marshaller interface for type KubeletConfig. +func (k KubeletConfig) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "allowedUnsafeSysctls", k.AllowedUnsafeSysctls) + populate(objectMap, "cpuCfsQuota", k.CPUCfsQuota) + populate(objectMap, "cpuCfsQuotaPeriod", k.CPUCfsQuotaPeriod) + populate(objectMap, "cpuManagerPolicy", k.CPUManagerPolicy) + populate(objectMap, "containerLogMaxFiles", k.ContainerLogMaxFiles) + populate(objectMap, "containerLogMaxSizeMB", k.ContainerLogMaxSizeMB) + populate(objectMap, "failSwapOn", k.FailSwapOn) + populate(objectMap, "imageGcHighThreshold", k.ImageGcHighThreshold) + populate(objectMap, "imageGcLowThreshold", k.ImageGcLowThreshold) + populate(objectMap, "podMaxPids", k.PodMaxPids) + populate(objectMap, "topologyManagerPolicy", k.TopologyManagerPolicy) + return json.Marshal(objectMap) +} + +// LinuxOSConfig - See AKS custom node configuration [https://docs.microsoft.com/azure/aks/custom-node-configuration] for more details. +type LinuxOSConfig struct { + // The size in MB of a swap file that will be created on each node. + SwapFileSizeMB *int32 `json:"swapFileSizeMB,omitempty"` + + // Sysctl settings for Linux agent nodes. + Sysctls *SysctlConfig `json:"sysctls,omitempty"` + + // Valid values are 'always', 'defer', 'defer+madvise', 'madvise' and 'never'. The default is 'madvise'. For more information see Transparent Hugepages + // [https://www.kernel.org/doc/html/latest/admin-guide/mm/transhuge.html#admin-guide-transhuge]. + TransparentHugePageDefrag *string `json:"transparentHugePageDefrag,omitempty"` + + // Valid values are 'always', 'madvise', and 'never'. The default is 'always'. For more information see Transparent Hugepages + // [https://www.kernel.org/doc/html/latest/admin-guide/mm/transhuge.html#admin-guide-transhuge]. + TransparentHugePageEnabled *string `json:"transparentHugePageEnabled,omitempty"` +} + +// MaintenanceConfiguration - See planned maintenance [https://docs.microsoft.com/azure/aks/planned-maintenance] for more information about planned maintenance. +type MaintenanceConfiguration struct { + SubResource + // Properties of a default maintenance configuration. + Properties *MaintenanceConfigurationProperties `json:"properties,omitempty"` + + // READ-ONLY; The system metadata relating to this resource. + SystemData *SystemData `json:"systemData,omitempty" azure:"ro"` +} + +// MaintenanceConfigurationListResult - The response from the List maintenance configurations operation. +type MaintenanceConfigurationListResult struct { + // The list of maintenance configurations. + Value []*MaintenanceConfiguration `json:"value,omitempty"` + + // READ-ONLY; The URL to get the next set of maintenance configuration results. + NextLink *string `json:"nextLink,omitempty" azure:"ro"` +} + +// MarshalJSON implements the json.Marshaller interface for type MaintenanceConfigurationListResult. +func (m MaintenanceConfigurationListResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "nextLink", m.NextLink) + populate(objectMap, "value", m.Value) + return json.Marshal(objectMap) +} + +// MaintenanceConfigurationProperties - Properties used to configure planned maintenance for a Managed Cluster. +type MaintenanceConfigurationProperties struct { + // Time slots on which upgrade is not allowed. + NotAllowedTime []*TimeSpan `json:"notAllowedTime,omitempty"` + + // If two array entries specify the same day of the week, the applied configuration is the union of times in both entries. + TimeInWeek []*TimeInWeek `json:"timeInWeek,omitempty"` +} + +// MarshalJSON implements the json.Marshaller interface for type MaintenanceConfigurationProperties. +func (m MaintenanceConfigurationProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "notAllowedTime", m.NotAllowedTime) + populate(objectMap, "timeInWeek", m.TimeInWeek) + return json.Marshal(objectMap) +} + +// MaintenanceConfigurationsCreateOrUpdateOptions contains the optional parameters for the MaintenanceConfigurations.CreateOrUpdate method. +type MaintenanceConfigurationsCreateOrUpdateOptions struct { + // placeholder for future optional parameters +} + +// MaintenanceConfigurationsDeleteOptions contains the optional parameters for the MaintenanceConfigurations.Delete method. +type MaintenanceConfigurationsDeleteOptions struct { + // placeholder for future optional parameters +} + +// MaintenanceConfigurationsGetOptions contains the optional parameters for the MaintenanceConfigurations.Get method. +type MaintenanceConfigurationsGetOptions struct { + // placeholder for future optional parameters +} + +// MaintenanceConfigurationsListByManagedClusterOptions contains the optional parameters for the MaintenanceConfigurations.ListByManagedCluster method. +type MaintenanceConfigurationsListByManagedClusterOptions struct { + // placeholder for future optional parameters +} + +// ManagedCluster - Managed cluster. +type ManagedCluster struct { + Resource + // The extended location of the Virtual Machine. + ExtendedLocation *ExtendedLocation `json:"extendedLocation,omitempty"` + + // The identity of the managed cluster, if configured. + Identity *ManagedClusterIdentity `json:"identity,omitempty"` + + // Properties of a managed cluster. + Properties *ManagedClusterProperties `json:"properties,omitempty"` + + // The managed cluster SKU. + SKU *ManagedClusterSKU `json:"sku,omitempty"` +} + +// MarshalJSON implements the json.Marshaller interface for type ManagedCluster. +func (m ManagedCluster) MarshalJSON() ([]byte, error) { + objectMap := m.Resource.marshalInternal() + populate(objectMap, "extendedLocation", m.ExtendedLocation) + populate(objectMap, "identity", m.Identity) + populate(objectMap, "properties", m.Properties) + populate(objectMap, "sku", m.SKU) + return json.Marshal(objectMap) +} + +// ManagedClusterAADProfile - For more details see managed AAD on AKS [https://docs.microsoft.com/azure/aks/managed-aad]. +type ManagedClusterAADProfile struct { + // The list of AAD group object IDs that will have admin role of the cluster. + AdminGroupObjectIDs []*string `json:"adminGroupObjectIDs,omitempty"` + + // The client AAD application ID. + ClientAppID *string `json:"clientAppID,omitempty"` + + // Whether to enable Azure RBAC for Kubernetes authorization. + EnableAzureRBAC *bool `json:"enableAzureRBAC,omitempty"` + + // Whether to enable managed AAD. + Managed *bool `json:"managed,omitempty"` + + // The server AAD application ID. + ServerAppID *string `json:"serverAppID,omitempty"` + + // The server AAD application secret. + ServerAppSecret *string `json:"serverAppSecret,omitempty"` + + // The AAD tenant ID to use for authentication. If not specified, will use the tenant of the deployment subscription. + TenantID *string `json:"tenantID,omitempty"` +} + +// MarshalJSON implements the json.Marshaller interface for type ManagedClusterAADProfile. +func (m ManagedClusterAADProfile) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "adminGroupObjectIDs", m.AdminGroupObjectIDs) + populate(objectMap, "clientAppID", m.ClientAppID) + populate(objectMap, "enableAzureRBAC", m.EnableAzureRBAC) + populate(objectMap, "managed", m.Managed) + populate(objectMap, "serverAppID", m.ServerAppID) + populate(objectMap, "serverAppSecret", m.ServerAppSecret) + populate(objectMap, "tenantID", m.TenantID) + return json.Marshal(objectMap) +} + +// ManagedClusterAPIServerAccessProfile - Access profile for managed cluster API server. +type ManagedClusterAPIServerAccessProfile struct { + // IP ranges are specified in CIDR format, e.g. 137.117.106.88/29. This feature is not compatible with clusters that use Public IP Per Node, or clusters + // that are using a Basic Load Balancer. For more + // information see API server authorized IP ranges [https://docs.microsoft.com/azure/aks/api-server-authorized-ip-ranges]. + AuthorizedIPRanges []*string `json:"authorizedIPRanges,omitempty"` + + // For more details, see Creating a private AKS cluster [https://docs.microsoft.com/azure/aks/private-clusters]. + EnablePrivateCluster *bool `json:"enablePrivateCluster,omitempty"` + + // Whether to create additional public FQDN for private cluster or not. + EnablePrivateClusterPublicFQDN *bool `json:"enablePrivateClusterPublicFQDN,omitempty"` + + // The default is System. For more details see configure private DNS zone [https://docs.microsoft.com/azure/aks/private-clusters#configure-private-dns-zone]. + // Allowed values are 'system' and 'none'. + PrivateDNSZone *string `json:"privateDNSZone,omitempty"` +} + +// MarshalJSON implements the json.Marshaller interface for type ManagedClusterAPIServerAccessProfile. +func (m ManagedClusterAPIServerAccessProfile) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "authorizedIPRanges", m.AuthorizedIPRanges) + populate(objectMap, "enablePrivateCluster", m.EnablePrivateCluster) + populate(objectMap, "enablePrivateClusterPublicFQDN", m.EnablePrivateClusterPublicFQDN) + populate(objectMap, "privateDNSZone", m.PrivateDNSZone) + return json.Marshal(objectMap) +} + +// ManagedClusterAccessProfile - Managed cluster Access Profile. +type ManagedClusterAccessProfile struct { + Resource + // AccessProfile of a managed cluster. + Properties *AccessProfile `json:"properties,omitempty"` +} + +// MarshalJSON implements the json.Marshaller interface for type ManagedClusterAccessProfile. +func (m ManagedClusterAccessProfile) MarshalJSON() ([]byte, error) { + objectMap := m.Resource.marshalInternal() + populate(objectMap, "properties", m.Properties) + return json.Marshal(objectMap) +} + +// ManagedClusterAddonProfile - A Kubernetes add-on profile for a managed cluster. +type ManagedClusterAddonProfile struct { + // REQUIRED; Whether the add-on is enabled or not. + Enabled *bool `json:"enabled,omitempty"` + + // Key-value pairs for configuring an add-on. + Config map[string]*string `json:"config,omitempty"` + + // READ-ONLY; Information of user assigned identity used by this add-on. + Identity *ManagedClusterAddonProfileIdentity `json:"identity,omitempty" azure:"ro"` +} + +// MarshalJSON implements the json.Marshaller interface for type ManagedClusterAddonProfile. +func (m ManagedClusterAddonProfile) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "config", m.Config) + populate(objectMap, "enabled", m.Enabled) + populate(objectMap, "identity", m.Identity) + return json.Marshal(objectMap) +} + +// ManagedClusterAddonProfileIdentity - Information of user assigned identity used by this add-on. +type ManagedClusterAddonProfileIdentity struct { + UserAssignedIdentity +} + +// ManagedClusterAgentPoolProfile - Profile for the container service agent pool. +type ManagedClusterAgentPoolProfile struct { + ManagedClusterAgentPoolProfileProperties + // REQUIRED; Windows agent pool names must be 6 characters or less. + Name *string `json:"name,omitempty"` +} + +// MarshalJSON implements the json.Marshaller interface for type ManagedClusterAgentPoolProfile. +func (m ManagedClusterAgentPoolProfile) MarshalJSON() ([]byte, error) { + objectMap := m.ManagedClusterAgentPoolProfileProperties.marshalInternal() + populate(objectMap, "name", m.Name) + return json.Marshal(objectMap) +} + +// ManagedClusterAgentPoolProfileProperties - Properties for the container service agent pool profile. +type ManagedClusterAgentPoolProfileProperties struct { + // The list of Availability zones to use for nodes. This can only be specified if the AgentPoolType property is 'VirtualMachineScaleSets'. + AvailabilityZones []*string `json:"availabilityZones,omitempty"` + + // Number of agents (VMs) to host docker containers. Allowed values must be in the range of 0 to 1000 (inclusive) for user pools and in the range of 1 to + // 1000 (inclusive) for system pools. The default + // value is 1. + Count *int32 `json:"count,omitempty"` + + // Whether to enable auto-scaler + EnableAutoScaling *bool `json:"enableAutoScaling,omitempty"` + + // This is only supported on certain VM sizes and in certain Azure regions. For more information, see: https://docs.microsoft.com/azure/aks/enable-host-encryption + EnableEncryptionAtHost *bool `json:"enableEncryptionAtHost,omitempty"` + + // See Add a FIPS-enabled node pool [https://docs.microsoft.com/azure/aks/use-multiple-node-pools#add-a-fips-enabled-node-pool-preview] for more details. + EnableFIPS *bool `json:"enableFIPS,omitempty"` + + // Some scenarios may require nodes in a node pool to receive their own dedicated public IP addresses. A common scenario is for gaming workloads, where + // a console needs to make a direct connection to a + // cloud virtual machine to minimize hops. For more information see assigning a public IP per node + // [https://docs.microsoft.com/azure/aks/use-multiple-node-pools#assign-a-public-ip-per-node-for-your-node-pools]. The default is false. + EnableNodePublicIP *bool `json:"enableNodePublicIP,omitempty"` + + // Whether to enable UltraSSD + EnableUltraSSD *bool `json:"enableUltraSSD,omitempty"` + + // GPUInstanceProfile to be used to specify GPU MIG instance profile for supported GPU VM SKU. + GpuInstanceProfile *GPUInstanceProfile `json:"gpuInstanceProfile,omitempty"` + + // The Kubelet configuration on the agent pool nodes. + KubeletConfig *KubeletConfig `json:"kubeletConfig,omitempty"` + + // Determines the placement of emptyDir volumes, container runtime data root, and Kubelet ephemeral storage. + KubeletDiskType *KubeletDiskType `json:"kubeletDiskType,omitempty"` + + // The OS configuration of Linux agent nodes. + LinuxOSConfig *LinuxOSConfig `json:"linuxOSConfig,omitempty"` + + // The maximum number of nodes for auto-scaling + MaxCount *int32 `json:"maxCount,omitempty"` + + // The maximum number of pods that can run on a node. + MaxPods *int32 `json:"maxPods,omitempty"` + + // The minimum number of nodes for auto-scaling + MinCount *int32 `json:"minCount,omitempty"` + + // A cluster must have at least one 'System' Agent Pool at all times. For additional information on agent pool restrictions and best practices, see: https://docs.microsoft.com/azure/aks/use-system-pools + Mode *AgentPoolMode `json:"mode,omitempty"` + + // The node labels to be persisted across all nodes in agent pool. + NodeLabels map[string]*string `json:"nodeLabels,omitempty"` + + // This is of the form: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/publicIPPrefixes/{publicIPPrefixName} + NodePublicIPPrefixID *string `json:"nodePublicIPPrefixID,omitempty"` + + // The taints added to new nodes during node pool create and scale. For example, key=value:NoSchedule. + NodeTaints []*string `json:"nodeTaints,omitempty"` + + // OS Disk Size in GB to be used to specify the disk size for every machine in the master/agent pool. If you specify 0, it will apply the default osDisk + // size according to the vmSize specified. + OSDiskSizeGB *int32 `json:"osDiskSizeGB,omitempty"` + + // The default is 'Ephemeral' if the VM supports it and has a cache disk larger than the requested OSDiskSizeGB. Otherwise, defaults to 'Managed'. May not + // be changed after creation. For more information + // see Ephemeral OS [https://docs.microsoft.com/azure/aks/cluster-configuration#ephemeral-os]. + OSDiskType *OSDiskType `json:"osDiskType,omitempty"` + + // Specifies an OS SKU. This value must not be specified if OSType is Windows. + OSSKU *OSSKU `json:"osSKU,omitempty"` + + // The operating system type. The default is Linux. + OSType *OSType `json:"osType,omitempty"` + + // As a best practice, you should upgrade all node pools in an AKS cluster to the same Kubernetes version. The node pool version must have the same major + // version as the control plane. The node pool minor + // version must be within two minor versions of the control plane version. The node pool version cannot be greater than the control plane version. For more + // information see upgrading a node pool + // [https://docs.microsoft.com/azure/aks/use-multiple-node-pools#upgrade-a-node-pool]. + OrchestratorVersion *string `json:"orchestratorVersion,omitempty"` + + // If omitted, pod IPs are statically assigned on the node subnet (see vnetSubnetID for more details). This is of the form: + // /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/subnets/{subnetName} + PodSubnetID *string `json:"podSubnetID,omitempty"` + + // The ID for Proximity Placement Group. + ProximityPlacementGroupID *string `json:"proximityPlacementGroupID,omitempty"` + + // This also effects the cluster autoscaler behavior. If not specified, it defaults to Delete. + ScaleDownMode *ScaleDownMode `json:"scaleDownMode,omitempty"` + + // This cannot be specified unless the scaleSetPriority is 'Spot'. If not specified, the default is 'Delete'. + ScaleSetEvictionPolicy *ScaleSetEvictionPolicy `json:"scaleSetEvictionPolicy,omitempty"` + + // The Virtual Machine Scale Set priority. If not specified, the default is 'Regular'. + ScaleSetPriority *ScaleSetPriority `json:"scaleSetPriority,omitempty"` + + // Possible values are any decimal value greater than zero or -1 which indicates the willingness to pay any on-demand price. For more details on spot pricing, + // see spot VMs pricing + // [https://docs.microsoft.com/azure/virtual-machines/spot-vms#pricing] + SpotMaxPrice *float32 `json:"spotMaxPrice,omitempty"` + + // The tags to be persisted on the agent pool virtual machine scale set. + Tags map[string]*string `json:"tags,omitempty"` + + // The type of Agent Pool. + Type *AgentPoolType `json:"type,omitempty"` + + // Settings for upgrading the agentpool + UpgradeSettings *AgentPoolUpgradeSettings `json:"upgradeSettings,omitempty"` + + // VM size availability varies by region. If a node contains insufficient compute resources (memory, cpu, etc) pods might fail to run correctly. For more + // details on restricted VM sizes, see: + // https://docs.microsoft.com/azure/aks/quotas-skus-regions + VMSize *string `json:"vmSize,omitempty"` + + // If this is not specified, a VNET and subnet will be generated and used. If no podSubnetID is specified, this applies to nodes and pods, otherwise it + // applies to just nodes. This is of the form: + // /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/subnets/{subnetName} + VnetSubnetID *string `json:"vnetSubnetID,omitempty"` + + // READ-ONLY; The version of node image + NodeImageVersion *string `json:"nodeImageVersion,omitempty" azure:"ro"` + + // READ-ONLY; Describes whether the Agent Pool is Running or Stopped + PowerState *PowerState `json:"powerState,omitempty" azure:"ro"` + + // READ-ONLY; The current deployment or provisioning state. + ProvisioningState *string `json:"provisioningState,omitempty" azure:"ro"` +} + +// MarshalJSON implements the json.Marshaller interface for type ManagedClusterAgentPoolProfileProperties. +func (m ManagedClusterAgentPoolProfileProperties) MarshalJSON() ([]byte, error) { + objectMap := m.marshalInternal() + return json.Marshal(objectMap) +} + +func (m ManagedClusterAgentPoolProfileProperties) marshalInternal() map[string]interface{} { + objectMap := make(map[string]interface{}) + populate(objectMap, "availabilityZones", m.AvailabilityZones) + populate(objectMap, "count", m.Count) + populate(objectMap, "enableAutoScaling", m.EnableAutoScaling) + populate(objectMap, "enableEncryptionAtHost", m.EnableEncryptionAtHost) + populate(objectMap, "enableFIPS", m.EnableFIPS) + populate(objectMap, "enableNodePublicIP", m.EnableNodePublicIP) + populate(objectMap, "enableUltraSSD", m.EnableUltraSSD) + populate(objectMap, "gpuInstanceProfile", m.GpuInstanceProfile) + populate(objectMap, "kubeletConfig", m.KubeletConfig) + populate(objectMap, "kubeletDiskType", m.KubeletDiskType) + populate(objectMap, "linuxOSConfig", m.LinuxOSConfig) + populate(objectMap, "maxCount", m.MaxCount) + populate(objectMap, "maxPods", m.MaxPods) + populate(objectMap, "minCount", m.MinCount) + populate(objectMap, "mode", m.Mode) + populate(objectMap, "nodeImageVersion", m.NodeImageVersion) + populate(objectMap, "nodeLabels", m.NodeLabels) + populate(objectMap, "nodePublicIPPrefixID", m.NodePublicIPPrefixID) + populate(objectMap, "nodeTaints", m.NodeTaints) + populate(objectMap, "osDiskSizeGB", m.OSDiskSizeGB) + populate(objectMap, "osDiskType", m.OSDiskType) + populate(objectMap, "osSKU", m.OSSKU) + populate(objectMap, "osType", m.OSType) + populate(objectMap, "orchestratorVersion", m.OrchestratorVersion) + populate(objectMap, "podSubnetID", m.PodSubnetID) + populate(objectMap, "powerState", m.PowerState) + populate(objectMap, "provisioningState", m.ProvisioningState) + populate(objectMap, "proximityPlacementGroupID", m.ProximityPlacementGroupID) + populate(objectMap, "scaleDownMode", m.ScaleDownMode) + populate(objectMap, "scaleSetEvictionPolicy", m.ScaleSetEvictionPolicy) + populate(objectMap, "scaleSetPriority", m.ScaleSetPriority) + populate(objectMap, "spotMaxPrice", m.SpotMaxPrice) + populate(objectMap, "tags", m.Tags) + populate(objectMap, "type", m.Type) + populate(objectMap, "upgradeSettings", m.UpgradeSettings) + populate(objectMap, "vmSize", m.VMSize) + populate(objectMap, "vnetSubnetID", m.VnetSubnetID) + return objectMap +} + +// ManagedClusterAutoUpgradeProfile - Auto upgrade profile for a managed cluster. +type ManagedClusterAutoUpgradeProfile struct { + // For more information see setting the AKS cluster auto-upgrade channel [https://docs.microsoft.com/azure/aks/upgrade-cluster#set-auto-upgrade-channel]. + UpgradeChannel *UpgradeChannel `json:"upgradeChannel,omitempty"` +} + +// ManagedClusterHTTPProxyConfig - Cluster HTTP proxy configuration. +type ManagedClusterHTTPProxyConfig struct { + // The HTTP proxy server endpoint to use. + HTTPProxy *string `json:"httpProxy,omitempty"` + + // The HTTPS proxy server endpoint to use. + HTTPSProxy *string `json:"httpsProxy,omitempty"` + + // The endpoints that should not go through proxy. + NoProxy []*string `json:"noProxy,omitempty"` + + // Alternative CA cert to use for connecting to proxy servers. + TrustedCa *string `json:"trustedCa,omitempty"` +} + +// MarshalJSON implements the json.Marshaller interface for type ManagedClusterHTTPProxyConfig. +func (m ManagedClusterHTTPProxyConfig) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "httpProxy", m.HTTPProxy) + populate(objectMap, "httpsProxy", m.HTTPSProxy) + populate(objectMap, "noProxy", m.NoProxy) + populate(objectMap, "trustedCa", m.TrustedCa) + return json.Marshal(objectMap) +} + +// ManagedClusterIdentity - Identity for the managed cluster. +type ManagedClusterIdentity struct { + // For more information see use managed identities in AKS [https://docs.microsoft.com/azure/aks/use-managed-identity]. + Type *ResourceIdentityType `json:"type,omitempty"` + + // The keys must be ARM resource IDs in the form: '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'. + UserAssignedIdentities map[string]*ManagedServiceIdentityUserAssignedIdentitiesValue `json:"userAssignedIdentities,omitempty"` + + // READ-ONLY; The principal id of the system assigned identity which is used by master components. + PrincipalID *string `json:"principalId,omitempty" azure:"ro"` + + // READ-ONLY; The tenant id of the system assigned identity which is used by master components. + TenantID *string `json:"tenantId,omitempty" azure:"ro"` +} + +// MarshalJSON implements the json.Marshaller interface for type ManagedClusterIdentity. +func (m ManagedClusterIdentity) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "principalId", m.PrincipalID) + populate(objectMap, "tenantId", m.TenantID) + populate(objectMap, "type", m.Type) + populate(objectMap, "userAssignedIdentities", m.UserAssignedIdentities) + return json.Marshal(objectMap) +} + +// ManagedClusterListResult - The response from the List Managed Clusters operation. +type ManagedClusterListResult struct { + // The list of managed clusters. + Value []*ManagedCluster `json:"value,omitempty"` + + // READ-ONLY; The URL to get the next set of managed cluster results. + NextLink *string `json:"nextLink,omitempty" azure:"ro"` +} + +// MarshalJSON implements the json.Marshaller interface for type ManagedClusterListResult. +func (m ManagedClusterListResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "nextLink", m.NextLink) + populate(objectMap, "value", m.Value) + return json.Marshal(objectMap) +} + +// ManagedClusterLoadBalancerProfile - Profile of the managed cluster load balancer. +type ManagedClusterLoadBalancerProfile struct { + // The desired number of allocated SNAT ports per VM. Allowed values are in the range of 0 to 64000 (inclusive). The default value is 0 which results in + // Azure dynamically allocating ports. + AllocatedOutboundPorts *int32 `json:"allocatedOutboundPorts,omitempty"` + + // The effective outbound IP resources of the cluster load balancer. + EffectiveOutboundIPs []*ResourceReference `json:"effectiveOutboundIPs,omitempty"` + + // Desired outbound flow idle timeout in minutes. Allowed values are in the range of 4 to 120 (inclusive). The default value is 30 minutes. + IdleTimeoutInMinutes *int32 `json:"idleTimeoutInMinutes,omitempty"` + + // Desired managed outbound IPs for the cluster load balancer. + ManagedOutboundIPs *ManagedClusterLoadBalancerProfileManagedOutboundIPs `json:"managedOutboundIPs,omitempty"` + + // Desired outbound IP Prefix resources for the cluster load balancer. + OutboundIPPrefixes *ManagedClusterLoadBalancerProfileOutboundIPPrefixes `json:"outboundIPPrefixes,omitempty"` + + // Desired outbound IP resources for the cluster load balancer. + OutboundIPs *ManagedClusterLoadBalancerProfileOutboundIPs `json:"outboundIPs,omitempty"` +} + +// MarshalJSON implements the json.Marshaller interface for type ManagedClusterLoadBalancerProfile. +func (m ManagedClusterLoadBalancerProfile) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "allocatedOutboundPorts", m.AllocatedOutboundPorts) + populate(objectMap, "effectiveOutboundIPs", m.EffectiveOutboundIPs) + populate(objectMap, "idleTimeoutInMinutes", m.IdleTimeoutInMinutes) + populate(objectMap, "managedOutboundIPs", m.ManagedOutboundIPs) + populate(objectMap, "outboundIPPrefixes", m.OutboundIPPrefixes) + populate(objectMap, "outboundIPs", m.OutboundIPs) + return json.Marshal(objectMap) +} + +// ManagedClusterLoadBalancerProfileManagedOutboundIPs - Desired managed outbound IPs for the cluster load balancer. +type ManagedClusterLoadBalancerProfileManagedOutboundIPs struct { + // The desired number of outbound IPs created/managed by Azure for the cluster load balancer. Allowed values must be in the range of 1 to 100 (inclusive). + // The default value is 1. + Count *int32 `json:"count,omitempty"` +} + +// ManagedClusterLoadBalancerProfileOutboundIPPrefixes - Desired outbound IP Prefix resources for the cluster load balancer. +type ManagedClusterLoadBalancerProfileOutboundIPPrefixes struct { + // A list of public IP prefix resources. + PublicIPPrefixes []*ResourceReference `json:"publicIPPrefixes,omitempty"` +} + +// MarshalJSON implements the json.Marshaller interface for type ManagedClusterLoadBalancerProfileOutboundIPPrefixes. +func (m ManagedClusterLoadBalancerProfileOutboundIPPrefixes) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "publicIPPrefixes", m.PublicIPPrefixes) + return json.Marshal(objectMap) +} + +// ManagedClusterLoadBalancerProfileOutboundIPs - Desired outbound IP resources for the cluster load balancer. +type ManagedClusterLoadBalancerProfileOutboundIPs struct { + // A list of public IP resources. + PublicIPs []*ResourceReference `json:"publicIPs,omitempty"` +} + +// MarshalJSON implements the json.Marshaller interface for type ManagedClusterLoadBalancerProfileOutboundIPs. +func (m ManagedClusterLoadBalancerProfileOutboundIPs) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "publicIPs", m.PublicIPs) + return json.Marshal(objectMap) +} + +// ManagedClusterManagedOutboundIPProfile - Profile of the managed outbound IP resources of the managed cluster. +type ManagedClusterManagedOutboundIPProfile struct { + // The desired number of outbound IPs created/managed by Azure. Allowed values must be in the range of 1 to 16 (inclusive). The default value is 1. + Count *int32 `json:"count,omitempty"` +} + +// ManagedClusterNATGatewayProfile - Profile of the managed cluster NAT gateway. +type ManagedClusterNATGatewayProfile struct { + // The effective outbound IP resources of the cluster NAT gateway. + EffectiveOutboundIPs []*ResourceReference `json:"effectiveOutboundIPs,omitempty"` + + // Desired outbound flow idle timeout in minutes. Allowed values are in the range of 4 to 120 (inclusive). The default value is 4 minutes. + IdleTimeoutInMinutes *int32 `json:"idleTimeoutInMinutes,omitempty"` + + // Profile of the managed outbound IP resources of the cluster NAT gateway. + ManagedOutboundIPProfile *ManagedClusterManagedOutboundIPProfile `json:"managedOutboundIPProfile,omitempty"` +} + +// MarshalJSON implements the json.Marshaller interface for type ManagedClusterNATGatewayProfile. +func (m ManagedClusterNATGatewayProfile) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "effectiveOutboundIPs", m.EffectiveOutboundIPs) + populate(objectMap, "idleTimeoutInMinutes", m.IdleTimeoutInMinutes) + populate(objectMap, "managedOutboundIPProfile", m.ManagedOutboundIPProfile) + return json.Marshal(objectMap) +} + +// ManagedClusterPodIdentity - Details about the pod identity assigned to the Managed Cluster. +type ManagedClusterPodIdentity struct { + // REQUIRED; The user assigned identity details. + Identity *UserAssignedIdentity `json:"identity,omitempty"` + + // REQUIRED; The name of the pod identity. + Name *string `json:"name,omitempty"` + + // REQUIRED; The namespace of the pod identity. + Namespace *string `json:"namespace,omitempty"` + + // The binding selector to use for the AzureIdentityBinding resource. + BindingSelector *string `json:"bindingSelector,omitempty"` + + // READ-ONLY + ProvisioningInfo *ManagedClusterPodIdentityProvisioningInfo `json:"provisioningInfo,omitempty" azure:"ro"` + + // READ-ONLY; The current provisioning state of the pod identity. + ProvisioningState *ManagedClusterPodIdentityProvisioningState `json:"provisioningState,omitempty" azure:"ro"` +} + +// ManagedClusterPodIdentityException - See disable AAD Pod Identity for a specific Pod/Application [https://azure.github.io/aad-pod-identity/docs/configure/application_exception/] +// for more details. +type ManagedClusterPodIdentityException struct { + // REQUIRED; The name of the pod identity exception. + Name *string `json:"name,omitempty"` + + // REQUIRED; The namespace of the pod identity exception. + Namespace *string `json:"namespace,omitempty"` + + // REQUIRED; The pod labels to match. + PodLabels map[string]*string `json:"podLabels,omitempty"` +} + +// MarshalJSON implements the json.Marshaller interface for type ManagedClusterPodIdentityException. +func (m ManagedClusterPodIdentityException) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "name", m.Name) + populate(objectMap, "namespace", m.Namespace) + populate(objectMap, "podLabels", m.PodLabels) + return json.Marshal(objectMap) +} + +// ManagedClusterPodIdentityProfile - See use AAD pod identity [https://docs.microsoft.com/azure/aks/use-azure-ad-pod-identity] for more details on pod +// identity integration. +type ManagedClusterPodIdentityProfile struct { + // Running in Kubenet is disabled by default due to the security related nature of AAD Pod Identity and the risks of IP spoofing. See using Kubenet network + // plugin with AAD Pod Identity + // [https://docs.microsoft.com/azure/aks/use-azure-ad-pod-identity#using-kubenet-network-plugin-with-azure-active-directory-pod-managed-identities] for + // more information. + AllowNetworkPluginKubenet *bool `json:"allowNetworkPluginKubenet,omitempty"` + + // Whether the pod identity addon is enabled. + Enabled *bool `json:"enabled,omitempty"` + + // The pod identities to use in the cluster. + UserAssignedIdentities []*ManagedClusterPodIdentity `json:"userAssignedIdentities,omitempty"` + + // The pod identity exceptions to allow. + UserAssignedIdentityExceptions []*ManagedClusterPodIdentityException `json:"userAssignedIdentityExceptions,omitempty"` +} + +// MarshalJSON implements the json.Marshaller interface for type ManagedClusterPodIdentityProfile. +func (m ManagedClusterPodIdentityProfile) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "allowNetworkPluginKubenet", m.AllowNetworkPluginKubenet) + populate(objectMap, "enabled", m.Enabled) + populate(objectMap, "userAssignedIdentities", m.UserAssignedIdentities) + populate(objectMap, "userAssignedIdentityExceptions", m.UserAssignedIdentityExceptions) + return json.Marshal(objectMap) +} + +// ManagedClusterPodIdentityProvisioningError - An error response from the pod identity provisioning. +type ManagedClusterPodIdentityProvisioningError struct { + // Details about the error. + Error *ManagedClusterPodIdentityProvisioningErrorBody `json:"error,omitempty"` +} + +// ManagedClusterPodIdentityProvisioningErrorBody - An error response from the pod identity provisioning. +type ManagedClusterPodIdentityProvisioningErrorBody struct { + // An identifier for the error. Codes are invariant and are intended to be consumed programmatically. + Code *string `json:"code,omitempty"` + + // A list of additional details about the error. + Details []*ManagedClusterPodIdentityProvisioningErrorBody `json:"details,omitempty"` + + // A message describing the error, intended to be suitable for display in a user interface. + Message *string `json:"message,omitempty"` + + // The target of the particular error. For example, the name of the property in error. + Target *string `json:"target,omitempty"` +} + +// MarshalJSON implements the json.Marshaller interface for type ManagedClusterPodIdentityProvisioningErrorBody. +func (m ManagedClusterPodIdentityProvisioningErrorBody) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "code", m.Code) + populate(objectMap, "details", m.Details) + populate(objectMap, "message", m.Message) + populate(objectMap, "target", m.Target) + return json.Marshal(objectMap) +} + +type ManagedClusterPodIdentityProvisioningInfo struct { + // Pod identity assignment error (if any). + Error *ManagedClusterPodIdentityProvisioningError `json:"error,omitempty"` +} + +// ManagedClusterPoolUpgradeProfile - The list of available upgrade versions. +type ManagedClusterPoolUpgradeProfile struct { + // REQUIRED; The Kubernetes version (major.minor.patch). + KubernetesVersion *string `json:"kubernetesVersion,omitempty"` + + // REQUIRED; The operating system type. The default is Linux. + OSType *OSType `json:"osType,omitempty"` + + // The Agent Pool name. + Name *string `json:"name,omitempty"` + + // List of orchestrator types and versions available for upgrade. + Upgrades []*ManagedClusterPoolUpgradeProfileUpgradesItem `json:"upgrades,omitempty"` +} + +// MarshalJSON implements the json.Marshaller interface for type ManagedClusterPoolUpgradeProfile. +func (m ManagedClusterPoolUpgradeProfile) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "kubernetesVersion", m.KubernetesVersion) + populate(objectMap, "name", m.Name) + populate(objectMap, "osType", m.OSType) + populate(objectMap, "upgrades", m.Upgrades) + return json.Marshal(objectMap) +} + +type ManagedClusterPoolUpgradeProfileUpgradesItem struct { + // Whether the Kubernetes version is currently in preview. + IsPreview *bool `json:"isPreview,omitempty"` + + // The Kubernetes version (major.minor.patch). + KubernetesVersion *string `json:"kubernetesVersion,omitempty"` +} + +// ManagedClusterProperties - Properties of the managed cluster. +type ManagedClusterProperties struct { + // The Azure Active Directory configuration. + AADProfile *ManagedClusterAADProfile `json:"aadProfile,omitempty"` + + // The access profile for managed cluster API server. + APIServerAccessProfile *ManagedClusterAPIServerAccessProfile `json:"apiServerAccessProfile,omitempty"` + + // The profile of managed cluster add-on. + AddonProfiles map[string]*ManagedClusterAddonProfile `json:"addonProfiles,omitempty"` + + // The agent pool properties. + AgentPoolProfiles []*ManagedClusterAgentPoolProfile `json:"agentPoolProfiles,omitempty"` + + // Parameters to be applied to the cluster-autoscaler when enabled + AutoScalerProfile *ManagedClusterPropertiesAutoScalerProfile `json:"autoScalerProfile,omitempty"` + + // The auto upgrade configuration. + AutoUpgradeProfile *ManagedClusterAutoUpgradeProfile `json:"autoUpgradeProfile,omitempty"` + + // This cannot be updated once the Managed Cluster has been created. + DNSPrefix *string `json:"dnsPrefix,omitempty"` + + // If set to true, getting static credentials will be disabled for this cluster. This must only be used on Managed Clusters that are AAD enabled. For more + // details see disable local accounts + // [https://docs.microsoft.com/azure/aks/managed-aad#disable-local-accounts-preview]. + DisableLocalAccounts *bool `json:"disableLocalAccounts,omitempty"` + + // This is of the form: '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/diskEncryptionSets/{encryptionSetName}' + DiskEncryptionSetID *string `json:"diskEncryptionSetID,omitempty"` + + // (DEPRECATING) Whether to enable Kubernetes pod security policy (preview). This feature is set for removal on October 15th, 2020. Learn more at aka.ms/aks/azpodpolicy. + EnablePodSecurityPolicy *bool `json:"enablePodSecurityPolicy,omitempty"` + + // Whether to enable Kubernetes Role-Based Access Control. + EnableRBAC *bool `json:"enableRBAC,omitempty"` + + // This cannot be updated once the Managed Cluster has been created. + FqdnSubdomain *string `json:"fqdnSubdomain,omitempty"` + + // Configurations for provisioning the cluster with HTTP proxy servers. + HTTPProxyConfig *ManagedClusterHTTPProxyConfig `json:"httpProxyConfig,omitempty"` + + // Identities associated with the cluster. + IdentityProfile map[string]*UserAssignedIdentity `json:"identityProfile,omitempty"` + + // When you upgrade a supported AKS cluster, Kubernetes minor versions cannot be skipped. All upgrades must be performed sequentially by major version number. + // For example, upgrades between 1.14.x -> + // 1.15.x or 1.15.x -> 1.16.x are allowed, however 1.14.x -> 1.16.x is not allowed. See upgrading an AKS cluster [https://docs.microsoft.com/azure/aks/upgrade-cluster] + // for more details. + KubernetesVersion *string `json:"kubernetesVersion,omitempty"` + + // The profile for Linux VMs in the Managed Cluster. + LinuxProfile *ContainerServiceLinuxProfile `json:"linuxProfile,omitempty"` + + // The network configuration profile. + NetworkProfile *ContainerServiceNetworkProfile `json:"networkProfile,omitempty"` + + // The name of the resource group containing agent pool nodes. + NodeResourceGroup *string `json:"nodeResourceGroup,omitempty"` + + // See use AAD pod identity [https://docs.microsoft.com/azure/aks/use-azure-ad-pod-identity] for more details on AAD pod identity integration. + PodIdentityProfile *ManagedClusterPodIdentityProfile `json:"podIdentityProfile,omitempty"` + + // Private link resources associated with the cluster. + PrivateLinkResources []*PrivateLinkResource `json:"privateLinkResources,omitempty"` + + // Security profile for the managed cluster. + SecurityProfile *ManagedClusterSecurityProfile `json:"securityProfile,omitempty"` + + // Information about a service principal identity for the cluster to use for manipulating Azure APIs. + ServicePrincipalProfile *ManagedClusterServicePrincipalProfile `json:"servicePrincipalProfile,omitempty"` + + // The profile for Windows VMs in the Managed Cluster. + WindowsProfile *ManagedClusterWindowsProfile `json:"windowsProfile,omitempty"` + + // READ-ONLY; The Azure Portal requires certain Cross-Origin Resource Sharing (CORS) headers to be sent in some responses, which Kubernetes APIServer doesn't + // handle by default. This special FQDN supports CORS, + // allowing the Azure Portal to function properly. + AzurePortalFQDN *string `json:"azurePortalFQDN,omitempty" azure:"ro"` + + // READ-ONLY; The FQDN of the master pool. + Fqdn *string `json:"fqdn,omitempty" azure:"ro"` + + // READ-ONLY; The max number of agent pools for the managed cluster. + MaxAgentPools *int32 `json:"maxAgentPools,omitempty" azure:"ro"` + + // READ-ONLY; The Power State of the cluster. + PowerState *PowerState `json:"powerState,omitempty" azure:"ro"` + + // READ-ONLY; The FQDN of private cluster. + PrivateFQDN *string `json:"privateFQDN,omitempty" azure:"ro"` + + // READ-ONLY; The current provisioning state. + ProvisioningState *string `json:"provisioningState,omitempty" azure:"ro"` +} + +// MarshalJSON implements the json.Marshaller interface for type ManagedClusterProperties. +func (m ManagedClusterProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "aadProfile", m.AADProfile) + populate(objectMap, "apiServerAccessProfile", m.APIServerAccessProfile) + populate(objectMap, "addonProfiles", m.AddonProfiles) + populate(objectMap, "agentPoolProfiles", m.AgentPoolProfiles) + populate(objectMap, "autoScalerProfile", m.AutoScalerProfile) + populate(objectMap, "autoUpgradeProfile", m.AutoUpgradeProfile) + populate(objectMap, "azurePortalFQDN", m.AzurePortalFQDN) + populate(objectMap, "dnsPrefix", m.DNSPrefix) + populate(objectMap, "disableLocalAccounts", m.DisableLocalAccounts) + populate(objectMap, "diskEncryptionSetID", m.DiskEncryptionSetID) + populate(objectMap, "enablePodSecurityPolicy", m.EnablePodSecurityPolicy) + populate(objectMap, "enableRBAC", m.EnableRBAC) + populate(objectMap, "fqdn", m.Fqdn) + populate(objectMap, "fqdnSubdomain", m.FqdnSubdomain) + populate(objectMap, "httpProxyConfig", m.HTTPProxyConfig) + populate(objectMap, "identityProfile", m.IdentityProfile) + populate(objectMap, "kubernetesVersion", m.KubernetesVersion) + populate(objectMap, "linuxProfile", m.LinuxProfile) + populate(objectMap, "maxAgentPools", m.MaxAgentPools) + populate(objectMap, "networkProfile", m.NetworkProfile) + populate(objectMap, "nodeResourceGroup", m.NodeResourceGroup) + populate(objectMap, "podIdentityProfile", m.PodIdentityProfile) + populate(objectMap, "powerState", m.PowerState) + populate(objectMap, "privateFQDN", m.PrivateFQDN) + populate(objectMap, "privateLinkResources", m.PrivateLinkResources) + populate(objectMap, "provisioningState", m.ProvisioningState) + populate(objectMap, "securityProfile", m.SecurityProfile) + populate(objectMap, "servicePrincipalProfile", m.ServicePrincipalProfile) + populate(objectMap, "windowsProfile", m.WindowsProfile) + return json.Marshal(objectMap) +} + +// ManagedClusterPropertiesAutoScalerProfile - Parameters to be applied to the cluster-autoscaler when enabled +type ManagedClusterPropertiesAutoScalerProfile struct { + // Valid values are 'true' and 'false' + BalanceSimilarNodeGroups *string `json:"balance-similar-node-groups,omitempty"` + + // If not specified, the default is 'random'. See expanders [https://github.com/kubernetes/autoscaler/blob/master/cluster-autoscaler/FAQ.md#what-are-expanders] + // for more information. + Expander *Expander `json:"expander,omitempty"` + + // The default is 10. + MaxEmptyBulkDelete *string `json:"max-empty-bulk-delete,omitempty"` + + // The default is 600. + MaxGracefulTerminationSec *string `json:"max-graceful-termination-sec,omitempty"` + + // The default is '15m'. Values must be an integer followed by an 'm'. No unit of time other than minutes (m) is supported. + MaxNodeProvisionTime *string `json:"max-node-provision-time,omitempty"` + + // The default is 45. The maximum is 100 and the minimum is 0. + MaxTotalUnreadyPercentage *string `json:"max-total-unready-percentage,omitempty"` + + // For scenarios like burst/batch scale where you don't want CA to act before the kubernetes scheduler could schedule all the pods, you can tell CA to ignore + // unscheduled pods before they're a certain + // age. The default is '0s'. Values must be an integer followed by a unit ('s' for seconds, 'm' for minutes, 'h' for hours, etc). + NewPodScaleUpDelay *string `json:"new-pod-scale-up-delay,omitempty"` + + // This must be an integer. The default is 3. + OkTotalUnreadyCount *string `json:"ok-total-unready-count,omitempty"` + + // The default is '10m'. Values must be an integer followed by an 'm'. No unit of time other than minutes (m) is supported. + ScaleDownDelayAfterAdd *string `json:"scale-down-delay-after-add,omitempty"` + + // The default is the scan-interval. Values must be an integer followed by an 'm'. No unit of time other than minutes (m) is supported. + ScaleDownDelayAfterDelete *string `json:"scale-down-delay-after-delete,omitempty"` + + // The default is '3m'. Values must be an integer followed by an 'm'. No unit of time other than minutes (m) is supported. + ScaleDownDelayAfterFailure *string `json:"scale-down-delay-after-failure,omitempty"` + + // The default is '10m'. Values must be an integer followed by an 'm'. No unit of time other than minutes (m) is supported. + ScaleDownUnneededTime *string `json:"scale-down-unneeded-time,omitempty"` + + // The default is '20m'. Values must be an integer followed by an 'm'. No unit of time other than minutes (m) is supported. + ScaleDownUnreadyTime *string `json:"scale-down-unready-time,omitempty"` + + // The default is '0.5'. + ScaleDownUtilizationThreshold *string `json:"scale-down-utilization-threshold,omitempty"` + + // The default is '10'. Values must be an integer number of seconds. + ScanInterval *string `json:"scan-interval,omitempty"` + + // The default is true. + SkipNodesWithLocalStorage *string `json:"skip-nodes-with-local-storage,omitempty"` + + // The default is true. + SkipNodesWithSystemPods *string `json:"skip-nodes-with-system-pods,omitempty"` +} + +// ManagedClusterSKU - The SKU of a Managed Cluster. +type ManagedClusterSKU struct { + // The name of a managed cluster SKU. + Name *ManagedClusterSKUName `json:"name,omitempty"` + + // If not specified, the default is 'Free'. See uptime SLA [https://docs.microsoft.com/azure/aks/uptime-sla] for more details. + Tier *ManagedClusterSKUTier `json:"tier,omitempty"` +} + +// ManagedClusterSecurityProfile - Security profile for the container service cluster. +type ManagedClusterSecurityProfile struct { + // Azure Defender settings for the security profile. + AzureDefender *ManagedClusterSecurityProfileAzureDefender `json:"azureDefender,omitempty"` +} + +// ManagedClusterSecurityProfileAzureDefender - Azure Defender settings for the security profile. +type ManagedClusterSecurityProfileAzureDefender struct { + // Whether to enable Azure Defender + Enabled *bool `json:"enabled,omitempty"` + + // Resource ID of the Log Analytics workspace to be associated with Azure Defender. When Azure Defender is enabled, this field is required and must be a + // valid workspace resource ID. When Azure Defender + // is disabled, leave the field empty. + LogAnalyticsWorkspaceResourceID *string `json:"logAnalyticsWorkspaceResourceId,omitempty"` +} + +// ManagedClusterServicePrincipalProfile - Information about a service principal identity for the cluster to use for manipulating Azure APIs. +type ManagedClusterServicePrincipalProfile struct { + // REQUIRED; The ID for the service principal. + ClientID *string `json:"clientId,omitempty"` + + // The secret password associated with the service principal in plain text. + Secret *string `json:"secret,omitempty"` +} + +// ManagedClusterUpgradeProfile - The list of available upgrades for compute pools. +type ManagedClusterUpgradeProfile struct { + // REQUIRED; The properties of the upgrade profile. + Properties *ManagedClusterUpgradeProfileProperties `json:"properties,omitempty"` + + // READ-ONLY; The ID of the upgrade profile. + ID *string `json:"id,omitempty" azure:"ro"` + + // READ-ONLY; The name of the upgrade profile. + Name *string `json:"name,omitempty" azure:"ro"` + + // READ-ONLY; The type of the upgrade profile. + Type *string `json:"type,omitempty" azure:"ro"` +} + +// ManagedClusterUpgradeProfileProperties - Control plane and agent pool upgrade profiles. +type ManagedClusterUpgradeProfileProperties struct { + // REQUIRED; The list of available upgrade versions for agent pools. + AgentPoolProfiles []*ManagedClusterPoolUpgradeProfile `json:"agentPoolProfiles,omitempty"` + + // REQUIRED; The list of available upgrade versions for the control plane. + ControlPlaneProfile *ManagedClusterPoolUpgradeProfile `json:"controlPlaneProfile,omitempty"` +} + +// MarshalJSON implements the json.Marshaller interface for type ManagedClusterUpgradeProfileProperties. +func (m ManagedClusterUpgradeProfileProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "agentPoolProfiles", m.AgentPoolProfiles) + populate(objectMap, "controlPlaneProfile", m.ControlPlaneProfile) + return json.Marshal(objectMap) +} + +// ManagedClusterWindowsProfile - Profile for Windows VMs in the managed cluster. +type ManagedClusterWindowsProfile struct { + // REQUIRED; Specifies the name of the administrator account. + // Restriction: Cannot end in "." + // Disallowed values: "administrator", "admin", "user", "user1", "test", "user2", "test1", "user3", "admin1", "1", "123", "a", "actuser", "adm", "admin2", + // "aspnet", "backup", "console", "david", "guest", + // "john", "owner", "root", "server", "sql", "support", "support_388945a0", "sys", "test2", "test3", "user4", "user5". + // Minimum-length: 1 character + // Max-length: 20 characters + AdminUsername *string `json:"adminUsername,omitempty"` + + // Specifies the password of the administrator account. + // Minimum-length: 8 characters + // Max-length: 123 characters + // Complexity requirements: 3 out of 4 conditions below need to be fulfilled + // Has lower characters + // Has upper characters + // Has a digit + // Has a special character (Regex match [\W_]) + // Disallowed values: "abc@123", "P@$$w0rd", "P@ssw0rd", "P@ssword123", "Pa$$word", "pass@word1", "Password!", "Password1", "Password22", "iloveyou!" + AdminPassword *string `json:"adminPassword,omitempty"` + + // For more details on CSI proxy, see the CSI proxy GitHub repo [https://github.com/kubernetes-csi/csi-proxy]. + EnableCSIProxy *bool `json:"enableCSIProxy,omitempty"` + + // The license type to use for Windows VMs. See Azure Hybrid User Benefits [https://azure.microsoft.com/pricing/hybrid-benefit/faq/] for more details. + LicenseType *LicenseType `json:"licenseType,omitempty"` +} + +// ManagedClustersBeginCreateOrUpdateOptions contains the optional parameters for the ManagedClusters.BeginCreateOrUpdate method. +type ManagedClustersBeginCreateOrUpdateOptions struct { + // placeholder for future optional parameters +} + +// ManagedClustersBeginDeleteOptions contains the optional parameters for the ManagedClusters.BeginDelete method. +type ManagedClustersBeginDeleteOptions struct { + // placeholder for future optional parameters +} + +// ManagedClustersBeginResetAADProfileOptions contains the optional parameters for the ManagedClusters.BeginResetAADProfile method. +type ManagedClustersBeginResetAADProfileOptions struct { + // placeholder for future optional parameters +} + +// ManagedClustersBeginResetServicePrincipalProfileOptions contains the optional parameters for the ManagedClusters.BeginResetServicePrincipalProfile method. +type ManagedClustersBeginResetServicePrincipalProfileOptions struct { + // placeholder for future optional parameters +} + +// ManagedClustersBeginRotateClusterCertificatesOptions contains the optional parameters for the ManagedClusters.BeginRotateClusterCertificates method. +type ManagedClustersBeginRotateClusterCertificatesOptions struct { + // placeholder for future optional parameters +} + +// ManagedClustersBeginRunCommandOptions contains the optional parameters for the ManagedClusters.BeginRunCommand method. +type ManagedClustersBeginRunCommandOptions struct { + // placeholder for future optional parameters +} + +// ManagedClustersBeginStartOptions contains the optional parameters for the ManagedClusters.BeginStart method. +type ManagedClustersBeginStartOptions struct { + // placeholder for future optional parameters +} + +// ManagedClustersBeginStopOptions contains the optional parameters for the ManagedClusters.BeginStop method. +type ManagedClustersBeginStopOptions struct { + // placeholder for future optional parameters +} + +// ManagedClustersBeginUpdateTagsOptions contains the optional parameters for the ManagedClusters.BeginUpdateTags method. +type ManagedClustersBeginUpdateTagsOptions struct { + // placeholder for future optional parameters +} + +// ManagedClustersGetAccessProfileOptions contains the optional parameters for the ManagedClusters.GetAccessProfile method. +type ManagedClustersGetAccessProfileOptions struct { + // placeholder for future optional parameters +} + +// ManagedClustersGetCommandResultOptions contains the optional parameters for the ManagedClusters.GetCommandResult method. +type ManagedClustersGetCommandResultOptions struct { + // placeholder for future optional parameters +} + +// ManagedClustersGetOSOptionsOptions contains the optional parameters for the ManagedClusters.GetOSOptions method. +type ManagedClustersGetOSOptionsOptions struct { + // The resource type for which the OS options needs to be returned + ResourceType *string +} + +// ManagedClustersGetOptions contains the optional parameters for the ManagedClusters.Get method. +type ManagedClustersGetOptions struct { + // placeholder for future optional parameters +} + +// ManagedClustersGetUpgradeProfileOptions contains the optional parameters for the ManagedClusters.GetUpgradeProfile method. +type ManagedClustersGetUpgradeProfileOptions struct { + // placeholder for future optional parameters +} + +// ManagedClustersListByResourceGroupOptions contains the optional parameters for the ManagedClusters.ListByResourceGroup method. +type ManagedClustersListByResourceGroupOptions struct { + // placeholder for future optional parameters +} + +// ManagedClustersListClusterAdminCredentialsOptions contains the optional parameters for the ManagedClusters.ListClusterAdminCredentials method. +type ManagedClustersListClusterAdminCredentialsOptions struct { + // server fqdn type for credentials to be returned + ServerFqdn *string +} + +// ManagedClustersListClusterMonitoringUserCredentialsOptions contains the optional parameters for the ManagedClusters.ListClusterMonitoringUserCredentials +// method. +type ManagedClustersListClusterMonitoringUserCredentialsOptions struct { + // server fqdn type for credentials to be returned + ServerFqdn *string +} + +// ManagedClustersListClusterUserCredentialsOptions contains the optional parameters for the ManagedClusters.ListClusterUserCredentials method. +type ManagedClustersListClusterUserCredentialsOptions struct { + // server fqdn type for credentials to be returned + ServerFqdn *string +} + +// ManagedClustersListOptions contains the optional parameters for the ManagedClusters.List method. +type ManagedClustersListOptions struct { + // placeholder for future optional parameters +} + +// ManagedClustersListOutboundNetworkDependenciesEndpointsOptions contains the optional parameters for the ManagedClusters.ListOutboundNetworkDependenciesEndpoints +// method. +type ManagedClustersListOutboundNetworkDependenciesEndpointsOptions struct { + // placeholder for future optional parameters +} + +type ManagedServiceIdentityUserAssignedIdentitiesValue struct { + // READ-ONLY; The client id of user assigned identity. + ClientID *string `json:"clientId,omitempty" azure:"ro"` + + // READ-ONLY; The principal id of user assigned identity. + PrincipalID *string `json:"principalId,omitempty" azure:"ro"` +} + +// OSOptionProfile - The OS option profile. +type OSOptionProfile struct { + // REQUIRED; The list of OS options. + Properties *OSOptionPropertyList `json:"properties,omitempty"` + + // READ-ONLY; The ID of the OS option resource. + ID *string `json:"id,omitempty" azure:"ro"` + + // READ-ONLY; The name of the OS option resource. + Name *string `json:"name,omitempty" azure:"ro"` + + // READ-ONLY; The type of the OS option resource. + Type *string `json:"type,omitempty" azure:"ro"` +} + +// OSOptionProperty - OS option property. +type OSOptionProperty struct { + // REQUIRED; Whether the image is FIPS-enabled. + EnableFipsImage *bool `json:"enable-fips-image,omitempty"` + + // REQUIRED; The OS type. + OSType *string `json:"os-type,omitempty"` +} + +// OSOptionPropertyList - The list of OS option properties. +type OSOptionPropertyList struct { + // REQUIRED; The list of OS options. + OSOptionPropertyList []*OSOptionProperty `json:"osOptionPropertyList,omitempty"` +} + +// MarshalJSON implements the json.Marshaller interface for type OSOptionPropertyList. +func (o OSOptionPropertyList) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "osOptionPropertyList", o.OSOptionPropertyList) + return json.Marshal(objectMap) +} + +// OperationListResult - The List Operation response. +type OperationListResult struct { + // READ-ONLY; The list of operations + Value []*OperationValue `json:"value,omitempty" azure:"ro"` +} + +// MarshalJSON implements the json.Marshaller interface for type OperationListResult. +func (o OperationListResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "value", o.Value) + return json.Marshal(objectMap) +} + +// OperationValue - Describes the properties of a Operation value. +type OperationValue struct { + // Describes the properties of a Operation Value Display. + Display *OperationValueDisplay `json:"display,omitempty"` + + // READ-ONLY; The name of the operation. + Name *string `json:"name,omitempty" azure:"ro"` + + // READ-ONLY; The origin of the operation. + Origin *string `json:"origin,omitempty" azure:"ro"` +} + +// OperationValueDisplay - Describes the properties of a Operation Value Display. +type OperationValueDisplay struct { + // READ-ONLY; The description of the operation. + Description *string `json:"description,omitempty" azure:"ro"` + + // READ-ONLY; The display name of the operation. + Operation *string `json:"operation,omitempty" azure:"ro"` + + // READ-ONLY; The resource provider for the operation. + Provider *string `json:"provider,omitempty" azure:"ro"` + + // READ-ONLY; The display name of the resource the operation applies to. + Resource *string `json:"resource,omitempty" azure:"ro"` +} + +// OperationsListOptions contains the optional parameters for the Operations.List method. +type OperationsListOptions struct { + // placeholder for future optional parameters +} + +// OutboundEnvironmentEndpoint - Egress endpoints which AKS agent nodes connect to for common purpose. +type OutboundEnvironmentEndpoint struct { + // The category of endpoints accessed by the AKS agent node, e.g. azure-resource-management, apiserver, etc. + Category *string `json:"category,omitempty"` + + // The endpoints that AKS agent nodes connect to + Endpoints []*EndpointDependency `json:"endpoints,omitempty"` +} + +// MarshalJSON implements the json.Marshaller interface for type OutboundEnvironmentEndpoint. +func (o OutboundEnvironmentEndpoint) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "category", o.Category) + populate(objectMap, "endpoints", o.Endpoints) + return json.Marshal(objectMap) +} + +// OutboundEnvironmentEndpointCollection - Collection of OutboundEnvironmentEndpoint +type OutboundEnvironmentEndpointCollection struct { + // REQUIRED; Collection of resources. + Value []*OutboundEnvironmentEndpoint `json:"value,omitempty"` + + // READ-ONLY; Link to next page of resources. + NextLink *string `json:"nextLink,omitempty" azure:"ro"` +} + +// MarshalJSON implements the json.Marshaller interface for type OutboundEnvironmentEndpointCollection. +func (o OutboundEnvironmentEndpointCollection) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "nextLink", o.NextLink) + populate(objectMap, "value", o.Value) + return json.Marshal(objectMap) +} + +// PowerState - Describes the Power State of the cluster +type PowerState struct { + // Tells whether the cluster is Running or Stopped + Code *Code `json:"code,omitempty"` +} + +// PrivateEndpoint - Private endpoint which a connection belongs to. +type PrivateEndpoint struct { + // The resource ID of the private endpoint + ID *string `json:"id,omitempty"` +} + +// PrivateEndpointConnection - A private endpoint connection +type PrivateEndpointConnection struct { + // The properties of a private endpoint connection. + Properties *PrivateEndpointConnectionProperties `json:"properties,omitempty"` + + // READ-ONLY; The ID of the private endpoint connection. + ID *string `json:"id,omitempty" azure:"ro"` + + // READ-ONLY; The name of the private endpoint connection. + Name *string `json:"name,omitempty" azure:"ro"` + + // READ-ONLY; The resource type. + Type *string `json:"type,omitempty" azure:"ro"` +} + +// PrivateEndpointConnectionListResult - A list of private endpoint connections +type PrivateEndpointConnectionListResult struct { + // The collection value. + Value []*PrivateEndpointConnection `json:"value,omitempty"` +} + +// MarshalJSON implements the json.Marshaller interface for type PrivateEndpointConnectionListResult. +func (p PrivateEndpointConnectionListResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "value", p.Value) + return json.Marshal(objectMap) +} + +// PrivateEndpointConnectionProperties - Properties of a private endpoint connection. +type PrivateEndpointConnectionProperties struct { + // REQUIRED; A collection of information about the state of the connection between service consumer and provider. + PrivateLinkServiceConnectionState *PrivateLinkServiceConnectionState `json:"privateLinkServiceConnectionState,omitempty"` + + // The resource of private endpoint. + PrivateEndpoint *PrivateEndpoint `json:"privateEndpoint,omitempty"` + + // READ-ONLY; The current provisioning state. + ProvisioningState *PrivateEndpointConnectionProvisioningState `json:"provisioningState,omitempty" azure:"ro"` +} + +// PrivateEndpointConnectionsBeginDeleteOptions contains the optional parameters for the PrivateEndpointConnections.BeginDelete method. +type PrivateEndpointConnectionsBeginDeleteOptions struct { + // placeholder for future optional parameters +} + +// PrivateEndpointConnectionsGetOptions contains the optional parameters for the PrivateEndpointConnections.Get method. +type PrivateEndpointConnectionsGetOptions struct { + // placeholder for future optional parameters +} + +// PrivateEndpointConnectionsListOptions contains the optional parameters for the PrivateEndpointConnections.List method. +type PrivateEndpointConnectionsListOptions struct { + // placeholder for future optional parameters +} + +// PrivateEndpointConnectionsUpdateOptions contains the optional parameters for the PrivateEndpointConnections.Update method. +type PrivateEndpointConnectionsUpdateOptions struct { + // placeholder for future optional parameters +} + +// PrivateLinkResource - A private link resource +type PrivateLinkResource struct { + // The group ID of the resource. + GroupID *string `json:"groupId,omitempty"` + + // The ID of the private link resource. + ID *string `json:"id,omitempty"` + + // The name of the private link resource. + Name *string `json:"name,omitempty"` + + // The RequiredMembers of the resource + RequiredMembers []*string `json:"requiredMembers,omitempty"` + + // The resource type. + Type *string `json:"type,omitempty"` + + // READ-ONLY; The private link service ID of the resource, this field is exposed only to NRP internally. + PrivateLinkServiceID *string `json:"privateLinkServiceID,omitempty" azure:"ro"` +} + +// MarshalJSON implements the json.Marshaller interface for type PrivateLinkResource. +func (p PrivateLinkResource) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "groupId", p.GroupID) + populate(objectMap, "id", p.ID) + populate(objectMap, "name", p.Name) + populate(objectMap, "privateLinkServiceID", p.PrivateLinkServiceID) + populate(objectMap, "requiredMembers", p.RequiredMembers) + populate(objectMap, "type", p.Type) + return json.Marshal(objectMap) +} + +// PrivateLinkResourcesListOptions contains the optional parameters for the PrivateLinkResources.List method. +type PrivateLinkResourcesListOptions struct { + // placeholder for future optional parameters +} + +// PrivateLinkResourcesListResult - A list of private link resources +type PrivateLinkResourcesListResult struct { + // The collection value. + Value []*PrivateLinkResource `json:"value,omitempty"` +} + +// MarshalJSON implements the json.Marshaller interface for type PrivateLinkResourcesListResult. +func (p PrivateLinkResourcesListResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "value", p.Value) + return json.Marshal(objectMap) +} + +// PrivateLinkServiceConnectionState - The state of a private link service connection. +type PrivateLinkServiceConnectionState struct { + // The private link service connection description. + Description *string `json:"description,omitempty"` + + // The private link service connection status. + Status *ConnectionStatus `json:"status,omitempty"` +} + +// ResolvePrivateLinkServiceIDPOSTOptions contains the optional parameters for the ResolvePrivateLinkServiceID.POST method. +type ResolvePrivateLinkServiceIDPOSTOptions struct { + // placeholder for future optional parameters +} + +// Resource - The Resource model definition. +type Resource struct { + // REQUIRED; Resource location + Location *string `json:"location,omitempty"` + + // Resource tags + Tags map[string]*string `json:"tags,omitempty"` + + // READ-ONLY; Resource Id + ID *string `json:"id,omitempty" azure:"ro"` + + // READ-ONLY; Resource name + Name *string `json:"name,omitempty" azure:"ro"` + + // READ-ONLY; Resource type + Type *string `json:"type,omitempty" azure:"ro"` +} + +// MarshalJSON implements the json.Marshaller interface for type Resource. +func (r Resource) MarshalJSON() ([]byte, error) { + objectMap := r.marshalInternal() + return json.Marshal(objectMap) +} + +func (r Resource) marshalInternal() map[string]interface{} { + objectMap := make(map[string]interface{}) + populate(objectMap, "id", r.ID) + populate(objectMap, "location", r.Location) + populate(objectMap, "name", r.Name) + populate(objectMap, "tags", r.Tags) + populate(objectMap, "type", r.Type) + return objectMap +} + +// ResourceReference - A reference to an Azure resource. +type ResourceReference struct { + // The fully qualified Azure resource id. + ID *string `json:"id,omitempty"` +} + +// RunCommandRequest - A run command request +type RunCommandRequest struct { + // REQUIRED; The command to run. + Command *string `json:"command,omitempty"` + + // AuthToken issued for AKS AAD Server App. + ClusterToken *string `json:"clusterToken,omitempty"` + + // A base64 encoded zip file containing the files required by the command. + Context *string `json:"context,omitempty"` +} + +// RunCommandResult - run command result. +type RunCommandResult struct { + // Properties of command result. + Properties *CommandResultProperties `json:"properties,omitempty"` + + // READ-ONLY; The command id. + ID *string `json:"id,omitempty" azure:"ro"` +} + +// SubResource - Reference to another subresource. +type SubResource struct { + // READ-ONLY; Resource ID. + ID *string `json:"id,omitempty" azure:"ro"` + + // READ-ONLY; The name of the resource that is unique within a resource group. This name can be used to access the resource. + Name *string `json:"name,omitempty" azure:"ro"` + + // READ-ONLY; Resource type + Type *string `json:"type,omitempty" azure:"ro"` +} + +// SysctlConfig - Sysctl settings for Linux agent nodes. +type SysctlConfig struct { + // Sysctl setting fs.aio-max-nr. + FsAioMaxNr *int32 `json:"fsAioMaxNr,omitempty"` + + // Sysctl setting fs.file-max. + FsFileMax *int32 `json:"fsFileMax,omitempty"` + + // Sysctl setting fs.inotify.maxuserwatches. + FsInotifyMaxUserWatches *int32 `json:"fsInotifyMaxUserWatches,omitempty"` + + // Sysctl setting fs.nr_open. + FsNrOpen *int32 `json:"fsNrOpen,omitempty"` + + // Sysctl setting kernel.threads-max. + KernelThreadsMax *int32 `json:"kernelThreadsMax,omitempty"` + + // Sysctl setting net.core.netdevmaxbacklog. + NetCoreNetdevMaxBacklog *int32 `json:"netCoreNetdevMaxBacklog,omitempty"` + + // Sysctl setting net.core.optmem_max. + NetCoreOptmemMax *int32 `json:"netCoreOptmemMax,omitempty"` + + // Sysctl setting net.core.rmem_default. + NetCoreRmemDefault *int32 `json:"netCoreRmemDefault,omitempty"` + + // Sysctl setting net.core.rmem_max. + NetCoreRmemMax *int32 `json:"netCoreRmemMax,omitempty"` + + // Sysctl setting net.core.somaxconn. + NetCoreSomaxconn *int32 `json:"netCoreSomaxconn,omitempty"` + + // Sysctl setting net.core.wmem_default. + NetCoreWmemDefault *int32 `json:"netCoreWmemDefault,omitempty"` + + // Sysctl setting net.core.wmem_max. + NetCoreWmemMax *int32 `json:"netCoreWmemMax,omitempty"` + + // Sysctl setting net.ipv4.iplocalport_range. + NetIPv4IPLocalPortRange *string `json:"netIpv4IpLocalPortRange,omitempty"` + + // Sysctl setting net.ipv4.neigh.default.gc_thresh1. + NetIPv4NeighDefaultGcThresh1 *int32 `json:"netIpv4NeighDefaultGcThresh1,omitempty"` + + // Sysctl setting net.ipv4.neigh.default.gc_thresh2. + NetIPv4NeighDefaultGcThresh2 *int32 `json:"netIpv4NeighDefaultGcThresh2,omitempty"` + + // Sysctl setting net.ipv4.neigh.default.gc_thresh3. + NetIPv4NeighDefaultGcThresh3 *int32 `json:"netIpv4NeighDefaultGcThresh3,omitempty"` + + // Sysctl setting net.ipv4.tcpfintimeout. + NetIPv4TCPFinTimeout *int32 `json:"netIpv4TcpFinTimeout,omitempty"` + + // Sysctl setting net.ipv4.tcpkeepaliveprobes. + NetIPv4TCPKeepaliveProbes *int32 `json:"netIpv4TcpKeepaliveProbes,omitempty"` + + // Sysctl setting net.ipv4.tcpkeepalivetime. + NetIPv4TCPKeepaliveTime *int32 `json:"netIpv4TcpKeepaliveTime,omitempty"` + + // Sysctl setting net.ipv4.tcpmaxsyn_backlog. + NetIPv4TCPMaxSynBacklog *int32 `json:"netIpv4TcpMaxSynBacklog,omitempty"` + + // Sysctl setting net.ipv4.tcpmaxtw_buckets. + NetIPv4TCPMaxTwBuckets *int32 `json:"netIpv4TcpMaxTwBuckets,omitempty"` + + // Sysctl setting net.ipv4.tcptwreuse. + NetIPv4TCPTwReuse *bool `json:"netIpv4TcpTwReuse,omitempty"` + + // Sysctl setting net.ipv4.tcpkeepaliveintvl. + NetIPv4TcpkeepaliveIntvl *int32 `json:"netIpv4TcpkeepaliveIntvl,omitempty"` + + // Sysctl setting net.netfilter.nfconntrackbuckets. + NetNetfilterNfConntrackBuckets *int32 `json:"netNetfilterNfConntrackBuckets,omitempty"` + + // Sysctl setting net.netfilter.nfconntrackmax. + NetNetfilterNfConntrackMax *int32 `json:"netNetfilterNfConntrackMax,omitempty"` + + // Sysctl setting vm.maxmapcount. + VMMaxMapCount *int32 `json:"vmMaxMapCount,omitempty"` + + // Sysctl setting vm.swappiness. + VMSwappiness *int32 `json:"vmSwappiness,omitempty"` + + // Sysctl setting vm.vfscachepressure. + VMVfsCachePressure *int32 `json:"vmVfsCachePressure,omitempty"` +} + +// SystemData - Metadata pertaining to creation and last modification of the resource. +type SystemData struct { + // The UTC timestamp of resource creation. + CreatedAt *time.Time `json:"createdAt,omitempty"` + + // The identity that created the resource. + CreatedBy *string `json:"createdBy,omitempty"` + + // The type of identity that created the resource. + CreatedByType *CreatedByType `json:"createdByType,omitempty"` + + // The type of identity that last modified the resource. + LastModifiedAt *time.Time `json:"lastModifiedAt,omitempty"` + + // The identity that last modified the resource. + LastModifiedBy *string `json:"lastModifiedBy,omitempty"` + + // The type of identity that last modified the resource. + LastModifiedByType *CreatedByType `json:"lastModifiedByType,omitempty"` +} + +// MarshalJSON implements the json.Marshaller interface for type SystemData. +func (s SystemData) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "createdAt", (*timeRFC3339)(s.CreatedAt)) + populate(objectMap, "createdBy", s.CreatedBy) + populate(objectMap, "createdByType", s.CreatedByType) + populate(objectMap, "lastModifiedAt", (*timeRFC3339)(s.LastModifiedAt)) + populate(objectMap, "lastModifiedBy", s.LastModifiedBy) + populate(objectMap, "lastModifiedByType", s.LastModifiedByType) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type SystemData. +func (s *SystemData) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return err + } + for key, val := range rawMsg { + var err error + switch key { + case "createdAt": + var aux timeRFC3339 + err = unpopulate(val, &aux) + s.CreatedAt = (*time.Time)(&aux) + delete(rawMsg, key) + case "createdBy": + err = unpopulate(val, &s.CreatedBy) + delete(rawMsg, key) + case "createdByType": + err = unpopulate(val, &s.CreatedByType) + delete(rawMsg, key) + case "lastModifiedAt": + var aux timeRFC3339 + err = unpopulate(val, &aux) + s.LastModifiedAt = (*time.Time)(&aux) + delete(rawMsg, key) + case "lastModifiedBy": + err = unpopulate(val, &s.LastModifiedBy) + delete(rawMsg, key) + case "lastModifiedByType": + err = unpopulate(val, &s.LastModifiedByType) + delete(rawMsg, key) + } + if err != nil { + return err + } + } + return nil +} + +// TagsObject - Tags object for patch operations. +type TagsObject struct { + // Resource tags. + Tags map[string]*string `json:"tags,omitempty"` +} + +// MarshalJSON implements the json.Marshaller interface for type TagsObject. +func (t TagsObject) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "tags", t.Tags) + return json.Marshal(objectMap) +} + +// TimeInWeek - Time in a week. +type TimeInWeek struct { + // The day of the week. + Day *WeekDay `json:"day,omitempty"` + + // Each integer hour represents a time range beginning at 0m after the hour ending at the next hour (non-inclusive). 0 corresponds to 00:00 UTC, 23 corresponds + // to 23:00 UTC. Specifying [0, 1] means the + // 00:00 - 02:00 UTC time range. + HourSlots []*int32 `json:"hourSlots,omitempty"` +} + +// MarshalJSON implements the json.Marshaller interface for type TimeInWeek. +func (t TimeInWeek) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "day", t.Day) + populate(objectMap, "hourSlots", t.HourSlots) + return json.Marshal(objectMap) +} + +// TimeSpan - For example, between 2021-05-25T13:00:00Z and 2021-05-25T14:00:00Z. +type TimeSpan struct { + // The end of a time span + End *time.Time `json:"end,omitempty"` + + // The start of a time span + Start *time.Time `json:"start,omitempty"` +} + +// MarshalJSON implements the json.Marshaller interface for type TimeSpan. +func (t TimeSpan) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "end", (*timeRFC3339)(t.End)) + populate(objectMap, "start", (*timeRFC3339)(t.Start)) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type TimeSpan. +func (t *TimeSpan) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return err + } + for key, val := range rawMsg { + var err error + switch key { + case "end": + var aux timeRFC3339 + err = unpopulate(val, &aux) + t.End = (*time.Time)(&aux) + delete(rawMsg, key) + case "start": + var aux timeRFC3339 + err = unpopulate(val, &aux) + t.Start = (*time.Time)(&aux) + delete(rawMsg, key) + } + if err != nil { + return err + } + } + return nil +} + +// UserAssignedIdentity - Details about a user assigned identity. +type UserAssignedIdentity struct { + // The client ID of the user assigned identity. + ClientID *string `json:"clientId,omitempty"` + + // The object ID of the user assigned identity. + ObjectID *string `json:"objectId,omitempty"` + + // The resource ID of the user assigned identity. + ResourceID *string `json:"resourceId,omitempty"` +} + +func populate(m map[string]interface{}, k string, v interface{}) { + if v == nil { + return + } else if azcore.IsNullValue(v) { + m[k] = nil + } else if !reflect.ValueOf(v).IsNil() { + m[k] = v + } +} + +func populateByteArray(m map[string]interface{}, k string, b []byte, f azcore.Base64Encoding) { + if azcore.IsNullValue(b) { + m[k] = nil + } else if len(b) == 0 { + return + } else { + m[k] = azcore.EncodeByteArray(b, f) + } +} + +func unpopulate(data json.RawMessage, v interface{}) error { + if data == nil { + return nil + } + return json.Unmarshal(data, v) +} diff --git a/sdk/containerservice/armcontainerservice/zz_generated_operations_client.go b/sdk/containerservice/armcontainerservice/zz_generated_operations_client.go new file mode 100644 index 000000000000..10a009fb138f --- /dev/null +++ b/sdk/containerservice/armcontainerservice/zz_generated_operations_client.go @@ -0,0 +1,81 @@ +// +build go1.13 + +// 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. + +package armcontainerservice + +import ( + "context" + "fmt" + "github.com/Azure/azure-sdk-for-go/sdk/armcore" + "github.com/Azure/azure-sdk-for-go/sdk/azcore" + "net/http" +) + +// OperationsClient contains the methods for the Operations group. +// Don't use this type directly, use NewOperationsClient() instead. +type OperationsClient struct { + con *armcore.Connection +} + +// NewOperationsClient creates a new instance of OperationsClient with the specified values. +func NewOperationsClient(con *armcore.Connection) *OperationsClient { + return &OperationsClient{con: con} +} + +// List - Gets a list of operations. +// If the operation fails it returns the *CloudError error type. +func (client *OperationsClient) List(ctx context.Context, options *OperationsListOptions) (OperationsListResponse, error) { + req, err := client.listCreateRequest(ctx, options) + if err != nil { + return OperationsListResponse{}, err + } + resp, err := client.con.Pipeline().Do(req) + if err != nil { + return OperationsListResponse{}, err + } + if !resp.HasStatusCode(http.StatusOK) { + return OperationsListResponse{}, client.listHandleError(resp) + } + return client.listHandleResponse(resp) +} + +// listCreateRequest creates the List request. +func (client *OperationsClient) listCreateRequest(ctx context.Context, options *OperationsListOptions) (*azcore.Request, error) { + urlPath := "/providers/Microsoft.ContainerService/operations" + req, err := azcore.NewRequest(ctx, http.MethodGet, azcore.JoinPaths(client.con.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + req.Telemetry(telemetryInfo) + reqQP := req.URL.Query() + reqQP.Set("api-version", "2021-07-01") + req.URL.RawQuery = reqQP.Encode() + req.Header.Set("Accept", "application/json") + return req, nil +} + +// listHandleResponse handles the List response. +func (client *OperationsClient) listHandleResponse(resp *azcore.Response) (OperationsListResponse, error) { + result := OperationsListResponse{RawResponse: resp.Response} + if err := resp.UnmarshalAsJSON(&result.OperationListResult); err != nil { + return OperationsListResponse{}, err + } + return result, nil +} + +// listHandleError handles the List error response. +func (client *OperationsClient) listHandleError(resp *azcore.Response) error { + body, err := resp.Payload() + if err != nil { + return azcore.NewResponseError(err, resp.Response) + } + errType := CloudError{raw: string(body)} + if err := resp.UnmarshalAsJSON(&errType); err != nil { + return azcore.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp.Response) + } + return azcore.NewResponseError(&errType, resp.Response) +} diff --git a/sdk/containerservice/armcontainerservice/zz_generated_pagers.go b/sdk/containerservice/armcontainerservice/zz_generated_pagers.go new file mode 100644 index 000000000000..11f82068bb67 --- /dev/null +++ b/sdk/containerservice/armcontainerservice/zz_generated_pagers.go @@ -0,0 +1,290 @@ +// +build go1.13 + +// 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. + +package armcontainerservice + +import ( + "context" + "github.com/Azure/azure-sdk-for-go/sdk/azcore" + "net/http" + "reflect" +) + +type AgentPoolsListPager interface { + azcore.Pager + // PageResponse returns the current AgentPoolsListResponse. + PageResponse() AgentPoolsListResponse +} + +type agentPoolsListPager struct { + client *AgentPoolsClient + current AgentPoolsListResponse + err error + requester func(context.Context) (*azcore.Request, error) + advancer func(context.Context, AgentPoolsListResponse) (*azcore.Request, error) +} + +func (p *agentPoolsListPager) Err() error { + return p.err +} + +func (p *agentPoolsListPager) NextPage(ctx context.Context) bool { + var req *azcore.Request + var err error + if !reflect.ValueOf(p.current).IsZero() { + if p.current.AgentPoolListResult.NextLink == nil || len(*p.current.AgentPoolListResult.NextLink) == 0 { + return false + } + req, err = p.advancer(ctx, p.current) + } else { + req, err = p.requester(ctx) + } + if err != nil { + p.err = err + return false + } + resp, err := p.client.con.Pipeline().Do(req) + if err != nil { + p.err = err + return false + } + if !resp.HasStatusCode(http.StatusOK) { + p.err = p.client.listHandleError(resp) + return false + } + result, err := p.client.listHandleResponse(resp) + if err != nil { + p.err = err + return false + } + p.current = result + return true +} + +func (p *agentPoolsListPager) PageResponse() AgentPoolsListResponse { + return p.current +} + +type MaintenanceConfigurationsListByManagedClusterPager interface { + azcore.Pager + // PageResponse returns the current MaintenanceConfigurationsListByManagedClusterResponse. + PageResponse() MaintenanceConfigurationsListByManagedClusterResponse +} + +type maintenanceConfigurationsListByManagedClusterPager struct { + client *MaintenanceConfigurationsClient + current MaintenanceConfigurationsListByManagedClusterResponse + err error + requester func(context.Context) (*azcore.Request, error) + advancer func(context.Context, MaintenanceConfigurationsListByManagedClusterResponse) (*azcore.Request, error) +} + +func (p *maintenanceConfigurationsListByManagedClusterPager) Err() error { + return p.err +} + +func (p *maintenanceConfigurationsListByManagedClusterPager) NextPage(ctx context.Context) bool { + var req *azcore.Request + var err error + if !reflect.ValueOf(p.current).IsZero() { + if p.current.MaintenanceConfigurationListResult.NextLink == nil || len(*p.current.MaintenanceConfigurationListResult.NextLink) == 0 { + return false + } + req, err = p.advancer(ctx, p.current) + } else { + req, err = p.requester(ctx) + } + if err != nil { + p.err = err + return false + } + resp, err := p.client.con.Pipeline().Do(req) + if err != nil { + p.err = err + return false + } + if !resp.HasStatusCode(http.StatusOK) { + p.err = p.client.listByManagedClusterHandleError(resp) + return false + } + result, err := p.client.listByManagedClusterHandleResponse(resp) + if err != nil { + p.err = err + return false + } + p.current = result + return true +} + +func (p *maintenanceConfigurationsListByManagedClusterPager) PageResponse() MaintenanceConfigurationsListByManagedClusterResponse { + return p.current +} + +type ManagedClustersListByResourceGroupPager interface { + azcore.Pager + // PageResponse returns the current ManagedClustersListByResourceGroupResponse. + PageResponse() ManagedClustersListByResourceGroupResponse +} + +type managedClustersListByResourceGroupPager struct { + client *ManagedClustersClient + current ManagedClustersListByResourceGroupResponse + err error + requester func(context.Context) (*azcore.Request, error) + advancer func(context.Context, ManagedClustersListByResourceGroupResponse) (*azcore.Request, error) +} + +func (p *managedClustersListByResourceGroupPager) Err() error { + return p.err +} + +func (p *managedClustersListByResourceGroupPager) NextPage(ctx context.Context) bool { + var req *azcore.Request + var err error + if !reflect.ValueOf(p.current).IsZero() { + if p.current.ManagedClusterListResult.NextLink == nil || len(*p.current.ManagedClusterListResult.NextLink) == 0 { + return false + } + req, err = p.advancer(ctx, p.current) + } else { + req, err = p.requester(ctx) + } + if err != nil { + p.err = err + return false + } + resp, err := p.client.con.Pipeline().Do(req) + if err != nil { + p.err = err + return false + } + if !resp.HasStatusCode(http.StatusOK) { + p.err = p.client.listByResourceGroupHandleError(resp) + return false + } + result, err := p.client.listByResourceGroupHandleResponse(resp) + if err != nil { + p.err = err + return false + } + p.current = result + return true +} + +func (p *managedClustersListByResourceGroupPager) PageResponse() ManagedClustersListByResourceGroupResponse { + return p.current +} + +type ManagedClustersListOutboundNetworkDependenciesEndpointsPager interface { + azcore.Pager + // PageResponse returns the current ManagedClustersListOutboundNetworkDependenciesEndpointsResponse. + PageResponse() ManagedClustersListOutboundNetworkDependenciesEndpointsResponse +} + +type managedClustersListOutboundNetworkDependenciesEndpointsPager struct { + client *ManagedClustersClient + current ManagedClustersListOutboundNetworkDependenciesEndpointsResponse + err error + requester func(context.Context) (*azcore.Request, error) + advancer func(context.Context, ManagedClustersListOutboundNetworkDependenciesEndpointsResponse) (*azcore.Request, error) +} + +func (p *managedClustersListOutboundNetworkDependenciesEndpointsPager) Err() error { + return p.err +} + +func (p *managedClustersListOutboundNetworkDependenciesEndpointsPager) NextPage(ctx context.Context) bool { + var req *azcore.Request + var err error + if !reflect.ValueOf(p.current).IsZero() { + if p.current.OutboundEnvironmentEndpointCollection.NextLink == nil || len(*p.current.OutboundEnvironmentEndpointCollection.NextLink) == 0 { + return false + } + req, err = p.advancer(ctx, p.current) + } else { + req, err = p.requester(ctx) + } + if err != nil { + p.err = err + return false + } + resp, err := p.client.con.Pipeline().Do(req) + if err != nil { + p.err = err + return false + } + if !resp.HasStatusCode(http.StatusOK) { + p.err = p.client.listOutboundNetworkDependenciesEndpointsHandleError(resp) + return false + } + result, err := p.client.listOutboundNetworkDependenciesEndpointsHandleResponse(resp) + if err != nil { + p.err = err + return false + } + p.current = result + return true +} + +func (p *managedClustersListOutboundNetworkDependenciesEndpointsPager) PageResponse() ManagedClustersListOutboundNetworkDependenciesEndpointsResponse { + return p.current +} + +type ManagedClustersListPager interface { + azcore.Pager + // PageResponse returns the current ManagedClustersListResponse. + PageResponse() ManagedClustersListResponse +} + +type managedClustersListPager struct { + client *ManagedClustersClient + current ManagedClustersListResponse + err error + requester func(context.Context) (*azcore.Request, error) + advancer func(context.Context, ManagedClustersListResponse) (*azcore.Request, error) +} + +func (p *managedClustersListPager) Err() error { + return p.err +} + +func (p *managedClustersListPager) NextPage(ctx context.Context) bool { + var req *azcore.Request + var err error + if !reflect.ValueOf(p.current).IsZero() { + if p.current.ManagedClusterListResult.NextLink == nil || len(*p.current.ManagedClusterListResult.NextLink) == 0 { + return false + } + req, err = p.advancer(ctx, p.current) + } else { + req, err = p.requester(ctx) + } + if err != nil { + p.err = err + return false + } + resp, err := p.client.con.Pipeline().Do(req) + if err != nil { + p.err = err + return false + } + if !resp.HasStatusCode(http.StatusOK) { + p.err = p.client.listHandleError(resp) + return false + } + result, err := p.client.listHandleResponse(resp) + if err != nil { + p.err = err + return false + } + p.current = result + return true +} + +func (p *managedClustersListPager) PageResponse() ManagedClustersListResponse { + return p.current +} diff --git a/sdk/containerservice/armcontainerservice/zz_generated_pollers.go b/sdk/containerservice/armcontainerservice/zz_generated_pollers.go new file mode 100644 index 000000000000..e32e833b73e3 --- /dev/null +++ b/sdk/containerservice/armcontainerservice/zz_generated_pollers.go @@ -0,0 +1,601 @@ +// +build go1.13 + +// 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. + +package armcontainerservice + +import ( + "context" + "github.com/Azure/azure-sdk-for-go/sdk/armcore" + "github.com/Azure/azure-sdk-for-go/sdk/azcore" + "net/http" + "time" +) + +// AgentPoolsCreateOrUpdatePoller provides polling facilities until the operation reaches a terminal state. +type AgentPoolsCreateOrUpdatePoller interface { + azcore.Poller + // FinalResponse performs a final GET to the service and returns the final response + // for the polling operation. If there is an error performing the final GET then an error is returned. + // If the final GET succeeded then the final AgentPoolsCreateOrUpdateResponse will be returned. + FinalResponse(ctx context.Context) (AgentPoolsCreateOrUpdateResponse, error) +} + +type agentPoolsCreateOrUpdatePoller struct { + pt *armcore.LROPoller +} + +func (p *agentPoolsCreateOrUpdatePoller) Done() bool { + return p.pt.Done() +} + +func (p *agentPoolsCreateOrUpdatePoller) Poll(ctx context.Context) (*http.Response, error) { + return p.pt.Poll(ctx) +} + +func (p *agentPoolsCreateOrUpdatePoller) FinalResponse(ctx context.Context) (AgentPoolsCreateOrUpdateResponse, error) { + respType := AgentPoolsCreateOrUpdateResponse{} + resp, err := p.pt.FinalResponse(ctx, &respType.AgentPool) + if err != nil { + return AgentPoolsCreateOrUpdateResponse{}, err + } + respType.RawResponse = resp + return respType, nil +} + +func (p *agentPoolsCreateOrUpdatePoller) ResumeToken() (string, error) { + return p.pt.ResumeToken() +} + +func (p *agentPoolsCreateOrUpdatePoller) pollUntilDone(ctx context.Context, freq time.Duration) (AgentPoolsCreateOrUpdateResponse, error) { + respType := AgentPoolsCreateOrUpdateResponse{} + resp, err := p.pt.PollUntilDone(ctx, freq, &respType.AgentPool) + if err != nil { + return AgentPoolsCreateOrUpdateResponse{}, err + } + respType.RawResponse = resp + return respType, nil +} + +// AgentPoolsDeletePoller provides polling facilities until the operation reaches a terminal state. +type AgentPoolsDeletePoller interface { + azcore.Poller + // FinalResponse performs a final GET to the service and returns the final response + // for the polling operation. If there is an error performing the final GET then an error is returned. + // If the final GET succeeded then the final AgentPoolsDeleteResponse will be returned. + FinalResponse(ctx context.Context) (AgentPoolsDeleteResponse, error) +} + +type agentPoolsDeletePoller struct { + pt *armcore.LROPoller +} + +func (p *agentPoolsDeletePoller) Done() bool { + return p.pt.Done() +} + +func (p *agentPoolsDeletePoller) Poll(ctx context.Context) (*http.Response, error) { + return p.pt.Poll(ctx) +} + +func (p *agentPoolsDeletePoller) FinalResponse(ctx context.Context) (AgentPoolsDeleteResponse, error) { + respType := AgentPoolsDeleteResponse{} + resp, err := p.pt.FinalResponse(ctx, nil) + if err != nil { + return AgentPoolsDeleteResponse{}, err + } + respType.RawResponse = resp + return respType, nil +} + +func (p *agentPoolsDeletePoller) ResumeToken() (string, error) { + return p.pt.ResumeToken() +} + +func (p *agentPoolsDeletePoller) pollUntilDone(ctx context.Context, freq time.Duration) (AgentPoolsDeleteResponse, error) { + respType := AgentPoolsDeleteResponse{} + resp, err := p.pt.PollUntilDone(ctx, freq, nil) + if err != nil { + return AgentPoolsDeleteResponse{}, err + } + respType.RawResponse = resp + return respType, nil +} + +// AgentPoolsUpgradeNodeImageVersionPoller provides polling facilities until the operation reaches a terminal state. +type AgentPoolsUpgradeNodeImageVersionPoller interface { + azcore.Poller + // FinalResponse performs a final GET to the service and returns the final response + // for the polling operation. If there is an error performing the final GET then an error is returned. + // If the final GET succeeded then the final AgentPoolsUpgradeNodeImageVersionResponse will be returned. + FinalResponse(ctx context.Context) (AgentPoolsUpgradeNodeImageVersionResponse, error) +} + +type agentPoolsUpgradeNodeImageVersionPoller struct { + pt *armcore.LROPoller +} + +func (p *agentPoolsUpgradeNodeImageVersionPoller) Done() bool { + return p.pt.Done() +} + +func (p *agentPoolsUpgradeNodeImageVersionPoller) Poll(ctx context.Context) (*http.Response, error) { + return p.pt.Poll(ctx) +} + +func (p *agentPoolsUpgradeNodeImageVersionPoller) FinalResponse(ctx context.Context) (AgentPoolsUpgradeNodeImageVersionResponse, error) { + respType := AgentPoolsUpgradeNodeImageVersionResponse{} + resp, err := p.pt.FinalResponse(ctx, &respType.AgentPool) + if err != nil { + return AgentPoolsUpgradeNodeImageVersionResponse{}, err + } + respType.RawResponse = resp + return respType, nil +} + +func (p *agentPoolsUpgradeNodeImageVersionPoller) ResumeToken() (string, error) { + return p.pt.ResumeToken() +} + +func (p *agentPoolsUpgradeNodeImageVersionPoller) pollUntilDone(ctx context.Context, freq time.Duration) (AgentPoolsUpgradeNodeImageVersionResponse, error) { + respType := AgentPoolsUpgradeNodeImageVersionResponse{} + resp, err := p.pt.PollUntilDone(ctx, freq, &respType.AgentPool) + if err != nil { + return AgentPoolsUpgradeNodeImageVersionResponse{}, err + } + respType.RawResponse = resp + return respType, nil +} + +// ManagedClustersCreateOrUpdatePoller provides polling facilities until the operation reaches a terminal state. +type ManagedClustersCreateOrUpdatePoller interface { + azcore.Poller + // FinalResponse performs a final GET to the service and returns the final response + // for the polling operation. If there is an error performing the final GET then an error is returned. + // If the final GET succeeded then the final ManagedClustersCreateOrUpdateResponse will be returned. + FinalResponse(ctx context.Context) (ManagedClustersCreateOrUpdateResponse, error) +} + +type managedClustersCreateOrUpdatePoller struct { + pt *armcore.LROPoller +} + +func (p *managedClustersCreateOrUpdatePoller) Done() bool { + return p.pt.Done() +} + +func (p *managedClustersCreateOrUpdatePoller) Poll(ctx context.Context) (*http.Response, error) { + return p.pt.Poll(ctx) +} + +func (p *managedClustersCreateOrUpdatePoller) FinalResponse(ctx context.Context) (ManagedClustersCreateOrUpdateResponse, error) { + respType := ManagedClustersCreateOrUpdateResponse{} + resp, err := p.pt.FinalResponse(ctx, &respType.ManagedCluster) + if err != nil { + return ManagedClustersCreateOrUpdateResponse{}, err + } + respType.RawResponse = resp + return respType, nil +} + +func (p *managedClustersCreateOrUpdatePoller) ResumeToken() (string, error) { + return p.pt.ResumeToken() +} + +func (p *managedClustersCreateOrUpdatePoller) pollUntilDone(ctx context.Context, freq time.Duration) (ManagedClustersCreateOrUpdateResponse, error) { + respType := ManagedClustersCreateOrUpdateResponse{} + resp, err := p.pt.PollUntilDone(ctx, freq, &respType.ManagedCluster) + if err != nil { + return ManagedClustersCreateOrUpdateResponse{}, err + } + respType.RawResponse = resp + return respType, nil +} + +// ManagedClustersDeletePoller provides polling facilities until the operation reaches a terminal state. +type ManagedClustersDeletePoller interface { + azcore.Poller + // FinalResponse performs a final GET to the service and returns the final response + // for the polling operation. If there is an error performing the final GET then an error is returned. + // If the final GET succeeded then the final ManagedClustersDeleteResponse will be returned. + FinalResponse(ctx context.Context) (ManagedClustersDeleteResponse, error) +} + +type managedClustersDeletePoller struct { + pt *armcore.LROPoller +} + +func (p *managedClustersDeletePoller) Done() bool { + return p.pt.Done() +} + +func (p *managedClustersDeletePoller) Poll(ctx context.Context) (*http.Response, error) { + return p.pt.Poll(ctx) +} + +func (p *managedClustersDeletePoller) FinalResponse(ctx context.Context) (ManagedClustersDeleteResponse, error) { + respType := ManagedClustersDeleteResponse{} + resp, err := p.pt.FinalResponse(ctx, nil) + if err != nil { + return ManagedClustersDeleteResponse{}, err + } + respType.RawResponse = resp + return respType, nil +} + +func (p *managedClustersDeletePoller) ResumeToken() (string, error) { + return p.pt.ResumeToken() +} + +func (p *managedClustersDeletePoller) pollUntilDone(ctx context.Context, freq time.Duration) (ManagedClustersDeleteResponse, error) { + respType := ManagedClustersDeleteResponse{} + resp, err := p.pt.PollUntilDone(ctx, freq, nil) + if err != nil { + return ManagedClustersDeleteResponse{}, err + } + respType.RawResponse = resp + return respType, nil +} + +// ManagedClustersResetAADProfilePoller provides polling facilities until the operation reaches a terminal state. +type ManagedClustersResetAADProfilePoller interface { + azcore.Poller + // FinalResponse performs a final GET to the service and returns the final response + // for the polling operation. If there is an error performing the final GET then an error is returned. + // If the final GET succeeded then the final ManagedClustersResetAADProfileResponse will be returned. + FinalResponse(ctx context.Context) (ManagedClustersResetAADProfileResponse, error) +} + +type managedClustersResetAADProfilePoller struct { + pt *armcore.LROPoller +} + +func (p *managedClustersResetAADProfilePoller) Done() bool { + return p.pt.Done() +} + +func (p *managedClustersResetAADProfilePoller) Poll(ctx context.Context) (*http.Response, error) { + return p.pt.Poll(ctx) +} + +func (p *managedClustersResetAADProfilePoller) FinalResponse(ctx context.Context) (ManagedClustersResetAADProfileResponse, error) { + respType := ManagedClustersResetAADProfileResponse{} + resp, err := p.pt.FinalResponse(ctx, nil) + if err != nil { + return ManagedClustersResetAADProfileResponse{}, err + } + respType.RawResponse = resp + return respType, nil +} + +func (p *managedClustersResetAADProfilePoller) ResumeToken() (string, error) { + return p.pt.ResumeToken() +} + +func (p *managedClustersResetAADProfilePoller) pollUntilDone(ctx context.Context, freq time.Duration) (ManagedClustersResetAADProfileResponse, error) { + respType := ManagedClustersResetAADProfileResponse{} + resp, err := p.pt.PollUntilDone(ctx, freq, nil) + if err != nil { + return ManagedClustersResetAADProfileResponse{}, err + } + respType.RawResponse = resp + return respType, nil +} + +// ManagedClustersResetServicePrincipalProfilePoller provides polling facilities until the operation reaches a terminal state. +type ManagedClustersResetServicePrincipalProfilePoller interface { + azcore.Poller + // FinalResponse performs a final GET to the service and returns the final response + // for the polling operation. If there is an error performing the final GET then an error is returned. + // If the final GET succeeded then the final ManagedClustersResetServicePrincipalProfileResponse will be returned. + FinalResponse(ctx context.Context) (ManagedClustersResetServicePrincipalProfileResponse, error) +} + +type managedClustersResetServicePrincipalProfilePoller struct { + pt *armcore.LROPoller +} + +func (p *managedClustersResetServicePrincipalProfilePoller) Done() bool { + return p.pt.Done() +} + +func (p *managedClustersResetServicePrincipalProfilePoller) Poll(ctx context.Context) (*http.Response, error) { + return p.pt.Poll(ctx) +} + +func (p *managedClustersResetServicePrincipalProfilePoller) FinalResponse(ctx context.Context) (ManagedClustersResetServicePrincipalProfileResponse, error) { + respType := ManagedClustersResetServicePrincipalProfileResponse{} + resp, err := p.pt.FinalResponse(ctx, nil) + if err != nil { + return ManagedClustersResetServicePrincipalProfileResponse{}, err + } + respType.RawResponse = resp + return respType, nil +} + +func (p *managedClustersResetServicePrincipalProfilePoller) ResumeToken() (string, error) { + return p.pt.ResumeToken() +} + +func (p *managedClustersResetServicePrincipalProfilePoller) pollUntilDone(ctx context.Context, freq time.Duration) (ManagedClustersResetServicePrincipalProfileResponse, error) { + respType := ManagedClustersResetServicePrincipalProfileResponse{} + resp, err := p.pt.PollUntilDone(ctx, freq, nil) + if err != nil { + return ManagedClustersResetServicePrincipalProfileResponse{}, err + } + respType.RawResponse = resp + return respType, nil +} + +// ManagedClustersRotateClusterCertificatesPoller provides polling facilities until the operation reaches a terminal state. +type ManagedClustersRotateClusterCertificatesPoller interface { + azcore.Poller + // FinalResponse performs a final GET to the service and returns the final response + // for the polling operation. If there is an error performing the final GET then an error is returned. + // If the final GET succeeded then the final ManagedClustersRotateClusterCertificatesResponse will be returned. + FinalResponse(ctx context.Context) (ManagedClustersRotateClusterCertificatesResponse, error) +} + +type managedClustersRotateClusterCertificatesPoller struct { + pt *armcore.LROPoller +} + +func (p *managedClustersRotateClusterCertificatesPoller) Done() bool { + return p.pt.Done() +} + +func (p *managedClustersRotateClusterCertificatesPoller) Poll(ctx context.Context) (*http.Response, error) { + return p.pt.Poll(ctx) +} + +func (p *managedClustersRotateClusterCertificatesPoller) FinalResponse(ctx context.Context) (ManagedClustersRotateClusterCertificatesResponse, error) { + respType := ManagedClustersRotateClusterCertificatesResponse{} + resp, err := p.pt.FinalResponse(ctx, nil) + if err != nil { + return ManagedClustersRotateClusterCertificatesResponse{}, err + } + respType.RawResponse = resp + return respType, nil +} + +func (p *managedClustersRotateClusterCertificatesPoller) ResumeToken() (string, error) { + return p.pt.ResumeToken() +} + +func (p *managedClustersRotateClusterCertificatesPoller) pollUntilDone(ctx context.Context, freq time.Duration) (ManagedClustersRotateClusterCertificatesResponse, error) { + respType := ManagedClustersRotateClusterCertificatesResponse{} + resp, err := p.pt.PollUntilDone(ctx, freq, nil) + if err != nil { + return ManagedClustersRotateClusterCertificatesResponse{}, err + } + respType.RawResponse = resp + return respType, nil +} + +// ManagedClustersRunCommandPoller provides polling facilities until the operation reaches a terminal state. +type ManagedClustersRunCommandPoller interface { + azcore.Poller + // FinalResponse performs a final GET to the service and returns the final response + // for the polling operation. If there is an error performing the final GET then an error is returned. + // If the final GET succeeded then the final ManagedClustersRunCommandResponse will be returned. + FinalResponse(ctx context.Context) (ManagedClustersRunCommandResponse, error) +} + +type managedClustersRunCommandPoller struct { + pt *armcore.LROPoller +} + +func (p *managedClustersRunCommandPoller) Done() bool { + return p.pt.Done() +} + +func (p *managedClustersRunCommandPoller) Poll(ctx context.Context) (*http.Response, error) { + return p.pt.Poll(ctx) +} + +func (p *managedClustersRunCommandPoller) FinalResponse(ctx context.Context) (ManagedClustersRunCommandResponse, error) { + respType := ManagedClustersRunCommandResponse{} + resp, err := p.pt.FinalResponse(ctx, &respType.RunCommandResult) + if err != nil { + return ManagedClustersRunCommandResponse{}, err + } + respType.RawResponse = resp + return respType, nil +} + +func (p *managedClustersRunCommandPoller) ResumeToken() (string, error) { + return p.pt.ResumeToken() +} + +func (p *managedClustersRunCommandPoller) pollUntilDone(ctx context.Context, freq time.Duration) (ManagedClustersRunCommandResponse, error) { + respType := ManagedClustersRunCommandResponse{} + resp, err := p.pt.PollUntilDone(ctx, freq, &respType.RunCommandResult) + if err != nil { + return ManagedClustersRunCommandResponse{}, err + } + respType.RawResponse = resp + return respType, nil +} + +// ManagedClustersStartPoller provides polling facilities until the operation reaches a terminal state. +type ManagedClustersStartPoller interface { + azcore.Poller + // FinalResponse performs a final GET to the service and returns the final response + // for the polling operation. If there is an error performing the final GET then an error is returned. + // If the final GET succeeded then the final ManagedClustersStartResponse will be returned. + FinalResponse(ctx context.Context) (ManagedClustersStartResponse, error) +} + +type managedClustersStartPoller struct { + pt *armcore.LROPoller +} + +func (p *managedClustersStartPoller) Done() bool { + return p.pt.Done() +} + +func (p *managedClustersStartPoller) Poll(ctx context.Context) (*http.Response, error) { + return p.pt.Poll(ctx) +} + +func (p *managedClustersStartPoller) FinalResponse(ctx context.Context) (ManagedClustersStartResponse, error) { + respType := ManagedClustersStartResponse{} + resp, err := p.pt.FinalResponse(ctx, nil) + if err != nil { + return ManagedClustersStartResponse{}, err + } + respType.RawResponse = resp + return respType, nil +} + +func (p *managedClustersStartPoller) ResumeToken() (string, error) { + return p.pt.ResumeToken() +} + +func (p *managedClustersStartPoller) pollUntilDone(ctx context.Context, freq time.Duration) (ManagedClustersStartResponse, error) { + respType := ManagedClustersStartResponse{} + resp, err := p.pt.PollUntilDone(ctx, freq, nil) + if err != nil { + return ManagedClustersStartResponse{}, err + } + respType.RawResponse = resp + return respType, nil +} + +// ManagedClustersStopPoller provides polling facilities until the operation reaches a terminal state. +type ManagedClustersStopPoller interface { + azcore.Poller + // FinalResponse performs a final GET to the service and returns the final response + // for the polling operation. If there is an error performing the final GET then an error is returned. + // If the final GET succeeded then the final ManagedClustersStopResponse will be returned. + FinalResponse(ctx context.Context) (ManagedClustersStopResponse, error) +} + +type managedClustersStopPoller struct { + pt *armcore.LROPoller +} + +func (p *managedClustersStopPoller) Done() bool { + return p.pt.Done() +} + +func (p *managedClustersStopPoller) Poll(ctx context.Context) (*http.Response, error) { + return p.pt.Poll(ctx) +} + +func (p *managedClustersStopPoller) FinalResponse(ctx context.Context) (ManagedClustersStopResponse, error) { + respType := ManagedClustersStopResponse{} + resp, err := p.pt.FinalResponse(ctx, nil) + if err != nil { + return ManagedClustersStopResponse{}, err + } + respType.RawResponse = resp + return respType, nil +} + +func (p *managedClustersStopPoller) ResumeToken() (string, error) { + return p.pt.ResumeToken() +} + +func (p *managedClustersStopPoller) pollUntilDone(ctx context.Context, freq time.Duration) (ManagedClustersStopResponse, error) { + respType := ManagedClustersStopResponse{} + resp, err := p.pt.PollUntilDone(ctx, freq, nil) + if err != nil { + return ManagedClustersStopResponse{}, err + } + respType.RawResponse = resp + return respType, nil +} + +// ManagedClustersUpdateTagsPoller provides polling facilities until the operation reaches a terminal state. +type ManagedClustersUpdateTagsPoller interface { + azcore.Poller + // FinalResponse performs a final GET to the service and returns the final response + // for the polling operation. If there is an error performing the final GET then an error is returned. + // If the final GET succeeded then the final ManagedClustersUpdateTagsResponse will be returned. + FinalResponse(ctx context.Context) (ManagedClustersUpdateTagsResponse, error) +} + +type managedClustersUpdateTagsPoller struct { + pt *armcore.LROPoller +} + +func (p *managedClustersUpdateTagsPoller) Done() bool { + return p.pt.Done() +} + +func (p *managedClustersUpdateTagsPoller) Poll(ctx context.Context) (*http.Response, error) { + return p.pt.Poll(ctx) +} + +func (p *managedClustersUpdateTagsPoller) FinalResponse(ctx context.Context) (ManagedClustersUpdateTagsResponse, error) { + respType := ManagedClustersUpdateTagsResponse{} + resp, err := p.pt.FinalResponse(ctx, &respType.ManagedCluster) + if err != nil { + return ManagedClustersUpdateTagsResponse{}, err + } + respType.RawResponse = resp + return respType, nil +} + +func (p *managedClustersUpdateTagsPoller) ResumeToken() (string, error) { + return p.pt.ResumeToken() +} + +func (p *managedClustersUpdateTagsPoller) pollUntilDone(ctx context.Context, freq time.Duration) (ManagedClustersUpdateTagsResponse, error) { + respType := ManagedClustersUpdateTagsResponse{} + resp, err := p.pt.PollUntilDone(ctx, freq, &respType.ManagedCluster) + if err != nil { + return ManagedClustersUpdateTagsResponse{}, err + } + respType.RawResponse = resp + return respType, nil +} + +// PrivateEndpointConnectionsDeletePoller provides polling facilities until the operation reaches a terminal state. +type PrivateEndpointConnectionsDeletePoller interface { + azcore.Poller + // FinalResponse performs a final GET to the service and returns the final response + // for the polling operation. If there is an error performing the final GET then an error is returned. + // If the final GET succeeded then the final PrivateEndpointConnectionsDeleteResponse will be returned. + FinalResponse(ctx context.Context) (PrivateEndpointConnectionsDeleteResponse, error) +} + +type privateEndpointConnectionsDeletePoller struct { + pt *armcore.LROPoller +} + +func (p *privateEndpointConnectionsDeletePoller) Done() bool { + return p.pt.Done() +} + +func (p *privateEndpointConnectionsDeletePoller) Poll(ctx context.Context) (*http.Response, error) { + return p.pt.Poll(ctx) +} + +func (p *privateEndpointConnectionsDeletePoller) FinalResponse(ctx context.Context) (PrivateEndpointConnectionsDeleteResponse, error) { + respType := PrivateEndpointConnectionsDeleteResponse{} + resp, err := p.pt.FinalResponse(ctx, nil) + if err != nil { + return PrivateEndpointConnectionsDeleteResponse{}, err + } + respType.RawResponse = resp + return respType, nil +} + +func (p *privateEndpointConnectionsDeletePoller) ResumeToken() (string, error) { + return p.pt.ResumeToken() +} + +func (p *privateEndpointConnectionsDeletePoller) pollUntilDone(ctx context.Context, freq time.Duration) (PrivateEndpointConnectionsDeleteResponse, error) { + respType := PrivateEndpointConnectionsDeleteResponse{} + resp, err := p.pt.PollUntilDone(ctx, freq, nil) + if err != nil { + return PrivateEndpointConnectionsDeleteResponse{}, err + } + respType.RawResponse = resp + return respType, nil +} diff --git a/sdk/containerservice/armcontainerservice/zz_generated_privateendpointconnections_client.go b/sdk/containerservice/armcontainerservice/zz_generated_privateendpointconnections_client.go new file mode 100644 index 000000000000..3acc26f88d7a --- /dev/null +++ b/sdk/containerservice/armcontainerservice/zz_generated_privateendpointconnections_client.go @@ -0,0 +1,347 @@ +// +build go1.13 + +// 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. + +package armcontainerservice + +import ( + "context" + "errors" + "fmt" + "github.com/Azure/azure-sdk-for-go/sdk/armcore" + "github.com/Azure/azure-sdk-for-go/sdk/azcore" + "net/http" + "net/url" + "strings" + "time" +) + +// PrivateEndpointConnectionsClient contains the methods for the PrivateEndpointConnections group. +// Don't use this type directly, use NewPrivateEndpointConnectionsClient() instead. +type PrivateEndpointConnectionsClient struct { + con *armcore.Connection + subscriptionID string +} + +// NewPrivateEndpointConnectionsClient creates a new instance of PrivateEndpointConnectionsClient with the specified values. +func NewPrivateEndpointConnectionsClient(con *armcore.Connection, subscriptionID string) *PrivateEndpointConnectionsClient { + return &PrivateEndpointConnectionsClient{con: con, subscriptionID: subscriptionID} +} + +// BeginDelete - Deletes a private endpoint connection. +// If the operation fails it returns the *CloudError error type. +func (client *PrivateEndpointConnectionsClient) BeginDelete(ctx context.Context, resourceGroupName string, resourceName string, privateEndpointConnectionName string, options *PrivateEndpointConnectionsBeginDeleteOptions) (PrivateEndpointConnectionsDeletePollerResponse, error) { + resp, err := client.deleteOperation(ctx, resourceGroupName, resourceName, privateEndpointConnectionName, options) + if err != nil { + return PrivateEndpointConnectionsDeletePollerResponse{}, err + } + result := PrivateEndpointConnectionsDeletePollerResponse{ + RawResponse: resp.Response, + } + pt, err := armcore.NewLROPoller("PrivateEndpointConnectionsClient.Delete", "", resp, client.con.Pipeline(), client.deleteHandleError) + if err != nil { + return PrivateEndpointConnectionsDeletePollerResponse{}, err + } + poller := &privateEndpointConnectionsDeletePoller{ + pt: pt, + } + result.Poller = poller + result.PollUntilDone = func(ctx context.Context, frequency time.Duration) (PrivateEndpointConnectionsDeleteResponse, error) { + return poller.pollUntilDone(ctx, frequency) + } + return result, nil +} + +// ResumeDelete creates a new PrivateEndpointConnectionsDeletePoller from the specified resume token. +// token - The value must come from a previous call to PrivateEndpointConnectionsDeletePoller.ResumeToken(). +func (client *PrivateEndpointConnectionsClient) ResumeDelete(ctx context.Context, token string) (PrivateEndpointConnectionsDeletePollerResponse, error) { + pt, err := armcore.NewLROPollerFromResumeToken("PrivateEndpointConnectionsClient.Delete", token, client.con.Pipeline(), client.deleteHandleError) + if err != nil { + return PrivateEndpointConnectionsDeletePollerResponse{}, err + } + poller := &privateEndpointConnectionsDeletePoller{ + pt: pt, + } + resp, err := poller.Poll(ctx) + if err != nil { + return PrivateEndpointConnectionsDeletePollerResponse{}, err + } + result := PrivateEndpointConnectionsDeletePollerResponse{ + RawResponse: resp, + } + result.Poller = poller + result.PollUntilDone = func(ctx context.Context, frequency time.Duration) (PrivateEndpointConnectionsDeleteResponse, error) { + return poller.pollUntilDone(ctx, frequency) + } + return result, nil +} + +// Delete - Deletes a private endpoint connection. +// If the operation fails it returns the *CloudError error type. +func (client *PrivateEndpointConnectionsClient) deleteOperation(ctx context.Context, resourceGroupName string, resourceName string, privateEndpointConnectionName string, options *PrivateEndpointConnectionsBeginDeleteOptions) (*azcore.Response, error) { + req, err := client.deleteCreateRequest(ctx, resourceGroupName, resourceName, privateEndpointConnectionName, options) + if err != nil { + return nil, err + } + resp, err := client.con.Pipeline().Do(req) + if err != nil { + return nil, err + } + if !resp.HasStatusCode(http.StatusOK, http.StatusNoContent) { + return nil, client.deleteHandleError(resp) + } + return resp, nil +} + +// deleteCreateRequest creates the Delete request. +func (client *PrivateEndpointConnectionsClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, resourceName string, privateEndpointConnectionName string, options *PrivateEndpointConnectionsBeginDeleteOptions) (*azcore.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/privateEndpointConnections/{privateEndpointConnectionName}" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if resourceName == "" { + return nil, errors.New("parameter resourceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceName}", url.PathEscape(resourceName)) + if privateEndpointConnectionName == "" { + return nil, errors.New("parameter privateEndpointConnectionName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{privateEndpointConnectionName}", url.PathEscape(privateEndpointConnectionName)) + req, err := azcore.NewRequest(ctx, http.MethodDelete, azcore.JoinPaths(client.con.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + req.Telemetry(telemetryInfo) + reqQP := req.URL.Query() + reqQP.Set("api-version", "2021-07-01") + req.URL.RawQuery = reqQP.Encode() + req.Header.Set("Accept", "application/json") + return req, nil +} + +// deleteHandleError handles the Delete error response. +func (client *PrivateEndpointConnectionsClient) deleteHandleError(resp *azcore.Response) error { + body, err := resp.Payload() + if err != nil { + return azcore.NewResponseError(err, resp.Response) + } + errType := CloudError{raw: string(body)} + if err := resp.UnmarshalAsJSON(&errType); err != nil { + return azcore.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp.Response) + } + return azcore.NewResponseError(&errType, resp.Response) +} + +// Get - To learn more about private clusters, see: https://docs.microsoft.com/azure/aks/private-clusters +// If the operation fails it returns the *CloudError error type. +func (client *PrivateEndpointConnectionsClient) Get(ctx context.Context, resourceGroupName string, resourceName string, privateEndpointConnectionName string, options *PrivateEndpointConnectionsGetOptions) (PrivateEndpointConnectionsGetResponse, error) { + req, err := client.getCreateRequest(ctx, resourceGroupName, resourceName, privateEndpointConnectionName, options) + if err != nil { + return PrivateEndpointConnectionsGetResponse{}, err + } + resp, err := client.con.Pipeline().Do(req) + if err != nil { + return PrivateEndpointConnectionsGetResponse{}, err + } + if !resp.HasStatusCode(http.StatusOK) { + return PrivateEndpointConnectionsGetResponse{}, client.getHandleError(resp) + } + return client.getHandleResponse(resp) +} + +// getCreateRequest creates the Get request. +func (client *PrivateEndpointConnectionsClient) getCreateRequest(ctx context.Context, resourceGroupName string, resourceName string, privateEndpointConnectionName string, options *PrivateEndpointConnectionsGetOptions) (*azcore.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/privateEndpointConnections/{privateEndpointConnectionName}" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if resourceName == "" { + return nil, errors.New("parameter resourceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceName}", url.PathEscape(resourceName)) + if privateEndpointConnectionName == "" { + return nil, errors.New("parameter privateEndpointConnectionName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{privateEndpointConnectionName}", url.PathEscape(privateEndpointConnectionName)) + req, err := azcore.NewRequest(ctx, http.MethodGet, azcore.JoinPaths(client.con.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + req.Telemetry(telemetryInfo) + reqQP := req.URL.Query() + reqQP.Set("api-version", "2021-07-01") + req.URL.RawQuery = reqQP.Encode() + req.Header.Set("Accept", "application/json") + return req, nil +} + +// getHandleResponse handles the Get response. +func (client *PrivateEndpointConnectionsClient) getHandleResponse(resp *azcore.Response) (PrivateEndpointConnectionsGetResponse, error) { + result := PrivateEndpointConnectionsGetResponse{RawResponse: resp.Response} + if err := resp.UnmarshalAsJSON(&result.PrivateEndpointConnection); err != nil { + return PrivateEndpointConnectionsGetResponse{}, err + } + return result, nil +} + +// getHandleError handles the Get error response. +func (client *PrivateEndpointConnectionsClient) getHandleError(resp *azcore.Response) error { + body, err := resp.Payload() + if err != nil { + return azcore.NewResponseError(err, resp.Response) + } + errType := CloudError{raw: string(body)} + if err := resp.UnmarshalAsJSON(&errType); err != nil { + return azcore.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp.Response) + } + return azcore.NewResponseError(&errType, resp.Response) +} + +// List - To learn more about private clusters, see: https://docs.microsoft.com/azure/aks/private-clusters +// If the operation fails it returns the *CloudError error type. +func (client *PrivateEndpointConnectionsClient) List(ctx context.Context, resourceGroupName string, resourceName string, options *PrivateEndpointConnectionsListOptions) (PrivateEndpointConnectionsListResponse, error) { + req, err := client.listCreateRequest(ctx, resourceGroupName, resourceName, options) + if err != nil { + return PrivateEndpointConnectionsListResponse{}, err + } + resp, err := client.con.Pipeline().Do(req) + if err != nil { + return PrivateEndpointConnectionsListResponse{}, err + } + if !resp.HasStatusCode(http.StatusOK) { + return PrivateEndpointConnectionsListResponse{}, client.listHandleError(resp) + } + return client.listHandleResponse(resp) +} + +// listCreateRequest creates the List request. +func (client *PrivateEndpointConnectionsClient) listCreateRequest(ctx context.Context, resourceGroupName string, resourceName string, options *PrivateEndpointConnectionsListOptions) (*azcore.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/privateEndpointConnections" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if resourceName == "" { + return nil, errors.New("parameter resourceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceName}", url.PathEscape(resourceName)) + req, err := azcore.NewRequest(ctx, http.MethodGet, azcore.JoinPaths(client.con.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + req.Telemetry(telemetryInfo) + reqQP := req.URL.Query() + reqQP.Set("api-version", "2021-07-01") + req.URL.RawQuery = reqQP.Encode() + req.Header.Set("Accept", "application/json") + return req, nil +} + +// listHandleResponse handles the List response. +func (client *PrivateEndpointConnectionsClient) listHandleResponse(resp *azcore.Response) (PrivateEndpointConnectionsListResponse, error) { + result := PrivateEndpointConnectionsListResponse{RawResponse: resp.Response} + if err := resp.UnmarshalAsJSON(&result.PrivateEndpointConnectionListResult); err != nil { + return PrivateEndpointConnectionsListResponse{}, err + } + return result, nil +} + +// listHandleError handles the List error response. +func (client *PrivateEndpointConnectionsClient) listHandleError(resp *azcore.Response) error { + body, err := resp.Payload() + if err != nil { + return azcore.NewResponseError(err, resp.Response) + } + errType := CloudError{raw: string(body)} + if err := resp.UnmarshalAsJSON(&errType); err != nil { + return azcore.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp.Response) + } + return azcore.NewResponseError(&errType, resp.Response) +} + +// Update - Updates a private endpoint connection. +// If the operation fails it returns the *CloudError error type. +func (client *PrivateEndpointConnectionsClient) Update(ctx context.Context, resourceGroupName string, resourceName string, privateEndpointConnectionName string, parameters PrivateEndpointConnection, options *PrivateEndpointConnectionsUpdateOptions) (PrivateEndpointConnectionsUpdateResponse, error) { + req, err := client.updateCreateRequest(ctx, resourceGroupName, resourceName, privateEndpointConnectionName, parameters, options) + if err != nil { + return PrivateEndpointConnectionsUpdateResponse{}, err + } + resp, err := client.con.Pipeline().Do(req) + if err != nil { + return PrivateEndpointConnectionsUpdateResponse{}, err + } + if !resp.HasStatusCode(http.StatusOK) { + return PrivateEndpointConnectionsUpdateResponse{}, client.updateHandleError(resp) + } + return client.updateHandleResponse(resp) +} + +// updateCreateRequest creates the Update request. +func (client *PrivateEndpointConnectionsClient) updateCreateRequest(ctx context.Context, resourceGroupName string, resourceName string, privateEndpointConnectionName string, parameters PrivateEndpointConnection, options *PrivateEndpointConnectionsUpdateOptions) (*azcore.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/privateEndpointConnections/{privateEndpointConnectionName}" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if resourceName == "" { + return nil, errors.New("parameter resourceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceName}", url.PathEscape(resourceName)) + if privateEndpointConnectionName == "" { + return nil, errors.New("parameter privateEndpointConnectionName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{privateEndpointConnectionName}", url.PathEscape(privateEndpointConnectionName)) + req, err := azcore.NewRequest(ctx, http.MethodPut, azcore.JoinPaths(client.con.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + req.Telemetry(telemetryInfo) + reqQP := req.URL.Query() + reqQP.Set("api-version", "2021-07-01") + req.URL.RawQuery = reqQP.Encode() + req.Header.Set("Accept", "application/json") + return req, req.MarshalAsJSON(parameters) +} + +// updateHandleResponse handles the Update response. +func (client *PrivateEndpointConnectionsClient) updateHandleResponse(resp *azcore.Response) (PrivateEndpointConnectionsUpdateResponse, error) { + result := PrivateEndpointConnectionsUpdateResponse{RawResponse: resp.Response} + if err := resp.UnmarshalAsJSON(&result.PrivateEndpointConnection); err != nil { + return PrivateEndpointConnectionsUpdateResponse{}, err + } + return result, nil +} + +// updateHandleError handles the Update error response. +func (client *PrivateEndpointConnectionsClient) updateHandleError(resp *azcore.Response) error { + body, err := resp.Payload() + if err != nil { + return azcore.NewResponseError(err, resp.Response) + } + errType := CloudError{raw: string(body)} + if err := resp.UnmarshalAsJSON(&errType); err != nil { + return azcore.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp.Response) + } + return azcore.NewResponseError(&errType, resp.Response) +} diff --git a/sdk/containerservice/armcontainerservice/zz_generated_privatelinkresources_client.go b/sdk/containerservice/armcontainerservice/zz_generated_privatelinkresources_client.go new file mode 100644 index 000000000000..ef5bd4be439c --- /dev/null +++ b/sdk/containerservice/armcontainerservice/zz_generated_privatelinkresources_client.go @@ -0,0 +1,97 @@ +// +build go1.13 + +// 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. + +package armcontainerservice + +import ( + "context" + "errors" + "fmt" + "github.com/Azure/azure-sdk-for-go/sdk/armcore" + "github.com/Azure/azure-sdk-for-go/sdk/azcore" + "net/http" + "net/url" + "strings" +) + +// PrivateLinkResourcesClient contains the methods for the PrivateLinkResources group. +// Don't use this type directly, use NewPrivateLinkResourcesClient() instead. +type PrivateLinkResourcesClient struct { + con *armcore.Connection + subscriptionID string +} + +// NewPrivateLinkResourcesClient creates a new instance of PrivateLinkResourcesClient with the specified values. +func NewPrivateLinkResourcesClient(con *armcore.Connection, subscriptionID string) *PrivateLinkResourcesClient { + return &PrivateLinkResourcesClient{con: con, subscriptionID: subscriptionID} +} + +// List - To learn more about private clusters, see: https://docs.microsoft.com/azure/aks/private-clusters +// If the operation fails it returns the *CloudError error type. +func (client *PrivateLinkResourcesClient) List(ctx context.Context, resourceGroupName string, resourceName string, options *PrivateLinkResourcesListOptions) (PrivateLinkResourcesListResponse, error) { + req, err := client.listCreateRequest(ctx, resourceGroupName, resourceName, options) + if err != nil { + return PrivateLinkResourcesListResponse{}, err + } + resp, err := client.con.Pipeline().Do(req) + if err != nil { + return PrivateLinkResourcesListResponse{}, err + } + if !resp.HasStatusCode(http.StatusOK) { + return PrivateLinkResourcesListResponse{}, client.listHandleError(resp) + } + return client.listHandleResponse(resp) +} + +// listCreateRequest creates the List request. +func (client *PrivateLinkResourcesClient) listCreateRequest(ctx context.Context, resourceGroupName string, resourceName string, options *PrivateLinkResourcesListOptions) (*azcore.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/privateLinkResources" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if resourceName == "" { + return nil, errors.New("parameter resourceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceName}", url.PathEscape(resourceName)) + req, err := azcore.NewRequest(ctx, http.MethodGet, azcore.JoinPaths(client.con.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + req.Telemetry(telemetryInfo) + reqQP := req.URL.Query() + reqQP.Set("api-version", "2021-07-01") + req.URL.RawQuery = reqQP.Encode() + req.Header.Set("Accept", "application/json") + return req, nil +} + +// listHandleResponse handles the List response. +func (client *PrivateLinkResourcesClient) listHandleResponse(resp *azcore.Response) (PrivateLinkResourcesListResponse, error) { + result := PrivateLinkResourcesListResponse{RawResponse: resp.Response} + if err := resp.UnmarshalAsJSON(&result.PrivateLinkResourcesListResult); err != nil { + return PrivateLinkResourcesListResponse{}, err + } + return result, nil +} + +// listHandleError handles the List error response. +func (client *PrivateLinkResourcesClient) listHandleError(resp *azcore.Response) error { + body, err := resp.Payload() + if err != nil { + return azcore.NewResponseError(err, resp.Response) + } + errType := CloudError{raw: string(body)} + if err := resp.UnmarshalAsJSON(&errType); err != nil { + return azcore.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp.Response) + } + return azcore.NewResponseError(&errType, resp.Response) +} diff --git a/sdk/containerservice/armcontainerservice/zz_generated_resolveprivatelinkserviceid_client.go b/sdk/containerservice/armcontainerservice/zz_generated_resolveprivatelinkserviceid_client.go new file mode 100644 index 000000000000..c24875fc7d80 --- /dev/null +++ b/sdk/containerservice/armcontainerservice/zz_generated_resolveprivatelinkserviceid_client.go @@ -0,0 +1,97 @@ +// +build go1.13 + +// 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. + +package armcontainerservice + +import ( + "context" + "errors" + "fmt" + "github.com/Azure/azure-sdk-for-go/sdk/armcore" + "github.com/Azure/azure-sdk-for-go/sdk/azcore" + "net/http" + "net/url" + "strings" +) + +// ResolvePrivateLinkServiceIDClient contains the methods for the ResolvePrivateLinkServiceID group. +// Don't use this type directly, use NewResolvePrivateLinkServiceIDClient() instead. +type ResolvePrivateLinkServiceIDClient struct { + con *armcore.Connection + subscriptionID string +} + +// NewResolvePrivateLinkServiceIDClient creates a new instance of ResolvePrivateLinkServiceIDClient with the specified values. +func NewResolvePrivateLinkServiceIDClient(con *armcore.Connection, subscriptionID string) *ResolvePrivateLinkServiceIDClient { + return &ResolvePrivateLinkServiceIDClient{con: con, subscriptionID: subscriptionID} +} + +// POST - Gets the private link service ID for the specified managed cluster. +// If the operation fails it returns the *CloudError error type. +func (client *ResolvePrivateLinkServiceIDClient) POST(ctx context.Context, resourceGroupName string, resourceName string, parameters PrivateLinkResource, options *ResolvePrivateLinkServiceIDPOSTOptions) (ResolvePrivateLinkServiceIDPOSTResponse, error) { + req, err := client.postCreateRequest(ctx, resourceGroupName, resourceName, parameters, options) + if err != nil { + return ResolvePrivateLinkServiceIDPOSTResponse{}, err + } + resp, err := client.con.Pipeline().Do(req) + if err != nil { + return ResolvePrivateLinkServiceIDPOSTResponse{}, err + } + if !resp.HasStatusCode(http.StatusOK) { + return ResolvePrivateLinkServiceIDPOSTResponse{}, client.postHandleError(resp) + } + return client.postHandleResponse(resp) +} + +// postCreateRequest creates the POST request. +func (client *ResolvePrivateLinkServiceIDClient) postCreateRequest(ctx context.Context, resourceGroupName string, resourceName string, parameters PrivateLinkResource, options *ResolvePrivateLinkServiceIDPOSTOptions) (*azcore.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/resolvePrivateLinkServiceId" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if resourceName == "" { + return nil, errors.New("parameter resourceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceName}", url.PathEscape(resourceName)) + req, err := azcore.NewRequest(ctx, http.MethodPost, azcore.JoinPaths(client.con.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + req.Telemetry(telemetryInfo) + reqQP := req.URL.Query() + reqQP.Set("api-version", "2021-07-01") + req.URL.RawQuery = reqQP.Encode() + req.Header.Set("Accept", "application/json") + return req, req.MarshalAsJSON(parameters) +} + +// postHandleResponse handles the POST response. +func (client *ResolvePrivateLinkServiceIDClient) postHandleResponse(resp *azcore.Response) (ResolvePrivateLinkServiceIDPOSTResponse, error) { + result := ResolvePrivateLinkServiceIDPOSTResponse{RawResponse: resp.Response} + if err := resp.UnmarshalAsJSON(&result.PrivateLinkResource); err != nil { + return ResolvePrivateLinkServiceIDPOSTResponse{}, err + } + return result, nil +} + +// postHandleError handles the POST error response. +func (client *ResolvePrivateLinkServiceIDClient) postHandleError(resp *azcore.Response) error { + body, err := resp.Payload() + if err != nil { + return azcore.NewResponseError(err, resp.Response) + } + errType := CloudError{raw: string(body)} + if err := resp.UnmarshalAsJSON(&errType); err != nil { + return azcore.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp.Response) + } + return azcore.NewResponseError(&errType, resp.Response) +} diff --git a/sdk/containerservice/armcontainerservice/zz_generated_response_types.go b/sdk/containerservice/armcontainerservice/zz_generated_response_types.go new file mode 100644 index 000000000000..a0bf66446fc8 --- /dev/null +++ b/sdk/containerservice/armcontainerservice/zz_generated_response_types.go @@ -0,0 +1,572 @@ +// +build go1.13 + +// 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. + +package armcontainerservice + +import ( + "context" + "net/http" + "time" +) + +// AgentPoolsCreateOrUpdatePollerResponse contains the response from method AgentPools.CreateOrUpdate. +type AgentPoolsCreateOrUpdatePollerResponse struct { + // PollUntilDone will poll the service endpoint until a terminal state is reached or an error is received + PollUntilDone func(ctx context.Context, frequency time.Duration) (AgentPoolsCreateOrUpdateResponse, error) + + // Poller contains an initialized poller. + Poller AgentPoolsCreateOrUpdatePoller + + // RawResponse contains the underlying HTTP response. + RawResponse *http.Response +} + +// AgentPoolsCreateOrUpdateResponse contains the response from method AgentPools.CreateOrUpdate. +type AgentPoolsCreateOrUpdateResponse struct { + AgentPoolsCreateOrUpdateResult + // RawResponse contains the underlying HTTP response. + RawResponse *http.Response +} + +// AgentPoolsCreateOrUpdateResult contains the result from method AgentPools.CreateOrUpdate. +type AgentPoolsCreateOrUpdateResult struct { + AgentPool +} + +// AgentPoolsDeletePollerResponse contains the response from method AgentPools.Delete. +type AgentPoolsDeletePollerResponse struct { + // PollUntilDone will poll the service endpoint until a terminal state is reached or an error is received + PollUntilDone func(ctx context.Context, frequency time.Duration) (AgentPoolsDeleteResponse, error) + + // Poller contains an initialized poller. + Poller AgentPoolsDeletePoller + + // RawResponse contains the underlying HTTP response. + RawResponse *http.Response +} + +// AgentPoolsDeleteResponse contains the response from method AgentPools.Delete. +type AgentPoolsDeleteResponse struct { + // RawResponse contains the underlying HTTP response. + RawResponse *http.Response +} + +// AgentPoolsGetAvailableAgentPoolVersionsResponse contains the response from method AgentPools.GetAvailableAgentPoolVersions. +type AgentPoolsGetAvailableAgentPoolVersionsResponse struct { + AgentPoolsGetAvailableAgentPoolVersionsResult + // RawResponse contains the underlying HTTP response. + RawResponse *http.Response +} + +// AgentPoolsGetAvailableAgentPoolVersionsResult contains the result from method AgentPools.GetAvailableAgentPoolVersions. +type AgentPoolsGetAvailableAgentPoolVersionsResult struct { + AgentPoolAvailableVersions +} + +// AgentPoolsGetResponse contains the response from method AgentPools.Get. +type AgentPoolsGetResponse struct { + AgentPoolsGetResult + // RawResponse contains the underlying HTTP response. + RawResponse *http.Response +} + +// AgentPoolsGetResult contains the result from method AgentPools.Get. +type AgentPoolsGetResult struct { + AgentPool +} + +// AgentPoolsGetUpgradeProfileResponse contains the response from method AgentPools.GetUpgradeProfile. +type AgentPoolsGetUpgradeProfileResponse struct { + AgentPoolsGetUpgradeProfileResult + // RawResponse contains the underlying HTTP response. + RawResponse *http.Response +} + +// AgentPoolsGetUpgradeProfileResult contains the result from method AgentPools.GetUpgradeProfile. +type AgentPoolsGetUpgradeProfileResult struct { + AgentPoolUpgradeProfile +} + +// AgentPoolsListResponse contains the response from method AgentPools.List. +type AgentPoolsListResponse struct { + AgentPoolsListResult + // RawResponse contains the underlying HTTP response. + RawResponse *http.Response +} + +// AgentPoolsListResult contains the result from method AgentPools.List. +type AgentPoolsListResult struct { + AgentPoolListResult +} + +// AgentPoolsUpgradeNodeImageVersionPollerResponse contains the response from method AgentPools.UpgradeNodeImageVersion. +type AgentPoolsUpgradeNodeImageVersionPollerResponse struct { + // PollUntilDone will poll the service endpoint until a terminal state is reached or an error is received + PollUntilDone func(ctx context.Context, frequency time.Duration) (AgentPoolsUpgradeNodeImageVersionResponse, error) + + // Poller contains an initialized poller. + Poller AgentPoolsUpgradeNodeImageVersionPoller + + // RawResponse contains the underlying HTTP response. + RawResponse *http.Response +} + +// AgentPoolsUpgradeNodeImageVersionResponse contains the response from method AgentPools.UpgradeNodeImageVersion. +type AgentPoolsUpgradeNodeImageVersionResponse struct { + AgentPoolsUpgradeNodeImageVersionResult + // RawResponse contains the underlying HTTP response. + RawResponse *http.Response +} + +// AgentPoolsUpgradeNodeImageVersionResult contains the result from method AgentPools.UpgradeNodeImageVersion. +type AgentPoolsUpgradeNodeImageVersionResult struct { + AgentPool +} + +// MaintenanceConfigurationsCreateOrUpdateResponse contains the response from method MaintenanceConfigurations.CreateOrUpdate. +type MaintenanceConfigurationsCreateOrUpdateResponse struct { + MaintenanceConfigurationsCreateOrUpdateResult + // RawResponse contains the underlying HTTP response. + RawResponse *http.Response +} + +// MaintenanceConfigurationsCreateOrUpdateResult contains the result from method MaintenanceConfigurations.CreateOrUpdate. +type MaintenanceConfigurationsCreateOrUpdateResult struct { + MaintenanceConfiguration +} + +// MaintenanceConfigurationsDeleteResponse contains the response from method MaintenanceConfigurations.Delete. +type MaintenanceConfigurationsDeleteResponse struct { + // RawResponse contains the underlying HTTP response. + RawResponse *http.Response +} + +// MaintenanceConfigurationsGetResponse contains the response from method MaintenanceConfigurations.Get. +type MaintenanceConfigurationsGetResponse struct { + MaintenanceConfigurationsGetResult + // RawResponse contains the underlying HTTP response. + RawResponse *http.Response +} + +// MaintenanceConfigurationsGetResult contains the result from method MaintenanceConfigurations.Get. +type MaintenanceConfigurationsGetResult struct { + MaintenanceConfiguration +} + +// MaintenanceConfigurationsListByManagedClusterResponse contains the response from method MaintenanceConfigurations.ListByManagedCluster. +type MaintenanceConfigurationsListByManagedClusterResponse struct { + MaintenanceConfigurationsListByManagedClusterResult + // RawResponse contains the underlying HTTP response. + RawResponse *http.Response +} + +// MaintenanceConfigurationsListByManagedClusterResult contains the result from method MaintenanceConfigurations.ListByManagedCluster. +type MaintenanceConfigurationsListByManagedClusterResult struct { + MaintenanceConfigurationListResult +} + +// ManagedClustersCreateOrUpdatePollerResponse contains the response from method ManagedClusters.CreateOrUpdate. +type ManagedClustersCreateOrUpdatePollerResponse struct { + // PollUntilDone will poll the service endpoint until a terminal state is reached or an error is received + PollUntilDone func(ctx context.Context, frequency time.Duration) (ManagedClustersCreateOrUpdateResponse, error) + + // Poller contains an initialized poller. + Poller ManagedClustersCreateOrUpdatePoller + + // RawResponse contains the underlying HTTP response. + RawResponse *http.Response +} + +// ManagedClustersCreateOrUpdateResponse contains the response from method ManagedClusters.CreateOrUpdate. +type ManagedClustersCreateOrUpdateResponse struct { + ManagedClustersCreateOrUpdateResult + // RawResponse contains the underlying HTTP response. + RawResponse *http.Response +} + +// ManagedClustersCreateOrUpdateResult contains the result from method ManagedClusters.CreateOrUpdate. +type ManagedClustersCreateOrUpdateResult struct { + ManagedCluster +} + +// ManagedClustersDeletePollerResponse contains the response from method ManagedClusters.Delete. +type ManagedClustersDeletePollerResponse struct { + // PollUntilDone will poll the service endpoint until a terminal state is reached or an error is received + PollUntilDone func(ctx context.Context, frequency time.Duration) (ManagedClustersDeleteResponse, error) + + // Poller contains an initialized poller. + Poller ManagedClustersDeletePoller + + // RawResponse contains the underlying HTTP response. + RawResponse *http.Response +} + +// ManagedClustersDeleteResponse contains the response from method ManagedClusters.Delete. +type ManagedClustersDeleteResponse struct { + // RawResponse contains the underlying HTTP response. + RawResponse *http.Response +} + +// ManagedClustersGetAccessProfileResponse contains the response from method ManagedClusters.GetAccessProfile. +type ManagedClustersGetAccessProfileResponse struct { + ManagedClustersGetAccessProfileResult + // RawResponse contains the underlying HTTP response. + RawResponse *http.Response +} + +// ManagedClustersGetAccessProfileResult contains the result from method ManagedClusters.GetAccessProfile. +type ManagedClustersGetAccessProfileResult struct { + ManagedClusterAccessProfile +} + +// ManagedClustersGetCommandResultResponse contains the response from method ManagedClusters.GetCommandResult. +type ManagedClustersGetCommandResultResponse struct { + ManagedClustersGetCommandResultResult + // RawResponse contains the underlying HTTP response. + RawResponse *http.Response +} + +// ManagedClustersGetCommandResultResult contains the result from method ManagedClusters.GetCommandResult. +type ManagedClustersGetCommandResultResult struct { + RunCommandResult +} + +// ManagedClustersGetOSOptionsResponse contains the response from method ManagedClusters.GetOSOptions. +type ManagedClustersGetOSOptionsResponse struct { + ManagedClustersGetOSOptionsResult + // RawResponse contains the underlying HTTP response. + RawResponse *http.Response +} + +// ManagedClustersGetOSOptionsResult contains the result from method ManagedClusters.GetOSOptions. +type ManagedClustersGetOSOptionsResult struct { + OSOptionProfile +} + +// ManagedClustersGetResponse contains the response from method ManagedClusters.Get. +type ManagedClustersGetResponse struct { + ManagedClustersGetResult + // RawResponse contains the underlying HTTP response. + RawResponse *http.Response +} + +// ManagedClustersGetResult contains the result from method ManagedClusters.Get. +type ManagedClustersGetResult struct { + ManagedCluster +} + +// ManagedClustersGetUpgradeProfileResponse contains the response from method ManagedClusters.GetUpgradeProfile. +type ManagedClustersGetUpgradeProfileResponse struct { + ManagedClustersGetUpgradeProfileResult + // RawResponse contains the underlying HTTP response. + RawResponse *http.Response +} + +// ManagedClustersGetUpgradeProfileResult contains the result from method ManagedClusters.GetUpgradeProfile. +type ManagedClustersGetUpgradeProfileResult struct { + ManagedClusterUpgradeProfile +} + +// ManagedClustersListByResourceGroupResponse contains the response from method ManagedClusters.ListByResourceGroup. +type ManagedClustersListByResourceGroupResponse struct { + ManagedClustersListByResourceGroupResult + // RawResponse contains the underlying HTTP response. + RawResponse *http.Response +} + +// ManagedClustersListByResourceGroupResult contains the result from method ManagedClusters.ListByResourceGroup. +type ManagedClustersListByResourceGroupResult struct { + ManagedClusterListResult +} + +// ManagedClustersListClusterAdminCredentialsResponse contains the response from method ManagedClusters.ListClusterAdminCredentials. +type ManagedClustersListClusterAdminCredentialsResponse struct { + ManagedClustersListClusterAdminCredentialsResult + // RawResponse contains the underlying HTTP response. + RawResponse *http.Response +} + +// ManagedClustersListClusterAdminCredentialsResult contains the result from method ManagedClusters.ListClusterAdminCredentials. +type ManagedClustersListClusterAdminCredentialsResult struct { + CredentialResults +} + +// ManagedClustersListClusterMonitoringUserCredentialsResponse contains the response from method ManagedClusters.ListClusterMonitoringUserCredentials. +type ManagedClustersListClusterMonitoringUserCredentialsResponse struct { + ManagedClustersListClusterMonitoringUserCredentialsResult + // RawResponse contains the underlying HTTP response. + RawResponse *http.Response +} + +// ManagedClustersListClusterMonitoringUserCredentialsResult contains the result from method ManagedClusters.ListClusterMonitoringUserCredentials. +type ManagedClustersListClusterMonitoringUserCredentialsResult struct { + CredentialResults +} + +// ManagedClustersListClusterUserCredentialsResponse contains the response from method ManagedClusters.ListClusterUserCredentials. +type ManagedClustersListClusterUserCredentialsResponse struct { + ManagedClustersListClusterUserCredentialsResult + // RawResponse contains the underlying HTTP response. + RawResponse *http.Response +} + +// ManagedClustersListClusterUserCredentialsResult contains the result from method ManagedClusters.ListClusterUserCredentials. +type ManagedClustersListClusterUserCredentialsResult struct { + CredentialResults +} + +// ManagedClustersListOutboundNetworkDependenciesEndpointsResponse contains the response from method ManagedClusters.ListOutboundNetworkDependenciesEndpoints. +type ManagedClustersListOutboundNetworkDependenciesEndpointsResponse struct { + ManagedClustersListOutboundNetworkDependenciesEndpointsResult + // RawResponse contains the underlying HTTP response. + RawResponse *http.Response +} + +// ManagedClustersListOutboundNetworkDependenciesEndpointsResult contains the result from method ManagedClusters.ListOutboundNetworkDependenciesEndpoints. +type ManagedClustersListOutboundNetworkDependenciesEndpointsResult struct { + OutboundEnvironmentEndpointCollection +} + +// ManagedClustersListResponse contains the response from method ManagedClusters.List. +type ManagedClustersListResponse struct { + ManagedClustersListResult + // RawResponse contains the underlying HTTP response. + RawResponse *http.Response +} + +// ManagedClustersListResult contains the result from method ManagedClusters.List. +type ManagedClustersListResult struct { + ManagedClusterListResult +} + +// ManagedClustersResetAADProfilePollerResponse contains the response from method ManagedClusters.ResetAADProfile. +type ManagedClustersResetAADProfilePollerResponse struct { + // PollUntilDone will poll the service endpoint until a terminal state is reached or an error is received + PollUntilDone func(ctx context.Context, frequency time.Duration) (ManagedClustersResetAADProfileResponse, error) + + // Poller contains an initialized poller. + Poller ManagedClustersResetAADProfilePoller + + // RawResponse contains the underlying HTTP response. + RawResponse *http.Response +} + +// ManagedClustersResetAADProfileResponse contains the response from method ManagedClusters.ResetAADProfile. +type ManagedClustersResetAADProfileResponse struct { + // RawResponse contains the underlying HTTP response. + RawResponse *http.Response +} + +// ManagedClustersResetServicePrincipalProfilePollerResponse contains the response from method ManagedClusters.ResetServicePrincipalProfile. +type ManagedClustersResetServicePrincipalProfilePollerResponse struct { + // PollUntilDone will poll the service endpoint until a terminal state is reached or an error is received + PollUntilDone func(ctx context.Context, frequency time.Duration) (ManagedClustersResetServicePrincipalProfileResponse, error) + + // Poller contains an initialized poller. + Poller ManagedClustersResetServicePrincipalProfilePoller + + // RawResponse contains the underlying HTTP response. + RawResponse *http.Response +} + +// ManagedClustersResetServicePrincipalProfileResponse contains the response from method ManagedClusters.ResetServicePrincipalProfile. +type ManagedClustersResetServicePrincipalProfileResponse struct { + // RawResponse contains the underlying HTTP response. + RawResponse *http.Response +} + +// ManagedClustersRotateClusterCertificatesPollerResponse contains the response from method ManagedClusters.RotateClusterCertificates. +type ManagedClustersRotateClusterCertificatesPollerResponse struct { + // PollUntilDone will poll the service endpoint until a terminal state is reached or an error is received + PollUntilDone func(ctx context.Context, frequency time.Duration) (ManagedClustersRotateClusterCertificatesResponse, error) + + // Poller contains an initialized poller. + Poller ManagedClustersRotateClusterCertificatesPoller + + // RawResponse contains the underlying HTTP response. + RawResponse *http.Response +} + +// ManagedClustersRotateClusterCertificatesResponse contains the response from method ManagedClusters.RotateClusterCertificates. +type ManagedClustersRotateClusterCertificatesResponse struct { + // RawResponse contains the underlying HTTP response. + RawResponse *http.Response +} + +// ManagedClustersRunCommandPollerResponse contains the response from method ManagedClusters.RunCommand. +type ManagedClustersRunCommandPollerResponse struct { + // PollUntilDone will poll the service endpoint until a terminal state is reached or an error is received + PollUntilDone func(ctx context.Context, frequency time.Duration) (ManagedClustersRunCommandResponse, error) + + // Poller contains an initialized poller. + Poller ManagedClustersRunCommandPoller + + // RawResponse contains the underlying HTTP response. + RawResponse *http.Response +} + +// ManagedClustersRunCommandResponse contains the response from method ManagedClusters.RunCommand. +type ManagedClustersRunCommandResponse struct { + ManagedClustersRunCommandResult + // RawResponse contains the underlying HTTP response. + RawResponse *http.Response +} + +// ManagedClustersRunCommandResult contains the result from method ManagedClusters.RunCommand. +type ManagedClustersRunCommandResult struct { + RunCommandResult +} + +// ManagedClustersStartPollerResponse contains the response from method ManagedClusters.Start. +type ManagedClustersStartPollerResponse struct { + // PollUntilDone will poll the service endpoint until a terminal state is reached or an error is received + PollUntilDone func(ctx context.Context, frequency time.Duration) (ManagedClustersStartResponse, error) + + // Poller contains an initialized poller. + Poller ManagedClustersStartPoller + + // RawResponse contains the underlying HTTP response. + RawResponse *http.Response +} + +// ManagedClustersStartResponse contains the response from method ManagedClusters.Start. +type ManagedClustersStartResponse struct { + // RawResponse contains the underlying HTTP response. + RawResponse *http.Response +} + +// ManagedClustersStopPollerResponse contains the response from method ManagedClusters.Stop. +type ManagedClustersStopPollerResponse struct { + // PollUntilDone will poll the service endpoint until a terminal state is reached or an error is received + PollUntilDone func(ctx context.Context, frequency time.Duration) (ManagedClustersStopResponse, error) + + // Poller contains an initialized poller. + Poller ManagedClustersStopPoller + + // RawResponse contains the underlying HTTP response. + RawResponse *http.Response +} + +// ManagedClustersStopResponse contains the response from method ManagedClusters.Stop. +type ManagedClustersStopResponse struct { + // RawResponse contains the underlying HTTP response. + RawResponse *http.Response +} + +// ManagedClustersUpdateTagsPollerResponse contains the response from method ManagedClusters.UpdateTags. +type ManagedClustersUpdateTagsPollerResponse struct { + // PollUntilDone will poll the service endpoint until a terminal state is reached or an error is received + PollUntilDone func(ctx context.Context, frequency time.Duration) (ManagedClustersUpdateTagsResponse, error) + + // Poller contains an initialized poller. + Poller ManagedClustersUpdateTagsPoller + + // RawResponse contains the underlying HTTP response. + RawResponse *http.Response +} + +// ManagedClustersUpdateTagsResponse contains the response from method ManagedClusters.UpdateTags. +type ManagedClustersUpdateTagsResponse struct { + ManagedClustersUpdateTagsResult + // RawResponse contains the underlying HTTP response. + RawResponse *http.Response +} + +// ManagedClustersUpdateTagsResult contains the result from method ManagedClusters.UpdateTags. +type ManagedClustersUpdateTagsResult struct { + ManagedCluster +} + +// OperationsListResponse contains the response from method Operations.List. +type OperationsListResponse struct { + OperationsListResult + // RawResponse contains the underlying HTTP response. + RawResponse *http.Response +} + +// OperationsListResult contains the result from method Operations.List. +type OperationsListResult struct { + OperationListResult +} + +// PrivateEndpointConnectionsDeletePollerResponse contains the response from method PrivateEndpointConnections.Delete. +type PrivateEndpointConnectionsDeletePollerResponse struct { + // PollUntilDone will poll the service endpoint until a terminal state is reached or an error is received + PollUntilDone func(ctx context.Context, frequency time.Duration) (PrivateEndpointConnectionsDeleteResponse, error) + + // Poller contains an initialized poller. + Poller PrivateEndpointConnectionsDeletePoller + + // RawResponse contains the underlying HTTP response. + RawResponse *http.Response +} + +// PrivateEndpointConnectionsDeleteResponse contains the response from method PrivateEndpointConnections.Delete. +type PrivateEndpointConnectionsDeleteResponse struct { + // RawResponse contains the underlying HTTP response. + RawResponse *http.Response +} + +// PrivateEndpointConnectionsGetResponse contains the response from method PrivateEndpointConnections.Get. +type PrivateEndpointConnectionsGetResponse struct { + PrivateEndpointConnectionsGetResult + // RawResponse contains the underlying HTTP response. + RawResponse *http.Response +} + +// PrivateEndpointConnectionsGetResult contains the result from method PrivateEndpointConnections.Get. +type PrivateEndpointConnectionsGetResult struct { + PrivateEndpointConnection +} + +// PrivateEndpointConnectionsListResponse contains the response from method PrivateEndpointConnections.List. +type PrivateEndpointConnectionsListResponse struct { + PrivateEndpointConnectionsListResult + // RawResponse contains the underlying HTTP response. + RawResponse *http.Response +} + +// PrivateEndpointConnectionsListResult contains the result from method PrivateEndpointConnections.List. +type PrivateEndpointConnectionsListResult struct { + PrivateEndpointConnectionListResult +} + +// PrivateEndpointConnectionsUpdateResponse contains the response from method PrivateEndpointConnections.Update. +type PrivateEndpointConnectionsUpdateResponse struct { + PrivateEndpointConnectionsUpdateResult + // RawResponse contains the underlying HTTP response. + RawResponse *http.Response +} + +// PrivateEndpointConnectionsUpdateResult contains the result from method PrivateEndpointConnections.Update. +type PrivateEndpointConnectionsUpdateResult struct { + PrivateEndpointConnection +} + +// PrivateLinkResourcesListResponse contains the response from method PrivateLinkResources.List. +type PrivateLinkResourcesListResponse struct { + PrivateLinkResourcesListResultEnvelope + // RawResponse contains the underlying HTTP response. + RawResponse *http.Response +} + +// PrivateLinkResourcesListResultEnvelope contains the result from method PrivateLinkResources.List. +type PrivateLinkResourcesListResultEnvelope struct { + PrivateLinkResourcesListResult +} + +// ResolvePrivateLinkServiceIDPOSTResponse contains the response from method ResolvePrivateLinkServiceID.POST. +type ResolvePrivateLinkServiceIDPOSTResponse struct { + ResolvePrivateLinkServiceIDPOSTResult + // RawResponse contains the underlying HTTP response. + RawResponse *http.Response +} + +// ResolvePrivateLinkServiceIDPOSTResult contains the result from method ResolvePrivateLinkServiceID.POST. +type ResolvePrivateLinkServiceIDPOSTResult struct { + PrivateLinkResource +} diff --git a/sdk/containerservice/armcontainerservice/zz_generated_time_rfc3339.go b/sdk/containerservice/armcontainerservice/zz_generated_time_rfc3339.go new file mode 100644 index 000000000000..2cf69e209b0e --- /dev/null +++ b/sdk/containerservice/armcontainerservice/zz_generated_time_rfc3339.go @@ -0,0 +1,57 @@ +// +build go1.13 + +// 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. + +package armcontainerservice + +import ( + "regexp" + "strings" + "time" +) + +const ( + utcLayoutJSON = `"2006-01-02T15:04:05.999999999"` + utcLayout = "2006-01-02T15:04:05.999999999" + rfc3339JSON = `"` + time.RFC3339Nano + `"` +) + +// Azure reports time in UTC but it doesn't include the 'Z' time zone suffix in some cases. +var tzOffsetRegex = regexp.MustCompile(`(Z|z|\+|-)(\d+:\d+)*"*$`) + +type timeRFC3339 time.Time + +func (t timeRFC3339) MarshalJSON() (json []byte, err error) { + tt := time.Time(t) + return tt.MarshalJSON() +} + +func (t timeRFC3339) MarshalText() (text []byte, err error) { + tt := time.Time(t) + return tt.MarshalText() +} + +func (t *timeRFC3339) UnmarshalJSON(data []byte) error { + layout := utcLayoutJSON + if tzOffsetRegex.Match(data) { + layout = rfc3339JSON + } + return t.Parse(layout, string(data)) +} + +func (t *timeRFC3339) UnmarshalText(data []byte) (err error) { + layout := utcLayout + if tzOffsetRegex.Match(data) { + layout = time.RFC3339Nano + } + return t.Parse(layout, string(data)) +} + +func (t *timeRFC3339) Parse(layout, value string) error { + p, err := time.Parse(layout, strings.ToUpper(value)) + *t = timeRFC3339(p) + return err +}