diff --git a/sdk/resourcemanager/containerservicefleet/armcontainerservicefleet/CHANGELOG.md b/sdk/resourcemanager/containerservicefleet/armcontainerservicefleet/CHANGELOG.md index c850a2bbeca9..21cf4b4e14b5 100644 --- a/sdk/resourcemanager/containerservicefleet/armcontainerservicefleet/CHANGELOG.md +++ b/sdk/resourcemanager/containerservicefleet/armcontainerservicefleet/CHANGELOG.md @@ -1,5 +1,19 @@ # Release History +## 1.2.0-beta.1 (2024-04-26) +### Features Added + +- New value `ManagedClusterUpgradeTypeControlPlaneOnly` added to enum type `ManagedClusterUpgradeType` +- New enum type `TargetType` with values `TargetTypeAfterStageWait`, `TargetTypeGroup`, `TargetTypeMember`, `TargetTypeStage` +- New function `*UpdateRunsClient.BeginSkip(context.Context, string, string, string, SkipProperties, *UpdateRunsClientBeginSkipOptions) (*runtime.Poller[UpdateRunsClientSkipResponse], error)` +- New struct `APIServerAccessProfile` +- New struct `AgentProfile` +- New struct `FleetHubProfile` +- New struct `SkipProperties` +- New struct `SkipTarget` +- 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.UpdateRunsClientBeginSkipOptions + if ifMatchParam != nil { + options = &armcontainerservicefleet.UpdateRunsClientBeginSkipOptions{ + IfMatch: ifMatchParam, + } + } + respr, errRespr := u.srv.BeginSkip(req.Context(), resourceGroupNameParam, fleetNameParam, updateRunNameParam, body, options) + if respErr := server.GetError(errRespr, req); respErr != nil { + return nil, respErr + } + beginSkip = &respr + u.beginSkip.add(req, beginSkip) + } + + resp, err := server.PollerResponderNext(beginSkip, req) + if err != nil { + return nil, err + } + + if !contains([]int{http.StatusOK, http.StatusAccepted}, resp.StatusCode) { + u.beginSkip.remove(req) + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted", resp.StatusCode)} + } + if !server.PollerResponderMore(beginSkip) { + u.beginSkip.remove(req) + } + + 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..5bf96093db45 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,15 +120,15 @@ 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() + req.Raw().Header["Accept"] = []string{"application/json"} if options != nil && options.IfMatch != nil { req.Raw().Header["If-Match"] = []string{*options.IfMatch} } if options != nil && options.IfNoneMatch != nil { req.Raw().Header["If-None-Match"] = []string{*options.IfNoneMatch} } - req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, resource); err != nil { return nil, err } @@ -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,19 +211,19 @@ 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() + req.Raw().Header["Accept"] = []string{"application/json"} if options != nil && options.IfMatch != nil { req.Raw().Header["If-Match"] = []string{*options.IfMatch} } - req.Raw().Header["Accept"] = []string{"application/json"} return req, nil } // 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. @@ -371,7 +371,7 @@ func (client *FleetMembersClient) BeginUpdate(ctx context.Context, resourceGroup return nil, err } poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[FleetMembersClientUpdateResponse]{ - FinalStateVia: runtime.FinalStateViaLocation, + FinalStateVia: runtime.FinalStateViaOriginalURI, Tracer: client.internal.Tracer(), }) return poller, err @@ -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,12 +431,12 @@ 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() + req.Raw().Header["Accept"] = []string{"application/json"} 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, properties); err != nil { return nil, err } diff --git a/sdk/resourcemanager/containerservicefleet/armcontainerservicefleet/fleetmembers_client_example_test.go b/sdk/resourcemanager/containerservicefleet/armcontainerservicefleet/fleetmembers_client_example_test.go index e46c4b54f8aa..ef57b28855ac 100644 --- a/sdk/resourcemanager/containerservicefleet/armcontainerservicefleet/fleetmembers_client_example_test.go +++ b/sdk/resourcemanager/containerservicefleet/armcontainerservicefleet/fleetmembers_client_example_test.go @@ -18,7 +18,7 @@ import ( "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 +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/92de53a5f1e0e03c94b40475d2135d97148ed014/specification/containerservice/resource-manager/Microsoft.ContainerService/fleet/preview/2024-02-02-preview/examples/FleetMembers_ListByFleet.json func ExampleFleetMembersClient_NewListByFleetPager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -64,7 +64,7 @@ func ExampleFleetMembersClient_NewListByFleetPager() { } } -// 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 +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/92de53a5f1e0e03c94b40475d2135d97148ed014/specification/containerservice/resource-manager/Microsoft.ContainerService/fleet/preview/2024-02-02-preview/examples/FleetMembers_Get.json func ExampleFleetMembersClient_Get() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -102,7 +102,7 @@ func ExampleFleetMembersClient_Get() { // } } -// 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 +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/92de53a5f1e0e03c94b40475d2135d97148ed014/specification/containerservice/resource-manager/Microsoft.ContainerService/fleet/preview/2024-02-02-preview/examples/FleetMembers_Create.json func ExampleFleetMembersClient_BeginCreate() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -150,7 +150,7 @@ func ExampleFleetMembersClient_BeginCreate() { // } } -// 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 +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/92de53a5f1e0e03c94b40475d2135d97148ed014/specification/containerservice/resource-manager/Microsoft.ContainerService/fleet/preview/2024-02-02-preview/examples/FleetMembers_Update.json func ExampleFleetMembersClient_BeginUpdate() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -197,7 +197,7 @@ func ExampleFleetMembersClient_BeginUpdate() { // } } -// 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 +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/92de53a5f1e0e03c94b40475d2135d97148ed014/specification/containerservice/resource-manager/Microsoft.ContainerService/fleet/preview/2024-02-02-preview/examples/FleetMembers_Delete.json func ExampleFleetMembersClient_BeginDelete() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { diff --git a/sdk/resourcemanager/containerservicefleet/armcontainerservicefleet/fleets_client.go b/sdk/resourcemanager/containerservicefleet/armcontainerservicefleet/fleets_client.go index f58da6c95cbb..dd389d1c3d5a 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,15 +115,15 @@ 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() + req.Raw().Header["Accept"] = []string{"application/json"} if options != nil && options.IfMatch != nil { req.Raw().Header["If-Match"] = []string{*options.IfMatch} } if options != nil && options.IfNoneMatch != nil { req.Raw().Header["If-None-Match"] = []string{*options.IfNoneMatch} } - req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, resource); err != nil { return nil, err } @@ -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,19 +200,19 @@ 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() + req.Raw().Header["Accept"] = []string{"application/json"} if options != nil && options.IfMatch != nil { req.Raw().Header["If-Match"] = []string{*options.IfMatch} } - req.Raw().Header["Accept"] = []string{"application/json"} return req, nil } // 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. @@ -467,7 +467,7 @@ func (client *FleetsClient) BeginUpdate(ctx context.Context, resourceGroupName s return nil, err } poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[FleetsClientUpdateResponse]{ - FinalStateVia: runtime.FinalStateViaLocation, + FinalStateVia: runtime.FinalStateViaOriginalURI, Tracer: client.internal.Tracer(), }) return poller, err @@ -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,12 +523,12 @@ 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() + req.Raw().Header["Accept"] = []string{"application/json"} 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, properties); err != nil { return nil, err } diff --git a/sdk/resourcemanager/containerservicefleet/armcontainerservicefleet/fleets_client_example_test.go b/sdk/resourcemanager/containerservicefleet/armcontainerservicefleet/fleets_client_example_test.go index 896fc00a41b8..c21460d324fb 100644 --- a/sdk/resourcemanager/containerservicefleet/armcontainerservicefleet/fleets_client_example_test.go +++ b/sdk/resourcemanager/containerservicefleet/armcontainerservicefleet/fleets_client_example_test.go @@ -18,7 +18,7 @@ import ( "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 +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/92de53a5f1e0e03c94b40475d2135d97148ed014/specification/containerservice/resource-manager/Microsoft.ContainerService/fleet/preview/2024-02-02-preview/examples/Fleets_ListBySub.json func ExampleFleetsClient_NewListBySubscriptionPager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -61,6 +61,15 @@ func ExampleFleetsClient_NewListBySubscriptionPager() { // }, // ETag: to.Ptr("23ujdflewrj3="), // Properties: &armcontainerservicefleet.FleetProperties{ + // HubProfile: &armcontainerservicefleet.FleetHubProfile{ + // AgentProfile: &armcontainerservicefleet.AgentProfile{ + // VMSize: to.Ptr("Standard_DS1"), + // }, + // DNSPrefix: to.Ptr("dnsprefix1"), + // Fqdn: to.Ptr("dnsprefix1-abcd1234.flt.eastus.azmk8s.io"), + // KubernetesVersion: to.Ptr("1.22.4"), + // PortalFqdn: to.Ptr("dnsprefix1-abcd1234.flt.eastus.azmk8s.io"), + // }, // ProvisioningState: to.Ptr(armcontainerservicefleet.FleetProvisioningStateSucceeded), // }, // }}, @@ -68,7 +77,7 @@ func ExampleFleetsClient_NewListBySubscriptionPager() { } } -// 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 +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/92de53a5f1e0e03c94b40475d2135d97148ed014/specification/containerservice/resource-manager/Microsoft.ContainerService/fleet/preview/2024-02-02-preview/examples/Fleets_ListByResourceGroup.json func ExampleFleetsClient_NewListByResourceGroupPager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -111,6 +120,15 @@ func ExampleFleetsClient_NewListByResourceGroupPager() { // }, // ETag: to.Ptr("23ujdflewrj3="), // Properties: &armcontainerservicefleet.FleetProperties{ + // HubProfile: &armcontainerservicefleet.FleetHubProfile{ + // AgentProfile: &armcontainerservicefleet.AgentProfile{ + // VMSize: to.Ptr("Standard_DS1"), + // }, + // DNSPrefix: to.Ptr("dnsprefix1"), + // Fqdn: to.Ptr("dnsprefix1-abcd1234.flt.eastus.azmk8s.io"), + // KubernetesVersion: to.Ptr("1.22.4"), + // PortalFqdn: to.Ptr("dnsprefix1-abcd1234.flt.eastus.azmk8s.io"), + // }, // ProvisioningState: to.Ptr(armcontainerservicefleet.FleetProvisioningStateSucceeded), // }, // }}, @@ -118,7 +136,7 @@ func ExampleFleetsClient_NewListByResourceGroupPager() { } } -// 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 +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/92de53a5f1e0e03c94b40475d2135d97148ed014/specification/containerservice/resource-manager/Microsoft.ContainerService/fleet/preview/2024-02-02-preview/examples/Fleets_Get.json func ExampleFleetsClient_Get() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -155,12 +173,21 @@ func ExampleFleetsClient_Get() { // }, // ETag: to.Ptr("23ujdflewrj3="), // Properties: &armcontainerservicefleet.FleetProperties{ + // HubProfile: &armcontainerservicefleet.FleetHubProfile{ + // AgentProfile: &armcontainerservicefleet.AgentProfile{ + // VMSize: to.Ptr("Standard_DS1"), + // }, + // DNSPrefix: to.Ptr("dnsprefix1"), + // Fqdn: to.Ptr("dnsprefix1-abcd1234.flt.eastus.azmk8s.io"), + // KubernetesVersion: to.Ptr("1.22.4"), + // PortalFqdn: to.Ptr("dnsprefix1-abcd1234.flt.eastus.azmk8s.io"), + // }, // 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 +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/92de53a5f1e0e03c94b40475d2135d97148ed014/specification/containerservice/resource-manager/Microsoft.ContainerService/fleet/preview/2024-02-02-preview/examples/Fleets_CreateOrUpdate.json func ExampleFleetsClient_BeginCreateOrUpdate() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -177,7 +204,14 @@ func ExampleFleetsClient_BeginCreateOrUpdate() { "archv2": to.Ptr(""), "tier": to.Ptr("production"), }, - Properties: &armcontainerservicefleet.FleetProperties{}, + Properties: &armcontainerservicefleet.FleetProperties{ + HubProfile: &armcontainerservicefleet.FleetHubProfile{ + AgentProfile: &armcontainerservicefleet.AgentProfile{ + VMSize: to.Ptr("Standard_DS1"), + }, + DNSPrefix: to.Ptr("dnsprefix1"), + }, + }, }, &armcontainerservicefleet.FleetsClientBeginCreateOrUpdateOptions{IfMatch: nil, IfNoneMatch: nil, }) @@ -210,12 +244,21 @@ func ExampleFleetsClient_BeginCreateOrUpdate() { // }, // ETag: to.Ptr("23ujdflewrj3="), // Properties: &armcontainerservicefleet.FleetProperties{ + // HubProfile: &armcontainerservicefleet.FleetHubProfile{ + // AgentProfile: &armcontainerservicefleet.AgentProfile{ + // VMSize: to.Ptr("Standard_DS1"), + // }, + // DNSPrefix: to.Ptr("dnsprefix1"), + // Fqdn: to.Ptr("dnsprefix1-abcd1234.flt.eastus.azmk8s.io"), + // KubernetesVersion: to.Ptr("1.22.4"), + // PortalFqdn: to.Ptr("dnsprefix1-abcd1234.flt.eastus.azmk8s.io"), + // }, // 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 +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/92de53a5f1e0e03c94b40475d2135d97148ed014/specification/containerservice/resource-manager/Microsoft.ContainerService/fleet/preview/2024-02-02-preview/examples/Fleets_PatchTags.json func ExampleFleetsClient_BeginUpdate() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -261,12 +304,21 @@ func ExampleFleetsClient_BeginUpdate() { // }, // ETag: to.Ptr("23ujdflewrj3="), // Properties: &armcontainerservicefleet.FleetProperties{ + // HubProfile: &armcontainerservicefleet.FleetHubProfile{ + // AgentProfile: &armcontainerservicefleet.AgentProfile{ + // VMSize: to.Ptr("Standard_DS1"), + // }, + // DNSPrefix: to.Ptr("dnsprefix1"), + // Fqdn: to.Ptr("dnsprefix1-abcd1234.flt.eastus.azmk8s.io"), + // KubernetesVersion: to.Ptr("1.22.4"), + // PortalFqdn: to.Ptr("dnsprefix1-abcd1234.flt.eastus.azmk8s.io"), + // }, // 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 +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/92de53a5f1e0e03c94b40475d2135d97148ed014/specification/containerservice/resource-manager/Microsoft.ContainerService/fleet/preview/2024-02-02-preview/examples/Fleets_Delete.json func ExampleFleetsClient_BeginDelete() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -287,7 +339,7 @@ func ExampleFleetsClient_BeginDelete() { } } -// 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 +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/92de53a5f1e0e03c94b40475d2135d97148ed014/specification/containerservice/resource-manager/Microsoft.ContainerService/fleet/preview/2024-02-02-preview/examples/Fleets_ListCredentialsResult.json func ExampleFleetsClient_ListCredentials() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { diff --git a/sdk/resourcemanager/containerservicefleet/armcontainerservicefleet/fleetupdatestrategies_client.go b/sdk/resourcemanager/containerservicefleet/armcontainerservicefleet/fleetupdatestrategies_client.go index 2d4b7efa252d..7ee10f4e0aa0 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,15 +120,15 @@ 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() + req.Raw().Header["Accept"] = []string{"application/json"} if options != nil && options.IfMatch != nil { req.Raw().Header["If-Match"] = []string{*options.IfMatch} } if options != nil && options.IfNoneMatch != nil { req.Raw().Header["If-None-Match"] = []string{*options.IfNoneMatch} } - req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, resource); err != nil { return nil, err } @@ -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,19 +211,19 @@ 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() + req.Raw().Header["Accept"] = []string{"application/json"} if options != nil && options.IfMatch != nil { req.Raw().Header["If-Match"] = []string{*options.IfMatch} } - req.Raw().Header["Accept"] = []string{"application/json"} return req, nil } // 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 index 3e836b017d09..75f76a38ecde 100644 --- a/sdk/resourcemanager/containerservicefleet/armcontainerservicefleet/fleetupdatestrategies_client_example_test.go +++ b/sdk/resourcemanager/containerservicefleet/armcontainerservicefleet/fleetupdatestrategies_client_example_test.go @@ -18,7 +18,7 @@ import ( "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 +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/92de53a5f1e0e03c94b40475d2135d97148ed014/specification/containerservice/resource-manager/Microsoft.ContainerService/fleet/preview/2024-02-02-preview/examples/UpdateStrategies_ListByFleet.json func ExampleFleetUpdateStrategiesClient_NewListByFleetPager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -74,7 +74,7 @@ func ExampleFleetUpdateStrategiesClient_NewListByFleetPager() { } } -// 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 +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/92de53a5f1e0e03c94b40475d2135d97148ed014/specification/containerservice/resource-manager/Microsoft.ContainerService/fleet/preview/2024-02-02-preview/examples/UpdateStrategies_Get.json func ExampleFleetUpdateStrategiesClient_Get() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -122,7 +122,7 @@ func ExampleFleetUpdateStrategiesClient_Get() { // } } -// 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 +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/92de53a5f1e0e03c94b40475d2135d97148ed014/specification/containerservice/resource-manager/Microsoft.ContainerService/fleet/preview/2024-02-02-preview/examples/UpdateStrategies_CreateOrUpdate.json func ExampleFleetUpdateStrategiesClient_BeginCreateOrUpdate() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -190,7 +190,7 @@ func ExampleFleetUpdateStrategiesClient_BeginCreateOrUpdate() { // } } -// 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 +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/92de53a5f1e0e03c94b40475d2135d97148ed014/specification/containerservice/resource-manager/Microsoft.ContainerService/fleet/preview/2024-02-02-preview/examples/UpdateStrategies_Delete.json func ExampleFleetUpdateStrategiesClient_BeginDelete() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { diff --git a/sdk/resourcemanager/containerservicefleet/armcontainerservicefleet/models.go b/sdk/resourcemanager/containerservicefleet/armcontainerservicefleet/models.go index 336682021ce6..61e2ffb4c3ae 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,12 +107,33 @@ 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 Value []*Fleet - // The link to the next page of items + // READ-ONLY; The link to the next page of items NextLink *string } @@ -123,7 +166,7 @@ type FleetMemberListResult struct { // REQUIRED; The FleetMember items on this page Value []*FleetMember - // The link to the next page of items + // READ-ONLY; The link to the next page of items NextLink *string } @@ -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 } @@ -196,7 +242,7 @@ type FleetUpdateStrategyListResult struct { // REQUIRED; The FleetUpdateStrategy items on this page Value []*FleetUpdateStrategy - // The link to the next page of items + // READ-ONLY; The link to the next page of items NextLink *string } @@ -220,8 +266,7 @@ type ManagedClusterUpdate struct { // ManagedClusterUpgradeSpec - The upgrade to apply to a ManagedCluster. type ManagedClusterUpgradeSpec struct { - // REQUIRED; The upgrade type. Full requires the KubernetesVersion property to be set. NodeImageOnly requires the KubernetesVersion - // property not to be set. + // REQUIRED; ManagedClusterUpgradeType is the type of upgrade to be applied. Type *ManagedClusterUpgradeType // The Kubernetes version to upgrade the member clusters to. @@ -333,6 +378,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 []*SkipTarget +} + +// SkipTarget - The definition of a single skip request. +type SkipTarget struct { + // REQUIRED; The skip target's name. 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. + Name *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). @@ -401,7 +462,7 @@ type UpdateRunListResult struct { // REQUIRED; The UpdateRun items on this page Value []*UpdateRun - // The link to the next page of items + // READ-ONLY; The link to the next page of items NextLink *string } diff --git a/sdk/resourcemanager/containerservicefleet/armcontainerservicefleet/models_serde.go b/sdk/resourcemanager/containerservicefleet/armcontainerservicefleet/models_serde.go index 6525c8f9dd5b..34106a2648e7 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) @@ -153,7 +219,9 @@ func (f *Fleet) UnmarshalJSON(data []byte) error { func (f FleetCredentialResult) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) populate(objectMap, "name", f.Name) - populateByteArray(objectMap, "value", f.Value, runtime.Base64StdFormat) + populateByteArray(objectMap, "value", f.Value, func() any { + return runtime.EncodeByteArray(f.Value, runtime.Base64StdFormat) + }) return json.Marshal(objectMap) } @@ -170,7 +238,9 @@ func (f *FleetCredentialResult) UnmarshalJSON(data []byte) error { err = unpopulate(val, "Name", &f.Name) delete(rawMsg, key) case "value": - err = runtime.DecodeByteArray(string(val), &f.Value, runtime.Base64StdFormat) + if val != nil && string(val) != "null" { + err = runtime.DecodeByteArray(string(val), &f.Value, runtime.Base64StdFormat) + } delete(rawMsg, key) } if err != nil { @@ -207,6 +277,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 +556,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 +570,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 +1031,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 SkipTarget. +func (s SkipTarget) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "name", s.Name) + populate(objectMap, "type", s.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type SkipTarget. +func (s *SkipTarget) 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 "name": + err = unpopulate(val, "Name", &s.Name) + 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) @@ -1397,18 +1576,18 @@ func populateAny(m map[string]any, k string, v any) { } } -func populateByteArray(m map[string]any, k string, b []byte, f runtime.Base64Encoding) { +func populateByteArray[T any](m map[string]any, k string, b []T, convert func() any) { if azcore.IsNullValue(b) { m[k] = nil } else if len(b) == 0 { return } else { - m[k] = runtime.EncodeByteArray(b, f) + m[k] = convert() } } func unpopulate(data json.RawMessage, fn string, v any) error { - if data == nil { + if data == nil || string(data) == "null" { return nil } if err := json.Unmarshal(data, v); err != nil { 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 index 2a5eecb213a0..4c196ab27f31 100644 --- a/sdk/resourcemanager/containerservicefleet/armcontainerservicefleet/operations_client_example_test.go +++ b/sdk/resourcemanager/containerservicefleet/armcontainerservicefleet/operations_client_example_test.go @@ -17,7 +17,7 @@ import ( "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 +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/92de53a5f1e0e03c94b40475d2135d97148ed014/specification/containerservice/resource-manager/Microsoft.ContainerService/fleet/preview/2024-02-02-preview/examples/Operations_List.json func ExampleOperationsClient_NewListPager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { diff --git a/sdk/resourcemanager/containerservicefleet/armcontainerservicefleet/options.go b/sdk/resourcemanager/containerservicefleet/armcontainerservicefleet/options.go index 393d8020ce28..8cef8b4075ec 100644 --- a/sdk/resourcemanager/containerservicefleet/armcontainerservicefleet/options.go +++ b/sdk/resourcemanager/containerservicefleet/armcontainerservicefleet/options.go @@ -161,6 +161,15 @@ type UpdateRunsClientBeginDeleteOptions struct { ResumeToken string } +// UpdateRunsClientBeginSkipOptions contains the optional parameters for the UpdateRunsClient.BeginSkip method. +type UpdateRunsClientBeginSkipOptions struct { + // The request should only proceed if an entity matches this string. + IfMatch *string + + // Resumes the LRO from the provided token. + ResumeToken string +} + // UpdateRunsClientBeginStartOptions contains the optional parameters for the UpdateRunsClient.BeginStart method. type UpdateRunsClientBeginStartOptions struct { // The request should only proceed if an entity matches this string. diff --git a/sdk/resourcemanager/containerservicefleet/armcontainerservicefleet/response_types.go b/sdk/resourcemanager/containerservicefleet/armcontainerservicefleet/responses.go similarity index 96% rename from sdk/resourcemanager/containerservicefleet/armcontainerservicefleet/response_types.go rename to sdk/resourcemanager/containerservicefleet/armcontainerservicefleet/responses.go index 45fc44310741..5a5858def43b 100644 --- a/sdk/resourcemanager/containerservicefleet/armcontainerservicefleet/response_types.go +++ b/sdk/resourcemanager/containerservicefleet/armcontainerservicefleet/responses.go @@ -130,6 +130,12 @@ type UpdateRunsClientListByFleetResponse struct { UpdateRunListResult } +// UpdateRunsClientSkipResponse contains the response from method UpdateRunsClient.BeginSkip. +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/time_rfc3339.go b/sdk/resourcemanager/containerservicefleet/armcontainerservicefleet/time_rfc3339.go index d9c2f73b215c..939f8984c901 100644 --- a/sdk/resourcemanager/containerservicefleet/armcontainerservicefleet/time_rfc3339.go +++ b/sdk/resourcemanager/containerservicefleet/armcontainerservicefleet/time_rfc3339.go @@ -19,12 +19,16 @@ import ( ) // Azure reports time in UTC but it doesn't include the 'Z' time zone suffix in some cases. -var tzOffsetRegex = regexp.MustCompile(`(Z|z|\+|-)(\d+:\d+)*"*$`) +var tzOffsetRegex = regexp.MustCompile(`(?:Z|z|\+|-)(?:\d+:\d+)*"*$`) const ( - utcDateTimeJSON = `"2006-01-02T15:04:05.999999999"` - utcDateTime = "2006-01-02T15:04:05.999999999" - dateTimeJSON = `"` + time.RFC3339Nano + `"` + utcDateTime = "2006-01-02T15:04:05.999999999" + utcDateTimeJSON = `"` + utcDateTime + `"` + utcDateTimeNoT = "2006-01-02 15:04:05.999999999" + utcDateTimeJSONNoT = `"` + utcDateTimeNoT + `"` + dateTimeNoT = `2006-01-02 15:04:05.999999999Z07:00` + dateTimeJSON = `"` + time.RFC3339Nano + `"` + dateTimeJSONNoT = `"` + dateTimeNoT + `"` ) type dateTimeRFC3339 time.Time @@ -40,17 +44,33 @@ func (t dateTimeRFC3339) MarshalText() ([]byte, error) { } func (t *dateTimeRFC3339) UnmarshalJSON(data []byte) error { - layout := utcDateTimeJSON - if tzOffsetRegex.Match(data) { + tzOffset := tzOffsetRegex.Match(data) + hasT := strings.Contains(string(data), "T") || strings.Contains(string(data), "t") + var layout string + if tzOffset && hasT { layout = dateTimeJSON + } else if tzOffset { + layout = dateTimeJSONNoT + } else if hasT { + layout = utcDateTimeJSON + } else { + layout = utcDateTimeJSONNoT } return t.Parse(layout, string(data)) } func (t *dateTimeRFC3339) UnmarshalText(data []byte) error { - layout := utcDateTime - if tzOffsetRegex.Match(data) { + tzOffset := tzOffsetRegex.Match(data) + hasT := strings.Contains(string(data), "T") || strings.Contains(string(data), "t") + var layout string + if tzOffset && hasT { layout = time.RFC3339Nano + } else if tzOffset { + layout = dateTimeNoT + } else if hasT { + layout = utcDateTime + } else { + layout = utcDateTimeNoT } return t.Parse(layout, string(data)) } @@ -61,6 +81,10 @@ func (t *dateTimeRFC3339) Parse(layout, value string) error { return err } +func (t dateTimeRFC3339) String() string { + return time.Time(t).Format(time.RFC3339Nano) +} + func populateDateTimeRFC3339(m map[string]any, k string, t *time.Time) { if t == nil { return @@ -74,7 +98,7 @@ func populateDateTimeRFC3339(m map[string]any, k string, t *time.Time) { } func unpopulateDateTimeRFC3339(data json.RawMessage, fn string, t **time.Time) error { - if data == nil || strings.EqualFold(string(data), "null") { + if data == nil || string(data) == "null" { return nil } var aux dateTimeRFC3339 diff --git a/sdk/resourcemanager/containerservicefleet/armcontainerservicefleet/updateruns_client.go b/sdk/resourcemanager/containerservicefleet/armcontainerservicefleet/updateruns_client.go index 518a94d25610..3321a066e408 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,15 +120,15 @@ 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() + req.Raw().Header["Accept"] = []string{"application/json"} if options != nil && options.IfMatch != nil { req.Raw().Header["If-Match"] = []string{*options.IfMatch} } if options != nil && options.IfNoneMatch != nil { req.Raw().Header["If-None-Match"] = []string{*options.IfNoneMatch} } - req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, resource); err != nil { return nil, err } @@ -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,19 +210,19 @@ 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() + req.Raw().Header["Accept"] = []string{"application/json"} if options != nil && options.IfMatch != nil { req.Raw().Header["If-Match"] = []string{*options.IfMatch} } - req.Raw().Header["Accept"] = []string{"application/json"} return req, nil } // 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,98 @@ func (client *UpdateRunsClient) listByFleetHandleResponse(resp *http.Response) ( return result, nil } +// BeginSkip - 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 - UpdateRunsClientBeginSkipOptions contains the optional parameters for the UpdateRunsClient.BeginSkip method. +func (client *UpdateRunsClient) BeginSkip(ctx context.Context, resourceGroupName string, fleetName string, updateRunName string, body SkipProperties, options *UpdateRunsClientBeginSkipOptions) (*runtime.Poller[UpdateRunsClientSkipResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.skip(ctx, resourceGroupName, fleetName, updateRunName, body, options) + if err != nil { + return nil, err + } + poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[UpdateRunsClientSkipResponse]{ + FinalStateVia: runtime.FinalStateViaLocation, + Tracer: client.internal.Tracer(), + }) + return poller, err + } else { + return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[UpdateRunsClientSkipResponse]{ + Tracer: client.internal.Tracer(), + }) + } +} + +// 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 +func (client *UpdateRunsClient) skip(ctx context.Context, resourceGroupName string, fleetName string, updateRunName string, body SkipProperties, options *UpdateRunsClientBeginSkipOptions) (*http.Response, error) { + var err error + const operationName = "UpdateRunsClient.BeginSkip" + 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 nil, err + } + httpResp, err := client.internal.Pipeline().Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted) { + err = runtime.NewResponseError(httpResp) + return nil, err + } + return httpResp, nil +} + +// skipCreateRequest creates the Skip request. +func (client *UpdateRunsClient) skipCreateRequest(ctx context.Context, resourceGroupName string, fleetName string, updateRunName string, body SkipProperties, options *UpdateRunsClientBeginSkipOptions) (*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() + req.Raw().Header["Accept"] = []string{"application/json"} + if options != nil && options.IfMatch != nil { + req.Raw().Header["If-Match"] = []string{*options.IfMatch} + } + if err := runtime.MarshalAsJSON(req, body); err != nil { + return nil, err + } + return req, 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 +470,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,19 +516,19 @@ 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() + req.Raw().Header["Accept"] = []string{"application/json"} if options != nil && options.IfMatch != nil { req.Raw().Header["If-Match"] = []string{*options.IfMatch} } - req.Raw().Header["Accept"] = []string{"application/json"} return req, nil } // 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 +554,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,11 +600,11 @@ 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() + req.Raw().Header["Accept"] = []string{"application/json"} if options != nil && options.IfMatch != nil { req.Raw().Header["If-Match"] = []string{*options.IfMatch} } - req.Raw().Header["Accept"] = []string{"application/json"} return req, nil } diff --git a/sdk/resourcemanager/containerservicefleet/armcontainerservicefleet/updateruns_client_example_test.go b/sdk/resourcemanager/containerservicefleet/armcontainerservicefleet/updateruns_client_example_test.go index eac87e1fd8c6..d607df8f985f 100644 --- a/sdk/resourcemanager/containerservicefleet/armcontainerservicefleet/updateruns_client_example_test.go +++ b/sdk/resourcemanager/containerservicefleet/armcontainerservicefleet/updateruns_client_example_test.go @@ -18,7 +18,7 @@ import ( "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 +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/92de53a5f1e0e03c94b40475d2135d97148ed014/specification/containerservice/resource-manager/Microsoft.ContainerService/fleet/preview/2024-02-02-preview/examples/UpdateRuns_ListByFleet.json func ExampleUpdateRunsClient_NewListByFleetPager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -116,7 +116,7 @@ func ExampleUpdateRunsClient_NewListByFleetPager() { } } -// 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 +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/92de53a5f1e0e03c94b40475d2135d97148ed014/specification/containerservice/resource-manager/Microsoft.ContainerService/fleet/preview/2024-02-02-preview/examples/UpdateRuns_Get.json func ExampleUpdateRunsClient_Get() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -206,7 +206,7 @@ func ExampleUpdateRunsClient_Get() { // } } -// 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 +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/92de53a5f1e0e03c94b40475d2135d97148ed014/specification/containerservice/resource-manager/Microsoft.ContainerService/fleet/preview/2024-02-02-preview/examples/UpdateRuns_CreateOrUpdate.json func ExampleUpdateRunsClient_BeginCreateOrUpdate() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -327,7 +327,7 @@ func ExampleUpdateRunsClient_BeginCreateOrUpdate() { // } } -// 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 +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/92de53a5f1e0e03c94b40475d2135d97148ed014/specification/containerservice/resource-manager/Microsoft.ContainerService/fleet/preview/2024-02-02-preview/examples/UpdateRuns_Delete.json func ExampleUpdateRunsClient_BeginDelete() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -348,7 +348,132 @@ func ExampleUpdateRunsClient_BeginDelete() { } } -// 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 +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/92de53a5f1e0e03c94b40475d2135d97148ed014/specification/containerservice/resource-manager/Microsoft.ContainerService/fleet/preview/2024-02-02-preview/examples/UpdateRuns_Skip.json +func ExampleUpdateRunsClient_BeginSkip() { + 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().BeginSkip(ctx, "rg1", "fleet1", "run1", armcontainerservicefleet.SkipProperties{ + Targets: []*armcontainerservicefleet.SkipTarget{ + { + Name: to.Ptr("member-one"), + Type: to.Ptr(armcontainerservicefleet.TargetTypeMember), + }, + { + Name: to.Ptr("stage1"), + Type: to.Ptr(armcontainerservicefleet.TargetTypeAfterStageWait), + }}, + }, &armcontainerservicefleet.UpdateRunsClientBeginSkipOptions{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.UpdateStateSkipped), + // }, + // 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-1"), + // Status: &armcontainerservicefleet.UpdateStatus{ + // State: to.Ptr(armcontainerservicefleet.UpdateStateSkipped), + // }, + // }}, + // 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.UpdateStateSkipped), + // }, + // }, + // { + // Name: to.Ptr("group-b"), + // Members: []*armcontainerservicefleet.MemberUpdateStatus{ + // { + // Name: to.Ptr("member-two"), + // ClusterResourceID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myClusters/providers/Microsoft.ContainerService/managedClusters/myCluster-2"), + // 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"), + // }, + // { + // Name: to.Ptr("group-b"), + // }}, + // }}, + // }, + // }, + // } +} + +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/92de53a5f1e0e03c94b40475d2135d97148ed014/specification/containerservice/resource-manager/Microsoft.ContainerService/fleet/preview/2024-02-02-preview/examples/UpdateRuns_Start.json func ExampleUpdateRunsClient_BeginStart() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -445,7 +570,7 @@ func ExampleUpdateRunsClient_BeginStart() { // } } -// 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 +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/92de53a5f1e0e03c94b40475d2135d97148ed014/specification/containerservice/resource-manager/Microsoft.ContainerService/fleet/preview/2024-02-02-preview/examples/UpdateRuns_Stop.json func ExampleUpdateRunsClient_BeginStop() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil {