diff --git a/sdk/resourcemanager/containerservicefleet/armcontainerservicefleet/CHANGELOG.md b/sdk/resourcemanager/containerservicefleet/armcontainerservicefleet/CHANGELOG.md index c850a2bbeca9..743de39cac80 100644 --- a/sdk/resourcemanager/containerservicefleet/armcontainerservicefleet/CHANGELOG.md +++ b/sdk/resourcemanager/containerservicefleet/armcontainerservicefleet/CHANGELOG.md @@ -1,5 +1,18 @@ # Release History +## 1.2.0-beta.1 (2024-01-18) +### Features Added + +- New enum type `TargetType` with values `TargetTypeAfterStageWait`, `TargetTypeGroup`, `TargetTypeMember`, `TargetTypeStage` +- New function `*UpdateRunsClient.Skip(context.Context, string, string, string, SkipProperties, *UpdateRunsClientSkipOptions) (UpdateRunsClientSkipResponse, error)` +- New struct `APIServerAccessProfile` +- New struct `AgentProfile` +- New struct `FleetHubProfile` +- New struct `SkipProperties` +- New struct `SkipRequest` +- New field `HubProfile` in struct `FleetProperties` + + ## 1.1.0 (2023-11-24) ### Features Added diff --git a/sdk/resourcemanager/containerservicefleet/armcontainerservicefleet/README.md b/sdk/resourcemanager/containerservicefleet/armcontainerservicefleet/README.md index d2b68197ddde..2ee0cb89db93 100644 --- a/sdk/resourcemanager/containerservicefleet/armcontainerservicefleet/README.md +++ b/sdk/resourcemanager/containerservicefleet/armcontainerservicefleet/README.md @@ -57,7 +57,7 @@ clientFactory, err := armcontainerservicefleet.NewClientFactory([!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.ContainerService/fleets/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/updateRuns/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/skip` + 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[armcontainerservicefleet.SkipProperties](req) + if err != nil { + return nil, err + } + resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) + if err != nil { + return nil, err + } + ifMatchParam := getOptional(getHeaderValue(req.Header, "If-Match")) + fleetNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("fleetName")]) + if err != nil { + return nil, err + } + updateRunNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("updateRunName")]) + if err != nil { + return nil, err + } + var options *armcontainerservicefleet.UpdateRunsClientSkipOptions + if ifMatchParam != nil { + options = &armcontainerservicefleet.UpdateRunsClientSkipOptions{ + IfMatch: ifMatchParam, + } + } + respr, errRespr := u.srv.Skip(req.Context(), resourceGroupNameParam, fleetNameParam, updateRunNameParam, body, options) + 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).UpdateRun, req) + if err != nil { + return nil, err + } + return resp, nil +} + func (u *UpdateRunsServerTransport) dispatchBeginStart(req *http.Request) (*http.Response, error) { if u.srv.BeginStart == nil { return nil, &nonRetriableError{errors.New("fake for method BeginStart not implemented")} diff --git a/sdk/resourcemanager/containerservicefleet/armcontainerservicefleet/fleetmembers_client.go b/sdk/resourcemanager/containerservicefleet/armcontainerservicefleet/fleetmembers_client.go index 6613d73dbc2e..1a0d18976aa3 100644 --- a/sdk/resourcemanager/containerservicefleet/armcontainerservicefleet/fleetmembers_client.go +++ b/sdk/resourcemanager/containerservicefleet/armcontainerservicefleet/fleetmembers_client.go @@ -46,7 +46,7 @@ func NewFleetMembersClient(subscriptionID string, credential azcore.TokenCredent // BeginCreate - Create a FleetMember // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-10-15 +// Generated from API version 2024-02-02-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - fleetName - The name of the Fleet resource. // - fleetMemberName - The name of the Fleet member resource. @@ -74,7 +74,7 @@ func (client *FleetMembersClient) BeginCreate(ctx context.Context, resourceGroup // Create - Create a FleetMember // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-10-15 +// Generated from API version 2024-02-02-preview func (client *FleetMembersClient) create(ctx context.Context, resourceGroupName string, fleetName string, fleetMemberName string, resource FleetMember, options *FleetMembersClientBeginCreateOptions) (*http.Response, error) { var err error const operationName = "FleetMembersClient.BeginCreate" @@ -120,7 +120,7 @@ func (client *FleetMembersClient) createCreateRequest(ctx context.Context, resou return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-10-15") + reqQP.Set("api-version", "2024-02-02-preview") req.Raw().URL.RawQuery = reqQP.Encode() if options != nil && options.IfMatch != nil { req.Raw().Header["If-Match"] = []string{*options.IfMatch} @@ -138,7 +138,7 @@ func (client *FleetMembersClient) createCreateRequest(ctx context.Context, resou // BeginDelete - Delete a FleetMember // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-10-15 +// Generated from API version 2024-02-02-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - fleetName - The name of the Fleet resource. // - fleetMemberName - The name of the Fleet member resource. @@ -165,7 +165,7 @@ func (client *FleetMembersClient) BeginDelete(ctx context.Context, resourceGroup // Delete - Delete a FleetMember // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-10-15 +// Generated from API version 2024-02-02-preview func (client *FleetMembersClient) deleteOperation(ctx context.Context, resourceGroupName string, fleetName string, fleetMemberName string, options *FleetMembersClientBeginDeleteOptions) (*http.Response, error) { var err error const operationName = "FleetMembersClient.BeginDelete" @@ -211,7 +211,7 @@ func (client *FleetMembersClient) deleteCreateRequest(ctx context.Context, resou return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-10-15") + reqQP.Set("api-version", "2024-02-02-preview") req.Raw().URL.RawQuery = reqQP.Encode() if options != nil && options.IfMatch != nil { req.Raw().Header["If-Match"] = []string{*options.IfMatch} @@ -223,7 +223,7 @@ func (client *FleetMembersClient) deleteCreateRequest(ctx context.Context, resou // Get - Get a FleetMember // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-10-15 +// Generated from API version 2024-02-02-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - fleetName - The name of the Fleet resource. // - fleetMemberName - The name of the Fleet member resource. @@ -274,7 +274,7 @@ func (client *FleetMembersClient) getCreateRequest(ctx context.Context, resource return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-10-15") + reqQP.Set("api-version", "2024-02-02-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -291,7 +291,7 @@ func (client *FleetMembersClient) getHandleResponse(resp *http.Response) (FleetM // NewListByFleetPager - List FleetMember resources by Fleet // -// Generated from API version 2023-10-15 +// Generated from API version 2024-02-02-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - fleetName - The name of the Fleet resource. // - options - FleetMembersClientListByFleetOptions contains the optional parameters for the FleetMembersClient.NewListByFleetPager @@ -339,7 +339,7 @@ func (client *FleetMembersClient) listByFleetCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-10-15") + reqQP.Set("api-version", "2024-02-02-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -357,7 +357,7 @@ func (client *FleetMembersClient) listByFleetHandleResponse(resp *http.Response) // BeginUpdate - Update a FleetMember // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-10-15 +// Generated from API version 2024-02-02-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - fleetName - The name of the Fleet resource. // - fleetMemberName - The name of the Fleet member resource. @@ -385,7 +385,7 @@ func (client *FleetMembersClient) BeginUpdate(ctx context.Context, resourceGroup // Update - Update a FleetMember // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-10-15 +// Generated from API version 2024-02-02-preview func (client *FleetMembersClient) update(ctx context.Context, resourceGroupName string, fleetName string, fleetMemberName string, properties FleetMemberUpdate, options *FleetMembersClientBeginUpdateOptions) (*http.Response, error) { var err error const operationName = "FleetMembersClient.BeginUpdate" @@ -431,7 +431,7 @@ func (client *FleetMembersClient) updateCreateRequest(ctx context.Context, resou return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-10-15") + reqQP.Set("api-version", "2024-02-02-preview") req.Raw().URL.RawQuery = reqQP.Encode() if options != nil && options.IfMatch != nil { req.Raw().Header["If-Match"] = []string{*options.IfMatch} diff --git a/sdk/resourcemanager/containerservicefleet/armcontainerservicefleet/fleetmembers_client_example_test.go b/sdk/resourcemanager/containerservicefleet/armcontainerservicefleet/fleetmembers_client_example_test.go deleted file mode 100644 index e46c4b54f8aa..000000000000 --- a/sdk/resourcemanager/containerservicefleet/armcontainerservicefleet/fleetmembers_client_example_test.go +++ /dev/null @@ -1,219 +0,0 @@ -//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 armcontainerservicefleet_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/containerservicefleet/armcontainerservicefleet" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/678aeba91061a67e9af8b9aaf41f85b8aea06c7c/specification/containerservice/resource-manager/Microsoft.ContainerService/fleet/stable/2023-10-15/examples/FleetMembers_ListByFleet.json -func ExampleFleetMembersClient_NewListByFleetPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcontainerservicefleet.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewFleetMembersClient().NewListByFleetPager("rg1", "fleet1", 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.FleetMemberListResult = armcontainerservicefleet.FleetMemberListResult{ - // Value: []*armcontainerservicefleet.FleetMember{ - // { - // Name: to.Ptr("member-1"), - // Type: to.Ptr("Microsoft.ContainerService/fleets/members"), - // ID: to.Ptr("/subscriptions/subid1/resourcegroups/rg1/providers/Microsoft.ContainerService/fleets/fleet-1/members/member-1"), - // SystemData: &armcontainerservicefleet.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-03-23T05:40:40.657Z"); return t}()), - // CreatedBy: to.Ptr("someUser"), - // CreatedByType: to.Ptr(armcontainerservicefleet.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-03-23T05:40:40.657Z"); return t}()), - // LastModifiedBy: to.Ptr("someOtherUser"), - // LastModifiedByType: to.Ptr(armcontainerservicefleet.CreatedByTypeUser), - // }, - // ETag: to.Ptr("kd30rkdfo49="), - // Properties: &armcontainerservicefleet.FleetMemberProperties{ - // ClusterResourceID: to.Ptr("/subscriptions/subid1/resourcegroups/rg1/providers/Microsoft.ContainerService/managedClusters/cluster-1"), - // ProvisioningState: to.Ptr(armcontainerservicefleet.FleetMemberProvisioningStateSucceeded), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/678aeba91061a67e9af8b9aaf41f85b8aea06c7c/specification/containerservice/resource-manager/Microsoft.ContainerService/fleet/stable/2023-10-15/examples/FleetMembers_Get.json -func ExampleFleetMembersClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcontainerservicefleet.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewFleetMembersClient().Get(ctx, "rg1", "fleet1", "member-1", 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.FleetMember = armcontainerservicefleet.FleetMember{ - // Name: to.Ptr("member-1"), - // Type: to.Ptr("Microsoft.ContainerService/fleets/members"), - // ID: to.Ptr("/subscriptions/subid1/resourcegroups/rg1/providers/Microsoft.ContainerService/fleets/fleet-1/members/member-1"), - // SystemData: &armcontainerservicefleet.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-03-23T05:40:40.657Z"); return t}()), - // CreatedBy: to.Ptr("someUser"), - // CreatedByType: to.Ptr(armcontainerservicefleet.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-03-23T05:40:40.657Z"); return t}()), - // LastModifiedBy: to.Ptr("someOtherUser"), - // LastModifiedByType: to.Ptr(armcontainerservicefleet.CreatedByTypeUser), - // }, - // ETag: to.Ptr("kd30rkdfo49="), - // Properties: &armcontainerservicefleet.FleetMemberProperties{ - // ClusterResourceID: to.Ptr("/subscriptions/subid1/resourcegroups/rg1/providers/Microsoft.ContainerService/managedClusters/cluster-1"), - // ProvisioningState: to.Ptr(armcontainerservicefleet.FleetMemberProvisioningStateSucceeded), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/678aeba91061a67e9af8b9aaf41f85b8aea06c7c/specification/containerservice/resource-manager/Microsoft.ContainerService/fleet/stable/2023-10-15/examples/FleetMembers_Create.json -func ExampleFleetMembersClient_BeginCreate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcontainerservicefleet.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewFleetMembersClient().BeginCreate(ctx, "rg1", "fleet1", "member-1", armcontainerservicefleet.FleetMember{ - Properties: &armcontainerservicefleet.FleetMemberProperties{ - ClusterResourceID: to.Ptr("/subscriptions/subid1/resourcegroups/rg1/providers/Microsoft.ContainerService/managedClusters/cluster-1"), - }, - }, &armcontainerservicefleet.FleetMembersClientBeginCreateOptions{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.FleetMember = armcontainerservicefleet.FleetMember{ - // Name: to.Ptr("member-1"), - // Type: to.Ptr("Microsoft.ContainerService/fleets/members"), - // ID: to.Ptr("/subscriptions/subid1/resourcegroups/rg1/providers/Microsoft.ContainerService/fleets/fleet-1/members/member-1"), - // SystemData: &armcontainerservicefleet.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-03-23T05:40:40.657Z"); return t}()), - // CreatedBy: to.Ptr("someUser"), - // CreatedByType: to.Ptr(armcontainerservicefleet.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-03-23T05:40:40.657Z"); return t}()), - // LastModifiedBy: to.Ptr("someOtherUser"), - // LastModifiedByType: to.Ptr(armcontainerservicefleet.CreatedByTypeUser), - // }, - // ETag: to.Ptr("23ujdflewrj3="), - // Properties: &armcontainerservicefleet.FleetMemberProperties{ - // ClusterResourceID: to.Ptr("/subscriptions/subid1/resourcegroups/rg1/providers/Microsoft.ContainerService/managedClusters/cluster-1"), - // ProvisioningState: to.Ptr(armcontainerservicefleet.FleetMemberProvisioningStateSucceeded), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/678aeba91061a67e9af8b9aaf41f85b8aea06c7c/specification/containerservice/resource-manager/Microsoft.ContainerService/fleet/stable/2023-10-15/examples/FleetMembers_Update.json -func ExampleFleetMembersClient_BeginUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcontainerservicefleet.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewFleetMembersClient().BeginUpdate(ctx, "rg1", "fleet1", "member-1", armcontainerservicefleet.FleetMemberUpdate{ - Properties: &armcontainerservicefleet.FleetMemberUpdateProperties{ - Group: to.Ptr("staging"), - }, - }, &armcontainerservicefleet.FleetMembersClientBeginUpdateOptions{IfMatch: 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.FleetMember = armcontainerservicefleet.FleetMember{ - // Name: to.Ptr("member-1"), - // Type: to.Ptr("Microsoft.ContainerService/fleets/members"), - // ID: to.Ptr("/subscriptions/subid1/resourcegroups/rg1/providers/Microsoft.ContainerService/fleets/fleet-1/members/member-1"), - // SystemData: &armcontainerservicefleet.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-03-23T05:40:40.657Z"); return t}()), - // CreatedBy: to.Ptr("someUser"), - // CreatedByType: to.Ptr(armcontainerservicefleet.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-03-23T05:40:40.657Z"); return t}()), - // LastModifiedBy: to.Ptr("someOtherUser"), - // LastModifiedByType: to.Ptr(armcontainerservicefleet.CreatedByTypeUser), - // }, - // ETag: to.Ptr("23ujdflewrj3="), - // Properties: &armcontainerservicefleet.FleetMemberProperties{ - // ClusterResourceID: to.Ptr("/subscriptions/subid1/resourcegroups/rg1/providers/Microsoft.ContainerService/managedClusters/cluster-1"), - // Group: to.Ptr("staging"), - // ProvisioningState: to.Ptr(armcontainerservicefleet.FleetMemberProvisioningStateSucceeded), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/678aeba91061a67e9af8b9aaf41f85b8aea06c7c/specification/containerservice/resource-manager/Microsoft.ContainerService/fleet/stable/2023-10-15/examples/FleetMembers_Delete.json -func ExampleFleetMembersClient_BeginDelete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcontainerservicefleet.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewFleetMembersClient().BeginDelete(ctx, "rg1", "fleet1", "member-1", &armcontainerservicefleet.FleetMembersClientBeginDeleteOptions{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) - } -} diff --git a/sdk/resourcemanager/containerservicefleet/armcontainerservicefleet/fleets_client.go b/sdk/resourcemanager/containerservicefleet/armcontainerservicefleet/fleets_client.go index f58da6c95cbb..0ce2f1db119f 100644 --- a/sdk/resourcemanager/containerservicefleet/armcontainerservicefleet/fleets_client.go +++ b/sdk/resourcemanager/containerservicefleet/armcontainerservicefleet/fleets_client.go @@ -46,7 +46,7 @@ func NewFleetsClient(subscriptionID string, credential azcore.TokenCredential, o // BeginCreateOrUpdate - Creates or updates a Fleet. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-10-15 +// Generated from API version 2024-02-02-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - fleetName - The name of the Fleet resource. // - resource - Resource create parameters. @@ -73,7 +73,7 @@ func (client *FleetsClient) BeginCreateOrUpdate(ctx context.Context, resourceGro // CreateOrUpdate - Creates or updates a Fleet. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-10-15 +// Generated from API version 2024-02-02-preview func (client *FleetsClient) createOrUpdate(ctx context.Context, resourceGroupName string, fleetName string, resource Fleet, options *FleetsClientBeginCreateOrUpdateOptions) (*http.Response, error) { var err error const operationName = "FleetsClient.BeginCreateOrUpdate" @@ -115,7 +115,7 @@ func (client *FleetsClient) createOrUpdateCreateRequest(ctx context.Context, res return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-10-15") + reqQP.Set("api-version", "2024-02-02-preview") req.Raw().URL.RawQuery = reqQP.Encode() if options != nil && options.IfMatch != nil { req.Raw().Header["If-Match"] = []string{*options.IfMatch} @@ -133,7 +133,7 @@ func (client *FleetsClient) createOrUpdateCreateRequest(ctx context.Context, res // BeginDelete - Delete a Fleet // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-10-15 +// Generated from API version 2024-02-02-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - fleetName - The name of the Fleet resource. // - options - FleetsClientBeginDeleteOptions contains the optional parameters for the FleetsClient.BeginDelete method. @@ -158,7 +158,7 @@ func (client *FleetsClient) BeginDelete(ctx context.Context, resourceGroupName s // Delete - Delete a Fleet // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-10-15 +// Generated from API version 2024-02-02-preview func (client *FleetsClient) deleteOperation(ctx context.Context, resourceGroupName string, fleetName string, options *FleetsClientBeginDeleteOptions) (*http.Response, error) { var err error const operationName = "FleetsClient.BeginDelete" @@ -200,7 +200,7 @@ func (client *FleetsClient) deleteCreateRequest(ctx context.Context, resourceGro return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-10-15") + reqQP.Set("api-version", "2024-02-02-preview") req.Raw().URL.RawQuery = reqQP.Encode() if options != nil && options.IfMatch != nil { req.Raw().Header["If-Match"] = []string{*options.IfMatch} @@ -212,7 +212,7 @@ func (client *FleetsClient) deleteCreateRequest(ctx context.Context, resourceGro // Get - Gets a Fleet. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-10-15 +// Generated from API version 2024-02-02-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - fleetName - The name of the Fleet resource. // - options - FleetsClientGetOptions contains the optional parameters for the FleetsClient.Get method. @@ -258,7 +258,7 @@ func (client *FleetsClient) getCreateRequest(ctx context.Context, resourceGroupN return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-10-15") + reqQP.Set("api-version", "2024-02-02-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -275,7 +275,7 @@ func (client *FleetsClient) getHandleResponse(resp *http.Response) (FleetsClient // NewListByResourceGroupPager - Lists fleets in the specified subscription and resource group. // -// Generated from API version 2023-10-15 +// Generated from API version 2024-02-02-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - options - FleetsClientListByResourceGroupOptions contains the optional parameters for the FleetsClient.NewListByResourceGroupPager // method. @@ -318,7 +318,7 @@ func (client *FleetsClient) listByResourceGroupCreateRequest(ctx context.Context return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-10-15") + reqQP.Set("api-version", "2024-02-02-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -335,7 +335,7 @@ func (client *FleetsClient) listByResourceGroupHandleResponse(resp *http.Respons // NewListBySubscriptionPager - Lists fleets in the specified subscription. // -// Generated from API version 2023-10-15 +// Generated from API version 2024-02-02-preview // - options - FleetsClientListBySubscriptionOptions contains the optional parameters for the FleetsClient.NewListBySubscriptionPager // method. func (client *FleetsClient) NewListBySubscriptionPager(options *FleetsClientListBySubscriptionOptions) *runtime.Pager[FleetsClientListBySubscriptionResponse] { @@ -373,7 +373,7 @@ func (client *FleetsClient) listBySubscriptionCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-10-15") + reqQP.Set("api-version", "2024-02-02-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -391,7 +391,7 @@ func (client *FleetsClient) listBySubscriptionHandleResponse(resp *http.Response // ListCredentials - Lists the user credentials of a Fleet. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-10-15 +// Generated from API version 2024-02-02-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - fleetName - The name of the Fleet resource. // - options - FleetsClientListCredentialsOptions contains the optional parameters for the FleetsClient.ListCredentials method. @@ -437,7 +437,7 @@ func (client *FleetsClient) listCredentialsCreateRequest(ctx context.Context, re return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-10-15") + reqQP.Set("api-version", "2024-02-02-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -455,7 +455,7 @@ func (client *FleetsClient) listCredentialsHandleResponse(resp *http.Response) ( // BeginUpdate - Update a Fleet // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-10-15 +// Generated from API version 2024-02-02-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - fleetName - The name of the Fleet resource. // - properties - The resource properties to be updated. @@ -481,7 +481,7 @@ func (client *FleetsClient) BeginUpdate(ctx context.Context, resourceGroupName s // Update - Update a Fleet // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-10-15 +// Generated from API version 2024-02-02-preview func (client *FleetsClient) update(ctx context.Context, resourceGroupName string, fleetName string, properties FleetPatch, options *FleetsClientBeginUpdateOptions) (*http.Response, error) { var err error const operationName = "FleetsClient.BeginUpdate" @@ -523,7 +523,7 @@ func (client *FleetsClient) updateCreateRequest(ctx context.Context, resourceGro return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-10-15") + reqQP.Set("api-version", "2024-02-02-preview") req.Raw().URL.RawQuery = reqQP.Encode() if options != nil && options.IfMatch != nil { req.Raw().Header["If-Match"] = []string{*options.IfMatch} diff --git a/sdk/resourcemanager/containerservicefleet/armcontainerservicefleet/fleets_client_example_test.go b/sdk/resourcemanager/containerservicefleet/armcontainerservicefleet/fleets_client_example_test.go deleted file mode 100644 index 896fc00a41b8..000000000000 --- a/sdk/resourcemanager/containerservicefleet/armcontainerservicefleet/fleets_client_example_test.go +++ /dev/null @@ -1,315 +0,0 @@ -//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 armcontainerservicefleet_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/containerservicefleet/armcontainerservicefleet" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/678aeba91061a67e9af8b9aaf41f85b8aea06c7c/specification/containerservice/resource-manager/Microsoft.ContainerService/fleet/stable/2023-10-15/examples/Fleets_ListBySub.json -func ExampleFleetsClient_NewListBySubscriptionPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcontainerservicefleet.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewFleetsClient().NewListBySubscriptionPager(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.FleetListResult = armcontainerservicefleet.FleetListResult{ - // Value: []*armcontainerservicefleet.Fleet{ - // { - // Name: to.Ptr("fleet-1"), - // Type: to.Ptr("Microsoft.ContainerService/fleets"), - // ID: to.Ptr("/subscriptions/subid1/resourcegroups/rg1/providers/Microsoft.ContainerService/fleets/fleet1"), - // SystemData: &armcontainerservicefleet.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-03-23T05:40:40.657Z"); return t}()), - // CreatedBy: to.Ptr("someUser"), - // CreatedByType: to.Ptr(armcontainerservicefleet.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-03-23T05:40:40.657Z"); return t}()), - // LastModifiedBy: to.Ptr("someOtherUser"), - // LastModifiedByType: to.Ptr(armcontainerservicefleet.CreatedByTypeUser), - // }, - // Location: to.Ptr("East US"), - // Tags: map[string]*string{ - // "archv2": to.Ptr(""), - // "tier": to.Ptr("production"), - // }, - // ETag: to.Ptr("23ujdflewrj3="), - // Properties: &armcontainerservicefleet.FleetProperties{ - // ProvisioningState: to.Ptr(armcontainerservicefleet.FleetProvisioningStateSucceeded), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/678aeba91061a67e9af8b9aaf41f85b8aea06c7c/specification/containerservice/resource-manager/Microsoft.ContainerService/fleet/stable/2023-10-15/examples/Fleets_ListByResourceGroup.json -func ExampleFleetsClient_NewListByResourceGroupPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcontainerservicefleet.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewFleetsClient().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.FleetListResult = armcontainerservicefleet.FleetListResult{ - // Value: []*armcontainerservicefleet.Fleet{ - // { - // Name: to.Ptr("fleet1"), - // Type: to.Ptr("Microsoft.ContainerService/fleets"), - // ID: to.Ptr("/subscriptions/subid1/resourcegroups/rg1/providers/Microsoft.ContainerService/fleets/fleet-1"), - // SystemData: &armcontainerservicefleet.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-03-23T05:40:40.657Z"); return t}()), - // CreatedBy: to.Ptr("someUser"), - // CreatedByType: to.Ptr(armcontainerservicefleet.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-03-23T05:40:40.657Z"); return t}()), - // LastModifiedBy: to.Ptr("someOtherUser"), - // LastModifiedByType: to.Ptr(armcontainerservicefleet.CreatedByTypeUser), - // }, - // Location: to.Ptr("East US"), - // Tags: map[string]*string{ - // "archv2": to.Ptr(""), - // "tier": to.Ptr("production"), - // }, - // ETag: to.Ptr("23ujdflewrj3="), - // Properties: &armcontainerservicefleet.FleetProperties{ - // ProvisioningState: to.Ptr(armcontainerservicefleet.FleetProvisioningStateSucceeded), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/678aeba91061a67e9af8b9aaf41f85b8aea06c7c/specification/containerservice/resource-manager/Microsoft.ContainerService/fleet/stable/2023-10-15/examples/Fleets_Get.json -func ExampleFleetsClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcontainerservicefleet.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewFleetsClient().Get(ctx, "rg1", "fleet1", 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.Fleet = armcontainerservicefleet.Fleet{ - // Name: to.Ptr("fleet-1"), - // Type: to.Ptr("Microsoft.ContainerService/fleets"), - // ID: to.Ptr("/subscriptions/subid1/resourcegroups/rg1/providers/Microsoft.ContainerService/fleets/fleet-1"), - // SystemData: &armcontainerservicefleet.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-03-23T05:40:40.657Z"); return t}()), - // CreatedBy: to.Ptr("someUser"), - // CreatedByType: to.Ptr(armcontainerservicefleet.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-03-23T05:40:40.657Z"); return t}()), - // LastModifiedBy: to.Ptr("someOtherUser"), - // LastModifiedByType: to.Ptr(armcontainerservicefleet.CreatedByTypeUser), - // }, - // Location: to.Ptr("East US"), - // Tags: map[string]*string{ - // "archv2": to.Ptr(""), - // "tier": to.Ptr("production"), - // }, - // ETag: to.Ptr("23ujdflewrj3="), - // Properties: &armcontainerservicefleet.FleetProperties{ - // ProvisioningState: to.Ptr(armcontainerservicefleet.FleetProvisioningStateSucceeded), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/678aeba91061a67e9af8b9aaf41f85b8aea06c7c/specification/containerservice/resource-manager/Microsoft.ContainerService/fleet/stable/2023-10-15/examples/Fleets_CreateOrUpdate.json -func ExampleFleetsClient_BeginCreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcontainerservicefleet.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewFleetsClient().BeginCreateOrUpdate(ctx, "rg1", "fleet1", armcontainerservicefleet.Fleet{ - Location: to.Ptr("East US"), - Tags: map[string]*string{ - "archv2": to.Ptr(""), - "tier": to.Ptr("production"), - }, - Properties: &armcontainerservicefleet.FleetProperties{}, - }, &armcontainerservicefleet.FleetsClientBeginCreateOrUpdateOptions{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.Fleet = armcontainerservicefleet.Fleet{ - // Name: to.Ptr("fleet-1"), - // Type: to.Ptr("Microsoft.ContainerService/fleets"), - // ID: to.Ptr("/subscriptions/subid1/resourcegroups/rg1/providers/Microsoft.ContainerService/fleets/fleet-1"), - // SystemData: &armcontainerservicefleet.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-03-23T05:40:40.657Z"); return t}()), - // CreatedBy: to.Ptr("someUser"), - // CreatedByType: to.Ptr(armcontainerservicefleet.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-03-23T05:40:40.657Z"); return t}()), - // LastModifiedBy: to.Ptr("someOtherUser"), - // LastModifiedByType: to.Ptr(armcontainerservicefleet.CreatedByTypeUser), - // }, - // Location: to.Ptr("East US"), - // Tags: map[string]*string{ - // "archv2": to.Ptr(""), - // "tier": to.Ptr("production"), - // }, - // ETag: to.Ptr("23ujdflewrj3="), - // Properties: &armcontainerservicefleet.FleetProperties{ - // ProvisioningState: to.Ptr(armcontainerservicefleet.FleetProvisioningStateSucceeded), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/678aeba91061a67e9af8b9aaf41f85b8aea06c7c/specification/containerservice/resource-manager/Microsoft.ContainerService/fleet/stable/2023-10-15/examples/Fleets_PatchTags.json -func ExampleFleetsClient_BeginUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcontainerservicefleet.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewFleetsClient().BeginUpdate(ctx, "rg1", "fleet1", armcontainerservicefleet.FleetPatch{ - Tags: map[string]*string{ - "env": to.Ptr("prod"), - "tier": to.Ptr("secure"), - }, - }, &armcontainerservicefleet.FleetsClientBeginUpdateOptions{IfMatch: to.Ptr("dfjkwelr7384")}) - 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.Fleet = armcontainerservicefleet.Fleet{ - // Name: to.Ptr("fleet-1"), - // Type: to.Ptr("Microsoft.ContainerService/fleets"), - // ID: to.Ptr("/subscriptions/subid1/resourcegroups/rg1/providers/Microsoft.ContainerService/fleets/fleet-1"), - // SystemData: &armcontainerservicefleet.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-03-23T05:40:40.657Z"); return t}()), - // CreatedBy: to.Ptr("someUser"), - // CreatedByType: to.Ptr(armcontainerservicefleet.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-03-23T05:40:40.657Z"); return t}()), - // LastModifiedBy: to.Ptr("someOtherUser"), - // LastModifiedByType: to.Ptr(armcontainerservicefleet.CreatedByTypeUser), - // }, - // Location: to.Ptr("East US"), - // Tags: map[string]*string{ - // "env": to.Ptr("prod"), - // "tier": to.Ptr("secure"), - // }, - // ETag: to.Ptr("23ujdflewrj3="), - // Properties: &armcontainerservicefleet.FleetProperties{ - // ProvisioningState: to.Ptr(armcontainerservicefleet.FleetProvisioningStateSucceeded), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/678aeba91061a67e9af8b9aaf41f85b8aea06c7c/specification/containerservice/resource-manager/Microsoft.ContainerService/fleet/stable/2023-10-15/examples/Fleets_Delete.json -func ExampleFleetsClient_BeginDelete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcontainerservicefleet.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewFleetsClient().BeginDelete(ctx, "rg1", "fleet1", &armcontainerservicefleet.FleetsClientBeginDeleteOptions{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/678aeba91061a67e9af8b9aaf41f85b8aea06c7c/specification/containerservice/resource-manager/Microsoft.ContainerService/fleet/stable/2023-10-15/examples/Fleets_ListCredentialsResult.json -func ExampleFleetsClient_ListCredentials() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcontainerservicefleet.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewFleetsClient().ListCredentials(ctx, "rg1", "fleet", 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.FleetCredentialResults = armcontainerservicefleet.FleetCredentialResults{ - // Kubeconfigs: []*armcontainerservicefleet.FleetCredentialResult{ - // { - // Name: to.Ptr("credentialName1"), - // Value: []byte("Y3JlZGVudGlhbFZhbHVlMQ=="), - // }}, - // } -} diff --git a/sdk/resourcemanager/containerservicefleet/armcontainerservicefleet/fleetupdatestrategies_client.go b/sdk/resourcemanager/containerservicefleet/armcontainerservicefleet/fleetupdatestrategies_client.go index 2d4b7efa252d..70eee677e3f5 100644 --- a/sdk/resourcemanager/containerservicefleet/armcontainerservicefleet/fleetupdatestrategies_client.go +++ b/sdk/resourcemanager/containerservicefleet/armcontainerservicefleet/fleetupdatestrategies_client.go @@ -46,7 +46,7 @@ func NewFleetUpdateStrategiesClient(subscriptionID string, credential azcore.Tok // BeginCreateOrUpdate - Create a FleetUpdateStrategy // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-10-15 +// Generated from API version 2024-02-02-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - fleetName - The name of the Fleet resource. // - updateStrategyName - The name of the UpdateStrategy resource. @@ -74,7 +74,7 @@ func (client *FleetUpdateStrategiesClient) BeginCreateOrUpdate(ctx context.Conte // CreateOrUpdate - Create a FleetUpdateStrategy // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-10-15 +// Generated from API version 2024-02-02-preview func (client *FleetUpdateStrategiesClient) createOrUpdate(ctx context.Context, resourceGroupName string, fleetName string, updateStrategyName string, resource FleetUpdateStrategy, options *FleetUpdateStrategiesClientBeginCreateOrUpdateOptions) (*http.Response, error) { var err error const operationName = "FleetUpdateStrategiesClient.BeginCreateOrUpdate" @@ -120,7 +120,7 @@ func (client *FleetUpdateStrategiesClient) createOrUpdateCreateRequest(ctx conte return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-10-15") + reqQP.Set("api-version", "2024-02-02-preview") req.Raw().URL.RawQuery = reqQP.Encode() if options != nil && options.IfMatch != nil { req.Raw().Header["If-Match"] = []string{*options.IfMatch} @@ -138,7 +138,7 @@ func (client *FleetUpdateStrategiesClient) createOrUpdateCreateRequest(ctx conte // BeginDelete - Delete a FleetUpdateStrategy // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-10-15 +// Generated from API version 2024-02-02-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - fleetName - The name of the Fleet resource. // - updateStrategyName - The name of the UpdateStrategy resource. @@ -165,7 +165,7 @@ func (client *FleetUpdateStrategiesClient) BeginDelete(ctx context.Context, reso // Delete - Delete a FleetUpdateStrategy // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-10-15 +// Generated from API version 2024-02-02-preview func (client *FleetUpdateStrategiesClient) deleteOperation(ctx context.Context, resourceGroupName string, fleetName string, updateStrategyName string, options *FleetUpdateStrategiesClientBeginDeleteOptions) (*http.Response, error) { var err error const operationName = "FleetUpdateStrategiesClient.BeginDelete" @@ -211,7 +211,7 @@ func (client *FleetUpdateStrategiesClient) deleteCreateRequest(ctx context.Conte return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-10-15") + reqQP.Set("api-version", "2024-02-02-preview") req.Raw().URL.RawQuery = reqQP.Encode() if options != nil && options.IfMatch != nil { req.Raw().Header["If-Match"] = []string{*options.IfMatch} @@ -223,7 +223,7 @@ func (client *FleetUpdateStrategiesClient) deleteCreateRequest(ctx context.Conte // Get - Get a FleetUpdateStrategy // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-10-15 +// Generated from API version 2024-02-02-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - fleetName - The name of the Fleet resource. // - updateStrategyName - The name of the UpdateStrategy resource. @@ -275,7 +275,7 @@ func (client *FleetUpdateStrategiesClient) getCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-10-15") + reqQP.Set("api-version", "2024-02-02-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -292,7 +292,7 @@ func (client *FleetUpdateStrategiesClient) getHandleResponse(resp *http.Response // NewListByFleetPager - List FleetUpdateStrategy resources by Fleet // -// Generated from API version 2023-10-15 +// Generated from API version 2024-02-02-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - fleetName - The name of the Fleet resource. // - options - FleetUpdateStrategiesClientListByFleetOptions contains the optional parameters for the FleetUpdateStrategiesClient.NewListByFleetPager @@ -340,7 +340,7 @@ func (client *FleetUpdateStrategiesClient) listByFleetCreateRequest(ctx context. return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-10-15") + reqQP.Set("api-version", "2024-02-02-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/containerservicefleet/armcontainerservicefleet/fleetupdatestrategies_client_example_test.go b/sdk/resourcemanager/containerservicefleet/armcontainerservicefleet/fleetupdatestrategies_client_example_test.go deleted file mode 100644 index 3e836b017d09..000000000000 --- a/sdk/resourcemanager/containerservicefleet/armcontainerservicefleet/fleetupdatestrategies_client_example_test.go +++ /dev/null @@ -1,212 +0,0 @@ -//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 armcontainerservicefleet_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/containerservicefleet/armcontainerservicefleet" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/678aeba91061a67e9af8b9aaf41f85b8aea06c7c/specification/containerservice/resource-manager/Microsoft.ContainerService/fleet/stable/2023-10-15/examples/UpdateStrategies_ListByFleet.json -func ExampleFleetUpdateStrategiesClient_NewListByFleetPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcontainerservicefleet.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewFleetUpdateStrategiesClient().NewListByFleetPager("rg1", "fleet1", 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.FleetUpdateStrategyListResult = armcontainerservicefleet.FleetUpdateStrategyListResult{ - // Value: []*armcontainerservicefleet.FleetUpdateStrategy{ - // { - // Name: to.Ptr("strategy1"), - // Type: to.Ptr("Microsoft.ContainerService/fleets/updateStrategies"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.ContainerService/fleets/myFleet/updateStrategies/strategy1"), - // SystemData: &armcontainerservicefleet.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-03-01T01:10:08.395Z"); return t}()), - // CreatedBy: to.Ptr("@contoso.com"), - // CreatedByType: to.Ptr(armcontainerservicefleet.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-03-01T01:10:08.395Z"); return t}()), - // LastModifiedBy: to.Ptr("@contoso.com"), - // LastModifiedByType: to.Ptr(armcontainerservicefleet.CreatedByTypeUser), - // }, - // ETag: to.Ptr("\"EtagValue\""), - // Properties: &armcontainerservicefleet.FleetUpdateStrategyProperties{ - // ProvisioningState: to.Ptr(armcontainerservicefleet.FleetUpdateStrategyProvisioningStateSucceeded), - // Strategy: &armcontainerservicefleet.UpdateRunStrategy{ - // Stages: []*armcontainerservicefleet.UpdateStage{ - // { - // Name: to.Ptr("stage1"), - // AfterStageWaitInSeconds: to.Ptr[int32](3600), - // Groups: []*armcontainerservicefleet.UpdateGroup{ - // { - // Name: to.Ptr("group-a"), - // }}, - // }}, - // }, - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/678aeba91061a67e9af8b9aaf41f85b8aea06c7c/specification/containerservice/resource-manager/Microsoft.ContainerService/fleet/stable/2023-10-15/examples/UpdateStrategies_Get.json -func ExampleFleetUpdateStrategiesClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcontainerservicefleet.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewFleetUpdateStrategiesClient().Get(ctx, "rg1", "fleet1", "strategy1", 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.FleetUpdateStrategy = armcontainerservicefleet.FleetUpdateStrategy{ - // Name: to.Ptr("strategy1"), - // Type: to.Ptr("Microsoft.ContainerService/fleets/updateStrategies"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.ContainerService/fleets/myFleet/updateStrategies/strategy1"), - // SystemData: &armcontainerservicefleet.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-03-01T01:10:08.395Z"); return t}()), - // CreatedBy: to.Ptr("@contoso.com"), - // CreatedByType: to.Ptr(armcontainerservicefleet.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-03-01T01:10:08.395Z"); return t}()), - // LastModifiedBy: to.Ptr("@contoso.com"), - // LastModifiedByType: to.Ptr(armcontainerservicefleet.CreatedByTypeUser), - // }, - // ETag: to.Ptr("\"EtagValue\""), - // Properties: &armcontainerservicefleet.FleetUpdateStrategyProperties{ - // ProvisioningState: to.Ptr(armcontainerservicefleet.FleetUpdateStrategyProvisioningStateSucceeded), - // Strategy: &armcontainerservicefleet.UpdateRunStrategy{ - // Stages: []*armcontainerservicefleet.UpdateStage{ - // { - // Name: to.Ptr("stage1"), - // AfterStageWaitInSeconds: to.Ptr[int32](3600), - // Groups: []*armcontainerservicefleet.UpdateGroup{ - // { - // Name: to.Ptr("group-a"), - // }}, - // }}, - // }, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/678aeba91061a67e9af8b9aaf41f85b8aea06c7c/specification/containerservice/resource-manager/Microsoft.ContainerService/fleet/stable/2023-10-15/examples/UpdateStrategies_CreateOrUpdate.json -func ExampleFleetUpdateStrategiesClient_BeginCreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcontainerservicefleet.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewFleetUpdateStrategiesClient().BeginCreateOrUpdate(ctx, "rg1", "fleet1", "strartegy1", armcontainerservicefleet.FleetUpdateStrategy{ - Properties: &armcontainerservicefleet.FleetUpdateStrategyProperties{ - Strategy: &armcontainerservicefleet.UpdateRunStrategy{ - Stages: []*armcontainerservicefleet.UpdateStage{ - { - Name: to.Ptr("stage1"), - AfterStageWaitInSeconds: to.Ptr[int32](3600), - Groups: []*armcontainerservicefleet.UpdateGroup{ - { - Name: to.Ptr("group-a"), - }}, - }}, - }, - }, - }, &armcontainerservicefleet.FleetUpdateStrategiesClientBeginCreateOrUpdateOptions{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.FleetUpdateStrategy = armcontainerservicefleet.FleetUpdateStrategy{ - // Name: to.Ptr("strategy1"), - // Type: to.Ptr("Microsoft.ContainerService/fleets/updateStrategies"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.ContainerService/fleets/myFleet/updateStrategies/strategy1"), - // SystemData: &armcontainerservicefleet.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-03-01T01:10:08.395Z"); return t}()), - // CreatedBy: to.Ptr("@contoso.com"), - // CreatedByType: to.Ptr(armcontainerservicefleet.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-03-01T01:10:08.395Z"); return t}()), - // LastModifiedBy: to.Ptr("@contoso.com"), - // LastModifiedByType: to.Ptr(armcontainerservicefleet.CreatedByTypeUser), - // }, - // ETag: to.Ptr("\"EtagValue\""), - // Properties: &armcontainerservicefleet.FleetUpdateStrategyProperties{ - // ProvisioningState: to.Ptr(armcontainerservicefleet.FleetUpdateStrategyProvisioningStateSucceeded), - // Strategy: &armcontainerservicefleet.UpdateRunStrategy{ - // Stages: []*armcontainerservicefleet.UpdateStage{ - // { - // Name: to.Ptr("stage1"), - // AfterStageWaitInSeconds: to.Ptr[int32](3600), - // Groups: []*armcontainerservicefleet.UpdateGroup{ - // { - // Name: to.Ptr("group-a"), - // }}, - // }}, - // }, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/678aeba91061a67e9af8b9aaf41f85b8aea06c7c/specification/containerservice/resource-manager/Microsoft.ContainerService/fleet/stable/2023-10-15/examples/UpdateStrategies_Delete.json -func ExampleFleetUpdateStrategiesClient_BeginDelete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcontainerservicefleet.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewFleetUpdateStrategiesClient().BeginDelete(ctx, "rg1", "fleet1", "strategy1", &armcontainerservicefleet.FleetUpdateStrategiesClientBeginDeleteOptions{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) - } -} diff --git a/sdk/resourcemanager/containerservicefleet/armcontainerservicefleet/go.mod b/sdk/resourcemanager/containerservicefleet/armcontainerservicefleet/go.mod index 9fc4b8f4f619..033a33abdd54 100644 --- a/sdk/resourcemanager/containerservicefleet/armcontainerservicefleet/go.mod +++ b/sdk/resourcemanager/containerservicefleet/armcontainerservicefleet/go.mod @@ -4,7 +4,6 @@ go 1.18 require ( github.com/Azure/azure-sdk-for-go/sdk/azcore v1.9.0 - github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.4.0 github.com/Azure/azure-sdk-for-go/sdk/internal v1.5.0 github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/internal/v2 v2.0.0 github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/resources/armresources v1.1.1 @@ -12,6 +11,7 @@ require ( ) require ( + github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.4.0 // indirect github.com/AzureAD/microsoft-authentication-library-for-go v1.1.1 // indirect github.com/davecgh/go-spew v1.1.1 // indirect github.com/dnaeon/go-vcr v1.2.0 // indirect diff --git a/sdk/resourcemanager/containerservicefleet/armcontainerservicefleet/models.go b/sdk/resourcemanager/containerservicefleet/armcontainerservicefleet/models.go index 336682021ce6..8e46ab6a2896 100644 --- a/sdk/resourcemanager/containerservicefleet/armcontainerservicefleet/models.go +++ b/sdk/resourcemanager/containerservicefleet/armcontainerservicefleet/models.go @@ -10,6 +10,28 @@ package armcontainerservicefleet import "time" +// APIServerAccessProfile - Access profile for the Fleet hub API server. +type APIServerAccessProfile struct { + // Whether to create the Fleet hub as a private cluster or not. + EnablePrivateCluster *bool + + // Whether to enable apiserver vnet integration for the Fleet hub or not. + EnableVnetIntegration *bool + + // The subnet to be used when apiserver vnet integration is enabled. It is required when creating a new Fleet with BYO vnet. + SubnetID *string +} + +// AgentProfile - Agent profile for the Fleet hub. +type AgentProfile struct { + // The ID of the subnet which the Fleet hub node will join on startup. If this is not specified, a vnet and subnet will be + // generated and used. + SubnetID *string + + // The virtual machine size of the Fleet hub. + VMSize *string +} + // ErrorAdditionalInfo - The resource management error additional info. type ErrorAdditionalInfo struct { // READ-ONLY; The additional info. @@ -85,6 +107,27 @@ type FleetCredentialResults struct { Kubeconfigs []*FleetCredentialResult } +// FleetHubProfile - The FleetHubProfile configures the fleet hub. +type FleetHubProfile struct { + // The access profile for the Fleet hub API server. + APIServerAccessProfile *APIServerAccessProfile + + // The agent profile for the Fleet hub. + AgentProfile *AgentProfile + + // DNS prefix used to create the FQDN for the Fleet hub. + DNSPrefix *string + + // READ-ONLY; The FQDN of the Fleet hub. + Fqdn *string + + // READ-ONLY; The Kubernetes version of the Fleet hub. + KubernetesVersion *string + + // READ-ONLY; The Azure Portal FQDN of the Fleet hub. + PortalFqdn *string +} + // FleetListResult - The response of a Fleet list operation. type FleetListResult struct { // REQUIRED; The Fleet items on this page @@ -163,6 +206,9 @@ type FleetPatch struct { // FleetProperties - Fleet properties. type FleetProperties struct { + // The FleetHubProfile configures the Fleet's hub. + HubProfile *FleetHubProfile + // READ-ONLY; The status of the last operation. ProvisioningState *FleetProvisioningState } @@ -333,6 +379,22 @@ type OperationListResult struct { Value []*Operation } +// SkipProperties - The properties of a skip operation containing multiple skip requests. +type SkipProperties struct { + // REQUIRED; The targets to skip. + Targets []*SkipRequest +} + +// SkipRequest - The definition of a single skip request. +type SkipRequest struct { + // REQUIRED; The skip target. To skip a member/group/stage, use the member/group/stage's name; Tp skip an after stage wait, + // use the parent stage's name. + Target *string + + // REQUIRED; The skip target type. + Type *TargetType +} + // SystemData - Metadata pertaining to creation and last modification of the resource. type SystemData struct { // The timestamp of resource creation (UTC). diff --git a/sdk/resourcemanager/containerservicefleet/armcontainerservicefleet/models_serde.go b/sdk/resourcemanager/containerservicefleet/armcontainerservicefleet/models_serde.go index 6525c8f9dd5b..f75bc3d3bfbe 100644 --- a/sdk/resourcemanager/containerservicefleet/armcontainerservicefleet/models_serde.go +++ b/sdk/resourcemanager/containerservicefleet/armcontainerservicefleet/models_serde.go @@ -16,6 +16,72 @@ import ( "reflect" ) +// MarshalJSON implements the json.Marshaller interface for type APIServerAccessProfile. +func (a APIServerAccessProfile) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "enablePrivateCluster", a.EnablePrivateCluster) + populate(objectMap, "enableVnetIntegration", a.EnableVnetIntegration) + populate(objectMap, "subnetId", a.SubnetID) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type APIServerAccessProfile. +func (a *APIServerAccessProfile) 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 "enablePrivateCluster": + err = unpopulate(val, "EnablePrivateCluster", &a.EnablePrivateCluster) + delete(rawMsg, key) + case "enableVnetIntegration": + err = unpopulate(val, "EnableVnetIntegration", &a.EnableVnetIntegration) + delete(rawMsg, key) + case "subnetId": + err = unpopulate(val, "SubnetID", &a.SubnetID) + 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 AgentProfile. +func (a AgentProfile) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "subnetId", a.SubnetID) + populate(objectMap, "vmSize", a.VMSize) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type AgentProfile. +func (a *AgentProfile) 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 "subnetId": + err = unpopulate(val, "SubnetID", &a.SubnetID) + delete(rawMsg, key) + case "vmSize": + err = unpopulate(val, "VMSize", &a.VMSize) + 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 ErrorAdditionalInfo. func (e ErrorAdditionalInfo) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) @@ -207,6 +273,53 @@ func (f *FleetCredentialResults) UnmarshalJSON(data []byte) error { return nil } +// MarshalJSON implements the json.Marshaller interface for type FleetHubProfile. +func (f FleetHubProfile) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "apiServerAccessProfile", f.APIServerAccessProfile) + populate(objectMap, "agentProfile", f.AgentProfile) + populate(objectMap, "dnsPrefix", f.DNSPrefix) + populate(objectMap, "fqdn", f.Fqdn) + populate(objectMap, "kubernetesVersion", f.KubernetesVersion) + populate(objectMap, "portalFqdn", f.PortalFqdn) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type FleetHubProfile. +func (f *FleetHubProfile) 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", f, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "apiServerAccessProfile": + err = unpopulate(val, "APIServerAccessProfile", &f.APIServerAccessProfile) + delete(rawMsg, key) + case "agentProfile": + err = unpopulate(val, "AgentProfile", &f.AgentProfile) + delete(rawMsg, key) + case "dnsPrefix": + err = unpopulate(val, "DNSPrefix", &f.DNSPrefix) + delete(rawMsg, key) + case "fqdn": + err = unpopulate(val, "Fqdn", &f.Fqdn) + delete(rawMsg, key) + case "kubernetesVersion": + err = unpopulate(val, "KubernetesVersion", &f.KubernetesVersion) + delete(rawMsg, key) + case "portalFqdn": + err = unpopulate(val, "PortalFqdn", &f.PortalFqdn) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", f, err) + } + } + return nil +} + // MarshalJSON implements the json.Marshaller interface for type FleetListResult. func (f FleetListResult) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) @@ -439,6 +552,7 @@ func (f *FleetPatch) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type FleetProperties. func (f FleetProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) + populate(objectMap, "hubProfile", f.HubProfile) populate(objectMap, "provisioningState", f.ProvisioningState) return json.Marshal(objectMap) } @@ -452,6 +566,9 @@ func (f *FleetProperties) UnmarshalJSON(data []byte) error { for key, val := range rawMsg { var err error switch key { + case "hubProfile": + err = unpopulate(val, "HubProfile", &f.HubProfile) + delete(rawMsg, key) case "provisioningState": err = unpopulate(val, "ProvisioningState", &f.ProvisioningState) delete(rawMsg, key) @@ -910,6 +1027,64 @@ func (o *OperationListResult) UnmarshalJSON(data []byte) error { return nil } +// MarshalJSON implements the json.Marshaller interface for type SkipProperties. +func (s SkipProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "targets", s.Targets) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type SkipProperties. +func (s *SkipProperties) 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 "targets": + err = unpopulate(val, "Targets", &s.Targets) + 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 SkipRequest. +func (s SkipRequest) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "target", s.Target) + populate(objectMap, "type", s.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type SkipRequest. +func (s *SkipRequest) 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 "target": + err = unpopulate(val, "Target", &s.Target) + 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 SystemData. func (s SystemData) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) diff --git a/sdk/resourcemanager/containerservicefleet/armcontainerservicefleet/operations_client.go b/sdk/resourcemanager/containerservicefleet/armcontainerservicefleet/operations_client.go index 6eef32070fcb..5483e10aaaff 100644 --- a/sdk/resourcemanager/containerservicefleet/armcontainerservicefleet/operations_client.go +++ b/sdk/resourcemanager/containerservicefleet/armcontainerservicefleet/operations_client.go @@ -39,7 +39,7 @@ func NewOperationsClient(credential azcore.TokenCredential, options *arm.ClientO // NewListPager - List the operations for the provider // -// Generated from API version 2023-10-15 +// Generated from API version 2024-02-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]{ @@ -72,7 +72,7 @@ func (client *OperationsClient) listCreateRequest(ctx context.Context, options * return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-10-15") + reqQP.Set("api-version", "2024-02-02-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/containerservicefleet/armcontainerservicefleet/operations_client_example_test.go b/sdk/resourcemanager/containerservicefleet/armcontainerservicefleet/operations_client_example_test.go deleted file mode 100644 index 2a5eecb213a0..000000000000 --- a/sdk/resourcemanager/containerservicefleet/armcontainerservicefleet/operations_client_example_test.go +++ /dev/null @@ -1,56 +0,0 @@ -//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 armcontainerservicefleet_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/containerservicefleet/armcontainerservicefleet" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/678aeba91061a67e9af8b9aaf41f85b8aea06c7c/specification/containerservice/resource-manager/Microsoft.ContainerService/fleet/stable/2023-10-15/examples/Operations_List.json -func ExampleOperationsClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcontainerservicefleet.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewOperationsClient().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.OperationListResult = armcontainerservicefleet.OperationListResult{ - // Value: []*armcontainerservicefleet.Operation{ - // { - // Name: to.Ptr("Microsoft.ContainerService/locations/operations/read"), - // Display: &armcontainerservicefleet.OperationDisplay{ - // Description: to.Ptr("Gets the status of an asynchronous operation"), - // Operation: to.Ptr("Get Operation"), - // Provider: to.Ptr("Microsoft Container Service"), - // Resource: to.Ptr("Operation"), - // }, - // Origin: to.Ptr(armcontainerservicefleet.OriginUserSystem), - // }}, - // } - } -} diff --git a/sdk/resourcemanager/containerservicefleet/armcontainerservicefleet/options.go b/sdk/resourcemanager/containerservicefleet/armcontainerservicefleet/options.go index 393d8020ce28..bf0c6820df81 100644 --- a/sdk/resourcemanager/containerservicefleet/armcontainerservicefleet/options.go +++ b/sdk/resourcemanager/containerservicefleet/armcontainerservicefleet/options.go @@ -188,3 +188,9 @@ type UpdateRunsClientGetOptions struct { type UpdateRunsClientListByFleetOptions struct { // placeholder for future optional parameters } + +// UpdateRunsClientSkipOptions contains the optional parameters for the UpdateRunsClient.Skip method. +type UpdateRunsClientSkipOptions struct { + // The request should only proceed if an entity matches this string. + IfMatch *string +} diff --git a/sdk/resourcemanager/containerservicefleet/armcontainerservicefleet/response_types.go b/sdk/resourcemanager/containerservicefleet/armcontainerservicefleet/response_types.go index 45fc44310741..8934e9254c4c 100644 --- a/sdk/resourcemanager/containerservicefleet/armcontainerservicefleet/response_types.go +++ b/sdk/resourcemanager/containerservicefleet/armcontainerservicefleet/response_types.go @@ -130,6 +130,12 @@ type UpdateRunsClientListByFleetResponse struct { UpdateRunListResult } +// UpdateRunsClientSkipResponse contains the response from method UpdateRunsClient.Skip. +type UpdateRunsClientSkipResponse struct { + // A multi-stage process to perform update operations across members of a Fleet. + UpdateRun +} + // UpdateRunsClientStartResponse contains the response from method UpdateRunsClient.BeginStart. type UpdateRunsClientStartResponse struct { // A multi-stage process to perform update operations across members of a Fleet. diff --git a/sdk/resourcemanager/containerservicefleet/armcontainerservicefleet/updateruns_client.go b/sdk/resourcemanager/containerservicefleet/armcontainerservicefleet/updateruns_client.go index 518a94d25610..da3edb936a80 100644 --- a/sdk/resourcemanager/containerservicefleet/armcontainerservicefleet/updateruns_client.go +++ b/sdk/resourcemanager/containerservicefleet/armcontainerservicefleet/updateruns_client.go @@ -46,7 +46,7 @@ func NewUpdateRunsClient(subscriptionID string, credential azcore.TokenCredentia // BeginCreateOrUpdate - Create a UpdateRun // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-10-15 +// Generated from API version 2024-02-02-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - fleetName - The name of the Fleet resource. // - updateRunName - The name of the UpdateRun resource. @@ -74,7 +74,7 @@ func (client *UpdateRunsClient) BeginCreateOrUpdate(ctx context.Context, resourc // CreateOrUpdate - Create a UpdateRun // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-10-15 +// Generated from API version 2024-02-02-preview func (client *UpdateRunsClient) createOrUpdate(ctx context.Context, resourceGroupName string, fleetName string, updateRunName string, resource UpdateRun, options *UpdateRunsClientBeginCreateOrUpdateOptions) (*http.Response, error) { var err error const operationName = "UpdateRunsClient.BeginCreateOrUpdate" @@ -120,7 +120,7 @@ func (client *UpdateRunsClient) createOrUpdateCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-10-15") + reqQP.Set("api-version", "2024-02-02-preview") req.Raw().URL.RawQuery = reqQP.Encode() if options != nil && options.IfMatch != nil { req.Raw().Header["If-Match"] = []string{*options.IfMatch} @@ -138,7 +138,7 @@ func (client *UpdateRunsClient) createOrUpdateCreateRequest(ctx context.Context, // BeginDelete - Delete a UpdateRun // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-10-15 +// Generated from API version 2024-02-02-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - fleetName - The name of the Fleet resource. // - updateRunName - The name of the UpdateRun resource. @@ -164,7 +164,7 @@ func (client *UpdateRunsClient) BeginDelete(ctx context.Context, resourceGroupNa // Delete - Delete a UpdateRun // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-10-15 +// Generated from API version 2024-02-02-preview func (client *UpdateRunsClient) deleteOperation(ctx context.Context, resourceGroupName string, fleetName string, updateRunName string, options *UpdateRunsClientBeginDeleteOptions) (*http.Response, error) { var err error const operationName = "UpdateRunsClient.BeginDelete" @@ -210,7 +210,7 @@ func (client *UpdateRunsClient) deleteCreateRequest(ctx context.Context, resourc return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-10-15") + reqQP.Set("api-version", "2024-02-02-preview") req.Raw().URL.RawQuery = reqQP.Encode() if options != nil && options.IfMatch != nil { req.Raw().Header["If-Match"] = []string{*options.IfMatch} @@ -222,7 +222,7 @@ func (client *UpdateRunsClient) deleteCreateRequest(ctx context.Context, resourc // Get - Get a UpdateRun // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-10-15 +// Generated from API version 2024-02-02-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - fleetName - The name of the Fleet resource. // - updateRunName - The name of the UpdateRun resource. @@ -273,7 +273,7 @@ func (client *UpdateRunsClient) getCreateRequest(ctx context.Context, resourceGr return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-10-15") + reqQP.Set("api-version", "2024-02-02-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -290,7 +290,7 @@ func (client *UpdateRunsClient) getHandleResponse(resp *http.Response) (UpdateRu // NewListByFleetPager - List UpdateRun resources by Fleet // -// Generated from API version 2023-10-15 +// Generated from API version 2024-02-02-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - fleetName - The name of the Fleet resource. // - options - UpdateRunsClientListByFleetOptions contains the optional parameters for the UpdateRunsClient.NewListByFleetPager @@ -338,7 +338,7 @@ func (client *UpdateRunsClient) listByFleetCreateRequest(ctx context.Context, re return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-10-15") + reqQP.Set("api-version", "2024-02-02-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -353,10 +353,86 @@ func (client *UpdateRunsClient) listByFleetHandleResponse(resp *http.Response) ( return result, nil } +// Skip - Skips one or a combination of member/group/stage/afterStageWait(s) of an update run. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2024-02-02-preview +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - fleetName - The name of the Fleet resource. +// - updateRunName - The name of the UpdateRun resource. +// - body - The content of the action request +// - options - UpdateRunsClientSkipOptions contains the optional parameters for the UpdateRunsClient.Skip method. +func (client *UpdateRunsClient) Skip(ctx context.Context, resourceGroupName string, fleetName string, updateRunName string, body SkipProperties, options *UpdateRunsClientSkipOptions) (UpdateRunsClientSkipResponse, error) { + var err error + const operationName = "UpdateRunsClient.Skip" + ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) + ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) + defer func() { endSpan(err) }() + req, err := client.skipCreateRequest(ctx, resourceGroupName, fleetName, updateRunName, body, options) + if err != nil { + return UpdateRunsClientSkipResponse{}, err + } + httpResp, err := client.internal.Pipeline().Do(req) + if err != nil { + return UpdateRunsClientSkipResponse{}, err + } + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return UpdateRunsClientSkipResponse{}, err + } + resp, err := client.skipHandleResponse(httpResp) + return resp, err +} + +// skipCreateRequest creates the Skip request. +func (client *UpdateRunsClient) skipCreateRequest(ctx context.Context, resourceGroupName string, fleetName string, updateRunName string, body SkipProperties, options *UpdateRunsClientSkipOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/fleets/{fleetName}/updateRuns/{updateRunName}/skip" + 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 fleetName == "" { + return nil, errors.New("parameter fleetName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{fleetName}", url.PathEscape(fleetName)) + if updateRunName == "" { + return nil, errors.New("parameter updateRunName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{updateRunName}", url.PathEscape(updateRunName)) + 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-02-02-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + if options != nil && options.IfMatch != nil { + req.Raw().Header["If-Match"] = []string{*options.IfMatch} + } + req.Raw().Header["Accept"] = []string{"application/json"} + if err := runtime.MarshalAsJSON(req, body); err != nil { + return nil, err + } + return req, nil +} + +// skipHandleResponse handles the Skip response. +func (client *UpdateRunsClient) skipHandleResponse(resp *http.Response) (UpdateRunsClientSkipResponse, error) { + result := UpdateRunsClientSkipResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.UpdateRun); err != nil { + return UpdateRunsClientSkipResponse{}, err + } + return result, nil +} + // BeginStart - Starts an UpdateRun. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-10-15 +// Generated from API version 2024-02-02-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - fleetName - The name of the Fleet resource. // - updateRunName - The name of the UpdateRun resource. @@ -382,7 +458,7 @@ func (client *UpdateRunsClient) BeginStart(ctx context.Context, resourceGroupNam // Start - Starts an UpdateRun. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-10-15 +// Generated from API version 2024-02-02-preview func (client *UpdateRunsClient) start(ctx context.Context, resourceGroupName string, fleetName string, updateRunName string, options *UpdateRunsClientBeginStartOptions) (*http.Response, error) { var err error const operationName = "UpdateRunsClient.BeginStart" @@ -428,7 +504,7 @@ func (client *UpdateRunsClient) startCreateRequest(ctx context.Context, resource return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-10-15") + reqQP.Set("api-version", "2024-02-02-preview") req.Raw().URL.RawQuery = reqQP.Encode() if options != nil && options.IfMatch != nil { req.Raw().Header["If-Match"] = []string{*options.IfMatch} @@ -440,7 +516,7 @@ func (client *UpdateRunsClient) startCreateRequest(ctx context.Context, resource // BeginStop - Stops an UpdateRun. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-10-15 +// Generated from API version 2024-02-02-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - fleetName - The name of the Fleet resource. // - updateRunName - The name of the UpdateRun resource. @@ -466,7 +542,7 @@ func (client *UpdateRunsClient) BeginStop(ctx context.Context, resourceGroupName // Stop - Stops an UpdateRun. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-10-15 +// Generated from API version 2024-02-02-preview func (client *UpdateRunsClient) stop(ctx context.Context, resourceGroupName string, fleetName string, updateRunName string, options *UpdateRunsClientBeginStopOptions) (*http.Response, error) { var err error const operationName = "UpdateRunsClient.BeginStop" @@ -512,7 +588,7 @@ func (client *UpdateRunsClient) stopCreateRequest(ctx context.Context, resourceG return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-10-15") + reqQP.Set("api-version", "2024-02-02-preview") req.Raw().URL.RawQuery = reqQP.Encode() if options != nil && options.IfMatch != nil { req.Raw().Header["If-Match"] = []string{*options.IfMatch} diff --git a/sdk/resourcemanager/containerservicefleet/armcontainerservicefleet/updateruns_client_example_test.go b/sdk/resourcemanager/containerservicefleet/armcontainerservicefleet/updateruns_client_example_test.go deleted file mode 100644 index eac87e1fd8c6..000000000000 --- a/sdk/resourcemanager/containerservicefleet/armcontainerservicefleet/updateruns_client_example_test.go +++ /dev/null @@ -1,543 +0,0 @@ -//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 armcontainerservicefleet_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/containerservicefleet/armcontainerservicefleet" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/678aeba91061a67e9af8b9aaf41f85b8aea06c7c/specification/containerservice/resource-manager/Microsoft.ContainerService/fleet/stable/2023-10-15/examples/UpdateRuns_ListByFleet.json -func ExampleUpdateRunsClient_NewListByFleetPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcontainerservicefleet.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewUpdateRunsClient().NewListByFleetPager("rg1", "fleet1", 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.UpdateRunListResult = armcontainerservicefleet.UpdateRunListResult{ - // Value: []*armcontainerservicefleet.UpdateRun{ - // { - // Name: to.Ptr("run1"), - // Type: to.Ptr("Microsoft.ContainerService/fleets/updateRuns"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.ContainerService/fleets/myFleet/updateRuns/run1"), - // SystemData: &armcontainerservicefleet.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-03-01T01:10:08.395Z"); return t}()), - // CreatedBy: to.Ptr("@contoso.com"), - // CreatedByType: to.Ptr(armcontainerservicefleet.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-03-01T01:10:08.395Z"); return t}()), - // LastModifiedBy: to.Ptr("@contoso.com"), - // LastModifiedByType: to.Ptr(armcontainerservicefleet.CreatedByTypeUser), - // }, - // ETag: to.Ptr("\"EtagValue\""), - // Properties: &armcontainerservicefleet.UpdateRunProperties{ - // ManagedClusterUpdate: &armcontainerservicefleet.ManagedClusterUpdate{ - // NodeImageSelection: &armcontainerservicefleet.NodeImageSelection{ - // Type: to.Ptr(armcontainerservicefleet.NodeImageSelectionTypeLatest), - // }, - // Upgrade: &armcontainerservicefleet.ManagedClusterUpgradeSpec{ - // Type: to.Ptr(armcontainerservicefleet.ManagedClusterUpgradeTypeFull), - // KubernetesVersion: to.Ptr("1.26.1"), - // }, - // }, - // ProvisioningState: to.Ptr(armcontainerservicefleet.UpdateRunProvisioningStateSucceeded), - // Status: &armcontainerservicefleet.UpdateRunStatus{ - // Stages: []*armcontainerservicefleet.UpdateStageStatus{ - // { - // Name: to.Ptr("stage1"), - // AfterStageWaitStatus: &armcontainerservicefleet.WaitStatus{ - // Status: &armcontainerservicefleet.UpdateStatus{ - // State: to.Ptr(armcontainerservicefleet.UpdateStateNotStarted), - // }, - // WaitDurationInSeconds: to.Ptr[int32](3600), - // }, - // Groups: []*armcontainerservicefleet.UpdateGroupStatus{ - // { - // Name: to.Ptr("group-a"), - // Members: []*armcontainerservicefleet.MemberUpdateStatus{ - // { - // Name: to.Ptr("member-one"), - // ClusterResourceID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myClusters/providers/Microsoft.ContainerService/managedClusters/myCluster"), - // Status: &armcontainerservicefleet.UpdateStatus{ - // State: to.Ptr(armcontainerservicefleet.UpdateStateNotStarted), - // }, - // }}, - // Status: &armcontainerservicefleet.UpdateStatus{ - // State: to.Ptr(armcontainerservicefleet.UpdateStateNotStarted), - // }, - // }}, - // Status: &armcontainerservicefleet.UpdateStatus{ - // State: to.Ptr(armcontainerservicefleet.UpdateStateNotStarted), - // }, - // }}, - // Status: &armcontainerservicefleet.UpdateStatus{ - // State: to.Ptr(armcontainerservicefleet.UpdateStateNotStarted), - // }, - // }, - // Strategy: &armcontainerservicefleet.UpdateRunStrategy{ - // Stages: []*armcontainerservicefleet.UpdateStage{ - // { - // Name: to.Ptr("stage1"), - // AfterStageWaitInSeconds: to.Ptr[int32](3600), - // Groups: []*armcontainerservicefleet.UpdateGroup{ - // { - // Name: to.Ptr("group-a"), - // }}, - // }}, - // }, - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/678aeba91061a67e9af8b9aaf41f85b8aea06c7c/specification/containerservice/resource-manager/Microsoft.ContainerService/fleet/stable/2023-10-15/examples/UpdateRuns_Get.json -func ExampleUpdateRunsClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcontainerservicefleet.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewUpdateRunsClient().Get(ctx, "rg1", "fleet1", "run1", 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.UpdateRun = armcontainerservicefleet.UpdateRun{ - // Name: to.Ptr("run1"), - // Type: to.Ptr("Microsoft.ContainerService/fleets/updateRuns"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.ContainerService/fleets/myFleet/updateRuns/run1"), - // SystemData: &armcontainerservicefleet.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-03-01T01:10:08.395Z"); return t}()), - // CreatedBy: to.Ptr("@contoso.com"), - // CreatedByType: to.Ptr(armcontainerservicefleet.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-03-01T01:10:08.395Z"); return t}()), - // LastModifiedBy: to.Ptr("@contoso.com"), - // LastModifiedByType: to.Ptr(armcontainerservicefleet.CreatedByTypeUser), - // }, - // ETag: to.Ptr("\"EtagValue\""), - // Properties: &armcontainerservicefleet.UpdateRunProperties{ - // ManagedClusterUpdate: &armcontainerservicefleet.ManagedClusterUpdate{ - // NodeImageSelection: &armcontainerservicefleet.NodeImageSelection{ - // Type: to.Ptr(armcontainerservicefleet.NodeImageSelectionTypeLatest), - // }, - // Upgrade: &armcontainerservicefleet.ManagedClusterUpgradeSpec{ - // Type: to.Ptr(armcontainerservicefleet.ManagedClusterUpgradeTypeFull), - // KubernetesVersion: to.Ptr("1.26.1"), - // }, - // }, - // ProvisioningState: to.Ptr(armcontainerservicefleet.UpdateRunProvisioningStateSucceeded), - // Status: &armcontainerservicefleet.UpdateRunStatus{ - // Stages: []*armcontainerservicefleet.UpdateStageStatus{ - // { - // Name: to.Ptr("stage1"), - // AfterStageWaitStatus: &armcontainerservicefleet.WaitStatus{ - // Status: &armcontainerservicefleet.UpdateStatus{ - // State: to.Ptr(armcontainerservicefleet.UpdateStateNotStarted), - // }, - // WaitDurationInSeconds: to.Ptr[int32](3600), - // }, - // Groups: []*armcontainerservicefleet.UpdateGroupStatus{ - // { - // Name: to.Ptr("group-a"), - // Members: []*armcontainerservicefleet.MemberUpdateStatus{ - // { - // Name: to.Ptr("member-one"), - // ClusterResourceID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myClusters/providers/Microsoft.ContainerService/managedClusters/myCluster"), - // Status: &armcontainerservicefleet.UpdateStatus{ - // State: to.Ptr(armcontainerservicefleet.UpdateStateNotStarted), - // }, - // }}, - // Status: &armcontainerservicefleet.UpdateStatus{ - // State: to.Ptr(armcontainerservicefleet.UpdateStateNotStarted), - // }, - // }}, - // Status: &armcontainerservicefleet.UpdateStatus{ - // State: to.Ptr(armcontainerservicefleet.UpdateStateNotStarted), - // }, - // }}, - // Status: &armcontainerservicefleet.UpdateStatus{ - // State: to.Ptr(armcontainerservicefleet.UpdateStateNotStarted), - // }, - // }, - // Strategy: &armcontainerservicefleet.UpdateRunStrategy{ - // Stages: []*armcontainerservicefleet.UpdateStage{ - // { - // Name: to.Ptr("stage1"), - // AfterStageWaitInSeconds: to.Ptr[int32](3600), - // Groups: []*armcontainerservicefleet.UpdateGroup{ - // { - // Name: to.Ptr("group-a"), - // }}, - // }}, - // }, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/678aeba91061a67e9af8b9aaf41f85b8aea06c7c/specification/containerservice/resource-manager/Microsoft.ContainerService/fleet/stable/2023-10-15/examples/UpdateRuns_CreateOrUpdate.json -func ExampleUpdateRunsClient_BeginCreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcontainerservicefleet.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewUpdateRunsClient().BeginCreateOrUpdate(ctx, "rg1", "fleet1", "run1", armcontainerservicefleet.UpdateRun{ - Properties: &armcontainerservicefleet.UpdateRunProperties{ - ManagedClusterUpdate: &armcontainerservicefleet.ManagedClusterUpdate{ - NodeImageSelection: &armcontainerservicefleet.NodeImageSelection{ - Type: to.Ptr(armcontainerservicefleet.NodeImageSelectionTypeLatest), - }, - Upgrade: &armcontainerservicefleet.ManagedClusterUpgradeSpec{ - Type: to.Ptr(armcontainerservicefleet.ManagedClusterUpgradeTypeFull), - KubernetesVersion: to.Ptr("1.26.1"), - }, - }, - Strategy: &armcontainerservicefleet.UpdateRunStrategy{ - Stages: []*armcontainerservicefleet.UpdateStage{ - { - Name: to.Ptr("stage1"), - AfterStageWaitInSeconds: to.Ptr[int32](3600), - Groups: []*armcontainerservicefleet.UpdateGroup{ - { - Name: to.Ptr("group-a"), - }}, - }}, - }, - UpdateStrategyID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.ContainerService/fleets/myFleet/updateStrategies/strategy1"), - }, - }, &armcontainerservicefleet.UpdateRunsClientBeginCreateOrUpdateOptions{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.UpdateRun = armcontainerservicefleet.UpdateRun{ - // Name: to.Ptr("run1"), - // Type: to.Ptr("Microsoft.ContainerService/fleets/updateRuns"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.ContainerService/fleets/myFleet/updateRuns/run1"), - // SystemData: &armcontainerservicefleet.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-03-01T01:10:08.395Z"); return t}()), - // CreatedBy: to.Ptr("@contoso.com"), - // CreatedByType: to.Ptr(armcontainerservicefleet.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-03-01T01:10:08.395Z"); return t}()), - // LastModifiedBy: to.Ptr("@contoso.com"), - // LastModifiedByType: to.Ptr(armcontainerservicefleet.CreatedByTypeUser), - // }, - // ETag: to.Ptr("\"EtagValue\""), - // Properties: &armcontainerservicefleet.UpdateRunProperties{ - // ManagedClusterUpdate: &armcontainerservicefleet.ManagedClusterUpdate{ - // NodeImageSelection: &armcontainerservicefleet.NodeImageSelection{ - // Type: to.Ptr(armcontainerservicefleet.NodeImageSelectionTypeLatest), - // }, - // Upgrade: &armcontainerservicefleet.ManagedClusterUpgradeSpec{ - // Type: to.Ptr(armcontainerservicefleet.ManagedClusterUpgradeTypeFull), - // KubernetesVersion: to.Ptr("1.26.1"), - // }, - // }, - // ProvisioningState: to.Ptr(armcontainerservicefleet.UpdateRunProvisioningStateSucceeded), - // Status: &armcontainerservicefleet.UpdateRunStatus{ - // Stages: []*armcontainerservicefleet.UpdateStageStatus{ - // { - // Name: to.Ptr("stage1"), - // AfterStageWaitStatus: &armcontainerservicefleet.WaitStatus{ - // Status: &armcontainerservicefleet.UpdateStatus{ - // State: to.Ptr(armcontainerservicefleet.UpdateStateNotStarted), - // }, - // WaitDurationInSeconds: to.Ptr[int32](3600), - // }, - // Groups: []*armcontainerservicefleet.UpdateGroupStatus{ - // { - // Name: to.Ptr("group-a"), - // Members: []*armcontainerservicefleet.MemberUpdateStatus{ - // { - // Name: to.Ptr("member-one"), - // ClusterResourceID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myClusters/providers/Microsoft.ContainerService/managedClusters/myCluster"), - // Status: &armcontainerservicefleet.UpdateStatus{ - // State: to.Ptr(armcontainerservicefleet.UpdateStateNotStarted), - // }, - // }}, - // Status: &armcontainerservicefleet.UpdateStatus{ - // State: to.Ptr(armcontainerservicefleet.UpdateStateNotStarted), - // }, - // }}, - // Status: &armcontainerservicefleet.UpdateStatus{ - // State: to.Ptr(armcontainerservicefleet.UpdateStateNotStarted), - // }, - // }}, - // Status: &armcontainerservicefleet.UpdateStatus{ - // State: to.Ptr(armcontainerservicefleet.UpdateStateNotStarted), - // }, - // }, - // Strategy: &armcontainerservicefleet.UpdateRunStrategy{ - // Stages: []*armcontainerservicefleet.UpdateStage{ - // { - // Name: to.Ptr("stage1"), - // AfterStageWaitInSeconds: to.Ptr[int32](3600), - // Groups: []*armcontainerservicefleet.UpdateGroup{ - // { - // Name: to.Ptr("group-a"), - // }}, - // }}, - // }, - // UpdateStrategyID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.ContainerService/fleets/myFleet/updateStrategies/strategy1"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/678aeba91061a67e9af8b9aaf41f85b8aea06c7c/specification/containerservice/resource-manager/Microsoft.ContainerService/fleet/stable/2023-10-15/examples/UpdateRuns_Delete.json -func ExampleUpdateRunsClient_BeginDelete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcontainerservicefleet.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewUpdateRunsClient().BeginDelete(ctx, "rg1", "fleet1", "run1", &armcontainerservicefleet.UpdateRunsClientBeginDeleteOptions{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/678aeba91061a67e9af8b9aaf41f85b8aea06c7c/specification/containerservice/resource-manager/Microsoft.ContainerService/fleet/stable/2023-10-15/examples/UpdateRuns_Start.json -func ExampleUpdateRunsClient_BeginStart() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcontainerservicefleet.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewUpdateRunsClient().BeginStart(ctx, "rg1", "fleet1", "run1", &armcontainerservicefleet.UpdateRunsClientBeginStartOptions{IfMatch: 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.UpdateRun = armcontainerservicefleet.UpdateRun{ - // Name: to.Ptr("run1"), - // Type: to.Ptr("Microsoft.ContainerService/fleets/updateRuns"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.ContainerService/fleets/myFleet/updateRuns/run1"), - // SystemData: &armcontainerservicefleet.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-03-01T01:09:08.395Z"); return t}()), - // CreatedBy: to.Ptr("@contoso.com"), - // CreatedByType: to.Ptr(armcontainerservicefleet.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-03-01T01:10:08.395Z"); return t}()), - // LastModifiedBy: to.Ptr("@contoso.com"), - // LastModifiedByType: to.Ptr(armcontainerservicefleet.CreatedByTypeUser), - // }, - // ETag: to.Ptr("\"EtagValue\""), - // Properties: &armcontainerservicefleet.UpdateRunProperties{ - // ManagedClusterUpdate: &armcontainerservicefleet.ManagedClusterUpdate{ - // NodeImageSelection: &armcontainerservicefleet.NodeImageSelection{ - // Type: to.Ptr(armcontainerservicefleet.NodeImageSelectionTypeLatest), - // }, - // Upgrade: &armcontainerservicefleet.ManagedClusterUpgradeSpec{ - // Type: to.Ptr(armcontainerservicefleet.ManagedClusterUpgradeTypeFull), - // KubernetesVersion: to.Ptr("1.26.1"), - // }, - // }, - // ProvisioningState: to.Ptr(armcontainerservicefleet.UpdateRunProvisioningStateSucceeded), - // Status: &armcontainerservicefleet.UpdateRunStatus{ - // Stages: []*armcontainerservicefleet.UpdateStageStatus{ - // { - // Name: to.Ptr("stage1"), - // AfterStageWaitStatus: &armcontainerservicefleet.WaitStatus{ - // Status: &armcontainerservicefleet.UpdateStatus{ - // State: to.Ptr(armcontainerservicefleet.UpdateStateNotStarted), - // }, - // WaitDurationInSeconds: to.Ptr[int32](3600), - // }, - // Groups: []*armcontainerservicefleet.UpdateGroupStatus{ - // { - // Name: to.Ptr("group-a"), - // Members: []*armcontainerservicefleet.MemberUpdateStatus{ - // { - // Name: to.Ptr("member-one"), - // ClusterResourceID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myClusters/providers/Microsoft.ContainerService/managedClusters/myCluster"), - // Status: &armcontainerservicefleet.UpdateStatus{ - // State: to.Ptr(armcontainerservicefleet.UpdateStateRunning), - // }, - // }}, - // Status: &armcontainerservicefleet.UpdateStatus{ - // StartTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-03-01T01:10:08.395Z"); return t}()), - // State: to.Ptr(armcontainerservicefleet.UpdateStateRunning), - // }, - // }}, - // Status: &armcontainerservicefleet.UpdateStatus{ - // StartTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-03-01T01:10:08.395Z"); return t}()), - // State: to.Ptr(armcontainerservicefleet.UpdateStateRunning), - // }, - // }}, - // Status: &armcontainerservicefleet.UpdateStatus{ - // StartTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-03-01T01:10:08.395Z"); return t}()), - // State: to.Ptr(armcontainerservicefleet.UpdateStateRunning), - // }, - // }, - // Strategy: &armcontainerservicefleet.UpdateRunStrategy{ - // Stages: []*armcontainerservicefleet.UpdateStage{ - // { - // Name: to.Ptr("stage1"), - // AfterStageWaitInSeconds: to.Ptr[int32](3600), - // Groups: []*armcontainerservicefleet.UpdateGroup{ - // { - // Name: to.Ptr("group-a"), - // }}, - // }}, - // }, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/678aeba91061a67e9af8b9aaf41f85b8aea06c7c/specification/containerservice/resource-manager/Microsoft.ContainerService/fleet/stable/2023-10-15/examples/UpdateRuns_Stop.json -func ExampleUpdateRunsClient_BeginStop() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcontainerservicefleet.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewUpdateRunsClient().BeginStop(ctx, "rg1", "fleet1", "run1", &armcontainerservicefleet.UpdateRunsClientBeginStopOptions{IfMatch: 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.UpdateRun = armcontainerservicefleet.UpdateRun{ - // Name: to.Ptr("run1"), - // Type: to.Ptr("Microsoft.ContainerService/fleets/updateRuns"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.ContainerService/fleets/myFleet/updateRuns/run1"), - // SystemData: &armcontainerservicefleet.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-03-01T01:09:08.395Z"); return t}()), - // CreatedBy: to.Ptr("@contoso.com"), - // CreatedByType: to.Ptr(armcontainerservicefleet.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-03-01T01:10:08.395Z"); return t}()), - // LastModifiedBy: to.Ptr("@contoso.com"), - // LastModifiedByType: to.Ptr(armcontainerservicefleet.CreatedByTypeUser), - // }, - // ETag: to.Ptr("\"EtagValue\""), - // Properties: &armcontainerservicefleet.UpdateRunProperties{ - // ManagedClusterUpdate: &armcontainerservicefleet.ManagedClusterUpdate{ - // NodeImageSelection: &armcontainerservicefleet.NodeImageSelection{ - // Type: to.Ptr(armcontainerservicefleet.NodeImageSelectionTypeLatest), - // }, - // Upgrade: &armcontainerservicefleet.ManagedClusterUpgradeSpec{ - // Type: to.Ptr(armcontainerservicefleet.ManagedClusterUpgradeTypeFull), - // KubernetesVersion: to.Ptr("1.26.1"), - // }, - // }, - // ProvisioningState: to.Ptr(armcontainerservicefleet.UpdateRunProvisioningStateSucceeded), - // Status: &armcontainerservicefleet.UpdateRunStatus{ - // Stages: []*armcontainerservicefleet.UpdateStageStatus{ - // { - // Name: to.Ptr("stage1"), - // AfterStageWaitStatus: &armcontainerservicefleet.WaitStatus{ - // Status: &armcontainerservicefleet.UpdateStatus{ - // State: to.Ptr(armcontainerservicefleet.UpdateStateNotStarted), - // }, - // WaitDurationInSeconds: to.Ptr[int32](3600), - // }, - // Groups: []*armcontainerservicefleet.UpdateGroupStatus{ - // { - // Name: to.Ptr("group-a"), - // Members: []*armcontainerservicefleet.MemberUpdateStatus{ - // { - // Name: to.Ptr("member-one"), - // ClusterResourceID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myClusters/providers/Microsoft.ContainerService/managedClusters/myCluster"), - // Status: &armcontainerservicefleet.UpdateStatus{ - // State: to.Ptr(armcontainerservicefleet.UpdateStateStopping), - // }, - // }}, - // Status: &armcontainerservicefleet.UpdateStatus{ - // StartTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-03-01T01:10:08.395Z"); return t}()), - // State: to.Ptr(armcontainerservicefleet.UpdateStateStopping), - // }, - // }}, - // Status: &armcontainerservicefleet.UpdateStatus{ - // StartTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-03-01T01:10:08.395Z"); return t}()), - // State: to.Ptr(armcontainerservicefleet.UpdateStateStopping), - // }, - // }}, - // Status: &armcontainerservicefleet.UpdateStatus{ - // StartTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-03-01T01:10:08.395Z"); return t}()), - // State: to.Ptr(armcontainerservicefleet.UpdateStateStopping), - // }, - // }, - // Strategy: &armcontainerservicefleet.UpdateRunStrategy{ - // Stages: []*armcontainerservicefleet.UpdateStage{ - // { - // Name: to.Ptr("stage1"), - // AfterStageWaitInSeconds: to.Ptr[int32](3600), - // Groups: []*armcontainerservicefleet.UpdateGroup{ - // { - // Name: to.Ptr("group-a"), - // }}, - // }}, - // }, - // }, - // } -}