From 61c859dc9bd71cc4cbd334747d0f4b117bf61437 Mon Sep 17 00:00:00 2001 From: Azure SDK Bot <53356347+azure-sdk@users.noreply.github.com> Date: Tue, 20 Aug 2024 19:17:17 -0700 Subject: [PATCH] [Release] sdk/resourcemanager/containerservice/armcontainerservice/6.1.0-beta.1 (#23276) * [Release] sdk/resourcemanager/containerservice/armcontainerservice/6.1.0-beta.1 generation from spec commit: c7b98b36e4023331545051284d8500adf98f02fe * update assets.json --------- Co-authored-by: ReleaseHelper Co-authored-by: Alancere <804873052@qq.com> --- .../armcontainerservice/CHANGELOG.md | 132 + .../armcontainerservice/agentpools_client.go | 142 +- .../agentpools_client_example_test.go | 498 +++- .../armcontainerservice/assets.json | 2 +- .../armcontainerservice/autorest.md | 8 +- .../armcontainerservice/client_factory.go | 32 + .../armcontainerservice/constants.go | 376 ++- .../fake/agentpools_server.go | 91 +- .../armcontainerservice/fake/internal.go | 19 + .../fake/loadbalancers_server.go | 259 ++ .../fake/machines_server.go | 164 ++ .../fake/managedclusters_server.go | 264 +- .../fake/managedclustersnapshots_server.go | 314 +++ .../fake/operationstatusresult_server.go | 203 ++ .../fake/server_factory.go | 26 + .../loadbalancers_client.go | 333 +++ .../loadbalancers_client_example_test.go | 144 ++ .../armcontainerservice/machines_client.go | 187 ++ .../machines_client_example_test.go | 104 + .../maintenanceconfigurations_client.go | 16 +- ...nanceconfigurations_client_example_test.go | 41 +- .../managedclusters_client.go | 478 +++- .../managedclusters_client_example_test.go | 2001 ++++++++++---- .../managedclustersnapshots_client.go | 417 +++ ...gedclustersnapshots_client_example_test.go | 343 +++ .../armcontainerservice/models.go | 983 ++++++- .../armcontainerservice/models_serde.go | 2292 ++++++++++++++++- .../armcontainerservice/operations_client.go | 4 +- .../operations_client_example_test.go | 2 +- .../operationstatusresult_client.go | 254 ++ ...erationstatusresult_client_example_test.go | 118 + .../armcontainerservice/options.go | 149 ++ .../privateendpointconnections_client.go | 18 +- ...endpointconnections_client_example_test.go | 14 +- .../privatelinkresources_client.go | 4 +- ...rivatelinkresources_client_example_test.go | 2 +- .../resolveprivatelinkserviceid_client.go | 4 +- ...rivatelinkserviceid_client_example_test.go | 2 +- .../armcontainerservice/responses.go | 127 + .../armcontainerservice/snapshots_client.go | 24 +- .../snapshots_client_example_test.go | 12 +- .../trustedaccessrolebindings_client.go | 20 +- ...daccessrolebindings_client_example_test.go | 8 +- .../trustedaccessroles_client.go | 4 +- .../trustedaccessroles_client_example_test.go | 2 +- 45 files changed, 9732 insertions(+), 905 deletions(-) create mode 100644 sdk/resourcemanager/containerservice/armcontainerservice/fake/loadbalancers_server.go create mode 100644 sdk/resourcemanager/containerservice/armcontainerservice/fake/machines_server.go create mode 100644 sdk/resourcemanager/containerservice/armcontainerservice/fake/managedclustersnapshots_server.go create mode 100644 sdk/resourcemanager/containerservice/armcontainerservice/fake/operationstatusresult_server.go create mode 100644 sdk/resourcemanager/containerservice/armcontainerservice/loadbalancers_client.go create mode 100644 sdk/resourcemanager/containerservice/armcontainerservice/loadbalancers_client_example_test.go create mode 100644 sdk/resourcemanager/containerservice/armcontainerservice/machines_client.go create mode 100644 sdk/resourcemanager/containerservice/armcontainerservice/machines_client_example_test.go create mode 100644 sdk/resourcemanager/containerservice/armcontainerservice/managedclustersnapshots_client.go create mode 100644 sdk/resourcemanager/containerservice/armcontainerservice/managedclustersnapshots_client_example_test.go create mode 100644 sdk/resourcemanager/containerservice/armcontainerservice/operationstatusresult_client.go create mode 100644 sdk/resourcemanager/containerservice/armcontainerservice/operationstatusresult_client_example_test.go diff --git a/sdk/resourcemanager/containerservice/armcontainerservice/CHANGELOG.md b/sdk/resourcemanager/containerservice/armcontainerservice/CHANGELOG.md index 39299b26a45a..81f0fa4c7c4c 100644 --- a/sdk/resourcemanager/containerservice/armcontainerservice/CHANGELOG.md +++ b/sdk/resourcemanager/containerservice/armcontainerservice/CHANGELOG.md @@ -1,5 +1,137 @@ # Release History +## 6.1.0-beta.1 (2024-08-22) +### Features Added + +- New value `AgentPoolModeGateway` added to enum type `AgentPoolMode` +- New value `AgentPoolTypeVirtualMachines` added to enum type `AgentPoolType` +- New value `ManagedClusterSKUNameAutomatic` added to enum type `ManagedClusterSKUName` +- New value `OSSKUMariner`, `OSSKUWindowsAnnual` added to enum type `OSSKU` +- New value `OutboundTypeNone` added to enum type `OutboundType` +- New value `PublicNetworkAccessSecuredByPerimeter` added to enum type `PublicNetworkAccess` +- New value `SnapshotTypeManagedCluster` added to enum type `SnapshotType` +- New value `WorkloadRuntimeKataMshvVMIsolation` added to enum type `WorkloadRuntime` +- New enum type `AddonAutoscaling` with values `AddonAutoscalingDisabled`, `AddonAutoscalingEnabled` +- New enum type `AgentPoolSSHAccess` with values `AgentPoolSSHAccessDisabled`, `AgentPoolSSHAccessLocalUser` +- New enum type `ArtifactSource` with values `ArtifactSourceCache`, `ArtifactSourceDirect` +- New enum type `ClusterServiceLoadBalancerHealthProbeMode` with values `ClusterServiceLoadBalancerHealthProbeModeServiceNodePort`, `ClusterServiceLoadBalancerHealthProbeModeShared` +- New enum type `GuardrailsSupport` with values `GuardrailsSupportPreview`, `GuardrailsSupportStable` +- New enum type `IpvsScheduler` with values `IpvsSchedulerLeastConnection`, `IpvsSchedulerRoundRobin` +- New enum type `Level` with values `LevelEnforcement`, `LevelOff`, `LevelWarning` +- New enum type `Mode` with values `ModeIPTABLES`, `ModeIPVS` +- New enum type `NodeProvisioningMode` with values `NodeProvisioningModeAuto`, `NodeProvisioningModeManual` +- New enum type `Operator` with values `OperatorDoesNotExist`, `OperatorExists`, `OperatorIn`, `OperatorNotIn` +- New enum type `PodIPAllocationMode` with values `PodIPAllocationModeDynamicIndividual`, `PodIPAllocationModeStaticBlock` +- New enum type `PodLinkLocalAccess` with values `PodLinkLocalAccessIMDS`, `PodLinkLocalAccessNone` +- New enum type `RestrictionLevel` with values `RestrictionLevelReadOnly`, `RestrictionLevelUnrestricted` +- New enum type `SafeguardsSupport` with values `SafeguardsSupportPreview`, `SafeguardsSupportStable` +- New enum type `UndrainableNodeBehavior` with values `UndrainableNodeBehaviorCordon`, `UndrainableNodeBehaviorSchedule` +- New function `*AgentPoolsClient.BeginDeleteMachines(context.Context, string, string, string, AgentPoolDeleteMachinesParameter, *AgentPoolsClientBeginDeleteMachinesOptions) (*runtime.Poller[AgentPoolsClientDeleteMachinesResponse], error)` +- New function `*ClientFactory.NewLoadBalancersClient() *LoadBalancersClient` +- New function `*ClientFactory.NewMachinesClient() *MachinesClient` +- New function `*ClientFactory.NewManagedClusterSnapshotsClient() *ManagedClusterSnapshotsClient` +- New function `*ClientFactory.NewOperationStatusResultClient() *OperationStatusResultClient` +- New function `NewLoadBalancersClient(string, azcore.TokenCredential, *arm.ClientOptions) (*LoadBalancersClient, error)` +- New function `*LoadBalancersClient.CreateOrUpdate(context.Context, string, string, string, LoadBalancer, *LoadBalancersClientCreateOrUpdateOptions) (LoadBalancersClientCreateOrUpdateResponse, error)` +- New function `*LoadBalancersClient.BeginDelete(context.Context, string, string, string, *LoadBalancersClientBeginDeleteOptions) (*runtime.Poller[LoadBalancersClientDeleteResponse], error)` +- New function `*LoadBalancersClient.Get(context.Context, string, string, string, *LoadBalancersClientGetOptions) (LoadBalancersClientGetResponse, error)` +- New function `*LoadBalancersClient.NewListByManagedClusterPager(string, string, *LoadBalancersClientListByManagedClusterOptions) *runtime.Pager[LoadBalancersClientListByManagedClusterResponse]` +- New function `NewMachinesClient(string, azcore.TokenCredential, *arm.ClientOptions) (*MachinesClient, error)` +- New function `*MachinesClient.Get(context.Context, string, string, string, string, *MachinesClientGetOptions) (MachinesClientGetResponse, error)` +- New function `*MachinesClient.NewListPager(string, string, string, *MachinesClientListOptions) *runtime.Pager[MachinesClientListResponse]` +- New function `NewManagedClusterSnapshotsClient(string, azcore.TokenCredential, *arm.ClientOptions) (*ManagedClusterSnapshotsClient, error)` +- New function `*ManagedClusterSnapshotsClient.CreateOrUpdate(context.Context, string, string, ManagedClusterSnapshot, *ManagedClusterSnapshotsClientCreateOrUpdateOptions) (ManagedClusterSnapshotsClientCreateOrUpdateResponse, error)` +- New function `*ManagedClusterSnapshotsClient.Delete(context.Context, string, string, *ManagedClusterSnapshotsClientDeleteOptions) (ManagedClusterSnapshotsClientDeleteResponse, error)` +- New function `*ManagedClusterSnapshotsClient.Get(context.Context, string, string, *ManagedClusterSnapshotsClientGetOptions) (ManagedClusterSnapshotsClientGetResponse, error)` +- New function `*ManagedClusterSnapshotsClient.NewListByResourceGroupPager(string, *ManagedClusterSnapshotsClientListByResourceGroupOptions) *runtime.Pager[ManagedClusterSnapshotsClientListByResourceGroupResponse]` +- New function `*ManagedClusterSnapshotsClient.NewListPager(*ManagedClusterSnapshotsClientListOptions) *runtime.Pager[ManagedClusterSnapshotsClientListResponse]` +- New function `*ManagedClusterSnapshotsClient.UpdateTags(context.Context, string, string, TagsObject, *ManagedClusterSnapshotsClientUpdateTagsOptions) (ManagedClusterSnapshotsClientUpdateTagsResponse, error)` +- New function `*ManagedClustersClient.GetGuardrailsVersions(context.Context, string, string, *ManagedClustersClientGetGuardrailsVersionsOptions) (ManagedClustersClientGetGuardrailsVersionsResponse, error)` +- New function `*ManagedClustersClient.GetSafeguardsVersions(context.Context, string, string, *ManagedClustersClientGetSafeguardsVersionsOptions) (ManagedClustersClientGetSafeguardsVersionsResponse, error)` +- New function `*ManagedClustersClient.NewListGuardrailsVersionsPager(string, *ManagedClustersClientListGuardrailsVersionsOptions) *runtime.Pager[ManagedClustersClientListGuardrailsVersionsResponse]` +- New function `*ManagedClustersClient.NewListSafeguardsVersionsPager(string, *ManagedClustersClientListSafeguardsVersionsOptions) *runtime.Pager[ManagedClustersClientListSafeguardsVersionsResponse]` +- New function `*ManagedClustersClient.BeginRebalanceLoadBalancers(context.Context, string, string, RebalanceLoadBalancersRequestBody, *ManagedClustersClientBeginRebalanceLoadBalancersOptions) (*runtime.Poller[ManagedClustersClientRebalanceLoadBalancersResponse], error)` +- New function `NewOperationStatusResultClient(string, azcore.TokenCredential, *arm.ClientOptions) (*OperationStatusResultClient, error)` +- New function `*OperationStatusResultClient.Get(context.Context, string, string, string, *OperationStatusResultClientGetOptions) (OperationStatusResultClientGetResponse, error)` +- New function `*OperationStatusResultClient.GetByAgentPool(context.Context, string, string, string, string, *OperationStatusResultClientGetByAgentPoolOptions) (OperationStatusResultClientGetByAgentPoolResponse, error)` +- New function `*OperationStatusResultClient.NewListPager(string, string, *OperationStatusResultClientListOptions) *runtime.Pager[OperationStatusResultClientListResponse]` +- New struct `AdvancedNetworking` +- New struct `AdvancedNetworkingObservability` +- New struct `AgentPoolArtifactStreamingProfile` +- New struct `AgentPoolDeleteMachinesParameter` +- New struct `AgentPoolGPUProfile` +- New struct `AgentPoolGatewayProfile` +- New struct `AgentPoolSecurityProfile` +- New struct `AutoScaleProfile` +- New struct `Component` +- New struct `ComponentsByRelease` +- New struct `ErrorAdditionalInfo` +- New struct `ErrorDetail` +- New struct `GuardrailsAvailableVersion` +- New struct `GuardrailsAvailableVersionsList` +- New struct `GuardrailsAvailableVersionsProperties` +- New struct `LabelSelector` +- New struct `LabelSelectorRequirement` +- New struct `LoadBalancer` +- New struct `LoadBalancerListResult` +- New struct `LoadBalancerProperties` +- New struct `Machine` +- New struct `MachineIPAddress` +- New struct `MachineListResult` +- New struct `MachineNetworkProperties` +- New struct `MachineProperties` +- New struct `ManagedClusterAIToolchainOperatorProfile` +- New struct `ManagedClusterAzureMonitorProfileAppMonitoring` +- New struct `ManagedClusterAzureMonitorProfileAppMonitoringAutoInstrumentation` +- New struct `ManagedClusterAzureMonitorProfileAppMonitoringOpenTelemetryLogs` +- New struct `ManagedClusterAzureMonitorProfileAppMonitoringOpenTelemetryMetrics` +- New struct `ManagedClusterAzureMonitorProfileContainerInsights` +- New struct `ManagedClusterBootstrapProfile` +- New struct `ManagedClusterNodeProvisioningProfile` +- New struct `ManagedClusterNodeResourceGroupProfile` +- New struct `ManagedClusterPropertiesForSnapshot` +- New struct `ManagedClusterSecurityProfileImageIntegrity` +- New struct `ManagedClusterSecurityProfileNodeRestriction` +- New struct `ManagedClusterSnapshot` +- New struct `ManagedClusterSnapshotListResult` +- New struct `ManagedClusterSnapshotProperties` +- New struct `ManagedClusterStaticEgressGatewayProfile` +- New struct `ManualScaleProfile` +- New struct `NetworkProfileForSnapshot` +- New struct `NetworkProfileKubeProxyConfig` +- New struct `NetworkProfileKubeProxyConfigIpvsConfig` +- New struct `OperationStatusResult` +- New struct `OperationStatusResultList` +- New struct `RebalanceLoadBalancersRequestBody` +- New struct `SafeguardsAvailableVersion` +- New struct `SafeguardsAvailableVersionsList` +- New struct `SafeguardsAvailableVersionsProperties` +- New struct `SafeguardsProfile` +- New struct `ScaleProfile` +- New struct `VirtualMachineNodes` +- New struct `VirtualMachinesProfile` +- New field `ComponentsByReleases` in struct `AgentPoolUpgradeProfileProperties` +- New field `UndrainableNodeBehavior` in struct `AgentPoolUpgradeSettings` +- New field `IfMatch`, `IfNoneMatch` in struct `AgentPoolsClientBeginCreateOrUpdateOptions` +- New field `IfMatch`, `IgnorePodDisruptionBudget` in struct `AgentPoolsClientBeginDeleteOptions` +- New field `ETag`, `Kind` in struct `ManagedCluster` +- New field `EnableVnetIntegration`, `SubnetID` in struct `ManagedClusterAPIServerAccessProfile` +- New field `ArtifactStreamingProfile`, `ETag`, `EnableCustomCATrust`, `GatewayProfile`, `GpuProfile`, `MessageOfTheDay`, `NodeInitializationTaints`, `PodIPAllocationMode`, `SecurityProfile`, `VirtualMachineNodesStatus`, `VirtualMachinesProfile` in struct `ManagedClusterAgentPoolProfile` +- New field `ArtifactStreamingProfile`, `ETag`, `EnableCustomCATrust`, `GatewayProfile`, `GpuProfile`, `MessageOfTheDay`, `NodeInitializationTaints`, `PodIPAllocationMode`, `SecurityProfile`, `VirtualMachineNodesStatus`, `VirtualMachinesProfile` in struct `ManagedClusterAgentPoolProfileProperties` +- New field `AppMonitoring`, `ContainerInsights` in struct `ManagedClusterAzureMonitorProfile` +- New field `EffectiveNoProxy` in struct `ManagedClusterHTTPProxyConfig` +- New field `ClusterServiceLoadBalancerHealthProbeMode` in struct `ManagedClusterLoadBalancerProfile` +- New field `ComponentsByReleases` in struct `ManagedClusterPoolUpgradeProfile` +- New field `AiToolchainOperatorProfile`, `BootstrapProfile`, `CreationData`, `EnableNamespaceResources`, `NodeProvisioningProfile`, `NodeResourceGroupProfile`, `SafeguardsProfile` in struct `ManagedClusterProperties` +- New field `CustomCATrustCertificates`, `ImageIntegrity`, `NodeRestriction` in struct `ManagedClusterSecurityProfile` +- New field `Version` in struct `ManagedClusterStorageProfileDiskCSIDriver` +- New field `AddonAutoscaling` in struct `ManagedClusterWorkloadAutoScalerProfileVerticalPodAutoscaler` +- New field `IfMatch`, `IfNoneMatch` in struct `ManagedClustersClientBeginCreateOrUpdateOptions` +- New field `IfMatch`, `IgnorePodDisruptionBudget` in struct `ManagedClustersClientBeginDeleteOptions` +- New field `IfMatch` in struct `ManagedClustersClientBeginUpdateTagsOptions` +- New field `AdvancedNetworking`, `KubeProxyConfig`, `PodLinkLocalAccess`, `StaticEgressGatewayProfile` in struct `NetworkProfile` + + ## 6.0.0 (2024-07-26) ### Breaking Changes diff --git a/sdk/resourcemanager/containerservice/armcontainerservice/agentpools_client.go b/sdk/resourcemanager/containerservice/armcontainerservice/agentpools_client.go index 8f0eaf034a44..516e649ae57f 100644 --- a/sdk/resourcemanager/containerservice/armcontainerservice/agentpools_client.go +++ b/sdk/resourcemanager/containerservice/armcontainerservice/agentpools_client.go @@ -17,6 +17,7 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" "net/http" "net/url" + "strconv" "strings" ) @@ -45,10 +46,10 @@ func NewAgentPoolsClient(subscriptionID string, credential azcore.TokenCredentia // BeginAbortLatestOperation - Aborts the currently running operation on the agent pool. The Agent Pool will be moved to a // Canceling state and eventually to a Canceled state when cancellation finishes. If the operation completes -// before cancellation can take place, a 409 error code is returned. +// before cancellation can take place, an error is returned. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-05-01 +// Generated from API version 2024-05-02-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - resourceName - The name of the managed cluster resource. // - agentPoolName - The name of the agent pool. @@ -74,10 +75,10 @@ func (client *AgentPoolsClient) BeginAbortLatestOperation(ctx context.Context, r // AbortLatestOperation - Aborts the currently running operation on the agent pool. The Agent Pool will be moved to a Canceling // state and eventually to a Canceled state when cancellation finishes. If the operation completes -// before cancellation can take place, a 409 error code is returned. +// before cancellation can take place, an error is returned. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-05-01 +// Generated from API version 2024-05-02-preview func (client *AgentPoolsClient) abortLatestOperation(ctx context.Context, resourceGroupName string, resourceName string, agentPoolName string, options *AgentPoolsClientBeginAbortLatestOperationOptions) (*http.Response, error) { var err error const operationName = "AgentPoolsClient.BeginAbortLatestOperation" @@ -123,7 +124,7 @@ func (client *AgentPoolsClient) abortLatestOperationCreateRequest(ctx context.Co return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-05-02-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -132,7 +133,7 @@ func (client *AgentPoolsClient) abortLatestOperationCreateRequest(ctx context.Co // BeginCreateOrUpdate - Creates or updates an agent pool in the specified managed cluster. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-05-01 +// Generated from API version 2024-05-02-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - resourceName - The name of the managed cluster resource. // - agentPoolName - The name of the agent pool. @@ -159,7 +160,7 @@ func (client *AgentPoolsClient) BeginCreateOrUpdate(ctx context.Context, resourc // CreateOrUpdate - Creates or updates an agent pool in the specified managed cluster. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-05-01 +// Generated from API version 2024-05-02-preview func (client *AgentPoolsClient) createOrUpdate(ctx context.Context, resourceGroupName string, resourceName string, agentPoolName string, parameters AgentPool, options *AgentPoolsClientBeginCreateOrUpdateOptions) (*http.Response, error) { var err error const operationName = "AgentPoolsClient.BeginCreateOrUpdate" @@ -205,9 +206,15 @@ func (client *AgentPoolsClient) createOrUpdateCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-05-02-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} + if options != nil && options.IfMatch != nil { + req.Raw().Header["If-Match"] = []string{*options.IfMatch} + } + if options != nil && options.IfNoneMatch != nil { + req.Raw().Header["If-None-Match"] = []string{*options.IfNoneMatch} + } if err := runtime.MarshalAsJSON(req, parameters); err != nil { return nil, err } @@ -217,7 +224,7 @@ func (client *AgentPoolsClient) createOrUpdateCreateRequest(ctx context.Context, // BeginDelete - Deletes an agent pool in the specified managed cluster. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-05-01 +// Generated from API version 2024-05-02-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - resourceName - The name of the managed cluster resource. // - agentPoolName - The name of the agent pool. @@ -242,7 +249,7 @@ func (client *AgentPoolsClient) BeginDelete(ctx context.Context, resourceGroupNa // Delete - Deletes an agent pool in the specified managed cluster. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-05-01 +// Generated from API version 2024-05-02-preview func (client *AgentPoolsClient) deleteOperation(ctx context.Context, resourceGroupName string, resourceName string, agentPoolName string, options *AgentPoolsClientBeginDeleteOptions) (*http.Response, error) { var err error const operationName = "AgentPoolsClient.BeginDelete" @@ -288,16 +295,107 @@ func (client *AgentPoolsClient) deleteCreateRequest(ctx context.Context, resourc return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-05-02-preview") + if options != nil && options.IgnorePodDisruptionBudget != nil { + reqQP.Set("ignore-pod-disruption-budget", strconv.FormatBool(*options.IgnorePodDisruptionBudget)) + } + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + if options != nil && options.IfMatch != nil { + req.Raw().Header["If-Match"] = []string{*options.IfMatch} + } + return req, nil +} + +// BeginDeleteMachines - Deletes specific machines in an agent pool. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2024-05-02-preview +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - resourceName - The name of the managed cluster resource. +// - agentPoolName - The name of the agent pool. +// - machines - A list of machines from the agent pool to be deleted. +// - options - AgentPoolsClientBeginDeleteMachinesOptions contains the optional parameters for the AgentPoolsClient.BeginDeleteMachines +// method. +func (client *AgentPoolsClient) BeginDeleteMachines(ctx context.Context, resourceGroupName string, resourceName string, agentPoolName string, machines AgentPoolDeleteMachinesParameter, options *AgentPoolsClientBeginDeleteMachinesOptions) (*runtime.Poller[AgentPoolsClientDeleteMachinesResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.deleteMachines(ctx, resourceGroupName, resourceName, agentPoolName, machines, options) + if err != nil { + return nil, err + } + poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[AgentPoolsClientDeleteMachinesResponse]{ + Tracer: client.internal.Tracer(), + }) + return poller, err + } else { + return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[AgentPoolsClientDeleteMachinesResponse]{ + Tracer: client.internal.Tracer(), + }) + } +} + +// DeleteMachines - Deletes specific machines in an agent pool. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2024-05-02-preview +func (client *AgentPoolsClient) deleteMachines(ctx context.Context, resourceGroupName string, resourceName string, agentPoolName string, machines AgentPoolDeleteMachinesParameter, options *AgentPoolsClientBeginDeleteMachinesOptions) (*http.Response, error) { + var err error + const operationName = "AgentPoolsClient.BeginDeleteMachines" + ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) + ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) + defer func() { endSpan(err) }() + req, err := client.deleteMachinesCreateRequest(ctx, resourceGroupName, resourceName, agentPoolName, machines, options) + if err != nil { + return nil, err + } + httpResp, err := client.internal.Pipeline().Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(httpResp, http.StatusAccepted) { + err = runtime.NewResponseError(httpResp) + return nil, err + } + return httpResp, nil +} + +// deleteMachinesCreateRequest creates the DeleteMachines request. +func (client *AgentPoolsClient) deleteMachinesCreateRequest(ctx context.Context, resourceGroupName string, resourceName string, agentPoolName string, machines AgentPoolDeleteMachinesParameter, options *AgentPoolsClientBeginDeleteMachinesOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools/{agentPoolName}/deleteMachines" + 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 := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2024-05-02-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} + if err := runtime.MarshalAsJSON(req, machines); err != nil { + return nil, err + } return req, nil } // Get - Gets the specified managed cluster agent pool. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-05-01 +// Generated from API version 2024-05-02-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - resourceName - The name of the managed cluster resource. // - agentPoolName - The name of the agent pool. @@ -348,7 +446,7 @@ func (client *AgentPoolsClient) getCreateRequest(ctx context.Context, resourceGr return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-05-02-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -367,7 +465,7 @@ func (client *AgentPoolsClient) getHandleResponse(resp *http.Response) (AgentPoo // for more details about the version lifecycle. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-05-01 +// Generated from API version 2024-05-02-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - resourceName - The name of the managed cluster resource. // - options - AgentPoolsClientGetAvailableAgentPoolVersionsOptions contains the optional parameters for the AgentPoolsClient.GetAvailableAgentPoolVersions @@ -414,7 +512,7 @@ func (client *AgentPoolsClient) getAvailableAgentPoolVersionsCreateRequest(ctx c return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-05-02-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -432,7 +530,7 @@ func (client *AgentPoolsClient) getAvailableAgentPoolVersionsHandleResponse(resp // GetUpgradeProfile - Gets the upgrade profile for an agent pool. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-05-01 +// Generated from API version 2024-05-02-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - resourceName - The name of the managed cluster resource. // - agentPoolName - The name of the agent pool. @@ -484,7 +582,7 @@ func (client *AgentPoolsClient) getUpgradeProfileCreateRequest(ctx context.Conte return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-05-02-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -501,7 +599,7 @@ func (client *AgentPoolsClient) getUpgradeProfileHandleResponse(resp *http.Respo // NewListPager - Gets a list of agent pools in the specified managed cluster. // -// Generated from API version 2024-05-01 +// Generated from API version 2024-05-02-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - resourceName - The name of the managed cluster resource. // - options - AgentPoolsClientListOptions contains the optional parameters for the AgentPoolsClient.NewListPager method. @@ -548,7 +646,7 @@ func (client *AgentPoolsClient) listCreateRequest(ctx context.Context, resourceG return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-05-02-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -568,7 +666,7 @@ func (client *AgentPoolsClient) listHandleResponse(resp *http.Response) (AgentPo // versions, see: https://docs.microsoft.com/azure/aks/node-image-upgrade // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-05-01 +// Generated from API version 2024-05-02-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - resourceName - The name of the managed cluster resource. // - agentPoolName - The name of the agent pool. @@ -597,7 +695,7 @@ func (client *AgentPoolsClient) BeginUpgradeNodeImageVersion(ctx context.Context // versions, see: https://docs.microsoft.com/azure/aks/node-image-upgrade // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-05-01 +// Generated from API version 2024-05-02-preview func (client *AgentPoolsClient) upgradeNodeImageVersion(ctx context.Context, resourceGroupName string, resourceName string, agentPoolName string, options *AgentPoolsClientBeginUpgradeNodeImageVersionOptions) (*http.Response, error) { var err error const operationName = "AgentPoolsClient.BeginUpgradeNodeImageVersion" @@ -643,7 +741,7 @@ func (client *AgentPoolsClient) upgradeNodeImageVersionCreateRequest(ctx context return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-05-02-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/containerservice/armcontainerservice/agentpools_client_example_test.go b/sdk/resourcemanager/containerservice/armcontainerservice/agentpools_client_example_test.go index d37ff24c5faf..c968d4ae66c0 100644 --- a/sdk/resourcemanager/containerservice/armcontainerservice/agentpools_client_example_test.go +++ b/sdk/resourcemanager/containerservice/armcontainerservice/agentpools_client_example_test.go @@ -18,7 +18,7 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/containerservice/armcontainerservice/v6" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/8cbd903b0d037c427def0e8fbf167b26e87bd1a9/specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2024-05-01/examples/AgentPoolsAbortOperation.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c7b98b36e4023331545051284d8500adf98f02fe/specification/containerservice/resource-manager/Microsoft.ContainerService/aks/preview/2024-05-02-preview/examples/AgentPoolsAbortOperation.json func ExampleAgentPoolsClient_BeginAbortLatestOperation() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -39,7 +39,7 @@ func ExampleAgentPoolsClient_BeginAbortLatestOperation() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/8cbd903b0d037c427def0e8fbf167b26e87bd1a9/specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2024-05-01/examples/AgentPoolsList.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c7b98b36e4023331545051284d8500adf98f02fe/specification/containerservice/resource-manager/Microsoft.ContainerService/aks/preview/2024-05-02-preview/examples/AgentPoolsList.json func ExampleAgentPoolsClient_NewListPager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -69,6 +69,7 @@ func ExampleAgentPoolsClient_NewListPager() { // Properties: &armcontainerservice.ManagedClusterAgentPoolProfileProperties{ // Count: to.Ptr[int32](3), // CurrentOrchestratorVersion: to.Ptr("1.9.6"), + // ETag: to.Ptr("ewnfuib"), // MaxPods: to.Ptr[int32](110), // NodeImageVersion: to.Ptr("AKSUbuntu:1604:2020.03.11"), // OrchestratorVersion: to.Ptr("1.9.6"), @@ -81,7 +82,7 @@ func ExampleAgentPoolsClient_NewListPager() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/8cbd903b0d037c427def0e8fbf167b26e87bd1a9/specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2024-05-01/examples/AgentPoolsGet.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c7b98b36e4023331545051284d8500adf98f02fe/specification/containerservice/resource-manager/Microsoft.ContainerService/aks/preview/2024-05-02-preview/examples/AgentPoolsGet.json func ExampleAgentPoolsClient_Get() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -105,6 +106,7 @@ func ExampleAgentPoolsClient_Get() { // Properties: &armcontainerservice.ManagedClusterAgentPoolProfileProperties{ // Count: to.Ptr[int32](3), // CurrentOrchestratorVersion: to.Ptr("1.9.6"), + // ETag: to.Ptr("ebwiyfneowv"), // MaxPods: to.Ptr[int32](110), // NodeImageVersion: to.Ptr("AKSUbuntu:1604:2020.03.11"), // OrchestratorVersion: to.Ptr("1.9.6"), @@ -118,7 +120,56 @@ func ExampleAgentPoolsClient_Get() { // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/8cbd903b0d037c427def0e8fbf167b26e87bd1a9/specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2024-05-01/examples/AgentPoolsCreate_Snapshot.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c7b98b36e4023331545051284d8500adf98f02fe/specification/containerservice/resource-manager/Microsoft.ContainerService/aks/preview/2024-05-02-preview/examples/AgentPoolsAssociate_CRG.json +func ExampleAgentPoolsClient_BeginCreateOrUpdate_associateAgentPoolWithCapacityReservationGroup() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + clientFactory, err := armcontainerservice.NewClientFactory("", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + poller, err := clientFactory.NewAgentPoolsClient().BeginCreateOrUpdate(ctx, "rg1", "clustername1", "agentpool1", armcontainerservice.AgentPool{ + Properties: &armcontainerservice.ManagedClusterAgentPoolProfileProperties{ + CapacityReservationGroupID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/rg1/providers/Microsoft.Compute/CapacityReservationGroups/crg1"), + Count: to.Ptr[int32](3), + OrchestratorVersion: to.Ptr(""), + OSType: to.Ptr(armcontainerservice.OSTypeLinux), + VMSize: to.Ptr("Standard_DS2_v2"), + }, + }, &armcontainerservice.AgentPoolsClientBeginCreateOrUpdateOptions{IfMatch: nil, + IfNoneMatch: nil, + }) + if err != nil { + log.Fatalf("failed to finish the request: %v", err) + } + res, err := poller.PollUntilDone(ctx, nil) + if err != nil { + log.Fatalf("failed to pull the result: %v", err) + } + // You could use response here. We use blank identifier for just demo purposes. + _ = res + // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. + // res.AgentPool = armcontainerservice.AgentPool{ + // Name: to.Ptr("agentpool1"), + // Type: to.Ptr("Microsoft.ContainerService/managedClusters/agentPools"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/rg1/providers/Microsoft.ContainerService/managedClusters/clustername1/agentPools/agentpool1"), + // Properties: &armcontainerservice.ManagedClusterAgentPoolProfileProperties{ + // CapacityReservationGroupID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/rg1/providers/Microsoft.Compute/CapacityReservationGroups/crg1"), + // Count: to.Ptr[int32](3), + // CurrentOrchestratorVersion: to.Ptr("1.9.6"), + // MaxPods: to.Ptr[int32](110), + // OrchestratorVersion: to.Ptr("1.9.6"), + // OSType: to.Ptr(armcontainerservice.OSTypeLinux), + // ProvisioningState: to.Ptr("Succeeded"), + // VMSize: to.Ptr("Standard_DS2_v2"), + // }, + // } +} + +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c7b98b36e4023331545051284d8500adf98f02fe/specification/containerservice/resource-manager/Microsoft.ContainerService/aks/preview/2024-05-02-preview/examples/AgentPoolsCreate_Snapshot.json func ExampleAgentPoolsClient_BeginCreateOrUpdate_createAgentPoolUsingAnAgentPoolSnapshot() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -133,14 +184,16 @@ func ExampleAgentPoolsClient_BeginCreateOrUpdate_createAgentPoolUsingAnAgentPool Properties: &armcontainerservice.ManagedClusterAgentPoolProfileProperties{ Count: to.Ptr[int32](3), CreationData: &armcontainerservice.CreationData{ - SourceResourceID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/rg1/providers/Microsoft.ContainerService/snapshots/snapshot1"), + SourceResourceID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.ContainerService/snapshots/snapshot1"), }, EnableFIPS: to.Ptr(true), OrchestratorVersion: to.Ptr(""), OSType: to.Ptr(armcontainerservice.OSTypeLinux), VMSize: to.Ptr("Standard_DS2_v2"), }, - }, nil) + }, &armcontainerservice.AgentPoolsClientBeginCreateOrUpdateOptions{IfMatch: nil, + IfNoneMatch: nil, + }) if err != nil { log.Fatalf("failed to finish the request: %v", err) } @@ -158,7 +211,7 @@ func ExampleAgentPoolsClient_BeginCreateOrUpdate_createAgentPoolUsingAnAgentPool // Properties: &armcontainerservice.ManagedClusterAgentPoolProfileProperties{ // Count: to.Ptr[int32](3), // CreationData: &armcontainerservice.CreationData{ - // SourceResourceID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/rg1/providers/Microsoft.ContainerService/snapshots/snapshot1"), + // SourceResourceID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.ContainerService/snapshots/snapshot1"), // }, // CurrentOrchestratorVersion: to.Ptr("1.19.6"), // EnableFIPS: to.Ptr(true), @@ -171,8 +224,8 @@ func ExampleAgentPoolsClient_BeginCreateOrUpdate_createAgentPoolUsingAnAgentPool // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/8cbd903b0d037c427def0e8fbf167b26e87bd1a9/specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2024-05-01/examples/AgentPoolsCreate_CRG.json -func ExampleAgentPoolsClient_BeginCreateOrUpdate_createAgentPoolWithCapacityReservationGroup() { +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c7b98b36e4023331545051284d8500adf98f02fe/specification/containerservice/resource-manager/Microsoft.ContainerService/aks/preview/2024-05-02-preview/examples/AgentPoolsCreate_EnableCustomCATrust.json +func ExampleAgentPoolsClient_BeginCreateOrUpdate_createAgentPoolWithCustomCaTrustEnabled() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) @@ -184,13 +237,15 @@ func ExampleAgentPoolsClient_BeginCreateOrUpdate_createAgentPoolWithCapacityRese } poller, err := clientFactory.NewAgentPoolsClient().BeginCreateOrUpdate(ctx, "rg1", "clustername1", "agentpool1", armcontainerservice.AgentPool{ Properties: &armcontainerservice.ManagedClusterAgentPoolProfileProperties{ - CapacityReservationGroupID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/rg1/providers/Microsoft.Compute/CapacityReservationGroups/crg1"), - Count: to.Ptr[int32](3), - OrchestratorVersion: to.Ptr(""), - OSType: to.Ptr(armcontainerservice.OSTypeLinux), - VMSize: to.Ptr("Standard_DS2_v2"), + Count: to.Ptr[int32](3), + EnableCustomCATrust: to.Ptr(true), + OrchestratorVersion: to.Ptr(""), + OSType: to.Ptr(armcontainerservice.OSTypeLinux), + VMSize: to.Ptr("Standard_DS2_v2"), }, - }, nil) + }, &armcontainerservice.AgentPoolsClientBeginCreateOrUpdateOptions{IfMatch: nil, + IfNoneMatch: nil, + }) if err != nil { log.Fatalf("failed to finish the request: %v", err) } @@ -206,11 +261,11 @@ func ExampleAgentPoolsClient_BeginCreateOrUpdate_createAgentPoolWithCapacityRese // Type: to.Ptr("Microsoft.ContainerService/managedClusters/agentPools"), // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/rg1/providers/Microsoft.ContainerService/managedClusters/clustername1/agentPools/agentpool1"), // Properties: &armcontainerservice.ManagedClusterAgentPoolProfileProperties{ - // CapacityReservationGroupID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/rg1/providers/Microsoft.Compute/CapacityReservationGroups/crg1"), // Count: to.Ptr[int32](3), - // CurrentOrchestratorVersion: to.Ptr("1.9.6"), + // CurrentOrchestratorVersion: to.Ptr("1.19.6"), + // EnableCustomCATrust: to.Ptr(true), // MaxPods: to.Ptr[int32](110), - // OrchestratorVersion: to.Ptr("1.9.6"), + // OrchestratorVersion: to.Ptr("1.19.6"), // OSType: to.Ptr(armcontainerservice.OSTypeLinux), // ProvisioningState: to.Ptr("Succeeded"), // VMSize: to.Ptr("Standard_DS2_v2"), @@ -218,7 +273,7 @@ func ExampleAgentPoolsClient_BeginCreateOrUpdate_createAgentPoolWithCapacityRese // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/8cbd903b0d037c427def0e8fbf167b26e87bd1a9/specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2024-05-01/examples/AgentPoolsCreate_DedicatedHostGroup.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c7b98b36e4023331545051284d8500adf98f02fe/specification/containerservice/resource-manager/Microsoft.ContainerService/aks/preview/2024-05-02-preview/examples/AgentPoolsCreate_DedicatedHostGroup.json func ExampleAgentPoolsClient_BeginCreateOrUpdate_createAgentPoolWithDedicatedHostGroup() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -237,7 +292,9 @@ func ExampleAgentPoolsClient_BeginCreateOrUpdate_createAgentPoolWithDedicatedHos OSType: to.Ptr(armcontainerservice.OSTypeLinux), VMSize: to.Ptr("Standard_DS2_v2"), }, - }, nil) + }, &armcontainerservice.AgentPoolsClientBeginCreateOrUpdateOptions{IfMatch: nil, + IfNoneMatch: nil, + }) if err != nil { log.Fatalf("failed to finish the request: %v", err) } @@ -254,6 +311,7 @@ func ExampleAgentPoolsClient_BeginCreateOrUpdate_createAgentPoolWithDedicatedHos // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/rg1/providers/Microsoft.ContainerService/managedClusters/clustername1/agentPools/agentpool1"), // Properties: &armcontainerservice.ManagedClusterAgentPoolProfileProperties{ // Count: to.Ptr[int32](3), + // CurrentOrchestratorVersion: to.Ptr("1.19.6"), // HostGroupID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/rg/providers/Microsoft.Compute/hostGroups/hostgroup1"), // MaxPods: to.Ptr[int32](110), // OrchestratorVersion: to.Ptr("1.19.6"), @@ -264,7 +322,7 @@ func ExampleAgentPoolsClient_BeginCreateOrUpdate_createAgentPoolWithDedicatedHos // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/8cbd903b0d037c427def0e8fbf167b26e87bd1a9/specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2024-05-01/examples/AgentPoolsCreate_EnableEncryptionAtHost.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c7b98b36e4023331545051284d8500adf98f02fe/specification/containerservice/resource-manager/Microsoft.ContainerService/aks/preview/2024-05-02-preview/examples/AgentPoolsCreate_EnableEncryptionAtHost.json func ExampleAgentPoolsClient_BeginCreateOrUpdate_createAgentPoolWithEncryptionAtHostEnabled() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -283,7 +341,9 @@ func ExampleAgentPoolsClient_BeginCreateOrUpdate_createAgentPoolWithEncryptionAt OSType: to.Ptr(armcontainerservice.OSTypeLinux), VMSize: to.Ptr("Standard_DS2_v2"), }, - }, nil) + }, &armcontainerservice.AgentPoolsClientBeginCreateOrUpdateOptions{IfMatch: nil, + IfNoneMatch: nil, + }) if err != nil { log.Fatalf("failed to finish the request: %v", err) } @@ -311,7 +371,7 @@ func ExampleAgentPoolsClient_BeginCreateOrUpdate_createAgentPoolWithEncryptionAt // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/8cbd903b0d037c427def0e8fbf167b26e87bd1a9/specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2024-05-01/examples/AgentPoolsCreate_Ephemeral.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c7b98b36e4023331545051284d8500adf98f02fe/specification/containerservice/resource-manager/Microsoft.ContainerService/aks/preview/2024-05-02-preview/examples/AgentPoolsCreate_Ephemeral.json func ExampleAgentPoolsClient_BeginCreateOrUpdate_createAgentPoolWithEphemeralOsDisk() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -331,7 +391,9 @@ func ExampleAgentPoolsClient_BeginCreateOrUpdate_createAgentPoolWithEphemeralOsD OSType: to.Ptr(armcontainerservice.OSTypeLinux), VMSize: to.Ptr("Standard_DS2_v2"), }, - }, nil) + }, &armcontainerservice.AgentPoolsClientBeginCreateOrUpdateOptions{IfMatch: nil, + IfNoneMatch: nil, + }) if err != nil { log.Fatalf("failed to finish the request: %v", err) } @@ -360,7 +422,7 @@ func ExampleAgentPoolsClient_BeginCreateOrUpdate_createAgentPoolWithEphemeralOsD // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/8cbd903b0d037c427def0e8fbf167b26e87bd1a9/specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2024-05-01/examples/AgentPoolsCreate_EnableFIPS.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c7b98b36e4023331545051284d8500adf98f02fe/specification/containerservice/resource-manager/Microsoft.ContainerService/aks/preview/2024-05-02-preview/examples/AgentPoolsCreate_EnableFIPS.json func ExampleAgentPoolsClient_BeginCreateOrUpdate_createAgentPoolWithFipsEnabledOs() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -379,7 +441,9 @@ func ExampleAgentPoolsClient_BeginCreateOrUpdate_createAgentPoolWithFipsEnabledO OSType: to.Ptr(armcontainerservice.OSTypeLinux), VMSize: to.Ptr("Standard_DS2_v2"), }, - }, nil) + }, &armcontainerservice.AgentPoolsClientBeginCreateOrUpdateOptions{IfMatch: nil, + IfNoneMatch: nil, + }) if err != nil { log.Fatalf("failed to finish the request: %v", err) } @@ -407,7 +471,7 @@ func ExampleAgentPoolsClient_BeginCreateOrUpdate_createAgentPoolWithFipsEnabledO // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/8cbd903b0d037c427def0e8fbf167b26e87bd1a9/specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2024-05-01/examples/AgentPoolsCreate_GPUMIG.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c7b98b36e4023331545051284d8500adf98f02fe/specification/containerservice/resource-manager/Microsoft.ContainerService/aks/preview/2024-05-02-preview/examples/AgentPoolsCreate_GPUMIG.json func ExampleAgentPoolsClient_BeginCreateOrUpdate_createAgentPoolWithGpumig() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -449,7 +513,9 @@ func ExampleAgentPoolsClient_BeginCreateOrUpdate_createAgentPoolWithGpumig() { OSType: to.Ptr(armcontainerservice.OSTypeLinux), VMSize: to.Ptr("Standard_ND96asr_v4"), }, - }, nil) + }, &armcontainerservice.AgentPoolsClientBeginCreateOrUpdateOptions{IfMatch: nil, + IfNoneMatch: nil, + }) if err != nil { log.Fatalf("failed to finish the request: %v", err) } @@ -500,7 +566,7 @@ func ExampleAgentPoolsClient_BeginCreateOrUpdate_createAgentPoolWithGpumig() { // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/8cbd903b0d037c427def0e8fbf167b26e87bd1a9/specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2024-05-01/examples/AgentPoolsCreate_WasmWasi.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c7b98b36e4023331545051284d8500adf98f02fe/specification/containerservice/resource-manager/Microsoft.ContainerService/aks/preview/2024-05-02-preview/examples/AgentPoolsCreate_WasmWasi.json func ExampleAgentPoolsClient_BeginCreateOrUpdate_createAgentPoolWithKrustletAndTheWasiRuntime() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -521,7 +587,9 @@ func ExampleAgentPoolsClient_BeginCreateOrUpdate_createAgentPoolWithKrustletAndT VMSize: to.Ptr("Standard_DS2_v2"), WorkloadRuntime: to.Ptr(armcontainerservice.WorkloadRuntimeWasmWasi), }, - }, nil) + }, &armcontainerservice.AgentPoolsClientBeginCreateOrUpdateOptions{IfMatch: nil, + IfNoneMatch: nil, + }) if err != nil { log.Fatalf("failed to finish the request: %v", err) } @@ -551,7 +619,7 @@ func ExampleAgentPoolsClient_BeginCreateOrUpdate_createAgentPoolWithKrustletAndT // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/8cbd903b0d037c427def0e8fbf167b26e87bd1a9/specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2024-05-01/examples/AgentPoolsCreate_CustomNodeConfig.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c7b98b36e4023331545051284d8500adf98f02fe/specification/containerservice/resource-manager/Microsoft.ContainerService/aks/preview/2024-05-02-preview/examples/AgentPoolsCreate_CustomNodeConfig.json func ExampleAgentPoolsClient_BeginCreateOrUpdate_createAgentPoolWithKubeletConfigAndLinuxOsConfig() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -592,7 +660,9 @@ func ExampleAgentPoolsClient_BeginCreateOrUpdate_createAgentPoolWithKubeletConfi OSType: to.Ptr(armcontainerservice.OSTypeLinux), VMSize: to.Ptr("Standard_DS2_v2"), }, - }, nil) + }, &armcontainerservice.AgentPoolsClientBeginCreateOrUpdateOptions{IfMatch: nil, + IfNoneMatch: nil, + }) if err != nil { log.Fatalf("failed to finish the request: %v", err) } @@ -642,7 +712,60 @@ func ExampleAgentPoolsClient_BeginCreateOrUpdate_createAgentPoolWithKubeletConfi // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/8cbd903b0d037c427def0e8fbf167b26e87bd1a9/specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2024-05-01/examples/AgentPoolsCreate_OSSKU.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c7b98b36e4023331545051284d8500adf98f02fe/specification/containerservice/resource-manager/Microsoft.ContainerService/aks/preview/2024-05-02-preview/examples/AgentPoolsCreate_MessageOfTheDay.json +func ExampleAgentPoolsClient_BeginCreateOrUpdate_createAgentPoolWithMessageOfTheDay() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + clientFactory, err := armcontainerservice.NewClientFactory("", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + poller, err := clientFactory.NewAgentPoolsClient().BeginCreateOrUpdate(ctx, "rg1", "clustername1", "agentpool1", armcontainerservice.AgentPool{ + Properties: &armcontainerservice.ManagedClusterAgentPoolProfileProperties{ + Count: to.Ptr[int32](3), + MessageOfTheDay: to.Ptr("Zm9vCg=="), + Mode: to.Ptr(armcontainerservice.AgentPoolModeUser), + OrchestratorVersion: to.Ptr(""), + OSDiskSizeGB: to.Ptr[int32](64), + OSType: to.Ptr(armcontainerservice.OSTypeLinux), + VMSize: to.Ptr("Standard_DS2_v2"), + }, + }, &armcontainerservice.AgentPoolsClientBeginCreateOrUpdateOptions{IfMatch: nil, + IfNoneMatch: nil, + }) + if err != nil { + log.Fatalf("failed to finish the request: %v", err) + } + res, err := poller.PollUntilDone(ctx, nil) + if err != nil { + log.Fatalf("failed to pull the result: %v", err) + } + // You could use response here. We use blank identifier for just demo purposes. + _ = res + // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. + // res.AgentPool = armcontainerservice.AgentPool{ + // Name: to.Ptr("agentpool1"), + // Type: to.Ptr("Microsoft.ContainerService/managedClusters/agentPools"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/rg1/providers/Microsoft.ContainerService/managedClusters/clustername1/agentPools/agentpool1"), + // Properties: &armcontainerservice.ManagedClusterAgentPoolProfileProperties{ + // Count: to.Ptr[int32](3), + // CurrentOrchestratorVersion: to.Ptr("1.17.8"), + // MaxPods: to.Ptr[int32](110), + // MessageOfTheDay: to.Ptr("Zm9vCg=="), + // Mode: to.Ptr(armcontainerservice.AgentPoolModeUser), + // OrchestratorVersion: to.Ptr("1.17.8"), + // OSDiskSizeGB: to.Ptr[int32](64), + // OSType: to.Ptr(armcontainerservice.OSTypeLinux), + // ProvisioningState: to.Ptr("Succeeded"), + // VMSize: to.Ptr("Standard_DS2_v2"), + // }, + // } +} + +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c7b98b36e4023331545051284d8500adf98f02fe/specification/containerservice/resource-manager/Microsoft.ContainerService/aks/preview/2024-05-02-preview/examples/AgentPoolsCreate_OSSKU.json func ExampleAgentPoolsClient_BeginCreateOrUpdate_createAgentPoolWithOssku() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -684,7 +807,9 @@ func ExampleAgentPoolsClient_BeginCreateOrUpdate_createAgentPoolWithOssku() { OSType: to.Ptr(armcontainerservice.OSTypeLinux), VMSize: to.Ptr("Standard_DS2_v2"), }, - }, nil) + }, &armcontainerservice.AgentPoolsClientBeginCreateOrUpdateOptions{IfMatch: nil, + IfNoneMatch: nil, + }) if err != nil { log.Fatalf("failed to finish the request: %v", err) } @@ -735,7 +860,7 @@ func ExampleAgentPoolsClient_BeginCreateOrUpdate_createAgentPoolWithOssku() { // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/8cbd903b0d037c427def0e8fbf167b26e87bd1a9/specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2024-05-01/examples/AgentPoolsCreate_PPG.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c7b98b36e4023331545051284d8500adf98f02fe/specification/containerservice/resource-manager/Microsoft.ContainerService/aks/preview/2024-05-02-preview/examples/AgentPoolsCreate_PPG.json func ExampleAgentPoolsClient_BeginCreateOrUpdate_createAgentPoolWithPpg() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -754,7 +879,9 @@ func ExampleAgentPoolsClient_BeginCreateOrUpdate_createAgentPoolWithPpg() { ProximityPlacementGroupID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/rg1/providers/Microsoft.Compute/proximityPlacementGroups/ppg1"), VMSize: to.Ptr("Standard_DS2_v2"), }, - }, nil) + }, &armcontainerservice.AgentPoolsClientBeginCreateOrUpdateOptions{IfMatch: nil, + IfNoneMatch: nil, + }) if err != nil { log.Fatalf("failed to finish the request: %v", err) } @@ -782,7 +909,7 @@ func ExampleAgentPoolsClient_BeginCreateOrUpdate_createAgentPoolWithPpg() { // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/8cbd903b0d037c427def0e8fbf167b26e87bd1a9/specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2024-05-01/examples/AgentPoolsCreate_EnableUltraSSD.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c7b98b36e4023331545051284d8500adf98f02fe/specification/containerservice/resource-manager/Microsoft.ContainerService/aks/preview/2024-05-02-preview/examples/AgentPoolsCreate_EnableUltraSSD.json func ExampleAgentPoolsClient_BeginCreateOrUpdate_createAgentPoolWithUltraSsdEnabled() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -801,7 +928,9 @@ func ExampleAgentPoolsClient_BeginCreateOrUpdate_createAgentPoolWithUltraSsdEnab OSType: to.Ptr(armcontainerservice.OSTypeLinux), VMSize: to.Ptr("Standard_DS2_v2"), }, - }, nil) + }, &armcontainerservice.AgentPoolsClientBeginCreateOrUpdateOptions{IfMatch: nil, + IfNoneMatch: nil, + }) if err != nil { log.Fatalf("failed to finish the request: %v", err) } @@ -829,7 +958,195 @@ func ExampleAgentPoolsClient_BeginCreateOrUpdate_createAgentPoolWithUltraSsdEnab // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/8cbd903b0d037c427def0e8fbf167b26e87bd1a9/specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2024-05-01/examples/AgentPoolsCreate_WindowsOSSKU.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c7b98b36e4023331545051284d8500adf98f02fe/specification/containerservice/resource-manager/Microsoft.ContainerService/aks/preview/2024-05-02-preview/examples/AgentPoolsCreate_TypeVirtualMachines.json +func ExampleAgentPoolsClient_BeginCreateOrUpdate_createAgentPoolWithVirtualMachinesPoolType() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + clientFactory, err := armcontainerservice.NewClientFactory("", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + poller, err := clientFactory.NewAgentPoolsClient().BeginCreateOrUpdate(ctx, "rg1", "clustername1", "agentpool1", armcontainerservice.AgentPool{ + Properties: &armcontainerservice.ManagedClusterAgentPoolProfileProperties{ + Type: to.Ptr(armcontainerservice.AgentPoolTypeVirtualMachines), + NodeLabels: map[string]*string{ + "key1": to.Ptr("val1"), + }, + NodeTaints: []*string{ + to.Ptr("Key1=Value1:NoSchedule")}, + OrchestratorVersion: to.Ptr("1.9.6"), + OSType: to.Ptr(armcontainerservice.OSTypeLinux), + Tags: map[string]*string{ + "name1": to.Ptr("val1"), + }, + VirtualMachinesProfile: &armcontainerservice.VirtualMachinesProfile{ + Scale: &armcontainerservice.ScaleProfile{ + Manual: []*armcontainerservice.ManualScaleProfile{ + { + Count: to.Ptr[int32](5), + Sizes: []*string{ + to.Ptr("Standard_D2_v2"), + to.Ptr("Standard_D2_v3")}, + }}, + }, + }, + }, + }, &armcontainerservice.AgentPoolsClientBeginCreateOrUpdateOptions{IfMatch: nil, + IfNoneMatch: nil, + }) + if err != nil { + log.Fatalf("failed to finish the request: %v", err) + } + res, err := poller.PollUntilDone(ctx, nil) + if err != nil { + log.Fatalf("failed to pull the result: %v", err) + } + // You could use response here. We use blank identifier for just demo purposes. + _ = res + // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. + // res.AgentPool = armcontainerservice.AgentPool{ + // Name: to.Ptr("agentpool1"), + // Type: to.Ptr("Microsoft.ContainerService/managedClusters/agentPools"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/rg1/providers/Microsoft.ContainerService/managedClusters/clustername1/agentPools/agentpool1"), + // Properties: &armcontainerservice.ManagedClusterAgentPoolProfileProperties{ + // Type: to.Ptr(armcontainerservice.AgentPoolTypeVirtualMachines), + // CurrentOrchestratorVersion: to.Ptr("1.9.6"), + // MaxPods: to.Ptr[int32](110), + // NodeImageVersion: to.Ptr("AKSUbuntu-1804gen2containerd-2021.09.11"), + // NodeLabels: map[string]*string{ + // "key1": to.Ptr("val1"), + // }, + // NodeTaints: []*string{ + // to.Ptr("Key1=Value1:NoSchedule")}, + // OrchestratorVersion: to.Ptr("1.9.6"), + // OSType: to.Ptr(armcontainerservice.OSTypeLinux), + // ProvisioningState: to.Ptr("Succeeded"), + // Tags: map[string]*string{ + // "name1": to.Ptr("val1"), + // }, + // VirtualMachineNodesStatus: []*armcontainerservice.VirtualMachineNodes{ + // { + // Count: to.Ptr[int32](3), + // Size: to.Ptr("Standard_D2_v2"), + // }, + // { + // Count: to.Ptr[int32](2), + // Size: to.Ptr("Standard_D2_v3"), + // }}, + // VirtualMachinesProfile: &armcontainerservice.VirtualMachinesProfile{ + // Scale: &armcontainerservice.ScaleProfile{ + // Manual: []*armcontainerservice.ManualScaleProfile{ + // { + // Count: to.Ptr[int32](5), + // Sizes: []*string{ + // to.Ptr("Standard_D2_v2"), + // to.Ptr("Standard_D2_v3")}, + // }}, + // }, + // }, + // }, + // } +} + +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c7b98b36e4023331545051284d8500adf98f02fe/specification/containerservice/resource-manager/Microsoft.ContainerService/aks/preview/2024-05-02-preview/examples/AgentPoolsCreate_TypeVirtualMachines_Autoscale.json +func ExampleAgentPoolsClient_BeginCreateOrUpdate_createAgentPoolWithVirtualMachinesPoolTypeWithAutoscalingEnabled() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + clientFactory, err := armcontainerservice.NewClientFactory("", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + poller, err := clientFactory.NewAgentPoolsClient().BeginCreateOrUpdate(ctx, "rg1", "clustername1", "agentpool1", armcontainerservice.AgentPool{ + Properties: &armcontainerservice.ManagedClusterAgentPoolProfileProperties{ + Type: to.Ptr(armcontainerservice.AgentPoolTypeVirtualMachines), + NodeLabels: map[string]*string{ + "key1": to.Ptr("val1"), + }, + NodeTaints: []*string{ + to.Ptr("Key1=Value1:NoSchedule")}, + OrchestratorVersion: to.Ptr("1.29.0"), + OSType: to.Ptr(armcontainerservice.OSTypeLinux), + Tags: map[string]*string{ + "name1": to.Ptr("val1"), + }, + VirtualMachinesProfile: &armcontainerservice.VirtualMachinesProfile{ + Scale: &armcontainerservice.ScaleProfile{ + Autoscale: []*armcontainerservice.AutoScaleProfile{ + { + MaxCount: to.Ptr[int32](5), + MinCount: to.Ptr[int32](1), + Sizes: []*string{ + to.Ptr("Standard_D2_v2"), + to.Ptr("Standard_D2_v3")}, + }}, + }, + }, + }, + }, &armcontainerservice.AgentPoolsClientBeginCreateOrUpdateOptions{IfMatch: nil, + IfNoneMatch: nil, + }) + if err != nil { + log.Fatalf("failed to finish the request: %v", err) + } + res, err := poller.PollUntilDone(ctx, nil) + if err != nil { + log.Fatalf("failed to pull the result: %v", err) + } + // You could use response here. We use blank identifier for just demo purposes. + _ = res + // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. + // res.AgentPool = armcontainerservice.AgentPool{ + // Name: to.Ptr("agentpool1"), + // Type: to.Ptr("Microsoft.ContainerService/managedClusters/agentPools"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/rg1/providers/Microsoft.ContainerService/managedClusters/clustername1/agentPools/agentpool1"), + // Properties: &armcontainerservice.ManagedClusterAgentPoolProfileProperties{ + // Type: to.Ptr(armcontainerservice.AgentPoolTypeVirtualMachines), + // CurrentOrchestratorVersion: to.Ptr("1.29.0"), + // MaxPods: to.Ptr[int32](110), + // NodeImageVersion: to.Ptr("AKSUbuntu-1804gen2containerd-2021.09.11"), + // NodeLabels: map[string]*string{ + // "key1": to.Ptr("val1"), + // }, + // NodeTaints: []*string{ + // to.Ptr("Key1=Value1:NoSchedule")}, + // OrchestratorVersion: to.Ptr("1.29.0"), + // OSType: to.Ptr(armcontainerservice.OSTypeLinux), + // ProvisioningState: to.Ptr("Succeeded"), + // Tags: map[string]*string{ + // "name1": to.Ptr("val1"), + // }, + // VirtualMachineNodesStatus: []*armcontainerservice.VirtualMachineNodes{ + // { + // Count: to.Ptr[int32](1), + // Size: to.Ptr("Standard_D2_v2"), + // }, + // { + // Count: to.Ptr[int32](2), + // Size: to.Ptr("Standard_D2_v3"), + // }}, + // VirtualMachinesProfile: &armcontainerservice.VirtualMachinesProfile{ + // Scale: &armcontainerservice.ScaleProfile{ + // Autoscale: []*armcontainerservice.AutoScaleProfile{ + // { + // MaxCount: to.Ptr[int32](5), + // MinCount: to.Ptr[int32](1), + // Sizes: []*string{ + // to.Ptr("Standard_D2_v2"), + // to.Ptr("Standard_D2_v3")}, + // }}, + // }, + // }, + // }, + // } +} + +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c7b98b36e4023331545051284d8500adf98f02fe/specification/containerservice/resource-manager/Microsoft.ContainerService/aks/preview/2024-05-02-preview/examples/AgentPoolsCreate_WindowsOSSKU.json func ExampleAgentPoolsClient_BeginCreateOrUpdate_createAgentPoolWithWindowsOssku() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -848,7 +1165,9 @@ func ExampleAgentPoolsClient_BeginCreateOrUpdate_createAgentPoolWithWindowsOssku OSType: to.Ptr(armcontainerservice.OSTypeWindows), VMSize: to.Ptr("Standard_D4s_v3"), }, - }, nil) + }, &armcontainerservice.AgentPoolsClientBeginCreateOrUpdateOptions{IfMatch: nil, + IfNoneMatch: nil, + }) if err != nil { log.Fatalf("failed to finish the request: %v", err) } @@ -876,7 +1195,7 @@ func ExampleAgentPoolsClient_BeginCreateOrUpdate_createAgentPoolWithWindowsOssku // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/8cbd903b0d037c427def0e8fbf167b26e87bd1a9/specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2024-05-01/examples/AgentPoolsCreate_Spot.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c7b98b36e4023331545051284d8500adf98f02fe/specification/containerservice/resource-manager/Microsoft.ContainerService/aks/preview/2024-05-02-preview/examples/AgentPoolsCreate_Spot.json func ExampleAgentPoolsClient_BeginCreateOrUpdate_createSpotAgentPool() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -904,7 +1223,9 @@ func ExampleAgentPoolsClient_BeginCreateOrUpdate_createSpotAgentPool() { }, VMSize: to.Ptr("Standard_DS1_v2"), }, - }, nil) + }, &armcontainerservice.AgentPoolsClientBeginCreateOrUpdateOptions{IfMatch: nil, + IfNoneMatch: nil, + }) if err != nil { log.Fatalf("failed to finish the request: %v", err) } @@ -942,7 +1263,7 @@ func ExampleAgentPoolsClient_BeginCreateOrUpdate_createSpotAgentPool() { // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/8cbd903b0d037c427def0e8fbf167b26e87bd1a9/specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2024-05-01/examples/AgentPoolsCreate_WindowsDisableOutboundNAT.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c7b98b36e4023331545051284d8500adf98f02fe/specification/containerservice/resource-manager/Microsoft.ContainerService/aks/preview/2024-05-02-preview/examples/AgentPoolsCreate_WindowsDisableOutboundNAT.json func ExampleAgentPoolsClient_BeginCreateOrUpdate_createWindowsAgentPoolWithDisablingOutboundNat() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -964,7 +1285,9 @@ func ExampleAgentPoolsClient_BeginCreateOrUpdate_createWindowsAgentPoolWithDisab DisableOutboundNat: to.Ptr(true), }, }, - }, nil) + }, &armcontainerservice.AgentPoolsClientBeginCreateOrUpdateOptions{IfMatch: nil, + IfNoneMatch: nil, + }) if err != nil { log.Fatalf("failed to finish the request: %v", err) } @@ -995,7 +1318,7 @@ func ExampleAgentPoolsClient_BeginCreateOrUpdate_createWindowsAgentPoolWithDisab // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/8cbd903b0d037c427def0e8fbf167b26e87bd1a9/specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2024-05-01/examples/AgentPoolsCreate_Update.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c7b98b36e4023331545051284d8500adf98f02fe/specification/containerservice/resource-manager/Microsoft.ContainerService/aks/preview/2024-05-02-preview/examples/AgentPoolsCreate_Update.json func ExampleAgentPoolsClient_BeginCreateOrUpdate_createUpdateAgentPool() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -1024,7 +1347,9 @@ func ExampleAgentPoolsClient_BeginCreateOrUpdate_createUpdateAgentPool() { }, VMSize: to.Ptr("Standard_DS1_v2"), }, - }, nil) + }, &armcontainerservice.AgentPoolsClientBeginCreateOrUpdateOptions{IfMatch: nil, + IfNoneMatch: nil, + }) if err != nil { log.Fatalf("failed to finish the request: %v", err) } @@ -1041,7 +1366,6 @@ func ExampleAgentPoolsClient_BeginCreateOrUpdate_createUpdateAgentPool() { // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/rg1/providers/Microsoft.ContainerService/managedClusters/clustername1/agentPools/agentpool1"), // Properties: &armcontainerservice.ManagedClusterAgentPoolProfileProperties{ // Count: to.Ptr[int32](3), - // CurrentOrchestratorVersion: to.Ptr("1.9.6"), // MaxPods: to.Ptr[int32](110), // Mode: to.Ptr(armcontainerservice.AgentPoolModeUser), // NodeImageVersion: to.Ptr("AKSUbuntu:1604:2020.03.11"), @@ -1063,7 +1387,7 @@ func ExampleAgentPoolsClient_BeginCreateOrUpdate_createUpdateAgentPool() { // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/8cbd903b0d037c427def0e8fbf167b26e87bd1a9/specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2024-05-01/examples/AgentPools_Start.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c7b98b36e4023331545051284d8500adf98f02fe/specification/containerservice/resource-manager/Microsoft.ContainerService/aks/preview/2024-05-02-preview/examples/AgentPools_Start.json func ExampleAgentPoolsClient_BeginCreateOrUpdate_startAgentPool() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -1080,7 +1404,9 @@ func ExampleAgentPoolsClient_BeginCreateOrUpdate_startAgentPool() { Code: to.Ptr(armcontainerservice.CodeRunning), }, }, - }, nil) + }, &armcontainerservice.AgentPoolsClientBeginCreateOrUpdateOptions{IfMatch: nil, + IfNoneMatch: nil, + }) if err != nil { log.Fatalf("failed to finish the request: %v", err) } @@ -1108,7 +1434,7 @@ func ExampleAgentPoolsClient_BeginCreateOrUpdate_startAgentPool() { // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/8cbd903b0d037c427def0e8fbf167b26e87bd1a9/specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2024-05-01/examples/AgentPools_Stop.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c7b98b36e4023331545051284d8500adf98f02fe/specification/containerservice/resource-manager/Microsoft.ContainerService/aks/preview/2024-05-02-preview/examples/AgentPools_Stop.json func ExampleAgentPoolsClient_BeginCreateOrUpdate_stopAgentPool() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -1125,7 +1451,9 @@ func ExampleAgentPoolsClient_BeginCreateOrUpdate_stopAgentPool() { Code: to.Ptr(armcontainerservice.CodeStopped), }, }, - }, nil) + }, &armcontainerservice.AgentPoolsClientBeginCreateOrUpdateOptions{IfMatch: nil, + IfNoneMatch: nil, + }) if err != nil { log.Fatalf("failed to finish the request: %v", err) } @@ -1151,7 +1479,7 @@ func ExampleAgentPoolsClient_BeginCreateOrUpdate_stopAgentPool() { // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/8cbd903b0d037c427def0e8fbf167b26e87bd1a9/specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2024-05-01/examples/AgentPools_Update.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c7b98b36e4023331545051284d8500adf98f02fe/specification/containerservice/resource-manager/Microsoft.ContainerService/aks/preview/2024-05-02-preview/examples/AgentPools_Update.json func ExampleAgentPoolsClient_BeginCreateOrUpdate_updateAgentPool() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -1176,7 +1504,9 @@ func ExampleAgentPoolsClient_BeginCreateOrUpdate_updateAgentPool() { ScaleSetPriority: to.Ptr(armcontainerservice.ScaleSetPrioritySpot), VMSize: to.Ptr("Standard_DS1_v2"), }, - }, nil) + }, &armcontainerservice.AgentPoolsClientBeginCreateOrUpdateOptions{IfMatch: nil, + IfNoneMatch: nil, + }) if err != nil { log.Fatalf("failed to finish the request: %v", err) } @@ -1210,8 +1540,31 @@ func ExampleAgentPoolsClient_BeginCreateOrUpdate_updateAgentPool() { // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/8cbd903b0d037c427def0e8fbf167b26e87bd1a9/specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2024-05-01/examples/AgentPoolsDelete.json -func ExampleAgentPoolsClient_BeginDelete() { +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c7b98b36e4023331545051284d8500adf98f02fe/specification/containerservice/resource-manager/Microsoft.ContainerService/aks/preview/2024-05-02-preview/examples/AgentPoolsDelete.json +func ExampleAgentPoolsClient_BeginDelete_deleteAgentPool() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + clientFactory, err := armcontainerservice.NewClientFactory("", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + poller, err := clientFactory.NewAgentPoolsClient().BeginDelete(ctx, "rg1", "clustername1", "agentpool1", &armcontainerservice.AgentPoolsClientBeginDeleteOptions{IgnorePodDisruptionBudget: nil, + IfMatch: nil, + }) + if err != nil { + log.Fatalf("failed to finish the request: %v", err) + } + _, err = poller.PollUntilDone(ctx, nil) + if err != nil { + log.Fatalf("failed to pull the result: %v", err) + } +} + +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c7b98b36e4023331545051284d8500adf98f02fe/specification/containerservice/resource-manager/Microsoft.ContainerService/aks/preview/2024-05-02-preview/examples/AgentPoolsDelete_IgnorePodDisruptionBudget.json +func ExampleAgentPoolsClient_BeginDelete_deleteAgentPoolByIgnoringPodDisruptionBudget() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) @@ -1221,7 +1574,9 @@ func ExampleAgentPoolsClient_BeginDelete() { if err != nil { log.Fatalf("failed to create client: %v", err) } - poller, err := clientFactory.NewAgentPoolsClient().BeginDelete(ctx, "rg1", "clustername1", "agentpool1", nil) + poller, err := clientFactory.NewAgentPoolsClient().BeginDelete(ctx, "rg1", "clustername1", "agentpool1", &armcontainerservice.AgentPoolsClientBeginDeleteOptions{IgnorePodDisruptionBudget: nil, + IfMatch: nil, + }) if err != nil { log.Fatalf("failed to finish the request: %v", err) } @@ -1231,7 +1586,7 @@ func ExampleAgentPoolsClient_BeginDelete() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/8cbd903b0d037c427def0e8fbf167b26e87bd1a9/specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2024-05-01/examples/AgentPoolsGetUpgradeProfile.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c7b98b36e4023331545051284d8500adf98f02fe/specification/containerservice/resource-manager/Microsoft.ContainerService/aks/preview/2024-05-02-preview/examples/AgentPoolsGetUpgradeProfile.json func ExampleAgentPoolsClient_GetUpgradeProfile() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -1265,7 +1620,32 @@ func ExampleAgentPoolsClient_GetUpgradeProfile() { // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/8cbd903b0d037c427def0e8fbf167b26e87bd1a9/specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2024-05-01/examples/AgentPoolsGetAgentPoolAvailableVersions.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c7b98b36e4023331545051284d8500adf98f02fe/specification/containerservice/resource-manager/Microsoft.ContainerService/aks/preview/2024-05-02-preview/examples/AgentPoolsDeleteMachines.json +func ExampleAgentPoolsClient_BeginDeleteMachines() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + clientFactory, err := armcontainerservice.NewClientFactory("", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + poller, err := clientFactory.NewAgentPoolsClient().BeginDeleteMachines(ctx, "rg1", "clustername1", "agentpool1", armcontainerservice.AgentPoolDeleteMachinesParameter{ + MachineNames: []*string{ + to.Ptr("aks-nodepool1-42263519-vmss00000a"), + to.Ptr("aks-nodepool1-42263519-vmss00000b")}, + }, nil) + if err != nil { + log.Fatalf("failed to finish the request: %v", err) + } + _, err = poller.PollUntilDone(ctx, nil) + if err != nil { + log.Fatalf("failed to pull the result: %v", err) + } +} + +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c7b98b36e4023331545051284d8500adf98f02fe/specification/containerservice/resource-manager/Microsoft.ContainerService/aks/preview/2024-05-02-preview/examples/AgentPoolsGetAgentPoolAvailableVersions.json func ExampleAgentPoolsClient_GetAvailableAgentPoolVersions() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -1304,7 +1684,7 @@ func ExampleAgentPoolsClient_GetAvailableAgentPoolVersions() { // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/8cbd903b0d037c427def0e8fbf167b26e87bd1a9/specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2024-05-01/examples/AgentPoolsUpgradeNodeImageVersion.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c7b98b36e4023331545051284d8500adf98f02fe/specification/containerservice/resource-manager/Microsoft.ContainerService/aks/preview/2024-05-02-preview/examples/AgentPoolsUpgradeNodeImageVersion.json func ExampleAgentPoolsClient_BeginUpgradeNodeImageVersion() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { diff --git a/sdk/resourcemanager/containerservice/armcontainerservice/assets.json b/sdk/resourcemanager/containerservice/armcontainerservice/assets.json index 33795deff891..32004bbd5e21 100644 --- a/sdk/resourcemanager/containerservice/armcontainerservice/assets.json +++ b/sdk/resourcemanager/containerservice/armcontainerservice/assets.json @@ -2,5 +2,5 @@ "AssetsRepo": "Azure/azure-sdk-assets", "AssetsRepoPrefixPath": "go", "TagPrefix": "go/resourcemanager/containerservice/armcontainerservice", - "Tag": "go/resourcemanager/containerservice/armcontainerservice_7497e2b191" + "Tag": "go/resourcemanager/containerservice/armcontainerservice_3ca2c6e947" } diff --git a/sdk/resourcemanager/containerservice/armcontainerservice/autorest.md b/sdk/resourcemanager/containerservice/armcontainerservice/autorest.md index 53af6c0976eb..8f60cb1e8729 100644 --- a/sdk/resourcemanager/containerservice/armcontainerservice/autorest.md +++ b/sdk/resourcemanager/containerservice/armcontainerservice/autorest.md @@ -5,9 +5,9 @@ ``` yaml azure-arm: true require: -- https://github.com/Azure/azure-rest-api-specs/blob/8cbd903b0d037c427def0e8fbf167b26e87bd1a9/specification/containerservice/resource-manager/Microsoft.ContainerService/aks/readme.md -- https://github.com/Azure/azure-rest-api-specs/blob/8cbd903b0d037c427def0e8fbf167b26e87bd1a9/specification/containerservice/resource-manager/Microsoft.ContainerService/aks/readme.go.md +- https://github.com/Azure/azure-rest-api-specs/blob/c7b98b36e4023331545051284d8500adf98f02fe/specification/containerservice/resource-manager/Microsoft.ContainerService/aks/readme.md +- https://github.com/Azure/azure-rest-api-specs/blob/c7b98b36e4023331545051284d8500adf98f02fe/specification/containerservice/resource-manager/Microsoft.ContainerService/aks/readme.go.md license-header: MICROSOFT_MIT_NO_VERSION -module-version: 6.0.0 -tag: package-2024-05 +module-version: 6.1.0-beta.1 +tag: package-preview-2024-05 ``` diff --git a/sdk/resourcemanager/containerservice/armcontainerservice/client_factory.go b/sdk/resourcemanager/containerservice/armcontainerservice/client_factory.go index 629ced52be30..e0587c7689ac 100644 --- a/sdk/resourcemanager/containerservice/armcontainerservice/client_factory.go +++ b/sdk/resourcemanager/containerservice/armcontainerservice/client_factory.go @@ -44,6 +44,22 @@ func (c *ClientFactory) NewAgentPoolsClient() *AgentPoolsClient { } } +// NewLoadBalancersClient creates a new instance of LoadBalancersClient. +func (c *ClientFactory) NewLoadBalancersClient() *LoadBalancersClient { + return &LoadBalancersClient{ + subscriptionID: c.subscriptionID, + internal: c.internal, + } +} + +// NewMachinesClient creates a new instance of MachinesClient. +func (c *ClientFactory) NewMachinesClient() *MachinesClient { + return &MachinesClient{ + subscriptionID: c.subscriptionID, + internal: c.internal, + } +} + // NewMaintenanceConfigurationsClient creates a new instance of MaintenanceConfigurationsClient. func (c *ClientFactory) NewMaintenanceConfigurationsClient() *MaintenanceConfigurationsClient { return &MaintenanceConfigurationsClient{ @@ -52,6 +68,14 @@ func (c *ClientFactory) NewMaintenanceConfigurationsClient() *MaintenanceConfigu } } +// NewManagedClusterSnapshotsClient creates a new instance of ManagedClusterSnapshotsClient. +func (c *ClientFactory) NewManagedClusterSnapshotsClient() *ManagedClusterSnapshotsClient { + return &ManagedClusterSnapshotsClient{ + subscriptionID: c.subscriptionID, + internal: c.internal, + } +} + // NewManagedClustersClient creates a new instance of ManagedClustersClient. func (c *ClientFactory) NewManagedClustersClient() *ManagedClustersClient { return &ManagedClustersClient{ @@ -60,6 +84,14 @@ func (c *ClientFactory) NewManagedClustersClient() *ManagedClustersClient { } } +// NewOperationStatusResultClient creates a new instance of OperationStatusResultClient. +func (c *ClientFactory) NewOperationStatusResultClient() *OperationStatusResultClient { + return &OperationStatusResultClient{ + subscriptionID: c.subscriptionID, + internal: c.internal, + } +} + // NewOperationsClient creates a new instance of OperationsClient. func (c *ClientFactory) NewOperationsClient() *OperationsClient { return &OperationsClient{ diff --git a/sdk/resourcemanager/containerservice/armcontainerservice/constants.go b/sdk/resourcemanager/containerservice/armcontainerservice/constants.go index 9135b42f6d4c..9ce10144188b 100644 --- a/sdk/resourcemanager/containerservice/armcontainerservice/constants.go +++ b/sdk/resourcemanager/containerservice/armcontainerservice/constants.go @@ -10,14 +10,35 @@ package armcontainerservice const ( moduleName = "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/containerservice/armcontainerservice" - moduleVersion = "v6.0.0" + moduleVersion = "v6.1.0-beta.1" ) +// AddonAutoscaling - Whether VPA add-on is enabled and configured to scale AKS-managed add-ons. +type AddonAutoscaling string + +const ( + // AddonAutoscalingDisabled - Feature to autoscale AKS-managed add-ons is disabled. + AddonAutoscalingDisabled AddonAutoscaling = "Disabled" + // AddonAutoscalingEnabled - Feature to autoscale AKS-managed add-ons is enabled. The default VPA update mode is Initial mode. + AddonAutoscalingEnabled AddonAutoscaling = "Enabled" +) + +// PossibleAddonAutoscalingValues returns the possible values for the AddonAutoscaling const type. +func PossibleAddonAutoscalingValues() []AddonAutoscaling { + return []AddonAutoscaling{ + AddonAutoscalingDisabled, + AddonAutoscalingEnabled, + } +} + // 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 ( + // AgentPoolModeGateway - Gateway agent pools are dedicated to providing static egress IPs to pods. For more details, see + // https://aka.ms/aks/static-egress-gateway. + AgentPoolModeGateway AgentPoolMode = "Gateway" // 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" @@ -28,11 +49,30 @@ const ( // PossibleAgentPoolModeValues returns the possible values for the AgentPoolMode const type. func PossibleAgentPoolModeValues() []AgentPoolMode { return []AgentPoolMode{ + AgentPoolModeGateway, AgentPoolModeSystem, AgentPoolModeUser, } } +// AgentPoolSSHAccess - SSH access method of an agent pool. +type AgentPoolSSHAccess string + +const ( + // AgentPoolSSHAccessDisabled - SSH service will be turned off on the node. + AgentPoolSSHAccessDisabled AgentPoolSSHAccess = "Disabled" + // AgentPoolSSHAccessLocalUser - Can SSH onto the node as a local user using private key. + AgentPoolSSHAccessLocalUser AgentPoolSSHAccess = "LocalUser" +) + +// PossibleAgentPoolSSHAccessValues returns the possible values for the AgentPoolSSHAccess const type. +func PossibleAgentPoolSSHAccessValues() []AgentPoolSSHAccess { + return []AgentPoolSSHAccess{ + AgentPoolSSHAccessDisabled, + AgentPoolSSHAccessLocalUser, + } +} + // AgentPoolType - The type of Agent Pool. type AgentPoolType string @@ -41,6 +81,8 @@ const ( AgentPoolTypeAvailabilitySet AgentPoolType = "AvailabilitySet" // AgentPoolTypeVirtualMachineScaleSets - Create an Agent Pool backed by a Virtual Machine Scale Set. AgentPoolTypeVirtualMachineScaleSets AgentPoolType = "VirtualMachineScaleSets" + // AgentPoolTypeVirtualMachines - Create an Agent Pool backed by a Single Instance VM orchestration mode. + AgentPoolTypeVirtualMachines AgentPoolType = "VirtualMachines" ) // PossibleAgentPoolTypeValues returns the possible values for the AgentPoolType const type. @@ -48,6 +90,25 @@ func PossibleAgentPoolTypeValues() []AgentPoolType { return []AgentPoolType{ AgentPoolTypeAvailabilitySet, AgentPoolTypeVirtualMachineScaleSets, + AgentPoolTypeVirtualMachines, + } +} + +// ArtifactSource - The source where the artifacts are downloaded from. +type ArtifactSource string + +const ( + // ArtifactSourceCache - pull images from Azure Container Registry with cache + ArtifactSourceCache ArtifactSource = "Cache" + // ArtifactSourceDirect - pull images from Microsoft Artifact Registry + ArtifactSourceDirect ArtifactSource = "Direct" +) + +// PossibleArtifactSourceValues returns the possible values for the ArtifactSource const type. +func PossibleArtifactSourceValues() []ArtifactSource { + return []ArtifactSource{ + ArtifactSourceCache, + ArtifactSourceDirect, } } @@ -69,6 +130,26 @@ func PossibleBackendPoolTypeValues() []BackendPoolType { } } +// ClusterServiceLoadBalancerHealthProbeMode - The health probing behavior for External Traffic Policy Cluster services. +type ClusterServiceLoadBalancerHealthProbeMode string + +const ( + // ClusterServiceLoadBalancerHealthProbeModeServiceNodePort - Each External Traffic Policy Cluster service will have its own + // health probe targeting service nodePort. + ClusterServiceLoadBalancerHealthProbeModeServiceNodePort ClusterServiceLoadBalancerHealthProbeMode = "ServiceNodePort" + // ClusterServiceLoadBalancerHealthProbeModeShared - All External Traffic Policy Cluster services in a Standard Load Balancer + // will have a dedicated health probe targeting the backend nodes' kube-proxy health check port 10256. + ClusterServiceLoadBalancerHealthProbeModeShared ClusterServiceLoadBalancerHealthProbeMode = "Shared" +) + +// PossibleClusterServiceLoadBalancerHealthProbeModeValues returns the possible values for the ClusterServiceLoadBalancerHealthProbeMode const type. +func PossibleClusterServiceLoadBalancerHealthProbeModeValues() []ClusterServiceLoadBalancerHealthProbeMode { + return []ClusterServiceLoadBalancerHealthProbeMode{ + ClusterServiceLoadBalancerHealthProbeModeServiceNodePort, + ClusterServiceLoadBalancerHealthProbeModeShared, + } +} + // Code - Tells whether the cluster is Running or Stopped type Code string @@ -211,11 +292,32 @@ func PossibleGPUInstanceProfileValues() []GPUInstanceProfile { } } -// IPFamily - The IP version to use for cluster networking and IP assignment. +// GuardrailsSupport - Whether the version is preview or stable. +type GuardrailsSupport string + +const ( + // GuardrailsSupportPreview - The version is preview. It is not recommended to use preview versions on critical production + // clusters. The preview version may not support all use-cases. + GuardrailsSupportPreview GuardrailsSupport = "Preview" + // GuardrailsSupportStable - The version is stable and can be used on critical production clusters. + GuardrailsSupportStable GuardrailsSupport = "Stable" +) + +// PossibleGuardrailsSupportValues returns the possible values for the GuardrailsSupport const type. +func PossibleGuardrailsSupportValues() []GuardrailsSupport { + return []GuardrailsSupport{ + GuardrailsSupportPreview, + GuardrailsSupportStable, + } +} + +// IPFamily - To determine if address belongs IPv4 or IPv6 family. type IPFamily string const ( + // IPFamilyIPv4 - IPv4 family IPFamilyIPv4 IPFamily = "IPv4" + // IPFamilyIPv6 - IPv6 family IPFamilyIPv6 IPFamily = "IPv6" ) @@ -227,6 +329,24 @@ func PossibleIPFamilyValues() []IPFamily { } } +// IpvsScheduler - IPVS scheduler, for more information please see http://www.linuxvirtualserver.org/docs/scheduling.html. +type IpvsScheduler string + +const ( + // IpvsSchedulerLeastConnection - Least Connection + IpvsSchedulerLeastConnection IpvsScheduler = "LeastConnection" + // IpvsSchedulerRoundRobin - Round Robin + IpvsSchedulerRoundRobin IpvsScheduler = "RoundRobin" +) + +// PossibleIpvsSchedulerValues returns the possible values for the IpvsScheduler const type. +func PossibleIpvsSchedulerValues() []IpvsScheduler { + return []IpvsScheduler{ + IpvsSchedulerLeastConnection, + IpvsSchedulerRoundRobin, + } +} + // IstioIngressGatewayMode - Mode of an ingress gateway. type IstioIngressGatewayMode string @@ -301,6 +421,25 @@ func PossibleKubernetesSupportPlanValues() []KubernetesSupportPlan { } } +// Level - The Safeguards level to be used. By default, Safeguards is enabled for all namespaces except those that AKS excludes +// via systemExcludedNamespaces +type Level string + +const ( + LevelEnforcement Level = "Enforcement" + LevelOff Level = "Off" + LevelWarning Level = "Warning" +) + +// PossibleLevelValues returns the possible values for the Level const type. +func PossibleLevelValues() []Level { + return []Level{ + LevelEnforcement, + LevelOff, + LevelWarning, + } +} + // 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 @@ -369,6 +508,10 @@ func PossibleManagedClusterPodIdentityProvisioningStateValues() []ManagedCluster type ManagedClusterSKUName string const ( + // ManagedClusterSKUNameAutomatic - Automatic clusters are optimized to run most production workloads with configuration that + // follows AKS best practices and recommendations for cluster and workload setup, scalability, and security. For more details + // about Automatic clusters see aka.ms/aks/automatic. + ManagedClusterSKUNameAutomatic ManagedClusterSKUName = "Automatic" // ManagedClusterSKUNameBase - Base option for the AKS control plane. ManagedClusterSKUNameBase ManagedClusterSKUName = "Base" ) @@ -376,6 +519,7 @@ const ( // PossibleManagedClusterSKUNameValues returns the possible values for the ManagedClusterSKUName const type. func PossibleManagedClusterSKUNameValues() []ManagedClusterSKUName { return []ManagedClusterSKUName{ + ManagedClusterSKUNameAutomatic, ManagedClusterSKUNameBase, } } @@ -407,6 +551,24 @@ func PossibleManagedClusterSKUTierValues() []ManagedClusterSKUTier { } } +// Mode - Specify which proxy mode to use ('IPTABLES' or 'IPVS') +type Mode string + +const ( + // ModeIPTABLES - IPTables proxy mode + ModeIPTABLES Mode = "IPTABLES" + // ModeIPVS - IPVS proxy mode. Must be using Kubernetes version >= 1.22. + ModeIPVS Mode = "IPVS" +) + +// PossibleModeValues returns the possible values for the Mode const type. +func PossibleModeValues() []Mode { + return []Mode{ + ModeIPTABLES, + ModeIPVS, + } +} + // NetworkDataplane - Network dataplane used in the Kubernetes cluster. type NetworkDataplane string @@ -455,8 +617,8 @@ const ( // 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" - // NetworkPluginNone - No CNI plugin is pre-installed. See [BYO CNI](https://docs.microsoft.com/en-us/azure/aks/use-byo-cni) - // for more information. + // NetworkPluginNone - Do not use a network plugin. A custom CNI will need to be installed after cluster creation for networking + // functionality. NetworkPluginNone NetworkPlugin = "none" ) @@ -473,8 +635,8 @@ func PossibleNetworkPluginValues() []NetworkPlugin { type NetworkPluginMode string const ( - // NetworkPluginModeOverlay - Used with networkPlugin=azure, pods are given IPs from the PodCIDR address space but use Azure - // Routing Domains rather than Kubenet's method of route tables. For more information visit https://aka.ms/aks/azure-cni-overlay. + // NetworkPluginModeOverlay - Pods are given IPs from the PodCIDR address space but use Azure Routing Domains rather than + // Kubenet reference plugins host-local and bridge. NetworkPluginModeOverlay NetworkPluginMode = "overlay" ) @@ -511,7 +673,7 @@ func PossibleNetworkPolicyValues() []NetworkPolicy { } } -// NodeOSUpgradeChannel - Manner in which the OS on your nodes is updated. The default is NodeImage. +// NodeOSUpgradeChannel - The default is Unmanaged, but may change to either NodeImage or SecurityPatch at GA. type NodeOSUpgradeChannel string const ( @@ -529,10 +691,10 @@ const ( // just in time consumption. NodeOSUpgradeChannelSecurityPatch NodeOSUpgradeChannel = "SecurityPatch" // NodeOSUpgradeChannelUnmanaged - OS updates will be applied automatically through the OS built-in patching infrastructure. - // Newly scaled in machines will be unpatched initially and will be patched at some point by the OS's infrastructure. Behavior - // of this option depends on the OS in question. Ubuntu and Mariner apply security patches through unattended upgrade roughly - // once a day around 06:00 UTC. Windows does not apply security patches automatically and so for them this option is equivalent - // to None till further notice + // Newly scaled in machines will be unpatched initially, and will be patched at some later time by the OS's infrastructure. + // Behavior of this option depends on the OS in question. Ubuntu and Mariner apply security patches through unattended upgrade + // roughly once a day around 06:00 UTC. Windows does not apply security patches automatically and so for them this option + // is equivalent to None till further notice NodeOSUpgradeChannelUnmanaged NodeOSUpgradeChannel = "Unmanaged" ) @@ -546,6 +708,25 @@ func PossibleNodeOSUpgradeChannelValues() []NodeOSUpgradeChannel { } } +// NodeProvisioningMode - Once the mode it set to Auto, it cannot be changed back to Manual. +type NodeProvisioningMode string + +const ( + // NodeProvisioningModeAuto - Nodes are provisioned automatically by AKS using Karpenter. Fixed size Node Pools can still + // be created, but autoscaling Node Pools cannot be. (See aka.ms/aks/nap for more details). + NodeProvisioningModeAuto NodeProvisioningMode = "Auto" + // NodeProvisioningModeManual - Nodes are provisioned manually by the user + NodeProvisioningModeManual NodeProvisioningMode = "Manual" +) + +// PossibleNodeProvisioningModeValues returns the possible values for the NodeProvisioningMode const type. +func PossibleNodeProvisioningModeValues() []NodeProvisioningMode { + return []NodeProvisioningMode{ + NodeProvisioningModeAuto, + NodeProvisioningModeManual, + } +} + // 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]. @@ -570,8 +751,9 @@ func PossibleOSDiskTypeValues() []OSDiskType { } } -// OSSKU - Specifies the OS SKU used by the agent pool. The default is Ubuntu if OSType is Linux. The default is Windows2019 -// when Kubernetes = 1.25 if OSType is Windows. +// OSSKU - Specifies the OS SKU used by the agent pool. If not specified, the default is Ubuntu if OSType=Linux or Windows2019 +// if OSType=Windows. And the default Windows OSSKU will be changed to Windows2022 +// after Windows2019 is deprecated. type OSSKU string const ( @@ -580,6 +762,8 @@ const ( OSSKUAzureLinux OSSKU = "AzureLinux" // OSSKUCBLMariner - Deprecated OSSKU. Microsoft recommends that new deployments choose 'AzureLinux' instead. OSSKUCBLMariner OSSKU = "CBLMariner" + // OSSKUMariner - Deprecated OSSKU. Microsoft recommends that new deployments choose 'AzureLinux' instead. + OSSKUMariner OSSKU = "Mariner" // OSSKUUbuntu - Use Ubuntu as the OS for node images. OSSKUUbuntu OSSKU = "Ubuntu" // OSSKUWindows2019 - Use Windows2019 as the OS for node images. Unsupported for system node pools. Windows2019 only supports @@ -588,6 +772,9 @@ const ( // OSSKUWindows2022 - Use Windows2022 as the OS for node images. Unsupported for system node pools. Windows2022 only supports // Windows2022 containers; it cannot run Windows2019 containers and vice versa. OSSKUWindows2022 OSSKU = "Windows2022" + // OSSKUWindowsAnnual - Use Windows Annual Channel version as the OS for node images. Unsupported for system node pools. Details + // about supported container images and kubernetes versions under different AKS Annual Channel versions could be seen in https://aka.ms/aks/windows-annual-channel-details. + OSSKUWindowsAnnual OSSKU = "WindowsAnnual" ) // PossibleOSSKUValues returns the possible values for the OSSKU const type. @@ -595,9 +782,11 @@ func PossibleOSSKUValues() []OSSKU { return []OSSKU{ OSSKUAzureLinux, OSSKUCBLMariner, + OSSKUMariner, OSSKUUbuntu, OSSKUWindows2019, OSSKUWindows2022, + OSSKUWindowsAnnual, } } @@ -619,6 +808,30 @@ func PossibleOSTypeValues() []OSType { } } +// Operator - operator represents a key's relationship to a set of values. Valid operators are In and NotIn +type Operator string + +const ( + // OperatorDoesNotExist - The value of the key should not exist. + OperatorDoesNotExist Operator = "DoesNotExist" + // OperatorExists - The value of the key should exist. + OperatorExists Operator = "Exists" + // OperatorIn - The value of the key should be in the given list. + OperatorIn Operator = "In" + // OperatorNotIn - The value of the key should not be in the given list. + OperatorNotIn Operator = "NotIn" +) + +// PossibleOperatorValues returns the possible values for the Operator const type. +func PossibleOperatorValues() []Operator { + return []Operator{ + OperatorDoesNotExist, + OperatorExists, + OperatorIn, + OperatorNotIn, + } +} + // 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 @@ -629,6 +842,9 @@ const ( OutboundTypeLoadBalancer OutboundType = "loadBalancer" // OutboundTypeManagedNATGateway - The AKS-managed NAT gateway is used for egress. OutboundTypeManagedNATGateway OutboundType = "managedNATGateway" + // OutboundTypeNone - The AKS cluster is not set with any outbound-type. All AKS nodes follows Azure VM default outbound behavior. + // Please refer to https://azure.microsoft.com/en-us/updates/default-outbound-access-for-vms-in-azure-will-be-retired-transition-to-a-new-method-of-internet-access/ + OutboundTypeNone OutboundType = "none" // 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" @@ -642,11 +858,55 @@ func PossibleOutboundTypeValues() []OutboundType { return []OutboundType{ OutboundTypeLoadBalancer, OutboundTypeManagedNATGateway, + OutboundTypeNone, OutboundTypeUserAssignedNATGateway, OutboundTypeUserDefinedRouting, } } +// PodIPAllocationMode - The IP allocation mode for pods in the agent pool. Must be used with podSubnetId. The default is +// 'DynamicIndividual'. +type PodIPAllocationMode string + +const ( + // PodIPAllocationModeDynamicIndividual - Each pod gets a single IP address assigned. This is better for maximizing a small + // to medium subnet of size /16 or smaller. The Azure CNI cluster with dynamic IP allocation defaults to this mode if the + // customer does not explicitly specify a podIPAllocationMode + PodIPAllocationModeDynamicIndividual PodIPAllocationMode = "DynamicIndividual" + // PodIPAllocationModeStaticBlock - Each node is statically allocated CIDR block(s) of size /28 = 16 IPs per block to satisfy + // the maxPods per node. Number of CIDR blocks >= (maxPods / 16). The block, rather than a single IP, counts against the Azure + // Vnet Private IP limit of 65K. Therefore block mode is suitable for running larger workloads with more than the current + // limit of 65K pods in a cluster. This mode is better suited to scale with larger subnets of /15 or bigger + PodIPAllocationModeStaticBlock PodIPAllocationMode = "StaticBlock" +) + +// PossiblePodIPAllocationModeValues returns the possible values for the PodIPAllocationMode const type. +func PossiblePodIPAllocationModeValues() []PodIPAllocationMode { + return []PodIPAllocationMode{ + PodIPAllocationModeDynamicIndividual, + PodIPAllocationModeStaticBlock, + } +} + +// PodLinkLocalAccess - Defines access to special link local addresses (Azure Instance Metadata Service, aka IMDS) for pods +// with hostNetwork=false. If not specified, the default is 'IMDS'. +type PodLinkLocalAccess string + +const ( + // PodLinkLocalAccessIMDS - Pods with hostNetwork=false can access Azure Instance Metadata Service (IMDS) without restriction. + PodLinkLocalAccessIMDS PodLinkLocalAccess = "IMDS" + // PodLinkLocalAccessNone - Pods with hostNetwork=false cannot access Azure Instance Metadata Service (IMDS). + PodLinkLocalAccessNone PodLinkLocalAccess = "None" +) + +// PossiblePodLinkLocalAccessValues returns the possible values for the PodLinkLocalAccess const type. +func PossiblePodLinkLocalAccessValues() []PodLinkLocalAccess { + return []PodLinkLocalAccess{ + PodLinkLocalAccessIMDS, + PodLinkLocalAccessNone, + } +} + // PrivateEndpointConnectionProvisioningState - The current provisioning state. type PrivateEndpointConnectionProvisioningState string @@ -691,8 +951,12 @@ func PossibleProtocolValues() []Protocol { type PublicNetworkAccess string const ( + // PublicNetworkAccessDisabled - Inbound traffic to managedCluster is disabled, traffic from managedCluster is allowed. PublicNetworkAccessDisabled PublicNetworkAccess = "Disabled" - PublicNetworkAccessEnabled PublicNetworkAccess = "Enabled" + // PublicNetworkAccessEnabled - Inbound/Outbound to the managedCluster is allowed. + PublicNetworkAccessEnabled PublicNetworkAccess = "Enabled" + // PublicNetworkAccessSecuredByPerimeter - Inbound/Outbound traffic is managed by Microsoft.Network/NetworkSecurityPerimeters. + PublicNetworkAccessSecuredByPerimeter PublicNetworkAccess = "SecuredByPerimeter" ) // PossiblePublicNetworkAccessValues returns the possible values for the PublicNetworkAccess const type. @@ -700,6 +964,7 @@ func PossiblePublicNetworkAccessValues() []PublicNetworkAccess { return []PublicNetworkAccess{ PublicNetworkAccessDisabled, PublicNetworkAccessEnabled, + PublicNetworkAccessSecuredByPerimeter, } } @@ -728,6 +993,43 @@ func PossibleResourceIdentityTypeValues() []ResourceIdentityType { } } +// RestrictionLevel - The restriction level applied to the cluster's node resource group +type RestrictionLevel string + +const ( + // RestrictionLevelReadOnly - Only */read RBAC permissions allowed on the managed node resource group + RestrictionLevelReadOnly RestrictionLevel = "ReadOnly" + // RestrictionLevelUnrestricted - All RBAC permissions are allowed on the managed node resource group + RestrictionLevelUnrestricted RestrictionLevel = "Unrestricted" +) + +// PossibleRestrictionLevelValues returns the possible values for the RestrictionLevel const type. +func PossibleRestrictionLevelValues() []RestrictionLevel { + return []RestrictionLevel{ + RestrictionLevelReadOnly, + RestrictionLevelUnrestricted, + } +} + +// SafeguardsSupport - Whether the version is preview or stable. +type SafeguardsSupport string + +const ( + // SafeguardsSupportPreview - The version is preview. It is not recommended to use preview versions on critical production + // clusters. The preview version may not support all use-cases. + SafeguardsSupportPreview SafeguardsSupport = "Preview" + // SafeguardsSupportStable - The version is stable and can be used on critical production clusters. + SafeguardsSupportStable SafeguardsSupport = "Stable" +) + +// PossibleSafeguardsSupportValues returns the possible values for the SafeguardsSupport const type. +func PossibleSafeguardsSupportValues() []SafeguardsSupport { + return []SafeguardsSupport{ + SafeguardsSupportPreview, + SafeguardsSupportStable, + } +} + // 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 @@ -810,6 +1112,8 @@ func PossibleServiceMeshModeValues() []ServiceMeshMode { type SnapshotType string const ( + // SnapshotTypeManagedCluster - The snapshot is a snapshot of a managed cluster. + SnapshotTypeManagedCluster SnapshotType = "ManagedCluster" // SnapshotTypeNodePool - The snapshot is a snapshot of a node pool. SnapshotTypeNodePool SnapshotType = "NodePool" ) @@ -817,6 +1121,7 @@ const ( // PossibleSnapshotTypeValues returns the possible values for the SnapshotType const type. func PossibleSnapshotTypeValues() []SnapshotType { return []SnapshotType{ + SnapshotTypeManagedCluster, SnapshotTypeNodePool, } } @@ -843,19 +1148,19 @@ func PossibleTrustedAccessRoleBindingProvisioningStateValues() []TrustedAccessRo } } -// Type - Specifies on which week of the month the dayOfWeek applies. +// Type - Specifies on which instance of the allowed days specified in daysOfWeek the maintenance occurs. type Type string const ( - // TypeFirst - First week of the month. + // TypeFirst - First. TypeFirst Type = "First" - // TypeFourth - Fourth week of the month. + // TypeFourth - Fourth. TypeFourth Type = "Fourth" - // TypeLast - Last week of the month. + // TypeLast - Last. TypeLast Type = "Last" - // TypeSecond - Second week of the month. + // TypeSecond - Second. TypeSecond Type = "Second" - // TypeThird - Third week of the month. + // TypeThird - Third. TypeThird Type = "Third" ) @@ -870,6 +1175,32 @@ func PossibleTypeValues() []Type { } } +// UndrainableNodeBehavior - Defines the behavior for undrainable nodes during upgrade. The most common cause of undrainable +// nodes is Pod Disruption Budgets (PDBs), but other issues, such as pod termination grace period is +// exceeding the remaining per-node drain timeout or pod is still being in a running state, can also cause undrainable nodes. +type UndrainableNodeBehavior string + +const ( + // UndrainableNodeBehaviorCordon - AKS will cordon the blocked nodes and replace them with surge nodes during upgrade. The + // blocked nodes will be cordoned and replaced by surge nodes. The blocked nodes will have label 'kubernetes.azure.com/upgrade-status:Quarantined'. + // A surge node will be retained for each blocked node. A best-effort attempt will be made to delete all other surge nodes. + // If there are enough surge nodes to replace blocked nodes, then the upgrade operation and the managed cluster will be in + // failed state. Otherwise, the upgrade operation and the managed cluster will be in canceled state. + UndrainableNodeBehaviorCordon UndrainableNodeBehavior = "Cordon" + // UndrainableNodeBehaviorSchedule - AKS will mark the blocked nodes schedulable, but the blocked nodes are not upgraded. + // A best-effort attempt will be made to delete all surge nodes. The upgrade operation and the managed cluster will be in + // failed state if there are any blocked nodes. + UndrainableNodeBehaviorSchedule UndrainableNodeBehavior = "Schedule" +) + +// PossibleUndrainableNodeBehaviorValues returns the possible values for the UndrainableNodeBehavior const type. +func PossibleUndrainableNodeBehaviorValues() []UndrainableNodeBehavior { + return []UndrainableNodeBehavior{ + UndrainableNodeBehaviorCordon, + UndrainableNodeBehaviorSchedule, + } +} + // 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 @@ -936,6 +1267,10 @@ func PossibleWeekDayValues() []WeekDay { type WorkloadRuntime string const ( + // WorkloadRuntimeKataMshvVMIsolation - Nodes can use (Kata + Cloud Hypervisor + Hyper-V) to enable Nested VM-based pods (Preview). + // Due to the use Hyper-V, AKS node OS itself is a nested VM (the root OS) of Hyper-V. Thus it can only be used with VM series + // that support Nested Virtualization such as Dv3 series. + WorkloadRuntimeKataMshvVMIsolation WorkloadRuntime = "KataMshvVmIsolation" // WorkloadRuntimeOCIContainer - Nodes will use Kubelet to run standard OCI container workloads. WorkloadRuntimeOCIContainer WorkloadRuntime = "OCIContainer" // WorkloadRuntimeWasmWasi - Nodes will use Krustlet to run WASM workloads using the WASI provider (Preview). @@ -945,6 +1280,7 @@ const ( // PossibleWorkloadRuntimeValues returns the possible values for the WorkloadRuntime const type. func PossibleWorkloadRuntimeValues() []WorkloadRuntime { return []WorkloadRuntime{ + WorkloadRuntimeKataMshvVMIsolation, WorkloadRuntimeOCIContainer, WorkloadRuntimeWasmWasi, } diff --git a/sdk/resourcemanager/containerservice/armcontainerservice/fake/agentpools_server.go b/sdk/resourcemanager/containerservice/armcontainerservice/fake/agentpools_server.go index fb2f1e20e41a..6379073cfbfe 100644 --- a/sdk/resourcemanager/containerservice/armcontainerservice/fake/agentpools_server.go +++ b/sdk/resourcemanager/containerservice/armcontainerservice/fake/agentpools_server.go @@ -20,6 +20,7 @@ import ( "net/http" "net/url" "regexp" + "strconv" ) // AgentPoolsServer is a fake server for instances of the armcontainerservice.AgentPoolsClient type. @@ -36,6 +37,10 @@ type AgentPoolsServer struct { // HTTP status codes to indicate success: http.StatusAccepted, http.StatusNoContent BeginDelete func(ctx context.Context, resourceGroupName string, resourceName string, agentPoolName string, options *armcontainerservice.AgentPoolsClientBeginDeleteOptions) (resp azfake.PollerResponder[armcontainerservice.AgentPoolsClientDeleteResponse], errResp azfake.ErrorResponder) + // BeginDeleteMachines is the fake for method AgentPoolsClient.BeginDeleteMachines + // HTTP status codes to indicate success: http.StatusAccepted + BeginDeleteMachines func(ctx context.Context, resourceGroupName string, resourceName string, agentPoolName string, machines armcontainerservice.AgentPoolDeleteMachinesParameter, options *armcontainerservice.AgentPoolsClientBeginDeleteMachinesOptions) (resp azfake.PollerResponder[armcontainerservice.AgentPoolsClientDeleteMachinesResponse], errResp azfake.ErrorResponder) + // Get is the fake for method AgentPoolsClient.Get // HTTP status codes to indicate success: http.StatusOK Get func(ctx context.Context, resourceGroupName string, resourceName string, agentPoolName string, options *armcontainerservice.AgentPoolsClientGetOptions) (resp azfake.Responder[armcontainerservice.AgentPoolsClientGetResponse], errResp azfake.ErrorResponder) @@ -66,6 +71,7 @@ func NewAgentPoolsServerTransport(srv *AgentPoolsServer) *AgentPoolsServerTransp beginAbortLatestOperation: newTracker[azfake.PollerResponder[armcontainerservice.AgentPoolsClientAbortLatestOperationResponse]](), beginCreateOrUpdate: newTracker[azfake.PollerResponder[armcontainerservice.AgentPoolsClientCreateOrUpdateResponse]](), beginDelete: newTracker[azfake.PollerResponder[armcontainerservice.AgentPoolsClientDeleteResponse]](), + beginDeleteMachines: newTracker[azfake.PollerResponder[armcontainerservice.AgentPoolsClientDeleteMachinesResponse]](), newListPager: newTracker[azfake.PagerResponder[armcontainerservice.AgentPoolsClientListResponse]](), beginUpgradeNodeImageVersion: newTracker[azfake.PollerResponder[armcontainerservice.AgentPoolsClientUpgradeNodeImageVersionResponse]](), } @@ -78,6 +84,7 @@ type AgentPoolsServerTransport struct { beginAbortLatestOperation *tracker[azfake.PollerResponder[armcontainerservice.AgentPoolsClientAbortLatestOperationResponse]] beginCreateOrUpdate *tracker[azfake.PollerResponder[armcontainerservice.AgentPoolsClientCreateOrUpdateResponse]] beginDelete *tracker[azfake.PollerResponder[armcontainerservice.AgentPoolsClientDeleteResponse]] + beginDeleteMachines *tracker[azfake.PollerResponder[armcontainerservice.AgentPoolsClientDeleteMachinesResponse]] newListPager *tracker[azfake.PagerResponder[armcontainerservice.AgentPoolsClientListResponse]] beginUpgradeNodeImageVersion *tracker[azfake.PollerResponder[armcontainerservice.AgentPoolsClientUpgradeNodeImageVersionResponse]] } @@ -100,6 +107,8 @@ func (a *AgentPoolsServerTransport) Do(req *http.Request) (*http.Response, error resp, err = a.dispatchBeginCreateOrUpdate(req) case "AgentPoolsClient.BeginDelete": resp, err = a.dispatchBeginDelete(req) + case "AgentPoolsClient.BeginDeleteMachines": + resp, err = a.dispatchBeginDeleteMachines(req) case "AgentPoolsClient.Get": resp, err = a.dispatchGet(req) case "AgentPoolsClient.GetAvailableAgentPoolVersions": @@ -197,7 +206,16 @@ func (a *AgentPoolsServerTransport) dispatchBeginCreateOrUpdate(req *http.Reques if err != nil { return nil, err } - respr, errRespr := a.srv.BeginCreateOrUpdate(req.Context(), resourceGroupNameParam, resourceNameParam, agentPoolNameParam, body, nil) + ifMatchParam := getOptional(getHeaderValue(req.Header, "If-Match")) + ifNoneMatchParam := getOptional(getHeaderValue(req.Header, "If-None-Match")) + var options *armcontainerservice.AgentPoolsClientBeginCreateOrUpdateOptions + if ifMatchParam != nil || ifNoneMatchParam != nil { + options = &armcontainerservice.AgentPoolsClientBeginCreateOrUpdateOptions{ + IfMatch: ifMatchParam, + IfNoneMatch: ifNoneMatchParam, + } + } + respr, errRespr := a.srv.BeginCreateOrUpdate(req.Context(), resourceGroupNameParam, resourceNameParam, agentPoolNameParam, body, options) if respErr := server.GetError(errRespr, req); respErr != nil { return nil, respErr } @@ -233,6 +251,7 @@ func (a *AgentPoolsServerTransport) dispatchBeginDelete(req *http.Request) (*htt if matches == nil || len(matches) < 4 { return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) } + qp := req.URL.Query() resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) if err != nil { return nil, err @@ -245,7 +264,23 @@ func (a *AgentPoolsServerTransport) dispatchBeginDelete(req *http.Request) (*htt if err != nil { return nil, err } - respr, errRespr := a.srv.BeginDelete(req.Context(), resourceGroupNameParam, resourceNameParam, agentPoolNameParam, nil) + ignorePodDisruptionBudgetUnescaped, err := url.QueryUnescape(qp.Get("ignore-pod-disruption-budget")) + if err != nil { + return nil, err + } + ignorePodDisruptionBudgetParam, err := parseOptional(ignorePodDisruptionBudgetUnescaped, strconv.ParseBool) + if err != nil { + return nil, err + } + ifMatchParam := getOptional(getHeaderValue(req.Header, "If-Match")) + var options *armcontainerservice.AgentPoolsClientBeginDeleteOptions + if ignorePodDisruptionBudgetParam != nil || ifMatchParam != nil { + options = &armcontainerservice.AgentPoolsClientBeginDeleteOptions{ + IgnorePodDisruptionBudget: ignorePodDisruptionBudgetParam, + IfMatch: ifMatchParam, + } + } + respr, errRespr := a.srv.BeginDelete(req.Context(), resourceGroupNameParam, resourceNameParam, agentPoolNameParam, options) if respErr := server.GetError(errRespr, req); respErr != nil { return nil, respErr } @@ -269,6 +304,58 @@ func (a *AgentPoolsServerTransport) dispatchBeginDelete(req *http.Request) (*htt return resp, nil } +func (a *AgentPoolsServerTransport) dispatchBeginDeleteMachines(req *http.Request) (*http.Response, error) { + if a.srv.BeginDeleteMachines == nil { + return nil, &nonRetriableError{errors.New("fake for method BeginDeleteMachines not implemented")} + } + beginDeleteMachines := a.beginDeleteMachines.get(req) + if beginDeleteMachines == nil { + const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.ContainerService/managedClusters/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/agentPools/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/deleteMachines` + regex := regexp.MustCompile(regexStr) + matches := regex.FindStringSubmatch(req.URL.EscapedPath()) + if matches == nil || len(matches) < 4 { + return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) + } + body, err := server.UnmarshalRequestAsJSON[armcontainerservice.AgentPoolDeleteMachinesParameter](req) + if err != nil { + return nil, err + } + resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) + if err != nil { + return nil, err + } + resourceNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceName")]) + if err != nil { + return nil, err + } + agentPoolNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("agentPoolName")]) + if err != nil { + return nil, err + } + respr, errRespr := a.srv.BeginDeleteMachines(req.Context(), resourceGroupNameParam, resourceNameParam, agentPoolNameParam, body, nil) + if respErr := server.GetError(errRespr, req); respErr != nil { + return nil, respErr + } + beginDeleteMachines = &respr + a.beginDeleteMachines.add(req, beginDeleteMachines) + } + + resp, err := server.PollerResponderNext(beginDeleteMachines, req) + if err != nil { + return nil, err + } + + if !contains([]int{http.StatusAccepted}, resp.StatusCode) { + a.beginDeleteMachines.remove(req) + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusAccepted", resp.StatusCode)} + } + if !server.PollerResponderMore(beginDeleteMachines) { + a.beginDeleteMachines.remove(req) + } + + return resp, nil +} + func (a *AgentPoolsServerTransport) dispatchGet(req *http.Request) (*http.Response, error) { if a.srv.Get == nil { return nil, &nonRetriableError{errors.New("fake for method Get not implemented")} diff --git a/sdk/resourcemanager/containerservice/armcontainerservice/fake/internal.go b/sdk/resourcemanager/containerservice/armcontainerservice/fake/internal.go index 94e060e89dbd..c63abf57927c 100644 --- a/sdk/resourcemanager/containerservice/armcontainerservice/fake/internal.go +++ b/sdk/resourcemanager/containerservice/armcontainerservice/fake/internal.go @@ -32,6 +32,14 @@ func contains[T comparable](s []T, v T) bool { return false } +func getHeaderValue(h http.Header, k string) string { + v := h[k] + if len(v) == 0 { + return "" + } + return v[0] +} + func getOptional[T any](v T) *T { if reflect.ValueOf(v).IsZero() { return nil @@ -39,6 +47,17 @@ func getOptional[T any](v T) *T { return &v } +func parseOptional[T any](v string, parse func(v string) (T, error)) (*T, error) { + if v == "" { + return nil, nil + } + t, err := parse(v) + if err != nil { + return nil, err + } + return &t, err +} + func newTracker[T any]() *tracker[T] { return &tracker[T]{ items: map[string]*T{}, diff --git a/sdk/resourcemanager/containerservice/armcontainerservice/fake/loadbalancers_server.go b/sdk/resourcemanager/containerservice/armcontainerservice/fake/loadbalancers_server.go new file mode 100644 index 000000000000..b652fb89eaf7 --- /dev/null +++ b/sdk/resourcemanager/containerservice/armcontainerservice/fake/loadbalancers_server.go @@ -0,0 +1,259 @@ +//go:build go1.18 +// +build go1.18 + +// 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. DO NOT EDIT. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +package fake + +import ( + "context" + "errors" + "fmt" + azfake "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake/server" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/containerservice/armcontainerservice/v6" + "net/http" + "net/url" + "regexp" +) + +// LoadBalancersServer is a fake server for instances of the armcontainerservice.LoadBalancersClient type. +type LoadBalancersServer struct { + // CreateOrUpdate is the fake for method LoadBalancersClient.CreateOrUpdate + // HTTP status codes to indicate success: http.StatusOK, http.StatusCreated + CreateOrUpdate func(ctx context.Context, resourceGroupName string, resourceName string, loadBalancerName string, parameters armcontainerservice.LoadBalancer, options *armcontainerservice.LoadBalancersClientCreateOrUpdateOptions) (resp azfake.Responder[armcontainerservice.LoadBalancersClientCreateOrUpdateResponse], errResp azfake.ErrorResponder) + + // BeginDelete is the fake for method LoadBalancersClient.BeginDelete + // HTTP status codes to indicate success: http.StatusAccepted, http.StatusNoContent + BeginDelete func(ctx context.Context, resourceGroupName string, resourceName string, loadBalancerName string, options *armcontainerservice.LoadBalancersClientBeginDeleteOptions) (resp azfake.PollerResponder[armcontainerservice.LoadBalancersClientDeleteResponse], errResp azfake.ErrorResponder) + + // Get is the fake for method LoadBalancersClient.Get + // HTTP status codes to indicate success: http.StatusOK + Get func(ctx context.Context, resourceGroupName string, resourceName string, loadBalancerName string, options *armcontainerservice.LoadBalancersClientGetOptions) (resp azfake.Responder[armcontainerservice.LoadBalancersClientGetResponse], errResp azfake.ErrorResponder) + + // NewListByManagedClusterPager is the fake for method LoadBalancersClient.NewListByManagedClusterPager + // HTTP status codes to indicate success: http.StatusOK + NewListByManagedClusterPager func(resourceGroupName string, resourceName string, options *armcontainerservice.LoadBalancersClientListByManagedClusterOptions) (resp azfake.PagerResponder[armcontainerservice.LoadBalancersClientListByManagedClusterResponse]) +} + +// NewLoadBalancersServerTransport creates a new instance of LoadBalancersServerTransport with the provided implementation. +// The returned LoadBalancersServerTransport instance is connected to an instance of armcontainerservice.LoadBalancersClient via the +// azcore.ClientOptions.Transporter field in the client's constructor parameters. +func NewLoadBalancersServerTransport(srv *LoadBalancersServer) *LoadBalancersServerTransport { + return &LoadBalancersServerTransport{ + srv: srv, + beginDelete: newTracker[azfake.PollerResponder[armcontainerservice.LoadBalancersClientDeleteResponse]](), + newListByManagedClusterPager: newTracker[azfake.PagerResponder[armcontainerservice.LoadBalancersClientListByManagedClusterResponse]](), + } +} + +// LoadBalancersServerTransport connects instances of armcontainerservice.LoadBalancersClient to instances of LoadBalancersServer. +// Don't use this type directly, use NewLoadBalancersServerTransport instead. +type LoadBalancersServerTransport struct { + srv *LoadBalancersServer + beginDelete *tracker[azfake.PollerResponder[armcontainerservice.LoadBalancersClientDeleteResponse]] + newListByManagedClusterPager *tracker[azfake.PagerResponder[armcontainerservice.LoadBalancersClientListByManagedClusterResponse]] +} + +// Do implements the policy.Transporter interface for LoadBalancersServerTransport. +func (l *LoadBalancersServerTransport) Do(req *http.Request) (*http.Response, error) { + rawMethod := req.Context().Value(runtime.CtxAPINameKey{}) + method, ok := rawMethod.(string) + if !ok { + return nil, nonRetriableError{errors.New("unable to dispatch request, missing value for CtxAPINameKey")} + } + + var resp *http.Response + var err error + + switch method { + case "LoadBalancersClient.CreateOrUpdate": + resp, err = l.dispatchCreateOrUpdate(req) + case "LoadBalancersClient.BeginDelete": + resp, err = l.dispatchBeginDelete(req) + case "LoadBalancersClient.Get": + resp, err = l.dispatchGet(req) + case "LoadBalancersClient.NewListByManagedClusterPager": + resp, err = l.dispatchNewListByManagedClusterPager(req) + default: + err = fmt.Errorf("unhandled API %s", method) + } + + if err != nil { + return nil, err + } + + return resp, nil +} + +func (l *LoadBalancersServerTransport) dispatchCreateOrUpdate(req *http.Request) (*http.Response, error) { + if l.srv.CreateOrUpdate == nil { + return nil, &nonRetriableError{errors.New("fake for method CreateOrUpdate not implemented")} + } + const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.ContainerService/managedClusters/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/loadBalancers/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)` + regex := regexp.MustCompile(regexStr) + matches := regex.FindStringSubmatch(req.URL.EscapedPath()) + if matches == nil || len(matches) < 4 { + return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) + } + body, err := server.UnmarshalRequestAsJSON[armcontainerservice.LoadBalancer](req) + if err != nil { + return nil, err + } + resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) + if err != nil { + return nil, err + } + resourceNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceName")]) + if err != nil { + return nil, err + } + loadBalancerNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("loadBalancerName")]) + if err != nil { + return nil, err + } + respr, errRespr := l.srv.CreateOrUpdate(req.Context(), resourceGroupNameParam, resourceNameParam, loadBalancerNameParam, body, nil) + if respErr := server.GetError(errRespr, req); respErr != nil { + return nil, respErr + } + respContent := server.GetResponseContent(respr) + if !contains([]int{http.StatusOK, http.StatusCreated}, respContent.HTTPStatus) { + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusCreated", respContent.HTTPStatus)} + } + resp, err := server.MarshalResponseAsJSON(respContent, server.GetResponse(respr).LoadBalancer, req) + if err != nil { + return nil, err + } + return resp, nil +} + +func (l *LoadBalancersServerTransport) dispatchBeginDelete(req *http.Request) (*http.Response, error) { + if l.srv.BeginDelete == nil { + return nil, &nonRetriableError{errors.New("fake for method BeginDelete not implemented")} + } + beginDelete := l.beginDelete.get(req) + if beginDelete == nil { + const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.ContainerService/managedClusters/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/loadBalancers/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)` + regex := regexp.MustCompile(regexStr) + matches := regex.FindStringSubmatch(req.URL.EscapedPath()) + if matches == nil || len(matches) < 4 { + return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) + } + resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) + if err != nil { + return nil, err + } + resourceNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceName")]) + if err != nil { + return nil, err + } + loadBalancerNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("loadBalancerName")]) + if err != nil { + return nil, err + } + respr, errRespr := l.srv.BeginDelete(req.Context(), resourceGroupNameParam, resourceNameParam, loadBalancerNameParam, nil) + if respErr := server.GetError(errRespr, req); respErr != nil { + return nil, respErr + } + beginDelete = &respr + l.beginDelete.add(req, beginDelete) + } + + resp, err := server.PollerResponderNext(beginDelete, req) + if err != nil { + return nil, err + } + + if !contains([]int{http.StatusAccepted, http.StatusNoContent}, resp.StatusCode) { + l.beginDelete.remove(req) + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusAccepted, http.StatusNoContent", resp.StatusCode)} + } + if !server.PollerResponderMore(beginDelete) { + l.beginDelete.remove(req) + } + + return resp, nil +} + +func (l *LoadBalancersServerTransport) dispatchGet(req *http.Request) (*http.Response, error) { + if l.srv.Get == nil { + return nil, &nonRetriableError{errors.New("fake for method Get not implemented")} + } + const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.ContainerService/managedClusters/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/loadBalancers/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)` + regex := regexp.MustCompile(regexStr) + matches := regex.FindStringSubmatch(req.URL.EscapedPath()) + if matches == nil || len(matches) < 4 { + return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) + } + resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) + if err != nil { + return nil, err + } + resourceNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceName")]) + if err != nil { + return nil, err + } + loadBalancerNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("loadBalancerName")]) + if err != nil { + return nil, err + } + respr, errRespr := l.srv.Get(req.Context(), resourceGroupNameParam, resourceNameParam, loadBalancerNameParam, nil) + if respErr := server.GetError(errRespr, req); respErr != nil { + return nil, respErr + } + respContent := server.GetResponseContent(respr) + if !contains([]int{http.StatusOK}, respContent.HTTPStatus) { + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", respContent.HTTPStatus)} + } + resp, err := server.MarshalResponseAsJSON(respContent, server.GetResponse(respr).LoadBalancer, req) + if err != nil { + return nil, err + } + return resp, nil +} + +func (l *LoadBalancersServerTransport) dispatchNewListByManagedClusterPager(req *http.Request) (*http.Response, error) { + if l.srv.NewListByManagedClusterPager == nil { + return nil, &nonRetriableError{errors.New("fake for method NewListByManagedClusterPager not implemented")} + } + newListByManagedClusterPager := l.newListByManagedClusterPager.get(req) + if newListByManagedClusterPager == nil { + const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.ContainerService/managedClusters/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/loadBalancers` + regex := regexp.MustCompile(regexStr) + matches := regex.FindStringSubmatch(req.URL.EscapedPath()) + if matches == nil || len(matches) < 3 { + return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) + } + resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) + if err != nil { + return nil, err + } + resourceNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceName")]) + if err != nil { + return nil, err + } + resp := l.srv.NewListByManagedClusterPager(resourceGroupNameParam, resourceNameParam, nil) + newListByManagedClusterPager = &resp + l.newListByManagedClusterPager.add(req, newListByManagedClusterPager) + server.PagerResponderInjectNextLinks(newListByManagedClusterPager, req, func(page *armcontainerservice.LoadBalancersClientListByManagedClusterResponse, createLink func() string) { + page.NextLink = to.Ptr(createLink()) + }) + } + resp, err := server.PagerResponderNext(newListByManagedClusterPager, req) + if err != nil { + return nil, err + } + if !contains([]int{http.StatusOK}, resp.StatusCode) { + l.newListByManagedClusterPager.remove(req) + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", resp.StatusCode)} + } + if !server.PagerResponderMore(newListByManagedClusterPager) { + l.newListByManagedClusterPager.remove(req) + } + return resp, nil +} diff --git a/sdk/resourcemanager/containerservice/armcontainerservice/fake/machines_server.go b/sdk/resourcemanager/containerservice/armcontainerservice/fake/machines_server.go new file mode 100644 index 000000000000..761b1c6efe91 --- /dev/null +++ b/sdk/resourcemanager/containerservice/armcontainerservice/fake/machines_server.go @@ -0,0 +1,164 @@ +//go:build go1.18 +// +build go1.18 + +// 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. DO NOT EDIT. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +package fake + +import ( + "context" + "errors" + "fmt" + azfake "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake/server" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/containerservice/armcontainerservice/v6" + "net/http" + "net/url" + "regexp" +) + +// MachinesServer is a fake server for instances of the armcontainerservice.MachinesClient type. +type MachinesServer struct { + // Get is the fake for method MachinesClient.Get + // HTTP status codes to indicate success: http.StatusOK + Get func(ctx context.Context, resourceGroupName string, resourceName string, agentPoolName string, machineName string, options *armcontainerservice.MachinesClientGetOptions) (resp azfake.Responder[armcontainerservice.MachinesClientGetResponse], errResp azfake.ErrorResponder) + + // NewListPager is the fake for method MachinesClient.NewListPager + // HTTP status codes to indicate success: http.StatusOK + NewListPager func(resourceGroupName string, resourceName string, agentPoolName string, options *armcontainerservice.MachinesClientListOptions) (resp azfake.PagerResponder[armcontainerservice.MachinesClientListResponse]) +} + +// NewMachinesServerTransport creates a new instance of MachinesServerTransport with the provided implementation. +// The returned MachinesServerTransport instance is connected to an instance of armcontainerservice.MachinesClient via the +// azcore.ClientOptions.Transporter field in the client's constructor parameters. +func NewMachinesServerTransport(srv *MachinesServer) *MachinesServerTransport { + return &MachinesServerTransport{ + srv: srv, + newListPager: newTracker[azfake.PagerResponder[armcontainerservice.MachinesClientListResponse]](), + } +} + +// MachinesServerTransport connects instances of armcontainerservice.MachinesClient to instances of MachinesServer. +// Don't use this type directly, use NewMachinesServerTransport instead. +type MachinesServerTransport struct { + srv *MachinesServer + newListPager *tracker[azfake.PagerResponder[armcontainerservice.MachinesClientListResponse]] +} + +// Do implements the policy.Transporter interface for MachinesServerTransport. +func (m *MachinesServerTransport) Do(req *http.Request) (*http.Response, error) { + rawMethod := req.Context().Value(runtime.CtxAPINameKey{}) + method, ok := rawMethod.(string) + if !ok { + return nil, nonRetriableError{errors.New("unable to dispatch request, missing value for CtxAPINameKey")} + } + + var resp *http.Response + var err error + + switch method { + case "MachinesClient.Get": + resp, err = m.dispatchGet(req) + case "MachinesClient.NewListPager": + resp, err = m.dispatchNewListPager(req) + default: + err = fmt.Errorf("unhandled API %s", method) + } + + if err != nil { + return nil, err + } + + return resp, nil +} + +func (m *MachinesServerTransport) dispatchGet(req *http.Request) (*http.Response, error) { + if m.srv.Get == nil { + return nil, &nonRetriableError{errors.New("fake for method Get not implemented")} + } + const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.ContainerService/managedClusters/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/agentPools/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/machines/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)` + regex := regexp.MustCompile(regexStr) + matches := regex.FindStringSubmatch(req.URL.EscapedPath()) + if matches == nil || len(matches) < 5 { + return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) + } + resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) + if err != nil { + return nil, err + } + resourceNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceName")]) + if err != nil { + return nil, err + } + agentPoolNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("agentPoolName")]) + if err != nil { + return nil, err + } + machineNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("machineName")]) + if err != nil { + return nil, err + } + respr, errRespr := m.srv.Get(req.Context(), resourceGroupNameParam, resourceNameParam, agentPoolNameParam, machineNameParam, nil) + if respErr := server.GetError(errRespr, req); respErr != nil { + return nil, respErr + } + respContent := server.GetResponseContent(respr) + if !contains([]int{http.StatusOK}, respContent.HTTPStatus) { + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", respContent.HTTPStatus)} + } + resp, err := server.MarshalResponseAsJSON(respContent, server.GetResponse(respr).Machine, req) + if err != nil { + return nil, err + } + return resp, nil +} + +func (m *MachinesServerTransport) dispatchNewListPager(req *http.Request) (*http.Response, error) { + if m.srv.NewListPager == nil { + return nil, &nonRetriableError{errors.New("fake for method NewListPager not implemented")} + } + newListPager := m.newListPager.get(req) + if newListPager == nil { + const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.ContainerService/managedClusters/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/agentPools/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/machines` + regex := regexp.MustCompile(regexStr) + matches := regex.FindStringSubmatch(req.URL.EscapedPath()) + if matches == nil || len(matches) < 4 { + return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) + } + resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) + if err != nil { + return nil, err + } + resourceNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceName")]) + if err != nil { + return nil, err + } + agentPoolNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("agentPoolName")]) + if err != nil { + return nil, err + } + resp := m.srv.NewListPager(resourceGroupNameParam, resourceNameParam, agentPoolNameParam, nil) + newListPager = &resp + m.newListPager.add(req, newListPager) + server.PagerResponderInjectNextLinks(newListPager, req, func(page *armcontainerservice.MachinesClientListResponse, createLink func() string) { + page.NextLink = to.Ptr(createLink()) + }) + } + resp, err := server.PagerResponderNext(newListPager, req) + if err != nil { + return nil, err + } + if !contains([]int{http.StatusOK}, resp.StatusCode) { + m.newListPager.remove(req) + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", resp.StatusCode)} + } + if !server.PagerResponderMore(newListPager) { + m.newListPager.remove(req) + } + return resp, nil +} diff --git a/sdk/resourcemanager/containerservice/armcontainerservice/fake/managedclusters_server.go b/sdk/resourcemanager/containerservice/armcontainerservice/fake/managedclusters_server.go index a0fb0cca9869..911ef98c61c1 100644 --- a/sdk/resourcemanager/containerservice/armcontainerservice/fake/managedclusters_server.go +++ b/sdk/resourcemanager/containerservice/armcontainerservice/fake/managedclusters_server.go @@ -20,6 +20,7 @@ import ( "net/http" "net/url" "regexp" + "strconv" ) // ManagedClustersServer is a fake server for instances of the armcontainerservice.ManagedClustersClient type. @@ -48,6 +49,10 @@ type ManagedClustersServer struct { // HTTP status codes to indicate success: http.StatusOK, http.StatusAccepted GetCommandResult func(ctx context.Context, resourceGroupName string, resourceName string, commandID string, options *armcontainerservice.ManagedClustersClientGetCommandResultOptions) (resp azfake.Responder[armcontainerservice.ManagedClustersClientGetCommandResultResponse], errResp azfake.ErrorResponder) + // GetGuardrailsVersions is the fake for method ManagedClustersClient.GetGuardrailsVersions + // HTTP status codes to indicate success: http.StatusOK + GetGuardrailsVersions func(ctx context.Context, location string, version string, options *armcontainerservice.ManagedClustersClientGetGuardrailsVersionsOptions) (resp azfake.Responder[armcontainerservice.ManagedClustersClientGetGuardrailsVersionsResponse], errResp azfake.ErrorResponder) + // GetMeshRevisionProfile is the fake for method ManagedClustersClient.GetMeshRevisionProfile // HTTP status codes to indicate success: http.StatusOK GetMeshRevisionProfile func(ctx context.Context, location string, mode string, options *armcontainerservice.ManagedClustersClientGetMeshRevisionProfileOptions) (resp azfake.Responder[armcontainerservice.ManagedClustersClientGetMeshRevisionProfileResponse], errResp azfake.ErrorResponder) @@ -56,6 +61,10 @@ type ManagedClustersServer struct { // HTTP status codes to indicate success: http.StatusOK GetMeshUpgradeProfile func(ctx context.Context, resourceGroupName string, resourceName string, mode string, options *armcontainerservice.ManagedClustersClientGetMeshUpgradeProfileOptions) (resp azfake.Responder[armcontainerservice.ManagedClustersClientGetMeshUpgradeProfileResponse], errResp azfake.ErrorResponder) + // GetSafeguardsVersions is the fake for method ManagedClustersClient.GetSafeguardsVersions + // HTTP status codes to indicate success: http.StatusOK + GetSafeguardsVersions func(ctx context.Context, location string, version string, options *armcontainerservice.ManagedClustersClientGetSafeguardsVersionsOptions) (resp azfake.Responder[armcontainerservice.ManagedClustersClientGetSafeguardsVersionsResponse], errResp azfake.ErrorResponder) + // GetUpgradeProfile is the fake for method ManagedClustersClient.GetUpgradeProfile // HTTP status codes to indicate success: http.StatusOK GetUpgradeProfile func(ctx context.Context, resourceGroupName string, resourceName string, options *armcontainerservice.ManagedClustersClientGetUpgradeProfileOptions) (resp azfake.Responder[armcontainerservice.ManagedClustersClientGetUpgradeProfileResponse], errResp azfake.ErrorResponder) @@ -80,6 +89,10 @@ type ManagedClustersServer struct { // HTTP status codes to indicate success: http.StatusOK ListClusterUserCredentials func(ctx context.Context, resourceGroupName string, resourceName string, options *armcontainerservice.ManagedClustersClientListClusterUserCredentialsOptions) (resp azfake.Responder[armcontainerservice.ManagedClustersClientListClusterUserCredentialsResponse], errResp azfake.ErrorResponder) + // NewListGuardrailsVersionsPager is the fake for method ManagedClustersClient.NewListGuardrailsVersionsPager + // HTTP status codes to indicate success: http.StatusOK + NewListGuardrailsVersionsPager func(location string, options *armcontainerservice.ManagedClustersClientListGuardrailsVersionsOptions) (resp azfake.PagerResponder[armcontainerservice.ManagedClustersClientListGuardrailsVersionsResponse]) + // ListKubernetesVersions is the fake for method ManagedClustersClient.ListKubernetesVersions // HTTP status codes to indicate success: http.StatusOK ListKubernetesVersions func(ctx context.Context, location string, options *armcontainerservice.ManagedClustersClientListKubernetesVersionsOptions) (resp azfake.Responder[armcontainerservice.ManagedClustersClientListKubernetesVersionsResponse], errResp azfake.ErrorResponder) @@ -96,6 +109,14 @@ type ManagedClustersServer struct { // HTTP status codes to indicate success: http.StatusOK NewListOutboundNetworkDependenciesEndpointsPager func(resourceGroupName string, resourceName string, options *armcontainerservice.ManagedClustersClientListOutboundNetworkDependenciesEndpointsOptions) (resp azfake.PagerResponder[armcontainerservice.ManagedClustersClientListOutboundNetworkDependenciesEndpointsResponse]) + // NewListSafeguardsVersionsPager is the fake for method ManagedClustersClient.NewListSafeguardsVersionsPager + // HTTP status codes to indicate success: http.StatusOK + NewListSafeguardsVersionsPager func(location string, options *armcontainerservice.ManagedClustersClientListSafeguardsVersionsOptions) (resp azfake.PagerResponder[armcontainerservice.ManagedClustersClientListSafeguardsVersionsResponse]) + + // BeginRebalanceLoadBalancers is the fake for method ManagedClustersClient.BeginRebalanceLoadBalancers + // HTTP status codes to indicate success: http.StatusAccepted + BeginRebalanceLoadBalancers func(ctx context.Context, resourceGroupName string, resourceName string, parameters armcontainerservice.RebalanceLoadBalancersRequestBody, options *armcontainerservice.ManagedClustersClientBeginRebalanceLoadBalancersOptions) (resp azfake.PollerResponder[armcontainerservice.ManagedClustersClientRebalanceLoadBalancersResponse], errResp azfake.ErrorResponder) + // BeginResetAADProfile is the fake for method ManagedClustersClient.BeginResetAADProfile // HTTP status codes to indicate success: http.StatusOK, http.StatusAccepted BeginResetAADProfile func(ctx context.Context, resourceGroupName string, resourceName string, parameters armcontainerservice.ManagedClusterAADProfile, options *armcontainerservice.ManagedClustersClientBeginResetAADProfileOptions) (resp azfake.PollerResponder[armcontainerservice.ManagedClustersClientResetAADProfileResponse], errResp azfake.ErrorResponder) @@ -140,9 +161,12 @@ func NewManagedClustersServerTransport(srv *ManagedClustersServer) *ManagedClust beginDelete: newTracker[azfake.PollerResponder[armcontainerservice.ManagedClustersClientDeleteResponse]](), newListPager: newTracker[azfake.PagerResponder[armcontainerservice.ManagedClustersClientListResponse]](), newListByResourceGroupPager: newTracker[azfake.PagerResponder[armcontainerservice.ManagedClustersClientListByResourceGroupResponse]](), + newListGuardrailsVersionsPager: newTracker[azfake.PagerResponder[armcontainerservice.ManagedClustersClientListGuardrailsVersionsResponse]](), newListMeshRevisionProfilesPager: newTracker[azfake.PagerResponder[armcontainerservice.ManagedClustersClientListMeshRevisionProfilesResponse]](), newListMeshUpgradeProfilesPager: newTracker[azfake.PagerResponder[armcontainerservice.ManagedClustersClientListMeshUpgradeProfilesResponse]](), newListOutboundNetworkDependenciesEndpointsPager: newTracker[azfake.PagerResponder[armcontainerservice.ManagedClustersClientListOutboundNetworkDependenciesEndpointsResponse]](), + newListSafeguardsVersionsPager: newTracker[azfake.PagerResponder[armcontainerservice.ManagedClustersClientListSafeguardsVersionsResponse]](), + beginRebalanceLoadBalancers: newTracker[azfake.PollerResponder[armcontainerservice.ManagedClustersClientRebalanceLoadBalancersResponse]](), beginResetAADProfile: newTracker[azfake.PollerResponder[armcontainerservice.ManagedClustersClientResetAADProfileResponse]](), beginResetServicePrincipalProfile: newTracker[azfake.PollerResponder[armcontainerservice.ManagedClustersClientResetServicePrincipalProfileResponse]](), beginRotateClusterCertificates: newTracker[azfake.PollerResponder[armcontainerservice.ManagedClustersClientRotateClusterCertificatesResponse]](), @@ -163,9 +187,12 @@ type ManagedClustersServerTransport struct { beginDelete *tracker[azfake.PollerResponder[armcontainerservice.ManagedClustersClientDeleteResponse]] newListPager *tracker[azfake.PagerResponder[armcontainerservice.ManagedClustersClientListResponse]] newListByResourceGroupPager *tracker[azfake.PagerResponder[armcontainerservice.ManagedClustersClientListByResourceGroupResponse]] + newListGuardrailsVersionsPager *tracker[azfake.PagerResponder[armcontainerservice.ManagedClustersClientListGuardrailsVersionsResponse]] newListMeshRevisionProfilesPager *tracker[azfake.PagerResponder[armcontainerservice.ManagedClustersClientListMeshRevisionProfilesResponse]] newListMeshUpgradeProfilesPager *tracker[azfake.PagerResponder[armcontainerservice.ManagedClustersClientListMeshUpgradeProfilesResponse]] newListOutboundNetworkDependenciesEndpointsPager *tracker[azfake.PagerResponder[armcontainerservice.ManagedClustersClientListOutboundNetworkDependenciesEndpointsResponse]] + newListSafeguardsVersionsPager *tracker[azfake.PagerResponder[armcontainerservice.ManagedClustersClientListSafeguardsVersionsResponse]] + beginRebalanceLoadBalancers *tracker[azfake.PollerResponder[armcontainerservice.ManagedClustersClientRebalanceLoadBalancersResponse]] beginResetAADProfile *tracker[azfake.PollerResponder[armcontainerservice.ManagedClustersClientResetAADProfileResponse]] beginResetServicePrincipalProfile *tracker[azfake.PollerResponder[armcontainerservice.ManagedClustersClientResetServicePrincipalProfileResponse]] beginRotateClusterCertificates *tracker[azfake.PollerResponder[armcontainerservice.ManagedClustersClientRotateClusterCertificatesResponse]] @@ -200,10 +227,14 @@ func (m *ManagedClustersServerTransport) Do(req *http.Request) (*http.Response, resp, err = m.dispatchGetAccessProfile(req) case "ManagedClustersClient.GetCommandResult": resp, err = m.dispatchGetCommandResult(req) + case "ManagedClustersClient.GetGuardrailsVersions": + resp, err = m.dispatchGetGuardrailsVersions(req) case "ManagedClustersClient.GetMeshRevisionProfile": resp, err = m.dispatchGetMeshRevisionProfile(req) case "ManagedClustersClient.GetMeshUpgradeProfile": resp, err = m.dispatchGetMeshUpgradeProfile(req) + case "ManagedClustersClient.GetSafeguardsVersions": + resp, err = m.dispatchGetSafeguardsVersions(req) case "ManagedClustersClient.GetUpgradeProfile": resp, err = m.dispatchGetUpgradeProfile(req) case "ManagedClustersClient.NewListPager": @@ -216,6 +247,8 @@ func (m *ManagedClustersServerTransport) Do(req *http.Request) (*http.Response, resp, err = m.dispatchListClusterMonitoringUserCredentials(req) case "ManagedClustersClient.ListClusterUserCredentials": resp, err = m.dispatchListClusterUserCredentials(req) + case "ManagedClustersClient.NewListGuardrailsVersionsPager": + resp, err = m.dispatchNewListGuardrailsVersionsPager(req) case "ManagedClustersClient.ListKubernetesVersions": resp, err = m.dispatchListKubernetesVersions(req) case "ManagedClustersClient.NewListMeshRevisionProfilesPager": @@ -224,6 +257,10 @@ func (m *ManagedClustersServerTransport) Do(req *http.Request) (*http.Response, resp, err = m.dispatchNewListMeshUpgradeProfilesPager(req) case "ManagedClustersClient.NewListOutboundNetworkDependenciesEndpointsPager": resp, err = m.dispatchNewListOutboundNetworkDependenciesEndpointsPager(req) + case "ManagedClustersClient.NewListSafeguardsVersionsPager": + resp, err = m.dispatchNewListSafeguardsVersionsPager(req) + case "ManagedClustersClient.BeginRebalanceLoadBalancers": + resp, err = m.dispatchBeginRebalanceLoadBalancers(req) case "ManagedClustersClient.BeginResetAADProfile": resp, err = m.dispatchBeginResetAADProfile(req) case "ManagedClustersClient.BeginResetServicePrincipalProfile": @@ -319,7 +356,16 @@ func (m *ManagedClustersServerTransport) dispatchBeginCreateOrUpdate(req *http.R if err != nil { return nil, err } - respr, errRespr := m.srv.BeginCreateOrUpdate(req.Context(), resourceGroupNameParam, resourceNameParam, body, nil) + ifMatchParam := getOptional(getHeaderValue(req.Header, "If-Match")) + ifNoneMatchParam := getOptional(getHeaderValue(req.Header, "If-None-Match")) + var options *armcontainerservice.ManagedClustersClientBeginCreateOrUpdateOptions + if ifMatchParam != nil || ifNoneMatchParam != nil { + options = &armcontainerservice.ManagedClustersClientBeginCreateOrUpdateOptions{ + IfMatch: ifMatchParam, + IfNoneMatch: ifNoneMatchParam, + } + } + respr, errRespr := m.srv.BeginCreateOrUpdate(req.Context(), resourceGroupNameParam, resourceNameParam, body, options) if respErr := server.GetError(errRespr, req); respErr != nil { return nil, respErr } @@ -355,6 +401,7 @@ func (m *ManagedClustersServerTransport) dispatchBeginDelete(req *http.Request) if matches == nil || len(matches) < 3 { return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) } + qp := req.URL.Query() resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) if err != nil { return nil, err @@ -363,7 +410,23 @@ func (m *ManagedClustersServerTransport) dispatchBeginDelete(req *http.Request) if err != nil { return nil, err } - respr, errRespr := m.srv.BeginDelete(req.Context(), resourceGroupNameParam, resourceNameParam, nil) + ignorePodDisruptionBudgetUnescaped, err := url.QueryUnescape(qp.Get("ignore-pod-disruption-budget")) + if err != nil { + return nil, err + } + ignorePodDisruptionBudgetParam, err := parseOptional(ignorePodDisruptionBudgetUnescaped, strconv.ParseBool) + if err != nil { + return nil, err + } + ifMatchParam := getOptional(getHeaderValue(req.Header, "If-Match")) + var options *armcontainerservice.ManagedClustersClientBeginDeleteOptions + if ignorePodDisruptionBudgetParam != nil || ifMatchParam != nil { + options = &armcontainerservice.ManagedClustersClientBeginDeleteOptions{ + IgnorePodDisruptionBudget: ignorePodDisruptionBudgetParam, + IfMatch: ifMatchParam, + } + } + respr, errRespr := m.srv.BeginDelete(req.Context(), resourceGroupNameParam, resourceNameParam, options) if respErr := server.GetError(errRespr, req); respErr != nil { return nil, respErr } @@ -497,6 +560,39 @@ func (m *ManagedClustersServerTransport) dispatchGetCommandResult(req *http.Requ return resp, nil } +func (m *ManagedClustersServerTransport) dispatchGetGuardrailsVersions(req *http.Request) (*http.Response, error) { + if m.srv.GetGuardrailsVersions == nil { + return nil, &nonRetriableError{errors.New("fake for method GetGuardrailsVersions not implemented")} + } + const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.ContainerService/locations/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/guardrailsVersions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)` + regex := regexp.MustCompile(regexStr) + matches := regex.FindStringSubmatch(req.URL.EscapedPath()) + if matches == nil || len(matches) < 3 { + return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) + } + locationParam, err := url.PathUnescape(matches[regex.SubexpIndex("location")]) + if err != nil { + return nil, err + } + versionParam, err := url.PathUnescape(matches[regex.SubexpIndex("version")]) + if err != nil { + return nil, err + } + respr, errRespr := m.srv.GetGuardrailsVersions(req.Context(), locationParam, versionParam, nil) + if respErr := server.GetError(errRespr, req); respErr != nil { + return nil, respErr + } + respContent := server.GetResponseContent(respr) + if !contains([]int{http.StatusOK}, respContent.HTTPStatus) { + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", respContent.HTTPStatus)} + } + resp, err := server.MarshalResponseAsJSON(respContent, server.GetResponse(respr).GuardrailsAvailableVersion, req) + if err != nil { + return nil, err + } + return resp, nil +} + func (m *ManagedClustersServerTransport) dispatchGetMeshRevisionProfile(req *http.Request) (*http.Response, error) { if m.srv.GetMeshRevisionProfile == nil { return nil, &nonRetriableError{errors.New("fake for method GetMeshRevisionProfile not implemented")} @@ -567,6 +663,39 @@ func (m *ManagedClustersServerTransport) dispatchGetMeshUpgradeProfile(req *http return resp, nil } +func (m *ManagedClustersServerTransport) dispatchGetSafeguardsVersions(req *http.Request) (*http.Response, error) { + if m.srv.GetSafeguardsVersions == nil { + return nil, &nonRetriableError{errors.New("fake for method GetSafeguardsVersions not implemented")} + } + const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.ContainerService/locations/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/safeguardsVersions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)` + regex := regexp.MustCompile(regexStr) + matches := regex.FindStringSubmatch(req.URL.EscapedPath()) + if matches == nil || len(matches) < 3 { + return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) + } + locationParam, err := url.PathUnescape(matches[regex.SubexpIndex("location")]) + if err != nil { + return nil, err + } + versionParam, err := url.PathUnescape(matches[regex.SubexpIndex("version")]) + if err != nil { + return nil, err + } + respr, errRespr := m.srv.GetSafeguardsVersions(req.Context(), locationParam, versionParam, nil) + if respErr := server.GetError(errRespr, req); respErr != nil { + return nil, respErr + } + respContent := server.GetResponseContent(respr) + if !contains([]int{http.StatusOK}, respContent.HTTPStatus) { + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", respContent.HTTPStatus)} + } + resp, err := server.MarshalResponseAsJSON(respContent, server.GetResponse(respr).SafeguardsAvailableVersion, req) + if err != nil { + return nil, err + } + return resp, nil +} + func (m *ManagedClustersServerTransport) dispatchGetUpgradeProfile(req *http.Request) (*http.Response, error) { if m.srv.GetUpgradeProfile == nil { return nil, &nonRetriableError{errors.New("fake for method GetUpgradeProfile not implemented")} @@ -811,6 +940,43 @@ func (m *ManagedClustersServerTransport) dispatchListClusterUserCredentials(req return resp, nil } +func (m *ManagedClustersServerTransport) dispatchNewListGuardrailsVersionsPager(req *http.Request) (*http.Response, error) { + if m.srv.NewListGuardrailsVersionsPager == nil { + return nil, &nonRetriableError{errors.New("fake for method NewListGuardrailsVersionsPager not implemented")} + } + newListGuardrailsVersionsPager := m.newListGuardrailsVersionsPager.get(req) + if newListGuardrailsVersionsPager == nil { + const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.ContainerService/locations/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/guardrailsVersions` + regex := regexp.MustCompile(regexStr) + matches := regex.FindStringSubmatch(req.URL.EscapedPath()) + if matches == nil || len(matches) < 2 { + return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) + } + locationParam, err := url.PathUnescape(matches[regex.SubexpIndex("location")]) + if err != nil { + return nil, err + } + resp := m.srv.NewListGuardrailsVersionsPager(locationParam, nil) + newListGuardrailsVersionsPager = &resp + m.newListGuardrailsVersionsPager.add(req, newListGuardrailsVersionsPager) + server.PagerResponderInjectNextLinks(newListGuardrailsVersionsPager, req, func(page *armcontainerservice.ManagedClustersClientListGuardrailsVersionsResponse, createLink func() string) { + page.NextLink = to.Ptr(createLink()) + }) + } + resp, err := server.PagerResponderNext(newListGuardrailsVersionsPager, req) + if err != nil { + return nil, err + } + if !contains([]int{http.StatusOK}, resp.StatusCode) { + m.newListGuardrailsVersionsPager.remove(req) + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", resp.StatusCode)} + } + if !server.PagerResponderMore(newListGuardrailsVersionsPager) { + m.newListGuardrailsVersionsPager.remove(req) + } + return resp, nil +} + func (m *ManagedClustersServerTransport) dispatchListKubernetesVersions(req *http.Request) (*http.Response, error) { if m.srv.ListKubernetesVersions == nil { return nil, &nonRetriableError{errors.New("fake for method ListKubernetesVersions not implemented")} @@ -959,6 +1125,91 @@ func (m *ManagedClustersServerTransport) dispatchNewListOutboundNetworkDependenc return resp, nil } +func (m *ManagedClustersServerTransport) dispatchNewListSafeguardsVersionsPager(req *http.Request) (*http.Response, error) { + if m.srv.NewListSafeguardsVersionsPager == nil { + return nil, &nonRetriableError{errors.New("fake for method NewListSafeguardsVersionsPager not implemented")} + } + newListSafeguardsVersionsPager := m.newListSafeguardsVersionsPager.get(req) + if newListSafeguardsVersionsPager == nil { + const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.ContainerService/locations/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/safeguardsVersions` + regex := regexp.MustCompile(regexStr) + matches := regex.FindStringSubmatch(req.URL.EscapedPath()) + if matches == nil || len(matches) < 2 { + return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) + } + locationParam, err := url.PathUnescape(matches[regex.SubexpIndex("location")]) + if err != nil { + return nil, err + } + resp := m.srv.NewListSafeguardsVersionsPager(locationParam, nil) + newListSafeguardsVersionsPager = &resp + m.newListSafeguardsVersionsPager.add(req, newListSafeguardsVersionsPager) + server.PagerResponderInjectNextLinks(newListSafeguardsVersionsPager, req, func(page *armcontainerservice.ManagedClustersClientListSafeguardsVersionsResponse, createLink func() string) { + page.NextLink = to.Ptr(createLink()) + }) + } + resp, err := server.PagerResponderNext(newListSafeguardsVersionsPager, req) + if err != nil { + return nil, err + } + if !contains([]int{http.StatusOK}, resp.StatusCode) { + m.newListSafeguardsVersionsPager.remove(req) + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", resp.StatusCode)} + } + if !server.PagerResponderMore(newListSafeguardsVersionsPager) { + m.newListSafeguardsVersionsPager.remove(req) + } + return resp, nil +} + +func (m *ManagedClustersServerTransport) dispatchBeginRebalanceLoadBalancers(req *http.Request) (*http.Response, error) { + if m.srv.BeginRebalanceLoadBalancers == nil { + return nil, &nonRetriableError{errors.New("fake for method BeginRebalanceLoadBalancers not implemented")} + } + beginRebalanceLoadBalancers := m.beginRebalanceLoadBalancers.get(req) + if beginRebalanceLoadBalancers == nil { + const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.ContainerService/managedClusters/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/rebalanceLoadBalancers` + regex := regexp.MustCompile(regexStr) + matches := regex.FindStringSubmatch(req.URL.EscapedPath()) + if matches == nil || len(matches) < 3 { + return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) + } + body, err := server.UnmarshalRequestAsJSON[armcontainerservice.RebalanceLoadBalancersRequestBody](req) + if err != nil { + return nil, err + } + resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) + if err != nil { + return nil, err + } + resourceNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceName")]) + if err != nil { + return nil, err + } + respr, errRespr := m.srv.BeginRebalanceLoadBalancers(req.Context(), resourceGroupNameParam, resourceNameParam, body, nil) + if respErr := server.GetError(errRespr, req); respErr != nil { + return nil, respErr + } + beginRebalanceLoadBalancers = &respr + m.beginRebalanceLoadBalancers.add(req, beginRebalanceLoadBalancers) + } + + resp, err := server.PollerResponderNext(beginRebalanceLoadBalancers, req) + if err != nil { + return nil, err + } + + if !contains([]int{http.StatusAccepted}, resp.StatusCode) { + m.beginRebalanceLoadBalancers.remove(req) + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusAccepted", resp.StatusCode)} + } + if !server.PollerResponderMore(beginRebalanceLoadBalancers) { + m.beginRebalanceLoadBalancers.remove(req) + } + + return resp, nil +} + func (m *ManagedClustersServerTransport) dispatchBeginResetAADProfile(req *http.Request) (*http.Response, error) { if m.srv.BeginResetAADProfile == nil { return nil, &nonRetriableError{errors.New("fake for method BeginResetAADProfile not implemented")} @@ -1303,7 +1554,14 @@ func (m *ManagedClustersServerTransport) dispatchBeginUpdateTags(req *http.Reque if err != nil { return nil, err } - respr, errRespr := m.srv.BeginUpdateTags(req.Context(), resourceGroupNameParam, resourceNameParam, body, nil) + ifMatchParam := getOptional(getHeaderValue(req.Header, "If-Match")) + var options *armcontainerservice.ManagedClustersClientBeginUpdateTagsOptions + if ifMatchParam != nil { + options = &armcontainerservice.ManagedClustersClientBeginUpdateTagsOptions{ + IfMatch: ifMatchParam, + } + } + respr, errRespr := m.srv.BeginUpdateTags(req.Context(), resourceGroupNameParam, resourceNameParam, body, options) if respErr := server.GetError(errRespr, req); respErr != nil { return nil, respErr } diff --git a/sdk/resourcemanager/containerservice/armcontainerservice/fake/managedclustersnapshots_server.go b/sdk/resourcemanager/containerservice/armcontainerservice/fake/managedclustersnapshots_server.go new file mode 100644 index 000000000000..f7d18b348d3b --- /dev/null +++ b/sdk/resourcemanager/containerservice/armcontainerservice/fake/managedclustersnapshots_server.go @@ -0,0 +1,314 @@ +//go:build go1.18 +// +build go1.18 + +// 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. DO NOT EDIT. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +package fake + +import ( + "context" + "errors" + "fmt" + azfake "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake/server" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/containerservice/armcontainerservice/v6" + "net/http" + "net/url" + "regexp" +) + +// ManagedClusterSnapshotsServer is a fake server for instances of the armcontainerservice.ManagedClusterSnapshotsClient type. +type ManagedClusterSnapshotsServer struct { + // CreateOrUpdate is the fake for method ManagedClusterSnapshotsClient.CreateOrUpdate + // HTTP status codes to indicate success: http.StatusOK, http.StatusCreated + CreateOrUpdate func(ctx context.Context, resourceGroupName string, resourceName string, parameters armcontainerservice.ManagedClusterSnapshot, options *armcontainerservice.ManagedClusterSnapshotsClientCreateOrUpdateOptions) (resp azfake.Responder[armcontainerservice.ManagedClusterSnapshotsClientCreateOrUpdateResponse], errResp azfake.ErrorResponder) + + // Delete is the fake for method ManagedClusterSnapshotsClient.Delete + // HTTP status codes to indicate success: http.StatusOK, http.StatusNoContent + Delete func(ctx context.Context, resourceGroupName string, resourceName string, options *armcontainerservice.ManagedClusterSnapshotsClientDeleteOptions) (resp azfake.Responder[armcontainerservice.ManagedClusterSnapshotsClientDeleteResponse], errResp azfake.ErrorResponder) + + // Get is the fake for method ManagedClusterSnapshotsClient.Get + // HTTP status codes to indicate success: http.StatusOK + Get func(ctx context.Context, resourceGroupName string, resourceName string, options *armcontainerservice.ManagedClusterSnapshotsClientGetOptions) (resp azfake.Responder[armcontainerservice.ManagedClusterSnapshotsClientGetResponse], errResp azfake.ErrorResponder) + + // NewListPager is the fake for method ManagedClusterSnapshotsClient.NewListPager + // HTTP status codes to indicate success: http.StatusOK + NewListPager func(options *armcontainerservice.ManagedClusterSnapshotsClientListOptions) (resp azfake.PagerResponder[armcontainerservice.ManagedClusterSnapshotsClientListResponse]) + + // NewListByResourceGroupPager is the fake for method ManagedClusterSnapshotsClient.NewListByResourceGroupPager + // HTTP status codes to indicate success: http.StatusOK + NewListByResourceGroupPager func(resourceGroupName string, options *armcontainerservice.ManagedClusterSnapshotsClientListByResourceGroupOptions) (resp azfake.PagerResponder[armcontainerservice.ManagedClusterSnapshotsClientListByResourceGroupResponse]) + + // UpdateTags is the fake for method ManagedClusterSnapshotsClient.UpdateTags + // HTTP status codes to indicate success: http.StatusOK + UpdateTags func(ctx context.Context, resourceGroupName string, resourceName string, parameters armcontainerservice.TagsObject, options *armcontainerservice.ManagedClusterSnapshotsClientUpdateTagsOptions) (resp azfake.Responder[armcontainerservice.ManagedClusterSnapshotsClientUpdateTagsResponse], errResp azfake.ErrorResponder) +} + +// NewManagedClusterSnapshotsServerTransport creates a new instance of ManagedClusterSnapshotsServerTransport with the provided implementation. +// The returned ManagedClusterSnapshotsServerTransport instance is connected to an instance of armcontainerservice.ManagedClusterSnapshotsClient via the +// azcore.ClientOptions.Transporter field in the client's constructor parameters. +func NewManagedClusterSnapshotsServerTransport(srv *ManagedClusterSnapshotsServer) *ManagedClusterSnapshotsServerTransport { + return &ManagedClusterSnapshotsServerTransport{ + srv: srv, + newListPager: newTracker[azfake.PagerResponder[armcontainerservice.ManagedClusterSnapshotsClientListResponse]](), + newListByResourceGroupPager: newTracker[azfake.PagerResponder[armcontainerservice.ManagedClusterSnapshotsClientListByResourceGroupResponse]](), + } +} + +// ManagedClusterSnapshotsServerTransport connects instances of armcontainerservice.ManagedClusterSnapshotsClient to instances of ManagedClusterSnapshotsServer. +// Don't use this type directly, use NewManagedClusterSnapshotsServerTransport instead. +type ManagedClusterSnapshotsServerTransport struct { + srv *ManagedClusterSnapshotsServer + newListPager *tracker[azfake.PagerResponder[armcontainerservice.ManagedClusterSnapshotsClientListResponse]] + newListByResourceGroupPager *tracker[azfake.PagerResponder[armcontainerservice.ManagedClusterSnapshotsClientListByResourceGroupResponse]] +} + +// Do implements the policy.Transporter interface for ManagedClusterSnapshotsServerTransport. +func (m *ManagedClusterSnapshotsServerTransport) Do(req *http.Request) (*http.Response, error) { + rawMethod := req.Context().Value(runtime.CtxAPINameKey{}) + method, ok := rawMethod.(string) + if !ok { + return nil, nonRetriableError{errors.New("unable to dispatch request, missing value for CtxAPINameKey")} + } + + var resp *http.Response + var err error + + switch method { + case "ManagedClusterSnapshotsClient.CreateOrUpdate": + resp, err = m.dispatchCreateOrUpdate(req) + case "ManagedClusterSnapshotsClient.Delete": + resp, err = m.dispatchDelete(req) + case "ManagedClusterSnapshotsClient.Get": + resp, err = m.dispatchGet(req) + case "ManagedClusterSnapshotsClient.NewListPager": + resp, err = m.dispatchNewListPager(req) + case "ManagedClusterSnapshotsClient.NewListByResourceGroupPager": + resp, err = m.dispatchNewListByResourceGroupPager(req) + case "ManagedClusterSnapshotsClient.UpdateTags": + resp, err = m.dispatchUpdateTags(req) + default: + err = fmt.Errorf("unhandled API %s", method) + } + + if err != nil { + return nil, err + } + + return resp, nil +} + +func (m *ManagedClusterSnapshotsServerTransport) dispatchCreateOrUpdate(req *http.Request) (*http.Response, error) { + if m.srv.CreateOrUpdate == nil { + return nil, &nonRetriableError{errors.New("fake for method CreateOrUpdate not implemented")} + } + const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.ContainerService/managedclustersnapshots/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)` + regex := regexp.MustCompile(regexStr) + matches := regex.FindStringSubmatch(req.URL.EscapedPath()) + if matches == nil || len(matches) < 3 { + return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) + } + body, err := server.UnmarshalRequestAsJSON[armcontainerservice.ManagedClusterSnapshot](req) + if err != nil { + return nil, err + } + resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) + if err != nil { + return nil, err + } + resourceNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceName")]) + if err != nil { + return nil, err + } + respr, errRespr := m.srv.CreateOrUpdate(req.Context(), resourceGroupNameParam, resourceNameParam, body, nil) + if respErr := server.GetError(errRespr, req); respErr != nil { + return nil, respErr + } + respContent := server.GetResponseContent(respr) + if !contains([]int{http.StatusOK, http.StatusCreated}, respContent.HTTPStatus) { + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusCreated", respContent.HTTPStatus)} + } + resp, err := server.MarshalResponseAsJSON(respContent, server.GetResponse(respr).ManagedClusterSnapshot, req) + if err != nil { + return nil, err + } + return resp, nil +} + +func (m *ManagedClusterSnapshotsServerTransport) dispatchDelete(req *http.Request) (*http.Response, error) { + if m.srv.Delete == nil { + return nil, &nonRetriableError{errors.New("fake for method Delete not implemented")} + } + const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.ContainerService/managedclustersnapshots/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)` + regex := regexp.MustCompile(regexStr) + matches := regex.FindStringSubmatch(req.URL.EscapedPath()) + if matches == nil || len(matches) < 3 { + return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) + } + resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) + if err != nil { + return nil, err + } + resourceNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceName")]) + if err != nil { + return nil, err + } + respr, errRespr := m.srv.Delete(req.Context(), resourceGroupNameParam, resourceNameParam, nil) + if respErr := server.GetError(errRespr, req); respErr != nil { + return nil, respErr + } + respContent := server.GetResponseContent(respr) + if !contains([]int{http.StatusOK, http.StatusNoContent}, respContent.HTTPStatus) { + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusNoContent", respContent.HTTPStatus)} + } + resp, err := server.NewResponse(respContent, req, nil) + if err != nil { + return nil, err + } + return resp, nil +} + +func (m *ManagedClusterSnapshotsServerTransport) dispatchGet(req *http.Request) (*http.Response, error) { + if m.srv.Get == nil { + return nil, &nonRetriableError{errors.New("fake for method Get not implemented")} + } + const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.ContainerService/managedclustersnapshots/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)` + regex := regexp.MustCompile(regexStr) + matches := regex.FindStringSubmatch(req.URL.EscapedPath()) + if matches == nil || len(matches) < 3 { + return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) + } + resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) + if err != nil { + return nil, err + } + resourceNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceName")]) + if err != nil { + return nil, err + } + respr, errRespr := m.srv.Get(req.Context(), resourceGroupNameParam, resourceNameParam, nil) + if respErr := server.GetError(errRespr, req); respErr != nil { + return nil, respErr + } + respContent := server.GetResponseContent(respr) + if !contains([]int{http.StatusOK}, respContent.HTTPStatus) { + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", respContent.HTTPStatus)} + } + resp, err := server.MarshalResponseAsJSON(respContent, server.GetResponse(respr).ManagedClusterSnapshot, req) + if err != nil { + return nil, err + } + return resp, nil +} + +func (m *ManagedClusterSnapshotsServerTransport) dispatchNewListPager(req *http.Request) (*http.Response, error) { + if m.srv.NewListPager == nil { + return nil, &nonRetriableError{errors.New("fake for method NewListPager not implemented")} + } + newListPager := m.newListPager.get(req) + if newListPager == nil { + const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.ContainerService/managedclustersnapshots` + regex := regexp.MustCompile(regexStr) + matches := regex.FindStringSubmatch(req.URL.EscapedPath()) + if matches == nil || len(matches) < 1 { + return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) + } + resp := m.srv.NewListPager(nil) + newListPager = &resp + m.newListPager.add(req, newListPager) + server.PagerResponderInjectNextLinks(newListPager, req, func(page *armcontainerservice.ManagedClusterSnapshotsClientListResponse, createLink func() string) { + page.NextLink = to.Ptr(createLink()) + }) + } + resp, err := server.PagerResponderNext(newListPager, req) + if err != nil { + return nil, err + } + if !contains([]int{http.StatusOK}, resp.StatusCode) { + m.newListPager.remove(req) + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", resp.StatusCode)} + } + if !server.PagerResponderMore(newListPager) { + m.newListPager.remove(req) + } + return resp, nil +} + +func (m *ManagedClusterSnapshotsServerTransport) dispatchNewListByResourceGroupPager(req *http.Request) (*http.Response, error) { + if m.srv.NewListByResourceGroupPager == nil { + return nil, &nonRetriableError{errors.New("fake for method NewListByResourceGroupPager not implemented")} + } + newListByResourceGroupPager := m.newListByResourceGroupPager.get(req) + if newListByResourceGroupPager == nil { + const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.ContainerService/managedclustersnapshots` + regex := regexp.MustCompile(regexStr) + matches := regex.FindStringSubmatch(req.URL.EscapedPath()) + if matches == nil || len(matches) < 2 { + return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) + } + resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) + if err != nil { + return nil, err + } + resp := m.srv.NewListByResourceGroupPager(resourceGroupNameParam, nil) + newListByResourceGroupPager = &resp + m.newListByResourceGroupPager.add(req, newListByResourceGroupPager) + server.PagerResponderInjectNextLinks(newListByResourceGroupPager, req, func(page *armcontainerservice.ManagedClusterSnapshotsClientListByResourceGroupResponse, createLink func() string) { + page.NextLink = to.Ptr(createLink()) + }) + } + resp, err := server.PagerResponderNext(newListByResourceGroupPager, req) + if err != nil { + return nil, err + } + if !contains([]int{http.StatusOK}, resp.StatusCode) { + m.newListByResourceGroupPager.remove(req) + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", resp.StatusCode)} + } + if !server.PagerResponderMore(newListByResourceGroupPager) { + m.newListByResourceGroupPager.remove(req) + } + return resp, nil +} + +func (m *ManagedClusterSnapshotsServerTransport) dispatchUpdateTags(req *http.Request) (*http.Response, error) { + if m.srv.UpdateTags == nil { + return nil, &nonRetriableError{errors.New("fake for method UpdateTags not implemented")} + } + const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.ContainerService/managedclustersnapshots/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)` + regex := regexp.MustCompile(regexStr) + matches := regex.FindStringSubmatch(req.URL.EscapedPath()) + if matches == nil || len(matches) < 3 { + return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) + } + body, err := server.UnmarshalRequestAsJSON[armcontainerservice.TagsObject](req) + if err != nil { + return nil, err + } + resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) + if err != nil { + return nil, err + } + resourceNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceName")]) + if err != nil { + return nil, err + } + respr, errRespr := m.srv.UpdateTags(req.Context(), resourceGroupNameParam, resourceNameParam, body, nil) + if respErr := server.GetError(errRespr, req); respErr != nil { + return nil, respErr + } + respContent := server.GetResponseContent(respr) + if !contains([]int{http.StatusOK}, respContent.HTTPStatus) { + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", respContent.HTTPStatus)} + } + resp, err := server.MarshalResponseAsJSON(respContent, server.GetResponse(respr).ManagedClusterSnapshot, req) + if err != nil { + return nil, err + } + return resp, nil +} diff --git a/sdk/resourcemanager/containerservice/armcontainerservice/fake/operationstatusresult_server.go b/sdk/resourcemanager/containerservice/armcontainerservice/fake/operationstatusresult_server.go new file mode 100644 index 000000000000..47317d1fe7ae --- /dev/null +++ b/sdk/resourcemanager/containerservice/armcontainerservice/fake/operationstatusresult_server.go @@ -0,0 +1,203 @@ +//go:build go1.18 +// +build go1.18 + +// 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. DO NOT EDIT. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +package fake + +import ( + "context" + "errors" + "fmt" + azfake "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake/server" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/containerservice/armcontainerservice/v6" + "net/http" + "net/url" + "regexp" +) + +// OperationStatusResultServer is a fake server for instances of the armcontainerservice.OperationStatusResultClient type. +type OperationStatusResultServer struct { + // Get is the fake for method OperationStatusResultClient.Get + // HTTP status codes to indicate success: http.StatusOK + Get func(ctx context.Context, resourceGroupName string, resourceName string, operationID string, options *armcontainerservice.OperationStatusResultClientGetOptions) (resp azfake.Responder[armcontainerservice.OperationStatusResultClientGetResponse], errResp azfake.ErrorResponder) + + // GetByAgentPool is the fake for method OperationStatusResultClient.GetByAgentPool + // HTTP status codes to indicate success: http.StatusOK + GetByAgentPool func(ctx context.Context, resourceGroupName string, resourceName string, agentPoolName string, operationID string, options *armcontainerservice.OperationStatusResultClientGetByAgentPoolOptions) (resp azfake.Responder[armcontainerservice.OperationStatusResultClientGetByAgentPoolResponse], errResp azfake.ErrorResponder) + + // NewListPager is the fake for method OperationStatusResultClient.NewListPager + // HTTP status codes to indicate success: http.StatusOK + NewListPager func(resourceGroupName string, resourceName string, options *armcontainerservice.OperationStatusResultClientListOptions) (resp azfake.PagerResponder[armcontainerservice.OperationStatusResultClientListResponse]) +} + +// NewOperationStatusResultServerTransport creates a new instance of OperationStatusResultServerTransport with the provided implementation. +// The returned OperationStatusResultServerTransport instance is connected to an instance of armcontainerservice.OperationStatusResultClient via the +// azcore.ClientOptions.Transporter field in the client's constructor parameters. +func NewOperationStatusResultServerTransport(srv *OperationStatusResultServer) *OperationStatusResultServerTransport { + return &OperationStatusResultServerTransport{ + srv: srv, + newListPager: newTracker[azfake.PagerResponder[armcontainerservice.OperationStatusResultClientListResponse]](), + } +} + +// OperationStatusResultServerTransport connects instances of armcontainerservice.OperationStatusResultClient to instances of OperationStatusResultServer. +// Don't use this type directly, use NewOperationStatusResultServerTransport instead. +type OperationStatusResultServerTransport struct { + srv *OperationStatusResultServer + newListPager *tracker[azfake.PagerResponder[armcontainerservice.OperationStatusResultClientListResponse]] +} + +// Do implements the policy.Transporter interface for OperationStatusResultServerTransport. +func (o *OperationStatusResultServerTransport) Do(req *http.Request) (*http.Response, error) { + rawMethod := req.Context().Value(runtime.CtxAPINameKey{}) + method, ok := rawMethod.(string) + if !ok { + return nil, nonRetriableError{errors.New("unable to dispatch request, missing value for CtxAPINameKey")} + } + + var resp *http.Response + var err error + + switch method { + case "OperationStatusResultClient.Get": + resp, err = o.dispatchGet(req) + case "OperationStatusResultClient.GetByAgentPool": + resp, err = o.dispatchGetByAgentPool(req) + case "OperationStatusResultClient.NewListPager": + resp, err = o.dispatchNewListPager(req) + default: + err = fmt.Errorf("unhandled API %s", method) + } + + if err != nil { + return nil, err + } + + return resp, nil +} + +func (o *OperationStatusResultServerTransport) dispatchGet(req *http.Request) (*http.Response, error) { + if o.srv.Get == nil { + return nil, &nonRetriableError{errors.New("fake for method Get not implemented")} + } + const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.ContainerService/managedClusters/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/operations/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)` + regex := regexp.MustCompile(regexStr) + matches := regex.FindStringSubmatch(req.URL.EscapedPath()) + if matches == nil || len(matches) < 4 { + return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) + } + resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) + if err != nil { + return nil, err + } + resourceNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceName")]) + if err != nil { + return nil, err + } + operationIDParam, err := url.PathUnescape(matches[regex.SubexpIndex("operationId")]) + if err != nil { + return nil, err + } + respr, errRespr := o.srv.Get(req.Context(), resourceGroupNameParam, resourceNameParam, operationIDParam, nil) + if respErr := server.GetError(errRespr, req); respErr != nil { + return nil, respErr + } + respContent := server.GetResponseContent(respr) + if !contains([]int{http.StatusOK}, respContent.HTTPStatus) { + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", respContent.HTTPStatus)} + } + resp, err := server.MarshalResponseAsJSON(respContent, server.GetResponse(respr).OperationStatusResult, req) + if err != nil { + return nil, err + } + return resp, nil +} + +func (o *OperationStatusResultServerTransport) dispatchGetByAgentPool(req *http.Request) (*http.Response, error) { + if o.srv.GetByAgentPool == nil { + return nil, &nonRetriableError{errors.New("fake for method GetByAgentPool not implemented")} + } + const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.ContainerService/managedClusters/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/agentPools/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/operations/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)` + regex := regexp.MustCompile(regexStr) + matches := regex.FindStringSubmatch(req.URL.EscapedPath()) + if matches == nil || len(matches) < 5 { + return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) + } + resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) + if err != nil { + return nil, err + } + resourceNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceName")]) + if err != nil { + return nil, err + } + agentPoolNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("agentPoolName")]) + if err != nil { + return nil, err + } + operationIDParam, err := url.PathUnescape(matches[regex.SubexpIndex("operationId")]) + if err != nil { + return nil, err + } + respr, errRespr := o.srv.GetByAgentPool(req.Context(), resourceGroupNameParam, resourceNameParam, agentPoolNameParam, operationIDParam, nil) + if respErr := server.GetError(errRespr, req); respErr != nil { + return nil, respErr + } + respContent := server.GetResponseContent(respr) + if !contains([]int{http.StatusOK}, respContent.HTTPStatus) { + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", respContent.HTTPStatus)} + } + resp, err := server.MarshalResponseAsJSON(respContent, server.GetResponse(respr).OperationStatusResult, req) + if err != nil { + return nil, err + } + return resp, nil +} + +func (o *OperationStatusResultServerTransport) dispatchNewListPager(req *http.Request) (*http.Response, error) { + if o.srv.NewListPager == nil { + return nil, &nonRetriableError{errors.New("fake for method NewListPager not implemented")} + } + newListPager := o.newListPager.get(req) + if newListPager == nil { + const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.ContainerService/managedClusters/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/operations` + regex := regexp.MustCompile(regexStr) + matches := regex.FindStringSubmatch(req.URL.EscapedPath()) + if matches == nil || len(matches) < 3 { + return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) + } + resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) + if err != nil { + return nil, err + } + resourceNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceName")]) + if err != nil { + return nil, err + } + resp := o.srv.NewListPager(resourceGroupNameParam, resourceNameParam, nil) + newListPager = &resp + o.newListPager.add(req, newListPager) + server.PagerResponderInjectNextLinks(newListPager, req, func(page *armcontainerservice.OperationStatusResultClientListResponse, createLink func() string) { + page.NextLink = to.Ptr(createLink()) + }) + } + resp, err := server.PagerResponderNext(newListPager, req) + if err != nil { + return nil, err + } + if !contains([]int{http.StatusOK}, resp.StatusCode) { + o.newListPager.remove(req) + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", resp.StatusCode)} + } + if !server.PagerResponderMore(newListPager) { + o.newListPager.remove(req) + } + return resp, nil +} diff --git a/sdk/resourcemanager/containerservice/armcontainerservice/fake/server_factory.go b/sdk/resourcemanager/containerservice/armcontainerservice/fake/server_factory.go index d2f680926f68..dfd3348a713a 100644 --- a/sdk/resourcemanager/containerservice/armcontainerservice/fake/server_factory.go +++ b/sdk/resourcemanager/containerservice/armcontainerservice/fake/server_factory.go @@ -20,8 +20,12 @@ import ( // ServerFactory is a fake server for instances of the armcontainerservice.ClientFactory type. type ServerFactory struct { AgentPoolsServer AgentPoolsServer + LoadBalancersServer LoadBalancersServer + MachinesServer MachinesServer MaintenanceConfigurationsServer MaintenanceConfigurationsServer + ManagedClusterSnapshotsServer ManagedClusterSnapshotsServer ManagedClustersServer ManagedClustersServer + OperationStatusResultServer OperationStatusResultServer OperationsServer OperationsServer PrivateEndpointConnectionsServer PrivateEndpointConnectionsServer PrivateLinkResourcesServer PrivateLinkResourcesServer @@ -46,8 +50,12 @@ type ServerFactoryTransport struct { srv *ServerFactory trMu sync.Mutex trAgentPoolsServer *AgentPoolsServerTransport + trLoadBalancersServer *LoadBalancersServerTransport + trMachinesServer *MachinesServerTransport trMaintenanceConfigurationsServer *MaintenanceConfigurationsServerTransport + trManagedClusterSnapshotsServer *ManagedClusterSnapshotsServerTransport trManagedClustersServer *ManagedClustersServerTransport + trOperationStatusResultServer *OperationStatusResultServerTransport trOperationsServer *OperationsServerTransport trPrivateEndpointConnectionsServer *PrivateEndpointConnectionsServerTransport trPrivateLinkResourcesServer *PrivateLinkResourcesServerTransport @@ -73,16 +81,34 @@ func (s *ServerFactoryTransport) Do(req *http.Request) (*http.Response, error) { case "AgentPoolsClient": initServer(s, &s.trAgentPoolsServer, func() *AgentPoolsServerTransport { return NewAgentPoolsServerTransport(&s.srv.AgentPoolsServer) }) resp, err = s.trAgentPoolsServer.Do(req) + case "LoadBalancersClient": + initServer(s, &s.trLoadBalancersServer, func() *LoadBalancersServerTransport { + return NewLoadBalancersServerTransport(&s.srv.LoadBalancersServer) + }) + resp, err = s.trLoadBalancersServer.Do(req) + case "MachinesClient": + initServer(s, &s.trMachinesServer, func() *MachinesServerTransport { return NewMachinesServerTransport(&s.srv.MachinesServer) }) + resp, err = s.trMachinesServer.Do(req) case "MaintenanceConfigurationsClient": initServer(s, &s.trMaintenanceConfigurationsServer, func() *MaintenanceConfigurationsServerTransport { return NewMaintenanceConfigurationsServerTransport(&s.srv.MaintenanceConfigurationsServer) }) resp, err = s.trMaintenanceConfigurationsServer.Do(req) + case "ManagedClusterSnapshotsClient": + initServer(s, &s.trManagedClusterSnapshotsServer, func() *ManagedClusterSnapshotsServerTransport { + return NewManagedClusterSnapshotsServerTransport(&s.srv.ManagedClusterSnapshotsServer) + }) + resp, err = s.trManagedClusterSnapshotsServer.Do(req) case "ManagedClustersClient": initServer(s, &s.trManagedClustersServer, func() *ManagedClustersServerTransport { return NewManagedClustersServerTransport(&s.srv.ManagedClustersServer) }) resp, err = s.trManagedClustersServer.Do(req) + case "OperationStatusResultClient": + initServer(s, &s.trOperationStatusResultServer, func() *OperationStatusResultServerTransport { + return NewOperationStatusResultServerTransport(&s.srv.OperationStatusResultServer) + }) + resp, err = s.trOperationStatusResultServer.Do(req) case "OperationsClient": initServer(s, &s.trOperationsServer, func() *OperationsServerTransport { return NewOperationsServerTransport(&s.srv.OperationsServer) }) resp, err = s.trOperationsServer.Do(req) diff --git a/sdk/resourcemanager/containerservice/armcontainerservice/loadbalancers_client.go b/sdk/resourcemanager/containerservice/armcontainerservice/loadbalancers_client.go new file mode 100644 index 000000000000..d4fa20cb5f5f --- /dev/null +++ b/sdk/resourcemanager/containerservice/armcontainerservice/loadbalancers_client.go @@ -0,0 +1,333 @@ +//go:build go1.18 +// +build go1.18 + +// 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. DO NOT EDIT. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +package armcontainerservice + +import ( + "context" + "errors" + "github.com/Azure/azure-sdk-for-go/sdk/azcore" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" + "net/http" + "net/url" + "strings" +) + +// LoadBalancersClient contains the methods for the LoadBalancers group. +// Don't use this type directly, use NewLoadBalancersClient() instead. +type LoadBalancersClient struct { + internal *arm.Client + subscriptionID string +} + +// NewLoadBalancersClient creates a new instance of LoadBalancersClient with the specified values. +// - subscriptionID - The ID of the target subscription. The value must be an UUID. +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. +func NewLoadBalancersClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*LoadBalancersClient, error) { + cl, err := arm.NewClient(moduleName, moduleVersion, credential, options) + if err != nil { + return nil, err + } + client := &LoadBalancersClient{ + subscriptionID: subscriptionID, + internal: cl, + } + return client, nil +} + +// CreateOrUpdate - Creates or updates a load balancer in the specified managed cluster. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2024-05-02-preview +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - resourceName - The name of the managed cluster resource. +// - loadBalancerName - The name of the load balancer. +// - parameters - The load balancer to create or update. +// - options - LoadBalancersClientCreateOrUpdateOptions contains the optional parameters for the LoadBalancersClient.CreateOrUpdate +// method. +func (client *LoadBalancersClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, resourceName string, loadBalancerName string, parameters LoadBalancer, options *LoadBalancersClientCreateOrUpdateOptions) (LoadBalancersClientCreateOrUpdateResponse, error) { + var err error + const operationName = "LoadBalancersClient.CreateOrUpdate" + ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) + ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) + defer func() { endSpan(err) }() + req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, resourceName, loadBalancerName, parameters, options) + if err != nil { + return LoadBalancersClientCreateOrUpdateResponse{}, err + } + httpResp, err := client.internal.Pipeline().Do(req) + if err != nil { + return LoadBalancersClientCreateOrUpdateResponse{}, err + } + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusCreated) { + err = runtime.NewResponseError(httpResp) + return LoadBalancersClientCreateOrUpdateResponse{}, err + } + resp, err := client.createOrUpdateHandleResponse(httpResp) + return resp, err +} + +// createOrUpdateCreateRequest creates the CreateOrUpdate request. +func (client *LoadBalancersClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, resourceName string, loadBalancerName string, parameters LoadBalancer, options *LoadBalancersClientCreateOrUpdateOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/loadBalancers/{loadBalancerName}" + 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 loadBalancerName == "" { + return nil, errors.New("parameter loadBalancerName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{loadBalancerName}", url.PathEscape(loadBalancerName)) + req, err := runtime.NewRequest(ctx, http.MethodPut, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2024-05-02-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + if err := runtime.MarshalAsJSON(req, parameters); err != nil { + return nil, err + } + return req, nil +} + +// createOrUpdateHandleResponse handles the CreateOrUpdate response. +func (client *LoadBalancersClient) createOrUpdateHandleResponse(resp *http.Response) (LoadBalancersClientCreateOrUpdateResponse, error) { + result := LoadBalancersClientCreateOrUpdateResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.LoadBalancer); err != nil { + return LoadBalancersClientCreateOrUpdateResponse{}, err + } + return result, nil +} + +// BeginDelete - Deletes a load balancer in the specified managed cluster. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2024-05-02-preview +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - resourceName - The name of the managed cluster resource. +// - loadBalancerName - The name of the load balancer. +// - options - LoadBalancersClientBeginDeleteOptions contains the optional parameters for the LoadBalancersClient.BeginDelete +// method. +func (client *LoadBalancersClient) BeginDelete(ctx context.Context, resourceGroupName string, resourceName string, loadBalancerName string, options *LoadBalancersClientBeginDeleteOptions) (*runtime.Poller[LoadBalancersClientDeleteResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.deleteOperation(ctx, resourceGroupName, resourceName, loadBalancerName, options) + if err != nil { + return nil, err + } + poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[LoadBalancersClientDeleteResponse]{ + Tracer: client.internal.Tracer(), + }) + return poller, err + } else { + return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[LoadBalancersClientDeleteResponse]{ + Tracer: client.internal.Tracer(), + }) + } +} + +// Delete - Deletes a load balancer in the specified managed cluster. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2024-05-02-preview +func (client *LoadBalancersClient) deleteOperation(ctx context.Context, resourceGroupName string, resourceName string, loadBalancerName string, options *LoadBalancersClientBeginDeleteOptions) (*http.Response, error) { + var err error + const operationName = "LoadBalancersClient.BeginDelete" + ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) + ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) + defer func() { endSpan(err) }() + req, err := client.deleteCreateRequest(ctx, resourceGroupName, resourceName, loadBalancerName, options) + if err != nil { + return nil, err + } + httpResp, err := client.internal.Pipeline().Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(httpResp, http.StatusAccepted, http.StatusNoContent) { + err = runtime.NewResponseError(httpResp) + return nil, err + } + return httpResp, nil +} + +// deleteCreateRequest creates the Delete request. +func (client *LoadBalancersClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, resourceName string, loadBalancerName string, options *LoadBalancersClientBeginDeleteOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/loadBalancers/{loadBalancerName}" + 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 loadBalancerName == "" { + return nil, errors.New("parameter loadBalancerName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{loadBalancerName}", url.PathEscape(loadBalancerName)) + req, err := runtime.NewRequest(ctx, http.MethodDelete, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2024-05-02-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// Get - Gets the specified load balancer. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2024-05-02-preview +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - resourceName - The name of the managed cluster resource. +// - loadBalancerName - The name of the load balancer. +// - options - LoadBalancersClientGetOptions contains the optional parameters for the LoadBalancersClient.Get method. +func (client *LoadBalancersClient) Get(ctx context.Context, resourceGroupName string, resourceName string, loadBalancerName string, options *LoadBalancersClientGetOptions) (LoadBalancersClientGetResponse, error) { + var err error + const operationName = "LoadBalancersClient.Get" + ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) + ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) + defer func() { endSpan(err) }() + req, err := client.getCreateRequest(ctx, resourceGroupName, resourceName, loadBalancerName, options) + if err != nil { + return LoadBalancersClientGetResponse{}, err + } + httpResp, err := client.internal.Pipeline().Do(req) + if err != nil { + return LoadBalancersClientGetResponse{}, err + } + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return LoadBalancersClientGetResponse{}, err + } + resp, err := client.getHandleResponse(httpResp) + return resp, err +} + +// getCreateRequest creates the Get request. +func (client *LoadBalancersClient) getCreateRequest(ctx context.Context, resourceGroupName string, resourceName string, loadBalancerName string, options *LoadBalancersClientGetOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/loadBalancers/{loadBalancerName}" + 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 loadBalancerName == "" { + return nil, errors.New("parameter loadBalancerName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{loadBalancerName}", url.PathEscape(loadBalancerName)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2024-05-02-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// getHandleResponse handles the Get response. +func (client *LoadBalancersClient) getHandleResponse(resp *http.Response) (LoadBalancersClientGetResponse, error) { + result := LoadBalancersClientGetResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.LoadBalancer); err != nil { + return LoadBalancersClientGetResponse{}, err + } + return result, nil +} + +// NewListByManagedClusterPager - Gets a list of load balancers in the specified managed cluster. +// +// Generated from API version 2024-05-02-preview +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - resourceName - The name of the managed cluster resource. +// - options - LoadBalancersClientListByManagedClusterOptions contains the optional parameters for the LoadBalancersClient.NewListByManagedClusterPager +// method. +func (client *LoadBalancersClient) NewListByManagedClusterPager(resourceGroupName string, resourceName string, options *LoadBalancersClientListByManagedClusterOptions) *runtime.Pager[LoadBalancersClientListByManagedClusterResponse] { + return runtime.NewPager(runtime.PagingHandler[LoadBalancersClientListByManagedClusterResponse]{ + More: func(page LoadBalancersClientListByManagedClusterResponse) bool { + return page.NextLink != nil && len(*page.NextLink) > 0 + }, + Fetcher: func(ctx context.Context, page *LoadBalancersClientListByManagedClusterResponse) (LoadBalancersClientListByManagedClusterResponse, error) { + ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, "LoadBalancersClient.NewListByManagedClusterPager") + nextLink := "" + if page != nil { + nextLink = *page.NextLink + } + resp, err := runtime.FetcherForNextLink(ctx, client.internal.Pipeline(), nextLink, func(ctx context.Context) (*policy.Request, error) { + return client.listByManagedClusterCreateRequest(ctx, resourceGroupName, resourceName, options) + }, nil) + if err != nil { + return LoadBalancersClientListByManagedClusterResponse{}, err + } + return client.listByManagedClusterHandleResponse(resp) + }, + Tracer: client.internal.Tracer(), + }) +} + +// listByManagedClusterCreateRequest creates the ListByManagedCluster request. +func (client *LoadBalancersClient) listByManagedClusterCreateRequest(ctx context.Context, resourceGroupName string, resourceName string, options *LoadBalancersClientListByManagedClusterOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/loadBalancers" + 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 := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2024-05-02-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// listByManagedClusterHandleResponse handles the ListByManagedCluster response. +func (client *LoadBalancersClient) listByManagedClusterHandleResponse(resp *http.Response) (LoadBalancersClientListByManagedClusterResponse, error) { + result := LoadBalancersClientListByManagedClusterResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.LoadBalancerListResult); err != nil { + return LoadBalancersClientListByManagedClusterResponse{}, err + } + return result, nil +} diff --git a/sdk/resourcemanager/containerservice/armcontainerservice/loadbalancers_client_example_test.go b/sdk/resourcemanager/containerservice/armcontainerservice/loadbalancers_client_example_test.go new file mode 100644 index 000000000000..864b24654985 --- /dev/null +++ b/sdk/resourcemanager/containerservice/armcontainerservice/loadbalancers_client_example_test.go @@ -0,0 +1,144 @@ +//go:build go1.18 +// +build go1.18 + +// 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. +// DO NOT EDIT. + +package armcontainerservice_test + +import ( + "context" + "log" + + "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" + "github.com/Azure/azure-sdk-for-go/sdk/azidentity" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/containerservice/armcontainerservice/v6" +) + +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c7b98b36e4023331545051284d8500adf98f02fe/specification/containerservice/resource-manager/Microsoft.ContainerService/aks/preview/2024-05-02-preview/examples/LoadBalancers_List.json +func ExampleLoadBalancersClient_NewListByManagedClusterPager() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + clientFactory, err := armcontainerservice.NewClientFactory("", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + pager := clientFactory.NewLoadBalancersClient().NewListByManagedClusterPager("rg1", "clustername1", nil) + for pager.More() { + page, err := pager.NextPage(ctx) + if err != nil { + log.Fatalf("failed to advance page: %v", err) + } + for _, v := range page.Value { + // You could use page here. We use blank identifier for just demo purposes. + _ = v + } + // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. + // page.LoadBalancerListResult = armcontainerservice.LoadBalancerListResult{ + // Value: []*armcontainerservice.LoadBalancer{ + // { + // Name: to.Ptr("kubernetes"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/rg1/providers/Microsoft.ContainerService/managedClusters/clustername1/loadBalancers/kubernetes"), + // Properties: &armcontainerservice.LoadBalancerProperties{ + // Name: to.Ptr("kubernetes"), + // AllowServicePlacement: to.Ptr(true), + // PrimaryAgentPoolName: to.Ptr("agentPool1"), + // ProvisioningState: to.Ptr("Succeeded"), + // }, + // }}, + // } + } +} + +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c7b98b36e4023331545051284d8500adf98f02fe/specification/containerservice/resource-manager/Microsoft.ContainerService/aks/preview/2024-05-02-preview/examples/LoadBalancers_Get.json +func ExampleLoadBalancersClient_Get() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + clientFactory, err := armcontainerservice.NewClientFactory("", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + res, err := clientFactory.NewLoadBalancersClient().Get(ctx, "rg1", "clustername1", "kubernetes", nil) + if err != nil { + log.Fatalf("failed to finish the request: %v", err) + } + // You could use response here. We use blank identifier for just demo purposes. + _ = res + // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. + // res.LoadBalancer = armcontainerservice.LoadBalancer{ + // Name: to.Ptr("kubernetes"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/rg1/providers/Microsoft.ContainerService/managedClusters/clustername1/loadBalancers/kubernetes"), + // Properties: &armcontainerservice.LoadBalancerProperties{ + // Name: to.Ptr("kubernetes"), + // AllowServicePlacement: to.Ptr(true), + // PrimaryAgentPoolName: to.Ptr("agentPool1"), + // ProvisioningState: to.Ptr("Succeeded"), + // }, + // } +} + +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c7b98b36e4023331545051284d8500adf98f02fe/specification/containerservice/resource-manager/Microsoft.ContainerService/aks/preview/2024-05-02-preview/examples/LoadBalancers_Create_Or_Update.json +func ExampleLoadBalancersClient_CreateOrUpdate() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + clientFactory, err := armcontainerservice.NewClientFactory("", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + res, err := clientFactory.NewLoadBalancersClient().CreateOrUpdate(ctx, "rg1", "clustername1", "kubernetes", armcontainerservice.LoadBalancer{ + Properties: &armcontainerservice.LoadBalancerProperties{ + Name: to.Ptr("kubernetes"), + AllowServicePlacement: to.Ptr(true), + PrimaryAgentPoolName: to.Ptr("agentpool1"), + }, + }, nil) + if err != nil { + log.Fatalf("failed to finish the request: %v", err) + } + // You could use response here. We use blank identifier for just demo purposes. + _ = res + // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. + // res.LoadBalancer = armcontainerservice.LoadBalancer{ + // Name: to.Ptr("kubernetes"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/rg1/providers/Microsoft.ContainerService/managedClusters/clustername1/loadBalancers/kubernetes"), + // Properties: &armcontainerservice.LoadBalancerProperties{ + // Name: to.Ptr("kubernetes"), + // AllowServicePlacement: to.Ptr(true), + // PrimaryAgentPoolName: to.Ptr("agentPool1"), + // ProvisioningState: to.Ptr("Succeeded"), + // }, + // } +} + +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c7b98b36e4023331545051284d8500adf98f02fe/specification/containerservice/resource-manager/Microsoft.ContainerService/aks/preview/2024-05-02-preview/examples/LoadBalancers_Delete.json +func ExampleLoadBalancersClient_BeginDelete() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + clientFactory, err := armcontainerservice.NewClientFactory("", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + poller, err := clientFactory.NewLoadBalancersClient().BeginDelete(ctx, "rg1", "clustername1", "kubernetes", nil) + if err != nil { + log.Fatalf("failed to finish the request: %v", err) + } + _, err = poller.PollUntilDone(ctx, nil) + if err != nil { + log.Fatalf("failed to pull the result: %v", err) + } +} diff --git a/sdk/resourcemanager/containerservice/armcontainerservice/machines_client.go b/sdk/resourcemanager/containerservice/armcontainerservice/machines_client.go new file mode 100644 index 000000000000..7ed75f97d559 --- /dev/null +++ b/sdk/resourcemanager/containerservice/armcontainerservice/machines_client.go @@ -0,0 +1,187 @@ +//go:build go1.18 +// +build go1.18 + +// 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. DO NOT EDIT. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +package armcontainerservice + +import ( + "context" + "errors" + "github.com/Azure/azure-sdk-for-go/sdk/azcore" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" + "net/http" + "net/url" + "strings" +) + +// MachinesClient contains the methods for the Machines group. +// Don't use this type directly, use NewMachinesClient() instead. +type MachinesClient struct { + internal *arm.Client + subscriptionID string +} + +// NewMachinesClient creates a new instance of MachinesClient with the specified values. +// - subscriptionID - The ID of the target subscription. The value must be an UUID. +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. +func NewMachinesClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*MachinesClient, error) { + cl, err := arm.NewClient(moduleName, moduleVersion, credential, options) + if err != nil { + return nil, err + } + client := &MachinesClient{ + subscriptionID: subscriptionID, + internal: cl, + } + return client, nil +} + +// Get - Get a specific machine in the specified agent pool. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2024-05-02-preview +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - resourceName - The name of the managed cluster resource. +// - agentPoolName - The name of the agent pool. +// - machineName - host name of the machine +// - options - MachinesClientGetOptions contains the optional parameters for the MachinesClient.Get method. +func (client *MachinesClient) Get(ctx context.Context, resourceGroupName string, resourceName string, agentPoolName string, machineName string, options *MachinesClientGetOptions) (MachinesClientGetResponse, error) { + var err error + const operationName = "MachinesClient.Get" + ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) + ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) + defer func() { endSpan(err) }() + req, err := client.getCreateRequest(ctx, resourceGroupName, resourceName, agentPoolName, machineName, options) + if err != nil { + return MachinesClientGetResponse{}, err + } + httpResp, err := client.internal.Pipeline().Do(req) + if err != nil { + return MachinesClientGetResponse{}, err + } + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return MachinesClientGetResponse{}, err + } + resp, err := client.getHandleResponse(httpResp) + return resp, err +} + +// getCreateRequest creates the Get request. +func (client *MachinesClient) getCreateRequest(ctx context.Context, resourceGroupName string, resourceName string, agentPoolName string, machineName string, options *MachinesClientGetOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools/{agentPoolName}/machines/{machineName}" + 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)) + if machineName == "" { + return nil, errors.New("parameter machineName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{machineName}", url.PathEscape(machineName)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2024-05-02-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// getHandleResponse handles the Get response. +func (client *MachinesClient) getHandleResponse(resp *http.Response) (MachinesClientGetResponse, error) { + result := MachinesClientGetResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.Machine); err != nil { + return MachinesClientGetResponse{}, err + } + return result, nil +} + +// NewListPager - Gets a list of machines in the specified agent pool. +// +// Generated from API version 2024-05-02-preview +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - resourceName - The name of the managed cluster resource. +// - agentPoolName - The name of the agent pool. +// - options - MachinesClientListOptions contains the optional parameters for the MachinesClient.NewListPager method. +func (client *MachinesClient) NewListPager(resourceGroupName string, resourceName string, agentPoolName string, options *MachinesClientListOptions) *runtime.Pager[MachinesClientListResponse] { + return runtime.NewPager(runtime.PagingHandler[MachinesClientListResponse]{ + More: func(page MachinesClientListResponse) bool { + return page.NextLink != nil && len(*page.NextLink) > 0 + }, + Fetcher: func(ctx context.Context, page *MachinesClientListResponse) (MachinesClientListResponse, error) { + ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, "MachinesClient.NewListPager") + nextLink := "" + if page != nil { + nextLink = *page.NextLink + } + resp, err := runtime.FetcherForNextLink(ctx, client.internal.Pipeline(), nextLink, func(ctx context.Context) (*policy.Request, error) { + return client.listCreateRequest(ctx, resourceGroupName, resourceName, agentPoolName, options) + }, nil) + if err != nil { + return MachinesClientListResponse{}, err + } + return client.listHandleResponse(resp) + }, + Tracer: client.internal.Tracer(), + }) +} + +// listCreateRequest creates the List request. +func (client *MachinesClient) listCreateRequest(ctx context.Context, resourceGroupName string, resourceName string, agentPoolName string, options *MachinesClientListOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools/{agentPoolName}/machines" + 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 := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2024-05-02-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// listHandleResponse handles the List response. +func (client *MachinesClient) listHandleResponse(resp *http.Response) (MachinesClientListResponse, error) { + result := MachinesClientListResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.MachineListResult); err != nil { + return MachinesClientListResponse{}, err + } + return result, nil +} diff --git a/sdk/resourcemanager/containerservice/armcontainerservice/machines_client_example_test.go b/sdk/resourcemanager/containerservice/armcontainerservice/machines_client_example_test.go new file mode 100644 index 000000000000..98bd21886242 --- /dev/null +++ b/sdk/resourcemanager/containerservice/armcontainerservice/machines_client_example_test.go @@ -0,0 +1,104 @@ +//go:build go1.18 +// +build go1.18 + +// 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. +// DO NOT EDIT. + +package armcontainerservice_test + +import ( + "context" + "log" + + "github.com/Azure/azure-sdk-for-go/sdk/azidentity" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/containerservice/armcontainerservice/v6" +) + +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c7b98b36e4023331545051284d8500adf98f02fe/specification/containerservice/resource-manager/Microsoft.ContainerService/aks/preview/2024-05-02-preview/examples/MachineList.json +func ExampleMachinesClient_NewListPager() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + clientFactory, err := armcontainerservice.NewClientFactory("", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + pager := clientFactory.NewMachinesClient().NewListPager("rg1", "clustername1", "agentpool1", nil) + for pager.More() { + page, err := pager.NextPage(ctx) + if err != nil { + log.Fatalf("failed to advance page: %v", err) + } + for _, v := range page.Value { + // You could use page here. We use blank identifier for just demo purposes. + _ = v + } + // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. + // page.MachineListResult = armcontainerservice.MachineListResult{ + // Value: []*armcontainerservice.Machine{ + // { + // Name: to.Ptr("aks-nodepool1-25481572-vmss000000"), + // Type: to.Ptr("Microsoft.ContainerService/managedClusters/agentPools/machines"), + // ID: to.Ptr("/subscriptions/26fe00f8-9173-4872-9134-bb1d2e00343a/resourceGroups/dummyRG/providers/Microsoft.ContainerService/managedClusters/round/agentPools/nodepool1/machines/aks-nodepool1-25481572-vmss000000"), + // Properties: &armcontainerservice.MachineProperties{ + // Network: &armcontainerservice.MachineNetworkProperties{ + // IPAddresses: []*armcontainerservice.MachineIPAddress{ + // { + // Family: to.Ptr(armcontainerservice.IPFamilyIPv4), + // IP: to.Ptr("172.20.2.4"), + // }, + // { + // Family: to.Ptr(armcontainerservice.IPFamilyIPv4), + // IP: to.Ptr("10.0.0.1"), + // }}, + // }, + // ResourceID: to.Ptr("/subscriptions/26fe00f8-9173-4872-9134-bb1d2e00343a/resourceGroups/dummyRG/providers/Microsoft.Compute/virtualMachineScaleSets/aks-nodepool1-25481572-vmss/virtualMachines/0"), + // }, + // }}, + // } + } +} + +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c7b98b36e4023331545051284d8500adf98f02fe/specification/containerservice/resource-manager/Microsoft.ContainerService/aks/preview/2024-05-02-preview/examples/MachineGet.json +func ExampleMachinesClient_Get() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + clientFactory, err := armcontainerservice.NewClientFactory("", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + res, err := clientFactory.NewMachinesClient().Get(ctx, "rg1", "clustername1", "agentpool1", "aks-nodepool1-42263519-vmss00000t", nil) + if err != nil { + log.Fatalf("failed to finish the request: %v", err) + } + // You could use response here. We use blank identifier for just demo purposes. + _ = res + // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. + // res.Machine = armcontainerservice.Machine{ + // Name: to.Ptr("aks-nodepool1-25481572-vmss000000"), + // Type: to.Ptr("Microsoft.ContainerService/managedClusters/agentPools/machines"), + // ID: to.Ptr("/subscriptions/26fe00f8-9173-4872-9134-bb1d2e00343a/resourceGroups/dummyRG/providers/Microsoft.ContainerService/managedClusters/round/agentPools/nodepool1/machines/aks-nodepool1-25481572-vmss000000"), + // Properties: &armcontainerservice.MachineProperties{ + // Network: &armcontainerservice.MachineNetworkProperties{ + // IPAddresses: []*armcontainerservice.MachineIPAddress{ + // { + // Family: to.Ptr(armcontainerservice.IPFamilyIPv4), + // IP: to.Ptr("172.20.2.4"), + // }, + // { + // Family: to.Ptr(armcontainerservice.IPFamilyIPv4), + // IP: to.Ptr("10.0.0.1"), + // }}, + // }, + // ResourceID: to.Ptr("/subscriptions/26fe00f8-9173-4872-9134-bb1d2e00343a/resourceGroups/dummyRG/providers/Microsoft.Compute/virtualMachineScaleSets/aks-nodepool1-25481572-vmss/virtualMachines/0"), + // }, + // } +} diff --git a/sdk/resourcemanager/containerservice/armcontainerservice/maintenanceconfigurations_client.go b/sdk/resourcemanager/containerservice/armcontainerservice/maintenanceconfigurations_client.go index 397a05999051..719c90a3f5fc 100644 --- a/sdk/resourcemanager/containerservice/armcontainerservice/maintenanceconfigurations_client.go +++ b/sdk/resourcemanager/containerservice/armcontainerservice/maintenanceconfigurations_client.go @@ -46,7 +46,7 @@ func NewMaintenanceConfigurationsClient(subscriptionID string, credential azcore // CreateOrUpdate - Creates or updates a maintenance configuration in the specified managed cluster. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-05-01 +// Generated from API version 2024-05-02-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - resourceName - The name of the managed cluster resource. // - configName - The name of the maintenance configuration. @@ -99,7 +99,7 @@ func (client *MaintenanceConfigurationsClient) createOrUpdateCreateRequest(ctx c return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-05-02-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { @@ -120,7 +120,7 @@ func (client *MaintenanceConfigurationsClient) createOrUpdateHandleResponse(resp // Delete - Deletes a maintenance configuration. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-05-01 +// Generated from API version 2024-05-02-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - resourceName - The name of the managed cluster resource. // - configName - The name of the maintenance configuration. @@ -171,7 +171,7 @@ func (client *MaintenanceConfigurationsClient) deleteCreateRequest(ctx context.C return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-05-02-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -180,7 +180,7 @@ func (client *MaintenanceConfigurationsClient) deleteCreateRequest(ctx context.C // Get - Gets the specified maintenance configuration of a managed cluster. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-05-01 +// Generated from API version 2024-05-02-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - resourceName - The name of the managed cluster resource. // - configName - The name of the maintenance configuration. @@ -232,7 +232,7 @@ func (client *MaintenanceConfigurationsClient) getCreateRequest(ctx context.Cont return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-05-02-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -249,7 +249,7 @@ func (client *MaintenanceConfigurationsClient) getHandleResponse(resp *http.Resp // NewListByManagedClusterPager - Gets a list of maintenance configurations in the specified managed cluster. // -// Generated from API version 2024-05-01 +// Generated from API version 2024-05-02-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - resourceName - The name of the managed cluster resource. // - options - MaintenanceConfigurationsClientListByManagedClusterOptions contains the optional parameters for the MaintenanceConfigurationsClient.NewListByManagedClusterPager @@ -297,7 +297,7 @@ func (client *MaintenanceConfigurationsClient) listByManagedClusterCreateRequest return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-05-02-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/containerservice/armcontainerservice/maintenanceconfigurations_client_example_test.go b/sdk/resourcemanager/containerservice/armcontainerservice/maintenanceconfigurations_client_example_test.go index 28bc4431739c..915a150a32a9 100644 --- a/sdk/resourcemanager/containerservice/armcontainerservice/maintenanceconfigurations_client_example_test.go +++ b/sdk/resourcemanager/containerservice/armcontainerservice/maintenanceconfigurations_client_example_test.go @@ -20,7 +20,7 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/containerservice/armcontainerservice/v6" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/8cbd903b0d037c427def0e8fbf167b26e87bd1a9/specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2024-05-01/examples/MaintenanceConfigurationsList.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c7b98b36e4023331545051284d8500adf98f02fe/specification/containerservice/resource-manager/Microsoft.ContainerService/aks/preview/2024-05-02-preview/examples/MaintenanceConfigurationsList.json func ExampleMaintenanceConfigurationsClient_NewListByManagedClusterPager_listMaintenanceConfigurationsByManagedCluster() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -66,7 +66,7 @@ func ExampleMaintenanceConfigurationsClient_NewListByManagedClusterPager_listMai } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/8cbd903b0d037c427def0e8fbf167b26e87bd1a9/specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2024-05-01/examples/MaintenanceConfigurationsList_MaintenanceWindow.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c7b98b36e4023331545051284d8500adf98f02fe/specification/containerservice/resource-manager/Microsoft.ContainerService/aks/preview/2024-05-02-preview/examples/MaintenanceConfigurationsList_MaintenanceWindow.json func ExampleMaintenanceConfigurationsClient_NewListByManagedClusterPager_listMaintenanceConfigurationsConfiguredWithMaintenanceWindowByManagedCluster() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -92,7 +92,7 @@ func ExampleMaintenanceConfigurationsClient_NewListByManagedClusterPager_listMai // Value: []*armcontainerservice.MaintenanceConfiguration{ // { // Name: to.Ptr("aksManagedNodeOSUpgradeSchedule"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/rg1/providers/Microsoft.ContainerService/managedClusters/clustername1/maintenanceConfigurations/aksManagedNodeOSUpgradeSchedule"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/rg1/providers/Microsoft.ContainerService/managedClusters/clustername1/maintenanceConfigurations/default"), // Properties: &armcontainerservice.MaintenanceConfigurationProperties{ // MaintenanceWindow: &armcontainerservice.MaintenanceWindow{ // DurationHours: to.Ptr[int32](10), @@ -109,7 +109,7 @@ func ExampleMaintenanceConfigurationsClient_NewListByManagedClusterPager_listMai // }, // { // Name: to.Ptr("aksManagedAutoUpgradeSchedule"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/rg1/providers/Microsoft.ContainerService/managedClusters/clustername1/maintenanceConfigurations/aksManagedAutoUpgradeSchedule"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/rg1/providers/Microsoft.ContainerService/managedClusters/clustername1/maintenanceConfigurations/default"), // Properties: &armcontainerservice.MaintenanceConfigurationProperties{ // MaintenanceWindow: &armcontainerservice.MaintenanceWindow{ // DurationHours: to.Ptr[int32](5), @@ -138,7 +138,7 @@ func ExampleMaintenanceConfigurationsClient_NewListByManagedClusterPager_listMai } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/8cbd903b0d037c427def0e8fbf167b26e87bd1a9/specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2024-05-01/examples/MaintenanceConfigurationsGet.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c7b98b36e4023331545051284d8500adf98f02fe/specification/containerservice/resource-manager/Microsoft.ContainerService/aks/preview/2024-05-02-preview/examples/MaintenanceConfigurationsGet.json func ExampleMaintenanceConfigurationsClient_Get_getMaintenanceConfiguration() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -184,7 +184,7 @@ func ExampleMaintenanceConfigurationsClient_Get_getMaintenanceConfiguration() { // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/8cbd903b0d037c427def0e8fbf167b26e87bd1a9/specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2024-05-01/examples/MaintenanceConfigurationsGet_MaintenanceWindow.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c7b98b36e4023331545051284d8500adf98f02fe/specification/containerservice/resource-manager/Microsoft.ContainerService/aks/preview/2024-05-02-preview/examples/MaintenanceConfigurationsGet_MaintenanceWindow.json func ExampleMaintenanceConfigurationsClient_Get_getMaintenanceConfigurationConfiguredWithMaintenanceWindow() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -204,7 +204,7 @@ func ExampleMaintenanceConfigurationsClient_Get_getMaintenanceConfigurationConfi // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. // res.MaintenanceConfiguration = armcontainerservice.MaintenanceConfiguration{ // Name: to.Ptr("aksManagedNodeOSUpgradeSchedule"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/rg1/providers/Microsoft.ContainerService/managedClusters/clustername1/maintenanceConfigurations/aksManagedNodeOSUpgradeSchedule"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/rg1/providers/Microsoft.ContainerService/managedClusters/clustername1/maintenanceConfigurations/default"), // Properties: &armcontainerservice.MaintenanceConfigurationProperties{ // MaintenanceWindow: &armcontainerservice.MaintenanceWindow{ // DurationHours: to.Ptr[int32](4), @@ -227,10 +227,18 @@ func ExampleMaintenanceConfigurationsClient_Get_getMaintenanceConfigurationConfi // UTCOffset: to.Ptr("-07:00"), // }, // }, + // SystemData: &armcontainerservice.SystemData{ + // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-01-01T17:18:19.123Z"); return t}()), + // CreatedBy: to.Ptr("user1"), + // CreatedByType: to.Ptr(armcontainerservice.CreatedByTypeUser), + // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-01-02T17:18:19.123Z"); return t}()), + // LastModifiedBy: to.Ptr("user2"), + // LastModifiedByType: to.Ptr(armcontainerservice.CreatedByTypeUser), + // }, // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/8cbd903b0d037c427def0e8fbf167b26e87bd1a9/specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2024-05-01/examples/MaintenanceConfigurationsCreate_Update.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c7b98b36e4023331545051284d8500adf98f02fe/specification/containerservice/resource-manager/Microsoft.ContainerService/aks/preview/2024-05-02-preview/examples/MaintenanceConfigurationsCreate_Update.json func ExampleMaintenanceConfigurationsClient_CreateOrUpdate_createUpdateMaintenanceConfiguration() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -292,7 +300,7 @@ func ExampleMaintenanceConfigurationsClient_CreateOrUpdate_createUpdateMaintenan // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/8cbd903b0d037c427def0e8fbf167b26e87bd1a9/specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2024-05-01/examples/MaintenanceConfigurationsCreate_Update_MaintenanceWindow.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c7b98b36e4023331545051284d8500adf98f02fe/specification/containerservice/resource-manager/Microsoft.ContainerService/aks/preview/2024-05-02-preview/examples/MaintenanceConfigurationsCreate_Update_MaintenanceWindow.json func ExampleMaintenanceConfigurationsClient_CreateOrUpdate_createUpdateMaintenanceConfigurationWithMaintenanceWindow() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -337,7 +345,8 @@ func ExampleMaintenanceConfigurationsClient_CreateOrUpdate_createUpdateMaintenan // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. // res.MaintenanceConfiguration = armcontainerservice.MaintenanceConfiguration{ // Name: to.Ptr("aksManagedAutoUpgradeSchedule"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/rg1/providers/Microsoft.ContainerService/managedClusters/clustername1/maintenanceConfigurations/aksManagedAutoUpgradeSchedule"), + // Type: to.Ptr("Microsoft.ContainerService/managedClusters/maintenanceConfigurations"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/rg1/providers/Microsoft.ContainerService/managedClusters/clustername1/maintenanceConfigurations/default"), // Properties: &armcontainerservice.MaintenanceConfigurationProperties{ // MaintenanceWindow: &armcontainerservice.MaintenanceWindow{ // DurationHours: to.Ptr[int32](10), @@ -361,10 +370,18 @@ func ExampleMaintenanceConfigurationsClient_CreateOrUpdate_createUpdateMaintenan // UTCOffset: to.Ptr("+05:30"), // }, // }, + // SystemData: &armcontainerservice.SystemData{ + // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-01-01T17:18:19.123Z"); return t}()), + // CreatedBy: to.Ptr("user1"), + // CreatedByType: to.Ptr(armcontainerservice.CreatedByTypeUser), + // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-01-02T17:18:19.123Z"); return t}()), + // LastModifiedBy: to.Ptr("user2"), + // LastModifiedByType: to.Ptr(armcontainerservice.CreatedByTypeUser), + // }, // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/8cbd903b0d037c427def0e8fbf167b26e87bd1a9/specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2024-05-01/examples/MaintenanceConfigurationsDelete.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c7b98b36e4023331545051284d8500adf98f02fe/specification/containerservice/resource-manager/Microsoft.ContainerService/aks/preview/2024-05-02-preview/examples/MaintenanceConfigurationsDelete.json func ExampleMaintenanceConfigurationsClient_Delete_deleteMaintenanceConfiguration() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -381,7 +398,7 @@ func ExampleMaintenanceConfigurationsClient_Delete_deleteMaintenanceConfiguratio } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/8cbd903b0d037c427def0e8fbf167b26e87bd1a9/specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2024-05-01/examples/MaintenanceConfigurationsDelete_MaintenanceWindow.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c7b98b36e4023331545051284d8500adf98f02fe/specification/containerservice/resource-manager/Microsoft.ContainerService/aks/preview/2024-05-02-preview/examples/MaintenanceConfigurationsDelete_MaintenanceWindow.json func ExampleMaintenanceConfigurationsClient_Delete_deleteMaintenanceConfigurationForNodeOsUpgrade() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { diff --git a/sdk/resourcemanager/containerservice/armcontainerservice/managedclusters_client.go b/sdk/resourcemanager/containerservice/armcontainerservice/managedclusters_client.go index b9a651f8463b..0c04fe4c3e80 100644 --- a/sdk/resourcemanager/containerservice/armcontainerservice/managedclusters_client.go +++ b/sdk/resourcemanager/containerservice/armcontainerservice/managedclusters_client.go @@ -17,6 +17,7 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" "net/http" "net/url" + "strconv" "strings" ) @@ -45,10 +46,10 @@ func NewManagedClustersClient(subscriptionID string, credential azcore.TokenCred // BeginAbortLatestOperation - Aborts the currently running operation on the managed cluster. The Managed Cluster will be // moved to a Canceling state and eventually to a Canceled state when cancellation finishes. If the operation -// completes before cancellation can take place, a 409 error code is returned. +// completes before cancellation can take place, an error is returned. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-05-01 +// Generated from API version 2024-05-02-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - resourceName - The name of the managed cluster resource. // - options - ManagedClustersClientBeginAbortLatestOperationOptions contains the optional parameters for the ManagedClustersClient.BeginAbortLatestOperation @@ -73,10 +74,10 @@ func (client *ManagedClustersClient) BeginAbortLatestOperation(ctx context.Conte // AbortLatestOperation - Aborts the currently running operation on the managed cluster. The Managed Cluster will be moved // to a Canceling state and eventually to a Canceled state when cancellation finishes. If the operation -// completes before cancellation can take place, a 409 error code is returned. +// completes before cancellation can take place, an error is returned. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-05-01 +// Generated from API version 2024-05-02-preview func (client *ManagedClustersClient) abortLatestOperation(ctx context.Context, resourceGroupName string, resourceName string, options *ManagedClustersClientBeginAbortLatestOperationOptions) (*http.Response, error) { var err error const operationName = "ManagedClustersClient.BeginAbortLatestOperation" @@ -118,7 +119,7 @@ func (client *ManagedClustersClient) abortLatestOperationCreateRequest(ctx conte return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-05-02-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -127,7 +128,7 @@ func (client *ManagedClustersClient) abortLatestOperationCreateRequest(ctx conte // BeginCreateOrUpdate - Creates or updates a managed cluster. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-05-01 +// Generated from API version 2024-05-02-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - resourceName - The name of the managed cluster resource. // - parameters - The managed cluster to create or update. @@ -153,7 +154,7 @@ func (client *ManagedClustersClient) BeginCreateOrUpdate(ctx context.Context, re // CreateOrUpdate - Creates or updates a managed cluster. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-05-01 +// Generated from API version 2024-05-02-preview func (client *ManagedClustersClient) createOrUpdate(ctx context.Context, resourceGroupName string, resourceName string, parameters ManagedCluster, options *ManagedClustersClientBeginCreateOrUpdateOptions) (*http.Response, error) { var err error const operationName = "ManagedClustersClient.BeginCreateOrUpdate" @@ -195,9 +196,15 @@ func (client *ManagedClustersClient) createOrUpdateCreateRequest(ctx context.Con return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-05-02-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} + if options != nil && options.IfMatch != nil { + req.Raw().Header["If-Match"] = []string{*options.IfMatch} + } + if options != nil && options.IfNoneMatch != nil { + req.Raw().Header["If-None-Match"] = []string{*options.IfNoneMatch} + } if err := runtime.MarshalAsJSON(req, parameters); err != nil { return nil, err } @@ -207,7 +214,7 @@ func (client *ManagedClustersClient) createOrUpdateCreateRequest(ctx context.Con // BeginDelete - Deletes a managed cluster. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-05-01 +// Generated from API version 2024-05-02-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - resourceName - The name of the managed cluster resource. // - options - ManagedClustersClientBeginDeleteOptions contains the optional parameters for the ManagedClustersClient.BeginDelete @@ -232,7 +239,7 @@ func (client *ManagedClustersClient) BeginDelete(ctx context.Context, resourceGr // Delete - Deletes a managed cluster. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-05-01 +// Generated from API version 2024-05-02-preview func (client *ManagedClustersClient) deleteOperation(ctx context.Context, resourceGroupName string, resourceName string, options *ManagedClustersClientBeginDeleteOptions) (*http.Response, error) { var err error const operationName = "ManagedClustersClient.BeginDelete" @@ -274,16 +281,22 @@ func (client *ManagedClustersClient) deleteCreateRequest(ctx context.Context, re return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-05-02-preview") + if options != nil && options.IgnorePodDisruptionBudget != nil { + reqQP.Set("ignore-pod-disruption-budget", strconv.FormatBool(*options.IgnorePodDisruptionBudget)) + } req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} + if options != nil && options.IfMatch != nil { + req.Raw().Header["If-Match"] = []string{*options.IfMatch} + } return req, nil } // Get - Gets a managed cluster. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-05-01 +// Generated from API version 2024-05-02-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - resourceName - The name of the managed cluster resource. // - options - ManagedClustersClientGetOptions contains the optional parameters for the ManagedClustersClient.Get method. @@ -329,7 +342,7 @@ func (client *ManagedClustersClient) getCreateRequest(ctx context.Context, resou return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-05-02-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -349,7 +362,7 @@ func (client *ManagedClustersClient) getHandleResponse(resp *http.Response) (Man // [https://docs.microsoft.com/rest/api/aks/managedclusters/listclusteradmincredentials] . // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-05-01 +// Generated from API version 2024-05-02-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - resourceName - The name of the managed cluster resource. // - roleName - The name of the role for managed cluster accessProfile resource. @@ -401,7 +414,7 @@ func (client *ManagedClustersClient) getAccessProfileCreateRequest(ctx context.C return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-05-02-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -419,7 +432,7 @@ func (client *ManagedClustersClient) getAccessProfileHandleResponse(resp *http.R // GetCommandResult - Gets the results of a command which has been run on the Managed Cluster. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-05-01 +// Generated from API version 2024-05-02-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - resourceName - The name of the managed cluster resource. // - commandID - Id of the command. @@ -471,7 +484,7 @@ func (client *ManagedClustersClient) getCommandResultCreateRequest(ctx context.C return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-05-02-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -489,11 +502,76 @@ func (client *ManagedClustersClient) getCommandResultHandleResponse(resp *http.R return result, nil } +// GetGuardrailsVersions - Contains Guardrails version along with its support info and whether it is a default version. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2024-05-02-preview +// - location - The name of the Azure region. +// - version - Safeguards version +// - options - ManagedClustersClientGetGuardrailsVersionsOptions contains the optional parameters for the ManagedClustersClient.GetGuardrailsVersions +// method. +func (client *ManagedClustersClient) GetGuardrailsVersions(ctx context.Context, location string, version string, options *ManagedClustersClientGetGuardrailsVersionsOptions) (ManagedClustersClientGetGuardrailsVersionsResponse, error) { + var err error + const operationName = "ManagedClustersClient.GetGuardrailsVersions" + ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) + ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) + defer func() { endSpan(err) }() + req, err := client.getGuardrailsVersionsCreateRequest(ctx, location, version, options) + if err != nil { + return ManagedClustersClientGetGuardrailsVersionsResponse{}, err + } + httpResp, err := client.internal.Pipeline().Do(req) + if err != nil { + return ManagedClustersClientGetGuardrailsVersionsResponse{}, err + } + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return ManagedClustersClientGetGuardrailsVersionsResponse{}, err + } + resp, err := client.getGuardrailsVersionsHandleResponse(httpResp) + return resp, err +} + +// getGuardrailsVersionsCreateRequest creates the GetGuardrailsVersions request. +func (client *ManagedClustersClient) getGuardrailsVersionsCreateRequest(ctx context.Context, location string, version string, options *ManagedClustersClientGetGuardrailsVersionsOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.ContainerService/locations/{location}/guardrailsVersions/{version}" + 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)) + if version == "" { + return nil, errors.New("parameter version cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{version}", url.PathEscape(version)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2024-05-02-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// getGuardrailsVersionsHandleResponse handles the GetGuardrailsVersions response. +func (client *ManagedClustersClient) getGuardrailsVersionsHandleResponse(resp *http.Response) (ManagedClustersClientGetGuardrailsVersionsResponse, error) { + result := ManagedClustersClientGetGuardrailsVersionsResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.GuardrailsAvailableVersion); err != nil { + return ManagedClustersClientGetGuardrailsVersionsResponse{}, err + } + return result, nil +} + // GetMeshRevisionProfile - Contains extra metadata on the revision, including supported revisions, cluster compatibility // and available upgrades // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-05-01 +// Generated from API version 2024-05-02-preview // - location - The name of the Azure region. // - mode - The mode of the mesh. // - options - ManagedClustersClientGetMeshRevisionProfileOptions contains the optional parameters for the ManagedClustersClient.GetMeshRevisionProfile @@ -540,7 +618,7 @@ func (client *ManagedClustersClient) getMeshRevisionProfileCreateRequest(ctx con return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-05-02-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -558,7 +636,7 @@ func (client *ManagedClustersClient) getMeshRevisionProfileHandleResponse(resp * // GetMeshUpgradeProfile - Gets available upgrades for a service mesh in a cluster. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-05-01 +// Generated from API version 2024-05-02-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - resourceName - The name of the managed cluster resource. // - mode - The mode of the mesh. @@ -610,7 +688,7 @@ func (client *ManagedClustersClient) getMeshUpgradeProfileCreateRequest(ctx cont return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-05-02-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -625,10 +703,75 @@ func (client *ManagedClustersClient) getMeshUpgradeProfileHandleResponse(resp *h return result, nil } +// GetSafeguardsVersions - Contains Safeguards version along with its support info and whether it is a default version. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2024-05-02-preview +// - location - The name of the Azure region. +// - version - Safeguards version +// - options - ManagedClustersClientGetSafeguardsVersionsOptions contains the optional parameters for the ManagedClustersClient.GetSafeguardsVersions +// method. +func (client *ManagedClustersClient) GetSafeguardsVersions(ctx context.Context, location string, version string, options *ManagedClustersClientGetSafeguardsVersionsOptions) (ManagedClustersClientGetSafeguardsVersionsResponse, error) { + var err error + const operationName = "ManagedClustersClient.GetSafeguardsVersions" + ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) + ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) + defer func() { endSpan(err) }() + req, err := client.getSafeguardsVersionsCreateRequest(ctx, location, version, options) + if err != nil { + return ManagedClustersClientGetSafeguardsVersionsResponse{}, err + } + httpResp, err := client.internal.Pipeline().Do(req) + if err != nil { + return ManagedClustersClientGetSafeguardsVersionsResponse{}, err + } + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return ManagedClustersClientGetSafeguardsVersionsResponse{}, err + } + resp, err := client.getSafeguardsVersionsHandleResponse(httpResp) + return resp, err +} + +// getSafeguardsVersionsCreateRequest creates the GetSafeguardsVersions request. +func (client *ManagedClustersClient) getSafeguardsVersionsCreateRequest(ctx context.Context, location string, version string, options *ManagedClustersClientGetSafeguardsVersionsOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.ContainerService/locations/{location}/safeguardsVersions/{version}" + 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)) + if version == "" { + return nil, errors.New("parameter version cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{version}", url.PathEscape(version)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2024-05-02-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// getSafeguardsVersionsHandleResponse handles the GetSafeguardsVersions response. +func (client *ManagedClustersClient) getSafeguardsVersionsHandleResponse(resp *http.Response) (ManagedClustersClientGetSafeguardsVersionsResponse, error) { + result := ManagedClustersClientGetSafeguardsVersionsResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.SafeguardsAvailableVersion); err != nil { + return ManagedClustersClientGetSafeguardsVersionsResponse{}, err + } + return result, nil +} + // GetUpgradeProfile - Gets the upgrade profile of a managed cluster. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-05-01 +// Generated from API version 2024-05-02-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - resourceName - The name of the managed cluster resource. // - options - ManagedClustersClientGetUpgradeProfileOptions contains the optional parameters for the ManagedClustersClient.GetUpgradeProfile @@ -675,7 +818,7 @@ func (client *ManagedClustersClient) getUpgradeProfileCreateRequest(ctx context. return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-05-02-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -692,7 +835,7 @@ func (client *ManagedClustersClient) getUpgradeProfileHandleResponse(resp *http. // NewListPager - Gets a list of managed clusters in the specified subscription. // -// Generated from API version 2024-05-01 +// Generated from API version 2024-05-02-preview // - options - ManagedClustersClientListOptions contains the optional parameters for the ManagedClustersClient.NewListPager // method. func (client *ManagedClustersClient) NewListPager(options *ManagedClustersClientListOptions) *runtime.Pager[ManagedClustersClientListResponse] { @@ -730,7 +873,7 @@ func (client *ManagedClustersClient) listCreateRequest(ctx context.Context, opti return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-05-02-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -747,7 +890,7 @@ func (client *ManagedClustersClient) listHandleResponse(resp *http.Response) (Ma // NewListByResourceGroupPager - Lists managed clusters in the specified subscription and resource group. // -// Generated from API version 2024-05-01 +// Generated from API version 2024-05-02-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - options - ManagedClustersClientListByResourceGroupOptions contains the optional parameters for the ManagedClustersClient.NewListByResourceGroupPager // method. @@ -790,7 +933,7 @@ func (client *ManagedClustersClient) listByResourceGroupCreateRequest(ctx contex return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-05-02-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -808,7 +951,7 @@ func (client *ManagedClustersClient) listByResourceGroupHandleResponse(resp *htt // ListClusterAdminCredentials - Lists the admin credentials of a managed cluster. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-05-01 +// Generated from API version 2024-05-02-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - resourceName - The name of the managed cluster resource. // - options - ManagedClustersClientListClusterAdminCredentialsOptions contains the optional parameters for the ManagedClustersClient.ListClusterAdminCredentials @@ -855,7 +998,7 @@ func (client *ManagedClustersClient) listClusterAdminCredentialsCreateRequest(ct return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-05-02-preview") if options != nil && options.ServerFqdn != nil { reqQP.Set("server-fqdn", *options.ServerFqdn) } @@ -876,7 +1019,7 @@ func (client *ManagedClustersClient) listClusterAdminCredentialsHandleResponse(r // ListClusterMonitoringUserCredentials - Lists the cluster monitoring user credentials of a managed cluster. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-05-01 +// Generated from API version 2024-05-02-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - resourceName - The name of the managed cluster resource. // - options - ManagedClustersClientListClusterMonitoringUserCredentialsOptions contains the optional parameters for the ManagedClustersClient.ListClusterMonitoringUserCredentials @@ -923,7 +1066,7 @@ func (client *ManagedClustersClient) listClusterMonitoringUserCredentialsCreateR return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-05-02-preview") if options != nil && options.ServerFqdn != nil { reqQP.Set("server-fqdn", *options.ServerFqdn) } @@ -944,7 +1087,7 @@ func (client *ManagedClustersClient) listClusterMonitoringUserCredentialsHandleR // ListClusterUserCredentials - Lists the user credentials of a managed cluster. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-05-01 +// Generated from API version 2024-05-02-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - resourceName - The name of the managed cluster resource. // - options - ManagedClustersClientListClusterUserCredentialsOptions contains the optional parameters for the ManagedClustersClient.ListClusterUserCredentials @@ -991,7 +1134,7 @@ func (client *ManagedClustersClient) listClusterUserCredentialsCreateRequest(ctx return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-05-02-preview") if options != nil && options.Format != nil { reqQP.Set("format", string(*options.Format)) } @@ -1012,11 +1155,72 @@ func (client *ManagedClustersClient) listClusterUserCredentialsHandleResponse(re return result, nil } +// NewListGuardrailsVersionsPager - Contains list of Guardrails version along with its support info and whether it is a default +// version. +// +// Generated from API version 2024-05-02-preview +// - location - The name of the Azure region. +// - options - ManagedClustersClientListGuardrailsVersionsOptions contains the optional parameters for the ManagedClustersClient.NewListGuardrailsVersionsPager +// method. +func (client *ManagedClustersClient) NewListGuardrailsVersionsPager(location string, options *ManagedClustersClientListGuardrailsVersionsOptions) *runtime.Pager[ManagedClustersClientListGuardrailsVersionsResponse] { + return runtime.NewPager(runtime.PagingHandler[ManagedClustersClientListGuardrailsVersionsResponse]{ + More: func(page ManagedClustersClientListGuardrailsVersionsResponse) bool { + return page.NextLink != nil && len(*page.NextLink) > 0 + }, + Fetcher: func(ctx context.Context, page *ManagedClustersClientListGuardrailsVersionsResponse) (ManagedClustersClientListGuardrailsVersionsResponse, error) { + ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, "ManagedClustersClient.NewListGuardrailsVersionsPager") + nextLink := "" + if page != nil { + nextLink = *page.NextLink + } + resp, err := runtime.FetcherForNextLink(ctx, client.internal.Pipeline(), nextLink, func(ctx context.Context) (*policy.Request, error) { + return client.listGuardrailsVersionsCreateRequest(ctx, location, options) + }, nil) + if err != nil { + return ManagedClustersClientListGuardrailsVersionsResponse{}, err + } + return client.listGuardrailsVersionsHandleResponse(resp) + }, + Tracer: client.internal.Tracer(), + }) +} + +// listGuardrailsVersionsCreateRequest creates the ListGuardrailsVersions request. +func (client *ManagedClustersClient) listGuardrailsVersionsCreateRequest(ctx context.Context, location string, options *ManagedClustersClientListGuardrailsVersionsOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.ContainerService/locations/{location}/guardrailsVersions" + 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 := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2024-05-02-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// listGuardrailsVersionsHandleResponse handles the ListGuardrailsVersions response. +func (client *ManagedClustersClient) listGuardrailsVersionsHandleResponse(resp *http.Response) (ManagedClustersClientListGuardrailsVersionsResponse, error) { + result := ManagedClustersClientListGuardrailsVersionsResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.GuardrailsAvailableVersionsList); err != nil { + return ManagedClustersClientListGuardrailsVersionsResponse{}, err + } + return result, nil +} + // ListKubernetesVersions - Contains extra metadata on the version, including supported patch versions, capabilities, available // upgrades, and details on preview status of the version // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-05-01 +// Generated from API version 2024-05-02-preview // - location - The name of the Azure region. // - options - ManagedClustersClientListKubernetesVersionsOptions contains the optional parameters for the ManagedClustersClient.ListKubernetesVersions // method. @@ -1058,7 +1262,7 @@ func (client *ManagedClustersClient) listKubernetesVersionsCreateRequest(ctx con return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-05-02-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -1076,7 +1280,7 @@ func (client *ManagedClustersClient) listKubernetesVersionsHandleResponse(resp * // NewListMeshRevisionProfilesPager - Contains extra metadata on each revision, including supported revisions, cluster compatibility // and available upgrades // -// Generated from API version 2024-05-01 +// Generated from API version 2024-05-02-preview // - location - The name of the Azure region. // - options - ManagedClustersClientListMeshRevisionProfilesOptions contains the optional parameters for the ManagedClustersClient.NewListMeshRevisionProfilesPager // method. @@ -1119,7 +1323,7 @@ func (client *ManagedClustersClient) listMeshRevisionProfilesCreateRequest(ctx c return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-05-02-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -1136,7 +1340,7 @@ func (client *ManagedClustersClient) listMeshRevisionProfilesHandleResponse(resp // NewListMeshUpgradeProfilesPager - Lists available upgrades for all service meshes in a specific cluster. // -// Generated from API version 2024-05-01 +// Generated from API version 2024-05-02-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - resourceName - The name of the managed cluster resource. // - options - ManagedClustersClientListMeshUpgradeProfilesOptions contains the optional parameters for the ManagedClustersClient.NewListMeshUpgradeProfilesPager @@ -1184,7 +1388,7 @@ func (client *ManagedClustersClient) listMeshUpgradeProfilesCreateRequest(ctx co return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-05-02-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -1202,7 +1406,7 @@ func (client *ManagedClustersClient) listMeshUpgradeProfilesHandleResponse(resp // NewListOutboundNetworkDependenciesEndpointsPager - 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. // -// Generated from API version 2024-05-01 +// Generated from API version 2024-05-02-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - resourceName - The name of the managed cluster resource. // - options - ManagedClustersClientListOutboundNetworkDependenciesEndpointsOptions contains the optional parameters for the @@ -1250,7 +1454,7 @@ func (client *ManagedClustersClient) listOutboundNetworkDependenciesEndpointsCre return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-05-02-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -1265,11 +1469,152 @@ func (client *ManagedClustersClient) listOutboundNetworkDependenciesEndpointsHan return result, nil } +// NewListSafeguardsVersionsPager - Contains list of Safeguards version along with its support info and whether it is a default +// version. +// +// Generated from API version 2024-05-02-preview +// - location - The name of the Azure region. +// - options - ManagedClustersClientListSafeguardsVersionsOptions contains the optional parameters for the ManagedClustersClient.NewListSafeguardsVersionsPager +// method. +func (client *ManagedClustersClient) NewListSafeguardsVersionsPager(location string, options *ManagedClustersClientListSafeguardsVersionsOptions) *runtime.Pager[ManagedClustersClientListSafeguardsVersionsResponse] { + return runtime.NewPager(runtime.PagingHandler[ManagedClustersClientListSafeguardsVersionsResponse]{ + More: func(page ManagedClustersClientListSafeguardsVersionsResponse) bool { + return page.NextLink != nil && len(*page.NextLink) > 0 + }, + Fetcher: func(ctx context.Context, page *ManagedClustersClientListSafeguardsVersionsResponse) (ManagedClustersClientListSafeguardsVersionsResponse, error) { + ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, "ManagedClustersClient.NewListSafeguardsVersionsPager") + nextLink := "" + if page != nil { + nextLink = *page.NextLink + } + resp, err := runtime.FetcherForNextLink(ctx, client.internal.Pipeline(), nextLink, func(ctx context.Context) (*policy.Request, error) { + return client.listSafeguardsVersionsCreateRequest(ctx, location, options) + }, nil) + if err != nil { + return ManagedClustersClientListSafeguardsVersionsResponse{}, err + } + return client.listSafeguardsVersionsHandleResponse(resp) + }, + Tracer: client.internal.Tracer(), + }) +} + +// listSafeguardsVersionsCreateRequest creates the ListSafeguardsVersions request. +func (client *ManagedClustersClient) listSafeguardsVersionsCreateRequest(ctx context.Context, location string, options *ManagedClustersClientListSafeguardsVersionsOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.ContainerService/locations/{location}/safeguardsVersions" + 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 := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2024-05-02-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// listSafeguardsVersionsHandleResponse handles the ListSafeguardsVersions response. +func (client *ManagedClustersClient) listSafeguardsVersionsHandleResponse(resp *http.Response) (ManagedClustersClientListSafeguardsVersionsResponse, error) { + result := ManagedClustersClientListSafeguardsVersionsResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.SafeguardsAvailableVersionsList); err != nil { + return ManagedClustersClientListSafeguardsVersionsResponse{}, err + } + return result, nil +} + +// BeginRebalanceLoadBalancers - Rebalance nodes across specific load balancers. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2024-05-02-preview +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - resourceName - The name of the managed cluster resource. +// - parameters - The names of the load balancers to be rebalanced. If set to empty, all load balancers will be rebalanced. +// - options - ManagedClustersClientBeginRebalanceLoadBalancersOptions contains the optional parameters for the ManagedClustersClient.BeginRebalanceLoadBalancers +// method. +func (client *ManagedClustersClient) BeginRebalanceLoadBalancers(ctx context.Context, resourceGroupName string, resourceName string, parameters RebalanceLoadBalancersRequestBody, options *ManagedClustersClientBeginRebalanceLoadBalancersOptions) (*runtime.Poller[ManagedClustersClientRebalanceLoadBalancersResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.rebalanceLoadBalancers(ctx, resourceGroupName, resourceName, parameters, options) + if err != nil { + return nil, err + } + poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[ManagedClustersClientRebalanceLoadBalancersResponse]{ + Tracer: client.internal.Tracer(), + }) + return poller, err + } else { + return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[ManagedClustersClientRebalanceLoadBalancersResponse]{ + Tracer: client.internal.Tracer(), + }) + } +} + +// RebalanceLoadBalancers - Rebalance nodes across specific load balancers. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2024-05-02-preview +func (client *ManagedClustersClient) rebalanceLoadBalancers(ctx context.Context, resourceGroupName string, resourceName string, parameters RebalanceLoadBalancersRequestBody, options *ManagedClustersClientBeginRebalanceLoadBalancersOptions) (*http.Response, error) { + var err error + const operationName = "ManagedClustersClient.BeginRebalanceLoadBalancers" + ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) + ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) + defer func() { endSpan(err) }() + req, err := client.rebalanceLoadBalancersCreateRequest(ctx, resourceGroupName, resourceName, parameters, options) + if err != nil { + return nil, err + } + httpResp, err := client.internal.Pipeline().Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(httpResp, http.StatusAccepted) { + err = runtime.NewResponseError(httpResp) + return nil, err + } + return httpResp, nil +} + +// rebalanceLoadBalancersCreateRequest creates the RebalanceLoadBalancers request. +func (client *ManagedClustersClient) rebalanceLoadBalancersCreateRequest(ctx context.Context, resourceGroupName string, resourceName string, parameters RebalanceLoadBalancersRequestBody, options *ManagedClustersClientBeginRebalanceLoadBalancersOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/rebalanceLoadBalancers" + 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 := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2024-05-02-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + if err := runtime.MarshalAsJSON(req, parameters); err != nil { + return nil, err + } + return req, nil +} + // BeginResetAADProfile - WARNING: This API will be deprecated. Please see AKS-managed Azure Active Directory integration // [https://aka.ms/aks-managed-aad] to update your cluster with AKS-managed Azure AD. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-05-01 +// Generated from API version 2024-05-02-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - resourceName - The name of the managed cluster resource. // - parameters - The AAD profile to set on the Managed Cluster @@ -1297,7 +1642,7 @@ func (client *ManagedClustersClient) BeginResetAADProfile(ctx context.Context, r // to update your cluster with AKS-managed Azure AD. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-05-01 +// Generated from API version 2024-05-02-preview func (client *ManagedClustersClient) resetAADProfile(ctx context.Context, resourceGroupName string, resourceName string, parameters ManagedClusterAADProfile, options *ManagedClustersClientBeginResetAADProfileOptions) (*http.Response, error) { var err error const operationName = "ManagedClustersClient.BeginResetAADProfile" @@ -1339,7 +1684,7 @@ func (client *ManagedClustersClient) resetAADProfileCreateRequest(ctx context.Co return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-05-02-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { @@ -1351,7 +1696,7 @@ func (client *ManagedClustersClient) resetAADProfileCreateRequest(ctx context.Co // BeginResetServicePrincipalProfile - This action cannot be performed on a cluster that is not using a service principal // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-05-01 +// Generated from API version 2024-05-02-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - resourceName - The name of the managed cluster resource. // - parameters - The service principal profile to set on the managed cluster. @@ -1378,7 +1723,7 @@ func (client *ManagedClustersClient) BeginResetServicePrincipalProfile(ctx conte // ResetServicePrincipalProfile - This action cannot be performed on a cluster that is not using a service principal // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-05-01 +// Generated from API version 2024-05-02-preview func (client *ManagedClustersClient) resetServicePrincipalProfile(ctx context.Context, resourceGroupName string, resourceName string, parameters ManagedClusterServicePrincipalProfile, options *ManagedClustersClientBeginResetServicePrincipalProfileOptions) (*http.Response, error) { var err error const operationName = "ManagedClustersClient.BeginResetServicePrincipalProfile" @@ -1420,7 +1765,7 @@ func (client *ManagedClustersClient) resetServicePrincipalProfileCreateRequest(c return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-05-02-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { @@ -1433,7 +1778,7 @@ func (client *ManagedClustersClient) resetServicePrincipalProfileCreateRequest(c // more details about rotating managed cluster certificates. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-05-01 +// Generated from API version 2024-05-02-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - resourceName - The name of the managed cluster resource. // - options - ManagedClustersClientBeginRotateClusterCertificatesOptions contains the optional parameters for the ManagedClustersClient.BeginRotateClusterCertificates @@ -1460,7 +1805,7 @@ func (client *ManagedClustersClient) BeginRotateClusterCertificates(ctx context. // details about rotating managed cluster certificates. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-05-01 +// Generated from API version 2024-05-02-preview func (client *ManagedClustersClient) rotateClusterCertificates(ctx context.Context, resourceGroupName string, resourceName string, options *ManagedClustersClientBeginRotateClusterCertificatesOptions) (*http.Response, error) { var err error const operationName = "ManagedClustersClient.BeginRotateClusterCertificates" @@ -1502,7 +1847,7 @@ func (client *ManagedClustersClient) rotateClusterCertificatesCreateRequest(ctx return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-05-02-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -1511,7 +1856,7 @@ func (client *ManagedClustersClient) rotateClusterCertificatesCreateRequest(ctx // BeginRotateServiceAccountSigningKeys - Rotates the service account signing keys of a managed cluster. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-05-01 +// Generated from API version 2024-05-02-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - resourceName - The name of the managed cluster resource. // - options - ManagedClustersClientBeginRotateServiceAccountSigningKeysOptions contains the optional parameters for the ManagedClustersClient.BeginRotateServiceAccountSigningKeys @@ -1537,7 +1882,7 @@ func (client *ManagedClustersClient) BeginRotateServiceAccountSigningKeys(ctx co // RotateServiceAccountSigningKeys - Rotates the service account signing keys of a managed cluster. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-05-01 +// Generated from API version 2024-05-02-preview func (client *ManagedClustersClient) rotateServiceAccountSigningKeys(ctx context.Context, resourceGroupName string, resourceName string, options *ManagedClustersClientBeginRotateServiceAccountSigningKeysOptions) (*http.Response, error) { var err error const operationName = "ManagedClustersClient.BeginRotateServiceAccountSigningKeys" @@ -1579,7 +1924,7 @@ func (client *ManagedClustersClient) rotateServiceAccountSigningKeysCreateReques return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-05-02-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -1590,7 +1935,7 @@ func (client *ManagedClustersClient) rotateServiceAccountSigningKeysCreateReques // [https://docs.microsoft.com/azure/aks/private-clusters#aks-run-command-preview]. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-05-01 +// Generated from API version 2024-05-02-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - resourceName - The name of the managed cluster resource. // - requestPayload - The run command request @@ -1619,7 +1964,7 @@ func (client *ManagedClustersClient) BeginRunCommand(ctx context.Context, resour // [https://docs.microsoft.com/azure/aks/private-clusters#aks-run-command-preview]. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-05-01 +// Generated from API version 2024-05-02-preview func (client *ManagedClustersClient) runCommand(ctx context.Context, resourceGroupName string, resourceName string, requestPayload RunCommandRequest, options *ManagedClustersClientBeginRunCommandOptions) (*http.Response, error) { var err error const operationName = "ManagedClustersClient.BeginRunCommand" @@ -1661,7 +2006,7 @@ func (client *ManagedClustersClient) runCommandCreateRequest(ctx context.Context return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-05-02-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, requestPayload); err != nil { @@ -1674,7 +2019,7 @@ func (client *ManagedClustersClient) runCommandCreateRequest(ctx context.Context // a cluster. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-05-01 +// Generated from API version 2024-05-02-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - resourceName - The name of the managed cluster resource. // - options - ManagedClustersClientBeginStartOptions contains the optional parameters for the ManagedClustersClient.BeginStart @@ -1701,7 +2046,7 @@ func (client *ManagedClustersClient) BeginStart(ctx context.Context, resourceGro // a cluster. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-05-01 +// Generated from API version 2024-05-02-preview func (client *ManagedClustersClient) start(ctx context.Context, resourceGroupName string, resourceName string, options *ManagedClustersClientBeginStartOptions) (*http.Response, error) { var err error const operationName = "ManagedClustersClient.BeginStart" @@ -1743,7 +2088,7 @@ func (client *ManagedClustersClient) startCreateRequest(ctx context.Context, res return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-05-02-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -1755,7 +2100,7 @@ func (client *ManagedClustersClient) startCreateRequest(ctx context.Context, res // for more details about stopping a cluster. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-05-01 +// Generated from API version 2024-05-02-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - resourceName - The name of the managed cluster resource. // - options - ManagedClustersClientBeginStopOptions contains the optional parameters for the ManagedClustersClient.BeginStop @@ -1784,7 +2129,7 @@ func (client *ManagedClustersClient) BeginStop(ctx context.Context, resourceGrou // for more details about stopping a cluster. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-05-01 +// Generated from API version 2024-05-02-preview func (client *ManagedClustersClient) stop(ctx context.Context, resourceGroupName string, resourceName string, options *ManagedClustersClientBeginStopOptions) (*http.Response, error) { var err error const operationName = "ManagedClustersClient.BeginStop" @@ -1826,7 +2171,7 @@ func (client *ManagedClustersClient) stopCreateRequest(ctx context.Context, reso return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-05-02-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -1835,7 +2180,7 @@ func (client *ManagedClustersClient) stopCreateRequest(ctx context.Context, reso // BeginUpdateTags - Updates tags on a managed cluster. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-05-01 +// Generated from API version 2024-05-02-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - resourceName - The name of the managed cluster resource. // - parameters - Parameters supplied to the Update Managed Cluster Tags operation. @@ -1861,7 +2206,7 @@ func (client *ManagedClustersClient) BeginUpdateTags(ctx context.Context, resour // UpdateTags - Updates tags on a managed cluster. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-05-01 +// Generated from API version 2024-05-02-preview func (client *ManagedClustersClient) updateTags(ctx context.Context, resourceGroupName string, resourceName string, parameters TagsObject, options *ManagedClustersClientBeginUpdateTagsOptions) (*http.Response, error) { var err error const operationName = "ManagedClustersClient.BeginUpdateTags" @@ -1903,9 +2248,12 @@ func (client *ManagedClustersClient) updateTagsCreateRequest(ctx context.Context return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-05-02-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} + if options != nil && options.IfMatch != nil { + req.Raw().Header["If-Match"] = []string{*options.IfMatch} + } if err := runtime.MarshalAsJSON(req, parameters); err != nil { return nil, err } diff --git a/sdk/resourcemanager/containerservice/armcontainerservice/managedclusters_client_example_test.go b/sdk/resourcemanager/containerservice/armcontainerservice/managedclusters_client_example_test.go index 6231c05b6f29..674440c88171 100644 --- a/sdk/resourcemanager/containerservice/armcontainerservice/managedclusters_client_example_test.go +++ b/sdk/resourcemanager/containerservice/armcontainerservice/managedclusters_client_example_test.go @@ -20,7 +20,7 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/containerservice/armcontainerservice/v6" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/8cbd903b0d037c427def0e8fbf167b26e87bd1a9/specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2024-05-01/examples/KubernetesVersions_List.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c7b98b36e4023331545051284d8500adf98f02fe/specification/containerservice/resource-manager/Microsoft.ContainerService/aks/preview/2024-05-02-preview/examples/KubernetesVersions_List.json func ExampleManagedClustersClient_ListKubernetesVersions() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -116,7 +116,7 @@ func ExampleManagedClustersClient_ListKubernetesVersions() { // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/8cbd903b0d037c427def0e8fbf167b26e87bd1a9/specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2024-05-01/examples/ManagedClustersList.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c7b98b36e4023331545051284d8500adf98f02fe/specification/containerservice/resource-manager/Microsoft.ContainerService/aks/preview/2024-05-02-preview/examples/ManagedClustersList.json func ExampleManagedClustersClient_NewListPager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -143,17 +143,19 @@ func ExampleManagedClustersClient_NewListPager() { // { // Name: to.Ptr("clustername1"), // Type: to.Ptr("Microsoft.ContainerService/ManagedClusters"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/rg1/providers/Microsoft.ContainerService/managedClusters/clustername1"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.ContainerService/managedClusters/clustername1"), // Location: to.Ptr("location1"), // Tags: map[string]*string{ // "archv2": to.Ptr(""), // "tier": to.Ptr("production"), // }, + // ETag: to.Ptr("nvweuib"), // Properties: &armcontainerservice.ManagedClusterProperties{ // AgentPoolProfiles: []*armcontainerservice.ManagedClusterAgentPoolProfile{ // { // Count: to.Ptr[int32](3), // CurrentOrchestratorVersion: to.Ptr("1.9.6"), + // ETag: to.Ptr("byuefvwi"), // MaxPods: to.Ptr[int32](110), // OrchestratorVersion: to.Ptr("1.9.6"), // OSType: to.Ptr(armcontainerservice.OSTypeLinux), @@ -161,8 +163,7 @@ func ExampleManagedClustersClient_NewListPager() { // VMSize: to.Ptr("Standard_DS1_v2"), // Name: to.Ptr("nodepool1"), // }}, - // CurrentKubernetesVersion: to.Ptr("1.9.6"), - // DiskEncryptionSetID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/rg1/providers/Microsoft.Compute/diskEncryptionSets/des"), + // DiskEncryptionSetID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Compute/diskEncryptionSets/des"), // DNSPrefix: to.Ptr("dnsprefix1"), // EnableRBAC: to.Ptr(false), // Fqdn: to.Ptr("dnsprefix1-abcd1234.hcp.eastus.azmk8s.io"), @@ -194,7 +195,7 @@ func ExampleManagedClustersClient_NewListPager() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/8cbd903b0d037c427def0e8fbf167b26e87bd1a9/specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2024-05-01/examples/ManagedClustersListByResourceGroup.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c7b98b36e4023331545051284d8500adf98f02fe/specification/containerservice/resource-manager/Microsoft.ContainerService/aks/preview/2024-05-02-preview/examples/ManagedClustersListByResourceGroup.json func ExampleManagedClustersClient_NewListByResourceGroupPager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -239,8 +240,7 @@ func ExampleManagedClustersClient_NewListByResourceGroupPager() { // VMSize: to.Ptr("Standard_DS1_v2"), // Name: to.Ptr("nodepool1"), // }}, - // CurrentKubernetesVersion: to.Ptr("1.9.6"), - // DiskEncryptionSetID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/rg1/providers/Microsoft.Compute/diskEncryptionSets/des"), + // DiskEncryptionSetID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Compute/diskEncryptionSets/des"), // DNSPrefix: to.Ptr("dnsprefix1"), // EnableRBAC: to.Ptr(false), // Fqdn: to.Ptr("dnsprefix1-abcd1234.hcp.eastus.azmk8s.io"), @@ -272,7 +272,7 @@ func ExampleManagedClustersClient_NewListByResourceGroupPager() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/8cbd903b0d037c427def0e8fbf167b26e87bd1a9/specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2024-05-01/examples/ManagedClustersGetUpgradeProfile.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c7b98b36e4023331545051284d8500adf98f02fe/specification/containerservice/resource-manager/Microsoft.ContainerService/aks/preview/2024-05-02-preview/examples/ManagedClustersGetUpgradeProfile.json func ExampleManagedClustersClient_GetUpgradeProfile() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -326,7 +326,7 @@ func ExampleManagedClustersClient_GetUpgradeProfile() { // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/8cbd903b0d037c427def0e8fbf167b26e87bd1a9/specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2024-05-01/examples/ManagedClustersGetAccessProfile.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c7b98b36e4023331545051284d8500adf98f02fe/specification/containerservice/resource-manager/Microsoft.ContainerService/aks/preview/2024-05-02-preview/examples/ManagedClustersGetAccessProfile.json func ExampleManagedClustersClient_GetAccessProfile() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -355,7 +355,7 @@ func ExampleManagedClustersClient_GetAccessProfile() { // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/8cbd903b0d037c427def0e8fbf167b26e87bd1a9/specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2024-05-01/examples/ManagedClustersListClusterAdminCredentials.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c7b98b36e4023331545051284d8500adf98f02fe/specification/containerservice/resource-manager/Microsoft.ContainerService/aks/preview/2024-05-02-preview/examples/ManagedClustersListClusterCredentialResult.json func ExampleManagedClustersClient_ListClusterAdminCredentials() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -382,63 +382,7 @@ func ExampleManagedClustersClient_ListClusterAdminCredentials() { // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/8cbd903b0d037c427def0e8fbf167b26e87bd1a9/specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2024-05-01/examples/ManagedClustersListClusterUserCredentials.json -func ExampleManagedClustersClient_ListClusterUserCredentials() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcontainerservice.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewManagedClustersClient().ListClusterUserCredentials(ctx, "rg1", "clustername1", &armcontainerservice.ManagedClustersClientListClusterUserCredentialsOptions{ServerFqdn: nil, - Format: nil, - }) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.CredentialResults = armcontainerservice.CredentialResults{ - // Kubeconfigs: []*armcontainerservice.CredentialResult{ - // { - // Name: to.Ptr("credentialName1"), - // Value: []byte("Y3JlZGVudGlhbFZhbHVlMQ=="), - // }}, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/8cbd903b0d037c427def0e8fbf167b26e87bd1a9/specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2024-05-01/examples/ManagedClustersListClusterMonitoringUserCredentials.json -func ExampleManagedClustersClient_ListClusterMonitoringUserCredentials() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcontainerservice.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewManagedClustersClient().ListClusterMonitoringUserCredentials(ctx, "rg1", "clustername1", &armcontainerservice.ManagedClustersClientListClusterMonitoringUserCredentialsOptions{ServerFqdn: nil}) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.CredentialResults = armcontainerservice.CredentialResults{ - // Kubeconfigs: []*armcontainerservice.CredentialResult{ - // { - // Name: to.Ptr("credentialName1"), - // Value: []byte("Y3JlZGVudGlhbFZhbHVlMQ=="), - // }}, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/8cbd903b0d037c427def0e8fbf167b26e87bd1a9/specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2024-05-01/examples/ManagedClustersGet.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c7b98b36e4023331545051284d8500adf98f02fe/specification/containerservice/resource-manager/Microsoft.ContainerService/aks/preview/2024-05-02-preview/examples/ManagedClustersGet.json func ExampleManagedClustersClient_Get() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -465,6 +409,7 @@ func ExampleManagedClustersClient_Get() { // "archv2": to.Ptr(""), // "tier": to.Ptr("production"), // }, + // ETag: to.Ptr("beywbwei"), // Properties: &armcontainerservice.ManagedClusterProperties{ // AgentPoolProfiles: []*armcontainerservice.ManagedClusterAgentPoolProfile{ // { @@ -474,6 +419,7 @@ func ExampleManagedClustersClient_Get() { // to.Ptr("3")}, // Count: to.Ptr[int32](3), // CurrentOrchestratorVersion: to.Ptr("1.9.6"), + // ETag: to.Ptr("nvewbvoi"), // MaxPods: to.Ptr[int32](110), // NodeImageVersion: to.Ptr("AKSUbuntu:1604:2020.03.11"), // OrchestratorVersion: to.Ptr("1.9.6"), @@ -486,8 +432,7 @@ func ExampleManagedClustersClient_Get() { // Name: to.Ptr("nodepool1"), // }}, // AzurePortalFQDN: to.Ptr("dnsprefix1-abcd1234.portal.hcp.eastus.azmk8s.io"), - // CurrentKubernetesVersion: to.Ptr("1.9.6"), - // DiskEncryptionSetID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/rg1/providers/Microsoft.Compute/diskEncryptionSets/des"), + // DiskEncryptionSetID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Compute/diskEncryptionSets/des"), // DNSPrefix: to.Ptr("dnsprefix1"), // EnableRBAC: to.Ptr(false), // Fqdn: to.Ptr("dnsprefix1-abcd1234.hcp.eastus.azmk8s.io"), @@ -510,19 +455,19 @@ func ExampleManagedClustersClient_Get() { // AllocatedOutboundPorts: to.Ptr[int32](2000), // EffectiveOutboundIPs: []*armcontainerservice.ResourceReference{ // { - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/MC_rg1/providers/Microsoft.Network/publicIPAddresses/mgdoutboundip1"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/MC_rg1/providers/Microsoft.Network/publicIPAddresses/mgdoutboundip1"), // }, // { - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/MC_rg1/providers/Microsoft.Network/publicIPAddresses/mgdoutboundip2"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/MC_rg1/providers/Microsoft.Network/publicIPAddresses/mgdoutboundip2"), // }}, // IdleTimeoutInMinutes: to.Ptr[int32](10), // OutboundIPs: &armcontainerservice.ManagedClusterLoadBalancerProfileOutboundIPs{ // PublicIPs: []*armcontainerservice.ResourceReference{ // { - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/rg1/providers/Microsoft.Network/publicIPAddresses/customeroutboundip1"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/publicIPAddresses/customeroutboundip1"), // }, // { - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/rg1/providers/Microsoft.Network/publicIPAddresses/customeroutboundip2"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/publicIPAddresses/customeroutboundip2"), // }}, // }, // }, @@ -551,7 +496,320 @@ func ExampleManagedClustersClient_Get() { // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/8cbd903b0d037c427def0e8fbf167b26e87bd1a9/specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2024-05-01/examples/ManagedClustersCreate_Snapshot.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c7b98b36e4023331545051284d8500adf98f02fe/specification/containerservice/resource-manager/Microsoft.ContainerService/aks/preview/2024-05-02-preview/examples/ManagedClustersAssociate_CRG.json +func ExampleManagedClustersClient_BeginCreateOrUpdate_associateManagedClusterWithCapacityReservationGroup() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + clientFactory, err := armcontainerservice.NewClientFactory("", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + poller, err := clientFactory.NewManagedClustersClient().BeginCreateOrUpdate(ctx, "rg1", "clustername1", armcontainerservice.ManagedCluster{ + Location: to.Ptr("location1"), + Tags: map[string]*string{ + "archv2": to.Ptr(""), + "tier": to.Ptr("production"), + }, + Properties: &armcontainerservice.ManagedClusterProperties{ + AddonProfiles: map[string]*armcontainerservice.ManagedClusterAddonProfile{}, + AgentPoolProfiles: []*armcontainerservice.ManagedClusterAgentPoolProfile{ + { + Type: to.Ptr(armcontainerservice.AgentPoolTypeVirtualMachineScaleSets), + CapacityReservationGroupID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/rg1/providers/Microsoft.Compute/capacityReservationGroups/crg1"), + Count: to.Ptr[int32](3), + EnableNodePublicIP: to.Ptr(true), + Mode: to.Ptr(armcontainerservice.AgentPoolModeSystem), + OSType: to.Ptr(armcontainerservice.OSTypeLinux), + VMSize: to.Ptr("Standard_DS2_v2"), + Name: to.Ptr("nodepool1"), + }}, + AutoScalerProfile: &armcontainerservice.ManagedClusterPropertiesAutoScalerProfile{ + ScaleDownDelayAfterAdd: to.Ptr("15m"), + ScanInterval: to.Ptr("20s"), + }, + DiskEncryptionSetID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Compute/diskEncryptionSets/des"), + DNSPrefix: to.Ptr("dnsprefix1"), + EnablePodSecurityPolicy: to.Ptr(true), + EnableRBAC: to.Ptr(true), + KubernetesVersion: to.Ptr(""), + LinuxProfile: &armcontainerservice.LinuxProfile{ + AdminUsername: to.Ptr("azureuser"), + SSH: &armcontainerservice.SSHConfiguration{ + PublicKeys: []*armcontainerservice.SSHPublicKey{ + { + KeyData: to.Ptr("keydata"), + }}, + }, + }, + NetworkProfile: &armcontainerservice.NetworkProfile{ + LoadBalancerProfile: &armcontainerservice.ManagedClusterLoadBalancerProfile{ + ManagedOutboundIPs: &armcontainerservice.ManagedClusterLoadBalancerProfileManagedOutboundIPs{ + Count: to.Ptr[int32](2), + }, + }, + LoadBalancerSKU: to.Ptr(armcontainerservice.LoadBalancerSKUStandard), + OutboundType: to.Ptr(armcontainerservice.OutboundTypeLoadBalancer), + }, + ServicePrincipalProfile: &armcontainerservice.ManagedClusterServicePrincipalProfile{ + ClientID: to.Ptr("clientid"), + Secret: to.Ptr("secret"), + }, + WindowsProfile: &armcontainerservice.ManagedClusterWindowsProfile{ + AdminPassword: to.Ptr("replacePassword1234$"), + AdminUsername: to.Ptr("azureuser"), + }, + }, + SKU: &armcontainerservice.ManagedClusterSKU{ + Name: to.Ptr(armcontainerservice.ManagedClusterSKUName("Basic")), + Tier: to.Ptr(armcontainerservice.ManagedClusterSKUTierFree), + }, + }, &armcontainerservice.ManagedClustersClientBeginCreateOrUpdateOptions{IfMatch: nil, + IfNoneMatch: nil, + }) + if err != nil { + log.Fatalf("failed to finish the request: %v", err) + } + res, err := poller.PollUntilDone(ctx, nil) + if err != nil { + log.Fatalf("failed to pull the result: %v", err) + } + // You could use response here. We use blank identifier for just demo purposes. + _ = res + // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. + // res.ManagedCluster = armcontainerservice.ManagedCluster{ + // Name: to.Ptr("clustername1"), + // Type: to.Ptr("Microsoft.ContainerService/ManagedClusters"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/rg1/providers/Microsoft.ContainerService/managedClusters/clustername1"), + // Location: to.Ptr("location1"), + // Tags: map[string]*string{ + // "archv2": to.Ptr(""), + // "tier": to.Ptr("production"), + // }, + // Properties: &armcontainerservice.ManagedClusterProperties{ + // AgentPoolProfiles: []*armcontainerservice.ManagedClusterAgentPoolProfile{ + // { + // Type: to.Ptr(armcontainerservice.AgentPoolTypeVirtualMachineScaleSets), + // CapacityReservationGroupID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/rg1/providers/Microsoft.Compute/capacityReservationGroups/crg1"), + // Count: to.Ptr[int32](3), + // CurrentOrchestratorVersion: to.Ptr("1.9.6"), + // EnableNodePublicIP: to.Ptr(true), + // MaxPods: to.Ptr[int32](110), + // Mode: to.Ptr(armcontainerservice.AgentPoolModeSystem), + // NodeImageVersion: to.Ptr("AKSUbuntu:1604:2020.03.11"), + // OrchestratorVersion: to.Ptr("1.9.6"), + // OSType: to.Ptr(armcontainerservice.OSTypeLinux), + // ProvisioningState: to.Ptr("Succeeded"), + // VMSize: to.Ptr("Standard_DS2_v2"), + // Name: to.Ptr("nodepool1"), + // }}, + // AutoScalerProfile: &armcontainerservice.ManagedClusterPropertiesAutoScalerProfile{ + // ScaleDownDelayAfterAdd: to.Ptr("15m"), + // ScanInterval: to.Ptr("20s"), + // }, + // DiskEncryptionSetID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Compute/diskEncryptionSets/des"), + // DNSPrefix: to.Ptr("dnsprefix1"), + // EnablePodSecurityPolicy: to.Ptr(true), + // EnableRBAC: to.Ptr(true), + // Fqdn: to.Ptr("dnsprefix1-abcd1234.hcp.eastus.azmk8s.io"), + // KubernetesVersion: to.Ptr("1.9.6"), + // LinuxProfile: &armcontainerservice.LinuxProfile{ + // AdminUsername: to.Ptr("azureuser"), + // SSH: &armcontainerservice.SSHConfiguration{ + // PublicKeys: []*armcontainerservice.SSHPublicKey{ + // { + // KeyData: to.Ptr("keydata"), + // }}, + // }, + // }, + // MaxAgentPools: to.Ptr[int32](1), + // NetworkProfile: &armcontainerservice.NetworkProfile{ + // DNSServiceIP: to.Ptr("10.0.0.10"), + // IPFamilies: []*armcontainerservice.IPFamily{ + // to.Ptr(armcontainerservice.IPFamilyIPv4)}, + // LoadBalancerProfile: &armcontainerservice.ManagedClusterLoadBalancerProfile{ + // AllocatedOutboundPorts: to.Ptr[int32](2000), + // EffectiveOutboundIPs: []*armcontainerservice.ResourceReference{ + // { + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/MC_rg1/providers/Microsoft.Network/publicIPAddresses/mgdoutboundip1"), + // }, + // { + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/MC_rg1/providers/Microsoft.Network/publicIPAddresses/mgdoutboundip2"), + // }}, + // IdleTimeoutInMinutes: to.Ptr[int32](10), + // ManagedOutboundIPs: &armcontainerservice.ManagedClusterLoadBalancerProfileManagedOutboundIPs{ + // Count: to.Ptr[int32](2), + // }, + // }, + // LoadBalancerSKU: to.Ptr(armcontainerservice.LoadBalancerSKUBasic), + // NetworkPlugin: to.Ptr(armcontainerservice.NetworkPluginKubenet), + // OutboundType: to.Ptr(armcontainerservice.OutboundTypeLoadBalancer), + // PodCidr: to.Ptr("10.244.0.0/16"), + // PodCidrs: []*string{ + // to.Ptr("10.244.0.0/16")}, + // ServiceCidr: to.Ptr("10.0.0.0/16"), + // ServiceCidrs: []*string{ + // to.Ptr("10.0.0.0/16")}, + // }, + // NodeResourceGroup: to.Ptr("MC_rg1_clustername1_location1"), + // ProvisioningState: to.Ptr("Succeeded"), + // ServicePrincipalProfile: &armcontainerservice.ManagedClusterServicePrincipalProfile{ + // ClientID: to.Ptr("clientid"), + // }, + // WindowsProfile: &armcontainerservice.ManagedClusterWindowsProfile{ + // AdminUsername: to.Ptr("azureuser"), + // }, + // }, + // } +} + +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c7b98b36e4023331545051284d8500adf98f02fe/specification/containerservice/resource-manager/Microsoft.ContainerService/aks/preview/2024-05-02-preview/examples/ManagedClustersCreate_MCSnapshot.json +func ExampleManagedClustersClient_BeginCreateOrUpdate_createManagedClusterUsingAManagedClusterSnapshot() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + clientFactory, err := armcontainerservice.NewClientFactory("", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + poller, err := clientFactory.NewManagedClustersClient().BeginCreateOrUpdate(ctx, "rg1", "clustername1", armcontainerservice.ManagedCluster{ + Location: to.Ptr("location1"), + Tags: map[string]*string{ + "archv2": to.Ptr(""), + "tier": to.Ptr("production"), + }, + Properties: &armcontainerservice.ManagedClusterProperties{ + AgentPoolProfiles: []*armcontainerservice.ManagedClusterAgentPoolProfile{ + { + Type: to.Ptr(armcontainerservice.AgentPoolTypeVirtualMachineScaleSets), + Count: to.Ptr[int32](3), + EnableFIPS: to.Ptr(true), + EnableNodePublicIP: to.Ptr(true), + Mode: to.Ptr(armcontainerservice.AgentPoolModeSystem), + OSType: to.Ptr(armcontainerservice.OSTypeLinux), + VMSize: to.Ptr("Standard_DS2_v2"), + Name: to.Ptr("nodepool1"), + }}, + CreationData: &armcontainerservice.CreationData{ + SourceResourceID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.ContainerService/managedclustersnapshots/snapshot1"), + }, + DNSPrefix: to.Ptr("dnsprefix1"), + KubernetesVersion: to.Ptr(""), + LinuxProfile: &armcontainerservice.LinuxProfile{ + AdminUsername: to.Ptr("azureuser"), + SSH: &armcontainerservice.SSHConfiguration{ + PublicKeys: []*armcontainerservice.SSHPublicKey{ + { + KeyData: to.Ptr("keydata"), + }}, + }, + }, + ServicePrincipalProfile: &armcontainerservice.ManagedClusterServicePrincipalProfile{ + ClientID: to.Ptr("clientid"), + Secret: to.Ptr("secret"), + }, + }, + SKU: &armcontainerservice.ManagedClusterSKU{ + Name: to.Ptr(armcontainerservice.ManagedClusterSKUName("Basic")), + Tier: to.Ptr(armcontainerservice.ManagedClusterSKUTierFree), + }, + }, &armcontainerservice.ManagedClustersClientBeginCreateOrUpdateOptions{IfMatch: nil, + IfNoneMatch: nil, + }) + if err != nil { + log.Fatalf("failed to finish the request: %v", err) + } + res, err := poller.PollUntilDone(ctx, nil) + if err != nil { + log.Fatalf("failed to pull the result: %v", err) + } + // You could use response here. We use blank identifier for just demo purposes. + _ = res + // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. + // res.ManagedCluster = armcontainerservice.ManagedCluster{ + // Name: to.Ptr("clustername1"), + // Type: to.Ptr("Microsoft.ContainerService/ManagedClusters"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/rg1/providers/Microsoft.ContainerService/managedClusters/clustername1"), + // Location: to.Ptr("location1"), + // Tags: map[string]*string{ + // "archv2": to.Ptr(""), + // "tier": to.Ptr("production"), + // }, + // Properties: &armcontainerservice.ManagedClusterProperties{ + // AgentPoolProfiles: []*armcontainerservice.ManagedClusterAgentPoolProfile{ + // { + // Type: to.Ptr(armcontainerservice.AgentPoolTypeVirtualMachineScaleSets), + // Count: to.Ptr[int32](3), + // EnableFIPS: to.Ptr(true), + // EnableNodePublicIP: to.Ptr(true), + // MaxPods: to.Ptr[int32](110), + // Mode: to.Ptr(armcontainerservice.AgentPoolModeSystem), + // NodeImageVersion: to.Ptr("AKSUbuntu:1604:2020.03.11"), + // OrchestratorVersion: to.Ptr("1.9.6"), + // OSType: to.Ptr(armcontainerservice.OSTypeLinux), + // ProvisioningState: to.Ptr("Succeeded"), + // VMSize: to.Ptr("Standard_DS2_v2"), + // Name: to.Ptr("nodepool1"), + // }}, + // CreationData: &armcontainerservice.CreationData{ + // SourceResourceID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.ContainerService/managedclustersnapshots/snapshot1"), + // }, + // DNSPrefix: to.Ptr("dnsprefix1"), + // EnableRBAC: to.Ptr(true), + // Fqdn: to.Ptr("dnsprefix1-abcd1234.hcp.eastus.azmk8s.io"), + // KubernetesVersion: to.Ptr("1.9.6"), + // LinuxProfile: &armcontainerservice.LinuxProfile{ + // AdminUsername: to.Ptr("azureuser"), + // SSH: &armcontainerservice.SSHConfiguration{ + // PublicKeys: []*armcontainerservice.SSHPublicKey{ + // { + // KeyData: to.Ptr("keydata"), + // }}, + // }, + // }, + // MaxAgentPools: to.Ptr[int32](1), + // NetworkProfile: &armcontainerservice.NetworkProfile{ + // DNSServiceIP: to.Ptr("10.0.0.10"), + // IPFamilies: []*armcontainerservice.IPFamily{ + // to.Ptr(armcontainerservice.IPFamilyIPv4)}, + // LoadBalancerProfile: &armcontainerservice.ManagedClusterLoadBalancerProfile{ + // AllocatedOutboundPorts: to.Ptr[int32](2000), + // EffectiveOutboundIPs: []*armcontainerservice.ResourceReference{ + // { + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/MC_rg1/providers/Microsoft.Network/publicIPAddresses/mgdoutboundip1"), + // }, + // { + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/MC_rg1/providers/Microsoft.Network/publicIPAddresses/mgdoutboundip2"), + // }}, + // IdleTimeoutInMinutes: to.Ptr[int32](10), + // ManagedOutboundIPs: &armcontainerservice.ManagedClusterLoadBalancerProfileManagedOutboundIPs{ + // Count: to.Ptr[int32](2), + // }, + // }, + // LoadBalancerSKU: to.Ptr(armcontainerservice.LoadBalancerSKUBasic), + // NetworkPlugin: to.Ptr(armcontainerservice.NetworkPluginKubenet), + // OutboundType: to.Ptr(armcontainerservice.OutboundTypeLoadBalancer), + // PodCidr: to.Ptr("10.244.0.0/16"), + // PodCidrs: []*string{ + // to.Ptr("10.244.0.0/16")}, + // ServiceCidr: to.Ptr("10.0.0.0/16"), + // ServiceCidrs: []*string{ + // to.Ptr("10.0.0.0/16")}, + // }, + // NodeResourceGroup: to.Ptr("MC_rg1_clustername1_location1"), + // ProvisioningState: to.Ptr("Succeeded"), + // ServicePrincipalProfile: &armcontainerservice.ManagedClusterServicePrincipalProfile{ + // ClientID: to.Ptr("clientid"), + // }, + // }, + // } +} + +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c7b98b36e4023331545051284d8500adf98f02fe/specification/containerservice/resource-manager/Microsoft.ContainerService/aks/preview/2024-05-02-preview/examples/ManagedClustersCreate_Snapshot.json func ExampleManagedClustersClient_BeginCreateOrUpdate_createManagedClusterUsingAnAgentPoolSnapshot() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -575,7 +833,7 @@ func ExampleManagedClustersClient_BeginCreateOrUpdate_createManagedClusterUsingA Type: to.Ptr(armcontainerservice.AgentPoolTypeVirtualMachineScaleSets), Count: to.Ptr[int32](3), CreationData: &armcontainerservice.CreationData{ - SourceResourceID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/rg1/providers/Microsoft.ContainerService/snapshots/snapshot1"), + SourceResourceID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.ContainerService/snapshots/snapshot1"), }, EnableFIPS: to.Ptr(true), EnableNodePublicIP: to.Ptr(true), @@ -588,7 +846,7 @@ func ExampleManagedClustersClient_BeginCreateOrUpdate_createManagedClusterUsingA ScaleDownDelayAfterAdd: to.Ptr("15m"), ScanInterval: to.Ptr("20s"), }, - DiskEncryptionSetID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/rg1/providers/Microsoft.Compute/diskEncryptionSets/des"), + DiskEncryptionSetID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Compute/diskEncryptionSets/des"), DNSPrefix: to.Ptr("dnsprefix1"), EnablePodSecurityPolicy: to.Ptr(false), EnableRBAC: to.Ptr(true), @@ -624,7 +882,9 @@ func ExampleManagedClustersClient_BeginCreateOrUpdate_createManagedClusterUsingA Name: to.Ptr(armcontainerservice.ManagedClusterSKUName("Basic")), Tier: to.Ptr(armcontainerservice.ManagedClusterSKUTierFree), }, - }, nil) + }, &armcontainerservice.ManagedClustersClientBeginCreateOrUpdateOptions{IfMatch: nil, + IfNoneMatch: nil, + }) if err != nil { log.Fatalf("failed to finish the request: %v", err) } @@ -650,7 +910,7 @@ func ExampleManagedClustersClient_BeginCreateOrUpdate_createManagedClusterUsingA // Type: to.Ptr(armcontainerservice.AgentPoolTypeVirtualMachineScaleSets), // Count: to.Ptr[int32](3), // CreationData: &armcontainerservice.CreationData{ - // SourceResourceID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/rg1/providers/Microsoft.ContainerService/snapshots/snapshot1"), + // SourceResourceID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.ContainerService/snapshots/snapshot1"), // }, // CurrentOrchestratorVersion: to.Ptr("1.9.6"), // EnableFIPS: to.Ptr(true), @@ -668,10 +928,169 @@ func ExampleManagedClustersClient_BeginCreateOrUpdate_createManagedClusterUsingA // ScaleDownDelayAfterAdd: to.Ptr("15m"), // ScanInterval: to.Ptr("20s"), // }, - // CurrentKubernetesVersion: to.Ptr("1.9.6"), - // DiskEncryptionSetID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/rg1/providers/Microsoft.Compute/diskEncryptionSets/des"), + // DiskEncryptionSetID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Compute/diskEncryptionSets/des"), + // DNSPrefix: to.Ptr("dnsprefix1"), + // EnablePodSecurityPolicy: to.Ptr(false), + // EnableRBAC: to.Ptr(true), + // Fqdn: to.Ptr("dnsprefix1-abcd1234.hcp.eastus.azmk8s.io"), + // KubernetesVersion: to.Ptr("1.9.6"), + // LinuxProfile: &armcontainerservice.LinuxProfile{ + // AdminUsername: to.Ptr("azureuser"), + // SSH: &armcontainerservice.SSHConfiguration{ + // PublicKeys: []*armcontainerservice.SSHPublicKey{ + // { + // KeyData: to.Ptr("keydata"), + // }}, + // }, + // }, + // MaxAgentPools: to.Ptr[int32](1), + // NetworkProfile: &armcontainerservice.NetworkProfile{ + // DNSServiceIP: to.Ptr("10.0.0.10"), + // IPFamilies: []*armcontainerservice.IPFamily{ + // to.Ptr(armcontainerservice.IPFamilyIPv4)}, + // LoadBalancerProfile: &armcontainerservice.ManagedClusterLoadBalancerProfile{ + // AllocatedOutboundPorts: to.Ptr[int32](2000), + // EffectiveOutboundIPs: []*armcontainerservice.ResourceReference{ + // { + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/MC_rg1/providers/Microsoft.Network/publicIPAddresses/mgdoutboundip1"), + // }, + // { + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/MC_rg1/providers/Microsoft.Network/publicIPAddresses/mgdoutboundip2"), + // }}, + // IdleTimeoutInMinutes: to.Ptr[int32](10), + // ManagedOutboundIPs: &armcontainerservice.ManagedClusterLoadBalancerProfileManagedOutboundIPs{ + // Count: to.Ptr[int32](2), + // }, + // }, + // LoadBalancerSKU: to.Ptr(armcontainerservice.LoadBalancerSKUBasic), + // NetworkPlugin: to.Ptr(armcontainerservice.NetworkPluginKubenet), + // OutboundType: to.Ptr(armcontainerservice.OutboundTypeLoadBalancer), + // PodCidr: to.Ptr("10.244.0.0/16"), + // PodCidrs: []*string{ + // to.Ptr("10.244.0.0/16")}, + // ServiceCidr: to.Ptr("10.0.0.0/16"), + // ServiceCidrs: []*string{ + // to.Ptr("10.0.0.0/16")}, + // }, + // NodeResourceGroup: to.Ptr("MC_rg1_clustername1_location1"), + // ProvisioningState: to.Ptr("Succeeded"), + // ServicePrincipalProfile: &armcontainerservice.ManagedClusterServicePrincipalProfile{ + // ClientID: to.Ptr("clientid"), + // }, + // WindowsProfile: &armcontainerservice.ManagedClusterWindowsProfile{ + // AdminUsername: to.Ptr("azureuser"), + // }, + // }, + // } +} + +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c7b98b36e4023331545051284d8500adf98f02fe/specification/containerservice/resource-manager/Microsoft.ContainerService/aks/preview/2024-05-02-preview/examples/ManagedClustersCreate_EnableAIToolchainOperator.json +func ExampleManagedClustersClient_BeginCreateOrUpdate_createManagedClusterWithAiToolchainOperatorEnabled() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + clientFactory, err := armcontainerservice.NewClientFactory("", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + poller, err := clientFactory.NewManagedClustersClient().BeginCreateOrUpdate(ctx, "rg1", "clustername1", armcontainerservice.ManagedCluster{ + Location: to.Ptr("location1"), + Tags: map[string]*string{ + "archv2": to.Ptr(""), + "tier": to.Ptr("production"), + }, + Properties: &armcontainerservice.ManagedClusterProperties{ + AddonProfiles: map[string]*armcontainerservice.ManagedClusterAddonProfile{}, + AgentPoolProfiles: []*armcontainerservice.ManagedClusterAgentPoolProfile{ + { + Type: to.Ptr(armcontainerservice.AgentPoolTypeVirtualMachineScaleSets), + Count: to.Ptr[int32](3), + EnableNodePublicIP: to.Ptr(true), + Mode: to.Ptr(armcontainerservice.AgentPoolModeSystem), + OSType: to.Ptr(armcontainerservice.OSTypeLinux), + VMSize: to.Ptr("Standard_DS2_v2"), + Name: to.Ptr("nodepool1"), + }}, + AiToolchainOperatorProfile: &armcontainerservice.ManagedClusterAIToolchainOperatorProfile{ + Enabled: to.Ptr(true), + }, + DNSPrefix: to.Ptr("dnsprefix1"), + EnableRBAC: to.Ptr(true), + KubernetesVersion: to.Ptr(""), + LinuxProfile: &armcontainerservice.LinuxProfile{ + AdminUsername: to.Ptr("azureuser"), + SSH: &armcontainerservice.SSHConfiguration{ + PublicKeys: []*armcontainerservice.SSHPublicKey{ + { + KeyData: to.Ptr("keydata"), + }}, + }, + }, + NetworkProfile: &armcontainerservice.NetworkProfile{ + LoadBalancerProfile: &armcontainerservice.ManagedClusterLoadBalancerProfile{ + ManagedOutboundIPs: &armcontainerservice.ManagedClusterLoadBalancerProfileManagedOutboundIPs{ + Count: to.Ptr[int32](2), + }, + }, + LoadBalancerSKU: to.Ptr(armcontainerservice.LoadBalancerSKUStandard), + NetworkDataplane: to.Ptr(armcontainerservice.NetworkDataplaneCilium), + NetworkPlugin: to.Ptr(armcontainerservice.NetworkPluginAzure), + NetworkPluginMode: to.Ptr(armcontainerservice.NetworkPluginModeOverlay), + OutboundType: to.Ptr(armcontainerservice.OutboundTypeLoadBalancer), + }, + ServicePrincipalProfile: &armcontainerservice.ManagedClusterServicePrincipalProfile{ + ClientID: to.Ptr("clientid"), + Secret: to.Ptr("secret"), + }, + }, + SKU: &armcontainerservice.ManagedClusterSKU{ + Name: to.Ptr(armcontainerservice.ManagedClusterSKUName("Basic")), + Tier: to.Ptr(armcontainerservice.ManagedClusterSKUTierFree), + }, + }, &armcontainerservice.ManagedClustersClientBeginCreateOrUpdateOptions{IfMatch: nil, + IfNoneMatch: nil, + }) + if err != nil { + log.Fatalf("failed to finish the request: %v", err) + } + res, err := poller.PollUntilDone(ctx, nil) + if err != nil { + log.Fatalf("failed to pull the result: %v", err) + } + // You could use response here. We use blank identifier for just demo purposes. + _ = res + // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. + // res.ManagedCluster = armcontainerservice.ManagedCluster{ + // Name: to.Ptr("clustername1"), + // Type: to.Ptr("Microsoft.ContainerService/ManagedClusters"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/rg1/providers/Microsoft.ContainerService/managedClusters/clustername1"), + // Location: to.Ptr("location1"), + // Tags: map[string]*string{ + // "archv2": to.Ptr(""), + // "tier": to.Ptr("production"), + // }, + // Properties: &armcontainerservice.ManagedClusterProperties{ + // AgentPoolProfiles: []*armcontainerservice.ManagedClusterAgentPoolProfile{ + // { + // Type: to.Ptr(armcontainerservice.AgentPoolTypeVirtualMachineScaleSets), + // Count: to.Ptr[int32](3), + // CurrentOrchestratorVersion: to.Ptr("1.9.6"), + // EnableNodePublicIP: to.Ptr(true), + // MaxPods: to.Ptr[int32](110), + // Mode: to.Ptr(armcontainerservice.AgentPoolModeSystem), + // NodeImageVersion: to.Ptr("AKSUbuntu:1604:2020.03.11"), + // OrchestratorVersion: to.Ptr("1.9.6"), + // OSType: to.Ptr(armcontainerservice.OSTypeLinux), + // ProvisioningState: to.Ptr("Succeeded"), + // VMSize: to.Ptr("Standard_DS2_v2"), + // Name: to.Ptr("nodepool1"), + // }}, + // AiToolchainOperatorProfile: &armcontainerservice.ManagedClusterAIToolchainOperatorProfile{ + // Enabled: to.Ptr(true), + // }, // DNSPrefix: to.Ptr("dnsprefix1"), - // EnablePodSecurityPolicy: to.Ptr(false), // EnableRBAC: to.Ptr(true), // Fqdn: to.Ptr("dnsprefix1-abcd1234.hcp.eastus.azmk8s.io"), // KubernetesVersion: to.Ptr("1.9.6"), @@ -693,18 +1112,20 @@ func ExampleManagedClustersClient_BeginCreateOrUpdate_createManagedClusterUsingA // AllocatedOutboundPorts: to.Ptr[int32](2000), // EffectiveOutboundIPs: []*armcontainerservice.ResourceReference{ // { - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/MC_rg1/providers/Microsoft.Network/publicIPAddresses/mgdoutboundip1"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/MC_rg1/providers/Microsoft.Network/publicIPAddresses/mgdoutboundip1"), // }, // { - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/MC_rg1/providers/Microsoft.Network/publicIPAddresses/mgdoutboundip2"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/MC_rg1/providers/Microsoft.Network/publicIPAddresses/mgdoutboundip2"), // }}, // IdleTimeoutInMinutes: to.Ptr[int32](10), // ManagedOutboundIPs: &armcontainerservice.ManagedClusterLoadBalancerProfileManagedOutboundIPs{ // Count: to.Ptr[int32](2), // }, // }, - // LoadBalancerSKU: to.Ptr(armcontainerservice.LoadBalancerSKUBasic), - // NetworkPlugin: to.Ptr(armcontainerservice.NetworkPluginKubenet), + // LoadBalancerSKU: to.Ptr(armcontainerservice.LoadBalancerSKUStandard), + // NetworkDataplane: to.Ptr(armcontainerservice.NetworkDataplaneCilium), + // NetworkPlugin: to.Ptr(armcontainerservice.NetworkPluginAzure), + // NetworkPluginMode: to.Ptr(armcontainerservice.NetworkPluginModeOverlay), // OutboundType: to.Ptr(armcontainerservice.OutboundTypeLoadBalancer), // PodCidr: to.Ptr("10.244.0.0/16"), // PodCidrs: []*string{ @@ -715,17 +1136,11 @@ func ExampleManagedClustersClient_BeginCreateOrUpdate_createManagedClusterUsingA // }, // NodeResourceGroup: to.Ptr("MC_rg1_clustername1_location1"), // ProvisioningState: to.Ptr("Succeeded"), - // ServicePrincipalProfile: &armcontainerservice.ManagedClusterServicePrincipalProfile{ - // ClientID: to.Ptr("clientid"), - // }, - // WindowsProfile: &armcontainerservice.ManagedClusterWindowsProfile{ - // AdminUsername: to.Ptr("azureuser"), - // }, // }, // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/8cbd903b0d037c427def0e8fbf167b26e87bd1a9/specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2024-05-01/examples/ManagedClustersCreate_ManagedNATGateway.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c7b98b36e4023331545051284d8500adf98f02fe/specification/containerservice/resource-manager/Microsoft.ContainerService/aks/preview/2024-05-02-preview/examples/ManagedClustersCreate_ManagedNATGateway.json func ExampleManagedClustersClient_BeginCreateOrUpdate_createManagedClusterWithAksManagedNatGatewayAsOutboundType() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -758,7 +1173,7 @@ func ExampleManagedClustersClient_BeginCreateOrUpdate_createManagedClusterWithAk ScaleDownDelayAfterAdd: to.Ptr("15m"), ScanInterval: to.Ptr("20s"), }, - DiskEncryptionSetID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/rg1/providers/Microsoft.Compute/diskEncryptionSets/des"), + DiskEncryptionSetID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Compute/diskEncryptionSets/des"), DNSPrefix: to.Ptr("dnsprefix1"), EnablePodSecurityPolicy: to.Ptr(true), EnableRBAC: to.Ptr(true), @@ -794,7 +1209,9 @@ func ExampleManagedClustersClient_BeginCreateOrUpdate_createManagedClusterWithAk Name: to.Ptr(armcontainerservice.ManagedClusterSKUName("Basic")), Tier: to.Ptr(armcontainerservice.ManagedClusterSKUTierFree), }, - }, nil) + }, &armcontainerservice.ManagedClustersClientBeginCreateOrUpdateOptions{IfMatch: nil, + IfNoneMatch: nil, + }) if err != nil { log.Fatalf("failed to finish the request: %v", err) } @@ -834,8 +1251,7 @@ func ExampleManagedClustersClient_BeginCreateOrUpdate_createManagedClusterWithAk // ScaleDownDelayAfterAdd: to.Ptr("15m"), // ScanInterval: to.Ptr("20s"), // }, - // CurrentKubernetesVersion: to.Ptr("1.9.6"), - // DiskEncryptionSetID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/rg1/providers/Microsoft.Compute/diskEncryptionSets/des"), + // DiskEncryptionSetID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Compute/diskEncryptionSets/des"), // DNSPrefix: to.Ptr("dnsprefix1"), // EnablePodSecurityPolicy: to.Ptr(true), // EnableRBAC: to.Ptr(true), @@ -857,10 +1273,10 @@ func ExampleManagedClustersClient_BeginCreateOrUpdate_createManagedClusterWithAk // NatGatewayProfile: &armcontainerservice.ManagedClusterNATGatewayProfile{ // EffectiveOutboundIPs: []*armcontainerservice.ResourceReference{ // { - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/MC_rg1/providers/Microsoft.Network/publicIPAddresses/mgdoutboundip1"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/MC_rg1/providers/Microsoft.Network/publicIPAddresses/mgdoutboundip1"), // }, // { - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/MC_rg1/providers/Microsoft.Network/publicIPAddresses/mgdoutboundip2"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/MC_rg1/providers/Microsoft.Network/publicIPAddresses/mgdoutboundip2"), // }}, // IdleTimeoutInMinutes: to.Ptr[int32](4), // ManagedOutboundIPProfile: &armcontainerservice.ManagedClusterManagedOutboundIPProfile{ @@ -884,7 +1300,7 @@ func ExampleManagedClustersClient_BeginCreateOrUpdate_createManagedClusterWithAk // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/8cbd903b0d037c427def0e8fbf167b26e87bd1a9/specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2024-05-01/examples/ManagedClustersCreate_AzureKeyvaultSecretsProvider.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c7b98b36e4023331545051284d8500adf98f02fe/specification/containerservice/resource-manager/Microsoft.ContainerService/aks/preview/2024-05-02-preview/examples/ManagedClustersCreate_AzureKeyvaultSecretsProvider.json func ExampleManagedClustersClient_BeginCreateOrUpdate_createManagedClusterWithAzureKeyVaultSecretsProviderAddon() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -925,7 +1341,7 @@ func ExampleManagedClustersClient_BeginCreateOrUpdate_createManagedClusterWithAz ScaleDownDelayAfterAdd: to.Ptr("15m"), ScanInterval: to.Ptr("20s"), }, - DiskEncryptionSetID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/rg1/providers/Microsoft.Compute/diskEncryptionSets/des"), + DiskEncryptionSetID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Compute/diskEncryptionSets/des"), DNSPrefix: to.Ptr("dnsprefix1"), EnablePodSecurityPolicy: to.Ptr(true), EnableRBAC: to.Ptr(true), @@ -961,7 +1377,9 @@ func ExampleManagedClustersClient_BeginCreateOrUpdate_createManagedClusterWithAz Name: to.Ptr(armcontainerservice.ManagedClusterSKUName("Basic")), Tier: to.Ptr(armcontainerservice.ManagedClusterSKUTierFree), }, - }, nil) + }, &armcontainerservice.ManagedClustersClientBeginCreateOrUpdateOptions{IfMatch: nil, + IfNoneMatch: nil, + }) if err != nil { log.Fatalf("failed to finish the request: %v", err) } @@ -1010,7 +1428,7 @@ func ExampleManagedClustersClient_BeginCreateOrUpdate_createManagedClusterWithAz // ScaleDownDelayAfterAdd: to.Ptr("15m"), // ScanInterval: to.Ptr("20s"), // }, - // DiskEncryptionSetID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/rg1/providers/Microsoft.Compute/diskEncryptionSets/des"), + // DiskEncryptionSetID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Compute/diskEncryptionSets/des"), // DNSPrefix: to.Ptr("dnsprefix1"), // EnablePodSecurityPolicy: to.Ptr(true), // EnableRBAC: to.Ptr(true), @@ -1032,10 +1450,10 @@ func ExampleManagedClustersClient_BeginCreateOrUpdate_createManagedClusterWithAz // AllocatedOutboundPorts: to.Ptr[int32](2000), // EffectiveOutboundIPs: []*armcontainerservice.ResourceReference{ // { - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/MC_rg1/providers/Microsoft.Network/publicIPAddresses/mgdoutboundip1"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/MC_rg1/providers/Microsoft.Network/publicIPAddresses/mgdoutboundip1"), // }, // { - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/MC_rg1/providers/Microsoft.Network/publicIPAddresses/mgdoutboundip2"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/MC_rg1/providers/Microsoft.Network/publicIPAddresses/mgdoutboundip2"), // }}, // IdleTimeoutInMinutes: to.Ptr[int32](10), // ManagedOutboundIPs: &armcontainerservice.ManagedClusterLoadBalancerProfileManagedOutboundIPs{ @@ -1060,8 +1478,8 @@ func ExampleManagedClustersClient_BeginCreateOrUpdate_createManagedClusterWithAz // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/8cbd903b0d037c427def0e8fbf167b26e87bd1a9/specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2024-05-01/examples/ManagedClustersCreate_CRG.json -func ExampleManagedClustersClient_BeginCreateOrUpdate_createManagedClusterWithCapacityReservationGroup() { +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c7b98b36e4023331545051284d8500adf98f02fe/specification/containerservice/resource-manager/Microsoft.ContainerService/aks/preview/2024-05-02-preview/examples/ManagedClustersCreate_EnableCustomCATrust.json +func ExampleManagedClustersClient_BeginCreateOrUpdate_createManagedClusterWithCustomCaTrustCertificatesPopulatedAndCustomCaTrustEnabled() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) @@ -1081,14 +1499,14 @@ func ExampleManagedClustersClient_BeginCreateOrUpdate_createManagedClusterWithCa AddonProfiles: map[string]*armcontainerservice.ManagedClusterAddonProfile{}, AgentPoolProfiles: []*armcontainerservice.ManagedClusterAgentPoolProfile{ { - Type: to.Ptr(armcontainerservice.AgentPoolTypeVirtualMachineScaleSets), - CapacityReservationGroupID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/rg1/providers/Microsoft.Compute/capacityReservationGroups/crg1"), - Count: to.Ptr[int32](3), - EnableNodePublicIP: to.Ptr(true), - Mode: to.Ptr(armcontainerservice.AgentPoolModeSystem), - OSType: to.Ptr(armcontainerservice.OSTypeLinux), - VMSize: to.Ptr("Standard_DS2_v2"), - Name: to.Ptr("nodepool1"), + Type: to.Ptr(armcontainerservice.AgentPoolTypeVirtualMachineScaleSets), + Count: to.Ptr[int32](3), + EnableCustomCATrust: to.Ptr(true), + EnableNodePublicIP: to.Ptr(true), + Mode: to.Ptr(armcontainerservice.AgentPoolModeSystem), + OSType: to.Ptr(armcontainerservice.OSTypeLinux), + VMSize: to.Ptr("Standard_DS2_v2"), + Name: to.Ptr("nodepool1"), }}, AutoScalerProfile: &armcontainerservice.ManagedClusterPropertiesAutoScalerProfile{ ScaleDownDelayAfterAdd: to.Ptr("15m"), @@ -1117,6 +1535,10 @@ func ExampleManagedClustersClient_BeginCreateOrUpdate_createManagedClusterWithCa LoadBalancerSKU: to.Ptr(armcontainerservice.LoadBalancerSKUStandard), OutboundType: to.Ptr(armcontainerservice.OutboundTypeLoadBalancer), }, + SecurityProfile: &armcontainerservice.ManagedClusterSecurityProfile{ + CustomCATrustCertificates: [][]byte{ + []byte("ZHVtbXlFeGFtcGxlVGVzdFZhbHVlRm9yQ2VydGlmaWNhdGVUb0JlQWRkZWQ=")}, + }, ServicePrincipalProfile: &armcontainerservice.ManagedClusterServicePrincipalProfile{ ClientID: to.Ptr("clientid"), Secret: to.Ptr("secret"), @@ -1130,7 +1552,9 @@ func ExampleManagedClustersClient_BeginCreateOrUpdate_createManagedClusterWithCa Name: to.Ptr(armcontainerservice.ManagedClusterSKUName("Basic")), Tier: to.Ptr(armcontainerservice.ManagedClusterSKUTierFree), }, - }, nil) + }, &armcontainerservice.ManagedClustersClientBeginCreateOrUpdateOptions{IfMatch: nil, + IfNoneMatch: nil, + }) if err != nil { log.Fatalf("failed to finish the request: %v", err) } @@ -1154,9 +1578,9 @@ func ExampleManagedClustersClient_BeginCreateOrUpdate_createManagedClusterWithCa // AgentPoolProfiles: []*armcontainerservice.ManagedClusterAgentPoolProfile{ // { // Type: to.Ptr(armcontainerservice.AgentPoolTypeVirtualMachineScaleSets), - // CapacityReservationGroupID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/rg1/providers/Microsoft.Compute/capacityReservationGroups/crg1"), // Count: to.Ptr[int32](3), // CurrentOrchestratorVersion: to.Ptr("1.9.6"), + // EnableCustomCATrust: to.Ptr(true), // EnableNodePublicIP: to.Ptr(true), // MaxPods: to.Ptr[int32](110), // Mode: to.Ptr(armcontainerservice.AgentPoolModeSystem), @@ -1217,17 +1641,21 @@ func ExampleManagedClustersClient_BeginCreateOrUpdate_createManagedClusterWithCa // }, // NodeResourceGroup: to.Ptr("MC_rg1_clustername1_location1"), // ProvisioningState: to.Ptr("Succeeded"), - // ServicePrincipalProfile: &armcontainerservice.ManagedClusterServicePrincipalProfile{ - // ClientID: to.Ptr("clientid"), - // }, - // WindowsProfile: &armcontainerservice.ManagedClusterWindowsProfile{ - // AdminUsername: to.Ptr("azureuser"), + // SecurityProfile: &armcontainerservice.ManagedClusterSecurityProfile{ + // CustomCATrustCertificates: [][]byte{ + // []byte("ZHVtbXlFeGFtcGxlVGVzdFZhbHVlRm9yQ2VydGlmaWNhdGVUb0JlQWRkZWQ=")}, + // }, + // ServicePrincipalProfile: &armcontainerservice.ManagedClusterServicePrincipalProfile{ + // ClientID: to.Ptr("clientid"), + // }, + // WindowsProfile: &armcontainerservice.ManagedClusterWindowsProfile{ + // AdminUsername: to.Ptr("azureuser"), + // }, // }, - // }, - // } + // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/8cbd903b0d037c427def0e8fbf167b26e87bd1a9/specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2024-05-01/examples/ManagedClustersCreate_DedicatedHostGroup.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c7b98b36e4023331545051284d8500adf98f02fe/specification/containerservice/resource-manager/Microsoft.ContainerService/aks/preview/2024-05-02-preview/examples/ManagedClustersCreate_DedicatedHostGroup.json func ExampleManagedClustersClient_BeginCreateOrUpdate_createManagedClusterWithDedicatedHostGroup() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -1260,7 +1688,7 @@ func ExampleManagedClustersClient_BeginCreateOrUpdate_createManagedClusterWithDe ScaleDownDelayAfterAdd: to.Ptr("15m"), ScanInterval: to.Ptr("20s"), }, - DiskEncryptionSetID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/rg1/providers/Microsoft.Compute/diskEncryptionSets/des"), + DiskEncryptionSetID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Compute/diskEncryptionSets/des"), DNSPrefix: to.Ptr("dnsprefix1"), EnablePodSecurityPolicy: to.Ptr(false), EnableRBAC: to.Ptr(true), @@ -1296,7 +1724,9 @@ func ExampleManagedClustersClient_BeginCreateOrUpdate_createManagedClusterWithDe Name: to.Ptr(armcontainerservice.ManagedClusterSKUName("Basic")), Tier: to.Ptr(armcontainerservice.ManagedClusterSKUTierFree), }, - }, nil) + }, &armcontainerservice.ManagedClustersClientBeginCreateOrUpdateOptions{IfMatch: nil, + IfNoneMatch: nil, + }) if err != nil { log.Fatalf("failed to finish the request: %v", err) } @@ -1321,6 +1751,7 @@ func ExampleManagedClustersClient_BeginCreateOrUpdate_createManagedClusterWithDe // { // Type: to.Ptr(armcontainerservice.AgentPoolTypeVirtualMachineScaleSets), // Count: to.Ptr[int32](3), + // CurrentOrchestratorVersion: to.Ptr("1.9.6"), // EnableNodePublicIP: to.Ptr(true), // HostGroupID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/rg/providers/Microsoft.Compute/hostGroups/hostgroup1"), // MaxPods: to.Ptr[int32](110), @@ -1335,7 +1766,7 @@ func ExampleManagedClustersClient_BeginCreateOrUpdate_createManagedClusterWithDe // ScaleDownDelayAfterAdd: to.Ptr("15m"), // ScanInterval: to.Ptr("20s"), // }, - // DiskEncryptionSetID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/rg1/providers/Microsoft.Compute/diskEncryptionSets/des"), + // DiskEncryptionSetID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Compute/diskEncryptionSets/des"), // DNSPrefix: to.Ptr("dnsprefix1"), // EnablePodSecurityPolicy: to.Ptr(false), // EnableRBAC: to.Ptr(true), @@ -1359,10 +1790,10 @@ func ExampleManagedClustersClient_BeginCreateOrUpdate_createManagedClusterWithDe // AllocatedOutboundPorts: to.Ptr[int32](2000), // EffectiveOutboundIPs: []*armcontainerservice.ResourceReference{ // { - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/MC_rg1/providers/Microsoft.Network/publicIPAddresses/mgdoutboundip1"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/MC_rg1/providers/Microsoft.Network/publicIPAddresses/mgdoutboundip1"), // }, // { - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/MC_rg1/providers/Microsoft.Network/publicIPAddresses/mgdoutboundip2"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/MC_rg1/providers/Microsoft.Network/publicIPAddresses/mgdoutboundip2"), // }}, // IdleTimeoutInMinutes: to.Ptr[int32](10), // ManagedOutboundIPs: &armcontainerservice.ManagedClusterLoadBalancerProfileManagedOutboundIPs{ @@ -1391,7 +1822,7 @@ func ExampleManagedClustersClient_BeginCreateOrUpdate_createManagedClusterWithDe // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/8cbd903b0d037c427def0e8fbf167b26e87bd1a9/specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2024-05-01/examples/ManagedClustersCreate_EnableEncryptionAtHost.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c7b98b36e4023331545051284d8500adf98f02fe/specification/containerservice/resource-manager/Microsoft.ContainerService/aks/preview/2024-05-02-preview/examples/ManagedClustersCreate_EnableEncryptionAtHost.json func ExampleManagedClustersClient_BeginCreateOrUpdate_createManagedClusterWithEncryptionAtHostEnabled() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -1425,7 +1856,7 @@ func ExampleManagedClustersClient_BeginCreateOrUpdate_createManagedClusterWithEn ScaleDownDelayAfterAdd: to.Ptr("15m"), ScanInterval: to.Ptr("20s"), }, - DiskEncryptionSetID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/rg1/providers/Microsoft.Compute/diskEncryptionSets/des"), + DiskEncryptionSetID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Compute/diskEncryptionSets/des"), DNSPrefix: to.Ptr("dnsprefix1"), EnablePodSecurityPolicy: to.Ptr(true), EnableRBAC: to.Ptr(true), @@ -1461,7 +1892,9 @@ func ExampleManagedClustersClient_BeginCreateOrUpdate_createManagedClusterWithEn Name: to.Ptr(armcontainerservice.ManagedClusterSKUName("Basic")), Tier: to.Ptr(armcontainerservice.ManagedClusterSKUTierFree), }, - }, nil) + }, &armcontainerservice.ManagedClustersClientBeginCreateOrUpdateOptions{IfMatch: nil, + IfNoneMatch: nil, + }) if err != nil { log.Fatalf("failed to finish the request: %v", err) } @@ -1502,8 +1935,7 @@ func ExampleManagedClustersClient_BeginCreateOrUpdate_createManagedClusterWithEn // ScaleDownDelayAfterAdd: to.Ptr("15m"), // ScanInterval: to.Ptr("20s"), // }, - // CurrentKubernetesVersion: to.Ptr("1.9.6"), - // DiskEncryptionSetID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/rg1/providers/Microsoft.Compute/diskEncryptionSets/des"), + // DiskEncryptionSetID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Compute/diskEncryptionSets/des"), // DNSPrefix: to.Ptr("dnsprefix1"), // EnablePodSecurityPolicy: to.Ptr(true), // EnableRBAC: to.Ptr(true), @@ -1527,10 +1959,10 @@ func ExampleManagedClustersClient_BeginCreateOrUpdate_createManagedClusterWithEn // AllocatedOutboundPorts: to.Ptr[int32](2000), // EffectiveOutboundIPs: []*armcontainerservice.ResourceReference{ // { - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/MC_rg1/providers/Microsoft.Network/publicIPAddresses/mgdoutboundip1"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/MC_rg1/providers/Microsoft.Network/publicIPAddresses/mgdoutboundip1"), // }, // { - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/MC_rg1/providers/Microsoft.Network/publicIPAddresses/mgdoutboundip2"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/MC_rg1/providers/Microsoft.Network/publicIPAddresses/mgdoutboundip2"), // }}, // IdleTimeoutInMinutes: to.Ptr[int32](10), // ManagedOutboundIPs: &armcontainerservice.ManagedClusterLoadBalancerProfileManagedOutboundIPs{ @@ -1559,7 +1991,7 @@ func ExampleManagedClustersClient_BeginCreateOrUpdate_createManagedClusterWithEn // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/8cbd903b0d037c427def0e8fbf167b26e87bd1a9/specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2024-05-01/examples/ManagedClustersCreate_EnabledFIPS.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c7b98b36e4023331545051284d8500adf98f02fe/specification/containerservice/resource-manager/Microsoft.ContainerService/aks/preview/2024-05-02-preview/examples/ManagedClustersCreate_EnabledFIPS.json func ExampleManagedClustersClient_BeginCreateOrUpdate_createManagedClusterWithFipsEnabledOs() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -1593,7 +2025,7 @@ func ExampleManagedClustersClient_BeginCreateOrUpdate_createManagedClusterWithFi ScaleDownDelayAfterAdd: to.Ptr("15m"), ScanInterval: to.Ptr("20s"), }, - DiskEncryptionSetID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/rg1/providers/Microsoft.Compute/diskEncryptionSets/des"), + DiskEncryptionSetID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Compute/diskEncryptionSets/des"), DNSPrefix: to.Ptr("dnsprefix1"), EnablePodSecurityPolicy: to.Ptr(false), EnableRBAC: to.Ptr(true), @@ -1629,7 +2061,9 @@ func ExampleManagedClustersClient_BeginCreateOrUpdate_createManagedClusterWithFi Name: to.Ptr(armcontainerservice.ManagedClusterSKUName("Basic")), Tier: to.Ptr(armcontainerservice.ManagedClusterSKUTierFree), }, - }, nil) + }, &armcontainerservice.ManagedClustersClientBeginCreateOrUpdateOptions{IfMatch: nil, + IfNoneMatch: nil, + }) if err != nil { log.Fatalf("failed to finish the request: %v", err) } @@ -1670,8 +2104,7 @@ func ExampleManagedClustersClient_BeginCreateOrUpdate_createManagedClusterWithFi // ScaleDownDelayAfterAdd: to.Ptr("15m"), // ScanInterval: to.Ptr("20s"), // }, - // CurrentKubernetesVersion: to.Ptr("1.9.6"), - // DiskEncryptionSetID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/rg1/providers/Microsoft.Compute/diskEncryptionSets/des"), + // DiskEncryptionSetID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Compute/diskEncryptionSets/des"), // DNSPrefix: to.Ptr("dnsprefix1"), // EnablePodSecurityPolicy: to.Ptr(false), // EnableRBAC: to.Ptr(true), @@ -1695,10 +2128,10 @@ func ExampleManagedClustersClient_BeginCreateOrUpdate_createManagedClusterWithFi // AllocatedOutboundPorts: to.Ptr[int32](2000), // EffectiveOutboundIPs: []*armcontainerservice.ResourceReference{ // { - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/MC_rg1/providers/Microsoft.Network/publicIPAddresses/mgdoutboundip1"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/MC_rg1/providers/Microsoft.Network/publicIPAddresses/mgdoutboundip1"), // }, // { - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/MC_rg1/providers/Microsoft.Network/publicIPAddresses/mgdoutboundip2"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/MC_rg1/providers/Microsoft.Network/publicIPAddresses/mgdoutboundip2"), // }}, // IdleTimeoutInMinutes: to.Ptr[int32](10), // ManagedOutboundIPs: &armcontainerservice.ManagedClusterLoadBalancerProfileManagedOutboundIPs{ @@ -1727,7 +2160,7 @@ func ExampleManagedClustersClient_BeginCreateOrUpdate_createManagedClusterWithFi // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/8cbd903b0d037c427def0e8fbf167b26e87bd1a9/specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2024-05-01/examples/ManagedClustersCreate_GPUMIG.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c7b98b36e4023331545051284d8500adf98f02fe/specification/containerservice/resource-manager/Microsoft.ContainerService/aks/preview/2024-05-02-preview/examples/ManagedClustersCreate_GPUMIG.json func ExampleManagedClustersClient_BeginCreateOrUpdate_createManagedClusterWithGpumig() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -1761,7 +2194,7 @@ func ExampleManagedClustersClient_BeginCreateOrUpdate_createManagedClusterWithGp ScaleDownDelayAfterAdd: to.Ptr("15m"), ScanInterval: to.Ptr("20s"), }, - DiskEncryptionSetID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/rg1/providers/Microsoft.Compute/diskEncryptionSets/des"), + DiskEncryptionSetID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Compute/diskEncryptionSets/des"), DNSPrefix: to.Ptr("dnsprefix1"), EnablePodSecurityPolicy: to.Ptr(true), EnableRBAC: to.Ptr(true), @@ -1805,7 +2238,9 @@ func ExampleManagedClustersClient_BeginCreateOrUpdate_createManagedClusterWithGp Name: to.Ptr(armcontainerservice.ManagedClusterSKUName("Basic")), Tier: to.Ptr(armcontainerservice.ManagedClusterSKUTierFree), }, - }, nil) + }, &armcontainerservice.ManagedClustersClientBeginCreateOrUpdateOptions{IfMatch: nil, + IfNoneMatch: nil, + }) if err != nil { log.Fatalf("failed to finish the request: %v", err) } @@ -1846,8 +2281,7 @@ func ExampleManagedClustersClient_BeginCreateOrUpdate_createManagedClusterWithGp // ScaleDownDelayAfterAdd: to.Ptr("15m"), // ScanInterval: to.Ptr("20s"), // }, - // CurrentKubernetesVersion: to.Ptr("1.9.6"), - // DiskEncryptionSetID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/rg1/providers/Microsoft.Compute/diskEncryptionSets/des"), + // DiskEncryptionSetID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Compute/diskEncryptionSets/des"), // DNSPrefix: to.Ptr("dnsprefix1"), // EnablePodSecurityPolicy: to.Ptr(true), // EnableRBAC: to.Ptr(true), @@ -1879,10 +2313,10 @@ func ExampleManagedClustersClient_BeginCreateOrUpdate_createManagedClusterWithGp // AllocatedOutboundPorts: to.Ptr[int32](2000), // EffectiveOutboundIPs: []*armcontainerservice.ResourceReference{ // { - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/MC_rg1/providers/Microsoft.Network/publicIPAddresses/mgdoutboundip1"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/MC_rg1/providers/Microsoft.Network/publicIPAddresses/mgdoutboundip1"), // }, // { - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/MC_rg1/providers/Microsoft.Network/publicIPAddresses/mgdoutboundip2"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/MC_rg1/providers/Microsoft.Network/publicIPAddresses/mgdoutboundip2"), // }}, // IdleTimeoutInMinutes: to.Ptr[int32](10), // ManagedOutboundIPs: &armcontainerservice.ManagedClusterLoadBalancerProfileManagedOutboundIPs{ @@ -1911,7 +2345,7 @@ func ExampleManagedClustersClient_BeginCreateOrUpdate_createManagedClusterWithGp // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/8cbd903b0d037c427def0e8fbf167b26e87bd1a9/specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2024-05-01/examples/ManagedClustersCreate_HTTPProxy.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c7b98b36e4023331545051284d8500adf98f02fe/specification/containerservice/resource-manager/Microsoft.ContainerService/aks/preview/2024-05-02-preview/examples/ManagedClustersCreate_HTTPProxy.json func ExampleManagedClustersClient_BeginCreateOrUpdate_createManagedClusterWithHttpProxyConfigured() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -1944,7 +2378,7 @@ func ExampleManagedClustersClient_BeginCreateOrUpdate_createManagedClusterWithHt ScaleDownDelayAfterAdd: to.Ptr("15m"), ScanInterval: to.Ptr("20s"), }, - DiskEncryptionSetID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/rg1/providers/Microsoft.Compute/diskEncryptionSets/des"), + DiskEncryptionSetID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Compute/diskEncryptionSets/des"), DNSPrefix: to.Ptr("dnsprefix1"), EnablePodSecurityPolicy: to.Ptr(true), EnableRBAC: to.Ptr(true), @@ -1988,7 +2422,9 @@ func ExampleManagedClustersClient_BeginCreateOrUpdate_createManagedClusterWithHt Name: to.Ptr(armcontainerservice.ManagedClusterSKUName("Basic")), Tier: to.Ptr(armcontainerservice.ManagedClusterSKUTierFree), }, - }, nil) + }, &armcontainerservice.ManagedClustersClientBeginCreateOrUpdateOptions{IfMatch: nil, + IfNoneMatch: nil, + }) if err != nil { log.Fatalf("failed to finish the request: %v", err) } @@ -2028,8 +2464,7 @@ func ExampleManagedClustersClient_BeginCreateOrUpdate_createManagedClusterWithHt // ScaleDownDelayAfterAdd: to.Ptr("15m"), // ScanInterval: to.Ptr("20s"), // }, - // CurrentKubernetesVersion: to.Ptr("1.9.6"), - // DiskEncryptionSetID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/rg1/providers/Microsoft.Compute/diskEncryptionSets/des"), + // DiskEncryptionSetID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Compute/diskEncryptionSets/des"), // DNSPrefix: to.Ptr("dnsprefix1"), // EnablePodSecurityPolicy: to.Ptr(true), // EnableRBAC: to.Ptr(true), @@ -2061,10 +2496,10 @@ func ExampleManagedClustersClient_BeginCreateOrUpdate_createManagedClusterWithHt // AllocatedOutboundPorts: to.Ptr[int32](2000), // EffectiveOutboundIPs: []*armcontainerservice.ResourceReference{ // { - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/MC_rg1/providers/Microsoft.Network/publicIPAddresses/mgdoutboundip1"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/MC_rg1/providers/Microsoft.Network/publicIPAddresses/mgdoutboundip1"), // }, // { - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/MC_rg1/providers/Microsoft.Network/publicIPAddresses/mgdoutboundip2"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/MC_rg1/providers/Microsoft.Network/publicIPAddresses/mgdoutboundip2"), // }}, // IdleTimeoutInMinutes: to.Ptr[int32](10), // ManagedOutboundIPs: &armcontainerservice.ManagedClusterLoadBalancerProfileManagedOutboundIPs{ @@ -2093,8 +2528,188 @@ func ExampleManagedClustersClient_BeginCreateOrUpdate_createManagedClusterWithHt // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/8cbd903b0d037c427def0e8fbf167b26e87bd1a9/specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2024-05-01/examples/ManagedClustersCreate_Premium.json -func ExampleManagedClustersClient_BeginCreateOrUpdate_createManagedClusterWithLongTermSupport() { +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c7b98b36e4023331545051284d8500adf98f02fe/specification/containerservice/resource-manager/Microsoft.ContainerService/aks/preview/2024-05-02-preview/examples/ManagedClustersCreate_Premium.json +func ExampleManagedClustersClient_BeginCreateOrUpdate_createManagedClusterWithLongTermSupport() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + clientFactory, err := armcontainerservice.NewClientFactory("", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + poller, err := clientFactory.NewManagedClustersClient().BeginCreateOrUpdate(ctx, "rg1", "clustername1", armcontainerservice.ManagedCluster{ + Location: to.Ptr("location1"), + Tags: map[string]*string{ + "archv2": to.Ptr(""), + "tier": to.Ptr("production"), + }, + Properties: &armcontainerservice.ManagedClusterProperties{ + AddonProfiles: map[string]*armcontainerservice.ManagedClusterAddonProfile{}, + AgentPoolProfiles: []*armcontainerservice.ManagedClusterAgentPoolProfile{ + { + Type: to.Ptr(armcontainerservice.AgentPoolTypeVirtualMachineScaleSets), + Count: to.Ptr[int32](3), + EnableEncryptionAtHost: to.Ptr(true), + EnableNodePublicIP: to.Ptr(true), + Mode: to.Ptr(armcontainerservice.AgentPoolModeSystem), + OSType: to.Ptr(armcontainerservice.OSTypeLinux), + VMSize: to.Ptr("Standard_DS2_v2"), + Name: to.Ptr("nodepool1"), + }}, + APIServerAccessProfile: &armcontainerservice.ManagedClusterAPIServerAccessProfile{ + DisableRunCommand: to.Ptr(true), + }, + AutoScalerProfile: &armcontainerservice.ManagedClusterPropertiesAutoScalerProfile{ + ScaleDownDelayAfterAdd: to.Ptr("15m"), + ScanInterval: to.Ptr("20s"), + }, + DNSPrefix: to.Ptr("dnsprefix1"), + EnablePodSecurityPolicy: to.Ptr(true), + EnableRBAC: to.Ptr(true), + KubernetesVersion: to.Ptr(""), + LinuxProfile: &armcontainerservice.LinuxProfile{ + AdminUsername: to.Ptr("azureuser"), + SSH: &armcontainerservice.SSHConfiguration{ + PublicKeys: []*armcontainerservice.SSHPublicKey{ + { + KeyData: to.Ptr("keydata"), + }}, + }, + }, + NetworkProfile: &armcontainerservice.NetworkProfile{ + LoadBalancerProfile: &armcontainerservice.ManagedClusterLoadBalancerProfile{ + ManagedOutboundIPs: &armcontainerservice.ManagedClusterLoadBalancerProfileManagedOutboundIPs{ + Count: to.Ptr[int32](2), + }, + }, + LoadBalancerSKU: to.Ptr(armcontainerservice.LoadBalancerSKUStandard), + OutboundType: to.Ptr(armcontainerservice.OutboundTypeLoadBalancer), + }, + ServicePrincipalProfile: &armcontainerservice.ManagedClusterServicePrincipalProfile{ + ClientID: to.Ptr("clientid"), + Secret: to.Ptr("secret"), + }, + SupportPlan: to.Ptr(armcontainerservice.KubernetesSupportPlanAKSLongTermSupport), + WindowsProfile: &armcontainerservice.ManagedClusterWindowsProfile{ + AdminPassword: to.Ptr("replacePassword1234$"), + AdminUsername: to.Ptr("azureuser"), + }, + }, + SKU: &armcontainerservice.ManagedClusterSKU{ + Name: to.Ptr(armcontainerservice.ManagedClusterSKUNameBase), + Tier: to.Ptr(armcontainerservice.ManagedClusterSKUTierPremium), + }, + }, &armcontainerservice.ManagedClustersClientBeginCreateOrUpdateOptions{IfMatch: nil, + IfNoneMatch: nil, + }) + if err != nil { + log.Fatalf("failed to finish the request: %v", err) + } + res, err := poller.PollUntilDone(ctx, nil) + if err != nil { + log.Fatalf("failed to pull the result: %v", err) + } + // You could use response here. We use blank identifier for just demo purposes. + _ = res + // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. + // res.ManagedCluster = armcontainerservice.ManagedCluster{ + // Name: to.Ptr("clustername1"), + // Type: to.Ptr("Microsoft.ContainerService/ManagedClusters"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/rg1/providers/Microsoft.ContainerService/managedClusters/clustername1"), + // Location: to.Ptr("location1"), + // Tags: map[string]*string{ + // "archv2": to.Ptr(""), + // "tier": to.Ptr("production"), + // }, + // Properties: &armcontainerservice.ManagedClusterProperties{ + // AgentPoolProfiles: []*armcontainerservice.ManagedClusterAgentPoolProfile{ + // { + // Type: to.Ptr(armcontainerservice.AgentPoolTypeVirtualMachineScaleSets), + // Count: to.Ptr[int32](3), + // CurrentOrchestratorVersion: to.Ptr("1.9.6"), + // EnableEncryptionAtHost: to.Ptr(true), + // EnableNodePublicIP: to.Ptr(true), + // MaxPods: to.Ptr[int32](110), + // Mode: to.Ptr(armcontainerservice.AgentPoolModeSystem), + // NodeImageVersion: to.Ptr("AKSUbuntu:1604:2020.03.11"), + // OrchestratorVersion: to.Ptr("1.9.6"), + // OSType: to.Ptr(armcontainerservice.OSTypeLinux), + // ProvisioningState: to.Ptr("Succeeded"), + // VMSize: to.Ptr("Standard_DS2_v2"), + // Name: to.Ptr("nodepool1"), + // }}, + // APIServerAccessProfile: &armcontainerservice.ManagedClusterAPIServerAccessProfile{ + // DisableRunCommand: to.Ptr(true), + // }, + // AutoScalerProfile: &armcontainerservice.ManagedClusterPropertiesAutoScalerProfile{ + // ScaleDownDelayAfterAdd: to.Ptr("15m"), + // ScanInterval: to.Ptr("20s"), + // }, + // DNSPrefix: to.Ptr("dnsprefix1"), + // EnablePodSecurityPolicy: to.Ptr(true), + // EnableRBAC: to.Ptr(true), + // Fqdn: to.Ptr("dnsprefix1-ee788a1f.hcp.location1.azmk8s.io"), + // KubernetesVersion: to.Ptr("1.9.6"), + // LinuxProfile: &armcontainerservice.LinuxProfile{ + // AdminUsername: to.Ptr("azureuser"), + // SSH: &armcontainerservice.SSHConfiguration{ + // PublicKeys: []*armcontainerservice.SSHPublicKey{ + // { + // KeyData: to.Ptr("keydata"), + // }}, + // }, + // }, + // MaxAgentPools: to.Ptr[int32](1), + // NetworkProfile: &armcontainerservice.NetworkProfile{ + // DNSServiceIP: to.Ptr("10.0.0.10"), + // IPFamilies: []*armcontainerservice.IPFamily{ + // to.Ptr(armcontainerservice.IPFamilyIPv4)}, + // LoadBalancerProfile: &armcontainerservice.ManagedClusterLoadBalancerProfile{ + // AllocatedOutboundPorts: to.Ptr[int32](2000), + // EffectiveOutboundIPs: []*armcontainerservice.ResourceReference{ + // { + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/MC_rg1/providers/Microsoft.Network/publicIPAddresses/mgdoutboundip1"), + // }, + // { + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/MC_rg1/providers/Microsoft.Network/publicIPAddresses/mgdoutboundip2"), + // }}, + // IdleTimeoutInMinutes: to.Ptr[int32](10), + // ManagedOutboundIPs: &armcontainerservice.ManagedClusterLoadBalancerProfileManagedOutboundIPs{ + // Count: to.Ptr[int32](2), + // }, + // }, + // LoadBalancerSKU: to.Ptr(armcontainerservice.LoadBalancerSKUBasic), + // NetworkPlugin: to.Ptr(armcontainerservice.NetworkPluginKubenet), + // OutboundType: to.Ptr(armcontainerservice.OutboundTypeLoadBalancer), + // PodCidr: to.Ptr("10.244.0.0/16"), + // PodCidrs: []*string{ + // to.Ptr("10.244.0.0/16")}, + // ServiceCidr: to.Ptr("10.0.0.0/16"), + // ServiceCidrs: []*string{ + // to.Ptr("10.0.0.0/16")}, + // }, + // NodeResourceGroup: to.Ptr("MC_rg1_clustername1_location1"), + // PrivateFQDN: to.Ptr("dnsprefix1-aae7e0f0.5cef6058-b6b5-414d-8cb1-4bd14eb0b15c.privatelink.location1.azmk8s.io"), + // ProvisioningState: to.Ptr("Succeeded"), + // ServicePrincipalProfile: &armcontainerservice.ManagedClusterServicePrincipalProfile{ + // ClientID: to.Ptr("clientid"), + // }, + // SupportPlan: to.Ptr(armcontainerservice.KubernetesSupportPlanAKSLongTermSupport), + // WindowsProfile: &armcontainerservice.ManagedClusterWindowsProfile{ + // AdminUsername: to.Ptr("azureuser"), + // }, + // }, + // SKU: &armcontainerservice.ManagedClusterSKU{ + // Name: to.Ptr(armcontainerservice.ManagedClusterSKUNameBase), + // Tier: to.Ptr(armcontainerservice.ManagedClusterSKUTierPremium), + // }, + // } +} + +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c7b98b36e4023331545051284d8500adf98f02fe/specification/containerservice/resource-manager/Microsoft.ContainerService/aks/preview/2024-05-02-preview/examples/ManagedClustersCreate_NodeAutoProvisioning.json +func ExampleManagedClustersClient_BeginCreateOrUpdate_createManagedClusterWithNodeAutoProvisioning() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) @@ -2114,22 +2729,14 @@ func ExampleManagedClustersClient_BeginCreateOrUpdate_createManagedClusterWithLo AddonProfiles: map[string]*armcontainerservice.ManagedClusterAddonProfile{}, AgentPoolProfiles: []*armcontainerservice.ManagedClusterAgentPoolProfile{ { - Type: to.Ptr(armcontainerservice.AgentPoolTypeVirtualMachineScaleSets), - Count: to.Ptr[int32](3), - EnableEncryptionAtHost: to.Ptr(true), - EnableNodePublicIP: to.Ptr(true), - Mode: to.Ptr(armcontainerservice.AgentPoolModeSystem), - OSType: to.Ptr(armcontainerservice.OSTypeLinux), - VMSize: to.Ptr("Standard_DS2_v2"), - Name: to.Ptr("nodepool1"), + Type: to.Ptr(armcontainerservice.AgentPoolTypeVirtualMachineScaleSets), + Count: to.Ptr[int32](3), + EnableNodePublicIP: to.Ptr(true), + Mode: to.Ptr(armcontainerservice.AgentPoolModeSystem), + OSType: to.Ptr(armcontainerservice.OSTypeLinux), + VMSize: to.Ptr("Standard_DS2_v2"), + Name: to.Ptr("nodepool1"), }}, - APIServerAccessProfile: &armcontainerservice.ManagedClusterAPIServerAccessProfile{ - DisableRunCommand: to.Ptr(true), - }, - AutoScalerProfile: &armcontainerservice.ManagedClusterPropertiesAutoScalerProfile{ - ScaleDownDelayAfterAdd: to.Ptr("15m"), - ScanInterval: to.Ptr("20s"), - }, DNSPrefix: to.Ptr("dnsprefix1"), EnablePodSecurityPolicy: to.Ptr(true), EnableRBAC: to.Ptr(true), @@ -2149,24 +2756,24 @@ func ExampleManagedClustersClient_BeginCreateOrUpdate_createManagedClusterWithLo Count: to.Ptr[int32](2), }, }, - LoadBalancerSKU: to.Ptr(armcontainerservice.LoadBalancerSKUStandard), - OutboundType: to.Ptr(armcontainerservice.OutboundTypeLoadBalancer), + LoadBalancerSKU: to.Ptr(armcontainerservice.LoadBalancerSKUStandard), + NetworkDataplane: to.Ptr(armcontainerservice.NetworkDataplaneCilium), + NetworkPlugin: to.Ptr(armcontainerservice.NetworkPluginAzure), + NetworkPluginMode: to.Ptr(armcontainerservice.NetworkPluginModeOverlay), + OutboundType: to.Ptr(armcontainerservice.OutboundTypeLoadBalancer), }, ServicePrincipalProfile: &armcontainerservice.ManagedClusterServicePrincipalProfile{ ClientID: to.Ptr("clientid"), Secret: to.Ptr("secret"), }, - SupportPlan: to.Ptr(armcontainerservice.KubernetesSupportPlanAKSLongTermSupport), - WindowsProfile: &armcontainerservice.ManagedClusterWindowsProfile{ - AdminPassword: to.Ptr("replacePassword1234$"), - AdminUsername: to.Ptr("azureuser"), - }, }, SKU: &armcontainerservice.ManagedClusterSKU{ - Name: to.Ptr(armcontainerservice.ManagedClusterSKUNameBase), - Tier: to.Ptr(armcontainerservice.ManagedClusterSKUTierPremium), + Name: to.Ptr(armcontainerservice.ManagedClusterSKUName("Basic")), + Tier: to.Ptr(armcontainerservice.ManagedClusterSKUTierFree), }, - }, nil) + }, &armcontainerservice.ManagedClustersClientBeginCreateOrUpdateOptions{IfMatch: nil, + IfNoneMatch: nil, + }) if err != nil { log.Fatalf("failed to finish the request: %v", err) } @@ -2192,7 +2799,6 @@ func ExampleManagedClustersClient_BeginCreateOrUpdate_createManagedClusterWithLo // Type: to.Ptr(armcontainerservice.AgentPoolTypeVirtualMachineScaleSets), // Count: to.Ptr[int32](3), // CurrentOrchestratorVersion: to.Ptr("1.9.6"), - // EnableEncryptionAtHost: to.Ptr(true), // EnableNodePublicIP: to.Ptr(true), // MaxPods: to.Ptr[int32](110), // Mode: to.Ptr(armcontainerservice.AgentPoolModeSystem), @@ -2203,17 +2809,10 @@ func ExampleManagedClustersClient_BeginCreateOrUpdate_createManagedClusterWithLo // VMSize: to.Ptr("Standard_DS2_v2"), // Name: to.Ptr("nodepool1"), // }}, - // APIServerAccessProfile: &armcontainerservice.ManagedClusterAPIServerAccessProfile{ - // DisableRunCommand: to.Ptr(true), - // }, - // AutoScalerProfile: &armcontainerservice.ManagedClusterPropertiesAutoScalerProfile{ - // ScaleDownDelayAfterAdd: to.Ptr("15m"), - // ScanInterval: to.Ptr("20s"), - // }, // DNSPrefix: to.Ptr("dnsprefix1"), // EnablePodSecurityPolicy: to.Ptr(true), // EnableRBAC: to.Ptr(true), - // Fqdn: to.Ptr("dnsprefix1-ee788a1f.hcp.location1.azmk8s.io"), + // Fqdn: to.Ptr("dnsprefix1-abcd1234.hcp.eastus.azmk8s.io"), // KubernetesVersion: to.Ptr("1.9.6"), // LinuxProfile: &armcontainerservice.LinuxProfile{ // AdminUsername: to.Ptr("azureuser"), @@ -2233,18 +2832,20 @@ func ExampleManagedClustersClient_BeginCreateOrUpdate_createManagedClusterWithLo // AllocatedOutboundPorts: to.Ptr[int32](2000), // EffectiveOutboundIPs: []*armcontainerservice.ResourceReference{ // { - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/MC_rg1/providers/Microsoft.Network/publicIPAddresses/mgdoutboundip1"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/MC_rg1/providers/Microsoft.Network/publicIPAddresses/mgdoutboundip1"), // }, // { - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/MC_rg1/providers/Microsoft.Network/publicIPAddresses/mgdoutboundip2"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/MC_rg1/providers/Microsoft.Network/publicIPAddresses/mgdoutboundip2"), // }}, // IdleTimeoutInMinutes: to.Ptr[int32](10), // ManagedOutboundIPs: &armcontainerservice.ManagedClusterLoadBalancerProfileManagedOutboundIPs{ // Count: to.Ptr[int32](2), // }, // }, - // LoadBalancerSKU: to.Ptr(armcontainerservice.LoadBalancerSKUBasic), - // NetworkPlugin: to.Ptr(armcontainerservice.NetworkPluginKubenet), + // LoadBalancerSKU: to.Ptr(armcontainerservice.LoadBalancerSKUStandard), + // NetworkDataplane: to.Ptr(armcontainerservice.NetworkDataplaneCilium), + // NetworkPlugin: to.Ptr(armcontainerservice.NetworkPluginAzure), + // NetworkPluginMode: to.Ptr(armcontainerservice.NetworkPluginModeOverlay), // OutboundType: to.Ptr(armcontainerservice.OutboundTypeLoadBalancer), // PodCidr: to.Ptr("10.244.0.0/16"), // PodCidrs: []*string{ @@ -2254,24 +2855,12 @@ func ExampleManagedClustersClient_BeginCreateOrUpdate_createManagedClusterWithLo // to.Ptr("10.0.0.0/16")}, // }, // NodeResourceGroup: to.Ptr("MC_rg1_clustername1_location1"), - // PrivateFQDN: to.Ptr("dnsprefix1-aae7e0f0.5cef6058-b6b5-414d-8cb1-4bd14eb0b15c.privatelink.location1.azmk8s.io"), // ProvisioningState: to.Ptr("Succeeded"), - // ServicePrincipalProfile: &armcontainerservice.ManagedClusterServicePrincipalProfile{ - // ClientID: to.Ptr("clientid"), - // }, - // SupportPlan: to.Ptr(armcontainerservice.KubernetesSupportPlanAKSLongTermSupport), - // WindowsProfile: &armcontainerservice.ManagedClusterWindowsProfile{ - // AdminUsername: to.Ptr("azureuser"), - // }, - // }, - // SKU: &armcontainerservice.ManagedClusterSKU{ - // Name: to.Ptr(armcontainerservice.ManagedClusterSKUNameBase), - // Tier: to.Ptr(armcontainerservice.ManagedClusterSKUTierPremium), // }, // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/8cbd903b0d037c427def0e8fbf167b26e87bd1a9/specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2024-05-01/examples/ManagedClustersCreate_NodePublicIPPrefix.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c7b98b36e4023331545051284d8500adf98f02fe/specification/containerservice/resource-manager/Microsoft.ContainerService/aks/preview/2024-05-02-preview/examples/ManagedClustersCreate_NodePublicIPPrefix.json func ExampleManagedClustersClient_BeginCreateOrUpdate_createManagedClusterWithNodePublicIpPrefix() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -2305,7 +2894,7 @@ func ExampleManagedClustersClient_BeginCreateOrUpdate_createManagedClusterWithNo ScaleDownDelayAfterAdd: to.Ptr("15m"), ScanInterval: to.Ptr("20s"), }, - DiskEncryptionSetID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/rg1/providers/Microsoft.Compute/diskEncryptionSets/des"), + DiskEncryptionSetID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Compute/diskEncryptionSets/des"), DNSPrefix: to.Ptr("dnsprefix1"), EnablePodSecurityPolicy: to.Ptr(true), EnableRBAC: to.Ptr(true), @@ -2341,7 +2930,9 @@ func ExampleManagedClustersClient_BeginCreateOrUpdate_createManagedClusterWithNo Name: to.Ptr(armcontainerservice.ManagedClusterSKUName("Basic")), Tier: to.Ptr(armcontainerservice.ManagedClusterSKUTierFree), }, - }, nil) + }, &armcontainerservice.ManagedClustersClientBeginCreateOrUpdateOptions{IfMatch: nil, + IfNoneMatch: nil, + }) if err != nil { log.Fatalf("failed to finish the request: %v", err) } @@ -2382,8 +2973,7 @@ func ExampleManagedClustersClient_BeginCreateOrUpdate_createManagedClusterWithNo // ScaleDownDelayAfterAdd: to.Ptr("15m"), // ScanInterval: to.Ptr("20s"), // }, - // CurrentKubernetesVersion: to.Ptr("1.9.6"), - // DiskEncryptionSetID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/rg1/providers/Microsoft.Compute/diskEncryptionSets/des"), + // DiskEncryptionSetID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Compute/diskEncryptionSets/des"), // DNSPrefix: to.Ptr("dnsprefix1"), // EnablePodSecurityPolicy: to.Ptr(true), // EnableRBAC: to.Ptr(true), @@ -2407,10 +2997,10 @@ func ExampleManagedClustersClient_BeginCreateOrUpdate_createManagedClusterWithNo // AllocatedOutboundPorts: to.Ptr[int32](2000), // EffectiveOutboundIPs: []*armcontainerservice.ResourceReference{ // { - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/MC_rg1/providers/Microsoft.Network/publicIPAddresses/mgdoutboundip1"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/MC_rg1/providers/Microsoft.Network/publicIPAddresses/mgdoutboundip1"), // }, // { - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/MC_rg1/providers/Microsoft.Network/publicIPAddresses/mgdoutboundip2"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/MC_rg1/providers/Microsoft.Network/publicIPAddresses/mgdoutboundip2"), // }}, // IdleTimeoutInMinutes: to.Ptr[int32](10), // ManagedOutboundIPs: &armcontainerservice.ManagedClusterLoadBalancerProfileManagedOutboundIPs{ @@ -2439,7 +3029,7 @@ func ExampleManagedClustersClient_BeginCreateOrUpdate_createManagedClusterWithNo // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/8cbd903b0d037c427def0e8fbf167b26e87bd1a9/specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2024-05-01/examples/ManagedClustersCreate_OSSKU.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c7b98b36e4023331545051284d8500adf98f02fe/specification/containerservice/resource-manager/Microsoft.ContainerService/aks/preview/2024-05-02-preview/examples/ManagedClustersCreate_OSSKU.json func ExampleManagedClustersClient_BeginCreateOrUpdate_createManagedClusterWithOssku() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -2473,7 +3063,7 @@ func ExampleManagedClustersClient_BeginCreateOrUpdate_createManagedClusterWithOs ScaleDownDelayAfterAdd: to.Ptr("15m"), ScanInterval: to.Ptr("20s"), }, - DiskEncryptionSetID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/rg1/providers/Microsoft.Compute/diskEncryptionSets/des"), + DiskEncryptionSetID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Compute/diskEncryptionSets/des"), DNSPrefix: to.Ptr("dnsprefix1"), EnablePodSecurityPolicy: to.Ptr(true), EnableRBAC: to.Ptr(true), @@ -2517,7 +3107,9 @@ func ExampleManagedClustersClient_BeginCreateOrUpdate_createManagedClusterWithOs Name: to.Ptr(armcontainerservice.ManagedClusterSKUName("Basic")), Tier: to.Ptr(armcontainerservice.ManagedClusterSKUTierFree), }, - }, nil) + }, &armcontainerservice.ManagedClustersClientBeginCreateOrUpdateOptions{IfMatch: nil, + IfNoneMatch: nil, + }) if err != nil { log.Fatalf("failed to finish the request: %v", err) } @@ -2558,8 +3150,7 @@ func ExampleManagedClustersClient_BeginCreateOrUpdate_createManagedClusterWithOs // ScaleDownDelayAfterAdd: to.Ptr("15m"), // ScanInterval: to.Ptr("20s"), // }, - // CurrentKubernetesVersion: to.Ptr("1.9.6"), - // DiskEncryptionSetID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/rg1/providers/Microsoft.Compute/diskEncryptionSets/des"), + // DiskEncryptionSetID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Compute/diskEncryptionSets/des"), // DNSPrefix: to.Ptr("dnsprefix1"), // EnablePodSecurityPolicy: to.Ptr(true), // EnableRBAC: to.Ptr(true), @@ -2591,10 +3182,10 @@ func ExampleManagedClustersClient_BeginCreateOrUpdate_createManagedClusterWithOs // AllocatedOutboundPorts: to.Ptr[int32](2000), // EffectiveOutboundIPs: []*armcontainerservice.ResourceReference{ // { - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/MC_rg1/providers/Microsoft.Network/publicIPAddresses/mgdoutboundip1"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/MC_rg1/providers/Microsoft.Network/publicIPAddresses/mgdoutboundip1"), // }, // { - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/MC_rg1/providers/Microsoft.Network/publicIPAddresses/mgdoutboundip2"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/MC_rg1/providers/Microsoft.Network/publicIPAddresses/mgdoutboundip2"), // }}, // IdleTimeoutInMinutes: to.Ptr[int32](10), // ManagedOutboundIPs: &armcontainerservice.ManagedClusterLoadBalancerProfileManagedOutboundIPs{ @@ -2623,7 +3214,7 @@ func ExampleManagedClustersClient_BeginCreateOrUpdate_createManagedClusterWithOs // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/8cbd903b0d037c427def0e8fbf167b26e87bd1a9/specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2024-05-01/examples/ManagedClustersCreate_PPG.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c7b98b36e4023331545051284d8500adf98f02fe/specification/containerservice/resource-manager/Microsoft.ContainerService/aks/preview/2024-05-02-preview/examples/ManagedClustersCreate_PPG.json func ExampleManagedClustersClient_BeginCreateOrUpdate_createManagedClusterWithPpg() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -2657,7 +3248,7 @@ func ExampleManagedClustersClient_BeginCreateOrUpdate_createManagedClusterWithPp ScaleDownDelayAfterAdd: to.Ptr("15m"), ScanInterval: to.Ptr("20s"), }, - DiskEncryptionSetID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/rg1/providers/Microsoft.Compute/diskEncryptionSets/des"), + DiskEncryptionSetID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Compute/diskEncryptionSets/des"), DNSPrefix: to.Ptr("dnsprefix1"), EnablePodSecurityPolicy: to.Ptr(true), EnableRBAC: to.Ptr(true), @@ -2693,7 +3284,9 @@ func ExampleManagedClustersClient_BeginCreateOrUpdate_createManagedClusterWithPp Name: to.Ptr(armcontainerservice.ManagedClusterSKUName("Basic")), Tier: to.Ptr(armcontainerservice.ManagedClusterSKUTierFree), }, - }, nil) + }, &armcontainerservice.ManagedClustersClientBeginCreateOrUpdateOptions{IfMatch: nil, + IfNoneMatch: nil, + }) if err != nil { log.Fatalf("failed to finish the request: %v", err) } @@ -2734,8 +3327,7 @@ func ExampleManagedClustersClient_BeginCreateOrUpdate_createManagedClusterWithPp // ScaleDownDelayAfterAdd: to.Ptr("15m"), // ScanInterval: to.Ptr("20s"), // }, - // CurrentKubernetesVersion: to.Ptr("1.9.6"), - // DiskEncryptionSetID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/rg1/providers/Microsoft.Compute/diskEncryptionSets/des"), + // DiskEncryptionSetID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Compute/diskEncryptionSets/des"), // DNSPrefix: to.Ptr("dnsprefix1"), // EnablePodSecurityPolicy: to.Ptr(true), // EnableRBAC: to.Ptr(true), @@ -2759,10 +3351,10 @@ func ExampleManagedClustersClient_BeginCreateOrUpdate_createManagedClusterWithPp // AllocatedOutboundPorts: to.Ptr[int32](2000), // EffectiveOutboundIPs: []*armcontainerservice.ResourceReference{ // { - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/MC_rg1/providers/Microsoft.Network/publicIPAddresses/mgdoutboundip1"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/MC_rg1/providers/Microsoft.Network/publicIPAddresses/mgdoutboundip1"), // }, // { - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/MC_rg1/providers/Microsoft.Network/publicIPAddresses/mgdoutboundip2"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/MC_rg1/providers/Microsoft.Network/publicIPAddresses/mgdoutboundip2"), // }}, // IdleTimeoutInMinutes: to.Ptr[int32](10), // ManagedOutboundIPs: &armcontainerservice.ManagedClusterLoadBalancerProfileManagedOutboundIPs{ @@ -2791,7 +3383,7 @@ func ExampleManagedClustersClient_BeginCreateOrUpdate_createManagedClusterWithPp // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/8cbd903b0d037c427def0e8fbf167b26e87bd1a9/specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2024-05-01/examples/ManagedClustersCreate_PodIdentity.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c7b98b36e4023331545051284d8500adf98f02fe/specification/containerservice/resource-manager/Microsoft.ContainerService/aks/preview/2024-05-02-preview/examples/ManagedClustersCreate_PodIdentity.json func ExampleManagedClustersClient_BeginCreateOrUpdate_createManagedClusterWithPodIdentityEnabled() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -2824,7 +3416,7 @@ func ExampleManagedClustersClient_BeginCreateOrUpdate_createManagedClusterWithPo ScaleDownDelayAfterAdd: to.Ptr("15m"), ScanInterval: to.Ptr("20s"), }, - DiskEncryptionSetID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/rg1/providers/Microsoft.Compute/diskEncryptionSets/des"), + DiskEncryptionSetID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Compute/diskEncryptionSets/des"), DNSPrefix: to.Ptr("dnsprefix1"), EnablePodSecurityPolicy: to.Ptr(true), EnableRBAC: to.Ptr(true), @@ -2864,7 +3456,9 @@ func ExampleManagedClustersClient_BeginCreateOrUpdate_createManagedClusterWithPo Name: to.Ptr(armcontainerservice.ManagedClusterSKUName("Basic")), Tier: to.Ptr(armcontainerservice.ManagedClusterSKUTierFree), }, - }, nil) + }, &armcontainerservice.ManagedClustersClientBeginCreateOrUpdateOptions{IfMatch: nil, + IfNoneMatch: nil, + }) if err != nil { log.Fatalf("failed to finish the request: %v", err) } @@ -2904,8 +3498,7 @@ func ExampleManagedClustersClient_BeginCreateOrUpdate_createManagedClusterWithPo // ScaleDownDelayAfterAdd: to.Ptr("15m"), // ScanInterval: to.Ptr("20s"), // }, - // CurrentKubernetesVersion: to.Ptr("1.9.6"), - // DiskEncryptionSetID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/rg1/providers/Microsoft.Compute/diskEncryptionSets/des"), + // DiskEncryptionSetID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Compute/diskEncryptionSets/des"), // DNSPrefix: to.Ptr("dnsprefix1"), // EnablePodSecurityPolicy: to.Ptr(true), // EnableRBAC: to.Ptr(true), @@ -2929,10 +3522,10 @@ func ExampleManagedClustersClient_BeginCreateOrUpdate_createManagedClusterWithPo // AllocatedOutboundPorts: to.Ptr[int32](2000), // EffectiveOutboundIPs: []*armcontainerservice.ResourceReference{ // { - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/MC_rg1/providers/Microsoft.Network/publicIPAddresses/mgdoutboundip1"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/MC_rg1/providers/Microsoft.Network/publicIPAddresses/mgdoutboundip1"), // }, // { - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/MC_rg1/providers/Microsoft.Network/publicIPAddresses/mgdoutboundip2"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/MC_rg1/providers/Microsoft.Network/publicIPAddresses/mgdoutboundip2"), // }}, // IdleTimeoutInMinutes: to.Ptr[int32](10), // ManagedOutboundIPs: &armcontainerservice.ManagedClusterLoadBalancerProfileManagedOutboundIPs{ @@ -2965,7 +3558,7 @@ func ExampleManagedClustersClient_BeginCreateOrUpdate_createManagedClusterWithPo // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/8cbd903b0d037c427def0e8fbf167b26e87bd1a9/specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2024-05-01/examples/ManagedClustersCreate_DisableRunCommand.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c7b98b36e4023331545051284d8500adf98f02fe/specification/containerservice/resource-manager/Microsoft.ContainerService/aks/preview/2024-05-02-preview/examples/ManagedClustersCreate_DisableRunCommand.json func ExampleManagedClustersClient_BeginCreateOrUpdate_createManagedClusterWithRunCommandDisabled() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -3037,7 +3630,9 @@ func ExampleManagedClustersClient_BeginCreateOrUpdate_createManagedClusterWithRu Name: to.Ptr(armcontainerservice.ManagedClusterSKUName("Basic")), Tier: to.Ptr(armcontainerservice.ManagedClusterSKUTierFree), }, - }, nil) + }, &armcontainerservice.ManagedClustersClientBeginCreateOrUpdateOptions{IfMatch: nil, + IfNoneMatch: nil, + }) if err != nil { log.Fatalf("failed to finish the request: %v", err) } @@ -3081,7 +3676,6 @@ func ExampleManagedClustersClient_BeginCreateOrUpdate_createManagedClusterWithRu // ScaleDownDelayAfterAdd: to.Ptr("15m"), // ScanInterval: to.Ptr("20s"), // }, - // CurrentKubernetesVersion: to.Ptr("1.9.6"), // DNSPrefix: to.Ptr("dnsprefix1"), // EnablePodSecurityPolicy: to.Ptr(true), // EnableRBAC: to.Ptr(true), @@ -3105,10 +3699,10 @@ func ExampleManagedClustersClient_BeginCreateOrUpdate_createManagedClusterWithRu // AllocatedOutboundPorts: to.Ptr[int32](2000), // EffectiveOutboundIPs: []*armcontainerservice.ResourceReference{ // { - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/MC_rg1/providers/Microsoft.Network/publicIPAddresses/mgdoutboundip1"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/MC_rg1/providers/Microsoft.Network/publicIPAddresses/mgdoutboundip1"), // }, // { - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/MC_rg1/providers/Microsoft.Network/publicIPAddresses/mgdoutboundip2"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/MC_rg1/providers/Microsoft.Network/publicIPAddresses/mgdoutboundip2"), // }}, // IdleTimeoutInMinutes: to.Ptr[int32](10), // ManagedOutboundIPs: &armcontainerservice.ManagedClusterLoadBalancerProfileManagedOutboundIPs{ @@ -3139,7 +3733,7 @@ func ExampleManagedClustersClient_BeginCreateOrUpdate_createManagedClusterWithRu // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/8cbd903b0d037c427def0e8fbf167b26e87bd1a9/specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2024-05-01/examples/ManagedClustersCreate_SecurityProfile.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c7b98b36e4023331545051284d8500adf98f02fe/specification/containerservice/resource-manager/Microsoft.ContainerService/aks/preview/2024-05-02-preview/examples/ManagedClustersCreate_SecurityProfile.json func ExampleManagedClustersClient_BeginCreateOrUpdate_createManagedClusterWithSecurityProfileConfigured() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -3194,16 +3788,187 @@ func ExampleManagedClustersClient_BeginCreateOrUpdate_createManagedClusterWithSe Enabled: to.Ptr(true), }, }, - WorkloadIdentity: &armcontainerservice.ManagedClusterSecurityProfileWorkloadIdentity{ - Enabled: to.Ptr(true), + }, + }, + SKU: &armcontainerservice.ManagedClusterSKU{ + Name: to.Ptr(armcontainerservice.ManagedClusterSKUName("Basic")), + Tier: to.Ptr(armcontainerservice.ManagedClusterSKUTierFree), + }, + }, &armcontainerservice.ManagedClustersClientBeginCreateOrUpdateOptions{IfMatch: nil, + IfNoneMatch: nil, + }) + if err != nil { + log.Fatalf("failed to finish the request: %v", err) + } + res, err := poller.PollUntilDone(ctx, nil) + if err != nil { + log.Fatalf("failed to pull the result: %v", err) + } + // You could use response here. We use blank identifier for just demo purposes. + _ = res + // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. + // res.ManagedCluster = armcontainerservice.ManagedCluster{ + // Name: to.Ptr("clustername1"), + // Type: to.Ptr("Microsoft.ContainerService/ManagedClusters"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/rg1/providers/Microsoft.ContainerService/managedClusters/clustername1"), + // Location: to.Ptr("location1"), + // Tags: map[string]*string{ + // "archv2": to.Ptr(""), + // "tier": to.Ptr("production"), + // }, + // Properties: &armcontainerservice.ManagedClusterProperties{ + // AgentPoolProfiles: []*armcontainerservice.ManagedClusterAgentPoolProfile{ + // { + // Type: to.Ptr(armcontainerservice.AgentPoolTypeVirtualMachineScaleSets), + // Count: to.Ptr[int32](3), + // CurrentOrchestratorVersion: to.Ptr("1.9.6"), + // EnableNodePublicIP: to.Ptr(true), + // MaxPods: to.Ptr[int32](110), + // Mode: to.Ptr(armcontainerservice.AgentPoolModeSystem), + // NodeImageVersion: to.Ptr("AKSUbuntu:1604:2020.03.11"), + // OrchestratorVersion: to.Ptr("1.9.6"), + // OSType: to.Ptr(armcontainerservice.OSTypeLinux), + // ProvisioningState: to.Ptr("Succeeded"), + // VMSize: to.Ptr("Standard_DS2_v2"), + // Name: to.Ptr("nodepool1"), + // }}, + // DiskEncryptionSetID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Compute/diskEncryptionSets/des"), + // DNSPrefix: to.Ptr("dnsprefix1"), + // EnablePodSecurityPolicy: to.Ptr(true), + // EnableRBAC: to.Ptr(true), + // Fqdn: to.Ptr("dnsprefix1-abcd1234.hcp.eastus.azmk8s.io"), + // KubernetesVersion: to.Ptr("1.9.6"), + // LinuxProfile: &armcontainerservice.LinuxProfile{ + // AdminUsername: to.Ptr("azureuser"), + // SSH: &armcontainerservice.SSHConfiguration{ + // PublicKeys: []*armcontainerservice.SSHPublicKey{ + // { + // KeyData: to.Ptr("keydata"), + // }}, + // }, + // }, + // MaxAgentPools: to.Ptr[int32](1), + // NetworkProfile: &armcontainerservice.NetworkProfile{ + // DNSServiceIP: to.Ptr("10.0.0.10"), + // IPFamilies: []*armcontainerservice.IPFamily{ + // to.Ptr(armcontainerservice.IPFamilyIPv4)}, + // LoadBalancerProfile: &armcontainerservice.ManagedClusterLoadBalancerProfile{ + // AllocatedOutboundPorts: to.Ptr[int32](2000), + // EffectiveOutboundIPs: []*armcontainerservice.ResourceReference{ + // { + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/MC_rg1/providers/Microsoft.Network/publicIPAddresses/mgdoutboundip1"), + // }, + // { + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/MC_rg1/providers/Microsoft.Network/publicIPAddresses/mgdoutboundip2"), + // }}, + // IdleTimeoutInMinutes: to.Ptr[int32](10), + // ManagedOutboundIPs: &armcontainerservice.ManagedClusterLoadBalancerProfileManagedOutboundIPs{ + // Count: to.Ptr[int32](2), + // }, + // }, + // LoadBalancerSKU: to.Ptr(armcontainerservice.LoadBalancerSKUBasic), + // NetworkPlugin: to.Ptr(armcontainerservice.NetworkPluginKubenet), + // OutboundType: to.Ptr(armcontainerservice.OutboundTypeLoadBalancer), + // PodCidr: to.Ptr("10.244.0.0/16"), + // PodCidrs: []*string{ + // to.Ptr("10.244.0.0/16")}, + // ServiceCidr: to.Ptr("10.0.0.0/16"), + // ServiceCidrs: []*string{ + // to.Ptr("10.0.0.0/16")}, + // }, + // NodeResourceGroup: to.Ptr("MC_rg1_clustername1_location1"), + // ProvisioningState: to.Ptr("Succeeded"), + // SecurityProfile: &armcontainerservice.ManagedClusterSecurityProfile{ + // Defender: &armcontainerservice.ManagedClusterSecurityProfileDefender{ + // LogAnalyticsWorkspaceResourceID: to.Ptr("/subscriptions/SUB_ID/resourcegroups/RG_NAME/providers/microsoft.operationalinsights/workspaces/WORKSPACE_NAME"), + // SecurityMonitoring: &armcontainerservice.ManagedClusterSecurityProfileDefenderSecurityMonitoring{ + // Enabled: to.Ptr(true), + // }, + // }, + // }, + // ServicePrincipalProfile: &armcontainerservice.ManagedClusterServicePrincipalProfile{ + // ClientID: to.Ptr("clientid"), + // }, + // WindowsProfile: &armcontainerservice.ManagedClusterWindowsProfile{ + // AdminUsername: to.Ptr("azureuser"), + // }, + // }, + // } +} + +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c7b98b36e4023331545051284d8500adf98f02fe/specification/containerservice/resource-manager/Microsoft.ContainerService/aks/preview/2024-05-02-preview/examples/ManagedClustersCreate_EnableUltraSSD.json +func ExampleManagedClustersClient_BeginCreateOrUpdate_createManagedClusterWithUltraSsdEnabled() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + clientFactory, err := armcontainerservice.NewClientFactory("", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + poller, err := clientFactory.NewManagedClustersClient().BeginCreateOrUpdate(ctx, "rg1", "clustername1", armcontainerservice.ManagedCluster{ + Location: to.Ptr("location1"), + Tags: map[string]*string{ + "archv2": to.Ptr(""), + "tier": to.Ptr("production"), + }, + Properties: &armcontainerservice.ManagedClusterProperties{ + AddonProfiles: map[string]*armcontainerservice.ManagedClusterAddonProfile{}, + AgentPoolProfiles: []*armcontainerservice.ManagedClusterAgentPoolProfile{ + { + Type: to.Ptr(armcontainerservice.AgentPoolTypeVirtualMachineScaleSets), + Count: to.Ptr[int32](3), + EnableNodePublicIP: to.Ptr(true), + EnableUltraSSD: to.Ptr(true), + Mode: to.Ptr(armcontainerservice.AgentPoolModeSystem), + OSType: to.Ptr(armcontainerservice.OSTypeLinux), + VMSize: to.Ptr("Standard_DS2_v2"), + Name: to.Ptr("nodepool1"), + }}, + AutoScalerProfile: &armcontainerservice.ManagedClusterPropertiesAutoScalerProfile{ + ScaleDownDelayAfterAdd: to.Ptr("15m"), + ScanInterval: to.Ptr("20s"), + }, + DiskEncryptionSetID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Compute/diskEncryptionSets/des"), + DNSPrefix: to.Ptr("dnsprefix1"), + EnablePodSecurityPolicy: to.Ptr(true), + EnableRBAC: to.Ptr(true), + KubernetesVersion: to.Ptr(""), + LinuxProfile: &armcontainerservice.LinuxProfile{ + AdminUsername: to.Ptr("azureuser"), + SSH: &armcontainerservice.SSHConfiguration{ + PublicKeys: []*armcontainerservice.SSHPublicKey{ + { + KeyData: to.Ptr("keydata"), + }}, + }, + }, + NetworkProfile: &armcontainerservice.NetworkProfile{ + LoadBalancerProfile: &armcontainerservice.ManagedClusterLoadBalancerProfile{ + ManagedOutboundIPs: &armcontainerservice.ManagedClusterLoadBalancerProfileManagedOutboundIPs{ + Count: to.Ptr[int32](2), + }, }, + LoadBalancerSKU: to.Ptr(armcontainerservice.LoadBalancerSKUStandard), + OutboundType: to.Ptr(armcontainerservice.OutboundTypeLoadBalancer), + }, + ServicePrincipalProfile: &armcontainerservice.ManagedClusterServicePrincipalProfile{ + ClientID: to.Ptr("clientid"), + Secret: to.Ptr("secret"), + }, + WindowsProfile: &armcontainerservice.ManagedClusterWindowsProfile{ + AdminPassword: to.Ptr("replacePassword1234$"), + AdminUsername: to.Ptr("azureuser"), }, }, SKU: &armcontainerservice.ManagedClusterSKU{ Name: to.Ptr(armcontainerservice.ManagedClusterSKUName("Basic")), Tier: to.Ptr(armcontainerservice.ManagedClusterSKUTierFree), }, - }, nil) + }, &armcontainerservice.ManagedClustersClientBeginCreateOrUpdateOptions{IfMatch: nil, + IfNoneMatch: nil, + }) if err != nil { log.Fatalf("failed to finish the request: %v", err) } @@ -3230,6 +3995,7 @@ func ExampleManagedClustersClient_BeginCreateOrUpdate_createManagedClusterWithSe // Count: to.Ptr[int32](3), // CurrentOrchestratorVersion: to.Ptr("1.9.6"), // EnableNodePublicIP: to.Ptr(true), + // EnableUltraSSD: to.Ptr(true), // MaxPods: to.Ptr[int32](110), // Mode: to.Ptr(armcontainerservice.AgentPoolModeSystem), // NodeImageVersion: to.Ptr("AKSUbuntu:1604:2020.03.11"), @@ -3239,8 +4005,11 @@ func ExampleManagedClustersClient_BeginCreateOrUpdate_createManagedClusterWithSe // VMSize: to.Ptr("Standard_DS2_v2"), // Name: to.Ptr("nodepool1"), // }}, - // CurrentKubernetesVersion: to.Ptr("1.9.6"), - // DiskEncryptionSetID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/rg1/providers/Microsoft.Compute/diskEncryptionSets/des"), + // AutoScalerProfile: &armcontainerservice.ManagedClusterPropertiesAutoScalerProfile{ + // ScaleDownDelayAfterAdd: to.Ptr("15m"), + // ScanInterval: to.Ptr("20s"), + // }, + // DiskEncryptionSetID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Compute/diskEncryptionSets/des"), // DNSPrefix: to.Ptr("dnsprefix1"), // EnablePodSecurityPolicy: to.Ptr(true), // EnableRBAC: to.Ptr(true), @@ -3264,10 +4033,10 @@ func ExampleManagedClustersClient_BeginCreateOrUpdate_createManagedClusterWithSe // AllocatedOutboundPorts: to.Ptr[int32](2000), // EffectiveOutboundIPs: []*armcontainerservice.ResourceReference{ // { - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/MC_rg1/providers/Microsoft.Network/publicIPAddresses/mgdoutboundip1"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/MC_rg1/providers/Microsoft.Network/publicIPAddresses/mgdoutboundip1"), // }, // { - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/MC_rg1/providers/Microsoft.Network/publicIPAddresses/mgdoutboundip2"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/MC_rg1/providers/Microsoft.Network/publicIPAddresses/mgdoutboundip2"), // }}, // IdleTimeoutInMinutes: to.Ptr[int32](10), // ManagedOutboundIPs: &armcontainerservice.ManagedClusterLoadBalancerProfileManagedOutboundIPs{ @@ -3286,17 +4055,6 @@ func ExampleManagedClustersClient_BeginCreateOrUpdate_createManagedClusterWithSe // }, // NodeResourceGroup: to.Ptr("MC_rg1_clustername1_location1"), // ProvisioningState: to.Ptr("Succeeded"), - // SecurityProfile: &armcontainerservice.ManagedClusterSecurityProfile{ - // Defender: &armcontainerservice.ManagedClusterSecurityProfileDefender{ - // LogAnalyticsWorkspaceResourceID: to.Ptr("/subscriptions/SUB_ID/resourcegroups/RG_NAME/providers/microsoft.operationalinsights/workspaces/WORKSPACE_NAME"), - // SecurityMonitoring: &armcontainerservice.ManagedClusterSecurityProfileDefenderSecurityMonitoring{ - // Enabled: to.Ptr(true), - // }, - // }, - // WorkloadIdentity: &armcontainerservice.ManagedClusterSecurityProfileWorkloadIdentity{ - // Enabled: to.Ptr(true), - // }, - // }, // ServicePrincipalProfile: &armcontainerservice.ManagedClusterServicePrincipalProfile{ // ClientID: to.Ptr("clientid"), // }, @@ -3307,8 +4065,8 @@ func ExampleManagedClustersClient_BeginCreateOrUpdate_createManagedClusterWithSe // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/8cbd903b0d037c427def0e8fbf167b26e87bd1a9/specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2024-05-01/examples/ManagedClustersCreate_EnableUltraSSD.json -func ExampleManagedClustersClient_BeginCreateOrUpdate_createManagedClusterWithUltraSsdEnabled() { +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c7b98b36e4023331545051284d8500adf98f02fe/specification/containerservice/resource-manager/Microsoft.ContainerService/aks/preview/2024-05-02-preview/examples/ManagedClustersCreate_VirtualMachines.json +func ExampleManagedClustersClient_BeginCreateOrUpdate_createManagedClusterWithVirtualMachinesPoolType() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) @@ -3328,22 +4086,17 @@ func ExampleManagedClustersClient_BeginCreateOrUpdate_createManagedClusterWithUl AddonProfiles: map[string]*armcontainerservice.ManagedClusterAddonProfile{}, AgentPoolProfiles: []*armcontainerservice.ManagedClusterAgentPoolProfile{ { - Type: to.Ptr(armcontainerservice.AgentPoolTypeVirtualMachineScaleSets), - Count: to.Ptr[int32](3), - EnableNodePublicIP: to.Ptr(true), - EnableUltraSSD: to.Ptr(true), - Mode: to.Ptr(armcontainerservice.AgentPoolModeSystem), - OSType: to.Ptr(armcontainerservice.OSTypeLinux), - VMSize: to.Ptr("Standard_DS2_v2"), - Name: to.Ptr("nodepool1"), + Type: to.Ptr(armcontainerservice.AgentPoolTypeVirtualMachines), + Count: to.Ptr[int32](3), + EnableFIPS: to.Ptr(true), + Mode: to.Ptr(armcontainerservice.AgentPoolModeSystem), + OSType: to.Ptr(armcontainerservice.OSTypeLinux), + VMSize: to.Ptr("Standard_DS2_v2"), + Name: to.Ptr("nodepool1"), }}, - AutoScalerProfile: &armcontainerservice.ManagedClusterPropertiesAutoScalerProfile{ - ScaleDownDelayAfterAdd: to.Ptr("15m"), - ScanInterval: to.Ptr("20s"), - }, - DiskEncryptionSetID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/rg1/providers/Microsoft.Compute/diskEncryptionSets/des"), + DiskEncryptionSetID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Compute/diskEncryptionSets/des"), DNSPrefix: to.Ptr("dnsprefix1"), - EnablePodSecurityPolicy: to.Ptr(true), + EnablePodSecurityPolicy: to.Ptr(false), EnableRBAC: to.Ptr(true), KubernetesVersion: to.Ptr(""), LinuxProfile: &armcontainerservice.LinuxProfile{ @@ -3368,16 +4121,14 @@ func ExampleManagedClustersClient_BeginCreateOrUpdate_createManagedClusterWithUl ClientID: to.Ptr("clientid"), Secret: to.Ptr("secret"), }, - WindowsProfile: &armcontainerservice.ManagedClusterWindowsProfile{ - AdminPassword: to.Ptr("replacePassword1234$"), - AdminUsername: to.Ptr("azureuser"), - }, }, SKU: &armcontainerservice.ManagedClusterSKU{ Name: to.Ptr(armcontainerservice.ManagedClusterSKUName("Basic")), Tier: to.Ptr(armcontainerservice.ManagedClusterSKUTierFree), }, - }, nil) + }, &armcontainerservice.ManagedClustersClientBeginCreateOrUpdateOptions{IfMatch: nil, + IfNoneMatch: nil, + }) if err != nil { log.Fatalf("failed to finish the request: %v", err) } @@ -3400,11 +4151,10 @@ func ExampleManagedClustersClient_BeginCreateOrUpdate_createManagedClusterWithUl // Properties: &armcontainerservice.ManagedClusterProperties{ // AgentPoolProfiles: []*armcontainerservice.ManagedClusterAgentPoolProfile{ // { - // Type: to.Ptr(armcontainerservice.AgentPoolTypeVirtualMachineScaleSets), + // Type: to.Ptr(armcontainerservice.AgentPoolTypeVirtualMachines), // Count: to.Ptr[int32](3), // CurrentOrchestratorVersion: to.Ptr("1.9.6"), - // EnableNodePublicIP: to.Ptr(true), - // EnableUltraSSD: to.Ptr(true), + // EnableFIPS: to.Ptr(true), // MaxPods: to.Ptr[int32](110), // Mode: to.Ptr(armcontainerservice.AgentPoolModeSystem), // NodeImageVersion: to.Ptr("AKSUbuntu:1604:2020.03.11"), @@ -3414,14 +4164,9 @@ func ExampleManagedClustersClient_BeginCreateOrUpdate_createManagedClusterWithUl // VMSize: to.Ptr("Standard_DS2_v2"), // Name: to.Ptr("nodepool1"), // }}, - // AutoScalerProfile: &armcontainerservice.ManagedClusterPropertiesAutoScalerProfile{ - // ScaleDownDelayAfterAdd: to.Ptr("15m"), - // ScanInterval: to.Ptr("20s"), - // }, - // CurrentKubernetesVersion: to.Ptr("1.9.6"), - // DiskEncryptionSetID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/rg1/providers/Microsoft.Compute/diskEncryptionSets/des"), + // DiskEncryptionSetID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Compute/diskEncryptionSets/des"), // DNSPrefix: to.Ptr("dnsprefix1"), - // EnablePodSecurityPolicy: to.Ptr(true), + // EnablePodSecurityPolicy: to.Ptr(false), // EnableRBAC: to.Ptr(true), // Fqdn: to.Ptr("dnsprefix1-abcd1234.hcp.eastus.azmk8s.io"), // KubernetesVersion: to.Ptr("1.9.6"), @@ -3443,10 +4188,10 @@ func ExampleManagedClustersClient_BeginCreateOrUpdate_createManagedClusterWithUl // AllocatedOutboundPorts: to.Ptr[int32](2000), // EffectiveOutboundIPs: []*armcontainerservice.ResourceReference{ // { - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/MC_rg1/providers/Microsoft.Network/publicIPAddresses/mgdoutboundip1"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/MC_rg1/providers/Microsoft.Network/publicIPAddresses/mgdoutboundip1"), // }, // { - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/MC_rg1/providers/Microsoft.Network/publicIPAddresses/mgdoutboundip2"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/MC_rg1/providers/Microsoft.Network/publicIPAddresses/mgdoutboundip2"), // }}, // IdleTimeoutInMinutes: to.Ptr[int32](10), // ManagedOutboundIPs: &armcontainerservice.ManagedClusterLoadBalancerProfileManagedOutboundIPs{ @@ -3468,14 +4213,11 @@ func ExampleManagedClustersClient_BeginCreateOrUpdate_createManagedClusterWithUl // ServicePrincipalProfile: &armcontainerservice.ManagedClusterServicePrincipalProfile{ // ClientID: to.Ptr("clientid"), // }, - // WindowsProfile: &armcontainerservice.ManagedClusterWindowsProfile{ - // AdminUsername: to.Ptr("azureuser"), - // }, // }, // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/8cbd903b0d037c427def0e8fbf167b26e87bd1a9/specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2024-05-01/examples/ManagedClustersCreate_IngressProfile_WebAppRouting.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c7b98b36e4023331545051284d8500adf98f02fe/specification/containerservice/resource-manager/Microsoft.ContainerService/aks/preview/2024-05-02-preview/examples/ManagedClustersCreate_IngressProfile_WebAppRouting.json func ExampleManagedClustersClient_BeginCreateOrUpdate_createManagedClusterWithWebAppRoutingIngressProfileConfigured() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -3535,7 +4277,9 @@ func ExampleManagedClustersClient_BeginCreateOrUpdate_createManagedClusterWithWe Name: to.Ptr(armcontainerservice.ManagedClusterSKUName("Basic")), Tier: to.Ptr(armcontainerservice.ManagedClusterSKUTierFree), }, - }, nil) + }, &armcontainerservice.ManagedClustersClientBeginCreateOrUpdateOptions{IfMatch: nil, + IfNoneMatch: nil, + }) if err != nil { log.Fatalf("failed to finish the request: %v", err) } @@ -3633,7 +4377,7 @@ func ExampleManagedClustersClient_BeginCreateOrUpdate_createManagedClusterWithWe // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/8cbd903b0d037c427def0e8fbf167b26e87bd1a9/specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2024-05-01/examples/ManagedClustersCreate_UserAssignedNATGateway.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c7b98b36e4023331545051284d8500adf98f02fe/specification/containerservice/resource-manager/Microsoft.ContainerService/aks/preview/2024-05-02-preview/examples/ManagedClustersCreate_UserAssignedNATGateway.json func ExampleManagedClustersClient_BeginCreateOrUpdate_createManagedClusterWithUserAssignedNatGatewayAsOutboundType() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -3666,7 +4410,7 @@ func ExampleManagedClustersClient_BeginCreateOrUpdate_createManagedClusterWithUs ScaleDownDelayAfterAdd: to.Ptr("15m"), ScanInterval: to.Ptr("20s"), }, - DiskEncryptionSetID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/rg1/providers/Microsoft.Compute/diskEncryptionSets/des"), + DiskEncryptionSetID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Compute/diskEncryptionSets/des"), DNSPrefix: to.Ptr("dnsprefix1"), EnablePodSecurityPolicy: to.Ptr(true), EnableRBAC: to.Ptr(true), @@ -3697,7 +4441,9 @@ func ExampleManagedClustersClient_BeginCreateOrUpdate_createManagedClusterWithUs Name: to.Ptr(armcontainerservice.ManagedClusterSKUName("Basic")), Tier: to.Ptr(armcontainerservice.ManagedClusterSKUTierFree), }, - }, nil) + }, &armcontainerservice.ManagedClustersClientBeginCreateOrUpdateOptions{IfMatch: nil, + IfNoneMatch: nil, + }) if err != nil { log.Fatalf("failed to finish the request: %v", err) } @@ -3737,8 +4483,7 @@ func ExampleManagedClustersClient_BeginCreateOrUpdate_createManagedClusterWithUs // ScaleDownDelayAfterAdd: to.Ptr("15m"), // ScanInterval: to.Ptr("20s"), // }, - // CurrentKubernetesVersion: to.Ptr("1.9.6"), - // DiskEncryptionSetID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/rg1/providers/Microsoft.Compute/diskEncryptionSets/des"), + // DiskEncryptionSetID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Compute/diskEncryptionSets/des"), // DNSPrefix: to.Ptr("dnsprefix1"), // EnablePodSecurityPolicy: to.Ptr(true), // EnableRBAC: to.Ptr(true), @@ -3774,7 +4519,7 @@ func ExampleManagedClustersClient_BeginCreateOrUpdate_createManagedClusterWithUs // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/8cbd903b0d037c427def0e8fbf167b26e87bd1a9/specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2024-05-01/examples/ManagedClustersCreate_PrivateClusterPublicFQDN.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c7b98b36e4023331545051284d8500adf98f02fe/specification/containerservice/resource-manager/Microsoft.ContainerService/aks/preview/2024-05-02-preview/examples/ManagedClustersCreate_PrivateClusterPublicFQDN.json func ExampleManagedClustersClient_BeginCreateOrUpdate_createManagedPrivateClusterWithPublicFqdnSpecified() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -3847,7 +4592,9 @@ func ExampleManagedClustersClient_BeginCreateOrUpdate_createManagedPrivateCluste Name: to.Ptr(armcontainerservice.ManagedClusterSKUName("Basic")), Tier: to.Ptr(armcontainerservice.ManagedClusterSKUTierFree), }, - }, nil) + }, &armcontainerservice.ManagedClustersClientBeginCreateOrUpdateOptions{IfMatch: nil, + IfNoneMatch: nil, + }) if err != nil { log.Fatalf("failed to finish the request: %v", err) } @@ -3893,7 +4640,6 @@ func ExampleManagedClustersClient_BeginCreateOrUpdate_createManagedPrivateCluste // ScaleDownDelayAfterAdd: to.Ptr("15m"), // ScanInterval: to.Ptr("20s"), // }, - // CurrentKubernetesVersion: to.Ptr("1.9.6"), // DNSPrefix: to.Ptr("dnsprefix1"), // EnablePodSecurityPolicy: to.Ptr(true), // EnableRBAC: to.Ptr(true), @@ -3917,10 +4663,10 @@ func ExampleManagedClustersClient_BeginCreateOrUpdate_createManagedPrivateCluste // AllocatedOutboundPorts: to.Ptr[int32](2000), // EffectiveOutboundIPs: []*armcontainerservice.ResourceReference{ // { - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/MC_rg1/providers/Microsoft.Network/publicIPAddresses/mgdoutboundip1"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/MC_rg1/providers/Microsoft.Network/publicIPAddresses/mgdoutboundip1"), // }, // { - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/MC_rg1/providers/Microsoft.Network/publicIPAddresses/mgdoutboundip2"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/MC_rg1/providers/Microsoft.Network/publicIPAddresses/mgdoutboundip2"), // }}, // IdleTimeoutInMinutes: to.Ptr[int32](10), // ManagedOutboundIPs: &armcontainerservice.ManagedClusterLoadBalancerProfileManagedOutboundIPs{ @@ -3950,7 +4696,7 @@ func ExampleManagedClustersClient_BeginCreateOrUpdate_createManagedPrivateCluste // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/8cbd903b0d037c427def0e8fbf167b26e87bd1a9/specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2024-05-01/examples/ManagedClustersCreate_PrivateClusterFQDNSubdomain.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c7b98b36e4023331545051284d8500adf98f02fe/specification/containerservice/resource-manager/Microsoft.ContainerService/aks/preview/2024-05-02-preview/examples/ManagedClustersCreate_PrivateClusterFQDNSubdomain.json func ExampleManagedClustersClient_BeginCreateOrUpdate_createManagedPrivateClusterWithFqdnSubdomainSpecified() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -4023,7 +4769,9 @@ func ExampleManagedClustersClient_BeginCreateOrUpdate_createManagedPrivateCluste Name: to.Ptr(armcontainerservice.ManagedClusterSKUName("Basic")), Tier: to.Ptr(armcontainerservice.ManagedClusterSKUTierFree), }, - }, nil) + }, &armcontainerservice.ManagedClustersClientBeginCreateOrUpdateOptions{IfMatch: nil, + IfNoneMatch: nil, + }) if err != nil { log.Fatalf("failed to finish the request: %v", err) } @@ -4068,7 +4816,6 @@ func ExampleManagedClustersClient_BeginCreateOrUpdate_createManagedPrivateCluste // ScaleDownDelayAfterAdd: to.Ptr("15m"), // ScanInterval: to.Ptr("20s"), // }, - // CurrentKubernetesVersion: to.Ptr("1.9.6"), // EnablePodSecurityPolicy: to.Ptr(true), // EnableRBAC: to.Ptr(true), // FqdnSubdomain: to.Ptr("domain1"), @@ -4091,10 +4838,10 @@ func ExampleManagedClustersClient_BeginCreateOrUpdate_createManagedPrivateCluste // AllocatedOutboundPorts: to.Ptr[int32](2000), // EffectiveOutboundIPs: []*armcontainerservice.ResourceReference{ // { - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/MC_rg1/providers/Microsoft.Network/publicIPAddresses/mgdoutboundip1"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/MC_rg1/providers/Microsoft.Network/publicIPAddresses/mgdoutboundip1"), // }, // { - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/MC_rg1/providers/Microsoft.Network/publicIPAddresses/mgdoutboundip2"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/MC_rg1/providers/Microsoft.Network/publicIPAddresses/mgdoutboundip2"), // }}, // IdleTimeoutInMinutes: to.Ptr[int32](10), // ManagedOutboundIPs: &armcontainerservice.ManagedClusterLoadBalancerProfileManagedOutboundIPs{ @@ -4124,7 +4871,7 @@ func ExampleManagedClustersClient_BeginCreateOrUpdate_createManagedPrivateCluste // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/8cbd903b0d037c427def0e8fbf167b26e87bd1a9/specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2024-05-01/examples/ManagedClustersCreate_UpdateWithEnableAzureRBAC.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c7b98b36e4023331545051284d8500adf98f02fe/specification/containerservice/resource-manager/Microsoft.ContainerService/aks/preview/2024-05-02-preview/examples/ManagedClustersCreate_UpdateWithEnableAzureRBAC.json func ExampleManagedClustersClient_BeginCreateOrUpdate_createUpdateAadManagedClusterWithEnableAzureRbac() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -4165,7 +4912,7 @@ func ExampleManagedClustersClient_BeginCreateOrUpdate_createUpdateAadManagedClus ScaleDownDelayAfterAdd: to.Ptr("15m"), ScanInterval: to.Ptr("20s"), }, - DiskEncryptionSetID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/rg1/providers/Microsoft.Compute/diskEncryptionSets/des"), + DiskEncryptionSetID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Compute/diskEncryptionSets/des"), DNSPrefix: to.Ptr("dnsprefix1"), EnablePodSecurityPolicy: to.Ptr(true), EnableRBAC: to.Ptr(true), @@ -4201,7 +4948,9 @@ func ExampleManagedClustersClient_BeginCreateOrUpdate_createUpdateAadManagedClus Name: to.Ptr(armcontainerservice.ManagedClusterSKUName("Basic")), Tier: to.Ptr(armcontainerservice.ManagedClusterSKUTierFree), }, - }, nil) + }, &armcontainerservice.ManagedClustersClientBeginCreateOrUpdateOptions{IfMatch: nil, + IfNoneMatch: nil, + }) if err != nil { log.Fatalf("failed to finish the request: %v", err) } @@ -4250,8 +4999,7 @@ func ExampleManagedClustersClient_BeginCreateOrUpdate_createUpdateAadManagedClus // ScaleDownDelayAfterAdd: to.Ptr("15m"), // ScanInterval: to.Ptr("20s"), // }, - // CurrentKubernetesVersion: to.Ptr("1.9.6"), - // DiskEncryptionSetID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/rg1/providers/Microsoft.Compute/diskEncryptionSets/des"), + // DiskEncryptionSetID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Compute/diskEncryptionSets/des"), // DNSPrefix: to.Ptr("dnsprefix1"), // EnablePodSecurityPolicy: to.Ptr(true), // EnableRBAC: to.Ptr(true), @@ -4275,10 +5023,10 @@ func ExampleManagedClustersClient_BeginCreateOrUpdate_createUpdateAadManagedClus // AllocatedOutboundPorts: to.Ptr[int32](2000), // EffectiveOutboundIPs: []*armcontainerservice.ResourceReference{ // { - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/MC_rg1/providers/Microsoft.Network/publicIPAddresses/mgdoutboundip1"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/MC_rg1/providers/Microsoft.Network/publicIPAddresses/mgdoutboundip1"), // }, // { - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/MC_rg1/providers/Microsoft.Network/publicIPAddresses/mgdoutboundip2"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/MC_rg1/providers/Microsoft.Network/publicIPAddresses/mgdoutboundip2"), // }}, // IdleTimeoutInMinutes: to.Ptr[int32](10), // ManagedOutboundIPs: &armcontainerservice.ManagedClusterLoadBalancerProfileManagedOutboundIPs{ @@ -4307,7 +5055,7 @@ func ExampleManagedClustersClient_BeginCreateOrUpdate_createUpdateAadManagedClus // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/8cbd903b0d037c427def0e8fbf167b26e87bd1a9/specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2024-05-01/examples/ManagedClustersCreate_Update.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c7b98b36e4023331545051284d8500adf98f02fe/specification/containerservice/resource-manager/Microsoft.ContainerService/aks/preview/2024-05-02-preview/examples/ManagedClustersCreate_Update.json func ExampleManagedClustersClient_BeginCreateOrUpdate_createUpdateManagedCluster() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -4327,7 +5075,7 @@ func ExampleManagedClustersClient_BeginCreateOrUpdate_createUpdateManagedCluster Identity: &armcontainerservice.ManagedClusterIdentity{ Type: to.Ptr(armcontainerservice.ResourceIdentityTypeUserAssigned), UserAssignedIdentities: map[string]*armcontainerservice.ManagedServiceIdentityUserAssignedIdentitiesValue{ - "/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/rgName1/providers/Microsoft.ManagedIdentity/userAssignedIdentities/identity1": {}, + "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgName1/providers/Microsoft.ManagedIdentity/userAssignedIdentities/identity1": {}, }, }, Properties: &armcontainerservice.ManagedClusterProperties{ @@ -4356,7 +5104,7 @@ func ExampleManagedClustersClient_BeginCreateOrUpdate_createUpdateManagedCluster ScanInterval: to.Ptr("20s"), SkipNodesWithSystemPods: to.Ptr("false"), }, - DiskEncryptionSetID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/rg1/providers/Microsoft.Compute/diskEncryptionSets/des"), + DiskEncryptionSetID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Compute/diskEncryptionSets/des"), DNSPrefix: to.Ptr("dnsprefix1"), EnablePodSecurityPolicy: to.Ptr(true), EnableRBAC: to.Ptr(true), @@ -4385,7 +5133,7 @@ func ExampleManagedClustersClient_BeginCreateOrUpdate_createUpdateManagedCluster }, UpgradeSettings: &armcontainerservice.ClusterUpgradeSettings{ OverrideSettings: &armcontainerservice.UpgradeOverrideSettings{ - ForceUpgrade: to.Ptr(false), + ForceUpgrade: to.Ptr(true), Until: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-11-01T13:00:00.000Z"); return t }()), }, }, @@ -4398,7 +5146,9 @@ func ExampleManagedClustersClient_BeginCreateOrUpdate_createUpdateManagedCluster Name: to.Ptr(armcontainerservice.ManagedClusterSKUName("Basic")), Tier: to.Ptr(armcontainerservice.ManagedClusterSKUTierFree), }, - }, nil) + }, &armcontainerservice.ManagedClustersClientBeginCreateOrUpdateOptions{IfMatch: nil, + IfNoneMatch: nil, + }) if err != nil { log.Fatalf("failed to finish the request: %v", err) } @@ -4421,7 +5171,7 @@ func ExampleManagedClustersClient_BeginCreateOrUpdate_createUpdateManagedCluster // Identity: &armcontainerservice.ManagedClusterIdentity{ // Type: to.Ptr(armcontainerservice.ResourceIdentityTypeUserAssigned), // UserAssignedIdentities: map[string]*armcontainerservice.ManagedServiceIdentityUserAssignedIdentitiesValue{ - // "/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/rgName1/providers/Microsoft.ManagedIdentity/userAssignedIdentities/identity1": &armcontainerservice.ManagedServiceIdentityUserAssignedIdentitiesValue{ + // "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgName1/providers/Microsoft.ManagedIdentity/userAssignedIdentities/identity1": &armcontainerservice.ManagedServiceIdentityUserAssignedIdentitiesValue{ // ClientID: to.Ptr("clientId1"), // PrincipalID: to.Ptr("principalId1"), // }, @@ -4457,8 +5207,7 @@ func ExampleManagedClustersClient_BeginCreateOrUpdate_createUpdateManagedCluster // ScanInterval: to.Ptr("20s"), // SkipNodesWithSystemPods: to.Ptr("false"), // }, - // CurrentKubernetesVersion: to.Ptr("1.9.6"), - // DiskEncryptionSetID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/rg1/providers/Microsoft.Compute/diskEncryptionSets/des"), + // DiskEncryptionSetID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Compute/diskEncryptionSets/des"), // DNSPrefix: to.Ptr("dnsprefix1"), // EnablePodSecurityPolicy: to.Ptr(true), // EnableRBAC: to.Ptr(true), @@ -4482,10 +5231,10 @@ func ExampleManagedClustersClient_BeginCreateOrUpdate_createUpdateManagedCluster // AllocatedOutboundPorts: to.Ptr[int32](2000), // EffectiveOutboundIPs: []*armcontainerservice.ResourceReference{ // { - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/MC_rg1/providers/Microsoft.Network/publicIPAddresses/mgdoutboundip1"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/MC_rg1/providers/Microsoft.Network/publicIPAddresses/mgdoutboundip1"), // }, // { - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/MC_rg1/providers/Microsoft.Network/publicIPAddresses/mgdoutboundip2"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/MC_rg1/providers/Microsoft.Network/publicIPAddresses/mgdoutboundip2"), // }}, // IdleTimeoutInMinutes: to.Ptr[int32](10), // ManagedOutboundIPs: &armcontainerservice.ManagedClusterLoadBalancerProfileManagedOutboundIPs{ @@ -4520,7 +5269,7 @@ func ExampleManagedClustersClient_BeginCreateOrUpdate_createUpdateManagedCluster // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/8cbd903b0d037c427def0e8fbf167b26e87bd1a9/specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2024-05-01/examples/ManagedClustersCreate_AzureServiceMesh.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c7b98b36e4023331545051284d8500adf98f02fe/specification/containerservice/resource-manager/Microsoft.ContainerService/aks/preview/2024-05-02-preview/examples/ManagedClustersCreate_AzureServiceMesh.json func ExampleManagedClustersClient_BeginCreateOrUpdate_createUpdateManagedClusterWithAzureServiceMesh() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -4561,7 +5310,7 @@ func ExampleManagedClustersClient_BeginCreateOrUpdate_createUpdateManagedCluster ScaleDownDelayAfterAdd: to.Ptr("15m"), ScanInterval: to.Ptr("20s"), }, - DiskEncryptionSetID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/rg1/providers/Microsoft.Compute/diskEncryptionSets/des"), + DiskEncryptionSetID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Compute/diskEncryptionSets/des"), DNSPrefix: to.Ptr("dnsprefix1"), EnablePodSecurityPolicy: to.Ptr(true), EnableRBAC: to.Ptr(true), @@ -4622,7 +5371,9 @@ func ExampleManagedClustersClient_BeginCreateOrUpdate_createUpdateManagedCluster Name: to.Ptr(armcontainerservice.ManagedClusterSKUName("Basic")), Tier: to.Ptr(armcontainerservice.ManagedClusterSKUTierFree), }, - }, nil) + }, &armcontainerservice.ManagedClustersClientBeginCreateOrUpdateOptions{IfMatch: nil, + IfNoneMatch: nil, + }) if err != nil { log.Fatalf("failed to finish the request: %v", err) } @@ -4671,7 +5422,7 @@ func ExampleManagedClustersClient_BeginCreateOrUpdate_createUpdateManagedCluster // ScaleDownDelayAfterAdd: to.Ptr("15m"), // ScanInterval: to.Ptr("20s"), // }, - // DiskEncryptionSetID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/rg1/providers/Microsoft.Compute/diskEncryptionSets/des"), + // DiskEncryptionSetID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Compute/diskEncryptionSets/des"), // DNSPrefix: to.Ptr("dnsprefix1"), // EnablePodSecurityPolicy: to.Ptr(true), // EnableRBAC: to.Ptr(true), @@ -4693,63 +5444,255 @@ func ExampleManagedClustersClient_BeginCreateOrUpdate_createUpdateManagedCluster // AllocatedOutboundPorts: to.Ptr[int32](2000), // EffectiveOutboundIPs: []*armcontainerservice.ResourceReference{ // { - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/MC_rg1/providers/Microsoft.Network/publicIPAddresses/mgdoutboundip1"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/MC_rg1/providers/Microsoft.Network/publicIPAddresses/mgdoutboundip1"), // }, // { - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/MC_rg1/providers/Microsoft.Network/publicIPAddresses/mgdoutboundip2"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/MC_rg1/providers/Microsoft.Network/publicIPAddresses/mgdoutboundip2"), // }}, // IdleTimeoutInMinutes: to.Ptr[int32](10), // ManagedOutboundIPs: &armcontainerservice.ManagedClusterLoadBalancerProfileManagedOutboundIPs{ // Count: to.Ptr[int32](2), // }, // }, - // LoadBalancerSKU: to.Ptr(armcontainerservice.LoadBalancerSKUBasic), - // NetworkPlugin: to.Ptr(armcontainerservice.NetworkPluginKubenet), - // OutboundType: to.Ptr(armcontainerservice.OutboundTypeLoadBalancer), - // PodCidr: to.Ptr("10.244.0.0/16"), - // ServiceCidr: to.Ptr("10.0.0.0/16"), - // }, - // NodeResourceGroup: to.Ptr("MC_rg1_clustername1_location1"), - // ProvisioningState: to.Ptr("Succeeded"), - // ServiceMeshProfile: &armcontainerservice.ServiceMeshProfile{ - // Istio: &armcontainerservice.IstioServiceMesh{ - // CertificateAuthority: &armcontainerservice.IstioCertificateAuthority{ - // Plugin: &armcontainerservice.IstioPluginCertificateAuthority{ - // CertChainObjectName: to.Ptr("cert-chain"), - // CertObjectName: to.Ptr("ca-cert"), - // KeyObjectName: to.Ptr("ca-key"), - // KeyVaultID: to.Ptr("/subscriptions/854c9ddb-fe9e-4aea-8d58-99ed88282881/resourceGroups/ddama-test/providers/Microsoft.KeyVault/vaults/my-akv"), - // RootCertObjectName: to.Ptr("root-cert"), - // }, - // }, - // Components: &armcontainerservice.IstioComponents{ - // EgressGateways: []*armcontainerservice.IstioEgressGateway{ - // { - // Enabled: to.Ptr(true), - // }}, - // IngressGateways: []*armcontainerservice.IstioIngressGateway{ + // LoadBalancerSKU: to.Ptr(armcontainerservice.LoadBalancerSKUBasic), + // NetworkPlugin: to.Ptr(armcontainerservice.NetworkPluginKubenet), + // OutboundType: to.Ptr(armcontainerservice.OutboundTypeLoadBalancer), + // PodCidr: to.Ptr("10.244.0.0/16"), + // ServiceCidr: to.Ptr("10.0.0.0/16"), + // }, + // NodeResourceGroup: to.Ptr("MC_rg1_clustername1_location1"), + // ProvisioningState: to.Ptr("Succeeded"), + // ServiceMeshProfile: &armcontainerservice.ServiceMeshProfile{ + // Istio: &armcontainerservice.IstioServiceMesh{ + // CertificateAuthority: &armcontainerservice.IstioCertificateAuthority{ + // Plugin: &armcontainerservice.IstioPluginCertificateAuthority{ + // CertChainObjectName: to.Ptr("cert-chain"), + // CertObjectName: to.Ptr("ca-cert"), + // KeyObjectName: to.Ptr("ca-key"), + // KeyVaultID: to.Ptr("/subscriptions/854c9ddb-fe9e-4aea-8d58-99ed88282881/resourceGroups/ddama-test/providers/Microsoft.KeyVault/vaults/my-akv"), + // RootCertObjectName: to.Ptr("root-cert"), + // }, + // }, + // Components: &armcontainerservice.IstioComponents{ + // EgressGateways: []*armcontainerservice.IstioEgressGateway{ + // { + // Enabled: to.Ptr(true), + // }}, + // IngressGateways: []*armcontainerservice.IstioIngressGateway{ + // { + // Enabled: to.Ptr(true), + // Mode: to.Ptr(armcontainerservice.IstioIngressGatewayModeInternal), + // }}, + // }, + // Revisions: []*string{ + // to.Ptr("asm-1-17")}, + // }, + // Mode: to.Ptr(armcontainerservice.ServiceMeshModeIstio), + // }, + // ServicePrincipalProfile: &armcontainerservice.ManagedClusterServicePrincipalProfile{ + // ClientID: to.Ptr("clientid"), + // }, + // WindowsProfile: &armcontainerservice.ManagedClusterWindowsProfile{ + // AdminUsername: to.Ptr("azureuser"), + // }, + // }, + // } +} + +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c7b98b36e4023331545051284d8500adf98f02fe/specification/containerservice/resource-manager/Microsoft.ContainerService/aks/preview/2024-05-02-preview/examples/ManagedClustersCreate_UpdateWithAHUB.json +func ExampleManagedClustersClient_BeginCreateOrUpdate_createUpdateManagedClusterWithEnableAhub() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + clientFactory, err := armcontainerservice.NewClientFactory("", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + poller, err := clientFactory.NewManagedClustersClient().BeginCreateOrUpdate(ctx, "rg1", "clustername1", armcontainerservice.ManagedCluster{ + Location: to.Ptr("location1"), + Tags: map[string]*string{ + "archv2": to.Ptr(""), + "tier": to.Ptr("production"), + }, + Identity: &armcontainerservice.ManagedClusterIdentity{ + Type: to.Ptr(armcontainerservice.ResourceIdentityTypeUserAssigned), + UserAssignedIdentities: map[string]*armcontainerservice.ManagedServiceIdentityUserAssignedIdentitiesValue{ + "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgName1/providers/Microsoft.ManagedIdentity/userAssignedIdentities/identity1": {}, + }, + }, + Properties: &armcontainerservice.ManagedClusterProperties{ + AddonProfiles: map[string]*armcontainerservice.ManagedClusterAddonProfile{}, + AgentPoolProfiles: []*armcontainerservice.ManagedClusterAgentPoolProfile{ + { + Type: to.Ptr(armcontainerservice.AgentPoolTypeVirtualMachineScaleSets), + AvailabilityZones: []*string{ + to.Ptr("1"), + to.Ptr("2"), + to.Ptr("3")}, + Count: to.Ptr[int32](3), + EnableNodePublicIP: to.Ptr(true), + Mode: to.Ptr(armcontainerservice.AgentPoolModeSystem), + OSType: to.Ptr(armcontainerservice.OSTypeLinux), + VMSize: to.Ptr("Standard_DS1_v2"), + Name: to.Ptr("nodepool1"), + }}, + AutoScalerProfile: &armcontainerservice.ManagedClusterPropertiesAutoScalerProfile{ + ScaleDownDelayAfterAdd: to.Ptr("15m"), + ScanInterval: to.Ptr("20s"), + }, + DiskEncryptionSetID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Compute/diskEncryptionSets/des"), + DNSPrefix: to.Ptr("dnsprefix1"), + EnablePodSecurityPolicy: to.Ptr(true), + EnableRBAC: to.Ptr(true), + KubernetesVersion: to.Ptr(""), + LinuxProfile: &armcontainerservice.LinuxProfile{ + AdminUsername: to.Ptr("azureuser"), + SSH: &armcontainerservice.SSHConfiguration{ + PublicKeys: []*armcontainerservice.SSHPublicKey{ + { + KeyData: to.Ptr("keydata"), + }}, + }, + }, + NetworkProfile: &armcontainerservice.NetworkProfile{ + LoadBalancerProfile: &armcontainerservice.ManagedClusterLoadBalancerProfile{ + ManagedOutboundIPs: &armcontainerservice.ManagedClusterLoadBalancerProfileManagedOutboundIPs{ + Count: to.Ptr[int32](2), + }, + }, + LoadBalancerSKU: to.Ptr(armcontainerservice.LoadBalancerSKUStandard), + OutboundType: to.Ptr(armcontainerservice.OutboundTypeLoadBalancer), + }, + ServicePrincipalProfile: &armcontainerservice.ManagedClusterServicePrincipalProfile{ + ClientID: to.Ptr("clientid"), + Secret: to.Ptr("secret"), + }, + WindowsProfile: &armcontainerservice.ManagedClusterWindowsProfile{ + AdminPassword: to.Ptr("replacePassword1234$"), + AdminUsername: to.Ptr("azureuser"), + LicenseType: to.Ptr(armcontainerservice.LicenseTypeWindowsServer), + }, + }, + SKU: &armcontainerservice.ManagedClusterSKU{ + Name: to.Ptr(armcontainerservice.ManagedClusterSKUName("Basic")), + Tier: to.Ptr(armcontainerservice.ManagedClusterSKUTierFree), + }, + }, &armcontainerservice.ManagedClustersClientBeginCreateOrUpdateOptions{IfMatch: nil, + IfNoneMatch: nil, + }) + if err != nil { + log.Fatalf("failed to finish the request: %v", err) + } + res, err := poller.PollUntilDone(ctx, nil) + if err != nil { + log.Fatalf("failed to pull the result: %v", err) + } + // You could use response here. We use blank identifier for just demo purposes. + _ = res + // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. + // res.ManagedCluster = armcontainerservice.ManagedCluster{ + // Name: to.Ptr("clustername1"), + // Type: to.Ptr("Microsoft.ContainerService/ManagedClusters"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/rg1/providers/Microsoft.ContainerService/managedClusters/clustername1"), + // Location: to.Ptr("location1"), + // Tags: map[string]*string{ + // "archv2": to.Ptr(""), + // "tier": to.Ptr("production"), + // }, + // Identity: &armcontainerservice.ManagedClusterIdentity{ + // Type: to.Ptr(armcontainerservice.ResourceIdentityTypeUserAssigned), + // UserAssignedIdentities: map[string]*armcontainerservice.ManagedServiceIdentityUserAssignedIdentitiesValue{ + // "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgName1/providers/Microsoft.ManagedIdentity/userAssignedIdentities/identity1": &armcontainerservice.ManagedServiceIdentityUserAssignedIdentitiesValue{ + // ClientID: to.Ptr("clientId1"), + // PrincipalID: to.Ptr("principalId1"), + // }, + // }, + // }, + // Properties: &armcontainerservice.ManagedClusterProperties{ + // AgentPoolProfiles: []*armcontainerservice.ManagedClusterAgentPoolProfile{ + // { + // Type: to.Ptr(armcontainerservice.AgentPoolTypeVirtualMachineScaleSets), + // AvailabilityZones: []*string{ + // to.Ptr("1"), + // to.Ptr("2"), + // to.Ptr("3")}, + // Count: to.Ptr[int32](3), + // CurrentOrchestratorVersion: to.Ptr("1.9.6"), + // EnableNodePublicIP: to.Ptr(true), + // MaxPods: to.Ptr[int32](110), + // Mode: to.Ptr(armcontainerservice.AgentPoolModeSystem), + // NodeImageVersion: to.Ptr("AKSUbuntu:1604:2020.03.11"), + // OrchestratorVersion: to.Ptr("1.9.6"), + // OSType: to.Ptr(armcontainerservice.OSTypeLinux), + // ProvisioningState: to.Ptr("Succeeded"), + // VMSize: to.Ptr("Standard_DS1_v2"), + // Name: to.Ptr("nodepool1"), + // }}, + // AutoScalerProfile: &armcontainerservice.ManagedClusterPropertiesAutoScalerProfile{ + // ScaleDownDelayAfterAdd: to.Ptr("15m"), + // ScanInterval: to.Ptr("20s"), + // }, + // DiskEncryptionSetID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Compute/diskEncryptionSets/des"), + // DNSPrefix: to.Ptr("dnsprefix1"), + // EnablePodSecurityPolicy: to.Ptr(true), + // EnableRBAC: to.Ptr(true), + // Fqdn: to.Ptr("dnsprefix1-abcd1234.hcp.eastus.azmk8s.io"), + // KubernetesVersion: to.Ptr("1.9.6"), + // LinuxProfile: &armcontainerservice.LinuxProfile{ + // AdminUsername: to.Ptr("azureuser"), + // SSH: &armcontainerservice.SSHConfiguration{ + // PublicKeys: []*armcontainerservice.SSHPublicKey{ // { - // Enabled: to.Ptr(true), - // Mode: to.Ptr(armcontainerservice.IstioIngressGatewayModeInternal), + // KeyData: to.Ptr("keydata"), // }}, // }, - // Revisions: []*string{ - // to.Ptr("asm-1-17")}, - // }, - // Mode: to.Ptr(armcontainerservice.ServiceMeshModeIstio), - // }, - // ServicePrincipalProfile: &armcontainerservice.ManagedClusterServicePrincipalProfile{ - // ClientID: to.Ptr("clientid"), - // }, - // WindowsProfile: &armcontainerservice.ManagedClusterWindowsProfile{ - // AdminUsername: to.Ptr("azureuser"), // }, - // }, - // } + // MaxAgentPools: to.Ptr[int32](1), + // NetworkProfile: &armcontainerservice.NetworkProfile{ + // DNSServiceIP: to.Ptr("10.0.0.10"), + // IPFamilies: []*armcontainerservice.IPFamily{ + // to.Ptr(armcontainerservice.IPFamilyIPv4)}, + // LoadBalancerProfile: &armcontainerservice.ManagedClusterLoadBalancerProfile{ + // AllocatedOutboundPorts: to.Ptr[int32](2000), + // EffectiveOutboundIPs: []*armcontainerservice.ResourceReference{ + // { + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/MC_rg1/providers/Microsoft.Network/publicIPAddresses/mgdoutboundip1"), + // }, + // { + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/MC_rg1/providers/Microsoft.Network/publicIPAddresses/mgdoutboundip2"), + // }}, + // IdleTimeoutInMinutes: to.Ptr[int32](10), + // ManagedOutboundIPs: &armcontainerservice.ManagedClusterLoadBalancerProfileManagedOutboundIPs{ + // Count: to.Ptr[int32](2), + // }, + // }, + // LoadBalancerSKU: to.Ptr(armcontainerservice.LoadBalancerSKUBasic), + // NetworkPlugin: to.Ptr(armcontainerservice.NetworkPluginKubenet), + // OutboundType: to.Ptr(armcontainerservice.OutboundTypeLoadBalancer), + // PodCidr: to.Ptr("10.244.0.0/16"), + // PodCidrs: []*string{ + // to.Ptr("10.244.0.0/16")}, + // ServiceCidr: to.Ptr("10.0.0.0/16"), + // ServiceCidrs: []*string{ + // to.Ptr("10.0.0.0/16")}, + // }, + // NodeResourceGroup: to.Ptr("MC_rg1_clustername1_location1"), + // ProvisioningState: to.Ptr("Succeeded"), + // ServicePrincipalProfile: &armcontainerservice.ManagedClusterServicePrincipalProfile{ + // ClientID: to.Ptr("clientid"), + // }, + // WindowsProfile: &armcontainerservice.ManagedClusterWindowsProfile{ + // AdminUsername: to.Ptr("azureuser"), + // LicenseType: to.Ptr(armcontainerservice.LicenseTypeWindowsServer), + // }, + // }, + // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/8cbd903b0d037c427def0e8fbf167b26e87bd1a9/specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2024-05-01/examples/ManagedClustersCreate_UpdateWithAHUB.json -func ExampleManagedClustersClient_BeginCreateOrUpdate_createUpdateManagedClusterWithEnableAhub() { +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c7b98b36e4023331545051284d8500adf98f02fe/specification/containerservice/resource-manager/Microsoft.ContainerService/aks/preview/2024-05-02-preview/examples/ManagedClustersCreate_UpdateWithEnableNamespaceResources.json +func ExampleManagedClustersClient_BeginCreateOrUpdate_createUpdateManagedClusterWithEnableNamespaceResources() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) @@ -4765,12 +5708,6 @@ func ExampleManagedClustersClient_BeginCreateOrUpdate_createUpdateManagedCluster "archv2": to.Ptr(""), "tier": to.Ptr("production"), }, - Identity: &armcontainerservice.ManagedClusterIdentity{ - Type: to.Ptr(armcontainerservice.ResourceIdentityTypeUserAssigned), - UserAssignedIdentities: map[string]*armcontainerservice.ManagedServiceIdentityUserAssignedIdentitiesValue{ - "/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/rgName1/providers/Microsoft.ManagedIdentity/userAssignedIdentities/identity1": {}, - }, - }, Properties: &armcontainerservice.ManagedClusterProperties{ AddonProfiles: map[string]*armcontainerservice.ManagedClusterAddonProfile{}, AgentPoolProfiles: []*armcontainerservice.ManagedClusterAgentPoolProfile{ @@ -4791,11 +5728,12 @@ func ExampleManagedClustersClient_BeginCreateOrUpdate_createUpdateManagedCluster ScaleDownDelayAfterAdd: to.Ptr("15m"), ScanInterval: to.Ptr("20s"), }, - DiskEncryptionSetID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/rg1/providers/Microsoft.Compute/diskEncryptionSets/des"), - DNSPrefix: to.Ptr("dnsprefix1"), - EnablePodSecurityPolicy: to.Ptr(true), - EnableRBAC: to.Ptr(true), - KubernetesVersion: to.Ptr(""), + DiskEncryptionSetID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Compute/diskEncryptionSets/des"), + DNSPrefix: to.Ptr("dnsprefix1"), + EnableNamespaceResources: to.Ptr(true), + EnablePodSecurityPolicy: to.Ptr(true), + EnableRBAC: to.Ptr(true), + KubernetesVersion: to.Ptr(""), LinuxProfile: &armcontainerservice.LinuxProfile{ AdminUsername: to.Ptr("azureuser"), SSH: &armcontainerservice.SSHConfiguration{ @@ -4821,14 +5759,15 @@ func ExampleManagedClustersClient_BeginCreateOrUpdate_createUpdateManagedCluster WindowsProfile: &armcontainerservice.ManagedClusterWindowsProfile{ AdminPassword: to.Ptr("replacePassword1234$"), AdminUsername: to.Ptr("azureuser"), - LicenseType: to.Ptr(armcontainerservice.LicenseTypeWindowsServer), }, }, SKU: &armcontainerservice.ManagedClusterSKU{ Name: to.Ptr(armcontainerservice.ManagedClusterSKUName("Basic")), Tier: to.Ptr(armcontainerservice.ManagedClusterSKUTierFree), }, - }, nil) + }, &armcontainerservice.ManagedClustersClientBeginCreateOrUpdateOptions{IfMatch: nil, + IfNoneMatch: nil, + }) if err != nil { log.Fatalf("failed to finish the request: %v", err) } @@ -4848,15 +5787,6 @@ func ExampleManagedClustersClient_BeginCreateOrUpdate_createUpdateManagedCluster // "archv2": to.Ptr(""), // "tier": to.Ptr("production"), // }, - // Identity: &armcontainerservice.ManagedClusterIdentity{ - // Type: to.Ptr(armcontainerservice.ResourceIdentityTypeUserAssigned), - // UserAssignedIdentities: map[string]*armcontainerservice.ManagedServiceIdentityUserAssignedIdentitiesValue{ - // "/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/rgName1/providers/Microsoft.ManagedIdentity/userAssignedIdentities/identity1": &armcontainerservice.ManagedServiceIdentityUserAssignedIdentitiesValue{ - // ClientID: to.Ptr("clientId1"), - // PrincipalID: to.Ptr("principalId1"), - // }, - // }, - // }, // Properties: &armcontainerservice.ManagedClusterProperties{ // AgentPoolProfiles: []*armcontainerservice.ManagedClusterAgentPoolProfile{ // { @@ -4881,9 +5811,9 @@ func ExampleManagedClustersClient_BeginCreateOrUpdate_createUpdateManagedCluster // ScaleDownDelayAfterAdd: to.Ptr("15m"), // ScanInterval: to.Ptr("20s"), // }, - // CurrentKubernetesVersion: to.Ptr("1.9.6"), - // DiskEncryptionSetID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/rg1/providers/Microsoft.Compute/diskEncryptionSets/des"), + // DiskEncryptionSetID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Compute/diskEncryptionSets/des"), // DNSPrefix: to.Ptr("dnsprefix1"), + // EnableNamespaceResources: to.Ptr(true), // EnablePodSecurityPolicy: to.Ptr(true), // EnableRBAC: to.Ptr(true), // Fqdn: to.Ptr("dnsprefix1-abcd1234.hcp.eastus.azmk8s.io"), @@ -4906,10 +5836,10 @@ func ExampleManagedClustersClient_BeginCreateOrUpdate_createUpdateManagedCluster // AllocatedOutboundPorts: to.Ptr[int32](2000), // EffectiveOutboundIPs: []*armcontainerservice.ResourceReference{ // { - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/MC_rg1/providers/Microsoft.Network/publicIPAddresses/mgdoutboundip1"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/MC_rg1/providers/Microsoft.Network/publicIPAddresses/mgdoutboundip1"), // }, // { - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/MC_rg1/providers/Microsoft.Network/publicIPAddresses/mgdoutboundip2"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/MC_rg1/providers/Microsoft.Network/publicIPAddresses/mgdoutboundip2"), // }}, // IdleTimeoutInMinutes: to.Ptr[int32](10), // ManagedOutboundIPs: &armcontainerservice.ManagedClusterLoadBalancerProfileManagedOutboundIPs{ @@ -4933,13 +5863,12 @@ func ExampleManagedClustersClient_BeginCreateOrUpdate_createUpdateManagedCluster // }, // WindowsProfile: &armcontainerservice.ManagedClusterWindowsProfile{ // AdminUsername: to.Ptr("azureuser"), - // LicenseType: to.Ptr(armcontainerservice.LicenseTypeWindowsServer), // }, // }, // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/8cbd903b0d037c427def0e8fbf167b26e87bd1a9/specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2024-05-01/examples/ManagedClustersCreate_UpdateWindowsGmsa.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c7b98b36e4023331545051284d8500adf98f02fe/specification/containerservice/resource-manager/Microsoft.ContainerService/aks/preview/2024-05-02-preview/examples/ManagedClustersCreate_UpdateWindowsGmsa.json func ExampleManagedClustersClient_BeginCreateOrUpdate_createUpdateManagedClusterWithWindowsGMsaEnabled() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -4959,7 +5888,7 @@ func ExampleManagedClustersClient_BeginCreateOrUpdate_createUpdateManagedCluster Identity: &armcontainerservice.ManagedClusterIdentity{ Type: to.Ptr(armcontainerservice.ResourceIdentityTypeUserAssigned), UserAssignedIdentities: map[string]*armcontainerservice.ManagedServiceIdentityUserAssignedIdentitiesValue{ - "/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/rgName1/providers/Microsoft.ManagedIdentity/userAssignedIdentities/identity1": {}, + "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgName1/providers/Microsoft.ManagedIdentity/userAssignedIdentities/identity1": {}, }, }, Properties: &armcontainerservice.ManagedClusterProperties{ @@ -4982,7 +5911,7 @@ func ExampleManagedClustersClient_BeginCreateOrUpdate_createUpdateManagedCluster ScaleDownDelayAfterAdd: to.Ptr("15m"), ScanInterval: to.Ptr("20s"), }, - DiskEncryptionSetID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/rg1/providers/Microsoft.Compute/diskEncryptionSets/des"), + DiskEncryptionSetID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Compute/diskEncryptionSets/des"), DNSPrefix: to.Ptr("dnsprefix1"), EnablePodSecurityPolicy: to.Ptr(true), EnableRBAC: to.Ptr(true), @@ -5021,7 +5950,9 @@ func ExampleManagedClustersClient_BeginCreateOrUpdate_createUpdateManagedCluster Name: to.Ptr(armcontainerservice.ManagedClusterSKUName("Basic")), Tier: to.Ptr(armcontainerservice.ManagedClusterSKUTierFree), }, - }, nil) + }, &armcontainerservice.ManagedClustersClientBeginCreateOrUpdateOptions{IfMatch: nil, + IfNoneMatch: nil, + }) if err != nil { log.Fatalf("failed to finish the request: %v", err) } @@ -5044,7 +5975,7 @@ func ExampleManagedClustersClient_BeginCreateOrUpdate_createUpdateManagedCluster // Identity: &armcontainerservice.ManagedClusterIdentity{ // Type: to.Ptr(armcontainerservice.ResourceIdentityTypeUserAssigned), // UserAssignedIdentities: map[string]*armcontainerservice.ManagedServiceIdentityUserAssignedIdentitiesValue{ - // "/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/rgName1/providers/Microsoft.ManagedIdentity/userAssignedIdentities/identity1": &armcontainerservice.ManagedServiceIdentityUserAssignedIdentitiesValue{ + // "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgName1/providers/Microsoft.ManagedIdentity/userAssignedIdentities/identity1": &armcontainerservice.ManagedServiceIdentityUserAssignedIdentitiesValue{ // ClientID: to.Ptr("clientId1"), // PrincipalID: to.Ptr("principalId1"), // }, @@ -5074,8 +6005,7 @@ func ExampleManagedClustersClient_BeginCreateOrUpdate_createUpdateManagedCluster // ScaleDownDelayAfterAdd: to.Ptr("15m"), // ScanInterval: to.Ptr("20s"), // }, - // CurrentKubernetesVersion: to.Ptr("1.9.6"), - // DiskEncryptionSetID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/rg1/providers/Microsoft.Compute/diskEncryptionSets/des"), + // DiskEncryptionSetID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Compute/diskEncryptionSets/des"), // DNSPrefix: to.Ptr("dnsprefix1"), // EnablePodSecurityPolicy: to.Ptr(true), // EnableRBAC: to.Ptr(true), @@ -5099,10 +6029,10 @@ func ExampleManagedClustersClient_BeginCreateOrUpdate_createUpdateManagedCluster // AllocatedOutboundPorts: to.Ptr[int32](2000), // EffectiveOutboundIPs: []*armcontainerservice.ResourceReference{ // { - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/MC_rg1/providers/Microsoft.Network/publicIPAddresses/mgdoutboundip1"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/MC_rg1/providers/Microsoft.Network/publicIPAddresses/mgdoutboundip1"), // }, // { - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/MC_rg1/providers/Microsoft.Network/publicIPAddresses/mgdoutboundip2"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/MC_rg1/providers/Microsoft.Network/publicIPAddresses/mgdoutboundip2"), // }}, // IdleTimeoutInMinutes: to.Ptr[int32](10), // ManagedOutboundIPs: &armcontainerservice.ManagedClusterLoadBalancerProfileManagedOutboundIPs{ @@ -5134,7 +6064,7 @@ func ExampleManagedClustersClient_BeginCreateOrUpdate_createUpdateManagedCluster // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/8cbd903b0d037c427def0e8fbf167b26e87bd1a9/specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2024-05-01/examples/ManagedClustersCreate_DualStackNetworking.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c7b98b36e4023331545051284d8500adf98f02fe/specification/containerservice/resource-manager/Microsoft.ContainerService/aks/preview/2024-05-02-preview/examples/ManagedClustersCreate_DualStackNetworking.json func ExampleManagedClustersClient_BeginCreateOrUpdate_createUpdateManagedClusterWithDualStackNetworking() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -5154,7 +6084,7 @@ func ExampleManagedClustersClient_BeginCreateOrUpdate_createUpdateManagedCluster Identity: &armcontainerservice.ManagedClusterIdentity{ Type: to.Ptr(armcontainerservice.ResourceIdentityTypeUserAssigned), UserAssignedIdentities: map[string]*armcontainerservice.ManagedServiceIdentityUserAssignedIdentitiesValue{ - "/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/rgName1/providers/Microsoft.ManagedIdentity/userAssignedIdentities/identity1": {}, + "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgName1/providers/Microsoft.ManagedIdentity/userAssignedIdentities/identity1": {}, }, }, Properties: &armcontainerservice.ManagedClusterProperties{ @@ -5183,7 +6113,7 @@ func ExampleManagedClustersClient_BeginCreateOrUpdate_createUpdateManagedCluster ScanInterval: to.Ptr("20s"), SkipNodesWithSystemPods: to.Ptr("false"), }, - DiskEncryptionSetID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/rg1/providers/Microsoft.Compute/diskEncryptionSets/des"), + DiskEncryptionSetID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Compute/diskEncryptionSets/des"), DNSPrefix: to.Ptr("dnsprefix1"), EnablePodSecurityPolicy: to.Ptr(true), EnableRBAC: to.Ptr(true), @@ -5222,7 +6152,9 @@ func ExampleManagedClustersClient_BeginCreateOrUpdate_createUpdateManagedCluster Name: to.Ptr(armcontainerservice.ManagedClusterSKUName("Basic")), Tier: to.Ptr(armcontainerservice.ManagedClusterSKUTierFree), }, - }, nil) + }, &armcontainerservice.ManagedClustersClientBeginCreateOrUpdateOptions{IfMatch: nil, + IfNoneMatch: nil, + }) if err != nil { log.Fatalf("failed to finish the request: %v", err) } @@ -5245,7 +6177,7 @@ func ExampleManagedClustersClient_BeginCreateOrUpdate_createUpdateManagedCluster // Identity: &armcontainerservice.ManagedClusterIdentity{ // Type: to.Ptr(armcontainerservice.ResourceIdentityTypeUserAssigned), // UserAssignedIdentities: map[string]*armcontainerservice.ManagedServiceIdentityUserAssignedIdentitiesValue{ - // "/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/rgName1/providers/Microsoft.ManagedIdentity/userAssignedIdentities/identity1": &armcontainerservice.ManagedServiceIdentityUserAssignedIdentitiesValue{ + // "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgName1/providers/Microsoft.ManagedIdentity/userAssignedIdentities/identity1": &armcontainerservice.ManagedServiceIdentityUserAssignedIdentitiesValue{ // ClientID: to.Ptr("clientId1"), // PrincipalID: to.Ptr("principalId1"), // }, @@ -5260,12 +6192,12 @@ func ExampleManagedClustersClient_BeginCreateOrUpdate_createUpdateManagedCluster // to.Ptr("2"), // to.Ptr("3")}, // Count: to.Ptr[int32](3), - // CurrentOrchestratorVersion: to.Ptr("1.22.1"), + // CurrentOrchestratorVersion: to.Ptr("1.9.6"), // EnableNodePublicIP: to.Ptr(true), // MaxPods: to.Ptr[int32](110), // Mode: to.Ptr(armcontainerservice.AgentPoolModeSystem), // NodeImageVersion: to.Ptr("AKSUbuntu:1604:2020.03.11"), - // OrchestratorVersion: to.Ptr("1.22.1"), + // OrchestratorVersion: to.Ptr("1.9.6"), // OSType: to.Ptr(armcontainerservice.OSTypeLinux), // ProvisioningState: to.Ptr("Succeeded"), // ScaleDownMode: to.Ptr(armcontainerservice.ScaleDownModeDeallocate), @@ -5281,13 +6213,12 @@ func ExampleManagedClustersClient_BeginCreateOrUpdate_createUpdateManagedCluster // ScanInterval: to.Ptr("20s"), // SkipNodesWithSystemPods: to.Ptr("false"), // }, - // CurrentKubernetesVersion: to.Ptr("1.22.1"), - // DiskEncryptionSetID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/rg1/providers/Microsoft.Compute/diskEncryptionSets/des"), + // DiskEncryptionSetID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Compute/diskEncryptionSets/des"), // DNSPrefix: to.Ptr("dnsprefix1"), // EnablePodSecurityPolicy: to.Ptr(true), // EnableRBAC: to.Ptr(true), // Fqdn: to.Ptr("dnsprefix1-abcd1234.hcp.eastus.azmk8s.io"), - // KubernetesVersion: to.Ptr("1.22.1"), + // KubernetesVersion: to.Ptr("1.9.6"), // LinuxProfile: &armcontainerservice.LinuxProfile{ // AdminUsername: to.Ptr("azureuser"), // SSH: &armcontainerservice.SSHConfiguration{ @@ -5307,13 +6238,13 @@ func ExampleManagedClustersClient_BeginCreateOrUpdate_createUpdateManagedCluster // AllocatedOutboundPorts: to.Ptr[int32](2000), // EffectiveOutboundIPs: []*armcontainerservice.ResourceReference{ // { - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/MC_rg1/providers/Microsoft.Network/publicIPAddresses/mgdoutboundip1"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/MC_rg1/providers/Microsoft.Network/publicIPAddresses/mgdoutboundip1"), // }, // { - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/MC_rg1/providers/Microsoft.Network/publicIPAddresses/mgdoutboundip2"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/MC_rg1/providers/Microsoft.Network/publicIPAddresses/mgdoutboundip2"), // }, // { - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/MC_rg1/providers/Microsoft.Network/publicIPAddresses/mgdoutboundip3-ipv6"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/MC_rg1/providers/Microsoft.Network/publicIPAddresses/mgdoutboundip3-ipv6"), // }}, // IdleTimeoutInMinutes: to.Ptr[int32](10), // ManagedOutboundIPs: &armcontainerservice.ManagedClusterLoadBalancerProfileManagedOutboundIPs{ @@ -5345,7 +6276,7 @@ func ExampleManagedClustersClient_BeginCreateOrUpdate_createUpdateManagedCluster // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/8cbd903b0d037c427def0e8fbf167b26e87bd1a9/specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2024-05-01/examples/ManagedClustersUpdateTags.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c7b98b36e4023331545051284d8500adf98f02fe/specification/containerservice/resource-manager/Microsoft.ContainerService/aks/preview/2024-05-02-preview/examples/ManagedClustersUpdateTags.json func ExampleManagedClustersClient_BeginUpdateTags() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -5361,7 +6292,7 @@ func ExampleManagedClustersClient_BeginUpdateTags() { "archv3": to.Ptr(""), "tier": to.Ptr("testing"), }, - }, nil) + }, &armcontainerservice.ManagedClustersClientBeginUpdateTagsOptions{IfMatch: nil}) if err != nil { log.Fatalf("failed to finish the request: %v", err) } @@ -5393,7 +6324,7 @@ func ExampleManagedClustersClient_BeginUpdateTags() { // VMSize: to.Ptr("Standard_DS1_v2"), // Name: to.Ptr("nodepool1"), // }}, - // DiskEncryptionSetID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/rg1/providers/Microsoft.Compute/diskEncryptionSets/des"), + // DiskEncryptionSetID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Compute/diskEncryptionSets/des"), // DNSPrefix: to.Ptr("dnsprefix1"), // EnableRBAC: to.Ptr(false), // Fqdn: to.Ptr("dnsprefix1-abcd1234.hcp.eastus.azmk8s.io"), @@ -5422,7 +6353,7 @@ func ExampleManagedClustersClient_BeginUpdateTags() { // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/8cbd903b0d037c427def0e8fbf167b26e87bd1a9/specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2024-05-01/examples/ManagedClustersDelete.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c7b98b36e4023331545051284d8500adf98f02fe/specification/containerservice/resource-manager/Microsoft.ContainerService/aks/preview/2024-05-02-preview/examples/ManagedClustersDelete.json func ExampleManagedClustersClient_BeginDelete() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -5433,7 +6364,9 @@ func ExampleManagedClustersClient_BeginDelete() { if err != nil { log.Fatalf("failed to create client: %v", err) } - poller, err := clientFactory.NewManagedClustersClient().BeginDelete(ctx, "rg1", "clustername1", nil) + poller, err := clientFactory.NewManagedClustersClient().BeginDelete(ctx, "rg1", "clustername1", &armcontainerservice.ManagedClustersClientBeginDeleteOptions{IgnorePodDisruptionBudget: nil, + IfMatch: nil, + }) if err != nil { log.Fatalf("failed to finish the request: %v", err) } @@ -5443,7 +6376,7 @@ func ExampleManagedClustersClient_BeginDelete() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/8cbd903b0d037c427def0e8fbf167b26e87bd1a9/specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2024-05-01/examples/ManagedClustersResetServicePrincipalProfile.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c7b98b36e4023331545051284d8500adf98f02fe/specification/containerservice/resource-manager/Microsoft.ContainerService/aks/preview/2024-05-02-preview/examples/ManagedClustersResetServicePrincipalProfile.json func ExampleManagedClustersClient_BeginResetServicePrincipalProfile() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -5467,7 +6400,7 @@ func ExampleManagedClustersClient_BeginResetServicePrincipalProfile() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/8cbd903b0d037c427def0e8fbf167b26e87bd1a9/specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2024-05-01/examples/ManagedClustersResetAADProfile.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c7b98b36e4023331545051284d8500adf98f02fe/specification/containerservice/resource-manager/Microsoft.ContainerService/aks/preview/2024-05-02-preview/examples/ManagedClustersResetAADProfile.json func ExampleManagedClustersClient_BeginResetAADProfile() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -5493,8 +6426,8 @@ func ExampleManagedClustersClient_BeginResetAADProfile() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/8cbd903b0d037c427def0e8fbf167b26e87bd1a9/specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2024-05-01/examples/ManagedClustersRotateClusterCertificates.json -func ExampleManagedClustersClient_BeginRotateClusterCertificates() { +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c7b98b36e4023331545051284d8500adf98f02fe/specification/containerservice/resource-manager/Microsoft.ContainerService/aks/preview/2024-05-02-preview/examples/ManagedClustersAbortOperation.json +func ExampleManagedClustersClient_BeginAbortLatestOperation() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) @@ -5504,7 +6437,7 @@ func ExampleManagedClustersClient_BeginRotateClusterCertificates() { if err != nil { log.Fatalf("failed to create client: %v", err) } - poller, err := clientFactory.NewManagedClustersClient().BeginRotateClusterCertificates(ctx, "rg1", "clustername1", nil) + poller, err := clientFactory.NewManagedClustersClient().BeginAbortLatestOperation(ctx, "rg1", "clustername1", nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } @@ -5514,8 +6447,8 @@ func ExampleManagedClustersClient_BeginRotateClusterCertificates() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/8cbd903b0d037c427def0e8fbf167b26e87bd1a9/specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2024-05-01/examples/ManagedClustersAbortOperation.json -func ExampleManagedClustersClient_BeginAbortLatestOperation() { +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c7b98b36e4023331545051284d8500adf98f02fe/specification/containerservice/resource-manager/Microsoft.ContainerService/aks/preview/2024-05-02-preview/examples/ManagedClustersRotateClusterCertificates.json +func ExampleManagedClustersClient_BeginRotateClusterCertificates() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) @@ -5525,7 +6458,7 @@ func ExampleManagedClustersClient_BeginAbortLatestOperation() { if err != nil { log.Fatalf("failed to create client: %v", err) } - poller, err := clientFactory.NewManagedClustersClient().BeginAbortLatestOperation(ctx, "rg1", "clustername1", nil) + poller, err := clientFactory.NewManagedClustersClient().BeginRotateClusterCertificates(ctx, "rg1", "clustername1", nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } @@ -5535,7 +6468,7 @@ func ExampleManagedClustersClient_BeginAbortLatestOperation() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/8cbd903b0d037c427def0e8fbf167b26e87bd1a9/specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2024-05-01/examples/ManagedClustersRotateServiceAccountSigningKeys.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c7b98b36e4023331545051284d8500adf98f02fe/specification/containerservice/resource-manager/Microsoft.ContainerService/aks/preview/2024-05-02-preview/examples/ManagedClustersRotateServiceAccountSigningKeys.json func ExampleManagedClustersClient_BeginRotateServiceAccountSigningKeys() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -5556,7 +6489,7 @@ func ExampleManagedClustersClient_BeginRotateServiceAccountSigningKeys() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/8cbd903b0d037c427def0e8fbf167b26e87bd1a9/specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2024-05-01/examples/ManagedClustersStop.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c7b98b36e4023331545051284d8500adf98f02fe/specification/containerservice/resource-manager/Microsoft.ContainerService/aks/preview/2024-05-02-preview/examples/ManagedClustersStop.json func ExampleManagedClustersClient_BeginStop() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -5577,7 +6510,7 @@ func ExampleManagedClustersClient_BeginStop() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/8cbd903b0d037c427def0e8fbf167b26e87bd1a9/specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2024-05-01/examples/ManagedClustersStart.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c7b98b36e4023331545051284d8500adf98f02fe/specification/containerservice/resource-manager/Microsoft.ContainerService/aks/preview/2024-05-02-preview/examples/ManagedClustersStart.json func ExampleManagedClustersClient_BeginStart() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -5598,7 +6531,7 @@ func ExampleManagedClustersClient_BeginStart() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/8cbd903b0d037c427def0e8fbf167b26e87bd1a9/specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2024-05-01/examples/RunCommandRequest.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c7b98b36e4023331545051284d8500adf98f02fe/specification/containerservice/resource-manager/Microsoft.ContainerService/aks/preview/2024-05-02-preview/examples/RunCommandRequest.json func ExampleManagedClustersClient_BeginRunCommand() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -5636,7 +6569,7 @@ func ExampleManagedClustersClient_BeginRunCommand() { // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/8cbd903b0d037c427def0e8fbf167b26e87bd1a9/specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2024-05-01/examples/RunCommandResultFailed.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c7b98b36e4023331545051284d8500adf98f02fe/specification/containerservice/resource-manager/Microsoft.ContainerService/aks/preview/2024-05-02-preview/examples/RunCommandResultFailed.json func ExampleManagedClustersClient_GetCommandResult_commandFailedResult() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -5663,7 +6596,7 @@ func ExampleManagedClustersClient_GetCommandResult_commandFailedResult() { // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/8cbd903b0d037c427def0e8fbf167b26e87bd1a9/specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2024-05-01/examples/RunCommandResultSucceed.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c7b98b36e4023331545051284d8500adf98f02fe/specification/containerservice/resource-manager/Microsoft.ContainerService/aks/preview/2024-05-02-preview/examples/RunCommandResultSucceed.json func ExampleManagedClustersClient_GetCommandResult_commandSucceedResult() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -5693,7 +6626,7 @@ func ExampleManagedClustersClient_GetCommandResult_commandSucceedResult() { // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/8cbd903b0d037c427def0e8fbf167b26e87bd1a9/specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2024-05-01/examples/OutboundNetworkDependenciesEndpointsList.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c7b98b36e4023331545051284d8500adf98f02fe/specification/containerservice/resource-manager/Microsoft.ContainerService/aks/preview/2024-05-02-preview/examples/OutboundNetworkDependenciesEndpointsList.json func ExampleManagedClustersClient_NewListOutboundNetworkDependenciesEndpointsPager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -5918,7 +6851,139 @@ func ExampleManagedClustersClient_NewListOutboundNetworkDependenciesEndpointsPag } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/8cbd903b0d037c427def0e8fbf167b26e87bd1a9/specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2024-05-01/examples/ManagedClustersList_MeshRevisionProfiles.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c7b98b36e4023331545051284d8500adf98f02fe/specification/containerservice/resource-manager/Microsoft.ContainerService/aks/preview/2024-05-02-preview/examples/GetGuardrailsVersions.json +func ExampleManagedClustersClient_GetGuardrailsVersions() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + clientFactory, err := armcontainerservice.NewClientFactory("", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + res, err := clientFactory.NewManagedClustersClient().GetGuardrailsVersions(ctx, "location1", "v1.0.0", nil) + if err != nil { + log.Fatalf("failed to finish the request: %v", err) + } + // You could use response here. We use blank identifier for just demo purposes. + _ = res + // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. + // res.GuardrailsAvailableVersion = armcontainerservice.GuardrailsAvailableVersion{ + // Name: to.Ptr("v1.0.0"), + // Type: to.Ptr("Microsoft.ContainerService/locations/guardrailsVersions"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.ContainerService/locations/location1/guardrailsVersions/v1.0.0"), + // Properties: &armcontainerservice.GuardrailsAvailableVersionsProperties{ + // IsDefaultVersion: to.Ptr(true), + // Support: to.Ptr(armcontainerservice.GuardrailsSupportPreview), + // }, + // } +} + +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c7b98b36e4023331545051284d8500adf98f02fe/specification/containerservice/resource-manager/Microsoft.ContainerService/aks/preview/2024-05-02-preview/examples/ListGuardrailsVersions.json +func ExampleManagedClustersClient_NewListGuardrailsVersionsPager() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + clientFactory, err := armcontainerservice.NewClientFactory("", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + pager := clientFactory.NewManagedClustersClient().NewListGuardrailsVersionsPager("location1", nil) + for pager.More() { + page, err := pager.NextPage(ctx) + if err != nil { + log.Fatalf("failed to advance page: %v", err) + } + for _, v := range page.Value { + // You could use page here. We use blank identifier for just demo purposes. + _ = v + } + // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. + // page.GuardrailsAvailableVersionsList = armcontainerservice.GuardrailsAvailableVersionsList{ + // Value: []*armcontainerservice.GuardrailsAvailableVersion{ + // { + // Name: to.Ptr("v1.0.0"), + // Type: to.Ptr("Microsoft.ContainerService/locations/guardrailsVersions"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.ContainerService/locations/location1/guardrailsVersions/v1.0.0"), + // Properties: &armcontainerservice.GuardrailsAvailableVersionsProperties{ + // IsDefaultVersion: to.Ptr(true), + // Support: to.Ptr(armcontainerservice.GuardrailsSupportPreview), + // }, + // }}, + // } + } +} + +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c7b98b36e4023331545051284d8500adf98f02fe/specification/containerservice/resource-manager/Microsoft.ContainerService/aks/preview/2024-05-02-preview/examples/GetSafeguardsVersions.json +func ExampleManagedClustersClient_GetSafeguardsVersions() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + clientFactory, err := armcontainerservice.NewClientFactory("", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + res, err := clientFactory.NewManagedClustersClient().GetSafeguardsVersions(ctx, "location1", "v1.0.0", nil) + if err != nil { + log.Fatalf("failed to finish the request: %v", err) + } + // You could use response here. We use blank identifier for just demo purposes. + _ = res + // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. + // res.SafeguardsAvailableVersion = armcontainerservice.SafeguardsAvailableVersion{ + // Name: to.Ptr("v1.0.0"), + // Type: to.Ptr("Microsoft.ContainerService/locations/safeguardsVersions"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.ContainerService/locations/location1/safeguardsVersions/v1.0.0"), + // Properties: &armcontainerservice.SafeguardsAvailableVersionsProperties{ + // IsDefaultVersion: to.Ptr(true), + // Support: to.Ptr(armcontainerservice.SafeguardsSupportPreview), + // }, + // } +} + +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c7b98b36e4023331545051284d8500adf98f02fe/specification/containerservice/resource-manager/Microsoft.ContainerService/aks/preview/2024-05-02-preview/examples/ListSafeguardsVersions.json +func ExampleManagedClustersClient_NewListSafeguardsVersionsPager() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + clientFactory, err := armcontainerservice.NewClientFactory("", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + pager := clientFactory.NewManagedClustersClient().NewListSafeguardsVersionsPager("location1", nil) + for pager.More() { + page, err := pager.NextPage(ctx) + if err != nil { + log.Fatalf("failed to advance page: %v", err) + } + for _, v := range page.Value { + // You could use page here. We use blank identifier for just demo purposes. + _ = v + } + // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. + // page.SafeguardsAvailableVersionsList = armcontainerservice.SafeguardsAvailableVersionsList{ + // Value: []*armcontainerservice.SafeguardsAvailableVersion{ + // { + // Name: to.Ptr("v1.0.0"), + // Type: to.Ptr("Microsoft.ContainerService/locations/safeguardsVersions"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.ContainerService/locations/location1/safeguardsVersions/v1.0.0"), + // Properties: &armcontainerservice.SafeguardsAvailableVersionsProperties{ + // IsDefaultVersion: to.Ptr(true), + // Support: to.Ptr(armcontainerservice.SafeguardsSupportPreview), + // }, + // }}, + // } + } +} + +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c7b98b36e4023331545051284d8500adf98f02fe/specification/containerservice/resource-manager/Microsoft.ContainerService/aks/preview/2024-05-02-preview/examples/ManagedClustersList_MeshRevisionProfiles.json func ExampleManagedClustersClient_NewListMeshRevisionProfilesPager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -5960,7 +7025,7 @@ func ExampleManagedClustersClient_NewListMeshRevisionProfilesPager() { // }}, // Revision: to.Ptr("asm-1-17"), // Upgrades: []*string{ - // to.Ptr("asm-1-18")}, + // to.Ptr("1-18")}, // }, // { // CompatibleWith: []*armcontainerservice.CompatibleVersions{ @@ -5982,7 +7047,7 @@ func ExampleManagedClustersClient_NewListMeshRevisionProfilesPager() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/8cbd903b0d037c427def0e8fbf167b26e87bd1a9/specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2024-05-01/examples/ManagedClustersGet_MeshRevisionProfile.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c7b98b36e4023331545051284d8500adf98f02fe/specification/containerservice/resource-manager/Microsoft.ContainerService/aks/preview/2024-05-02-preview/examples/ManagedClustersGet_MeshRevisionProfile.json func ExampleManagedClustersClient_GetMeshRevisionProfile() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -6018,7 +7083,7 @@ func ExampleManagedClustersClient_GetMeshRevisionProfile() { // }}, // Revision: to.Ptr("asm-1-17"), // Upgrades: []*string{ - // to.Ptr("asm-1-18")}, + // to.Ptr("1-18")}, // }, // { // CompatibleWith: []*armcontainerservice.CompatibleVersions{ @@ -6038,7 +7103,7 @@ func ExampleManagedClustersClient_GetMeshRevisionProfile() { // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/8cbd903b0d037c427def0e8fbf167b26e87bd1a9/specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2024-05-01/examples/ManagedClustersList_MeshUpgradeProfiles.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c7b98b36e4023331545051284d8500adf98f02fe/specification/containerservice/resource-manager/Microsoft.ContainerService/aks/preview/2024-05-02-preview/examples/ManagedClustersList_MeshUpgradeProfiles.json func ExampleManagedClustersClient_NewListMeshUpgradeProfilesPager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -6078,14 +7143,14 @@ func ExampleManagedClustersClient_NewListMeshUpgradeProfilesPager() { // }}, // Revision: to.Ptr("asm-1-17"), // Upgrades: []*string{ - // to.Ptr("asm-1-18")}, + // to.Ptr("1-18")}, // }, // }}, // } } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/8cbd903b0d037c427def0e8fbf167b26e87bd1a9/specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2024-05-01/examples/ManagedClustersGet_MeshUpgradeProfile.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c7b98b36e4023331545051284d8500adf98f02fe/specification/containerservice/resource-manager/Microsoft.ContainerService/aks/preview/2024-05-02-preview/examples/ManagedClustersGet_MeshUpgradeProfile.json func ExampleManagedClustersClient_GetMeshUpgradeProfile() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -6119,7 +7184,31 @@ func ExampleManagedClustersClient_GetMeshUpgradeProfile() { // }}, // Revision: to.Ptr("asm-1-17"), // Upgrades: []*string{ - // to.Ptr("asm-1-18")}, + // to.Ptr("1-18")}, // }, // } } + +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c7b98b36e4023331545051284d8500adf98f02fe/specification/containerservice/resource-manager/Microsoft.ContainerService/aks/preview/2024-05-02-preview/examples/LoadBalancers_Rebalance.json +func ExampleManagedClustersClient_BeginRebalanceLoadBalancers() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + clientFactory, err := armcontainerservice.NewClientFactory("", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + poller, err := clientFactory.NewManagedClustersClient().BeginRebalanceLoadBalancers(ctx, "rg1", "clustername1", armcontainerservice.RebalanceLoadBalancersRequestBody{ + LoadBalancerNames: []*string{ + to.Ptr("kubernetes")}, + }, nil) + if err != nil { + log.Fatalf("failed to finish the request: %v", err) + } + _, err = poller.PollUntilDone(ctx, nil) + if err != nil { + log.Fatalf("failed to pull the result: %v", err) + } +} diff --git a/sdk/resourcemanager/containerservice/armcontainerservice/managedclustersnapshots_client.go b/sdk/resourcemanager/containerservice/armcontainerservice/managedclustersnapshots_client.go new file mode 100644 index 000000000000..bed6ce510f88 --- /dev/null +++ b/sdk/resourcemanager/containerservice/armcontainerservice/managedclustersnapshots_client.go @@ -0,0 +1,417 @@ +//go:build go1.18 +// +build go1.18 + +// 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. DO NOT EDIT. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +package armcontainerservice + +import ( + "context" + "errors" + "github.com/Azure/azure-sdk-for-go/sdk/azcore" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" + "net/http" + "net/url" + "strings" +) + +// ManagedClusterSnapshotsClient contains the methods for the ManagedClusterSnapshots group. +// Don't use this type directly, use NewManagedClusterSnapshotsClient() instead. +type ManagedClusterSnapshotsClient struct { + internal *arm.Client + subscriptionID string +} + +// NewManagedClusterSnapshotsClient creates a new instance of ManagedClusterSnapshotsClient with the specified values. +// - subscriptionID - The ID of the target subscription. The value must be an UUID. +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. +func NewManagedClusterSnapshotsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*ManagedClusterSnapshotsClient, error) { + cl, err := arm.NewClient(moduleName, moduleVersion, credential, options) + if err != nil { + return nil, err + } + client := &ManagedClusterSnapshotsClient{ + subscriptionID: subscriptionID, + internal: cl, + } + return client, nil +} + +// CreateOrUpdate - Creates or updates a managed cluster snapshot. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2024-05-02-preview +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - resourceName - The name of the managed cluster resource. +// - parameters - The managed cluster snapshot to create or update. +// - options - ManagedClusterSnapshotsClientCreateOrUpdateOptions contains the optional parameters for the ManagedClusterSnapshotsClient.CreateOrUpdate +// method. +func (client *ManagedClusterSnapshotsClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, resourceName string, parameters ManagedClusterSnapshot, options *ManagedClusterSnapshotsClientCreateOrUpdateOptions) (ManagedClusterSnapshotsClientCreateOrUpdateResponse, error) { + var err error + const operationName = "ManagedClusterSnapshotsClient.CreateOrUpdate" + ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) + ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) + defer func() { endSpan(err) }() + req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, resourceName, parameters, options) + if err != nil { + return ManagedClusterSnapshotsClientCreateOrUpdateResponse{}, err + } + httpResp, err := client.internal.Pipeline().Do(req) + if err != nil { + return ManagedClusterSnapshotsClientCreateOrUpdateResponse{}, err + } + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusCreated) { + err = runtime.NewResponseError(httpResp) + return ManagedClusterSnapshotsClientCreateOrUpdateResponse{}, err + } + resp, err := client.createOrUpdateHandleResponse(httpResp) + return resp, err +} + +// createOrUpdateCreateRequest creates the CreateOrUpdate request. +func (client *ManagedClusterSnapshotsClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, resourceName string, parameters ManagedClusterSnapshot, options *ManagedClusterSnapshotsClientCreateOrUpdateOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedclustersnapshots/{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 := runtime.NewRequest(ctx, http.MethodPut, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2024-05-02-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + if err := runtime.MarshalAsJSON(req, parameters); err != nil { + return nil, err + } + return req, nil +} + +// createOrUpdateHandleResponse handles the CreateOrUpdate response. +func (client *ManagedClusterSnapshotsClient) createOrUpdateHandleResponse(resp *http.Response) (ManagedClusterSnapshotsClientCreateOrUpdateResponse, error) { + result := ManagedClusterSnapshotsClientCreateOrUpdateResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.ManagedClusterSnapshot); err != nil { + return ManagedClusterSnapshotsClientCreateOrUpdateResponse{}, err + } + return result, nil +} + +// Delete - Deletes a managed cluster snapshot. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2024-05-02-preview +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - resourceName - The name of the managed cluster resource. +// - options - ManagedClusterSnapshotsClientDeleteOptions contains the optional parameters for the ManagedClusterSnapshotsClient.Delete +// method. +func (client *ManagedClusterSnapshotsClient) Delete(ctx context.Context, resourceGroupName string, resourceName string, options *ManagedClusterSnapshotsClientDeleteOptions) (ManagedClusterSnapshotsClientDeleteResponse, error) { + var err error + const operationName = "ManagedClusterSnapshotsClient.Delete" + ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) + ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) + defer func() { endSpan(err) }() + req, err := client.deleteCreateRequest(ctx, resourceGroupName, resourceName, options) + if err != nil { + return ManagedClusterSnapshotsClientDeleteResponse{}, err + } + httpResp, err := client.internal.Pipeline().Do(req) + if err != nil { + return ManagedClusterSnapshotsClientDeleteResponse{}, err + } + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusNoContent) { + err = runtime.NewResponseError(httpResp) + return ManagedClusterSnapshotsClientDeleteResponse{}, err + } + return ManagedClusterSnapshotsClientDeleteResponse{}, nil +} + +// deleteCreateRequest creates the Delete request. +func (client *ManagedClusterSnapshotsClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, resourceName string, options *ManagedClusterSnapshotsClientDeleteOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedclustersnapshots/{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 := runtime.NewRequest(ctx, http.MethodDelete, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2024-05-02-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// Get - Gets a managed cluster snapshot. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2024-05-02-preview +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - resourceName - The name of the managed cluster resource. +// - options - ManagedClusterSnapshotsClientGetOptions contains the optional parameters for the ManagedClusterSnapshotsClient.Get +// method. +func (client *ManagedClusterSnapshotsClient) Get(ctx context.Context, resourceGroupName string, resourceName string, options *ManagedClusterSnapshotsClientGetOptions) (ManagedClusterSnapshotsClientGetResponse, error) { + var err error + const operationName = "ManagedClusterSnapshotsClient.Get" + ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) + ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) + defer func() { endSpan(err) }() + req, err := client.getCreateRequest(ctx, resourceGroupName, resourceName, options) + if err != nil { + return ManagedClusterSnapshotsClientGetResponse{}, err + } + httpResp, err := client.internal.Pipeline().Do(req) + if err != nil { + return ManagedClusterSnapshotsClientGetResponse{}, err + } + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return ManagedClusterSnapshotsClientGetResponse{}, err + } + resp, err := client.getHandleResponse(httpResp) + return resp, err +} + +// getCreateRequest creates the Get request. +func (client *ManagedClusterSnapshotsClient) getCreateRequest(ctx context.Context, resourceGroupName string, resourceName string, options *ManagedClusterSnapshotsClientGetOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedclustersnapshots/{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 := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2024-05-02-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// getHandleResponse handles the Get response. +func (client *ManagedClusterSnapshotsClient) getHandleResponse(resp *http.Response) (ManagedClusterSnapshotsClientGetResponse, error) { + result := ManagedClusterSnapshotsClientGetResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.ManagedClusterSnapshot); err != nil { + return ManagedClusterSnapshotsClientGetResponse{}, err + } + return result, nil +} + +// NewListPager - Gets a list of managed cluster snapshots in the specified subscription. +// +// Generated from API version 2024-05-02-preview +// - options - ManagedClusterSnapshotsClientListOptions contains the optional parameters for the ManagedClusterSnapshotsClient.NewListPager +// method. +func (client *ManagedClusterSnapshotsClient) NewListPager(options *ManagedClusterSnapshotsClientListOptions) *runtime.Pager[ManagedClusterSnapshotsClientListResponse] { + return runtime.NewPager(runtime.PagingHandler[ManagedClusterSnapshotsClientListResponse]{ + More: func(page ManagedClusterSnapshotsClientListResponse) bool { + return page.NextLink != nil && len(*page.NextLink) > 0 + }, + Fetcher: func(ctx context.Context, page *ManagedClusterSnapshotsClientListResponse) (ManagedClusterSnapshotsClientListResponse, error) { + ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, "ManagedClusterSnapshotsClient.NewListPager") + nextLink := "" + if page != nil { + nextLink = *page.NextLink + } + resp, err := runtime.FetcherForNextLink(ctx, client.internal.Pipeline(), nextLink, func(ctx context.Context) (*policy.Request, error) { + return client.listCreateRequest(ctx, options) + }, nil) + if err != nil { + return ManagedClusterSnapshotsClientListResponse{}, err + } + return client.listHandleResponse(resp) + }, + Tracer: client.internal.Tracer(), + }) +} + +// listCreateRequest creates the List request. +func (client *ManagedClusterSnapshotsClient) listCreateRequest(ctx context.Context, options *ManagedClusterSnapshotsClientListOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.ContainerService/managedclustersnapshots" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2024-05-02-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// listHandleResponse handles the List response. +func (client *ManagedClusterSnapshotsClient) listHandleResponse(resp *http.Response) (ManagedClusterSnapshotsClientListResponse, error) { + result := ManagedClusterSnapshotsClientListResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.ManagedClusterSnapshotListResult); err != nil { + return ManagedClusterSnapshotsClientListResponse{}, err + } + return result, nil +} + +// NewListByResourceGroupPager - Lists managed cluster snapshots in the specified subscription and resource group. +// +// Generated from API version 2024-05-02-preview +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - options - ManagedClusterSnapshotsClientListByResourceGroupOptions contains the optional parameters for the ManagedClusterSnapshotsClient.NewListByResourceGroupPager +// method. +func (client *ManagedClusterSnapshotsClient) NewListByResourceGroupPager(resourceGroupName string, options *ManagedClusterSnapshotsClientListByResourceGroupOptions) *runtime.Pager[ManagedClusterSnapshotsClientListByResourceGroupResponse] { + return runtime.NewPager(runtime.PagingHandler[ManagedClusterSnapshotsClientListByResourceGroupResponse]{ + More: func(page ManagedClusterSnapshotsClientListByResourceGroupResponse) bool { + return page.NextLink != nil && len(*page.NextLink) > 0 + }, + Fetcher: func(ctx context.Context, page *ManagedClusterSnapshotsClientListByResourceGroupResponse) (ManagedClusterSnapshotsClientListByResourceGroupResponse, error) { + ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, "ManagedClusterSnapshotsClient.NewListByResourceGroupPager") + nextLink := "" + if page != nil { + nextLink = *page.NextLink + } + resp, err := runtime.FetcherForNextLink(ctx, client.internal.Pipeline(), nextLink, func(ctx context.Context) (*policy.Request, error) { + return client.listByResourceGroupCreateRequest(ctx, resourceGroupName, options) + }, nil) + if err != nil { + return ManagedClusterSnapshotsClientListByResourceGroupResponse{}, err + } + return client.listByResourceGroupHandleResponse(resp) + }, + Tracer: client.internal.Tracer(), + }) +} + +// listByResourceGroupCreateRequest creates the ListByResourceGroup request. +func (client *ManagedClusterSnapshotsClient) listByResourceGroupCreateRequest(ctx context.Context, resourceGroupName string, options *ManagedClusterSnapshotsClientListByResourceGroupOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedclustersnapshots" + 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 := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2024-05-02-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// listByResourceGroupHandleResponse handles the ListByResourceGroup response. +func (client *ManagedClusterSnapshotsClient) listByResourceGroupHandleResponse(resp *http.Response) (ManagedClusterSnapshotsClientListByResourceGroupResponse, error) { + result := ManagedClusterSnapshotsClientListByResourceGroupResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.ManagedClusterSnapshotListResult); err != nil { + return ManagedClusterSnapshotsClientListByResourceGroupResponse{}, err + } + return result, nil +} + +// UpdateTags - Updates tags on a managed cluster snapshot. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2024-05-02-preview +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - resourceName - The name of the managed cluster resource. +// - parameters - Parameters supplied to the Update managed cluster snapshot Tags operation. +// - options - ManagedClusterSnapshotsClientUpdateTagsOptions contains the optional parameters for the ManagedClusterSnapshotsClient.UpdateTags +// method. +func (client *ManagedClusterSnapshotsClient) UpdateTags(ctx context.Context, resourceGroupName string, resourceName string, parameters TagsObject, options *ManagedClusterSnapshotsClientUpdateTagsOptions) (ManagedClusterSnapshotsClientUpdateTagsResponse, error) { + var err error + const operationName = "ManagedClusterSnapshotsClient.UpdateTags" + ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) + ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) + defer func() { endSpan(err) }() + req, err := client.updateTagsCreateRequest(ctx, resourceGroupName, resourceName, parameters, options) + if err != nil { + return ManagedClusterSnapshotsClientUpdateTagsResponse{}, err + } + httpResp, err := client.internal.Pipeline().Do(req) + if err != nil { + return ManagedClusterSnapshotsClientUpdateTagsResponse{}, err + } + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return ManagedClusterSnapshotsClientUpdateTagsResponse{}, err + } + resp, err := client.updateTagsHandleResponse(httpResp) + return resp, err +} + +// updateTagsCreateRequest creates the UpdateTags request. +func (client *ManagedClusterSnapshotsClient) updateTagsCreateRequest(ctx context.Context, resourceGroupName string, resourceName string, parameters TagsObject, options *ManagedClusterSnapshotsClientUpdateTagsOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedclustersnapshots/{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 := runtime.NewRequest(ctx, http.MethodPatch, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2024-05-02-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + if err := runtime.MarshalAsJSON(req, parameters); err != nil { + return nil, err + } + return req, nil +} + +// updateTagsHandleResponse handles the UpdateTags response. +func (client *ManagedClusterSnapshotsClient) updateTagsHandleResponse(resp *http.Response) (ManagedClusterSnapshotsClientUpdateTagsResponse, error) { + result := ManagedClusterSnapshotsClientUpdateTagsResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.ManagedClusterSnapshot); err != nil { + return ManagedClusterSnapshotsClientUpdateTagsResponse{}, err + } + return result, nil +} diff --git a/sdk/resourcemanager/containerservice/armcontainerservice/managedclustersnapshots_client_example_test.go b/sdk/resourcemanager/containerservice/armcontainerservice/managedclustersnapshots_client_example_test.go new file mode 100644 index 000000000000..0fdf39098060 --- /dev/null +++ b/sdk/resourcemanager/containerservice/armcontainerservice/managedclustersnapshots_client_example_test.go @@ -0,0 +1,343 @@ +//go:build go1.18 +// +build go1.18 + +// 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. +// DO NOT EDIT. + +package armcontainerservice_test + +import ( + "context" + "log" + + "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" + "github.com/Azure/azure-sdk-for-go/sdk/azidentity" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/containerservice/armcontainerservice/v6" +) + +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c7b98b36e4023331545051284d8500adf98f02fe/specification/containerservice/resource-manager/Microsoft.ContainerService/aks/preview/2024-05-02-preview/examples/ManagedClusterSnapshotsList.json +func ExampleManagedClusterSnapshotsClient_NewListPager() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + clientFactory, err := armcontainerservice.NewClientFactory("", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + pager := clientFactory.NewManagedClusterSnapshotsClient().NewListPager(nil) + for pager.More() { + page, err := pager.NextPage(ctx) + if err != nil { + log.Fatalf("failed to advance page: %v", err) + } + for _, v := range page.Value { + // You could use page here. We use blank identifier for just demo purposes. + _ = v + } + // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. + // page.ManagedClusterSnapshotListResult = armcontainerservice.ManagedClusterSnapshotListResult{ + // Value: []*armcontainerservice.ManagedClusterSnapshot{ + // { + // Name: to.Ptr("snapshot1"), + // Type: to.Ptr("Microsoft.ContainerService/ManagedClusterSnapshots"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/rg1/providers/Microsoft.ContainerService/managedclustersnapshots/snapshot1"), + // SystemData: &armcontainerservice.SystemData{ + // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-08-09T20:13:23.298Z"); return t}()), + // CreatedBy: to.Ptr("user1"), + // CreatedByType: to.Ptr(armcontainerservice.CreatedByTypeUser), + // }, + // Location: to.Ptr("westus"), + // Tags: map[string]*string{ + // "key1": to.Ptr("val1"), + // "key2": to.Ptr("val2"), + // }, + // Properties: &armcontainerservice.ManagedClusterSnapshotProperties{ + // CreationData: &armcontainerservice.CreationData{ + // SourceResourceID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/rg1/providers/Microsoft.ContainerService/managedClusters/cluster1"), + // }, + // ManagedClusterPropertiesReadOnly: &armcontainerservice.ManagedClusterPropertiesForSnapshot{ + // EnableRbac: to.Ptr(true), + // KubernetesVersion: to.Ptr("1.20.5"), + // NetworkProfile: &armcontainerservice.NetworkProfileForSnapshot{ + // LoadBalancerSKU: to.Ptr(armcontainerservice.LoadBalancerSKUStandard), + // NetworkMode: to.Ptr(armcontainerservice.NetworkModeBridge), + // NetworkPlugin: to.Ptr(armcontainerservice.NetworkPluginKubenet), + // NetworkPolicy: to.Ptr(armcontainerservice.NetworkPolicyCalico), + // }, + // SKU: &armcontainerservice.ManagedClusterSKU{ + // Name: to.Ptr(armcontainerservice.ManagedClusterSKUName("Basic")), + // Tier: to.Ptr(armcontainerservice.ManagedClusterSKUTierFree), + // }, + // }, + // SnapshotType: to.Ptr(armcontainerservice.SnapshotTypeManagedCluster), + // }, + // }}, + // } + } +} + +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c7b98b36e4023331545051284d8500adf98f02fe/specification/containerservice/resource-manager/Microsoft.ContainerService/aks/preview/2024-05-02-preview/examples/ManagedClusterSnapshotsListByResourceGroup.json +func ExampleManagedClusterSnapshotsClient_NewListByResourceGroupPager() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + clientFactory, err := armcontainerservice.NewClientFactory("", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + pager := clientFactory.NewManagedClusterSnapshotsClient().NewListByResourceGroupPager("rg1", nil) + for pager.More() { + page, err := pager.NextPage(ctx) + if err != nil { + log.Fatalf("failed to advance page: %v", err) + } + for _, v := range page.Value { + // You could use page here. We use blank identifier for just demo purposes. + _ = v + } + // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. + // page.ManagedClusterSnapshotListResult = armcontainerservice.ManagedClusterSnapshotListResult{ + // Value: []*armcontainerservice.ManagedClusterSnapshot{ + // { + // Name: to.Ptr("snapshot1"), + // Type: to.Ptr("Microsoft.ContainerService/ManagedClusterSnapshots"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/rg1/providers/Microsoft.ContainerService/managedclustersnapshots/snapshot1"), + // SystemData: &armcontainerservice.SystemData{ + // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-08-09T20:13:23.298Z"); return t}()), + // CreatedBy: to.Ptr("user1"), + // CreatedByType: to.Ptr(armcontainerservice.CreatedByTypeUser), + // }, + // Location: to.Ptr("westus"), + // Tags: map[string]*string{ + // "key1": to.Ptr("val1"), + // "key2": to.Ptr("val2"), + // }, + // Properties: &armcontainerservice.ManagedClusterSnapshotProperties{ + // CreationData: &armcontainerservice.CreationData{ + // SourceResourceID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/rg1/providers/Microsoft.ContainerService/managedClusters/cluster1"), + // }, + // ManagedClusterPropertiesReadOnly: &armcontainerservice.ManagedClusterPropertiesForSnapshot{ + // EnableRbac: to.Ptr(true), + // KubernetesVersion: to.Ptr("1.20.5"), + // NetworkProfile: &armcontainerservice.NetworkProfileForSnapshot{ + // LoadBalancerSKU: to.Ptr(armcontainerservice.LoadBalancerSKUStandard), + // NetworkMode: to.Ptr(armcontainerservice.NetworkModeBridge), + // NetworkPlugin: to.Ptr(armcontainerservice.NetworkPluginKubenet), + // NetworkPolicy: to.Ptr(armcontainerservice.NetworkPolicyCalico), + // }, + // SKU: &armcontainerservice.ManagedClusterSKU{ + // Name: to.Ptr(armcontainerservice.ManagedClusterSKUName("Basic")), + // Tier: to.Ptr(armcontainerservice.ManagedClusterSKUTierFree), + // }, + // }, + // SnapshotType: to.Ptr(armcontainerservice.SnapshotTypeManagedCluster), + // }, + // }}, + // } + } +} + +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c7b98b36e4023331545051284d8500adf98f02fe/specification/containerservice/resource-manager/Microsoft.ContainerService/aks/preview/2024-05-02-preview/examples/ManagedClusterSnapshotsGet.json +func ExampleManagedClusterSnapshotsClient_Get() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + clientFactory, err := armcontainerservice.NewClientFactory("", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + res, err := clientFactory.NewManagedClusterSnapshotsClient().Get(ctx, "rg1", "snapshot1", nil) + if err != nil { + log.Fatalf("failed to finish the request: %v", err) + } + // You could use response here. We use blank identifier for just demo purposes. + _ = res + // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. + // res.ManagedClusterSnapshot = armcontainerservice.ManagedClusterSnapshot{ + // Name: to.Ptr("snapshot1"), + // Type: to.Ptr("Microsoft.ContainerService/ManagedClusterSnapshots"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/rg1/providers/Microsoft.ContainerService/managedclustersnapshots/snapshot1"), + // SystemData: &armcontainerservice.SystemData{ + // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-08-09T20:13:23.298Z"); return t}()), + // CreatedBy: to.Ptr("user1"), + // CreatedByType: to.Ptr(armcontainerservice.CreatedByTypeUser), + // }, + // Location: to.Ptr("westus"), + // Tags: map[string]*string{ + // "key1": to.Ptr("val1"), + // "key2": to.Ptr("val2"), + // }, + // Properties: &armcontainerservice.ManagedClusterSnapshotProperties{ + // CreationData: &armcontainerservice.CreationData{ + // SourceResourceID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/rg1/providers/Microsoft.ContainerService/managedClusters/cluster1"), + // }, + // ManagedClusterPropertiesReadOnly: &armcontainerservice.ManagedClusterPropertiesForSnapshot{ + // EnableRbac: to.Ptr(true), + // KubernetesVersion: to.Ptr("1.20.5"), + // NetworkProfile: &armcontainerservice.NetworkProfileForSnapshot{ + // LoadBalancerSKU: to.Ptr(armcontainerservice.LoadBalancerSKUStandard), + // NetworkMode: to.Ptr(armcontainerservice.NetworkModeBridge), + // NetworkPlugin: to.Ptr(armcontainerservice.NetworkPluginKubenet), + // NetworkPolicy: to.Ptr(armcontainerservice.NetworkPolicyCalico), + // }, + // SKU: &armcontainerservice.ManagedClusterSKU{ + // Name: to.Ptr(armcontainerservice.ManagedClusterSKUName("Basic")), + // Tier: to.Ptr(armcontainerservice.ManagedClusterSKUTierFree), + // }, + // }, + // SnapshotType: to.Ptr(armcontainerservice.SnapshotTypeManagedCluster), + // }, + // } +} + +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c7b98b36e4023331545051284d8500adf98f02fe/specification/containerservice/resource-manager/Microsoft.ContainerService/aks/preview/2024-05-02-preview/examples/ManagedClusterSnapshotsCreate.json +func ExampleManagedClusterSnapshotsClient_CreateOrUpdate() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + clientFactory, err := armcontainerservice.NewClientFactory("", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + res, err := clientFactory.NewManagedClusterSnapshotsClient().CreateOrUpdate(ctx, "rg1", "snapshot1", armcontainerservice.ManagedClusterSnapshot{ + Location: to.Ptr("westus"), + Tags: map[string]*string{ + "key1": to.Ptr("val1"), + "key2": to.Ptr("val2"), + }, + Properties: &armcontainerservice.ManagedClusterSnapshotProperties{ + CreationData: &armcontainerservice.CreationData{ + SourceResourceID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/rg1/providers/Microsoft.ContainerService/managedClusters/cluster1"), + }, + }, + }, nil) + if err != nil { + log.Fatalf("failed to finish the request: %v", err) + } + // You could use response here. We use blank identifier for just demo purposes. + _ = res + // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. + // res.ManagedClusterSnapshot = armcontainerservice.ManagedClusterSnapshot{ + // Name: to.Ptr("snapshot1"), + // Type: to.Ptr("Microsoft.ContainerService/ManagedClusterSnapshots"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/rg1/providers/Microsoft.ContainerService/managedclustersnapshots/snapshot1"), + // SystemData: &armcontainerservice.SystemData{ + // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-08-09T20:13:23.298Z"); return t}()), + // CreatedBy: to.Ptr("user1"), + // CreatedByType: to.Ptr(armcontainerservice.CreatedByTypeUser), + // }, + // Location: to.Ptr("westus"), + // Tags: map[string]*string{ + // "key1": to.Ptr("val1"), + // "key2": to.Ptr("val2"), + // }, + // Properties: &armcontainerservice.ManagedClusterSnapshotProperties{ + // CreationData: &armcontainerservice.CreationData{ + // SourceResourceID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/rg1/providers/Microsoft.ContainerService/managedClusters/cluster1"), + // }, + // ManagedClusterPropertiesReadOnly: &armcontainerservice.ManagedClusterPropertiesForSnapshot{ + // EnableRbac: to.Ptr(true), + // KubernetesVersion: to.Ptr("1.20.5"), + // NetworkProfile: &armcontainerservice.NetworkProfileForSnapshot{ + // LoadBalancerSKU: to.Ptr(armcontainerservice.LoadBalancerSKUStandard), + // NetworkMode: to.Ptr(armcontainerservice.NetworkModeBridge), + // NetworkPlugin: to.Ptr(armcontainerservice.NetworkPluginKubenet), + // NetworkPolicy: to.Ptr(armcontainerservice.NetworkPolicyCalico), + // }, + // SKU: &armcontainerservice.ManagedClusterSKU{ + // Name: to.Ptr(armcontainerservice.ManagedClusterSKUName("Basic")), + // Tier: to.Ptr(armcontainerservice.ManagedClusterSKUTierFree), + // }, + // }, + // SnapshotType: to.Ptr(armcontainerservice.SnapshotTypeManagedCluster), + // }, + // } +} + +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c7b98b36e4023331545051284d8500adf98f02fe/specification/containerservice/resource-manager/Microsoft.ContainerService/aks/preview/2024-05-02-preview/examples/ManagedClusterSnapshotsUpdateTags.json +func ExampleManagedClusterSnapshotsClient_UpdateTags() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + clientFactory, err := armcontainerservice.NewClientFactory("", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + res, err := clientFactory.NewManagedClusterSnapshotsClient().UpdateTags(ctx, "rg1", "snapshot1", armcontainerservice.TagsObject{ + Tags: map[string]*string{ + "key2": to.Ptr("new-val2"), + "key3": to.Ptr("val3"), + }, + }, nil) + if err != nil { + log.Fatalf("failed to finish the request: %v", err) + } + // You could use response here. We use blank identifier for just demo purposes. + _ = res + // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. + // res.ManagedClusterSnapshot = armcontainerservice.ManagedClusterSnapshot{ + // Name: to.Ptr("snapshot1"), + // Type: to.Ptr("Microsoft.ContainerService/ManagedClusterSnapshots"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/rg1/providers/Microsoft.ContainerService/managedclustersnapshots/snapshot1"), + // SystemData: &armcontainerservice.SystemData{ + // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-08-09T20:13:23.298Z"); return t}()), + // CreatedBy: to.Ptr("user1"), + // CreatedByType: to.Ptr(armcontainerservice.CreatedByTypeUser), + // }, + // Location: to.Ptr("westus"), + // Tags: map[string]*string{ + // "key1": to.Ptr("val1"), + // "key2": to.Ptr("val2"), + // }, + // Properties: &armcontainerservice.ManagedClusterSnapshotProperties{ + // CreationData: &armcontainerservice.CreationData{ + // SourceResourceID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/rg1/providers/Microsoft.ContainerService/managedClusters/cluster1"), + // }, + // ManagedClusterPropertiesReadOnly: &armcontainerservice.ManagedClusterPropertiesForSnapshot{ + // EnableRbac: to.Ptr(true), + // KubernetesVersion: to.Ptr("1.20.5"), + // NetworkProfile: &armcontainerservice.NetworkProfileForSnapshot{ + // LoadBalancerSKU: to.Ptr(armcontainerservice.LoadBalancerSKUStandard), + // NetworkMode: to.Ptr(armcontainerservice.NetworkModeBridge), + // NetworkPlugin: to.Ptr(armcontainerservice.NetworkPluginKubenet), + // NetworkPolicy: to.Ptr(armcontainerservice.NetworkPolicyCalico), + // }, + // SKU: &armcontainerservice.ManagedClusterSKU{ + // Name: to.Ptr(armcontainerservice.ManagedClusterSKUName("Basic")), + // Tier: to.Ptr(armcontainerservice.ManagedClusterSKUTierFree), + // }, + // }, + // SnapshotType: to.Ptr(armcontainerservice.SnapshotTypeManagedCluster), + // }, + // } +} + +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c7b98b36e4023331545051284d8500adf98f02fe/specification/containerservice/resource-manager/Microsoft.ContainerService/aks/preview/2024-05-02-preview/examples/ManagedClusterSnapshotsDelete.json +func ExampleManagedClusterSnapshotsClient_Delete() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + clientFactory, err := armcontainerservice.NewClientFactory("", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + _, err = clientFactory.NewManagedClusterSnapshotsClient().Delete(ctx, "rg1", "snapshot1", nil) + if err != nil { + log.Fatalf("failed to finish the request: %v", err) + } +} diff --git a/sdk/resourcemanager/containerservice/armcontainerservice/models.go b/sdk/resourcemanager/containerservice/armcontainerservice/models.go index 89a13f3b6f86..996e8819f675 100644 --- a/sdk/resourcemanager/containerservice/armcontainerservice/models.go +++ b/sdk/resourcemanager/containerservice/armcontainerservice/models.go @@ -25,6 +25,20 @@ type AccessProfile struct { KubeConfig []byte } +// AdvancedNetworking - Advanced Networking profile for enabling observability on a cluster. Note that enabling advanced networking +// features may incur additional costs. For more information see aka.ms/aksadvancednetworking. +type AdvancedNetworking struct { + // Observability profile to enable advanced network metrics and flow logs with historical contexts. + Observability *AdvancedNetworkingObservability +} + +// AdvancedNetworkingObservability - Observability profile to enable advanced network metrics and flow logs with historical +// contexts. +type AdvancedNetworkingObservability struct { + // Indicates the enablement of Advanced Networking observability functionalities on clusters. + Enabled *bool +} + // AgentPool - Agent Pool. type AgentPool struct { // Properties of an agent pool. @@ -40,6 +54,13 @@ type AgentPool struct { Type *string } +type AgentPoolArtifactStreamingProfile struct { + // Artifact streaming speeds up the cold-start of containers on a node through on-demand image loading. To use this feature, + // container images must also enable artifact streaming on ACR. If not specified, + // the default is false. + Enabled *bool +} + // AgentPoolAvailableVersions - The list of available versions for an agent pool. type AgentPoolAvailableVersions struct { // REQUIRED; Properties of agent pool available versions. @@ -72,6 +93,30 @@ type AgentPoolAvailableVersionsPropertiesAgentPoolVersionsItem struct { KubernetesVersion *string } +// AgentPoolDeleteMachinesParameter - Specifies a list of machine names from the agent pool to be deleted. +type AgentPoolDeleteMachinesParameter struct { + // REQUIRED; The agent pool machine names. + MachineNames []*string +} + +type AgentPoolGPUProfile struct { + // The default value is true when the vmSize of the agent pool contains a GPU, false otherwise. GPU Driver Installation can + // only be set true when VM has an associated GPU resource. Setting this field to + // false prevents automatic GPU driver installation. In that case, in order for the GPU to be usable, the user must perform + // GPU driver installation themselves. + InstallGPUDriver *bool +} + +// AgentPoolGatewayProfile - Profile of the managed cluster gateway agent pool. +type AgentPoolGatewayProfile struct { + // The Gateway agent pool associates one public IPPrefix for each static egress gateway to provide public egress. The size + // of Public IPPrefix should be selected by the user. Each node in the agent pool + // is assigned with one IP from the IPPrefix. The IPPrefix size thus serves as a cap on the size of the Gateway agent pool. + // Due to Azure public IPPrefix size limitation, the valid value range is [28, 31] + // (/31 = 2 nodes/IPs, /30 = 4 nodes/IPs, /29 = 8 nodes/IPs, /28 = 16 nodes/IPs). The default value is 31. + PublicIPPrefixSize *int32 +} + // AgentPoolListResult - The response from the List Agent Pools operation. type AgentPoolListResult struct { // The list of agent pools. @@ -93,6 +138,22 @@ type AgentPoolNetworkProfile struct { NodePublicIPTags []*IPTag } +// AgentPoolSecurityProfile - The security settings of an agent pool. +type AgentPoolSecurityProfile struct { + // Secure Boot is a feature of Trusted Launch which ensures that only signed operating systems and drivers can boot. For more + // details, see aka.ms/aks/trustedlaunch. If not specified, the default is + // false. + EnableSecureBoot *bool + + // vTPM is a Trusted Launch feature for configuring a dedicated secure vault for keys and measurements held locally on the + // node. For more details, see aka.ms/aks/trustedlaunch. If not specified, the + // default is false. + EnableVTPM *bool + + // SSH access method of an agent pool. + SSHAccess *AgentPoolSSHAccess +} + // AgentPoolUpgradeProfile - The list of available upgrades for an agent pool. type AgentPoolUpgradeProfile struct { // REQUIRED; The properties of the agent pool upgrade profile. @@ -116,6 +177,9 @@ type AgentPoolUpgradeProfileProperties struct { // REQUIRED; The operating system type. The default is Linux. OSType *OSType + // List of components grouped by kubernetes major.minor version. + ComponentsByReleases []*ComponentsByRelease + // The latest AKS supported node image version. LatestNodeImageVersion *string @@ -148,6 +212,11 @@ type AgentPoolUpgradeSettings struct { // The amount of time (in minutes) to wait after draining a node and before reimaging it and moving on to next node. If not // specified, the default is 0 minutes. NodeSoakDurationInMinutes *int32 + + // Defines the behavior for undrainable nodes during upgrade. The most common cause of undrainable nodes is Pod Disruption + // Budgets (PDBs), but other issues, such as pod termination grace period is + // exceeding the remaining per-node drain timeout or pod is still being in a running state, can also cause undrainable nodes. + UndrainableNodeBehavior *UndrainableNodeBehavior } // AgentPoolWindowsProfile - The Windows agent pool's specific profile. @@ -157,6 +226,20 @@ type AgentPoolWindowsProfile struct { DisableOutboundNat *bool } +// AutoScaleProfile - Specifications on auto-scaling. +type AutoScaleProfile struct { + // The maximum number of nodes of the specified sizes. + MaxCount *int32 + + // The minimum number of nodes of the specified sizes. + MinCount *int32 + + // The list of allowed vm sizes e.g. ['StandardE4sv3', 'StandardE16sv3', 'StandardD16sv5']. AKS will use the first available + // one when auto scaling. If a VM size is unavailable (e.g. due to quota or + // regional capacity reasons), AKS will use the next size. + Sizes []*string +} + // AzureKeyVaultKms - Azure Key Vault key management service settings for the security profile. type AzureKeyVaultKms struct { // Whether to enable Azure Key Vault key management service. The default is false. @@ -214,6 +297,28 @@ type CompatibleVersions struct { Versions []*string } +type Component struct { + // If upgraded component version contains breaking changes from the current version. To see a detailed description of what + // the breaking changes are, visit + // https://learn.microsoft.com/azure/aks/supported-kubernetes-versions?tabs=azure-cli#aks-components-breaking-changes-by-version. + HasBreakingChanges *bool + + // Component name. + Name *string + + // Component version. + Version *string +} + +// ComponentsByRelease - components of given Kubernetes version. +type ComponentsByRelease struct { + // components of current or upgraded Kubernetes version in the cluster. + Components []*Component + + // The Kubernetes version (major.minor). + KubernetesVersion *string +} + // CreationData - Data used when creating a target resource from a source resource. type CreationData struct { // This is the ARM ID of the source object to be used to create the target object. @@ -289,6 +394,33 @@ type EndpointDetail struct { Protocol *string } +// ErrorAdditionalInfo - The resource management error additional info. +type ErrorAdditionalInfo struct { + // READ-ONLY; The additional info. + Info any + + // READ-ONLY; The additional info type. + Type *string +} + +// ErrorDetail - The error detail. +type ErrorDetail struct { + // READ-ONLY; The error additional info. + AdditionalInfo []*ErrorAdditionalInfo + + // READ-ONLY; The error code. + Code *string + + // READ-ONLY; The error details. + Details []*ErrorDetail + + // READ-ONLY; The error message. + Message *string + + // READ-ONLY; The error target. + Target *string +} + // ExtendedLocation - The complex type of the extended location. type ExtendedLocation struct { // The name of the extended location. @@ -298,6 +430,42 @@ type ExtendedLocation struct { Type *ExtendedLocationTypes } +// GuardrailsAvailableVersion - Available Guardrails Version +type GuardrailsAvailableVersion struct { + // REQUIRED; Whether the version is default or not and support info. + Properties *GuardrailsAvailableVersionsProperties + + // READ-ONLY; Fully qualified resource ID for the resource. E.g. "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}" + ID *string + + // READ-ONLY; The name of the resource + Name *string + + // READ-ONLY; Azure Resource Manager metadata containing createdBy and modifiedBy information. + SystemData *SystemData + + // READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" + Type *string +} + +// GuardrailsAvailableVersionsList - Hold values properties, which is array of GuardrailsVersions +type GuardrailsAvailableVersionsList struct { + // Array of AKS supported Guardrails versions. + Value []*GuardrailsAvailableVersion + + // READ-ONLY; The URL to get the next Guardrails available version. + NextLink *string +} + +// GuardrailsAvailableVersionsProperties - Whether the version is default or not and support info. +type GuardrailsAvailableVersionsProperties struct { + // READ-ONLY + IsDefaultVersion *bool + + // READ-ONLY; Whether the version is preview or stable. + Support *GuardrailsSupport +} + // IPTag - Contains the IPTag associated with the object. type IPTag struct { // The IP tag type. Example: RoutingPreference. @@ -451,6 +619,32 @@ type KubernetesVersionListResult struct { Values []*KubernetesVersion } +// LabelSelector - A label selector is a label query over a set of resources. The result of matchLabels and matchExpressions +// are ANDed. An empty label selector matches all objects. A null label selector matches no +// objects. +type LabelSelector struct { + // matchExpressions is a list of label selector requirements. The requirements are ANDed. + MatchExpressions []*LabelSelectorRequirement + + // matchLabels is an array of {key=value} pairs. A single {key=value} in the matchLabels map is equivalent to an element of + // matchExpressions, whose key field is key, the operator is In, and the values + // array contains only value. The requirements are ANDed. + MatchLabels []*string +} + +// LabelSelectorRequirement - A label selector requirement is a selector that contains values, a key, and an operator that +// relates the key and values. +type LabelSelectorRequirement struct { + // key is the label key that the selector applies to. + Key *string + + // operator represents a key's relationship to a set of values. Valid operators are In and NotIn + Operator *Operator + + // values is an array of string values, the values array must be non-empty. + Values []*string +} + // LinuxOSConfig - See AKS custom node configuration [https://docs.microsoft.com/azure/aks/custom-node-configuration] for // more details. type LinuxOSConfig struct { @@ -479,6 +673,114 @@ type LinuxProfile struct { SSH *SSHConfiguration } +// LoadBalancer - The configurations regarding multiple standard load balancers. If not supplied, single load balancer mode +// will be used. Multiple standard load balancers mode will be used if at lease one configuration +// is supplied. There has to be a configuration named kubernetes. +type LoadBalancer struct { + // The properties of the load balancer. + Properties *LoadBalancerProperties + + // READ-ONLY; Fully qualified resource ID for the resource. E.g. "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}" + ID *string + + // READ-ONLY; The name of the resource + Name *string + + // READ-ONLY; Azure Resource Manager metadata containing createdBy and modifiedBy information. + SystemData *SystemData + + // READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" + Type *string +} + +// LoadBalancerListResult - The response from the List Load Balancers operation. +type LoadBalancerListResult struct { + // The list of Load Balancers. + Value []*LoadBalancer + + // READ-ONLY; The URL to get the next set of load balancer results. + NextLink *string +} + +type LoadBalancerProperties struct { + // REQUIRED; Name of the public load balancer. There will be an internal load balancer created if needed, and the name will + // be -internal. The internal lb shares the same configurations as the external one. + // The internal lbs are not needed to be included in LoadBalancer list. There must be a name of kubernetes in the list. + Name *string + + // REQUIRED; Required field. A string value that must specify the ID of an existing agent pool. All nodes in the given pool + // will always be added to this load balancer. This agent pool must have at least one node + // and minCount>=1 for autoscaling operations. An agent pool can only be the primary pool for a single load balancer. + PrimaryAgentPoolName *string + + // Whether to automatically place services on the load balancer. If not supplied, the default value is true. If set to false + // manually, both of the external and the internal load balancer will not be + // selected for services unless they explicitly target it. + AllowServicePlacement *bool + + // Nodes that match this selector will be possible members of this load balancer. + NodeSelector *LabelSelector + + // Only services that must match this selector can be placed on this load balancer. + ServiceLabelSelector *LabelSelector + + // Services created in namespaces that match the selector can be placed on this load balancer. + ServiceNamespaceSelector *LabelSelector + + // READ-ONLY; The current provisioning state. + ProvisioningState *string +} + +// Machine - A machine. Contains details about the underlying virtual machine. A machine may be visible here but not in kubectl +// get nodes; if so it may be because the machine has not been registered with the +// Kubernetes API Server yet. +type Machine struct { + // READ-ONLY; Resource ID. + ID *string + + // 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 + + // READ-ONLY; The properties of the machine + Properties *MachineProperties + + // READ-ONLY; Resource type + Type *string +} + +// MachineIPAddress - The machine IP address details. +type MachineIPAddress struct { + // READ-ONLY; To determine if address belongs IPv4 or IPv6 family. + Family *IPFamily + + // READ-ONLY; IPv4 or IPv6 address of the machine + IP *string +} + +// MachineListResult - The response from the List Machines operation. +type MachineListResult struct { + // The list of Machines in cluster. + Value []*Machine + + // READ-ONLY; The URL to get the next set of machine results. + NextLink *string +} + +// MachineNetworkProperties - network properties of the machine +type MachineNetworkProperties struct { + // READ-ONLY; IPv4, IPv6 addresses of the machine + IPAddresses []*MachineIPAddress +} + +// MachineProperties - The properties of the machine +type MachineProperties struct { + // READ-ONLY; network properties of the machine + Network *MachineNetworkProperties + + // READ-ONLY; Arm resource id of the machine. It can be used to GET underlying VM Instance + ResourceID *string +} + // MaintenanceConfiguration - See planned maintenance [https://docs.microsoft.com/azure/aks/planned-maintenance] for more // information about planned maintenance. type MaintenanceConfiguration struct { @@ -557,6 +859,9 @@ type ManagedCluster struct { // The identity of the managed cluster, if configured. Identity *ManagedClusterIdentity + // This is primarily used to expose different UI experiences in the portal for different kinds + Kind *string + // Properties of a managed cluster. Properties *ManagedClusterProperties @@ -566,6 +871,11 @@ type ManagedCluster struct { // Resource tags. Tags map[string]*string + // READ-ONLY; Unique read-only string used to implement optimistic concurrency. The eTag value will change when the resource + // is updated. Specify an if-match or if-none-match header with the eTag value for a + // subsequent request to enable optimistic concurrency per the normal etag convention. + ETag *string + // READ-ONLY; Fully qualified resource ID for the resource. E.g. "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}" ID *string @@ -603,6 +913,14 @@ type ManagedClusterAADProfile struct { TenantID *string } +// ManagedClusterAIToolchainOperatorProfile - When enabling the operator, a set of AKS managed CRDs and controllers will be +// installed in the cluster. The operator automates the deployment of OSS models for inference and/or training purposes. It +// provides a set of preset models and enables distributed inference against them. +type ManagedClusterAIToolchainOperatorProfile struct { + // Indicates if AI toolchain operator enabled or not. + Enabled *bool +} + // 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 @@ -619,9 +937,16 @@ type ManagedClusterAPIServerAccessProfile struct { // Whether to create additional public FQDN for private cluster or not. EnablePrivateClusterPublicFQDN *bool + // Whether to enable apiserver vnet integration for the cluster or not. + EnableVnetIntegration *bool + // 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 + + // It is required when: 1. creating a new cluster with BYO Vnet; 2. updating an existing cluster to enable apiserver vnet + // integration. + SubnetID *string } // ManagedClusterAccessProfile - Managed cluster Access Profile. @@ -677,6 +1002,9 @@ type ManagedClusterAgentPoolProfile struct { // REQUIRED; Windows agent pool names must be 6 characters or less. Name *string + // Configuration for using artifact streaming on AKS. + ArtifactStreamingProfile *AgentPoolArtifactStreamingProfile + // The list of Availability zones to use for nodes. This can only be specified if the AgentPoolType property is 'VirtualMachineScaleSets'. AvailabilityZones []*string @@ -694,6 +1022,11 @@ type ManagedClusterAgentPoolProfile struct { // Whether to enable auto-scaler EnableAutoScaling *bool + // When set to true, AKS adds a label to the node indicating that the feature is enabled and deploys a daemonset along with + // host services to sync custom certificate authorities from user-provided list of + // base64 encoded certificates into node trust stores. Defaults to false. + EnableCustomCATrust *bool + // 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 @@ -711,9 +1044,15 @@ type ManagedClusterAgentPoolProfile struct { // Whether to enable UltraSSD EnableUltraSSD *bool + // Profile specific to a managed agent pool in Gateway mode. This field cannot be set if agent pool mode is not Gateway. + GatewayProfile *AgentPoolGatewayProfile + // GPUInstanceProfile to be used to specify GPU MIG instance profile for supported GPU VM SKU. GpuInstanceProfile *GPUInstanceProfile + // The GPU settings of an agent pool. + GpuProfile *AgentPoolGPUProfile + // This is of the form: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/hostGroups/{hostGroupName}. // For more information see Azure dedicated hosts // [https://docs.microsoft.com/azure/virtual-machines/dedicated-hosts]. @@ -734,6 +1073,11 @@ type ManagedClusterAgentPoolProfile struct { // The maximum number of pods that can run on a node. MaxPods *int32 + // A base64-encoded string which will be written to /etc/motd after decoding. This allows customization of the message of + // the day for Linux nodes. It must not be specified for Windows nodes. It must be a + // static string (i.e., will be printed raw and not be executed as a script). + MessageOfTheDay *string + // The minimum number of nodes for auto-scaling MinCount *int32 @@ -744,6 +1088,13 @@ type ManagedClusterAgentPoolProfile struct { // Network-related settings of an agent pool. NetworkProfile *AgentPoolNetworkProfile + // These taints will not be reconciled by AKS and can be removed with a kubectl call. This field can be modified after node + // pool is created, but nodes will not be recreated with new taints until another + // operation that requires recreation (e.g. node image upgrade) happens. These taints allow for required configuration to + // run before the node is ready to accept workloads, for example + // 'key1=value1:NoSchedule' that then can be removed with kubectl taint nodes node1 key1=value1:NoSchedule- + NodeInitializationTaints []*string + // The node labels to be persisted across all nodes in agent pool. NodeLabels map[string]*string @@ -762,22 +1113,26 @@ type ManagedClusterAgentPoolProfile struct { // see Ephemeral OS [https://docs.microsoft.com/azure/aks/cluster-configuration#ephemeral-os]. OSDiskType *OSDiskType - // Specifies the OS SKU used by the agent pool. The default is Ubuntu if OSType is Linux. The default is Windows2019 when - // Kubernetes = 1.25 if OSType is Windows. + // Specifies the OS SKU used by the agent pool. If not specified, the default is Ubuntu if OSType=Linux or Windows2019 if + // OSType=Windows. And the default Windows OSSKU will be changed to Windows2022 + // after Windows2019 is deprecated. OSSKU *OSSKU // The operating system type. The default is Linux. OSType *OSType - // Both patch version (e.g. 1.20.13) and (e.g. 1.20) are supported. When is specified, the latest supported GA patch version - // is chosen automatically. Updating the cluster with the same once it has been - // created (e.g. 1.14.x -> 1.14) will not trigger an upgrade, even if a newer patch version is available. 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]. + // Both patch version and are supported. When is specified, the latest supported patch version is chosen automatically. Updating + // the agent pool with the same once it has been created will not trigger an + // upgrade, even if a newer patch version is available. 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 + // The IP allocation mode for pods in the agent pool. Must be used with podSubnetId. The default is 'DynamicIndividual'. + PodIPAllocationMode *PodIPAllocationMode + // 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 @@ -799,6 +1154,9 @@ type ManagedClusterAgentPoolProfile struct { // The Virtual Machine Scale Set priority. If not specified, the default is 'Regular'. ScaleSetPriority *ScaleSetPriority + // The security settings of an agent pool. + SecurityProfile *AgentPoolSecurityProfile + // 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] @@ -818,6 +1176,12 @@ type ManagedClusterAgentPoolProfile struct { // https://docs.microsoft.com/azure/aks/quotas-skus-regions VMSize *string + // The status of nodes in a VirtualMachines agent pool. + VirtualMachineNodesStatus []*VirtualMachineNodes + + // Specifications on VirtualMachines agent pool. + VirtualMachinesProfile *VirtualMachinesProfile + // 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} @@ -829,10 +1193,15 @@ type ManagedClusterAgentPoolProfile struct { // Determines the type of workload a node can run. WorkloadRuntime *WorkloadRuntime - // READ-ONLY; If orchestratorVersion is a fully specified version , this field will be exactly equal to it. If orchestratorVersion - // is , this field will contain the full version being used. + // READ-ONLY; If orchestratorVersion was a fully specified version , this field will be exactly equal to it. If orchestratorVersion + // was , this field will contain the full version being used. CurrentOrchestratorVersion *string + // READ-ONLY; Unique read-only string used to implement optimistic concurrency. The eTag value will change when the resource + // is updated. Specify an if-match or if-none-match header with the eTag value for a + // subsequent request to enable optimistic concurrency per the normal etag convention. + ETag *string + // READ-ONLY; The version of node image NodeImageVersion *string @@ -842,6 +1211,9 @@ type ManagedClusterAgentPoolProfile struct { // ManagedClusterAgentPoolProfileProperties - Properties for the container service agent pool profile. type ManagedClusterAgentPoolProfileProperties struct { + // Configuration for using artifact streaming on AKS. + ArtifactStreamingProfile *AgentPoolArtifactStreamingProfile + // The list of Availability zones to use for nodes. This can only be specified if the AgentPoolType property is 'VirtualMachineScaleSets'. AvailabilityZones []*string @@ -859,6 +1231,11 @@ type ManagedClusterAgentPoolProfileProperties struct { // Whether to enable auto-scaler EnableAutoScaling *bool + // When set to true, AKS adds a label to the node indicating that the feature is enabled and deploys a daemonset along with + // host services to sync custom certificate authorities from user-provided list of + // base64 encoded certificates into node trust stores. Defaults to false. + EnableCustomCATrust *bool + // 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 @@ -876,9 +1253,15 @@ type ManagedClusterAgentPoolProfileProperties struct { // Whether to enable UltraSSD EnableUltraSSD *bool + // Profile specific to a managed agent pool in Gateway mode. This field cannot be set if agent pool mode is not Gateway. + GatewayProfile *AgentPoolGatewayProfile + // GPUInstanceProfile to be used to specify GPU MIG instance profile for supported GPU VM SKU. GpuInstanceProfile *GPUInstanceProfile + // The GPU settings of an agent pool. + GpuProfile *AgentPoolGPUProfile + // This is of the form: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/hostGroups/{hostGroupName}. // For more information see Azure dedicated hosts // [https://docs.microsoft.com/azure/virtual-machines/dedicated-hosts]. @@ -899,6 +1282,11 @@ type ManagedClusterAgentPoolProfileProperties struct { // The maximum number of pods that can run on a node. MaxPods *int32 + // A base64-encoded string which will be written to /etc/motd after decoding. This allows customization of the message of + // the day for Linux nodes. It must not be specified for Windows nodes. It must be a + // static string (i.e., will be printed raw and not be executed as a script). + MessageOfTheDay *string + // The minimum number of nodes for auto-scaling MinCount *int32 @@ -909,6 +1297,13 @@ type ManagedClusterAgentPoolProfileProperties struct { // Network-related settings of an agent pool. NetworkProfile *AgentPoolNetworkProfile + // These taints will not be reconciled by AKS and can be removed with a kubectl call. This field can be modified after node + // pool is created, but nodes will not be recreated with new taints until another + // operation that requires recreation (e.g. node image upgrade) happens. These taints allow for required configuration to + // run before the node is ready to accept workloads, for example + // 'key1=value1:NoSchedule' that then can be removed with kubectl taint nodes node1 key1=value1:NoSchedule- + NodeInitializationTaints []*string + // The node labels to be persisted across all nodes in agent pool. NodeLabels map[string]*string @@ -927,22 +1322,26 @@ type ManagedClusterAgentPoolProfileProperties struct { // see Ephemeral OS [https://docs.microsoft.com/azure/aks/cluster-configuration#ephemeral-os]. OSDiskType *OSDiskType - // Specifies the OS SKU used by the agent pool. The default is Ubuntu if OSType is Linux. The default is Windows2019 when - // Kubernetes = 1.25 if OSType is Windows. + // Specifies the OS SKU used by the agent pool. If not specified, the default is Ubuntu if OSType=Linux or Windows2019 if + // OSType=Windows. And the default Windows OSSKU will be changed to Windows2022 + // after Windows2019 is deprecated. OSSKU *OSSKU // The operating system type. The default is Linux. OSType *OSType - // Both patch version (e.g. 1.20.13) and (e.g. 1.20) are supported. When is specified, the latest supported GA patch version - // is chosen automatically. Updating the cluster with the same once it has been - // created (e.g. 1.14.x -> 1.14) will not trigger an upgrade, even if a newer patch version is available. 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]. + // Both patch version and are supported. When is specified, the latest supported patch version is chosen automatically. Updating + // the agent pool with the same once it has been created will not trigger an + // upgrade, even if a newer patch version is available. 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 + // The IP allocation mode for pods in the agent pool. Must be used with podSubnetId. The default is 'DynamicIndividual'. + PodIPAllocationMode *PodIPAllocationMode + // 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 @@ -964,6 +1363,9 @@ type ManagedClusterAgentPoolProfileProperties struct { // The Virtual Machine Scale Set priority. If not specified, the default is 'Regular'. ScaleSetPriority *ScaleSetPriority + // The security settings of an agent pool. + SecurityProfile *AgentPoolSecurityProfile + // 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] @@ -983,6 +1385,12 @@ type ManagedClusterAgentPoolProfileProperties struct { // https://docs.microsoft.com/azure/aks/quotas-skus-regions VMSize *string + // The status of nodes in a VirtualMachines agent pool. + VirtualMachineNodesStatus []*VirtualMachineNodes + + // Specifications on VirtualMachines agent pool. + VirtualMachinesProfile *VirtualMachinesProfile + // 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} @@ -994,10 +1402,15 @@ type ManagedClusterAgentPoolProfileProperties struct { // Determines the type of workload a node can run. WorkloadRuntime *WorkloadRuntime - // READ-ONLY; If orchestratorVersion is a fully specified version , this field will be exactly equal to it. If orchestratorVersion - // is , this field will contain the full version being used. + // READ-ONLY; If orchestratorVersion was a fully specified version , this field will be exactly equal to it. If orchestratorVersion + // was , this field will contain the full version being used. CurrentOrchestratorVersion *string + // READ-ONLY; Unique read-only string used to implement optimistic concurrency. The eTag value will change when the resource + // is updated. Specify an if-match or if-none-match header with the eTag value for a + // subsequent request to enable optimistic concurrency per the normal etag convention. + ETag *string + // READ-ONLY; The version of node image NodeImageVersion *string @@ -1007,50 +1420,132 @@ type ManagedClusterAgentPoolProfileProperties struct { // ManagedClusterAutoUpgradeProfile - Auto upgrade profile for a managed cluster. type ManagedClusterAutoUpgradeProfile struct { - // Manner in which the OS on your nodes is updated. The default is NodeImage. + // The default is Unmanaged, but may change to either NodeImage or SecurityPatch at GA. NodeOSUpgradeChannel *NodeOSUpgradeChannel // 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 } -// ManagedClusterAzureMonitorProfile - Azure Monitor addon profiles for monitoring the managed cluster. +// ManagedClusterAzureMonitorProfile - Prometheus addon profile for the container service cluster type ManagedClusterAzureMonitorProfile struct { - // Metrics profile for the Azure Monitor managed service for Prometheus addon. Collect out-of-the-box Kubernetes infrastructure - // metrics to send to an Azure Monitor Workspace and configure additional - // scraping for custom targets. See aka.ms/AzureManagedPrometheus for an overview. + // Application Monitoring Profile for Kubernetes Application Container. Collects application logs, metrics and traces through + // auto-instrumentation of the application using Azure Monitor OpenTelemetry + // based SDKs. See aka.ms/AzureMonitorApplicationMonitoring for an overview. + AppMonitoring *ManagedClusterAzureMonitorProfileAppMonitoring + + // Azure Monitor Container Insights Profile for Kubernetes Events, Inventory and Container stdout & stderr logs etc. See aka.ms/AzureMonitorContainerInsights + // for an overview. + ContainerInsights *ManagedClusterAzureMonitorProfileContainerInsights + + // Metrics profile for the prometheus service addon Metrics *ManagedClusterAzureMonitorProfileMetrics } -// ManagedClusterAzureMonitorProfileKubeStateMetrics - Kube State Metrics profile for the Azure Managed Prometheus addon. -// These optional settings are for the kube-state-metrics pod that is deployed with the addon. See -// aka.ms/AzureManagedPrometheus-optional-parameters for details. +// ManagedClusterAzureMonitorProfileAppMonitoring - Application Monitoring Profile for Kubernetes Application Container. Collects +// application logs, metrics and traces through auto-instrumentation of the application using Azure Monitor OpenTelemetry +// based SDKs. See aka.ms/AzureMonitorApplicationMonitoring for an overview. +type ManagedClusterAzureMonitorProfileAppMonitoring struct { + // Application Monitoring Auto Instrumentation for Kubernetes Application Container. Deploys web hook to auto-instrument Azure + // Monitor OpenTelemetry based SDKs to collect OpenTelemetry metrics, logs and + // traces of the application. See aka.ms/AzureMonitorApplicationMonitoring for an overview. + AutoInstrumentation *ManagedClusterAzureMonitorProfileAppMonitoringAutoInstrumentation + + // Application Monitoring Open Telemetry Metrics Profile for Kubernetes Application Container Logs and Traces. Collects OpenTelemetry + // logs and traces of the application using Azure Monitor OpenTelemetry + // based SDKs. See aka.ms/AzureMonitorApplicationMonitoring for an overview. + OpenTelemetryLogs *ManagedClusterAzureMonitorProfileAppMonitoringOpenTelemetryLogs + + // Application Monitoring Open Telemetry Metrics Profile for Kubernetes Application Container Metrics. Collects OpenTelemetry + // metrics of the application using Azure Monitor OpenTelemetry based SDKs. See + // aka.ms/AzureMonitorApplicationMonitoring for an overview. + OpenTelemetryMetrics *ManagedClusterAzureMonitorProfileAppMonitoringOpenTelemetryMetrics +} + +// ManagedClusterAzureMonitorProfileAppMonitoringAutoInstrumentation - Application Monitoring Auto Instrumentation for Kubernetes +// Application Container. Deploys web hook to auto-instrument Azure Monitor OpenTelemetry based SDKs to collect OpenTelemetry +// metrics, logs and +// traces of the application. See aka.ms/AzureMonitorApplicationMonitoring for an overview. +type ManagedClusterAzureMonitorProfileAppMonitoringAutoInstrumentation struct { + // Indicates if Application Monitoring Auto Instrumentation is enabled or not. + Enabled *bool +} + +// ManagedClusterAzureMonitorProfileAppMonitoringOpenTelemetryLogs - Application Monitoring Open Telemetry Metrics Profile +// for Kubernetes Application Container Logs and Traces. Collects OpenTelemetry logs and traces of the application using Azure +// Monitor OpenTelemetry +// based SDKs. See aka.ms/AzureMonitorApplicationMonitoring for an overview. +type ManagedClusterAzureMonitorProfileAppMonitoringOpenTelemetryLogs struct { + // Indicates if Application Monitoring Open Telemetry Logs and traces is enabled or not. + Enabled *bool + + // The Open Telemetry host port for Open Telemetry logs and traces. If not specified, the default port is 28331. + Port *int64 +} + +// ManagedClusterAzureMonitorProfileAppMonitoringOpenTelemetryMetrics - Application Monitoring Open Telemetry Metrics Profile +// for Kubernetes Application Container Metrics. Collects OpenTelemetry metrics of the application using Azure Monitor OpenTelemetry +// based SDKs. See +// aka.ms/AzureMonitorApplicationMonitoring for an overview. +type ManagedClusterAzureMonitorProfileAppMonitoringOpenTelemetryMetrics struct { + // Indicates if Application Monitoring Open Telemetry Metrics is enabled or not. + Enabled *bool + + // The Open Telemetry host port for Open Telemetry metrics. If not specified, the default port is 28333. + Port *int64 +} + +// ManagedClusterAzureMonitorProfileContainerInsights - Azure Monitor Container Insights Profile for Kubernetes Events, Inventory +// and Container stdout & stderr logs etc. See aka.ms/AzureMonitorContainerInsights for an overview. +type ManagedClusterAzureMonitorProfileContainerInsights struct { + // Indicates whether custom metrics collection has to be disabled or not. If not specified the default is false. No custom + // metrics will be emitted if this field is false but the container insights + // enabled field is false + DisableCustomMetrics *bool + + // Indicates whether prometheus metrics scraping is disabled or not. If not specified the default is false. No prometheus + // metrics will be emitted if this field is false but the container insights enabled + // field is false + DisablePrometheusMetricsScraping *bool + + // Indicates if Azure Monitor Container Insights Logs Addon is enabled or not. + Enabled *bool + + // Fully Qualified ARM Resource Id of Azure Log Analytics Workspace for storing Azure Monitor Container Insights Logs. + LogAnalyticsWorkspaceResourceID *string + + // The syslog host port. If not specified, the default port is 28330. + SyslogPort *int64 +} + +// ManagedClusterAzureMonitorProfileKubeStateMetrics - Kube State Metrics for prometheus addon profile for the container service +// cluster type ManagedClusterAzureMonitorProfileKubeStateMetrics struct { - // Comma-separated list of Kubernetes annotation keys that will be used in the resource's labels metric (Example: 'namespaces=[kubernetes.io/team,…],pods=[kubernetes.io/team],…'). - // By default the metric - // contains only resource name and namespace labels. + // Comma-separated list of additional Kubernetes label keys that will be used in the resource's labels metric. MetricAnnotationsAllowList *string - // Comma-separated list of additional Kubernetes label keys that will be used in the resource's labels metric (Example: 'namespaces=[k8s-label-1,k8s-label-n,…],pods=[app],…'). - // By default the metric - // contains only resource name and namespace labels. + // Comma-separated list of Kubernetes annotations keys that will be used in the resource's labels metric. MetricLabelsAllowlist *string } -// ManagedClusterAzureMonitorProfileMetrics - Metrics profile for the Azure Monitor managed service for Prometheus addon. -// Collect out-of-the-box Kubernetes infrastructure metrics to send to an Azure Monitor Workspace and configure additional -// scraping for custom targets. See aka.ms/AzureManagedPrometheus for an overview. +// ManagedClusterAzureMonitorProfileMetrics - Metrics profile for the prometheus service addon type ManagedClusterAzureMonitorProfileMetrics struct { - // REQUIRED; Whether to enable or disable the Azure Managed Prometheus addon for Prometheus monitoring. See aka.ms/AzureManagedPrometheus-aks-enable - // for details on enabling and disabling. + // REQUIRED; Whether to enable the Prometheus collector Enabled *bool - // Kube State Metrics profile for the Azure Managed Prometheus addon. These optional settings are for the kube-state-metrics - // pod that is deployed with the addon. See - // aka.ms/AzureManagedPrometheus-optional-parameters for details. + // Kube State Metrics for prometheus addon profile for the container service cluster KubeStateMetrics *ManagedClusterAzureMonitorProfileKubeStateMetrics } +// ManagedClusterBootstrapProfile - The bootstrap profile. +type ManagedClusterBootstrapProfile struct { + // The source where the artifacts are downloaded from. + ArtifactSource *ArtifactSource + + // The resource Id of Azure Container Registry. The registry must have private network access, premium SKU and zone redundancy. + ContainerRegistryID *string +} + // ManagedClusterCostAnalysis - The cost analysis configuration for the cluster type ManagedClusterCostAnalysis struct { // The Managed Cluster sku.tier must be set to 'Standard' or 'Premium' to enable this feature. Enabling this will add Kubernetes @@ -1072,6 +1567,10 @@ type ManagedClusterHTTPProxyConfig struct { // Alternative CA cert to use for connecting to proxy servers. TrustedCa *string + + // READ-ONLY; A read-only list of all endpoints for which traffic should not be sent to the proxy. This list is a superset + // of noProxy and values injected by AKS. + EffectiveNoProxy []*string } // ManagedClusterIdentity - Identity for the managed cluster. @@ -1096,25 +1595,23 @@ type ManagedClusterIdentity struct { // ManagedClusterIngressProfile - Ingress profile for the container service cluster. type ManagedClusterIngressProfile struct { - // App Routing settings for the ingress profile. You can find an overview and onboarding guide for this feature at - // https://learn.microsoft.com/en-us/azure/aks/app-routing?tabs=default%2Cdeploy-app-default. + // Web App Routing settings for the ingress profile. WebAppRouting *ManagedClusterIngressProfileWebAppRouting } -// ManagedClusterIngressProfileWebAppRouting - Application Routing add-on settings for the ingress profile. +// ManagedClusterIngressProfileWebAppRouting - Web App Routing settings for the ingress profile. type ManagedClusterIngressProfileWebAppRouting struct { - // Resource IDs of the DNS zones to be associated with the Application Routing add-on. Used only when Application Routing - // add-on is enabled. Public and private DNS zones can be in different resource - // groups, but all public DNS zones must be in the same resource group and all private DNS zones must be in the same resource - // group. + // Resource IDs of the DNS zones to be associated with the Web App Routing add-on. Used only when Web App Routing is enabled. + // Public and private DNS zones can be in different resource groups, but all + // public DNS zones must be in the same resource group and all private DNS zones must be in the same resource group. DNSZoneResourceIDs []*string - // Whether to enable the Application Routing add-on. + // Whether to enable Web App Routing. Enabled *bool - // READ-ONLY; Managed identity of the Application Routing add-on. This is the identity that should be granted permissions, - // for example, to manage the associated Azure DNS resource and get certificates from Azure - // Key Vault. See this overview of the add-on [https://learn.microsoft.com/en-us/azure/aks/web-app-routing?tabs=with-osm] + // READ-ONLY; Managed identity of the Web Application Routing add-on. This is the identity that should be granted permissions, + // for example, to manage the associated Azure DNS resource and get certificates from + // Azure Key Vault. See this overview of the add-on [https://learn.microsoft.com/en-us/azure/aks/web-app-routing?tabs=with-osm] // for more instructions. Identity *UserAssignedIdentity } @@ -1137,6 +1634,9 @@ type ManagedClusterLoadBalancerProfile struct { // The type of the managed inbound Load Balancer BackendPool. BackendPoolType *BackendPoolType + // The health probing behavior for External Traffic Policy Cluster services. + ClusterServiceLoadBalancerHealthProbeMode *ClusterServiceLoadBalancerHealthProbeMode + // The effective outbound IP resources of the cluster load balancer. EffectiveOutboundIPs []*ResourceReference @@ -1207,6 +1707,17 @@ type ManagedClusterNATGatewayProfile struct { ManagedOutboundIPProfile *ManagedClusterManagedOutboundIPProfile } +type ManagedClusterNodeProvisioningProfile struct { + // Once the mode it set to Auto, it cannot be changed back to Manual. + Mode *NodeProvisioningMode +} + +// ManagedClusterNodeResourceGroupProfile - Node resource group lockdown profile for a managed cluster. +type ManagedClusterNodeResourceGroupProfile struct { + // The restriction level applied to the cluster's node resource group + RestrictionLevel *RestrictionLevel +} + // ManagedClusterOIDCIssuerProfile - The OIDC issuer profile of the Managed Cluster. type ManagedClusterOIDCIssuerProfile struct { // Whether the OIDC issuer is enabled. @@ -1303,6 +1814,9 @@ type ManagedClusterPoolUpgradeProfile struct { // REQUIRED; The operating system type. The default is Linux. OSType *OSType + // List of components grouped by kubernetes major.minor version. + ComponentsByReleases []*ComponentsByRelease + // The Agent Pool name. Name *string @@ -1332,15 +1846,24 @@ type ManagedClusterProperties struct { // The agent pool properties. AgentPoolProfiles []*ManagedClusterAgentPoolProfile + // AI toolchain operator settings that apply to the whole cluster. + AiToolchainOperatorProfile *ManagedClusterAIToolchainOperatorProfile + // Parameters to be applied to the cluster-autoscaler when enabled AutoScalerProfile *ManagedClusterPropertiesAutoScalerProfile // The auto upgrade configuration. AutoUpgradeProfile *ManagedClusterAutoUpgradeProfile - // Azure Monitor addon profiles for monitoring the managed cluster. + // Prometheus addon profile for the container service cluster AzureMonitorProfile *ManagedClusterAzureMonitorProfile + // Profile of the cluster bootstrap configuration. + BootstrapProfile *ManagedClusterBootstrapProfile + + // CreationData to be used to specify the source Snapshot ID if the cluster will be created/upgraded using a snapshot. + CreationData *CreationData + // This cannot be updated once the Managed Cluster has been created. DNSPrefix *string @@ -1352,6 +1875,11 @@ type ManagedClusterProperties struct { // This is of the form: '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/diskEncryptionSets/{encryptionSetName}' DiskEncryptionSetID *string + // The default value is false. It can be enabled/disabled on creation and updating of the managed cluster. See https://aka.ms/NamespaceARMResource + // [https://aka.ms/NamespaceARMResource] for more details + // on Namespace as a ARM Resource. + EnableNamespaceResources *bool + // (DEPRECATED) Whether to enable Kubernetes pod security policy (preview). PodSecurityPolicy was deprecated in Kubernetes // v1.21, and removed from Kubernetes in v1.25. Learn more at // https://aka.ms/k8s/psp and https://aka.ms/aks/psp. @@ -1372,13 +1900,10 @@ type ManagedClusterProperties struct { // Ingress profile for the managed cluster. IngressProfile *ManagedClusterIngressProfile - // Both patch version (e.g. 1.20.13) and (e.g. 1.20) are supported. When is specified, the latest supported GA patch version - // is chosen automatically. Updating the cluster with the same once it has been - // created (e.g. 1.14.x -> 1.14) will not trigger an upgrade, even if a newer patch version is available. 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. + // 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 // The profile for Linux VMs in the Managed Cluster. @@ -1390,9 +1915,15 @@ type ManagedClusterProperties struct { // The network configuration profile. NetworkProfile *NetworkProfile + // Node provisioning settings that apply to the whole cluster. + NodeProvisioningProfile *ManagedClusterNodeProvisioningProfile + // The name of the resource group containing agent pool nodes. NodeResourceGroup *string + // The node resource group configuration profile. + NodeResourceGroupProfile *ManagedClusterNodeResourceGroupProfile + // The OIDC issuer profile of the Managed Cluster. OidcIssuerProfile *ManagedClusterOIDCIssuerProfile @@ -1406,6 +1937,9 @@ type ManagedClusterProperties struct { // Allow or deny public network access for AKS PublicNetworkAccess *PublicNetworkAccess + // The Safeguards profile holds all the safeguards information for a given cluster + SafeguardsProfile *SafeguardsProfile + // Security profile for the managed cluster. SecurityProfile *ManagedClusterSecurityProfile @@ -1435,8 +1969,7 @@ type ManagedClusterProperties struct { // allowing the Azure Portal to function properly. AzurePortalFQDN *string - // READ-ONLY; If kubernetesVersion was a fully specified version , this field will be exactly equal to it. If kubernetesVersion - // was , this field will contain the full version being used. + // READ-ONLY; The version of Kubernetes the Managed Cluster is running. CurrentKubernetesVersion *string // READ-ONLY; The FQDN of the master pool. @@ -1474,8 +2007,7 @@ type ManagedClusterPropertiesAutoScalerProfile struct { // node will be deleted without ensuring that daemonset pods are deleted or evicted. DaemonsetEvictionForOccupiedNodes *bool - // 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. + // Available values are: 'least-waste', 'most-pods', 'priority', 'random'. Expander *Expander // If set to true, the resources used by daemonset will be taken into account when making scaling down decisions. @@ -1531,6 +2063,21 @@ type ManagedClusterPropertiesAutoScalerProfile struct { SkipNodesWithSystemPods *string } +// ManagedClusterPropertiesForSnapshot - managed cluster properties for snapshot, these properties are read only. +type ManagedClusterPropertiesForSnapshot struct { + // Whether the cluster has enabled Kubernetes Role-Based Access Control or not. + EnableRbac *bool + + // The current kubernetes version. + KubernetesVersion *string + + // The current managed cluster sku. + SKU *ManagedClusterSKU + + // READ-ONLY; The current network profile. + NetworkProfile *NetworkProfileForSnapshot +} + // ManagedClusterSKU - The SKU of a Managed Cluster. type ManagedClusterSKU struct { // The name of a managed cluster SKU. @@ -1547,12 +2094,26 @@ type ManagedClusterSecurityProfile struct { // the security profile. AzureKeyVaultKms *AzureKeyVaultKms + // A list of up to 10 base64 encoded CAs that will be added to the trust store on nodes with the Custom CA Trust feature enabled. + // For more information see Custom CA Trust Certificates + // [https://learn.microsoft.com/en-us/azure/aks/custom-certificate-authority] + CustomCATrustCertificates [][]byte + // Microsoft Defender settings for the security profile. Defender *ManagedClusterSecurityProfileDefender // Image Cleaner settings for the security profile. ImageCleaner *ManagedClusterSecurityProfileImageCleaner + // Image integrity is a feature that works with Azure Policy to verify image integrity by signature. This will not have any + // effect unless Azure Policy is applied to enforce image signatures. See + // https://aka.ms/aks/image-integrity for how to use this feature via policy. + ImageIntegrity *ManagedClusterSecurityProfileImageIntegrity + + // Node Restriction [https://kubernetes.io/docs/reference/access-authn-authz/admission-controllers/#noderestriction] settings + // for the security profile. + NodeRestriction *ManagedClusterSecurityProfileNodeRestriction + // Workload identity settings for the security profile. Workload identity enables Kubernetes applications to access Azure // cloud resources securely with Azure AD. See https://aka.ms/aks/wi for more // details. @@ -1586,6 +2147,18 @@ type ManagedClusterSecurityProfileImageCleaner struct { IntervalHours *int32 } +// ManagedClusterSecurityProfileImageIntegrity - Image integrity related settings for the security profile. +type ManagedClusterSecurityProfileImageIntegrity struct { + // Whether to enable image integrity. The default value is false. + Enabled *bool +} + +// ManagedClusterSecurityProfileNodeRestriction - Node Restriction settings for the security profile. +type ManagedClusterSecurityProfileNodeRestriction struct { + // Whether to enable Node Restriction + Enabled *bool +} + // ManagedClusterSecurityProfileWorkloadIdentity - Workload identity settings for the security profile. type ManagedClusterSecurityProfileWorkloadIdentity struct { // Whether to enable workload identity. @@ -1602,6 +2175,57 @@ type ManagedClusterServicePrincipalProfile struct { Secret *string } +// ManagedClusterSnapshot - A managed cluster snapshot resource. +type ManagedClusterSnapshot struct { + // REQUIRED; The geo-location where the resource lives + Location *string + + // Properties of a managed cluster snapshot. + Properties *ManagedClusterSnapshotProperties + + // Resource tags. + Tags map[string]*string + + // READ-ONLY; Fully qualified resource ID for the resource. E.g. "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}" + ID *string + + // READ-ONLY; The name of the resource + Name *string + + // READ-ONLY; Azure Resource Manager metadata containing createdBy and modifiedBy information. + SystemData *SystemData + + // READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" + Type *string +} + +// ManagedClusterSnapshotListResult - The response from the List Managed Cluster Snapshots operation. +type ManagedClusterSnapshotListResult struct { + // The list of managed cluster snapshots. + Value []*ManagedClusterSnapshot + + // READ-ONLY; The URL to get the next set of managed cluster snapshot results. + NextLink *string +} + +// ManagedClusterSnapshotProperties - Properties for a managed cluster snapshot. +type ManagedClusterSnapshotProperties struct { + // CreationData to be used to specify the source resource ID to create this snapshot. + CreationData *CreationData + + // The type of a snapshot. The default is NodePool. + SnapshotType *SnapshotType + + // READ-ONLY; What the properties will be showed when getting managed cluster snapshot. Those properties are read-only. + ManagedClusterPropertiesReadOnly *ManagedClusterPropertiesForSnapshot +} + +// ManagedClusterStaticEgressGatewayProfile - The Static Egress Gateway addon configuration for the cluster. +type ManagedClusterStaticEgressGatewayProfile struct { + // Indicates if Static Egress Gateway addon is enabled or not. + Enabled *bool +} + // ManagedClusterStorageProfile - Storage profile for the container service cluster. type ManagedClusterStorageProfile struct { // AzureBlob CSI Driver settings for the storage profile. @@ -1627,6 +2251,9 @@ type ManagedClusterStorageProfileBlobCSIDriver struct { type ManagedClusterStorageProfileDiskCSIDriver struct { // Whether to enable AzureDisk CSI Driver. The default value is true. Enabled *bool + + // The version of AzureDisk CSI Driver. The default value is v1. + Version *string } // ManagedClusterStorageProfileFileCSIDriver - AzureFile CSI Driver settings for the storage profile. @@ -1702,9 +2329,7 @@ type ManagedClusterWindowsProfile struct { // ManagedClusterWorkloadAutoScalerProfile - Workload Auto-scaler profile for the managed cluster. type ManagedClusterWorkloadAutoScalerProfile struct { // KEDA (Kubernetes Event-driven Autoscaling) settings for the workload auto-scaler profile. - Keda *ManagedClusterWorkloadAutoScalerProfileKeda - - // VPA (Vertical Pod Autoscaler) settings for the workload auto-scaler profile. + Keda *ManagedClusterWorkloadAutoScalerProfileKeda VerticalPodAutoscaler *ManagedClusterWorkloadAutoScalerProfileVerticalPodAutoscaler } @@ -1715,11 +2340,12 @@ type ManagedClusterWorkloadAutoScalerProfileKeda struct { Enabled *bool } -// ManagedClusterWorkloadAutoScalerProfileVerticalPodAutoscaler - VPA (Vertical Pod Autoscaler) settings for the workload -// auto-scaler profile. type ManagedClusterWorkloadAutoScalerProfileVerticalPodAutoscaler struct { - // REQUIRED; Whether to enable VPA. Default value is false. + // REQUIRED; Whether to enable VPA add-on in cluster. Default value is false. Enabled *bool + + // Whether VPA add-on is enabled and configured to scale AKS-managed add-ons. + AddonAutoscaling *AddonAutoscaling } type ManagedServiceIdentityUserAssignedIdentitiesValue struct { @@ -1730,6 +2356,17 @@ type ManagedServiceIdentityUserAssignedIdentitiesValue struct { PrincipalID *string } +// ManualScaleProfile - Specifications on number of machines. +type ManualScaleProfile struct { + // Number of nodes. + Count *int32 + + // The list of allowed vm sizes e.g. ['StandardE4sv3', 'StandardE16sv3', 'StandardD16sv5']. AKS will use the first available + // one when scaling. If a VM size is unavailable (e.g. due to quota or regional + // capacity reasons), AKS will use the next size. + Sizes []*string +} + // MeshRevision - Holds information on upgrades and compatibility for given major.minor mesh release. type MeshRevision struct { // List of items this revision of service mesh is compatible with, and their associated versions. @@ -1815,6 +2452,10 @@ type MeshUpgradeProfileProperties struct { // NetworkProfile - Profile of network configuration. type NetworkProfile struct { + // Advanced Networking profile for enabling observability on a cluster. Note that enabling advanced networking features may + // incur additional costs. For more information see aka.ms/aksadvancednetworking. + AdvancedNetworking *AdvancedNetworking + // An IP address assigned to the Kubernetes DNS service. It must be within the Kubernetes service address range specified // in serviceCidr. DNSServiceIP *string @@ -1823,6 +2464,12 @@ type NetworkProfile struct { // dual-stack, the expected values are IPv4 and IPv6. IPFamilies []*IPFamily + // Holds configuration customizations for kube-proxy. Any values not defined will use the kube-proxy defaulting behavior. + // See https://v + // .docs.kubernetes.io/docs/reference/command-line-tools-reference/kube-proxy/ where is represented by a - string. Kubernetes + // version 1.23 would be '1-23'. + KubeProxyConfig *NetworkProfileKubeProxyConfig + // Profile of the cluster load balancer. LoadBalancerProfile *ManagedClusterLoadBalancerProfile @@ -1842,7 +2489,7 @@ type NetworkProfile struct { // Network plugin used for building the Kubernetes network. NetworkPlugin *NetworkPlugin - // The mode the network plugin should use. + // Network plugin mode used for building the Kubernetes network. NetworkPluginMode *NetworkPluginMode // Network policy used for building the Kubernetes network. @@ -1859,12 +2506,69 @@ type NetworkProfile struct { // networking. PodCidrs []*string + // Defines access to special link local addresses (Azure Instance Metadata Service, aka IMDS) for pods with hostNetwork=false. + // if not specified, the default is 'IMDS'. + PodLinkLocalAccess *PodLinkLocalAccess + // A CIDR notation IP range from which to assign service cluster IPs. It must not overlap with any Subnet IP ranges. ServiceCidr *string // One IPv4 CIDR is expected for single-stack networking. Two CIDRs, one for each IP family (IPv4/IPv6), is expected for dual-stack // networking. They must not overlap with any Subnet IP ranges. ServiceCidrs []*string + + // The profile for Static Egress Gateway addon. For more details about Static Egress Gateway, see https://aka.ms/aks/static-egress-gateway. + StaticEgressGatewayProfile *ManagedClusterStaticEgressGatewayProfile +} + +// NetworkProfileForSnapshot - network profile for managed cluster snapshot, these properties are read only. +type NetworkProfileForSnapshot struct { + // loadBalancerSku for managed cluster snapshot. + LoadBalancerSKU *LoadBalancerSKU + + // networkMode for managed cluster snapshot. + NetworkMode *NetworkMode + + // networkPlugin for managed cluster snapshot. + NetworkPlugin *NetworkPlugin + + // NetworkPluginMode for managed cluster snapshot. + NetworkPluginMode *NetworkPluginMode + + // networkPolicy for managed cluster snapshot. + NetworkPolicy *NetworkPolicy +} + +// NetworkProfileKubeProxyConfig - Holds configuration customizations for kube-proxy. Any values not defined will use the +// kube-proxy defaulting behavior. See https://v +// .docs.kubernetes.io/docs/reference/command-line-tools-reference/kube-proxy/ where is represented by a - string. Kubernetes +// version 1.23 would be '1-23'. +type NetworkProfileKubeProxyConfig struct { + // Whether to enable on kube-proxy on the cluster (if no 'kubeProxyConfig' exists, kube-proxy is enabled in AKS by default + // without these customizations). + Enabled *bool + + // Holds configuration customizations for IPVS. May only be specified if 'mode' is set to 'IPVS'. + IpvsConfig *NetworkProfileKubeProxyConfigIpvsConfig + + // Specify which proxy mode to use ('IPTABLES' or 'IPVS') + Mode *Mode +} + +// NetworkProfileKubeProxyConfigIpvsConfig - Holds configuration customizations for IPVS. May only be specified if 'mode' +// is set to 'IPVS'. +type NetworkProfileKubeProxyConfigIpvsConfig struct { + // IPVS scheduler, for more information please see http://www.linuxvirtualserver.org/docs/scheduling.html. + Scheduler *IpvsScheduler + + // The timeout value used for IPVS TCP sessions after receiving a FIN in seconds. Must be a positive integer value. + TCPFinTimeoutSeconds *int32 + + // The timeout value used for idle IPVS TCP sessions in seconds. Must be a positive integer value. + TCPTimeoutSeconds *int32 + + // The timeout value used for IPVS UDP packets in seconds. Must be a positive integer value. + UDPTimeoutSeconds *int32 } // OperationListResult - The List Operation response. @@ -1873,6 +2577,45 @@ type OperationListResult struct { Value []*OperationValue } +// OperationStatusResult - The current status of an async operation. +type OperationStatusResult struct { + // REQUIRED; Operation status. + Status *string + + // The end time of the operation. + EndTime *time.Time + + // If present, details of the operation error. + Error *ErrorDetail + + // Fully qualified ID for the async operation. + ID *string + + // Name of the async operation. + Name *string + + // The operations list. + Operations []*OperationStatusResult + + // Percent of the operation that is complete. + PercentComplete *float32 + + // The start time of the operation. + StartTime *time.Time + + // READ-ONLY; Fully qualified ID of the resource against which the original async operation was started. + ResourceID *string +} + +// OperationStatusResultList - The operations list. It contains an URL link to get the next set of results. +type OperationStatusResultList struct { + // READ-ONLY; URL to get the next set of operation list results (if there are any). + NextLink *string + + // READ-ONLY; List of operations + Value []*OperationStatusResult +} + // OperationValue - Describes the properties of a Operation value. type OperationValue struct { // Describes the properties of a Operation Value Display. @@ -2011,6 +2754,13 @@ type PrivateLinkServiceConnectionState struct { Status *ConnectionStatus } +// RebalanceLoadBalancersRequestBody - The names of the load balancers to rebalance. If set to empty, all load balancers will +// be rebalanced. +type RebalanceLoadBalancersRequestBody struct { + // The load balancer names list. + LoadBalancerNames []*string +} + // RelativeMonthlySchedule - For schedules like: 'recur every month on the first Monday' or 'recur every 3 months on last // Friday'. type RelativeMonthlySchedule struct { @@ -2020,7 +2770,7 @@ type RelativeMonthlySchedule struct { // REQUIRED; Specifies the number of months between each set of occurrences. IntervalMonths *int32 - // REQUIRED; Specifies on which week of the month the dayOfWeek applies. + // REQUIRED; Specifies on which instance of the allowed days specified in daysOfWeek the maintenance occurs. WeekIndex *Type } @@ -2064,6 +2814,69 @@ type SSHPublicKey struct { KeyData *string } +// SafeguardsAvailableVersion - Available Safeguards Version +type SafeguardsAvailableVersion struct { + // REQUIRED; Whether the version is default or not and support info. + Properties *SafeguardsAvailableVersionsProperties + + // READ-ONLY; Fully qualified resource ID for the resource. E.g. "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}" + ID *string + + // READ-ONLY; The name of the resource + Name *string + + // READ-ONLY; Azure Resource Manager metadata containing createdBy and modifiedBy information. + SystemData *SystemData + + // READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" + Type *string +} + +// SafeguardsAvailableVersionsList - Hold values properties, which is array of SafeguardsVersions +type SafeguardsAvailableVersionsList struct { + // Array of AKS supported Safeguards versions. + Value []*SafeguardsAvailableVersion + + // READ-ONLY; The URL to get the next Safeguards available version. + NextLink *string +} + +// SafeguardsAvailableVersionsProperties - Whether the version is default or not and support info. +type SafeguardsAvailableVersionsProperties struct { + // READ-ONLY + IsDefaultVersion *bool + + // READ-ONLY; Whether the version is preview or stable. + Support *SafeguardsSupport +} + +// SafeguardsProfile - The Safeguards profile. +type SafeguardsProfile struct { + // REQUIRED; The Safeguards level to be used. By default, Safeguards is enabled for all namespaces except those that AKS excludes + // via systemExcludedNamespaces + Level *Level + + // List of namespaces excluded from Safeguards checks + ExcludedNamespaces []*string + + // The version of constraints to use + Version *string + + // READ-ONLY; List of namespaces specified by AKS to be excluded from Safeguards + SystemExcludedNamespaces []*string +} + +// ScaleProfile - Specifications on how to scale a VirtualMachines agent pool. +type ScaleProfile struct { + // Specifications on how to auto-scale the VirtualMachines agent pool within a predefined size range. Currently, at most one + // AutoScaleProfile is allowed. + Autoscale []*AutoScaleProfile + + // Specifications on how to scale the VirtualMachines agent pool to a fixed size. Currently, at most one ManualScaleProfile + // is allowed. + Manual []*ManualScaleProfile +} + // Schedule - One and only one of the schedule types should be specified. Choose either 'daily', 'weekly', 'absoluteMonthly' // or 'relativeMonthly' for your maintenance schedule. type Schedule struct { @@ -2139,8 +2952,9 @@ type SnapshotProperties struct { // READ-ONLY; The version of node image. NodeImageVersion *string - // READ-ONLY; Specifies the OS SKU used by the agent pool. The default is Ubuntu if OSType is Linux. The default is Windows2019 - // when Kubernetes = 1.25 if OSType is Windows. + // READ-ONLY; Specifies the OS SKU used by the agent pool. If not specified, the default is Ubuntu if OSType=Linux or Windows2019 + // if OSType=Windows. And the default Windows OSSKU will be changed to Windows2022 + // after Windows2019 is deprecated. OSSKU *OSSKU // READ-ONLY; The operating system type. The default is Linux. @@ -2386,6 +3200,21 @@ type UserAssignedIdentity struct { ResourceID *string } +// VirtualMachineNodes - Current status on a group of nodes of the same vm size. +type VirtualMachineNodes struct { + // Number of nodes. + Count *int32 + + // The VM size of the agents used to host this group of nodes. + Size *string +} + +// VirtualMachinesProfile - Specifications on VirtualMachines agent pool. +type VirtualMachinesProfile struct { + // Specifications on how to scale a VirtualMachines agent pool. + Scale *ScaleProfile +} + // WeeklySchedule - For schedules like: 'recur every Monday' or 'recur every 3 weeks on Wednesday'. type WeeklySchedule struct { // REQUIRED; Specifies on which day of the week the maintenance occurs. diff --git a/sdk/resourcemanager/containerservice/armcontainerservice/models_serde.go b/sdk/resourcemanager/containerservice/armcontainerservice/models_serde.go index 61dfd9e0028e..0c31cd7dacae 100644 --- a/sdk/resourcemanager/containerservice/armcontainerservice/models_serde.go +++ b/sdk/resourcemanager/containerservice/armcontainerservice/models_serde.go @@ -78,6 +78,60 @@ func (a *AccessProfile) UnmarshalJSON(data []byte) error { return nil } +// MarshalJSON implements the json.Marshaller interface for type AdvancedNetworking. +func (a AdvancedNetworking) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "observability", a.Observability) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type AdvancedNetworking. +func (a *AdvancedNetworking) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", a, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "observability": + err = unpopulate(val, "Observability", &a.Observability) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", a, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type AdvancedNetworkingObservability. +func (a AdvancedNetworkingObservability) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "enabled", a.Enabled) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type AdvancedNetworkingObservability. +func (a *AdvancedNetworkingObservability) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", a, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "enabled": + err = unpopulate(val, "Enabled", &a.Enabled) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", a, err) + } + } + return nil +} + // MarshalJSON implements the json.Marshaller interface for type AgentPool. func (a AgentPool) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) @@ -117,6 +171,33 @@ func (a *AgentPool) UnmarshalJSON(data []byte) error { return nil } +// MarshalJSON implements the json.Marshaller interface for type AgentPoolArtifactStreamingProfile. +func (a AgentPoolArtifactStreamingProfile) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "enabled", a.Enabled) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type AgentPoolArtifactStreamingProfile. +func (a *AgentPoolArtifactStreamingProfile) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", a, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "enabled": + err = unpopulate(val, "Enabled", &a.Enabled) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", a, err) + } + } + return nil +} + // MarshalJSON implements the json.Marshaller interface for type AgentPoolAvailableVersions. func (a AgentPoolAvailableVersions) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) @@ -218,6 +299,87 @@ func (a *AgentPoolAvailableVersionsPropertiesAgentPoolVersionsItem) UnmarshalJSO return nil } +// MarshalJSON implements the json.Marshaller interface for type AgentPoolDeleteMachinesParameter. +func (a AgentPoolDeleteMachinesParameter) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "machineNames", a.MachineNames) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type AgentPoolDeleteMachinesParameter. +func (a *AgentPoolDeleteMachinesParameter) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", a, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "machineNames": + err = unpopulate(val, "MachineNames", &a.MachineNames) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", a, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type AgentPoolGPUProfile. +func (a AgentPoolGPUProfile) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "installGPUDriver", a.InstallGPUDriver) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type AgentPoolGPUProfile. +func (a *AgentPoolGPUProfile) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", a, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "installGPUDriver": + err = unpopulate(val, "InstallGPUDriver", &a.InstallGPUDriver) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", a, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type AgentPoolGatewayProfile. +func (a AgentPoolGatewayProfile) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "publicIPPrefixSize", a.PublicIPPrefixSize) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type AgentPoolGatewayProfile. +func (a *AgentPoolGatewayProfile) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", a, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "publicIPPrefixSize": + err = unpopulate(val, "PublicIPPrefixSize", &a.PublicIPPrefixSize) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", a, err) + } + } + return nil +} + // MarshalJSON implements the json.Marshaller interface for type AgentPoolListResult. func (a AgentPoolListResult) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) @@ -284,6 +446,41 @@ func (a *AgentPoolNetworkProfile) UnmarshalJSON(data []byte) error { return nil } +// MarshalJSON implements the json.Marshaller interface for type AgentPoolSecurityProfile. +func (a AgentPoolSecurityProfile) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "enableSecureBoot", a.EnableSecureBoot) + populate(objectMap, "enableVTPM", a.EnableVTPM) + populate(objectMap, "sshAccess", a.SSHAccess) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type AgentPoolSecurityProfile. +func (a *AgentPoolSecurityProfile) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", a, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "enableSecureBoot": + err = unpopulate(val, "EnableSecureBoot", &a.EnableSecureBoot) + delete(rawMsg, key) + case "enableVTPM": + err = unpopulate(val, "EnableVTPM", &a.EnableVTPM) + delete(rawMsg, key) + case "sshAccess": + err = unpopulate(val, "SSHAccess", &a.SSHAccess) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", a, err) + } + } + return nil +} + // MarshalJSON implements the json.Marshaller interface for type AgentPoolUpgradeProfile. func (a AgentPoolUpgradeProfile) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) @@ -326,6 +523,7 @@ func (a *AgentPoolUpgradeProfile) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type AgentPoolUpgradeProfileProperties. func (a AgentPoolUpgradeProfileProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) + populate(objectMap, "componentsByReleases", a.ComponentsByReleases) populate(objectMap, "kubernetesVersion", a.KubernetesVersion) populate(objectMap, "latestNodeImageVersion", a.LatestNodeImageVersion) populate(objectMap, "osType", a.OSType) @@ -342,6 +540,9 @@ func (a *AgentPoolUpgradeProfileProperties) UnmarshalJSON(data []byte) error { for key, val := range rawMsg { var err error switch key { + case "componentsByReleases": + err = unpopulate(val, "ComponentsByReleases", &a.ComponentsByReleases) + delete(rawMsg, key) case "kubernetesVersion": err = unpopulate(val, "KubernetesVersion", &a.KubernetesVersion) delete(rawMsg, key) @@ -399,6 +600,7 @@ func (a AgentPoolUpgradeSettings) MarshalJSON() ([]byte, error) { populate(objectMap, "drainTimeoutInMinutes", a.DrainTimeoutInMinutes) populate(objectMap, "maxSurge", a.MaxSurge) populate(objectMap, "nodeSoakDurationInMinutes", a.NodeSoakDurationInMinutes) + populate(objectMap, "undrainableNodeBehavior", a.UndrainableNodeBehavior) return json.Marshal(objectMap) } @@ -420,6 +622,9 @@ func (a *AgentPoolUpgradeSettings) UnmarshalJSON(data []byte) error { case "nodeSoakDurationInMinutes": err = unpopulate(val, "NodeSoakDurationInMinutes", &a.NodeSoakDurationInMinutes) delete(rawMsg, key) + case "undrainableNodeBehavior": + err = unpopulate(val, "UndrainableNodeBehavior", &a.UndrainableNodeBehavior) + delete(rawMsg, key) } if err != nil { return fmt.Errorf("unmarshalling type %T: %v", a, err) @@ -455,6 +660,41 @@ func (a *AgentPoolWindowsProfile) UnmarshalJSON(data []byte) error { return nil } +// MarshalJSON implements the json.Marshaller interface for type AutoScaleProfile. +func (a AutoScaleProfile) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "maxCount", a.MaxCount) + populate(objectMap, "minCount", a.MinCount) + populate(objectMap, "sizes", a.Sizes) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type AutoScaleProfile. +func (a *AutoScaleProfile) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", a, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "maxCount": + err = unpopulate(val, "MaxCount", &a.MaxCount) + delete(rawMsg, key) + case "minCount": + err = unpopulate(val, "MinCount", &a.MinCount) + delete(rawMsg, key) + case "sizes": + err = unpopulate(val, "Sizes", &a.Sizes) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", a, err) + } + } + return nil +} + // MarshalJSON implements the json.Marshaller interface for type AzureKeyVaultKms. func (a AzureKeyVaultKms) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) @@ -599,6 +839,72 @@ func (c *CompatibleVersions) UnmarshalJSON(data []byte) error { return nil } +// MarshalJSON implements the json.Marshaller interface for type Component. +func (c Component) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "hasBreakingChanges", c.HasBreakingChanges) + populate(objectMap, "name", c.Name) + populate(objectMap, "version", c.Version) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type Component. +func (c *Component) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", c, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "hasBreakingChanges": + err = unpopulate(val, "HasBreakingChanges", &c.HasBreakingChanges) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &c.Name) + delete(rawMsg, key) + case "version": + err = unpopulate(val, "Version", &c.Version) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", c, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ComponentsByRelease. +func (c ComponentsByRelease) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "components", c.Components) + populate(objectMap, "kubernetesVersion", c.KubernetesVersion) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ComponentsByRelease. +func (c *ComponentsByRelease) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", c, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "components": + err = unpopulate(val, "Components", &c.Components) + delete(rawMsg, key) + case "kubernetesVersion": + err = unpopulate(val, "KubernetesVersion", &c.KubernetesVersion) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", c, err) + } + } + return nil +} + // MarshalJSON implements the json.Marshaller interface for type CreationData. func (c CreationData) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) @@ -855,16 +1161,16 @@ func (e *EndpointDetail) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type ExtendedLocation. -func (e ExtendedLocation) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type ErrorAdditionalInfo. +func (e ErrorAdditionalInfo) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "name", e.Name) + populateAny(objectMap, "info", e.Info) populate(objectMap, "type", e.Type) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type ExtendedLocation. -func (e *ExtendedLocation) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type ErrorAdditionalInfo. +func (e *ErrorAdditionalInfo) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { return fmt.Errorf("unmarshalling type %T: %v", e, err) @@ -872,8 +1178,8 @@ func (e *ExtendedLocation) UnmarshalJSON(data []byte) error { for key, val := range rawMsg { var err error switch key { - case "name": - err = unpopulate(val, "Name", &e.Name) + case "info": + err = unpopulate(val, "Info", &e.Info) delete(rawMsg, key) case "type": err = unpopulate(val, "Type", &e.Type) @@ -886,41 +1192,220 @@ func (e *ExtendedLocation) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type IPTag. -func (i IPTag) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type ErrorDetail. +func (e ErrorDetail) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "ipTagType", i.IPTagType) - populate(objectMap, "tag", i.Tag) + populate(objectMap, "additionalInfo", e.AdditionalInfo) + populate(objectMap, "code", e.Code) + populate(objectMap, "details", e.Details) + populate(objectMap, "message", e.Message) + populate(objectMap, "target", e.Target) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type IPTag. -func (i *IPTag) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type ErrorDetail. +func (e *ErrorDetail) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", i, err) + return fmt.Errorf("unmarshalling type %T: %v", e, err) } for key, val := range rawMsg { var err error switch key { - case "ipTagType": - err = unpopulate(val, "IPTagType", &i.IPTagType) + case "additionalInfo": + err = unpopulate(val, "AdditionalInfo", &e.AdditionalInfo) delete(rawMsg, key) - case "tag": - err = unpopulate(val, "Tag", &i.Tag) + case "code": + err = unpopulate(val, "Code", &e.Code) + delete(rawMsg, key) + case "details": + err = unpopulate(val, "Details", &e.Details) + delete(rawMsg, key) + case "message": + err = unpopulate(val, "Message", &e.Message) + delete(rawMsg, key) + case "target": + err = unpopulate(val, "Target", &e.Target) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", i, err) + return fmt.Errorf("unmarshalling type %T: %v", e, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type IstioCertificateAuthority. -func (i IstioCertificateAuthority) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type ExtendedLocation. +func (e ExtendedLocation) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "plugin", i.Plugin) + populate(objectMap, "name", e.Name) + populate(objectMap, "type", e.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ExtendedLocation. +func (e *ExtendedLocation) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", e, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "name": + err = unpopulate(val, "Name", &e.Name) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &e.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", e, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type GuardrailsAvailableVersion. +func (g GuardrailsAvailableVersion) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "id", g.ID) + populate(objectMap, "name", g.Name) + populate(objectMap, "properties", g.Properties) + populate(objectMap, "systemData", g.SystemData) + populate(objectMap, "type", g.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type GuardrailsAvailableVersion. +func (g *GuardrailsAvailableVersion) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", g, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "id": + err = unpopulate(val, "ID", &g.ID) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &g.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &g.Properties) + delete(rawMsg, key) + case "systemData": + err = unpopulate(val, "SystemData", &g.SystemData) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &g.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", g, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type GuardrailsAvailableVersionsList. +func (g GuardrailsAvailableVersionsList) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "nextLink", g.NextLink) + populate(objectMap, "value", g.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type GuardrailsAvailableVersionsList. +func (g *GuardrailsAvailableVersionsList) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", g, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "nextLink": + err = unpopulate(val, "NextLink", &g.NextLink) + delete(rawMsg, key) + case "value": + err = unpopulate(val, "Value", &g.Value) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", g, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type GuardrailsAvailableVersionsProperties. +func (g GuardrailsAvailableVersionsProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "isDefaultVersion", g.IsDefaultVersion) + populate(objectMap, "support", g.Support) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type GuardrailsAvailableVersionsProperties. +func (g *GuardrailsAvailableVersionsProperties) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", g, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "isDefaultVersion": + err = unpopulate(val, "IsDefaultVersion", &g.IsDefaultVersion) + delete(rawMsg, key) + case "support": + err = unpopulate(val, "Support", &g.Support) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", g, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type IPTag. +func (i IPTag) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "ipTagType", i.IPTagType) + populate(objectMap, "tag", i.Tag) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type IPTag. +func (i *IPTag) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", i, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "ipTagType": + err = unpopulate(val, "IPTagType", &i.IPTagType) + delete(rawMsg, key) + case "tag": + err = unpopulate(val, "Tag", &i.Tag) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", i, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type IstioCertificateAuthority. +func (i IstioCertificateAuthority) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "plugin", i.Plugin) return json.Marshal(objectMap) } @@ -1302,6 +1787,72 @@ func (k *KubernetesVersionListResult) UnmarshalJSON(data []byte) error { return nil } +// MarshalJSON implements the json.Marshaller interface for type LabelSelector. +func (l LabelSelector) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "matchExpressions", l.MatchExpressions) + populate(objectMap, "matchLabels", l.MatchLabels) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type LabelSelector. +func (l *LabelSelector) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", l, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "matchExpressions": + err = unpopulate(val, "MatchExpressions", &l.MatchExpressions) + delete(rawMsg, key) + case "matchLabels": + err = unpopulate(val, "MatchLabels", &l.MatchLabels) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", l, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type LabelSelectorRequirement. +func (l LabelSelectorRequirement) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "key", l.Key) + populate(objectMap, "operator", l.Operator) + populate(objectMap, "values", l.Values) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type LabelSelectorRequirement. +func (l *LabelSelectorRequirement) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", l, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "key": + err = unpopulate(val, "Key", &l.Key) + delete(rawMsg, key) + case "operator": + err = unpopulate(val, "Operator", &l.Operator) + delete(rawMsg, key) + case "values": + err = unpopulate(val, "Values", &l.Values) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", l, err) + } + } + return nil +} + // MarshalJSON implements the json.Marshaller interface for type LinuxOSConfig. func (l LinuxOSConfig) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) @@ -1372,6 +1923,290 @@ func (l *LinuxProfile) UnmarshalJSON(data []byte) error { return nil } +// MarshalJSON implements the json.Marshaller interface for type LoadBalancer. +func (l LoadBalancer) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "id", l.ID) + populate(objectMap, "name", l.Name) + populate(objectMap, "properties", l.Properties) + populate(objectMap, "systemData", l.SystemData) + populate(objectMap, "type", l.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type LoadBalancer. +func (l *LoadBalancer) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", l, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "id": + err = unpopulate(val, "ID", &l.ID) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &l.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &l.Properties) + delete(rawMsg, key) + case "systemData": + err = unpopulate(val, "SystemData", &l.SystemData) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &l.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", l, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type LoadBalancerListResult. +func (l LoadBalancerListResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "nextLink", l.NextLink) + populate(objectMap, "value", l.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type LoadBalancerListResult. +func (l *LoadBalancerListResult) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", l, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "nextLink": + err = unpopulate(val, "NextLink", &l.NextLink) + delete(rawMsg, key) + case "value": + err = unpopulate(val, "Value", &l.Value) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", l, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type LoadBalancerProperties. +func (l LoadBalancerProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "allowServicePlacement", l.AllowServicePlacement) + populate(objectMap, "name", l.Name) + populate(objectMap, "nodeSelector", l.NodeSelector) + populate(objectMap, "primaryAgentPoolName", l.PrimaryAgentPoolName) + populate(objectMap, "provisioningState", l.ProvisioningState) + populate(objectMap, "serviceLabelSelector", l.ServiceLabelSelector) + populate(objectMap, "serviceNamespaceSelector", l.ServiceNamespaceSelector) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type LoadBalancerProperties. +func (l *LoadBalancerProperties) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", l, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "allowServicePlacement": + err = unpopulate(val, "AllowServicePlacement", &l.AllowServicePlacement) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &l.Name) + delete(rawMsg, key) + case "nodeSelector": + err = unpopulate(val, "NodeSelector", &l.NodeSelector) + delete(rawMsg, key) + case "primaryAgentPoolName": + err = unpopulate(val, "PrimaryAgentPoolName", &l.PrimaryAgentPoolName) + delete(rawMsg, key) + case "provisioningState": + err = unpopulate(val, "ProvisioningState", &l.ProvisioningState) + delete(rawMsg, key) + case "serviceLabelSelector": + err = unpopulate(val, "ServiceLabelSelector", &l.ServiceLabelSelector) + delete(rawMsg, key) + case "serviceNamespaceSelector": + err = unpopulate(val, "ServiceNamespaceSelector", &l.ServiceNamespaceSelector) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", l, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type Machine. +func (m Machine) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "id", m.ID) + populate(objectMap, "name", m.Name) + populate(objectMap, "properties", m.Properties) + populate(objectMap, "type", m.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type Machine. +func (m *Machine) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", m, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "id": + err = unpopulate(val, "ID", &m.ID) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &m.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &m.Properties) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &m.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", m, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type MachineIPAddress. +func (m MachineIPAddress) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "family", m.Family) + populate(objectMap, "ip", m.IP) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type MachineIPAddress. +func (m *MachineIPAddress) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", m, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "family": + err = unpopulate(val, "Family", &m.Family) + delete(rawMsg, key) + case "ip": + err = unpopulate(val, "IP", &m.IP) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", m, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type MachineListResult. +func (m MachineListResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "nextLink", m.NextLink) + populate(objectMap, "value", m.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type MachineListResult. +func (m *MachineListResult) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", m, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "nextLink": + err = unpopulate(val, "NextLink", &m.NextLink) + delete(rawMsg, key) + case "value": + err = unpopulate(val, "Value", &m.Value) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", m, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type MachineNetworkProperties. +func (m MachineNetworkProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "ipAddresses", m.IPAddresses) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type MachineNetworkProperties. +func (m *MachineNetworkProperties) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", m, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "ipAddresses": + err = unpopulate(val, "IPAddresses", &m.IPAddresses) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", m, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type MachineProperties. +func (m MachineProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "network", m.Network) + populate(objectMap, "resourceId", m.ResourceID) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type MachineProperties. +func (m *MachineProperties) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", m, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "network": + err = unpopulate(val, "Network", &m.Network) + delete(rawMsg, key) + case "resourceId": + err = unpopulate(val, "ResourceID", &m.ResourceID) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", m, err) + } + } + return nil +} + // MarshalJSON implements the json.Marshaller interface for type MaintenanceConfiguration. func (m MaintenanceConfiguration) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) @@ -1531,9 +2366,11 @@ func (m *MaintenanceWindow) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type ManagedCluster. func (m ManagedCluster) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) + populate(objectMap, "eTag", m.ETag) populate(objectMap, "extendedLocation", m.ExtendedLocation) populate(objectMap, "id", m.ID) populate(objectMap, "identity", m.Identity) + populate(objectMap, "kind", m.Kind) populate(objectMap, "location", m.Location) populate(objectMap, "name", m.Name) populate(objectMap, "properties", m.Properties) @@ -1553,6 +2390,9 @@ func (m *ManagedCluster) UnmarshalJSON(data []byte) error { for key, val := range rawMsg { var err error switch key { + case "eTag": + err = unpopulate(val, "ETag", &m.ETag) + delete(rawMsg, key) case "extendedLocation": err = unpopulate(val, "ExtendedLocation", &m.ExtendedLocation) delete(rawMsg, key) @@ -1562,6 +2402,9 @@ func (m *ManagedCluster) UnmarshalJSON(data []byte) error { case "identity": err = unpopulate(val, "Identity", &m.Identity) delete(rawMsg, key) + case "kind": + err = unpopulate(val, "Kind", &m.Kind) + delete(rawMsg, key) case "location": err = unpopulate(val, "Location", &m.Location) delete(rawMsg, key) @@ -1642,6 +2485,33 @@ func (m *ManagedClusterAADProfile) UnmarshalJSON(data []byte) error { return nil } +// MarshalJSON implements the json.Marshaller interface for type ManagedClusterAIToolchainOperatorProfile. +func (m ManagedClusterAIToolchainOperatorProfile) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "enabled", m.Enabled) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ManagedClusterAIToolchainOperatorProfile. +func (m *ManagedClusterAIToolchainOperatorProfile) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", m, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "enabled": + err = unpopulate(val, "Enabled", &m.Enabled) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", m, err) + } + } + return nil +} + // MarshalJSON implements the json.Marshaller interface for type ManagedClusterAPIServerAccessProfile. func (m ManagedClusterAPIServerAccessProfile) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) @@ -1649,7 +2519,9 @@ func (m ManagedClusterAPIServerAccessProfile) MarshalJSON() ([]byte, error) { populate(objectMap, "disableRunCommand", m.DisableRunCommand) populate(objectMap, "enablePrivateCluster", m.EnablePrivateCluster) populate(objectMap, "enablePrivateClusterPublicFQDN", m.EnablePrivateClusterPublicFQDN) + populate(objectMap, "enableVnetIntegration", m.EnableVnetIntegration) populate(objectMap, "privateDNSZone", m.PrivateDNSZone) + populate(objectMap, "subnetId", m.SubnetID) return json.Marshal(objectMap) } @@ -1674,9 +2546,15 @@ func (m *ManagedClusterAPIServerAccessProfile) UnmarshalJSON(data []byte) error case "enablePrivateClusterPublicFQDN": err = unpopulate(val, "EnablePrivateClusterPublicFQDN", &m.EnablePrivateClusterPublicFQDN) delete(rawMsg, key) + case "enableVnetIntegration": + err = unpopulate(val, "EnableVnetIntegration", &m.EnableVnetIntegration) + delete(rawMsg, key) case "privateDNSZone": err = unpopulate(val, "PrivateDNSZone", &m.PrivateDNSZone) delete(rawMsg, key) + case "subnetId": + err = unpopulate(val, "SubnetID", &m.SubnetID) + delete(rawMsg, key) } if err != nil { return fmt.Errorf("unmarshalling type %T: %v", m, err) @@ -1809,28 +2687,35 @@ func (m *ManagedClusterAddonProfileIdentity) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type ManagedClusterAgentPoolProfile. func (m ManagedClusterAgentPoolProfile) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) + populate(objectMap, "artifactStreamingProfile", m.ArtifactStreamingProfile) populate(objectMap, "availabilityZones", m.AvailabilityZones) populate(objectMap, "capacityReservationGroupID", m.CapacityReservationGroupID) populate(objectMap, "count", m.Count) populate(objectMap, "creationData", m.CreationData) populate(objectMap, "currentOrchestratorVersion", m.CurrentOrchestratorVersion) + populate(objectMap, "eTag", m.ETag) populate(objectMap, "enableAutoScaling", m.EnableAutoScaling) + populate(objectMap, "enableCustomCATrust", m.EnableCustomCATrust) populate(objectMap, "enableEncryptionAtHost", m.EnableEncryptionAtHost) populate(objectMap, "enableFIPS", m.EnableFIPS) populate(objectMap, "enableNodePublicIP", m.EnableNodePublicIP) populate(objectMap, "enableUltraSSD", m.EnableUltraSSD) + populate(objectMap, "gatewayProfile", m.GatewayProfile) populate(objectMap, "gpuInstanceProfile", m.GpuInstanceProfile) + populate(objectMap, "gpuProfile", m.GpuProfile) populate(objectMap, "hostGroupID", m.HostGroupID) 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, "messageOfTheDay", m.MessageOfTheDay) populate(objectMap, "minCount", m.MinCount) populate(objectMap, "mode", m.Mode) populate(objectMap, "name", m.Name) populate(objectMap, "networkProfile", m.NetworkProfile) populate(objectMap, "nodeImageVersion", m.NodeImageVersion) + populate(objectMap, "nodeInitializationTaints", m.NodeInitializationTaints) populate(objectMap, "nodeLabels", m.NodeLabels) populate(objectMap, "nodePublicIPPrefixID", m.NodePublicIPPrefixID) populate(objectMap, "nodeTaints", m.NodeTaints) @@ -1839,6 +2724,7 @@ func (m ManagedClusterAgentPoolProfile) MarshalJSON() ([]byte, error) { populate(objectMap, "osSKU", m.OSSKU) populate(objectMap, "osType", m.OSType) populate(objectMap, "orchestratorVersion", m.OrchestratorVersion) + populate(objectMap, "podIPAllocationMode", m.PodIPAllocationMode) populate(objectMap, "podSubnetID", m.PodSubnetID) populate(objectMap, "powerState", m.PowerState) populate(objectMap, "provisioningState", m.ProvisioningState) @@ -1846,11 +2732,14 @@ func (m ManagedClusterAgentPoolProfile) MarshalJSON() ([]byte, error) { populate(objectMap, "scaleDownMode", m.ScaleDownMode) populate(objectMap, "scaleSetEvictionPolicy", m.ScaleSetEvictionPolicy) populate(objectMap, "scaleSetPriority", m.ScaleSetPriority) + populate(objectMap, "securityProfile", m.SecurityProfile) 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, "virtualMachineNodesStatus", m.VirtualMachineNodesStatus) + populate(objectMap, "virtualMachinesProfile", m.VirtualMachinesProfile) populate(objectMap, "vnetSubnetID", m.VnetSubnetID) populate(objectMap, "windowsProfile", m.WindowsProfile) populate(objectMap, "workloadRuntime", m.WorkloadRuntime) @@ -1866,6 +2755,9 @@ func (m *ManagedClusterAgentPoolProfile) UnmarshalJSON(data []byte) error { for key, val := range rawMsg { var err error switch key { + case "artifactStreamingProfile": + err = unpopulate(val, "ArtifactStreamingProfile", &m.ArtifactStreamingProfile) + delete(rawMsg, key) case "availabilityZones": err = unpopulate(val, "AvailabilityZones", &m.AvailabilityZones) delete(rawMsg, key) @@ -1881,9 +2773,15 @@ func (m *ManagedClusterAgentPoolProfile) UnmarshalJSON(data []byte) error { case "currentOrchestratorVersion": err = unpopulate(val, "CurrentOrchestratorVersion", &m.CurrentOrchestratorVersion) delete(rawMsg, key) + case "eTag": + err = unpopulate(val, "ETag", &m.ETag) + delete(rawMsg, key) case "enableAutoScaling": err = unpopulate(val, "EnableAutoScaling", &m.EnableAutoScaling) delete(rawMsg, key) + case "enableCustomCATrust": + err = unpopulate(val, "EnableCustomCATrust", &m.EnableCustomCATrust) + delete(rawMsg, key) case "enableEncryptionAtHost": err = unpopulate(val, "EnableEncryptionAtHost", &m.EnableEncryptionAtHost) delete(rawMsg, key) @@ -1896,9 +2794,15 @@ func (m *ManagedClusterAgentPoolProfile) UnmarshalJSON(data []byte) error { case "enableUltraSSD": err = unpopulate(val, "EnableUltraSSD", &m.EnableUltraSSD) delete(rawMsg, key) + case "gatewayProfile": + err = unpopulate(val, "GatewayProfile", &m.GatewayProfile) + delete(rawMsg, key) case "gpuInstanceProfile": err = unpopulate(val, "GpuInstanceProfile", &m.GpuInstanceProfile) delete(rawMsg, key) + case "gpuProfile": + err = unpopulate(val, "GpuProfile", &m.GpuProfile) + delete(rawMsg, key) case "hostGroupID": err = unpopulate(val, "HostGroupID", &m.HostGroupID) delete(rawMsg, key) @@ -1917,6 +2821,9 @@ func (m *ManagedClusterAgentPoolProfile) UnmarshalJSON(data []byte) error { case "maxPods": err = unpopulate(val, "MaxPods", &m.MaxPods) delete(rawMsg, key) + case "messageOfTheDay": + err = unpopulate(val, "MessageOfTheDay", &m.MessageOfTheDay) + delete(rawMsg, key) case "minCount": err = unpopulate(val, "MinCount", &m.MinCount) delete(rawMsg, key) @@ -1932,6 +2839,9 @@ func (m *ManagedClusterAgentPoolProfile) UnmarshalJSON(data []byte) error { case "nodeImageVersion": err = unpopulate(val, "NodeImageVersion", &m.NodeImageVersion) delete(rawMsg, key) + case "nodeInitializationTaints": + err = unpopulate(val, "NodeInitializationTaints", &m.NodeInitializationTaints) + delete(rawMsg, key) case "nodeLabels": err = unpopulate(val, "NodeLabels", &m.NodeLabels) delete(rawMsg, key) @@ -1956,6 +2866,9 @@ func (m *ManagedClusterAgentPoolProfile) UnmarshalJSON(data []byte) error { case "orchestratorVersion": err = unpopulate(val, "OrchestratorVersion", &m.OrchestratorVersion) delete(rawMsg, key) + case "podIPAllocationMode": + err = unpopulate(val, "PodIPAllocationMode", &m.PodIPAllocationMode) + delete(rawMsg, key) case "podSubnetID": err = unpopulate(val, "PodSubnetID", &m.PodSubnetID) delete(rawMsg, key) @@ -1977,6 +2890,9 @@ func (m *ManagedClusterAgentPoolProfile) UnmarshalJSON(data []byte) error { case "scaleSetPriority": err = unpopulate(val, "ScaleSetPriority", &m.ScaleSetPriority) delete(rawMsg, key) + case "securityProfile": + err = unpopulate(val, "SecurityProfile", &m.SecurityProfile) + delete(rawMsg, key) case "spotMaxPrice": err = unpopulate(val, "SpotMaxPrice", &m.SpotMaxPrice) delete(rawMsg, key) @@ -1992,6 +2908,12 @@ func (m *ManagedClusterAgentPoolProfile) UnmarshalJSON(data []byte) error { case "vmSize": err = unpopulate(val, "VMSize", &m.VMSize) delete(rawMsg, key) + case "virtualMachineNodesStatus": + err = unpopulate(val, "VirtualMachineNodesStatus", &m.VirtualMachineNodesStatus) + delete(rawMsg, key) + case "virtualMachinesProfile": + err = unpopulate(val, "VirtualMachinesProfile", &m.VirtualMachinesProfile) + delete(rawMsg, key) case "vnetSubnetID": err = unpopulate(val, "VnetSubnetID", &m.VnetSubnetID) delete(rawMsg, key) @@ -2012,27 +2934,34 @@ func (m *ManagedClusterAgentPoolProfile) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type ManagedClusterAgentPoolProfileProperties. func (m ManagedClusterAgentPoolProfileProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) + populate(objectMap, "artifactStreamingProfile", m.ArtifactStreamingProfile) populate(objectMap, "availabilityZones", m.AvailabilityZones) populate(objectMap, "capacityReservationGroupID", m.CapacityReservationGroupID) populate(objectMap, "count", m.Count) populate(objectMap, "creationData", m.CreationData) populate(objectMap, "currentOrchestratorVersion", m.CurrentOrchestratorVersion) + populate(objectMap, "eTag", m.ETag) populate(objectMap, "enableAutoScaling", m.EnableAutoScaling) + populate(objectMap, "enableCustomCATrust", m.EnableCustomCATrust) populate(objectMap, "enableEncryptionAtHost", m.EnableEncryptionAtHost) populate(objectMap, "enableFIPS", m.EnableFIPS) populate(objectMap, "enableNodePublicIP", m.EnableNodePublicIP) populate(objectMap, "enableUltraSSD", m.EnableUltraSSD) + populate(objectMap, "gatewayProfile", m.GatewayProfile) populate(objectMap, "gpuInstanceProfile", m.GpuInstanceProfile) + populate(objectMap, "gpuProfile", m.GpuProfile) populate(objectMap, "hostGroupID", m.HostGroupID) 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, "messageOfTheDay", m.MessageOfTheDay) populate(objectMap, "minCount", m.MinCount) populate(objectMap, "mode", m.Mode) populate(objectMap, "networkProfile", m.NetworkProfile) populate(objectMap, "nodeImageVersion", m.NodeImageVersion) + populate(objectMap, "nodeInitializationTaints", m.NodeInitializationTaints) populate(objectMap, "nodeLabels", m.NodeLabels) populate(objectMap, "nodePublicIPPrefixID", m.NodePublicIPPrefixID) populate(objectMap, "nodeTaints", m.NodeTaints) @@ -2041,6 +2970,7 @@ func (m ManagedClusterAgentPoolProfileProperties) MarshalJSON() ([]byte, error) populate(objectMap, "osSKU", m.OSSKU) populate(objectMap, "osType", m.OSType) populate(objectMap, "orchestratorVersion", m.OrchestratorVersion) + populate(objectMap, "podIPAllocationMode", m.PodIPAllocationMode) populate(objectMap, "podSubnetID", m.PodSubnetID) populate(objectMap, "powerState", m.PowerState) populate(objectMap, "provisioningState", m.ProvisioningState) @@ -2048,11 +2978,14 @@ func (m ManagedClusterAgentPoolProfileProperties) MarshalJSON() ([]byte, error) populate(objectMap, "scaleDownMode", m.ScaleDownMode) populate(objectMap, "scaleSetEvictionPolicy", m.ScaleSetEvictionPolicy) populate(objectMap, "scaleSetPriority", m.ScaleSetPriority) + populate(objectMap, "securityProfile", m.SecurityProfile) 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, "virtualMachineNodesStatus", m.VirtualMachineNodesStatus) + populate(objectMap, "virtualMachinesProfile", m.VirtualMachinesProfile) populate(objectMap, "vnetSubnetID", m.VnetSubnetID) populate(objectMap, "windowsProfile", m.WindowsProfile) populate(objectMap, "workloadRuntime", m.WorkloadRuntime) @@ -2068,6 +3001,9 @@ func (m *ManagedClusterAgentPoolProfileProperties) UnmarshalJSON(data []byte) er for key, val := range rawMsg { var err error switch key { + case "artifactStreamingProfile": + err = unpopulate(val, "ArtifactStreamingProfile", &m.ArtifactStreamingProfile) + delete(rawMsg, key) case "availabilityZones": err = unpopulate(val, "AvailabilityZones", &m.AvailabilityZones) delete(rawMsg, key) @@ -2083,9 +3019,15 @@ func (m *ManagedClusterAgentPoolProfileProperties) UnmarshalJSON(data []byte) er case "currentOrchestratorVersion": err = unpopulate(val, "CurrentOrchestratorVersion", &m.CurrentOrchestratorVersion) delete(rawMsg, key) + case "eTag": + err = unpopulate(val, "ETag", &m.ETag) + delete(rawMsg, key) case "enableAutoScaling": err = unpopulate(val, "EnableAutoScaling", &m.EnableAutoScaling) delete(rawMsg, key) + case "enableCustomCATrust": + err = unpopulate(val, "EnableCustomCATrust", &m.EnableCustomCATrust) + delete(rawMsg, key) case "enableEncryptionAtHost": err = unpopulate(val, "EnableEncryptionAtHost", &m.EnableEncryptionAtHost) delete(rawMsg, key) @@ -2098,9 +3040,15 @@ func (m *ManagedClusterAgentPoolProfileProperties) UnmarshalJSON(data []byte) er case "enableUltraSSD": err = unpopulate(val, "EnableUltraSSD", &m.EnableUltraSSD) delete(rawMsg, key) + case "gatewayProfile": + err = unpopulate(val, "GatewayProfile", &m.GatewayProfile) + delete(rawMsg, key) case "gpuInstanceProfile": err = unpopulate(val, "GpuInstanceProfile", &m.GpuInstanceProfile) delete(rawMsg, key) + case "gpuProfile": + err = unpopulate(val, "GpuProfile", &m.GpuProfile) + delete(rawMsg, key) case "hostGroupID": err = unpopulate(val, "HostGroupID", &m.HostGroupID) delete(rawMsg, key) @@ -2119,6 +3067,9 @@ func (m *ManagedClusterAgentPoolProfileProperties) UnmarshalJSON(data []byte) er case "maxPods": err = unpopulate(val, "MaxPods", &m.MaxPods) delete(rawMsg, key) + case "messageOfTheDay": + err = unpopulate(val, "MessageOfTheDay", &m.MessageOfTheDay) + delete(rawMsg, key) case "minCount": err = unpopulate(val, "MinCount", &m.MinCount) delete(rawMsg, key) @@ -2131,6 +3082,9 @@ func (m *ManagedClusterAgentPoolProfileProperties) UnmarshalJSON(data []byte) er case "nodeImageVersion": err = unpopulate(val, "NodeImageVersion", &m.NodeImageVersion) delete(rawMsg, key) + case "nodeInitializationTaints": + err = unpopulate(val, "NodeInitializationTaints", &m.NodeInitializationTaints) + delete(rawMsg, key) case "nodeLabels": err = unpopulate(val, "NodeLabels", &m.NodeLabels) delete(rawMsg, key) @@ -2155,6 +3109,9 @@ func (m *ManagedClusterAgentPoolProfileProperties) UnmarshalJSON(data []byte) er case "orchestratorVersion": err = unpopulate(val, "OrchestratorVersion", &m.OrchestratorVersion) delete(rawMsg, key) + case "podIPAllocationMode": + err = unpopulate(val, "PodIPAllocationMode", &m.PodIPAllocationMode) + delete(rawMsg, key) case "podSubnetID": err = unpopulate(val, "PodSubnetID", &m.PodSubnetID) delete(rawMsg, key) @@ -2176,6 +3133,9 @@ func (m *ManagedClusterAgentPoolProfileProperties) UnmarshalJSON(data []byte) er case "scaleSetPriority": err = unpopulate(val, "ScaleSetPriority", &m.ScaleSetPriority) delete(rawMsg, key) + case "securityProfile": + err = unpopulate(val, "SecurityProfile", &m.SecurityProfile) + delete(rawMsg, key) case "spotMaxPrice": err = unpopulate(val, "SpotMaxPrice", &m.SpotMaxPrice) delete(rawMsg, key) @@ -2191,6 +3151,12 @@ func (m *ManagedClusterAgentPoolProfileProperties) UnmarshalJSON(data []byte) er case "vmSize": err = unpopulate(val, "VMSize", &m.VMSize) delete(rawMsg, key) + case "virtualMachineNodesStatus": + err = unpopulate(val, "VirtualMachineNodesStatus", &m.VirtualMachineNodesStatus) + delete(rawMsg, key) + case "virtualMachinesProfile": + err = unpopulate(val, "VirtualMachinesProfile", &m.VirtualMachinesProfile) + delete(rawMsg, key) case "vnetSubnetID": err = unpopulate(val, "VnetSubnetID", &m.VnetSubnetID) delete(rawMsg, key) @@ -2242,6 +3208,8 @@ func (m *ManagedClusterAutoUpgradeProfile) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type ManagedClusterAzureMonitorProfile. func (m ManagedClusterAzureMonitorProfile) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) + populate(objectMap, "appMonitoring", m.AppMonitoring) + populate(objectMap, "containerInsights", m.ContainerInsights) populate(objectMap, "metrics", m.Metrics) return json.Marshal(objectMap) } @@ -2255,6 +3223,12 @@ func (m *ManagedClusterAzureMonitorProfile) UnmarshalJSON(data []byte) error { for key, val := range rawMsg { var err error switch key { + case "appMonitoring": + err = unpopulate(val, "AppMonitoring", &m.AppMonitoring) + delete(rawMsg, key) + case "containerInsights": + err = unpopulate(val, "ContainerInsights", &m.ContainerInsights) + delete(rawMsg, key) case "metrics": err = unpopulate(val, "Metrics", &m.Metrics) delete(rawMsg, key) @@ -2266,6 +3240,173 @@ func (m *ManagedClusterAzureMonitorProfile) UnmarshalJSON(data []byte) error { return nil } +// MarshalJSON implements the json.Marshaller interface for type ManagedClusterAzureMonitorProfileAppMonitoring. +func (m ManagedClusterAzureMonitorProfileAppMonitoring) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "autoInstrumentation", m.AutoInstrumentation) + populate(objectMap, "openTelemetryLogs", m.OpenTelemetryLogs) + populate(objectMap, "openTelemetryMetrics", m.OpenTelemetryMetrics) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ManagedClusterAzureMonitorProfileAppMonitoring. +func (m *ManagedClusterAzureMonitorProfileAppMonitoring) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", m, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "autoInstrumentation": + err = unpopulate(val, "AutoInstrumentation", &m.AutoInstrumentation) + delete(rawMsg, key) + case "openTelemetryLogs": + err = unpopulate(val, "OpenTelemetryLogs", &m.OpenTelemetryLogs) + delete(rawMsg, key) + case "openTelemetryMetrics": + err = unpopulate(val, "OpenTelemetryMetrics", &m.OpenTelemetryMetrics) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", m, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ManagedClusterAzureMonitorProfileAppMonitoringAutoInstrumentation. +func (m ManagedClusterAzureMonitorProfileAppMonitoringAutoInstrumentation) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "enabled", m.Enabled) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ManagedClusterAzureMonitorProfileAppMonitoringAutoInstrumentation. +func (m *ManagedClusterAzureMonitorProfileAppMonitoringAutoInstrumentation) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", m, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "enabled": + err = unpopulate(val, "Enabled", &m.Enabled) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", m, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ManagedClusterAzureMonitorProfileAppMonitoringOpenTelemetryLogs. +func (m ManagedClusterAzureMonitorProfileAppMonitoringOpenTelemetryLogs) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "enabled", m.Enabled) + populate(objectMap, "port", m.Port) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ManagedClusterAzureMonitorProfileAppMonitoringOpenTelemetryLogs. +func (m *ManagedClusterAzureMonitorProfileAppMonitoringOpenTelemetryLogs) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", m, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "enabled": + err = unpopulate(val, "Enabled", &m.Enabled) + delete(rawMsg, key) + case "port": + err = unpopulate(val, "Port", &m.Port) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", m, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ManagedClusterAzureMonitorProfileAppMonitoringOpenTelemetryMetrics. +func (m ManagedClusterAzureMonitorProfileAppMonitoringOpenTelemetryMetrics) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "enabled", m.Enabled) + populate(objectMap, "port", m.Port) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ManagedClusterAzureMonitorProfileAppMonitoringOpenTelemetryMetrics. +func (m *ManagedClusterAzureMonitorProfileAppMonitoringOpenTelemetryMetrics) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", m, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "enabled": + err = unpopulate(val, "Enabled", &m.Enabled) + delete(rawMsg, key) + case "port": + err = unpopulate(val, "Port", &m.Port) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", m, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ManagedClusterAzureMonitorProfileContainerInsights. +func (m ManagedClusterAzureMonitorProfileContainerInsights) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "disableCustomMetrics", m.DisableCustomMetrics) + populate(objectMap, "disablePrometheusMetricsScraping", m.DisablePrometheusMetricsScraping) + populate(objectMap, "enabled", m.Enabled) + populate(objectMap, "logAnalyticsWorkspaceResourceId", m.LogAnalyticsWorkspaceResourceID) + populate(objectMap, "syslogPort", m.SyslogPort) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ManagedClusterAzureMonitorProfileContainerInsights. +func (m *ManagedClusterAzureMonitorProfileContainerInsights) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", m, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "disableCustomMetrics": + err = unpopulate(val, "DisableCustomMetrics", &m.DisableCustomMetrics) + delete(rawMsg, key) + case "disablePrometheusMetricsScraping": + err = unpopulate(val, "DisablePrometheusMetricsScraping", &m.DisablePrometheusMetricsScraping) + delete(rawMsg, key) + case "enabled": + err = unpopulate(val, "Enabled", &m.Enabled) + delete(rawMsg, key) + case "logAnalyticsWorkspaceResourceId": + err = unpopulate(val, "LogAnalyticsWorkspaceResourceID", &m.LogAnalyticsWorkspaceResourceID) + delete(rawMsg, key) + case "syslogPort": + err = unpopulate(val, "SyslogPort", &m.SyslogPort) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", m, err) + } + } + return nil +} + // MarshalJSON implements the json.Marshaller interface for type ManagedClusterAzureMonitorProfileKubeStateMetrics. func (m ManagedClusterAzureMonitorProfileKubeStateMetrics) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) @@ -2328,6 +3469,37 @@ func (m *ManagedClusterAzureMonitorProfileMetrics) UnmarshalJSON(data []byte) er return nil } +// MarshalJSON implements the json.Marshaller interface for type ManagedClusterBootstrapProfile. +func (m ManagedClusterBootstrapProfile) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "artifactSource", m.ArtifactSource) + populate(objectMap, "containerRegistryId", m.ContainerRegistryID) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ManagedClusterBootstrapProfile. +func (m *ManagedClusterBootstrapProfile) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", m, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "artifactSource": + err = unpopulate(val, "ArtifactSource", &m.ArtifactSource) + delete(rawMsg, key) + case "containerRegistryId": + err = unpopulate(val, "ContainerRegistryID", &m.ContainerRegistryID) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", m, err) + } + } + return nil +} + // MarshalJSON implements the json.Marshaller interface for type ManagedClusterCostAnalysis. func (m ManagedClusterCostAnalysis) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) @@ -2358,6 +3530,7 @@ func (m *ManagedClusterCostAnalysis) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type ManagedClusterHTTPProxyConfig. func (m ManagedClusterHTTPProxyConfig) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) + populate(objectMap, "effectiveNoProxy", m.EffectiveNoProxy) populate(objectMap, "httpProxy", m.HTTPProxy) populate(objectMap, "httpsProxy", m.HTTPSProxy) populate(objectMap, "noProxy", m.NoProxy) @@ -2374,6 +3547,9 @@ func (m *ManagedClusterHTTPProxyConfig) UnmarshalJSON(data []byte) error { for key, val := range rawMsg { var err error switch key { + case "effectiveNoProxy": + err = unpopulate(val, "EffectiveNoProxy", &m.EffectiveNoProxy) + delete(rawMsg, key) case "httpProxy": err = unpopulate(val, "HTTPProxy", &m.HTTPProxy) delete(rawMsg, key) @@ -2535,6 +3711,7 @@ func (m ManagedClusterLoadBalancerProfile) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) populate(objectMap, "allocatedOutboundPorts", m.AllocatedOutboundPorts) populate(objectMap, "backendPoolType", m.BackendPoolType) + populate(objectMap, "clusterServiceLoadBalancerHealthProbeMode", m.ClusterServiceLoadBalancerHealthProbeMode) populate(objectMap, "effectiveOutboundIPs", m.EffectiveOutboundIPs) populate(objectMap, "enableMultipleStandardLoadBalancers", m.EnableMultipleStandardLoadBalancers) populate(objectMap, "idleTimeoutInMinutes", m.IdleTimeoutInMinutes) @@ -2559,6 +3736,9 @@ func (m *ManagedClusterLoadBalancerProfile) UnmarshalJSON(data []byte) error { case "backendPoolType": err = unpopulate(val, "BackendPoolType", &m.BackendPoolType) delete(rawMsg, key) + case "clusterServiceLoadBalancerHealthProbeMode": + err = unpopulate(val, "ClusterServiceLoadBalancerHealthProbeMode", &m.ClusterServiceLoadBalancerHealthProbeMode) + delete(rawMsg, key) case "effectiveOutboundIPs": err = unpopulate(val, "EffectiveOutboundIPs", &m.EffectiveOutboundIPs) delete(rawMsg, key) @@ -2697,15 +3877,77 @@ func (m *ManagedClusterManagedOutboundIPProfile) UnmarshalJSON(data []byte) erro return nil } -// MarshalJSON implements the json.Marshaller interface for type ManagedClusterMetricsProfile. -func (m ManagedClusterMetricsProfile) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type ManagedClusterMetricsProfile. +func (m ManagedClusterMetricsProfile) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "costAnalysis", m.CostAnalysis) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ManagedClusterMetricsProfile. +func (m *ManagedClusterMetricsProfile) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", m, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "costAnalysis": + err = unpopulate(val, "CostAnalysis", &m.CostAnalysis) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", m, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ManagedClusterNATGatewayProfile. +func (m ManagedClusterNATGatewayProfile) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "effectiveOutboundIPs", m.EffectiveOutboundIPs) + populate(objectMap, "idleTimeoutInMinutes", m.IdleTimeoutInMinutes) + populate(objectMap, "managedOutboundIPProfile", m.ManagedOutboundIPProfile) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ManagedClusterNATGatewayProfile. +func (m *ManagedClusterNATGatewayProfile) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", m, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "effectiveOutboundIPs": + err = unpopulate(val, "EffectiveOutboundIPs", &m.EffectiveOutboundIPs) + delete(rawMsg, key) + case "idleTimeoutInMinutes": + err = unpopulate(val, "IdleTimeoutInMinutes", &m.IdleTimeoutInMinutes) + delete(rawMsg, key) + case "managedOutboundIPProfile": + err = unpopulate(val, "ManagedOutboundIPProfile", &m.ManagedOutboundIPProfile) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", m, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ManagedClusterNodeProvisioningProfile. +func (m ManagedClusterNodeProvisioningProfile) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "costAnalysis", m.CostAnalysis) + populate(objectMap, "mode", m.Mode) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type ManagedClusterMetricsProfile. -func (m *ManagedClusterMetricsProfile) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type ManagedClusterNodeProvisioningProfile. +func (m *ManagedClusterNodeProvisioningProfile) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { return fmt.Errorf("unmarshalling type %T: %v", m, err) @@ -2713,8 +3955,8 @@ func (m *ManagedClusterMetricsProfile) UnmarshalJSON(data []byte) error { for key, val := range rawMsg { var err error switch key { - case "costAnalysis": - err = unpopulate(val, "CostAnalysis", &m.CostAnalysis) + case "mode": + err = unpopulate(val, "Mode", &m.Mode) delete(rawMsg, key) } if err != nil { @@ -2724,17 +3966,15 @@ func (m *ManagedClusterMetricsProfile) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type ManagedClusterNATGatewayProfile. -func (m ManagedClusterNATGatewayProfile) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type ManagedClusterNodeResourceGroupProfile. +func (m ManagedClusterNodeResourceGroupProfile) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "effectiveOutboundIPs", m.EffectiveOutboundIPs) - populate(objectMap, "idleTimeoutInMinutes", m.IdleTimeoutInMinutes) - populate(objectMap, "managedOutboundIPProfile", m.ManagedOutboundIPProfile) + populate(objectMap, "restrictionLevel", m.RestrictionLevel) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type ManagedClusterNATGatewayProfile. -func (m *ManagedClusterNATGatewayProfile) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type ManagedClusterNodeResourceGroupProfile. +func (m *ManagedClusterNodeResourceGroupProfile) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { return fmt.Errorf("unmarshalling type %T: %v", m, err) @@ -2742,14 +3982,8 @@ func (m *ManagedClusterNATGatewayProfile) UnmarshalJSON(data []byte) error { for key, val := range rawMsg { var err error switch key { - case "effectiveOutboundIPs": - err = unpopulate(val, "EffectiveOutboundIPs", &m.EffectiveOutboundIPs) - delete(rawMsg, key) - case "idleTimeoutInMinutes": - err = unpopulate(val, "IdleTimeoutInMinutes", &m.IdleTimeoutInMinutes) - delete(rawMsg, key) - case "managedOutboundIPProfile": - err = unpopulate(val, "ManagedOutboundIPProfile", &m.ManagedOutboundIPProfile) + case "restrictionLevel": + err = unpopulate(val, "RestrictionLevel", &m.RestrictionLevel) delete(rawMsg, key) } if err != nil { @@ -3007,6 +4241,7 @@ func (m *ManagedClusterPodIdentityProvisioningInfo) UnmarshalJSON(data []byte) e // MarshalJSON implements the json.Marshaller interface for type ManagedClusterPoolUpgradeProfile. func (m ManagedClusterPoolUpgradeProfile) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) + populate(objectMap, "componentsByReleases", m.ComponentsByReleases) populate(objectMap, "kubernetesVersion", m.KubernetesVersion) populate(objectMap, "name", m.Name) populate(objectMap, "osType", m.OSType) @@ -3023,6 +4258,9 @@ func (m *ManagedClusterPoolUpgradeProfile) UnmarshalJSON(data []byte) error { for key, val := range rawMsg { var err error switch key { + case "componentsByReleases": + err = unpopulate(val, "ComponentsByReleases", &m.ComponentsByReleases) + delete(rawMsg, key) case "kubernetesVersion": err = unpopulate(val, "KubernetesVersion", &m.KubernetesVersion) delete(rawMsg, key) @@ -3081,14 +4319,18 @@ func (m ManagedClusterProperties) MarshalJSON() ([]byte, error) { populate(objectMap, "apiServerAccessProfile", m.APIServerAccessProfile) populate(objectMap, "addonProfiles", m.AddonProfiles) populate(objectMap, "agentPoolProfiles", m.AgentPoolProfiles) + populate(objectMap, "aiToolchainOperatorProfile", m.AiToolchainOperatorProfile) populate(objectMap, "autoScalerProfile", m.AutoScalerProfile) populate(objectMap, "autoUpgradeProfile", m.AutoUpgradeProfile) populate(objectMap, "azureMonitorProfile", m.AzureMonitorProfile) populate(objectMap, "azurePortalFQDN", m.AzurePortalFQDN) + populate(objectMap, "bootstrapProfile", m.BootstrapProfile) + populate(objectMap, "creationData", m.CreationData) populate(objectMap, "currentKubernetesVersion", m.CurrentKubernetesVersion) populate(objectMap, "dnsPrefix", m.DNSPrefix) populate(objectMap, "disableLocalAccounts", m.DisableLocalAccounts) populate(objectMap, "diskEncryptionSetID", m.DiskEncryptionSetID) + populate(objectMap, "enableNamespaceResources", m.EnableNamespaceResources) populate(objectMap, "enablePodSecurityPolicy", m.EnablePodSecurityPolicy) populate(objectMap, "enableRBAC", m.EnableRBAC) populate(objectMap, "fqdn", m.Fqdn) @@ -3101,7 +4343,9 @@ func (m ManagedClusterProperties) MarshalJSON() ([]byte, error) { populate(objectMap, "maxAgentPools", m.MaxAgentPools) populate(objectMap, "metricsProfile", m.MetricsProfile) populate(objectMap, "networkProfile", m.NetworkProfile) + populate(objectMap, "nodeProvisioningProfile", m.NodeProvisioningProfile) populate(objectMap, "nodeResourceGroup", m.NodeResourceGroup) + populate(objectMap, "nodeResourceGroupProfile", m.NodeResourceGroupProfile) populate(objectMap, "oidcIssuerProfile", m.OidcIssuerProfile) populate(objectMap, "podIdentityProfile", m.PodIdentityProfile) populate(objectMap, "powerState", m.PowerState) @@ -3110,6 +4354,7 @@ func (m ManagedClusterProperties) MarshalJSON() ([]byte, error) { populate(objectMap, "provisioningState", m.ProvisioningState) populate(objectMap, "publicNetworkAccess", m.PublicNetworkAccess) populate(objectMap, "resourceUID", m.ResourceUID) + populate(objectMap, "safeguardsProfile", m.SafeguardsProfile) populate(objectMap, "securityProfile", m.SecurityProfile) populate(objectMap, "serviceMeshProfile", m.ServiceMeshProfile) populate(objectMap, "servicePrincipalProfile", m.ServicePrincipalProfile) @@ -3142,6 +4387,9 @@ func (m *ManagedClusterProperties) UnmarshalJSON(data []byte) error { case "agentPoolProfiles": err = unpopulate(val, "AgentPoolProfiles", &m.AgentPoolProfiles) delete(rawMsg, key) + case "aiToolchainOperatorProfile": + err = unpopulate(val, "AiToolchainOperatorProfile", &m.AiToolchainOperatorProfile) + delete(rawMsg, key) case "autoScalerProfile": err = unpopulate(val, "AutoScalerProfile", &m.AutoScalerProfile) delete(rawMsg, key) @@ -3154,6 +4402,12 @@ func (m *ManagedClusterProperties) UnmarshalJSON(data []byte) error { case "azurePortalFQDN": err = unpopulate(val, "AzurePortalFQDN", &m.AzurePortalFQDN) delete(rawMsg, key) + case "bootstrapProfile": + err = unpopulate(val, "BootstrapProfile", &m.BootstrapProfile) + delete(rawMsg, key) + case "creationData": + err = unpopulate(val, "CreationData", &m.CreationData) + delete(rawMsg, key) case "currentKubernetesVersion": err = unpopulate(val, "CurrentKubernetesVersion", &m.CurrentKubernetesVersion) delete(rawMsg, key) @@ -3166,6 +4420,9 @@ func (m *ManagedClusterProperties) UnmarshalJSON(data []byte) error { case "diskEncryptionSetID": err = unpopulate(val, "DiskEncryptionSetID", &m.DiskEncryptionSetID) delete(rawMsg, key) + case "enableNamespaceResources": + err = unpopulate(val, "EnableNamespaceResources", &m.EnableNamespaceResources) + delete(rawMsg, key) case "enablePodSecurityPolicy": err = unpopulate(val, "EnablePodSecurityPolicy", &m.EnablePodSecurityPolicy) delete(rawMsg, key) @@ -3202,9 +4459,15 @@ func (m *ManagedClusterProperties) UnmarshalJSON(data []byte) error { case "networkProfile": err = unpopulate(val, "NetworkProfile", &m.NetworkProfile) delete(rawMsg, key) + case "nodeProvisioningProfile": + err = unpopulate(val, "NodeProvisioningProfile", &m.NodeProvisioningProfile) + delete(rawMsg, key) case "nodeResourceGroup": err = unpopulate(val, "NodeResourceGroup", &m.NodeResourceGroup) delete(rawMsg, key) + case "nodeResourceGroupProfile": + err = unpopulate(val, "NodeResourceGroupProfile", &m.NodeResourceGroupProfile) + delete(rawMsg, key) case "oidcIssuerProfile": err = unpopulate(val, "OidcIssuerProfile", &m.OidcIssuerProfile) delete(rawMsg, key) @@ -3229,6 +4492,9 @@ func (m *ManagedClusterProperties) UnmarshalJSON(data []byte) error { case "resourceUID": err = unpopulate(val, "ResourceUID", &m.ResourceUID) delete(rawMsg, key) + case "safeguardsProfile": + err = unpopulate(val, "SafeguardsProfile", &m.SafeguardsProfile) + delete(rawMsg, key) case "securityProfile": err = unpopulate(val, "SecurityProfile", &m.SecurityProfile) delete(rawMsg, key) @@ -3364,6 +4630,45 @@ func (m *ManagedClusterPropertiesAutoScalerProfile) UnmarshalJSON(data []byte) e return nil } +// MarshalJSON implements the json.Marshaller interface for type ManagedClusterPropertiesForSnapshot. +func (m ManagedClusterPropertiesForSnapshot) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "enableRbac", m.EnableRbac) + populate(objectMap, "kubernetesVersion", m.KubernetesVersion) + populate(objectMap, "networkProfile", m.NetworkProfile) + populate(objectMap, "sku", m.SKU) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ManagedClusterPropertiesForSnapshot. +func (m *ManagedClusterPropertiesForSnapshot) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", m, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "enableRbac": + err = unpopulate(val, "EnableRbac", &m.EnableRbac) + delete(rawMsg, key) + case "kubernetesVersion": + err = unpopulate(val, "KubernetesVersion", &m.KubernetesVersion) + delete(rawMsg, key) + case "networkProfile": + err = unpopulate(val, "NetworkProfile", &m.NetworkProfile) + delete(rawMsg, key) + case "sku": + err = unpopulate(val, "SKU", &m.SKU) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", m, err) + } + } + return nil +} + // MarshalJSON implements the json.Marshaller interface for type ManagedClusterSKU. func (m ManagedClusterSKU) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) @@ -3399,8 +4704,17 @@ func (m *ManagedClusterSKU) UnmarshalJSON(data []byte) error { func (m ManagedClusterSecurityProfile) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) populate(objectMap, "azureKeyVaultKms", m.AzureKeyVaultKms) + populateByteArray(objectMap, "customCATrustCertificates", m.CustomCATrustCertificates, func() any { + encodedValue := make([]string, len(m.CustomCATrustCertificates)) + for i := 0; i < len(m.CustomCATrustCertificates); i++ { + encodedValue[i] = runtime.EncodeByteArray(m.CustomCATrustCertificates[i], runtime.Base64StdFormat) + } + return encodedValue + }) populate(objectMap, "defender", m.Defender) populate(objectMap, "imageCleaner", m.ImageCleaner) + populate(objectMap, "imageIntegrity", m.ImageIntegrity) + populate(objectMap, "nodeRestriction", m.NodeRestriction) populate(objectMap, "workloadIdentity", m.WorkloadIdentity) return json.Marshal(objectMap) } @@ -3417,12 +4731,28 @@ func (m *ManagedClusterSecurityProfile) UnmarshalJSON(data []byte) error { case "azureKeyVaultKms": err = unpopulate(val, "AzureKeyVaultKms", &m.AzureKeyVaultKms) delete(rawMsg, key) + case "customCATrustCertificates": + var encodedValue []string + err = unpopulate(val, "CustomCATrustCertificates", &encodedValue) + if err == nil && len(encodedValue) > 0 { + m.CustomCATrustCertificates = make([][]byte, len(encodedValue)) + for i := 0; i < len(encodedValue) && err == nil; i++ { + err = runtime.DecodeByteArray(encodedValue[i], &m.CustomCATrustCertificates[i], runtime.Base64StdFormat) + } + } + delete(rawMsg, key) case "defender": err = unpopulate(val, "Defender", &m.Defender) delete(rawMsg, key) case "imageCleaner": err = unpopulate(val, "ImageCleaner", &m.ImageCleaner) delete(rawMsg, key) + case "imageIntegrity": + err = unpopulate(val, "ImageIntegrity", &m.ImageIntegrity) + delete(rawMsg, key) + case "nodeRestriction": + err = unpopulate(val, "NodeRestriction", &m.NodeRestriction) + delete(rawMsg, key) case "workloadIdentity": err = unpopulate(val, "WorkloadIdentity", &m.WorkloadIdentity) delete(rawMsg, key) @@ -3492,16 +4822,210 @@ func (m *ManagedClusterSecurityProfileDefenderSecurityMonitoring) UnmarshalJSON( return nil } -// MarshalJSON implements the json.Marshaller interface for type ManagedClusterSecurityProfileImageCleaner. -func (m ManagedClusterSecurityProfileImageCleaner) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type ManagedClusterSecurityProfileImageCleaner. +func (m ManagedClusterSecurityProfileImageCleaner) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "enabled", m.Enabled) + populate(objectMap, "intervalHours", m.IntervalHours) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ManagedClusterSecurityProfileImageCleaner. +func (m *ManagedClusterSecurityProfileImageCleaner) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", m, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "enabled": + err = unpopulate(val, "Enabled", &m.Enabled) + delete(rawMsg, key) + case "intervalHours": + err = unpopulate(val, "IntervalHours", &m.IntervalHours) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", m, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ManagedClusterSecurityProfileImageIntegrity. +func (m ManagedClusterSecurityProfileImageIntegrity) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "enabled", m.Enabled) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ManagedClusterSecurityProfileImageIntegrity. +func (m *ManagedClusterSecurityProfileImageIntegrity) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", m, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "enabled": + err = unpopulate(val, "Enabled", &m.Enabled) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", m, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ManagedClusterSecurityProfileNodeRestriction. +func (m ManagedClusterSecurityProfileNodeRestriction) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "enabled", m.Enabled) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ManagedClusterSecurityProfileNodeRestriction. +func (m *ManagedClusterSecurityProfileNodeRestriction) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", m, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "enabled": + err = unpopulate(val, "Enabled", &m.Enabled) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", m, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ManagedClusterSecurityProfileWorkloadIdentity. +func (m ManagedClusterSecurityProfileWorkloadIdentity) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "enabled", m.Enabled) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ManagedClusterSecurityProfileWorkloadIdentity. +func (m *ManagedClusterSecurityProfileWorkloadIdentity) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", m, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "enabled": + err = unpopulate(val, "Enabled", &m.Enabled) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", m, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ManagedClusterServicePrincipalProfile. +func (m ManagedClusterServicePrincipalProfile) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "clientId", m.ClientID) + populate(objectMap, "secret", m.Secret) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ManagedClusterServicePrincipalProfile. +func (m *ManagedClusterServicePrincipalProfile) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", m, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "clientId": + err = unpopulate(val, "ClientID", &m.ClientID) + delete(rawMsg, key) + case "secret": + err = unpopulate(val, "Secret", &m.Secret) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", m, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ManagedClusterSnapshot. +func (m ManagedClusterSnapshot) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "id", m.ID) + populate(objectMap, "location", m.Location) + populate(objectMap, "name", m.Name) + populate(objectMap, "properties", m.Properties) + populate(objectMap, "systemData", m.SystemData) + populate(objectMap, "tags", m.Tags) + populate(objectMap, "type", m.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ManagedClusterSnapshot. +func (m *ManagedClusterSnapshot) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", m, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "id": + err = unpopulate(val, "ID", &m.ID) + delete(rawMsg, key) + case "location": + err = unpopulate(val, "Location", &m.Location) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &m.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &m.Properties) + delete(rawMsg, key) + case "systemData": + err = unpopulate(val, "SystemData", &m.SystemData) + delete(rawMsg, key) + case "tags": + err = unpopulate(val, "Tags", &m.Tags) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &m.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", m, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ManagedClusterSnapshotListResult. +func (m ManagedClusterSnapshotListResult) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "enabled", m.Enabled) - populate(objectMap, "intervalHours", m.IntervalHours) + populate(objectMap, "nextLink", m.NextLink) + populate(objectMap, "value", m.Value) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type ManagedClusterSecurityProfileImageCleaner. -func (m *ManagedClusterSecurityProfileImageCleaner) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type ManagedClusterSnapshotListResult. +func (m *ManagedClusterSnapshotListResult) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { return fmt.Errorf("unmarshalling type %T: %v", m, err) @@ -3509,11 +5033,11 @@ func (m *ManagedClusterSecurityProfileImageCleaner) UnmarshalJSON(data []byte) e for key, val := range rawMsg { var err error switch key { - case "enabled": - err = unpopulate(val, "Enabled", &m.Enabled) + case "nextLink": + err = unpopulate(val, "NextLink", &m.NextLink) delete(rawMsg, key) - case "intervalHours": - err = unpopulate(val, "IntervalHours", &m.IntervalHours) + case "value": + err = unpopulate(val, "Value", &m.Value) delete(rawMsg, key) } if err != nil { @@ -3523,15 +5047,17 @@ func (m *ManagedClusterSecurityProfileImageCleaner) UnmarshalJSON(data []byte) e return nil } -// MarshalJSON implements the json.Marshaller interface for type ManagedClusterSecurityProfileWorkloadIdentity. -func (m ManagedClusterSecurityProfileWorkloadIdentity) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type ManagedClusterSnapshotProperties. +func (m ManagedClusterSnapshotProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "enabled", m.Enabled) + populate(objectMap, "creationData", m.CreationData) + populate(objectMap, "managedClusterPropertiesReadOnly", m.ManagedClusterPropertiesReadOnly) + populate(objectMap, "snapshotType", m.SnapshotType) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type ManagedClusterSecurityProfileWorkloadIdentity. -func (m *ManagedClusterSecurityProfileWorkloadIdentity) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type ManagedClusterSnapshotProperties. +func (m *ManagedClusterSnapshotProperties) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { return fmt.Errorf("unmarshalling type %T: %v", m, err) @@ -3539,8 +5065,14 @@ func (m *ManagedClusterSecurityProfileWorkloadIdentity) UnmarshalJSON(data []byt for key, val := range rawMsg { var err error switch key { - case "enabled": - err = unpopulate(val, "Enabled", &m.Enabled) + case "creationData": + err = unpopulate(val, "CreationData", &m.CreationData) + delete(rawMsg, key) + case "managedClusterPropertiesReadOnly": + err = unpopulate(val, "ManagedClusterPropertiesReadOnly", &m.ManagedClusterPropertiesReadOnly) + delete(rawMsg, key) + case "snapshotType": + err = unpopulate(val, "SnapshotType", &m.SnapshotType) delete(rawMsg, key) } if err != nil { @@ -3550,16 +5082,15 @@ func (m *ManagedClusterSecurityProfileWorkloadIdentity) UnmarshalJSON(data []byt return nil } -// MarshalJSON implements the json.Marshaller interface for type ManagedClusterServicePrincipalProfile. -func (m ManagedClusterServicePrincipalProfile) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type ManagedClusterStaticEgressGatewayProfile. +func (m ManagedClusterStaticEgressGatewayProfile) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "clientId", m.ClientID) - populate(objectMap, "secret", m.Secret) + populate(objectMap, "enabled", m.Enabled) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type ManagedClusterServicePrincipalProfile. -func (m *ManagedClusterServicePrincipalProfile) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type ManagedClusterStaticEgressGatewayProfile. +func (m *ManagedClusterStaticEgressGatewayProfile) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { return fmt.Errorf("unmarshalling type %T: %v", m, err) @@ -3567,11 +5098,8 @@ func (m *ManagedClusterServicePrincipalProfile) UnmarshalJSON(data []byte) error for key, val := range rawMsg { var err error switch key { - case "clientId": - err = unpopulate(val, "ClientID", &m.ClientID) - delete(rawMsg, key) - case "secret": - err = unpopulate(val, "Secret", &m.Secret) + case "enabled": + err = unpopulate(val, "Enabled", &m.Enabled) delete(rawMsg, key) } if err != nil { @@ -3651,6 +5179,7 @@ func (m *ManagedClusterStorageProfileBlobCSIDriver) UnmarshalJSON(data []byte) e func (m ManagedClusterStorageProfileDiskCSIDriver) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) populate(objectMap, "enabled", m.Enabled) + populate(objectMap, "version", m.Version) return json.Marshal(objectMap) } @@ -3666,6 +5195,9 @@ func (m *ManagedClusterStorageProfileDiskCSIDriver) UnmarshalJSON(data []byte) e case "enabled": err = unpopulate(val, "Enabled", &m.Enabled) delete(rawMsg, key) + case "version": + err = unpopulate(val, "Version", &m.Version) + delete(rawMsg, key) } if err != nil { return fmt.Errorf("unmarshalling type %T: %v", m, err) @@ -3902,6 +5434,7 @@ func (m *ManagedClusterWorkloadAutoScalerProfileKeda) UnmarshalJSON(data []byte) // MarshalJSON implements the json.Marshaller interface for type ManagedClusterWorkloadAutoScalerProfileVerticalPodAutoscaler. func (m ManagedClusterWorkloadAutoScalerProfileVerticalPodAutoscaler) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) + populate(objectMap, "addonAutoscaling", m.AddonAutoscaling) populate(objectMap, "enabled", m.Enabled) return json.Marshal(objectMap) } @@ -3915,6 +5448,9 @@ func (m *ManagedClusterWorkloadAutoScalerProfileVerticalPodAutoscaler) Unmarshal for key, val := range rawMsg { var err error switch key { + case "addonAutoscaling": + err = unpopulate(val, "AddonAutoscaling", &m.AddonAutoscaling) + delete(rawMsg, key) case "enabled": err = unpopulate(val, "Enabled", &m.Enabled) delete(rawMsg, key) @@ -3957,6 +5493,37 @@ func (m *ManagedServiceIdentityUserAssignedIdentitiesValue) UnmarshalJSON(data [ return nil } +// MarshalJSON implements the json.Marshaller interface for type ManualScaleProfile. +func (m ManualScaleProfile) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "count", m.Count) + populate(objectMap, "sizes", m.Sizes) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ManualScaleProfile. +func (m *ManualScaleProfile) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", m, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "count": + err = unpopulate(val, "Count", &m.Count) + delete(rawMsg, key) + case "sizes": + err = unpopulate(val, "Sizes", &m.Sizes) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", m, err) + } + } + return nil +} + // MarshalJSON implements the json.Marshaller interface for type MeshRevision. func (m MeshRevision) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) @@ -4205,8 +5772,10 @@ func (m *MeshUpgradeProfileProperties) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type NetworkProfile. func (n NetworkProfile) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) + populate(objectMap, "advancedNetworking", n.AdvancedNetworking) populate(objectMap, "dnsServiceIP", n.DNSServiceIP) populate(objectMap, "ipFamilies", n.IPFamilies) + populate(objectMap, "kubeProxyConfig", n.KubeProxyConfig) populate(objectMap, "loadBalancerProfile", n.LoadBalancerProfile) populate(objectMap, "loadBalancerSku", n.LoadBalancerSKU) populate(objectMap, "natGatewayProfile", n.NatGatewayProfile) @@ -4218,82 +5787,300 @@ func (n NetworkProfile) MarshalJSON() ([]byte, error) { populate(objectMap, "outboundType", n.OutboundType) populate(objectMap, "podCidr", n.PodCidr) populate(objectMap, "podCidrs", n.PodCidrs) + populate(objectMap, "podLinkLocalAccess", n.PodLinkLocalAccess) populate(objectMap, "serviceCidr", n.ServiceCidr) populate(objectMap, "serviceCidrs", n.ServiceCidrs) + populate(objectMap, "staticEgressGatewayProfile", n.StaticEgressGatewayProfile) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type NetworkProfile. +func (n *NetworkProfile) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", n, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "advancedNetworking": + err = unpopulate(val, "AdvancedNetworking", &n.AdvancedNetworking) + delete(rawMsg, key) + case "dnsServiceIP": + err = unpopulate(val, "DNSServiceIP", &n.DNSServiceIP) + delete(rawMsg, key) + case "ipFamilies": + err = unpopulate(val, "IPFamilies", &n.IPFamilies) + delete(rawMsg, key) + case "kubeProxyConfig": + err = unpopulate(val, "KubeProxyConfig", &n.KubeProxyConfig) + delete(rawMsg, key) + case "loadBalancerProfile": + err = unpopulate(val, "LoadBalancerProfile", &n.LoadBalancerProfile) + delete(rawMsg, key) + case "loadBalancerSku": + err = unpopulate(val, "LoadBalancerSKU", &n.LoadBalancerSKU) + delete(rawMsg, key) + case "natGatewayProfile": + err = unpopulate(val, "NatGatewayProfile", &n.NatGatewayProfile) + delete(rawMsg, key) + case "networkDataplane": + err = unpopulate(val, "NetworkDataplane", &n.NetworkDataplane) + delete(rawMsg, key) + case "networkMode": + err = unpopulate(val, "NetworkMode", &n.NetworkMode) + delete(rawMsg, key) + case "networkPlugin": + err = unpopulate(val, "NetworkPlugin", &n.NetworkPlugin) + delete(rawMsg, key) + case "networkPluginMode": + err = unpopulate(val, "NetworkPluginMode", &n.NetworkPluginMode) + delete(rawMsg, key) + case "networkPolicy": + err = unpopulate(val, "NetworkPolicy", &n.NetworkPolicy) + delete(rawMsg, key) + case "outboundType": + err = unpopulate(val, "OutboundType", &n.OutboundType) + delete(rawMsg, key) + case "podCidr": + err = unpopulate(val, "PodCidr", &n.PodCidr) + delete(rawMsg, key) + case "podCidrs": + err = unpopulate(val, "PodCidrs", &n.PodCidrs) + delete(rawMsg, key) + case "podLinkLocalAccess": + err = unpopulate(val, "PodLinkLocalAccess", &n.PodLinkLocalAccess) + delete(rawMsg, key) + case "serviceCidr": + err = unpopulate(val, "ServiceCidr", &n.ServiceCidr) + delete(rawMsg, key) + case "serviceCidrs": + err = unpopulate(val, "ServiceCidrs", &n.ServiceCidrs) + delete(rawMsg, key) + case "staticEgressGatewayProfile": + err = unpopulate(val, "StaticEgressGatewayProfile", &n.StaticEgressGatewayProfile) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", n, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type NetworkProfileForSnapshot. +func (n NetworkProfileForSnapshot) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "loadBalancerSku", n.LoadBalancerSKU) + populate(objectMap, "networkMode", n.NetworkMode) + populate(objectMap, "networkPlugin", n.NetworkPlugin) + populate(objectMap, "networkPluginMode", n.NetworkPluginMode) + populate(objectMap, "networkPolicy", n.NetworkPolicy) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type NetworkProfileForSnapshot. +func (n *NetworkProfileForSnapshot) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", n, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "loadBalancerSku": + err = unpopulate(val, "LoadBalancerSKU", &n.LoadBalancerSKU) + delete(rawMsg, key) + case "networkMode": + err = unpopulate(val, "NetworkMode", &n.NetworkMode) + delete(rawMsg, key) + case "networkPlugin": + err = unpopulate(val, "NetworkPlugin", &n.NetworkPlugin) + delete(rawMsg, key) + case "networkPluginMode": + err = unpopulate(val, "NetworkPluginMode", &n.NetworkPluginMode) + delete(rawMsg, key) + case "networkPolicy": + err = unpopulate(val, "NetworkPolicy", &n.NetworkPolicy) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", n, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type NetworkProfileKubeProxyConfig. +func (n NetworkProfileKubeProxyConfig) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "enabled", n.Enabled) + populate(objectMap, "ipvsConfig", n.IpvsConfig) + populate(objectMap, "mode", n.Mode) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type NetworkProfileKubeProxyConfig. +func (n *NetworkProfileKubeProxyConfig) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", n, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "enabled": + err = unpopulate(val, "Enabled", &n.Enabled) + delete(rawMsg, key) + case "ipvsConfig": + err = unpopulate(val, "IpvsConfig", &n.IpvsConfig) + delete(rawMsg, key) + case "mode": + err = unpopulate(val, "Mode", &n.Mode) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", n, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type NetworkProfileKubeProxyConfigIpvsConfig. +func (n NetworkProfileKubeProxyConfigIpvsConfig) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "scheduler", n.Scheduler) + populate(objectMap, "tcpFinTimeoutSeconds", n.TCPFinTimeoutSeconds) + populate(objectMap, "tcpTimeoutSeconds", n.TCPTimeoutSeconds) + populate(objectMap, "udpTimeoutSeconds", n.UDPTimeoutSeconds) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type NetworkProfileKubeProxyConfigIpvsConfig. +func (n *NetworkProfileKubeProxyConfigIpvsConfig) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", n, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "scheduler": + err = unpopulate(val, "Scheduler", &n.Scheduler) + delete(rawMsg, key) + case "tcpFinTimeoutSeconds": + err = unpopulate(val, "TCPFinTimeoutSeconds", &n.TCPFinTimeoutSeconds) + delete(rawMsg, key) + case "tcpTimeoutSeconds": + err = unpopulate(val, "TCPTimeoutSeconds", &n.TCPTimeoutSeconds) + delete(rawMsg, key) + case "udpTimeoutSeconds": + err = unpopulate(val, "UDPTimeoutSeconds", &n.UDPTimeoutSeconds) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", n, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type OperationListResult. +func (o OperationListResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "value", o.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type OperationListResult. +func (o *OperationListResult) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", o, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "value": + err = unpopulate(val, "Value", &o.Value) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", o, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type OperationStatusResult. +func (o OperationStatusResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populateDateTimeRFC3339(objectMap, "endTime", o.EndTime) + populate(objectMap, "error", o.Error) + populate(objectMap, "id", o.ID) + populate(objectMap, "name", o.Name) + populate(objectMap, "operations", o.Operations) + populate(objectMap, "percentComplete", o.PercentComplete) + populate(objectMap, "resourceId", o.ResourceID) + populateDateTimeRFC3339(objectMap, "startTime", o.StartTime) + populate(objectMap, "status", o.Status) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type NetworkProfile. -func (n *NetworkProfile) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type OperationStatusResult. +func (o *OperationStatusResult) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", n, err) + return fmt.Errorf("unmarshalling type %T: %v", o, err) } for key, val := range rawMsg { var err error switch key { - case "dnsServiceIP": - err = unpopulate(val, "DNSServiceIP", &n.DNSServiceIP) - delete(rawMsg, key) - case "ipFamilies": - err = unpopulate(val, "IPFamilies", &n.IPFamilies) - delete(rawMsg, key) - case "loadBalancerProfile": - err = unpopulate(val, "LoadBalancerProfile", &n.LoadBalancerProfile) - delete(rawMsg, key) - case "loadBalancerSku": - err = unpopulate(val, "LoadBalancerSKU", &n.LoadBalancerSKU) - delete(rawMsg, key) - case "natGatewayProfile": - err = unpopulate(val, "NatGatewayProfile", &n.NatGatewayProfile) - delete(rawMsg, key) - case "networkDataplane": - err = unpopulate(val, "NetworkDataplane", &n.NetworkDataplane) - delete(rawMsg, key) - case "networkMode": - err = unpopulate(val, "NetworkMode", &n.NetworkMode) + case "endTime": + err = unpopulateDateTimeRFC3339(val, "EndTime", &o.EndTime) delete(rawMsg, key) - case "networkPlugin": - err = unpopulate(val, "NetworkPlugin", &n.NetworkPlugin) + case "error": + err = unpopulate(val, "Error", &o.Error) delete(rawMsg, key) - case "networkPluginMode": - err = unpopulate(val, "NetworkPluginMode", &n.NetworkPluginMode) + case "id": + err = unpopulate(val, "ID", &o.ID) delete(rawMsg, key) - case "networkPolicy": - err = unpopulate(val, "NetworkPolicy", &n.NetworkPolicy) + case "name": + err = unpopulate(val, "Name", &o.Name) delete(rawMsg, key) - case "outboundType": - err = unpopulate(val, "OutboundType", &n.OutboundType) + case "operations": + err = unpopulate(val, "Operations", &o.Operations) delete(rawMsg, key) - case "podCidr": - err = unpopulate(val, "PodCidr", &n.PodCidr) + case "percentComplete": + err = unpopulate(val, "PercentComplete", &o.PercentComplete) delete(rawMsg, key) - case "podCidrs": - err = unpopulate(val, "PodCidrs", &n.PodCidrs) + case "resourceId": + err = unpopulate(val, "ResourceID", &o.ResourceID) delete(rawMsg, key) - case "serviceCidr": - err = unpopulate(val, "ServiceCidr", &n.ServiceCidr) + case "startTime": + err = unpopulateDateTimeRFC3339(val, "StartTime", &o.StartTime) delete(rawMsg, key) - case "serviceCidrs": - err = unpopulate(val, "ServiceCidrs", &n.ServiceCidrs) + case "status": + err = unpopulate(val, "Status", &o.Status) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", n, err) + return fmt.Errorf("unmarshalling type %T: %v", o, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type OperationListResult. -func (o OperationListResult) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type OperationStatusResultList. +func (o OperationStatusResultList) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) + populate(objectMap, "nextLink", o.NextLink) populate(objectMap, "value", o.Value) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type OperationListResult. -func (o *OperationListResult) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type OperationStatusResultList. +func (o *OperationStatusResultList) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { return fmt.Errorf("unmarshalling type %T: %v", o, err) @@ -4301,6 +6088,9 @@ func (o *OperationListResult) UnmarshalJSON(data []byte) error { for key, val := range rawMsg { var err error switch key { + case "nextLink": + err = unpopulate(val, "NextLink", &o.NextLink) + delete(rawMsg, key) case "value": err = unpopulate(val, "Value", &o.Value) delete(rawMsg, key) @@ -4743,6 +6533,33 @@ func (p *PrivateLinkServiceConnectionState) UnmarshalJSON(data []byte) error { return nil } +// MarshalJSON implements the json.Marshaller interface for type RebalanceLoadBalancersRequestBody. +func (r RebalanceLoadBalancersRequestBody) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "loadBalancerNames", r.LoadBalancerNames) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type RebalanceLoadBalancersRequestBody. +func (r *RebalanceLoadBalancersRequestBody) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", r, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "loadBalancerNames": + err = unpopulate(val, "LoadBalancerNames", &r.LoadBalancerNames) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", r, err) + } + } + return nil +} + // MarshalJSON implements the json.Marshaller interface for type RelativeMonthlySchedule. func (r RelativeMonthlySchedule) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) @@ -4925,6 +6742,181 @@ func (s *SSHPublicKey) UnmarshalJSON(data []byte) error { return nil } +// MarshalJSON implements the json.Marshaller interface for type SafeguardsAvailableVersion. +func (s SafeguardsAvailableVersion) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "id", s.ID) + populate(objectMap, "name", s.Name) + populate(objectMap, "properties", s.Properties) + populate(objectMap, "systemData", s.SystemData) + populate(objectMap, "type", s.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type SafeguardsAvailableVersion. +func (s *SafeguardsAvailableVersion) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "id": + err = unpopulate(val, "ID", &s.ID) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &s.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &s.Properties) + delete(rawMsg, key) + case "systemData": + err = unpopulate(val, "SystemData", &s.SystemData) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &s.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type SafeguardsAvailableVersionsList. +func (s SafeguardsAvailableVersionsList) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "nextLink", s.NextLink) + populate(objectMap, "value", s.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type SafeguardsAvailableVersionsList. +func (s *SafeguardsAvailableVersionsList) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "nextLink": + err = unpopulate(val, "NextLink", &s.NextLink) + delete(rawMsg, key) + case "value": + err = unpopulate(val, "Value", &s.Value) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type SafeguardsAvailableVersionsProperties. +func (s SafeguardsAvailableVersionsProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "isDefaultVersion", s.IsDefaultVersion) + populate(objectMap, "support", s.Support) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type SafeguardsAvailableVersionsProperties. +func (s *SafeguardsAvailableVersionsProperties) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "isDefaultVersion": + err = unpopulate(val, "IsDefaultVersion", &s.IsDefaultVersion) + delete(rawMsg, key) + case "support": + err = unpopulate(val, "Support", &s.Support) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type SafeguardsProfile. +func (s SafeguardsProfile) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "excludedNamespaces", s.ExcludedNamespaces) + populate(objectMap, "level", s.Level) + populate(objectMap, "systemExcludedNamespaces", s.SystemExcludedNamespaces) + populate(objectMap, "version", s.Version) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type SafeguardsProfile. +func (s *SafeguardsProfile) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "excludedNamespaces": + err = unpopulate(val, "ExcludedNamespaces", &s.ExcludedNamespaces) + delete(rawMsg, key) + case "level": + err = unpopulate(val, "Level", &s.Level) + delete(rawMsg, key) + case "systemExcludedNamespaces": + err = unpopulate(val, "SystemExcludedNamespaces", &s.SystemExcludedNamespaces) + delete(rawMsg, key) + case "version": + err = unpopulate(val, "Version", &s.Version) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ScaleProfile. +func (s ScaleProfile) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "autoscale", s.Autoscale) + populate(objectMap, "manual", s.Manual) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ScaleProfile. +func (s *ScaleProfile) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "autoscale": + err = unpopulate(val, "Autoscale", &s.Autoscale) + delete(rawMsg, key) + case "manual": + err = unpopulate(val, "Manual", &s.Manual) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + } + return nil +} + // MarshalJSON implements the json.Marshaller interface for type Schedule. func (s Schedule) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) @@ -5687,6 +7679,64 @@ func (u *UserAssignedIdentity) UnmarshalJSON(data []byte) error { return nil } +// MarshalJSON implements the json.Marshaller interface for type VirtualMachineNodes. +func (v VirtualMachineNodes) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "count", v.Count) + populate(objectMap, "size", v.Size) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type VirtualMachineNodes. +func (v *VirtualMachineNodes) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", v, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "count": + err = unpopulate(val, "Count", &v.Count) + delete(rawMsg, key) + case "size": + err = unpopulate(val, "Size", &v.Size) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", v, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type VirtualMachinesProfile. +func (v VirtualMachinesProfile) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "scale", v.Scale) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type VirtualMachinesProfile. +func (v *VirtualMachinesProfile) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", v, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "scale": + err = unpopulate(val, "Scale", &v.Scale) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", v, err) + } + } + return nil +} + // MarshalJSON implements the json.Marshaller interface for type WeeklySchedule. func (w WeeklySchedule) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) @@ -5763,6 +7813,16 @@ func populate(m map[string]any, k string, v any) { } } +func populateAny(m map[string]any, k string, v any) { + if v == nil { + return + } else if azcore.IsNullValue(v) { + m[k] = nil + } else { + m[k] = v + } +} + func populateByteArray[T any](m map[string]any, k string, b []T, convert func() any) { if azcore.IsNullValue(b) { m[k] = nil diff --git a/sdk/resourcemanager/containerservice/armcontainerservice/operations_client.go b/sdk/resourcemanager/containerservice/armcontainerservice/operations_client.go index 15c7e7441444..4c0fb30feec9 100644 --- a/sdk/resourcemanager/containerservice/armcontainerservice/operations_client.go +++ b/sdk/resourcemanager/containerservice/armcontainerservice/operations_client.go @@ -39,7 +39,7 @@ func NewOperationsClient(credential azcore.TokenCredential, options *arm.ClientO // NewListPager - Gets a list of operations. // -// Generated from API version 2024-05-01 +// Generated from API version 2024-05-02-preview // - options - OperationsClientListOptions contains the optional parameters for the OperationsClient.NewListPager method. func (client *OperationsClient) NewListPager(options *OperationsClientListOptions) *runtime.Pager[OperationsClientListResponse] { return runtime.NewPager(runtime.PagingHandler[OperationsClientListResponse]{ @@ -73,7 +73,7 @@ func (client *OperationsClient) listCreateRequest(ctx context.Context, options * return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-05-02-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/containerservice/armcontainerservice/operations_client_example_test.go b/sdk/resourcemanager/containerservice/armcontainerservice/operations_client_example_test.go index e6eef96c87c8..cd809c0faddf 100644 --- a/sdk/resourcemanager/containerservice/armcontainerservice/operations_client_example_test.go +++ b/sdk/resourcemanager/containerservice/armcontainerservice/operations_client_example_test.go @@ -17,7 +17,7 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/containerservice/armcontainerservice/v6" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/8cbd903b0d037c427def0e8fbf167b26e87bd1a9/specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2024-05-01/examples/Operation_List.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c7b98b36e4023331545051284d8500adf98f02fe/specification/containerservice/resource-manager/Microsoft.ContainerService/aks/preview/2024-05-02-preview/examples/Operation_List.json func ExampleOperationsClient_NewListPager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { diff --git a/sdk/resourcemanager/containerservice/armcontainerservice/operationstatusresult_client.go b/sdk/resourcemanager/containerservice/armcontainerservice/operationstatusresult_client.go new file mode 100644 index 000000000000..54896bab8561 --- /dev/null +++ b/sdk/resourcemanager/containerservice/armcontainerservice/operationstatusresult_client.go @@ -0,0 +1,254 @@ +//go:build go1.18 +// +build go1.18 + +// 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. DO NOT EDIT. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +package armcontainerservice + +import ( + "context" + "errors" + "github.com/Azure/azure-sdk-for-go/sdk/azcore" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" + "net/http" + "net/url" + "strings" +) + +// OperationStatusResultClient contains the methods for the OperationStatusResult group. +// Don't use this type directly, use NewOperationStatusResultClient() instead. +type OperationStatusResultClient struct { + internal *arm.Client + subscriptionID string +} + +// NewOperationStatusResultClient creates a new instance of OperationStatusResultClient with the specified values. +// - subscriptionID - The ID of the target subscription. The value must be an UUID. +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. +func NewOperationStatusResultClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*OperationStatusResultClient, error) { + cl, err := arm.NewClient(moduleName, moduleVersion, credential, options) + if err != nil { + return nil, err + } + client := &OperationStatusResultClient{ + subscriptionID: subscriptionID, + internal: cl, + } + return client, nil +} + +// Get - Get the status of a specific operation in the specified managed cluster. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2024-05-02-preview +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - resourceName - The name of the managed cluster resource. +// - operationID - The ID of an ongoing async operation. +// - options - OperationStatusResultClientGetOptions contains the optional parameters for the OperationStatusResultClient.Get +// method. +func (client *OperationStatusResultClient) Get(ctx context.Context, resourceGroupName string, resourceName string, operationID string, options *OperationStatusResultClientGetOptions) (OperationStatusResultClientGetResponse, error) { + var err error + const operationName = "OperationStatusResultClient.Get" + ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) + ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) + defer func() { endSpan(err) }() + req, err := client.getCreateRequest(ctx, resourceGroupName, resourceName, operationID, options) + if err != nil { + return OperationStatusResultClientGetResponse{}, err + } + httpResp, err := client.internal.Pipeline().Do(req) + if err != nil { + return OperationStatusResultClientGetResponse{}, err + } + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return OperationStatusResultClientGetResponse{}, err + } + resp, err := client.getHandleResponse(httpResp) + return resp, err +} + +// getCreateRequest creates the Get request. +func (client *OperationStatusResultClient) getCreateRequest(ctx context.Context, resourceGroupName string, resourceName string, operationID string, options *OperationStatusResultClientGetOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/operations/{operationId}" + 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 operationID == "" { + return nil, errors.New("parameter operationID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{operationId}", url.PathEscape(operationID)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2024-05-02-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// getHandleResponse handles the Get response. +func (client *OperationStatusResultClient) getHandleResponse(resp *http.Response) (OperationStatusResultClientGetResponse, error) { + result := OperationStatusResultClientGetResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.OperationStatusResult); err != nil { + return OperationStatusResultClientGetResponse{}, err + } + return result, nil +} + +// GetByAgentPool - Get the status of a specific operation in the specified agent pool. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2024-05-02-preview +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - resourceName - The name of the managed cluster resource. +// - agentPoolName - The name of the agent pool. +// - operationID - The ID of an ongoing async operation. +// - options - OperationStatusResultClientGetByAgentPoolOptions contains the optional parameters for the OperationStatusResultClient.GetByAgentPool +// method. +func (client *OperationStatusResultClient) GetByAgentPool(ctx context.Context, resourceGroupName string, resourceName string, agentPoolName string, operationID string, options *OperationStatusResultClientGetByAgentPoolOptions) (OperationStatusResultClientGetByAgentPoolResponse, error) { + var err error + const operationName = "OperationStatusResultClient.GetByAgentPool" + ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) + ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) + defer func() { endSpan(err) }() + req, err := client.getByAgentPoolCreateRequest(ctx, resourceGroupName, resourceName, agentPoolName, operationID, options) + if err != nil { + return OperationStatusResultClientGetByAgentPoolResponse{}, err + } + httpResp, err := client.internal.Pipeline().Do(req) + if err != nil { + return OperationStatusResultClientGetByAgentPoolResponse{}, err + } + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return OperationStatusResultClientGetByAgentPoolResponse{}, err + } + resp, err := client.getByAgentPoolHandleResponse(httpResp) + return resp, err +} + +// getByAgentPoolCreateRequest creates the GetByAgentPool request. +func (client *OperationStatusResultClient) getByAgentPoolCreateRequest(ctx context.Context, resourceGroupName string, resourceName string, agentPoolName string, operationID string, options *OperationStatusResultClientGetByAgentPoolOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools/{agentPoolName}/operations/{operationId}" + 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)) + if operationID == "" { + return nil, errors.New("parameter operationID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{operationId}", url.PathEscape(operationID)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2024-05-02-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// getByAgentPoolHandleResponse handles the GetByAgentPool response. +func (client *OperationStatusResultClient) getByAgentPoolHandleResponse(resp *http.Response) (OperationStatusResultClientGetByAgentPoolResponse, error) { + result := OperationStatusResultClientGetByAgentPoolResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.OperationStatusResult); err != nil { + return OperationStatusResultClientGetByAgentPoolResponse{}, err + } + return result, nil +} + +// NewListPager - Gets a list of operations in the specified managedCluster +// +// Generated from API version 2024-05-02-preview +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - resourceName - The name of the managed cluster resource. +// - options - OperationStatusResultClientListOptions contains the optional parameters for the OperationStatusResultClient.NewListPager +// method. +func (client *OperationStatusResultClient) NewListPager(resourceGroupName string, resourceName string, options *OperationStatusResultClientListOptions) *runtime.Pager[OperationStatusResultClientListResponse] { + return runtime.NewPager(runtime.PagingHandler[OperationStatusResultClientListResponse]{ + More: func(page OperationStatusResultClientListResponse) bool { + return page.NextLink != nil && len(*page.NextLink) > 0 + }, + Fetcher: func(ctx context.Context, page *OperationStatusResultClientListResponse) (OperationStatusResultClientListResponse, error) { + ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, "OperationStatusResultClient.NewListPager") + nextLink := "" + if page != nil { + nextLink = *page.NextLink + } + resp, err := runtime.FetcherForNextLink(ctx, client.internal.Pipeline(), nextLink, func(ctx context.Context) (*policy.Request, error) { + return client.listCreateRequest(ctx, resourceGroupName, resourceName, options) + }, nil) + if err != nil { + return OperationStatusResultClientListResponse{}, err + } + return client.listHandleResponse(resp) + }, + Tracer: client.internal.Tracer(), + }) +} + +// listCreateRequest creates the List request. +func (client *OperationStatusResultClient) listCreateRequest(ctx context.Context, resourceGroupName string, resourceName string, options *OperationStatusResultClientListOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/operations" + 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 := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2024-05-02-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// listHandleResponse handles the List response. +func (client *OperationStatusResultClient) listHandleResponse(resp *http.Response) (OperationStatusResultClientListResponse, error) { + result := OperationStatusResultClientListResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.OperationStatusResultList); err != nil { + return OperationStatusResultClientListResponse{}, err + } + return result, nil +} diff --git a/sdk/resourcemanager/containerservice/armcontainerservice/operationstatusresult_client_example_test.go b/sdk/resourcemanager/containerservice/armcontainerservice/operationstatusresult_client_example_test.go new file mode 100644 index 000000000000..9acd581ef658 --- /dev/null +++ b/sdk/resourcemanager/containerservice/armcontainerservice/operationstatusresult_client_example_test.go @@ -0,0 +1,118 @@ +//go:build go1.18 +// +build go1.18 + +// 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. +// DO NOT EDIT. + +package armcontainerservice_test + +import ( + "context" + "log" + + "github.com/Azure/azure-sdk-for-go/sdk/azidentity" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/containerservice/armcontainerservice/v6" +) + +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c7b98b36e4023331545051284d8500adf98f02fe/specification/containerservice/resource-manager/Microsoft.ContainerService/aks/preview/2024-05-02-preview/examples/OperationStatusResultList.json +func ExampleOperationStatusResultClient_NewListPager() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + clientFactory, err := armcontainerservice.NewClientFactory("", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + pager := clientFactory.NewOperationStatusResultClient().NewListPager("rg1", "clustername1", nil) + for pager.More() { + page, err := pager.NextPage(ctx) + if err != nil { + log.Fatalf("failed to advance page: %v", err) + } + for _, v := range page.Value { + // You could use page here. We use blank identifier for just demo purposes. + _ = v + } + // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. + // page.OperationStatusResultList = armcontainerservice.OperationStatusResultList{ + // Value: []*armcontainerservice.OperationStatusResult{ + // { + // Name: to.Ptr("d11edb09-6e27-429f-9fe5-17baf773bc4a"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/rg1/providers/Microsoft.ContainerService/managedClusters/clustername1/operations/d11edb09-6e27-429f-9fe5-17baf773bc4a"), + // PercentComplete: to.Ptr[float32](40), + // StartTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-07-26T12:14:26.317Z"); return t}()), + // Status: to.Ptr("InProgress"), + // }, + // { + // Name: to.Ptr("d11edb09-6e27-429f-9fe5-17baf773bc4b"), + // EndTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-07-26T12:14:50.317Z"); return t}()), + // Error: &armcontainerservice.ErrorDetail{ + // Code: to.Ptr("ReconcileAgentPoolIdentityError"), + // Message: to.Ptr("Reconcile agent pool nodepool1 identity failed"), + // }, + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/rg1/providers/Microsoft.ContainerService/managedClusters/clustername1/operations/d11edb09-6e27-429f-9fe5-17baf773bc4b"), + // StartTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-07-26T12:14:26.317Z"); return t}()), + // Status: to.Ptr("Failed"), + // }}, + // } + } +} + +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c7b98b36e4023331545051284d8500adf98f02fe/specification/containerservice/resource-manager/Microsoft.ContainerService/aks/preview/2024-05-02-preview/examples/OperationStatusResultGet.json +func ExampleOperationStatusResultClient_Get() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + clientFactory, err := armcontainerservice.NewClientFactory("", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + res, err := clientFactory.NewOperationStatusResultClient().Get(ctx, "rg1", "clustername1", "00000000-0000-0000-0000-000000000001", nil) + if err != nil { + log.Fatalf("failed to finish the request: %v", err) + } + // You could use response here. We use blank identifier for just demo purposes. + _ = res + // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. + // res.OperationStatusResult = armcontainerservice.OperationStatusResult{ + // Name: to.Ptr("00000000-0000-0000-0000-000000000001"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.ContainerService/managedClusters/clustername1/operations/00000000-0000-0000-0000-000000000001"), + // PercentComplete: to.Ptr[float32](40), + // StartTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-07-26T12:14:26.317Z"); return t}()), + // Status: to.Ptr("InProgress"), + // } +} + +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c7b98b36e4023331545051284d8500adf98f02fe/specification/containerservice/resource-manager/Microsoft.ContainerService/aks/preview/2024-05-02-preview/examples/OperationStatusResultGetByAgentPool.json +func ExampleOperationStatusResultClient_GetByAgentPool() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + clientFactory, err := armcontainerservice.NewClientFactory("", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + res, err := clientFactory.NewOperationStatusResultClient().GetByAgentPool(ctx, "rg1", "clustername1", "agentpool1", "00000000-0000-0000-0000-000000000001", nil) + if err != nil { + log.Fatalf("failed to finish the request: %v", err) + } + // You could use response here. We use blank identifier for just demo purposes. + _ = res + // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. + // res.OperationStatusResult = armcontainerservice.OperationStatusResult{ + // Name: to.Ptr("00000000-0000-0000-0000-000000000001"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.ContainerService/managedClusters/clustername1/agentPools/agentpool1/operations/00000000-0000-0000-0000-000000000001"), + // PercentComplete: to.Ptr[float32](40), + // StartTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-07-26T12:14:26.317Z"); return t}()), + // Status: to.Ptr("InProgress"), + // } +} diff --git a/sdk/resourcemanager/containerservice/armcontainerservice/options.go b/sdk/resourcemanager/containerservice/armcontainerservice/options.go index a4b0900cef77..46eafa2c790b 100644 --- a/sdk/resourcemanager/containerservice/armcontainerservice/options.go +++ b/sdk/resourcemanager/containerservice/armcontainerservice/options.go @@ -18,12 +18,31 @@ type AgentPoolsClientBeginAbortLatestOperationOptions struct { // AgentPoolsClientBeginCreateOrUpdateOptions contains the optional parameters for the AgentPoolsClient.BeginCreateOrUpdate // method. type AgentPoolsClientBeginCreateOrUpdateOptions struct { + // The request should only proceed if an entity matches this string. + IfMatch *string + + // The request should only proceed if no entity matches this string. + IfNoneMatch *string + + // Resumes the LRO from the provided token. + ResumeToken string +} + +// AgentPoolsClientBeginDeleteMachinesOptions contains the optional parameters for the AgentPoolsClient.BeginDeleteMachines +// method. +type AgentPoolsClientBeginDeleteMachinesOptions struct { // Resumes the LRO from the provided token. ResumeToken string } // AgentPoolsClientBeginDeleteOptions contains the optional parameters for the AgentPoolsClient.BeginDelete method. type AgentPoolsClientBeginDeleteOptions struct { + // The request should only proceed if an entity matches this string. + IfMatch *string + + // ignore-pod-disruption-budget=true to delete those pods on a node without considering Pod Disruption Budget + IgnorePodDisruptionBudget *bool + // Resumes the LRO from the provided token. ResumeToken string } @@ -56,6 +75,38 @@ type AgentPoolsClientListOptions struct { // placeholder for future optional parameters } +// LoadBalancersClientBeginDeleteOptions contains the optional parameters for the LoadBalancersClient.BeginDelete method. +type LoadBalancersClientBeginDeleteOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// LoadBalancersClientCreateOrUpdateOptions contains the optional parameters for the LoadBalancersClient.CreateOrUpdate method. +type LoadBalancersClientCreateOrUpdateOptions struct { + // placeholder for future optional parameters +} + +// LoadBalancersClientGetOptions contains the optional parameters for the LoadBalancersClient.Get method. +type LoadBalancersClientGetOptions struct { + // placeholder for future optional parameters +} + +// LoadBalancersClientListByManagedClusterOptions contains the optional parameters for the LoadBalancersClient.NewListByManagedClusterPager +// method. +type LoadBalancersClientListByManagedClusterOptions struct { + // placeholder for future optional parameters +} + +// MachinesClientGetOptions contains the optional parameters for the MachinesClient.Get method. +type MachinesClientGetOptions struct { + // placeholder for future optional parameters +} + +// MachinesClientListOptions contains the optional parameters for the MachinesClient.NewListPager method. +type MachinesClientListOptions struct { + // placeholder for future optional parameters +} + // MaintenanceConfigurationsClientCreateOrUpdateOptions contains the optional parameters for the MaintenanceConfigurationsClient.CreateOrUpdate // method. type MaintenanceConfigurationsClientCreateOrUpdateOptions struct { @@ -80,6 +131,41 @@ type MaintenanceConfigurationsClientListByManagedClusterOptions struct { // placeholder for future optional parameters } +// ManagedClusterSnapshotsClientCreateOrUpdateOptions contains the optional parameters for the ManagedClusterSnapshotsClient.CreateOrUpdate +// method. +type ManagedClusterSnapshotsClientCreateOrUpdateOptions struct { + // placeholder for future optional parameters +} + +// ManagedClusterSnapshotsClientDeleteOptions contains the optional parameters for the ManagedClusterSnapshotsClient.Delete +// method. +type ManagedClusterSnapshotsClientDeleteOptions struct { + // placeholder for future optional parameters +} + +// ManagedClusterSnapshotsClientGetOptions contains the optional parameters for the ManagedClusterSnapshotsClient.Get method. +type ManagedClusterSnapshotsClientGetOptions struct { + // placeholder for future optional parameters +} + +// ManagedClusterSnapshotsClientListByResourceGroupOptions contains the optional parameters for the ManagedClusterSnapshotsClient.NewListByResourceGroupPager +// method. +type ManagedClusterSnapshotsClientListByResourceGroupOptions struct { + // placeholder for future optional parameters +} + +// ManagedClusterSnapshotsClientListOptions contains the optional parameters for the ManagedClusterSnapshotsClient.NewListPager +// method. +type ManagedClusterSnapshotsClientListOptions struct { + // placeholder for future optional parameters +} + +// ManagedClusterSnapshotsClientUpdateTagsOptions contains the optional parameters for the ManagedClusterSnapshotsClient.UpdateTags +// method. +type ManagedClusterSnapshotsClientUpdateTagsOptions struct { + // placeholder for future optional parameters +} + // ManagedClustersClientBeginAbortLatestOperationOptions contains the optional parameters for the ManagedClustersClient.BeginAbortLatestOperation // method. type ManagedClustersClientBeginAbortLatestOperationOptions struct { @@ -90,12 +176,31 @@ type ManagedClustersClientBeginAbortLatestOperationOptions struct { // ManagedClustersClientBeginCreateOrUpdateOptions contains the optional parameters for the ManagedClustersClient.BeginCreateOrUpdate // method. type ManagedClustersClientBeginCreateOrUpdateOptions struct { + // The request should only proceed if an entity matches this string. + IfMatch *string + + // The request should only proceed if no entity matches this string. + IfNoneMatch *string + // Resumes the LRO from the provided token. ResumeToken string } // ManagedClustersClientBeginDeleteOptions contains the optional parameters for the ManagedClustersClient.BeginDelete method. type ManagedClustersClientBeginDeleteOptions struct { + // The request should only proceed if an entity matches this string. + IfMatch *string + + // ignore-pod-disruption-budget=true to delete those pods on a node without considering Pod Disruption Budget + IgnorePodDisruptionBudget *bool + + // Resumes the LRO from the provided token. + ResumeToken string +} + +// ManagedClustersClientBeginRebalanceLoadBalancersOptions contains the optional parameters for the ManagedClustersClient.BeginRebalanceLoadBalancers +// method. +type ManagedClustersClientBeginRebalanceLoadBalancersOptions struct { // Resumes the LRO from the provided token. ResumeToken string } @@ -150,6 +255,9 @@ type ManagedClustersClientBeginStopOptions struct { // ManagedClustersClientBeginUpdateTagsOptions contains the optional parameters for the ManagedClustersClient.BeginUpdateTags // method. type ManagedClustersClientBeginUpdateTagsOptions struct { + // The request should only proceed if an entity matches this string. + IfMatch *string + // Resumes the LRO from the provided token. ResumeToken string } @@ -166,6 +274,12 @@ type ManagedClustersClientGetCommandResultOptions struct { // placeholder for future optional parameters } +// ManagedClustersClientGetGuardrailsVersionsOptions contains the optional parameters for the ManagedClustersClient.GetGuardrailsVersions +// method. +type ManagedClustersClientGetGuardrailsVersionsOptions struct { + // placeholder for future optional parameters +} + // ManagedClustersClientGetMeshRevisionProfileOptions contains the optional parameters for the ManagedClustersClient.GetMeshRevisionProfile // method. type ManagedClustersClientGetMeshRevisionProfileOptions struct { @@ -183,6 +297,12 @@ type ManagedClustersClientGetOptions struct { // placeholder for future optional parameters } +// ManagedClustersClientGetSafeguardsVersionsOptions contains the optional parameters for the ManagedClustersClient.GetSafeguardsVersions +// method. +type ManagedClustersClientGetSafeguardsVersionsOptions struct { + // placeholder for future optional parameters +} + // ManagedClustersClientGetUpgradeProfileOptions contains the optional parameters for the ManagedClustersClient.GetUpgradeProfile // method. type ManagedClustersClientGetUpgradeProfileOptions struct { @@ -221,6 +341,12 @@ type ManagedClustersClientListClusterUserCredentialsOptions struct { ServerFqdn *string } +// ManagedClustersClientListGuardrailsVersionsOptions contains the optional parameters for the ManagedClustersClient.NewListGuardrailsVersionsPager +// method. +type ManagedClustersClientListGuardrailsVersionsOptions struct { + // placeholder for future optional parameters +} + // ManagedClustersClientListKubernetesVersionsOptions contains the optional parameters for the ManagedClustersClient.ListKubernetesVersions // method. type ManagedClustersClientListKubernetesVersionsOptions struct { @@ -250,6 +376,29 @@ type ManagedClustersClientListOutboundNetworkDependenciesEndpointsOptions struct // placeholder for future optional parameters } +// ManagedClustersClientListSafeguardsVersionsOptions contains the optional parameters for the ManagedClustersClient.NewListSafeguardsVersionsPager +// method. +type ManagedClustersClientListSafeguardsVersionsOptions struct { + // placeholder for future optional parameters +} + +// OperationStatusResultClientGetByAgentPoolOptions contains the optional parameters for the OperationStatusResultClient.GetByAgentPool +// method. +type OperationStatusResultClientGetByAgentPoolOptions struct { + // placeholder for future optional parameters +} + +// OperationStatusResultClientGetOptions contains the optional parameters for the OperationStatusResultClient.Get method. +type OperationStatusResultClientGetOptions struct { + // placeholder for future optional parameters +} + +// OperationStatusResultClientListOptions contains the optional parameters for the OperationStatusResultClient.NewListPager +// method. +type OperationStatusResultClientListOptions struct { + // placeholder for future optional parameters +} + // OperationsClientListOptions contains the optional parameters for the OperationsClient.NewListPager method. type OperationsClientListOptions struct { // placeholder for future optional parameters diff --git a/sdk/resourcemanager/containerservice/armcontainerservice/privateendpointconnections_client.go b/sdk/resourcemanager/containerservice/armcontainerservice/privateendpointconnections_client.go index 3239edc295cb..93fa0ca25d19 100644 --- a/sdk/resourcemanager/containerservice/armcontainerservice/privateendpointconnections_client.go +++ b/sdk/resourcemanager/containerservice/armcontainerservice/privateendpointconnections_client.go @@ -46,7 +46,7 @@ func NewPrivateEndpointConnectionsClient(subscriptionID string, credential azcor // BeginDelete - Deletes a private endpoint connection. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-05-01 +// Generated from API version 2024-05-02-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - resourceName - The name of the managed cluster resource. // - privateEndpointConnectionName - The name of the private endpoint connection. @@ -72,7 +72,7 @@ func (client *PrivateEndpointConnectionsClient) BeginDelete(ctx context.Context, // Delete - Deletes a private endpoint connection. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-05-01 +// Generated from API version 2024-05-02-preview func (client *PrivateEndpointConnectionsClient) deleteOperation(ctx context.Context, resourceGroupName string, resourceName string, privateEndpointConnectionName string, options *PrivateEndpointConnectionsClientBeginDeleteOptions) (*http.Response, error) { var err error const operationName = "PrivateEndpointConnectionsClient.BeginDelete" @@ -118,7 +118,7 @@ func (client *PrivateEndpointConnectionsClient) deleteCreateRequest(ctx context. return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-05-02-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -127,7 +127,7 @@ func (client *PrivateEndpointConnectionsClient) deleteCreateRequest(ctx context. // Get - To learn more about private clusters, see: https://docs.microsoft.com/azure/aks/private-clusters // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-05-01 +// Generated from API version 2024-05-02-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - resourceName - The name of the managed cluster resource. // - privateEndpointConnectionName - The name of the private endpoint connection. @@ -179,7 +179,7 @@ func (client *PrivateEndpointConnectionsClient) getCreateRequest(ctx context.Con return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-05-02-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -197,7 +197,7 @@ func (client *PrivateEndpointConnectionsClient) getHandleResponse(resp *http.Res // List - To learn more about private clusters, see: https://docs.microsoft.com/azure/aks/private-clusters // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-05-01 +// Generated from API version 2024-05-02-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - resourceName - The name of the managed cluster resource. // - options - PrivateEndpointConnectionsClientListOptions contains the optional parameters for the PrivateEndpointConnectionsClient.List @@ -244,7 +244,7 @@ func (client *PrivateEndpointConnectionsClient) listCreateRequest(ctx context.Co return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-05-02-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -262,7 +262,7 @@ func (client *PrivateEndpointConnectionsClient) listHandleResponse(resp *http.Re // Update - Updates a private endpoint connection. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-05-01 +// Generated from API version 2024-05-02-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - resourceName - The name of the managed cluster resource. // - privateEndpointConnectionName - The name of the private endpoint connection. @@ -315,7 +315,7 @@ func (client *PrivateEndpointConnectionsClient) updateCreateRequest(ctx context. return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-05-02-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { diff --git a/sdk/resourcemanager/containerservice/armcontainerservice/privateendpointconnections_client_example_test.go b/sdk/resourcemanager/containerservice/armcontainerservice/privateendpointconnections_client_example_test.go index 0cf91902f47c..601d83c1869b 100644 --- a/sdk/resourcemanager/containerservice/armcontainerservice/privateendpointconnections_client_example_test.go +++ b/sdk/resourcemanager/containerservice/armcontainerservice/privateendpointconnections_client_example_test.go @@ -18,7 +18,7 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/containerservice/armcontainerservice/v6" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/8cbd903b0d037c427def0e8fbf167b26e87bd1a9/specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2024-05-01/examples/PrivateEndpointConnectionsList.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c7b98b36e4023331545051284d8500adf98f02fe/specification/containerservice/resource-manager/Microsoft.ContainerService/aks/preview/2024-05-02-preview/examples/PrivateEndpointConnectionsList.json func ExamplePrivateEndpointConnectionsClient_List() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -41,7 +41,7 @@ func ExamplePrivateEndpointConnectionsClient_List() { // { // Name: to.Ptr("privateendpointconnection1"), // Type: to.Ptr("Microsoft.Network/privateLinkServices/privateEndpointConnections"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/rg1/providers/Microsoft.ContainerService/managedCluster/clustername1/privateEndpointConnections/privateendpointconnection1"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.ContainerService/managedCluster/clustername1/privateEndpointConnections/privateendpointconnection1"), // Properties: &armcontainerservice.PrivateEndpointConnectionProperties{ // PrivateEndpoint: &armcontainerservice.PrivateEndpoint{ // ID: to.Ptr("/subscriptions/subid2/resourceGroups/rg2/providers/Microsoft.Network/privateEndpoints/pe2"), @@ -55,7 +55,7 @@ func ExamplePrivateEndpointConnectionsClient_List() { // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/8cbd903b0d037c427def0e8fbf167b26e87bd1a9/specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2024-05-01/examples/PrivateEndpointConnectionsGet.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c7b98b36e4023331545051284d8500adf98f02fe/specification/containerservice/resource-manager/Microsoft.ContainerService/aks/preview/2024-05-02-preview/examples/PrivateEndpointConnectionsGet.json func ExamplePrivateEndpointConnectionsClient_Get() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -76,7 +76,7 @@ func ExamplePrivateEndpointConnectionsClient_Get() { // res.PrivateEndpointConnection = armcontainerservice.PrivateEndpointConnection{ // Name: to.Ptr("privateendpointconnection1"), // Type: to.Ptr("Microsoft.Network/privateLinkServices/privateEndpointConnections"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/rg1/providers/Microsoft.ContainerService/managedCluster/clustername1/privateEndpointConnections/privateendpointconnection1"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.ContainerService/managedCluster/clustername1/privateEndpointConnections/privateendpointconnection1"), // Properties: &armcontainerservice.PrivateEndpointConnectionProperties{ // PrivateEndpoint: &armcontainerservice.PrivateEndpoint{ // ID: to.Ptr("/subscriptions/subid2/resourceGroups/rg2/providers/Microsoft.Network/privateEndpoints/pe2"), @@ -89,7 +89,7 @@ func ExamplePrivateEndpointConnectionsClient_Get() { // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/8cbd903b0d037c427def0e8fbf167b26e87bd1a9/specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2024-05-01/examples/PrivateEndpointConnectionsUpdate.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c7b98b36e4023331545051284d8500adf98f02fe/specification/containerservice/resource-manager/Microsoft.ContainerService/aks/preview/2024-05-02-preview/examples/PrivateEndpointConnectionsUpdate.json func ExamplePrivateEndpointConnectionsClient_Update() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -116,7 +116,7 @@ func ExamplePrivateEndpointConnectionsClient_Update() { // res.PrivateEndpointConnection = armcontainerservice.PrivateEndpointConnection{ // Name: to.Ptr("privateendpointconnection1"), // Type: to.Ptr("Microsoft.Network/privateLinkServices/privateEndpointConnections"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/rg1/providers/Microsoft.ContainerService/managedCluster/clustername1/privateEndpointConnections/privateendpointconnection1"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.ContainerService/managedCluster/clustername1/privateEndpointConnections/privateendpointconnection1"), // Properties: &armcontainerservice.PrivateEndpointConnectionProperties{ // PrivateEndpoint: &armcontainerservice.PrivateEndpoint{ // ID: to.Ptr("/subscriptions/subid2/resourceGroups/rg2/providers/Microsoft.Network/privateEndpoints/pe2"), @@ -129,7 +129,7 @@ func ExamplePrivateEndpointConnectionsClient_Update() { // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/8cbd903b0d037c427def0e8fbf167b26e87bd1a9/specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2024-05-01/examples/PrivateEndpointConnectionsDelete.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c7b98b36e4023331545051284d8500adf98f02fe/specification/containerservice/resource-manager/Microsoft.ContainerService/aks/preview/2024-05-02-preview/examples/PrivateEndpointConnectionsDelete.json func ExamplePrivateEndpointConnectionsClient_BeginDelete() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { diff --git a/sdk/resourcemanager/containerservice/armcontainerservice/privatelinkresources_client.go b/sdk/resourcemanager/containerservice/armcontainerservice/privatelinkresources_client.go index 53a4fd654a8a..ccc9a8e27acc 100644 --- a/sdk/resourcemanager/containerservice/armcontainerservice/privatelinkresources_client.go +++ b/sdk/resourcemanager/containerservice/armcontainerservice/privatelinkresources_client.go @@ -46,7 +46,7 @@ func NewPrivateLinkResourcesClient(subscriptionID string, credential azcore.Toke // List - To learn more about private clusters, see: https://docs.microsoft.com/azure/aks/private-clusters // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-05-01 +// Generated from API version 2024-05-02-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - resourceName - The name of the managed cluster resource. // - options - PrivateLinkResourcesClientListOptions contains the optional parameters for the PrivateLinkResourcesClient.List @@ -93,7 +93,7 @@ func (client *PrivateLinkResourcesClient) listCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-05-02-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/containerservice/armcontainerservice/privatelinkresources_client_example_test.go b/sdk/resourcemanager/containerservice/armcontainerservice/privatelinkresources_client_example_test.go index 0d5fff0df45d..e4140a7730ed 100644 --- a/sdk/resourcemanager/containerservice/armcontainerservice/privatelinkresources_client_example_test.go +++ b/sdk/resourcemanager/containerservice/armcontainerservice/privatelinkresources_client_example_test.go @@ -17,7 +17,7 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/containerservice/armcontainerservice/v6" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/8cbd903b0d037c427def0e8fbf167b26e87bd1a9/specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2024-05-01/examples/PrivateLinkResourcesList.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c7b98b36e4023331545051284d8500adf98f02fe/specification/containerservice/resource-manager/Microsoft.ContainerService/aks/preview/2024-05-02-preview/examples/PrivateLinkResourcesList.json func ExamplePrivateLinkResourcesClient_List() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { diff --git a/sdk/resourcemanager/containerservice/armcontainerservice/resolveprivatelinkserviceid_client.go b/sdk/resourcemanager/containerservice/armcontainerservice/resolveprivatelinkserviceid_client.go index bd2ce3ba64e7..f15ea169ffec 100644 --- a/sdk/resourcemanager/containerservice/armcontainerservice/resolveprivatelinkserviceid_client.go +++ b/sdk/resourcemanager/containerservice/armcontainerservice/resolveprivatelinkserviceid_client.go @@ -46,7 +46,7 @@ func NewResolvePrivateLinkServiceIDClient(subscriptionID string, credential azco // POST - Gets the private link service ID for the specified managed cluster. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-05-01 +// Generated from API version 2024-05-02-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - resourceName - The name of the managed cluster resource. // - parameters - Parameters required in order to resolve a private link service ID. @@ -94,7 +94,7 @@ func (client *ResolvePrivateLinkServiceIDClient) postCreateRequest(ctx context.C return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-05-02-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { diff --git a/sdk/resourcemanager/containerservice/armcontainerservice/resolveprivatelinkserviceid_client_example_test.go b/sdk/resourcemanager/containerservice/armcontainerservice/resolveprivatelinkserviceid_client_example_test.go index 96e77646896a..8e70d1f3994b 100644 --- a/sdk/resourcemanager/containerservice/armcontainerservice/resolveprivatelinkserviceid_client_example_test.go +++ b/sdk/resourcemanager/containerservice/armcontainerservice/resolveprivatelinkserviceid_client_example_test.go @@ -18,7 +18,7 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/containerservice/armcontainerservice/v6" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/8cbd903b0d037c427def0e8fbf167b26e87bd1a9/specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2024-05-01/examples/ResolvePrivateLinkServiceId.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c7b98b36e4023331545051284d8500adf98f02fe/specification/containerservice/resource-manager/Microsoft.ContainerService/aks/preview/2024-05-02-preview/examples/ResolvePrivateLinkServiceId.json func ExampleResolvePrivateLinkServiceIDClient_POST() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { diff --git a/sdk/resourcemanager/containerservice/armcontainerservice/responses.go b/sdk/resourcemanager/containerservice/armcontainerservice/responses.go index cfb3d64aa518..620559ecfec1 100644 --- a/sdk/resourcemanager/containerservice/armcontainerservice/responses.go +++ b/sdk/resourcemanager/containerservice/armcontainerservice/responses.go @@ -19,6 +19,11 @@ type AgentPoolsClientCreateOrUpdateResponse struct { AgentPool } +// AgentPoolsClientDeleteMachinesResponse contains the response from method AgentPoolsClient.BeginDeleteMachines. +type AgentPoolsClientDeleteMachinesResponse struct { + // placeholder for future response values +} + // AgentPoolsClientDeleteResponse contains the response from method AgentPoolsClient.BeginDelete. type AgentPoolsClientDeleteResponse struct { // placeholder for future response values @@ -54,6 +59,46 @@ type AgentPoolsClientUpgradeNodeImageVersionResponse struct { AgentPool } +// LoadBalancersClientCreateOrUpdateResponse contains the response from method LoadBalancersClient.CreateOrUpdate. +type LoadBalancersClientCreateOrUpdateResponse struct { + // The configurations regarding multiple standard load balancers. If not supplied, single load balancer mode will be used. + // Multiple standard load balancers mode will be used if at lease one configuration is supplied. There has to be a configuration + // named `kubernetes`. + LoadBalancer +} + +// LoadBalancersClientDeleteResponse contains the response from method LoadBalancersClient.BeginDelete. +type LoadBalancersClientDeleteResponse struct { + // placeholder for future response values +} + +// LoadBalancersClientGetResponse contains the response from method LoadBalancersClient.Get. +type LoadBalancersClientGetResponse struct { + // The configurations regarding multiple standard load balancers. If not supplied, single load balancer mode will be used. + // Multiple standard load balancers mode will be used if at lease one configuration is supplied. There has to be a configuration + // named `kubernetes`. + LoadBalancer +} + +// LoadBalancersClientListByManagedClusterResponse contains the response from method LoadBalancersClient.NewListByManagedClusterPager. +type LoadBalancersClientListByManagedClusterResponse struct { + // The response from the List Load Balancers operation. + LoadBalancerListResult +} + +// MachinesClientGetResponse contains the response from method MachinesClient.Get. +type MachinesClientGetResponse struct { + // A machine. Contains details about the underlying virtual machine. A machine may be visible here but not in kubectl get + // nodes; if so it may be because the machine has not been registered with the Kubernetes API Server yet. + Machine +} + +// MachinesClientListResponse contains the response from method MachinesClient.NewListPager. +type MachinesClientListResponse struct { + // The response from the List Machines operation. + MachineListResult +} + // MaintenanceConfigurationsClientCreateOrUpdateResponse contains the response from method MaintenanceConfigurationsClient.CreateOrUpdate. type MaintenanceConfigurationsClientCreateOrUpdateResponse struct { // See [planned maintenance](https://docs.microsoft.com/azure/aks/planned-maintenance) for more information about planned @@ -79,6 +124,41 @@ type MaintenanceConfigurationsClientListByManagedClusterResponse struct { MaintenanceConfigurationListResult } +// ManagedClusterSnapshotsClientCreateOrUpdateResponse contains the response from method ManagedClusterSnapshotsClient.CreateOrUpdate. +type ManagedClusterSnapshotsClientCreateOrUpdateResponse struct { + // A managed cluster snapshot resource. + ManagedClusterSnapshot +} + +// ManagedClusterSnapshotsClientDeleteResponse contains the response from method ManagedClusterSnapshotsClient.Delete. +type ManagedClusterSnapshotsClientDeleteResponse struct { + // placeholder for future response values +} + +// ManagedClusterSnapshotsClientGetResponse contains the response from method ManagedClusterSnapshotsClient.Get. +type ManagedClusterSnapshotsClientGetResponse struct { + // A managed cluster snapshot resource. + ManagedClusterSnapshot +} + +// ManagedClusterSnapshotsClientListByResourceGroupResponse contains the response from method ManagedClusterSnapshotsClient.NewListByResourceGroupPager. +type ManagedClusterSnapshotsClientListByResourceGroupResponse struct { + // The response from the List Managed Cluster Snapshots operation. + ManagedClusterSnapshotListResult +} + +// ManagedClusterSnapshotsClientListResponse contains the response from method ManagedClusterSnapshotsClient.NewListPager. +type ManagedClusterSnapshotsClientListResponse struct { + // The response from the List Managed Cluster Snapshots operation. + ManagedClusterSnapshotListResult +} + +// ManagedClusterSnapshotsClientUpdateTagsResponse contains the response from method ManagedClusterSnapshotsClient.UpdateTags. +type ManagedClusterSnapshotsClientUpdateTagsResponse struct { + // A managed cluster snapshot resource. + ManagedClusterSnapshot +} + // ManagedClustersClientAbortLatestOperationResponse contains the response from method ManagedClustersClient.BeginAbortLatestOperation. type ManagedClustersClientAbortLatestOperationResponse struct { // placeholder for future response values @@ -110,6 +190,12 @@ type ManagedClustersClientGetCommandResultResponse struct { Location *string } +// ManagedClustersClientGetGuardrailsVersionsResponse contains the response from method ManagedClustersClient.GetGuardrailsVersions. +type ManagedClustersClientGetGuardrailsVersionsResponse struct { + // Available Guardrails Version + GuardrailsAvailableVersion +} + // ManagedClustersClientGetMeshRevisionProfileResponse contains the response from method ManagedClustersClient.GetMeshRevisionProfile. type ManagedClustersClientGetMeshRevisionProfileResponse struct { // Mesh revision profile for a mesh. @@ -128,6 +214,12 @@ type ManagedClustersClientGetResponse struct { ManagedCluster } +// ManagedClustersClientGetSafeguardsVersionsResponse contains the response from method ManagedClustersClient.GetSafeguardsVersions. +type ManagedClustersClientGetSafeguardsVersionsResponse struct { + // Available Safeguards Version + SafeguardsAvailableVersion +} + // ManagedClustersClientGetUpgradeProfileResponse contains the response from method ManagedClustersClient.GetUpgradeProfile. type ManagedClustersClientGetUpgradeProfileResponse struct { // The list of available upgrades for compute pools. @@ -158,6 +250,12 @@ type ManagedClustersClientListClusterUserCredentialsResponse struct { CredentialResults } +// ManagedClustersClientListGuardrailsVersionsResponse contains the response from method ManagedClustersClient.NewListGuardrailsVersionsPager. +type ManagedClustersClientListGuardrailsVersionsResponse struct { + // Hold values properties, which is array of GuardrailsVersions + GuardrailsAvailableVersionsList +} + // ManagedClustersClientListKubernetesVersionsResponse contains the response from method ManagedClustersClient.ListKubernetesVersions. type ManagedClustersClientListKubernetesVersionsResponse struct { // Hold values properties, which is array of KubernetesVersion @@ -188,6 +286,17 @@ type ManagedClustersClientListResponse struct { ManagedClusterListResult } +// ManagedClustersClientListSafeguardsVersionsResponse contains the response from method ManagedClustersClient.NewListSafeguardsVersionsPager. +type ManagedClustersClientListSafeguardsVersionsResponse struct { + // Hold values properties, which is array of SafeguardsVersions + SafeguardsAvailableVersionsList +} + +// ManagedClustersClientRebalanceLoadBalancersResponse contains the response from method ManagedClustersClient.BeginRebalanceLoadBalancers. +type ManagedClustersClientRebalanceLoadBalancersResponse struct { + // placeholder for future response values +} + // ManagedClustersClientResetAADProfileResponse contains the response from method ManagedClustersClient.BeginResetAADProfile. type ManagedClustersClientResetAADProfileResponse struct { // placeholder for future response values @@ -230,6 +339,24 @@ type ManagedClustersClientUpdateTagsResponse struct { ManagedCluster } +// OperationStatusResultClientGetByAgentPoolResponse contains the response from method OperationStatusResultClient.GetByAgentPool. +type OperationStatusResultClientGetByAgentPoolResponse struct { + // The current status of an async operation. + OperationStatusResult +} + +// OperationStatusResultClientGetResponse contains the response from method OperationStatusResultClient.Get. +type OperationStatusResultClientGetResponse struct { + // The current status of an async operation. + OperationStatusResult +} + +// OperationStatusResultClientListResponse contains the response from method OperationStatusResultClient.NewListPager. +type OperationStatusResultClientListResponse struct { + // The operations list. It contains an URL link to get the next set of results. + OperationStatusResultList +} + // OperationsClientListResponse contains the response from method OperationsClient.NewListPager. type OperationsClientListResponse struct { // The List Operation response. diff --git a/sdk/resourcemanager/containerservice/armcontainerservice/snapshots_client.go b/sdk/resourcemanager/containerservice/armcontainerservice/snapshots_client.go index 659ded03562d..88a3147db0ef 100644 --- a/sdk/resourcemanager/containerservice/armcontainerservice/snapshots_client.go +++ b/sdk/resourcemanager/containerservice/armcontainerservice/snapshots_client.go @@ -46,7 +46,7 @@ func NewSnapshotsClient(subscriptionID string, credential azcore.TokenCredential // CreateOrUpdate - Creates or updates a snapshot. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-05-01 +// Generated from API version 2024-05-02-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - resourceName - The name of the managed cluster resource. // - parameters - The snapshot to create or update. @@ -94,7 +94,7 @@ func (client *SnapshotsClient) createOrUpdateCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-05-02-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { @@ -115,7 +115,7 @@ func (client *SnapshotsClient) createOrUpdateHandleResponse(resp *http.Response) // Delete - Deletes a snapshot. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-05-01 +// Generated from API version 2024-05-02-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - resourceName - The name of the managed cluster resource. // - options - SnapshotsClientDeleteOptions contains the optional parameters for the SnapshotsClient.Delete method. @@ -160,7 +160,7 @@ func (client *SnapshotsClient) deleteCreateRequest(ctx context.Context, resource return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-05-02-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -169,7 +169,7 @@ func (client *SnapshotsClient) deleteCreateRequest(ctx context.Context, resource // Get - Gets a snapshot. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-05-01 +// Generated from API version 2024-05-02-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - resourceName - The name of the managed cluster resource. // - options - SnapshotsClientGetOptions contains the optional parameters for the SnapshotsClient.Get method. @@ -215,7 +215,7 @@ func (client *SnapshotsClient) getCreateRequest(ctx context.Context, resourceGro return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-05-02-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -232,7 +232,7 @@ func (client *SnapshotsClient) getHandleResponse(resp *http.Response) (Snapshots // NewListPager - Gets a list of snapshots in the specified subscription. // -// Generated from API version 2024-05-01 +// Generated from API version 2024-05-02-preview // - options - SnapshotsClientListOptions contains the optional parameters for the SnapshotsClient.NewListPager method. func (client *SnapshotsClient) NewListPager(options *SnapshotsClientListOptions) *runtime.Pager[SnapshotsClientListResponse] { return runtime.NewPager(runtime.PagingHandler[SnapshotsClientListResponse]{ @@ -269,7 +269,7 @@ func (client *SnapshotsClient) listCreateRequest(ctx context.Context, options *S return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-05-02-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -286,7 +286,7 @@ func (client *SnapshotsClient) listHandleResponse(resp *http.Response) (Snapshot // NewListByResourceGroupPager - Lists snapshots in the specified subscription and resource group. // -// Generated from API version 2024-05-01 +// Generated from API version 2024-05-02-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - options - SnapshotsClientListByResourceGroupOptions contains the optional parameters for the SnapshotsClient.NewListByResourceGroupPager // method. @@ -329,7 +329,7 @@ func (client *SnapshotsClient) listByResourceGroupCreateRequest(ctx context.Cont return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-05-02-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -347,7 +347,7 @@ func (client *SnapshotsClient) listByResourceGroupHandleResponse(resp *http.Resp // UpdateTags - Updates tags on a snapshot. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-05-01 +// Generated from API version 2024-05-02-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - resourceName - The name of the managed cluster resource. // - parameters - Parameters supplied to the Update snapshot Tags operation. @@ -394,7 +394,7 @@ func (client *SnapshotsClient) updateTagsCreateRequest(ctx context.Context, reso return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-05-02-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { diff --git a/sdk/resourcemanager/containerservice/armcontainerservice/snapshots_client_example_test.go b/sdk/resourcemanager/containerservice/armcontainerservice/snapshots_client_example_test.go index 8a4e6960531c..d7bea14dae5b 100644 --- a/sdk/resourcemanager/containerservice/armcontainerservice/snapshots_client_example_test.go +++ b/sdk/resourcemanager/containerservice/armcontainerservice/snapshots_client_example_test.go @@ -18,7 +18,7 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/containerservice/armcontainerservice/v6" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/8cbd903b0d037c427def0e8fbf167b26e87bd1a9/specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2024-05-01/examples/SnapshotsList.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c7b98b36e4023331545051284d8500adf98f02fe/specification/containerservice/resource-manager/Microsoft.ContainerService/aks/preview/2024-05-02-preview/examples/SnapshotsList.json func ExampleSnapshotsClient_NewListPager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -73,7 +73,7 @@ func ExampleSnapshotsClient_NewListPager() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/8cbd903b0d037c427def0e8fbf167b26e87bd1a9/specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2024-05-01/examples/SnapshotsListByResourceGroup.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c7b98b36e4023331545051284d8500adf98f02fe/specification/containerservice/resource-manager/Microsoft.ContainerService/aks/preview/2024-05-02-preview/examples/SnapshotsListByResourceGroup.json func ExampleSnapshotsClient_NewListByResourceGroupPager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -128,7 +128,7 @@ func ExampleSnapshotsClient_NewListByResourceGroupPager() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/8cbd903b0d037c427def0e8fbf167b26e87bd1a9/specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2024-05-01/examples/SnapshotsGet.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c7b98b36e4023331545051284d8500adf98f02fe/specification/containerservice/resource-manager/Microsoft.ContainerService/aks/preview/2024-05-02-preview/examples/SnapshotsGet.json func ExampleSnapshotsClient_Get() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -175,7 +175,7 @@ func ExampleSnapshotsClient_Get() { // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/8cbd903b0d037c427def0e8fbf167b26e87bd1a9/specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2024-05-01/examples/SnapshotsCreate.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c7b98b36e4023331545051284d8500adf98f02fe/specification/containerservice/resource-manager/Microsoft.ContainerService/aks/preview/2024-05-02-preview/examples/SnapshotsCreate.json func ExampleSnapshotsClient_CreateOrUpdate() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -233,7 +233,7 @@ func ExampleSnapshotsClient_CreateOrUpdate() { // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/8cbd903b0d037c427def0e8fbf167b26e87bd1a9/specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2024-05-01/examples/SnapshotsUpdateTags.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c7b98b36e4023331545051284d8500adf98f02fe/specification/containerservice/resource-manager/Microsoft.ContainerService/aks/preview/2024-05-02-preview/examples/SnapshotsUpdateTags.json func ExampleSnapshotsClient_UpdateTags() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -285,7 +285,7 @@ func ExampleSnapshotsClient_UpdateTags() { // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/8cbd903b0d037c427def0e8fbf167b26e87bd1a9/specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2024-05-01/examples/SnapshotsDelete.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c7b98b36e4023331545051284d8500adf98f02fe/specification/containerservice/resource-manager/Microsoft.ContainerService/aks/preview/2024-05-02-preview/examples/SnapshotsDelete.json func ExampleSnapshotsClient_Delete() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { diff --git a/sdk/resourcemanager/containerservice/armcontainerservice/trustedaccessrolebindings_client.go b/sdk/resourcemanager/containerservice/armcontainerservice/trustedaccessrolebindings_client.go index 8fe0b1bd9153..bd835c8027fd 100644 --- a/sdk/resourcemanager/containerservice/armcontainerservice/trustedaccessrolebindings_client.go +++ b/sdk/resourcemanager/containerservice/armcontainerservice/trustedaccessrolebindings_client.go @@ -46,7 +46,7 @@ func NewTrustedAccessRoleBindingsClient(subscriptionID string, credential azcore // BeginCreateOrUpdate - Create or update a trusted access role binding // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-05-01 +// Generated from API version 2024-05-02-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - resourceName - The name of the managed cluster resource. // - trustedAccessRoleBindingName - The name of trusted access role binding. @@ -73,7 +73,7 @@ func (client *TrustedAccessRoleBindingsClient) BeginCreateOrUpdate(ctx context.C // CreateOrUpdate - Create or update a trusted access role binding // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-05-01 +// Generated from API version 2024-05-02-preview func (client *TrustedAccessRoleBindingsClient) createOrUpdate(ctx context.Context, resourceGroupName string, resourceName string, trustedAccessRoleBindingName string, trustedAccessRoleBinding TrustedAccessRoleBinding, options *TrustedAccessRoleBindingsClientBeginCreateOrUpdateOptions) (*http.Response, error) { var err error const operationName = "TrustedAccessRoleBindingsClient.BeginCreateOrUpdate" @@ -119,7 +119,7 @@ func (client *TrustedAccessRoleBindingsClient) createOrUpdateCreateRequest(ctx c return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-05-02-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, trustedAccessRoleBinding); err != nil { @@ -131,7 +131,7 @@ func (client *TrustedAccessRoleBindingsClient) createOrUpdateCreateRequest(ctx c // BeginDelete - Delete a trusted access role binding. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-05-01 +// Generated from API version 2024-05-02-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - resourceName - The name of the managed cluster resource. // - trustedAccessRoleBindingName - The name of trusted access role binding. @@ -157,7 +157,7 @@ func (client *TrustedAccessRoleBindingsClient) BeginDelete(ctx context.Context, // Delete - Delete a trusted access role binding. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-05-01 +// Generated from API version 2024-05-02-preview func (client *TrustedAccessRoleBindingsClient) deleteOperation(ctx context.Context, resourceGroupName string, resourceName string, trustedAccessRoleBindingName string, options *TrustedAccessRoleBindingsClientBeginDeleteOptions) (*http.Response, error) { var err error const operationName = "TrustedAccessRoleBindingsClient.BeginDelete" @@ -203,7 +203,7 @@ func (client *TrustedAccessRoleBindingsClient) deleteCreateRequest(ctx context.C return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-05-02-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -212,7 +212,7 @@ func (client *TrustedAccessRoleBindingsClient) deleteCreateRequest(ctx context.C // Get - Get a trusted access role binding. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-05-01 +// Generated from API version 2024-05-02-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - resourceName - The name of the managed cluster resource. // - trustedAccessRoleBindingName - The name of trusted access role binding. @@ -264,7 +264,7 @@ func (client *TrustedAccessRoleBindingsClient) getCreateRequest(ctx context.Cont return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-05-02-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -281,7 +281,7 @@ func (client *TrustedAccessRoleBindingsClient) getHandleResponse(resp *http.Resp // NewListPager - List trusted access role bindings. // -// Generated from API version 2024-05-01 +// Generated from API version 2024-05-02-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - resourceName - The name of the managed cluster resource. // - options - TrustedAccessRoleBindingsClientListOptions contains the optional parameters for the TrustedAccessRoleBindingsClient.NewListPager @@ -329,7 +329,7 @@ func (client *TrustedAccessRoleBindingsClient) listCreateRequest(ctx context.Con return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-05-02-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/containerservice/armcontainerservice/trustedaccessrolebindings_client_example_test.go b/sdk/resourcemanager/containerservice/armcontainerservice/trustedaccessrolebindings_client_example_test.go index d9014a8c0b3b..b97c3a2ebec7 100644 --- a/sdk/resourcemanager/containerservice/armcontainerservice/trustedaccessrolebindings_client_example_test.go +++ b/sdk/resourcemanager/containerservice/armcontainerservice/trustedaccessrolebindings_client_example_test.go @@ -18,7 +18,7 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/containerservice/armcontainerservice/v6" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/8cbd903b0d037c427def0e8fbf167b26e87bd1a9/specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2024-05-01/examples/TrustedAccessRoleBindings_List.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c7b98b36e4023331545051284d8500adf98f02fe/specification/containerservice/resource-manager/Microsoft.ContainerService/aks/preview/2024-05-02-preview/examples/TrustedAccessRoleBindings_List.json func ExampleTrustedAccessRoleBindingsClient_NewListPager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -57,7 +57,7 @@ func ExampleTrustedAccessRoleBindingsClient_NewListPager() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/8cbd903b0d037c427def0e8fbf167b26e87bd1a9/specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2024-05-01/examples/TrustedAccessRoleBindings_Get.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c7b98b36e4023331545051284d8500adf98f02fe/specification/containerservice/resource-manager/Microsoft.ContainerService/aks/preview/2024-05-02-preview/examples/TrustedAccessRoleBindings_Get.json func ExampleTrustedAccessRoleBindingsClient_Get() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -88,7 +88,7 @@ func ExampleTrustedAccessRoleBindingsClient_Get() { // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/8cbd903b0d037c427def0e8fbf167b26e87bd1a9/specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2024-05-01/examples/TrustedAccessRoleBindings_CreateOrUpdate.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c7b98b36e4023331545051284d8500adf98f02fe/specification/containerservice/resource-manager/Microsoft.ContainerService/aks/preview/2024-05-02-preview/examples/TrustedAccessRoleBindings_CreateOrUpdate.json func ExampleTrustedAccessRoleBindingsClient_BeginCreateOrUpdate() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -130,7 +130,7 @@ func ExampleTrustedAccessRoleBindingsClient_BeginCreateOrUpdate() { // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/8cbd903b0d037c427def0e8fbf167b26e87bd1a9/specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2024-05-01/examples/TrustedAccessRoleBindings_Delete.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c7b98b36e4023331545051284d8500adf98f02fe/specification/containerservice/resource-manager/Microsoft.ContainerService/aks/preview/2024-05-02-preview/examples/TrustedAccessRoleBindings_Delete.json func ExampleTrustedAccessRoleBindingsClient_BeginDelete() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { diff --git a/sdk/resourcemanager/containerservice/armcontainerservice/trustedaccessroles_client.go b/sdk/resourcemanager/containerservice/armcontainerservice/trustedaccessroles_client.go index 3926a57f4b6a..d3a8640e9da3 100644 --- a/sdk/resourcemanager/containerservice/armcontainerservice/trustedaccessroles_client.go +++ b/sdk/resourcemanager/containerservice/armcontainerservice/trustedaccessroles_client.go @@ -45,7 +45,7 @@ func NewTrustedAccessRolesClient(subscriptionID string, credential azcore.TokenC // NewListPager - List supported trusted access roles. // -// Generated from API version 2024-05-01 +// Generated from API version 2024-05-02-preview // - location - The name of the Azure region. // - options - TrustedAccessRolesClientListOptions contains the optional parameters for the TrustedAccessRolesClient.NewListPager // method. @@ -88,7 +88,7 @@ func (client *TrustedAccessRolesClient) listCreateRequest(ctx context.Context, l return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-05-01") + reqQP.Set("api-version", "2024-05-02-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/containerservice/armcontainerservice/trustedaccessroles_client_example_test.go b/sdk/resourcemanager/containerservice/armcontainerservice/trustedaccessroles_client_example_test.go index ebec13027467..fef899536644 100644 --- a/sdk/resourcemanager/containerservice/armcontainerservice/trustedaccessroles_client_example_test.go +++ b/sdk/resourcemanager/containerservice/armcontainerservice/trustedaccessroles_client_example_test.go @@ -17,7 +17,7 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/containerservice/armcontainerservice/v6" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/8cbd903b0d037c427def0e8fbf167b26e87bd1a9/specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2024-05-01/examples/TrustedAccessRoles_List.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c7b98b36e4023331545051284d8500adf98f02fe/specification/containerservice/resource-manager/Microsoft.ContainerService/aks/preview/2024-05-02-preview/examples/TrustedAccessRoles_List.json func ExampleTrustedAccessRolesClient_NewListPager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil {