diff --git a/sdk/resourcemanager/servicefabric/armservicefabric/CHANGELOG.md b/sdk/resourcemanager/servicefabric/armservicefabric/CHANGELOG.md index 936ed591a685..aa38db35a577 100644 --- a/sdk/resourcemanager/servicefabric/armservicefabric/CHANGELOG.md +++ b/sdk/resourcemanager/servicefabric/armservicefabric/CHANGELOG.md @@ -1,5 +1,16 @@ # Release History +## 2.0.0 (2023-10-25) +### Breaking Changes + +- Operation `*ApplicationTypeVersionsClient.List` has supported pagination, use `*ApplicationTypeVersionsClient.NewListPager` instead. +- Operation `*ApplicationTypesClient.List` has supported pagination, use `*ApplicationTypesClient.NewListPager` instead. +- Operation `*ApplicationsClient.List` has supported pagination, use `*ApplicationsClient.NewListPager` instead. +- Operation `*ClustersClient.List` has supported pagination, use `*ClustersClient.NewListPager` instead. +- Operation `*ClustersClient.ListByResourceGroup` has supported pagination, use `*ClustersClient.NewListByResourceGroupPager` instead. +- Operation `*ServicesClient.List` has supported pagination, use `*ServicesClient.NewListPager` instead. + + ## 1.1.0 (2023-03-31) ### Features Added diff --git a/sdk/resourcemanager/servicefabric/armservicefabric/applications_client.go b/sdk/resourcemanager/servicefabric/armservicefabric/applications_client.go index f32951a5eaac..8472be42f79c 100644 --- a/sdk/resourcemanager/servicefabric/armservicefabric/applications_client.go +++ b/sdk/resourcemanager/servicefabric/armservicefabric/applications_client.go @@ -3,9 +3,8 @@ // 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. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. package armservicefabric @@ -60,7 +59,8 @@ func (client *ApplicationsClient) BeginCreateOrUpdate(ctx context.Context, resou if err != nil { return nil, err } - return runtime.NewPoller[ApplicationsClientCreateOrUpdateResponse](resp, client.internal.Pipeline(), nil) + poller, err := runtime.NewPoller[ApplicationsClientCreateOrUpdateResponse](resp, client.internal.Pipeline(), nil) + return poller, err } else { return runtime.NewPollerFromResumeToken[ApplicationsClientCreateOrUpdateResponse](options.ResumeToken, client.internal.Pipeline(), nil) } @@ -71,18 +71,20 @@ func (client *ApplicationsClient) BeginCreateOrUpdate(ctx context.Context, resou // // Generated from API version 2021-06-01 func (client *ApplicationsClient) createOrUpdate(ctx context.Context, resourceGroupName string, clusterName string, applicationName string, parameters ApplicationResource, options *ApplicationsClientBeginCreateOrUpdateOptions) (*http.Response, error) { + var err error req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, clusterName, applicationName, parameters, options) if err != nil { return nil, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return nil, err } - if !runtime.HasStatusCode(resp, http.StatusAccepted) { - return nil, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusAccepted) { + err = runtime.NewResponseError(httpResp) + return nil, err } - return resp, nil + return httpResp, nil } // createOrUpdateCreateRequest creates the CreateOrUpdate request. @@ -112,7 +114,10 @@ func (client *ApplicationsClient) createOrUpdateCreateRequest(ctx context.Contex reqQP.Set("api-version", "2021-06-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, parameters) + if err := runtime.MarshalAsJSON(req, parameters); err != nil { + return nil, err + } + return req, nil } // BeginDelete - Delete a Service Fabric application resource with the specified name. @@ -130,7 +135,8 @@ func (client *ApplicationsClient) BeginDelete(ctx context.Context, resourceGroup if err != nil { return nil, err } - return runtime.NewPoller[ApplicationsClientDeleteResponse](resp, client.internal.Pipeline(), nil) + poller, err := runtime.NewPoller[ApplicationsClientDeleteResponse](resp, client.internal.Pipeline(), nil) + return poller, err } else { return runtime.NewPollerFromResumeToken[ApplicationsClientDeleteResponse](options.ResumeToken, client.internal.Pipeline(), nil) } @@ -141,18 +147,20 @@ func (client *ApplicationsClient) BeginDelete(ctx context.Context, resourceGroup // // Generated from API version 2021-06-01 func (client *ApplicationsClient) deleteOperation(ctx context.Context, resourceGroupName string, clusterName string, applicationName string, options *ApplicationsClientBeginDeleteOptions) (*http.Response, error) { + var err error req, err := client.deleteCreateRequest(ctx, resourceGroupName, clusterName, applicationName, options) if err != nil { return nil, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return nil, err } - if !runtime.HasStatusCode(resp, http.StatusAccepted, http.StatusNoContent) { - return nil, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusAccepted, http.StatusNoContent) { + err = runtime.NewResponseError(httpResp) + return nil, err } - return resp, nil + return httpResp, nil } // deleteCreateRequest creates the Delete request. @@ -195,18 +203,21 @@ func (client *ApplicationsClient) deleteCreateRequest(ctx context.Context, resou // - applicationName - The name of the application resource. // - options - ApplicationsClientGetOptions contains the optional parameters for the ApplicationsClient.Get method. func (client *ApplicationsClient) Get(ctx context.Context, resourceGroupName string, clusterName string, applicationName string, options *ApplicationsClientGetOptions) (ApplicationsClientGetResponse, error) { + var err error req, err := client.getCreateRequest(ctx, resourceGroupName, clusterName, applicationName, options) if err != nil { return ApplicationsClientGetResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return ApplicationsClientGetResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return ApplicationsClientGetResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return ApplicationsClientGetResponse{}, err } - return client.getHandleResponse(resp) + resp, err := client.getHandleResponse(httpResp) + return resp, err } // getCreateRequest creates the Get request. @@ -248,26 +259,39 @@ func (client *ApplicationsClient) getHandleResponse(resp *http.Response) (Applic return result, nil } -// List - Gets all application resources created or in the process of being created in the Service Fabric cluster resource. -// If the operation fails it returns an *azcore.ResponseError type. +// NewListPager - Gets all application resources created or in the process of being created in the Service Fabric cluster +// resource. // // Generated from API version 2021-06-01 // - resourceGroupName - The name of the resource group. // - clusterName - The name of the cluster resource. -// - options - ApplicationsClientListOptions contains the optional parameters for the ApplicationsClient.List method. -func (client *ApplicationsClient) List(ctx context.Context, resourceGroupName string, clusterName string, options *ApplicationsClientListOptions) (ApplicationsClientListResponse, error) { - req, err := client.listCreateRequest(ctx, resourceGroupName, clusterName, options) - if err != nil { - return ApplicationsClientListResponse{}, err - } - resp, err := client.internal.Pipeline().Do(req) - if err != nil { - return ApplicationsClientListResponse{}, err - } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return ApplicationsClientListResponse{}, runtime.NewResponseError(resp) - } - return client.listHandleResponse(resp) +// - options - ApplicationsClientListOptions contains the optional parameters for the ApplicationsClient.NewListPager method. +func (client *ApplicationsClient) NewListPager(resourceGroupName string, clusterName string, options *ApplicationsClientListOptions) *runtime.Pager[ApplicationsClientListResponse] { + return runtime.NewPager(runtime.PagingHandler[ApplicationsClientListResponse]{ + More: func(page ApplicationsClientListResponse) bool { + return page.NextLink != nil && len(*page.NextLink) > 0 + }, + Fetcher: func(ctx context.Context, page *ApplicationsClientListResponse) (ApplicationsClientListResponse, error) { + var req *policy.Request + var err error + if page == nil { + req, err = client.listCreateRequest(ctx, resourceGroupName, clusterName, options) + } else { + req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) + } + if err != nil { + return ApplicationsClientListResponse{}, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return ApplicationsClientListResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return ApplicationsClientListResponse{}, runtime.NewResponseError(resp) + } + return client.listHandleResponse(resp) + }, + }) } // listCreateRequest creates the List request. @@ -321,7 +345,8 @@ func (client *ApplicationsClient) BeginUpdate(ctx context.Context, resourceGroup if err != nil { return nil, err } - return runtime.NewPoller[ApplicationsClientUpdateResponse](resp, client.internal.Pipeline(), nil) + poller, err := runtime.NewPoller[ApplicationsClientUpdateResponse](resp, client.internal.Pipeline(), nil) + return poller, err } else { return runtime.NewPollerFromResumeToken[ApplicationsClientUpdateResponse](options.ResumeToken, client.internal.Pipeline(), nil) } @@ -332,18 +357,20 @@ func (client *ApplicationsClient) BeginUpdate(ctx context.Context, resourceGroup // // Generated from API version 2021-06-01 func (client *ApplicationsClient) update(ctx context.Context, resourceGroupName string, clusterName string, applicationName string, parameters ApplicationResourceUpdate, options *ApplicationsClientBeginUpdateOptions) (*http.Response, error) { + var err error req, err := client.updateCreateRequest(ctx, resourceGroupName, clusterName, applicationName, parameters, options) if err != nil { return nil, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return nil, err } - if !runtime.HasStatusCode(resp, http.StatusAccepted) { - return nil, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusAccepted) { + err = runtime.NewResponseError(httpResp) + return nil, err } - return resp, nil + return httpResp, nil } // updateCreateRequest creates the Update request. @@ -373,5 +400,8 @@ func (client *ApplicationsClient) updateCreateRequest(ctx context.Context, resou reqQP.Set("api-version", "2021-06-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, parameters) + if err := runtime.MarshalAsJSON(req, parameters); err != nil { + return nil, err + } + return req, nil } diff --git a/sdk/resourcemanager/servicefabric/armservicefabric/applications_client_example_test.go b/sdk/resourcemanager/servicefabric/armservicefabric/applications_client_example_test.go deleted file mode 100644 index f29e5fa4bf5c..000000000000 --- a/sdk/resourcemanager/servicefabric/armservicefabric/applications_client_example_test.go +++ /dev/null @@ -1,313 +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 armservicefabric_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/servicefabric/armservicefabric" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d55b8005f05b040b852c15e74a0f3e36494a15e1/specification/servicefabric/resource-manager/Microsoft.ServiceFabric/stable/2021-06-01/examples/ApplicationGetOperation_example.json -func ExampleApplicationsClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armservicefabric.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewApplicationsClient().Get(ctx, "resRg", "myCluster", "myApp", 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.ApplicationResource = armservicefabric.ApplicationResource{ - // Name: to.Ptr("myCluster"), - // Type: to.Ptr("applications"), - // Etag: to.Ptr("W/\"636462502180261859\""), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/resRg/providers/Microsoft.ServiceFabric/clusters/myCluster/applications/myApp"), - // Location: to.Ptr("eastus"), - // Tags: map[string]*string{ - // }, - // Properties: &armservicefabric.ApplicationResourceProperties{ - // MaximumNodes: to.Ptr[int64](3), - // Metrics: []*armservicefabric.ApplicationMetricDescription{ - // { - // Name: to.Ptr("metric1"), - // MaximumCapacity: to.Ptr[int64](3), - // ReservationCapacity: to.Ptr[int64](1), - // TotalApplicationCapacity: to.Ptr[int64](5), - // }}, - // MinimumNodes: to.Ptr[int64](1), - // Parameters: map[string]*string{ - // "param1": to.Ptr("value1"), - // }, - // RemoveApplicationCapacity: to.Ptr(false), - // TypeVersion: to.Ptr("1.0"), - // UpgradePolicy: &armservicefabric.ApplicationUpgradePolicy{ - // ApplicationHealthPolicy: &armservicefabric.ArmApplicationHealthPolicy{ - // ConsiderWarningAsError: to.Ptr(true), - // DefaultServiceTypeHealthPolicy: &armservicefabric.ArmServiceTypeHealthPolicy{ - // MaxPercentUnhealthyPartitionsPerService: to.Ptr[int32](0), - // MaxPercentUnhealthyReplicasPerPartition: to.Ptr[int32](0), - // MaxPercentUnhealthyServices: to.Ptr[int32](0), - // }, - // MaxPercentUnhealthyDeployedApplications: to.Ptr[int32](0), - // }, - // ForceRestart: to.Ptr(false), - // RollingUpgradeMonitoringPolicy: &armservicefabric.ArmRollingUpgradeMonitoringPolicy{ - // FailureAction: to.Ptr(armservicefabric.ArmUpgradeFailureActionRollback), - // HealthCheckRetryTimeout: to.Ptr("00:10:00"), - // HealthCheckStableDuration: to.Ptr("00:05:00"), - // HealthCheckWaitDuration: to.Ptr("00:02:00"), - // UpgradeDomainTimeout: to.Ptr("1.06:00:00"), - // UpgradeTimeout: to.Ptr("01:00:00"), - // }, - // UpgradeMode: to.Ptr(armservicefabric.RollingUpgradeModeMonitored), - // UpgradeReplicaSetCheckTimeout: to.Ptr("01:00:00"), - // }, - // ProvisioningState: to.Ptr("Succeeded"), - // TypeName: to.Ptr("myAppType"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d55b8005f05b040b852c15e74a0f3e36494a15e1/specification/servicefabric/resource-manager/Microsoft.ServiceFabric/stable/2021-06-01/examples/ApplicationPutOperation_example_max.json -func ExampleApplicationsClient_BeginCreateOrUpdate_putAnApplicationWithMaximumParameters() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armservicefabric.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewApplicationsClient().BeginCreateOrUpdate(ctx, "resRg", "myCluster", "myApp", armservicefabric.ApplicationResource{ - Tags: map[string]*string{}, - Properties: &armservicefabric.ApplicationResourceProperties{ - MaximumNodes: to.Ptr[int64](3), - Metrics: []*armservicefabric.ApplicationMetricDescription{ - { - Name: to.Ptr("metric1"), - MaximumCapacity: to.Ptr[int64](3), - ReservationCapacity: to.Ptr[int64](1), - TotalApplicationCapacity: to.Ptr[int64](5), - }}, - MinimumNodes: to.Ptr[int64](1), - Parameters: map[string]*string{ - "param1": to.Ptr("value1"), - }, - RemoveApplicationCapacity: to.Ptr(false), - TypeVersion: to.Ptr("1.0"), - UpgradePolicy: &armservicefabric.ApplicationUpgradePolicy{ - ApplicationHealthPolicy: &armservicefabric.ArmApplicationHealthPolicy{ - ConsiderWarningAsError: to.Ptr(true), - DefaultServiceTypeHealthPolicy: &armservicefabric.ArmServiceTypeHealthPolicy{ - MaxPercentUnhealthyPartitionsPerService: to.Ptr[int32](0), - MaxPercentUnhealthyReplicasPerPartition: to.Ptr[int32](0), - MaxPercentUnhealthyServices: to.Ptr[int32](0), - }, - MaxPercentUnhealthyDeployedApplications: to.Ptr[int32](0), - }, - ForceRestart: to.Ptr(false), - RollingUpgradeMonitoringPolicy: &armservicefabric.ArmRollingUpgradeMonitoringPolicy{ - FailureAction: to.Ptr(armservicefabric.ArmUpgradeFailureActionRollback), - HealthCheckRetryTimeout: to.Ptr("00:10:00"), - HealthCheckStableDuration: to.Ptr("00:05:00"), - HealthCheckWaitDuration: to.Ptr("00:02:00"), - UpgradeDomainTimeout: to.Ptr("1.06:00:00"), - UpgradeTimeout: to.Ptr("01:00:00"), - }, - UpgradeMode: to.Ptr(armservicefabric.RollingUpgradeModeMonitored), - UpgradeReplicaSetCheckTimeout: to.Ptr("01:00:00"), - }, - TypeName: to.Ptr("myAppType"), - }, - }, 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/d55b8005f05b040b852c15e74a0f3e36494a15e1/specification/servicefabric/resource-manager/Microsoft.ServiceFabric/stable/2021-06-01/examples/ApplicationPutOperation_example_min.json -func ExampleApplicationsClient_BeginCreateOrUpdate_putAnApplicationWithMinimumParameters() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armservicefabric.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewApplicationsClient().BeginCreateOrUpdate(ctx, "resRg", "myCluster", "myApp", armservicefabric.ApplicationResource{ - Location: to.Ptr("eastus"), - Tags: map[string]*string{}, - Properties: &armservicefabric.ApplicationResourceProperties{ - RemoveApplicationCapacity: to.Ptr(false), - TypeVersion: to.Ptr("1.0"), - TypeName: to.Ptr("myAppType"), - }, - }, 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/d55b8005f05b040b852c15e74a0f3e36494a15e1/specification/servicefabric/resource-manager/Microsoft.ServiceFabric/stable/2021-06-01/examples/ApplicationPutOperation_recreate_example.json -func ExampleApplicationsClient_BeginCreateOrUpdate_putAnApplicationWithRecreateOption() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armservicefabric.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewApplicationsClient().BeginCreateOrUpdate(ctx, "resRg", "myCluster", "myApp", armservicefabric.ApplicationResource{ - Tags: map[string]*string{}, - Properties: &armservicefabric.ApplicationResourceProperties{ - Parameters: map[string]*string{ - "param1": to.Ptr("value1"), - }, - TypeVersion: to.Ptr("1.0"), - UpgradePolicy: &armservicefabric.ApplicationUpgradePolicy{ - RecreateApplication: to.Ptr(true), - }, - TypeName: to.Ptr("myAppType"), - }, - }, 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/d55b8005f05b040b852c15e74a0f3e36494a15e1/specification/servicefabric/resource-manager/Microsoft.ServiceFabric/stable/2021-06-01/examples/ApplicationPatchOperation_example.json -func ExampleApplicationsClient_BeginUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armservicefabric.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewApplicationsClient().BeginUpdate(ctx, "resRg", "myCluster", "myApp", armservicefabric.ApplicationResourceUpdate{ - Location: to.Ptr("eastus"), - Tags: map[string]*string{}, - Properties: &armservicefabric.ApplicationResourceUpdateProperties{ - Metrics: []*armservicefabric.ApplicationMetricDescription{ - { - Name: to.Ptr("metric1"), - MaximumCapacity: to.Ptr[int64](3), - ReservationCapacity: to.Ptr[int64](1), - TotalApplicationCapacity: to.Ptr[int64](5), - }}, - RemoveApplicationCapacity: to.Ptr(false), - TypeVersion: to.Ptr("1.0"), - }, - }, 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/d55b8005f05b040b852c15e74a0f3e36494a15e1/specification/servicefabric/resource-manager/Microsoft.ServiceFabric/stable/2021-06-01/examples/ApplicationDeleteOperation_example.json -func ExampleApplicationsClient_BeginDelete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armservicefabric.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewApplicationsClient().BeginDelete(ctx, "resRg", "myCluster", "myApp", 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/d55b8005f05b040b852c15e74a0f3e36494a15e1/specification/servicefabric/resource-manager/Microsoft.ServiceFabric/stable/2021-06-01/examples/ApplicationListOperation_example.json -func ExampleApplicationsClient_List() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armservicefabric.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewApplicationsClient().List(ctx, "resRg", "myCluster", 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.ApplicationResourceList = armservicefabric.ApplicationResourceList{ - // Value: []*armservicefabric.ApplicationResource{ - // { - // Name: to.Ptr("myCluster"), - // Type: to.Ptr("applications"), - // Etag: to.Ptr("W/\"636462502180261858\""), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/resRg/providers/Microsoft.ServiceFabric/clusters/myCluster/applications/myApp"), - // Location: to.Ptr("eastus"), - // Tags: map[string]*string{ - // }, - // Properties: &armservicefabric.ApplicationResourceProperties{ - // Metrics: []*armservicefabric.ApplicationMetricDescription{ - // { - // Name: to.Ptr("metric1"), - // MaximumCapacity: to.Ptr[int64](3), - // ReservationCapacity: to.Ptr[int64](1), - // TotalApplicationCapacity: to.Ptr[int64](5), - // }}, - // RemoveApplicationCapacity: to.Ptr(false), - // TypeVersion: to.Ptr("1.0"), - // ProvisioningState: to.Ptr("Succeeded"), - // TypeName: to.Ptr("myAppType"), - // }, - // }}, - // } -} diff --git a/sdk/resourcemanager/servicefabric/armservicefabric/applicationtypes_client.go b/sdk/resourcemanager/servicefabric/armservicefabric/applicationtypes_client.go index 12283e815e73..ee5b10ff994a 100644 --- a/sdk/resourcemanager/servicefabric/armservicefabric/applicationtypes_client.go +++ b/sdk/resourcemanager/servicefabric/armservicefabric/applicationtypes_client.go @@ -3,9 +3,8 @@ // 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. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. package armservicefabric @@ -55,18 +54,21 @@ func NewApplicationTypesClient(subscriptionID string, credential azcore.TokenCre // - options - ApplicationTypesClientCreateOrUpdateOptions contains the optional parameters for the ApplicationTypesClient.CreateOrUpdate // method. func (client *ApplicationTypesClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, clusterName string, applicationTypeName string, parameters ApplicationTypeResource, options *ApplicationTypesClientCreateOrUpdateOptions) (ApplicationTypesClientCreateOrUpdateResponse, error) { + var err error req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, clusterName, applicationTypeName, parameters, options) if err != nil { return ApplicationTypesClientCreateOrUpdateResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return ApplicationTypesClientCreateOrUpdateResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return ApplicationTypesClientCreateOrUpdateResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return ApplicationTypesClientCreateOrUpdateResponse{}, err } - return client.createOrUpdateHandleResponse(resp) + resp, err := client.createOrUpdateHandleResponse(httpResp) + return resp, err } // createOrUpdateCreateRequest creates the CreateOrUpdate request. @@ -96,7 +98,10 @@ func (client *ApplicationTypesClient) createOrUpdateCreateRequest(ctx context.Co reqQP.Set("api-version", "2021-06-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, parameters) + if err := runtime.MarshalAsJSON(req, parameters); err != nil { + return nil, err + } + return req, nil } // createOrUpdateHandleResponse handles the CreateOrUpdate response. @@ -123,7 +128,8 @@ func (client *ApplicationTypesClient) BeginDelete(ctx context.Context, resourceG if err != nil { return nil, err } - return runtime.NewPoller[ApplicationTypesClientDeleteResponse](resp, client.internal.Pipeline(), nil) + poller, err := runtime.NewPoller[ApplicationTypesClientDeleteResponse](resp, client.internal.Pipeline(), nil) + return poller, err } else { return runtime.NewPollerFromResumeToken[ApplicationTypesClientDeleteResponse](options.ResumeToken, client.internal.Pipeline(), nil) } @@ -134,18 +140,20 @@ func (client *ApplicationTypesClient) BeginDelete(ctx context.Context, resourceG // // Generated from API version 2021-06-01 func (client *ApplicationTypesClient) deleteOperation(ctx context.Context, resourceGroupName string, clusterName string, applicationTypeName string, options *ApplicationTypesClientBeginDeleteOptions) (*http.Response, error) { + var err error req, err := client.deleteCreateRequest(ctx, resourceGroupName, clusterName, applicationTypeName, options) if err != nil { return nil, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return nil, err } - if !runtime.HasStatusCode(resp, http.StatusAccepted, http.StatusNoContent) { - return nil, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusAccepted, http.StatusNoContent) { + err = runtime.NewResponseError(httpResp) + return nil, err } - return resp, nil + return httpResp, nil } // deleteCreateRequest creates the Delete request. @@ -188,18 +196,21 @@ func (client *ApplicationTypesClient) deleteCreateRequest(ctx context.Context, r // - applicationTypeName - The name of the application type name resource. // - options - ApplicationTypesClientGetOptions contains the optional parameters for the ApplicationTypesClient.Get method. func (client *ApplicationTypesClient) Get(ctx context.Context, resourceGroupName string, clusterName string, applicationTypeName string, options *ApplicationTypesClientGetOptions) (ApplicationTypesClientGetResponse, error) { + var err error req, err := client.getCreateRequest(ctx, resourceGroupName, clusterName, applicationTypeName, options) if err != nil { return ApplicationTypesClientGetResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return ApplicationTypesClientGetResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return ApplicationTypesClientGetResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return ApplicationTypesClientGetResponse{}, err } - return client.getHandleResponse(resp) + resp, err := client.getHandleResponse(httpResp) + return resp, err } // getCreateRequest creates the Get request. @@ -241,27 +252,40 @@ func (client *ApplicationTypesClient) getHandleResponse(resp *http.Response) (Ap return result, nil } -// List - Gets all application type name resources created or in the process of being created in the Service Fabric cluster -// resource. -// If the operation fails it returns an *azcore.ResponseError type. +// NewListPager - Gets all application type name resources created or in the process of being created in the Service Fabric +// cluster resource. // // Generated from API version 2021-06-01 // - resourceGroupName - The name of the resource group. // - clusterName - The name of the cluster resource. -// - options - ApplicationTypesClientListOptions contains the optional parameters for the ApplicationTypesClient.List method. -func (client *ApplicationTypesClient) List(ctx context.Context, resourceGroupName string, clusterName string, options *ApplicationTypesClientListOptions) (ApplicationTypesClientListResponse, error) { - req, err := client.listCreateRequest(ctx, resourceGroupName, clusterName, options) - if err != nil { - return ApplicationTypesClientListResponse{}, err - } - resp, err := client.internal.Pipeline().Do(req) - if err != nil { - return ApplicationTypesClientListResponse{}, err - } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return ApplicationTypesClientListResponse{}, runtime.NewResponseError(resp) - } - return client.listHandleResponse(resp) +// - options - ApplicationTypesClientListOptions contains the optional parameters for the ApplicationTypesClient.NewListPager +// method. +func (client *ApplicationTypesClient) NewListPager(resourceGroupName string, clusterName string, options *ApplicationTypesClientListOptions) *runtime.Pager[ApplicationTypesClientListResponse] { + return runtime.NewPager(runtime.PagingHandler[ApplicationTypesClientListResponse]{ + More: func(page ApplicationTypesClientListResponse) bool { + return page.NextLink != nil && len(*page.NextLink) > 0 + }, + Fetcher: func(ctx context.Context, page *ApplicationTypesClientListResponse) (ApplicationTypesClientListResponse, error) { + var req *policy.Request + var err error + if page == nil { + req, err = client.listCreateRequest(ctx, resourceGroupName, clusterName, options) + } else { + req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) + } + if err != nil { + return ApplicationTypesClientListResponse{}, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return ApplicationTypesClientListResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return ApplicationTypesClientListResponse{}, runtime.NewResponseError(resp) + } + return client.listHandleResponse(resp) + }, + }) } // listCreateRequest creates the List request. diff --git a/sdk/resourcemanager/servicefabric/armservicefabric/applicationtypes_client_example_test.go b/sdk/resourcemanager/servicefabric/armservicefabric/applicationtypes_client_example_test.go deleted file mode 100644 index 2e9f72cd7574..000000000000 --- a/sdk/resourcemanager/servicefabric/armservicefabric/applicationtypes_client_example_test.go +++ /dev/null @@ -1,140 +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 armservicefabric_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/servicefabric/armservicefabric" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d55b8005f05b040b852c15e74a0f3e36494a15e1/specification/servicefabric/resource-manager/Microsoft.ServiceFabric/stable/2021-06-01/examples/ApplicationTypeNameGetOperation_example.json -func ExampleApplicationTypesClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armservicefabric.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewApplicationTypesClient().Get(ctx, "resRg", "myCluster", "myAppType", 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.ApplicationTypeResource = armservicefabric.ApplicationTypeResource{ - // Name: to.Ptr("myCluster"), - // Type: to.Ptr("applicationTypes"), - // Etag: to.Ptr("W/\"636462502174844831\""), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/resRg/providers/Microsoft.ServiceFabric/clusters/myCluster/applicationTypes/myAppType"), - // Location: to.Ptr("eastus"), - // Tags: map[string]*string{ - // }, - // Properties: &armservicefabric.ApplicationTypeResourceProperties{ - // ProvisioningState: to.Ptr("Succeeded"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d55b8005f05b040b852c15e74a0f3e36494a15e1/specification/servicefabric/resource-manager/Microsoft.ServiceFabric/stable/2021-06-01/examples/ApplicationTypeNamePutOperation_example.json -func ExampleApplicationTypesClient_CreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armservicefabric.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewApplicationTypesClient().CreateOrUpdate(ctx, "resRg", "myCluster", "myAppType", armservicefabric.ApplicationTypeResource{ - Tags: map[string]*string{}, - }, 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.ApplicationTypeResource = armservicefabric.ApplicationTypeResource{ - // Name: to.Ptr("myCluster"), - // Type: to.Ptr("applicationTypes"), - // Etag: to.Ptr("W/\"636462502174844831\""), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/resRg/providers/Microsoft.ServiceFabric/clusters/myCluster/applicationTypes/myAppType"), - // Location: to.Ptr("eastus"), - // Tags: map[string]*string{ - // }, - // Properties: &armservicefabric.ApplicationTypeResourceProperties{ - // ProvisioningState: to.Ptr("Succeeded"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d55b8005f05b040b852c15e74a0f3e36494a15e1/specification/servicefabric/resource-manager/Microsoft.ServiceFabric/stable/2021-06-01/examples/ApplicationTypeNameDeleteOperation_example.json -func ExampleApplicationTypesClient_BeginDelete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armservicefabric.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewApplicationTypesClient().BeginDelete(ctx, "resRg", "myCluster", "myAppType", 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/d55b8005f05b040b852c15e74a0f3e36494a15e1/specification/servicefabric/resource-manager/Microsoft.ServiceFabric/stable/2021-06-01/examples/ApplicationTypeNameListOperation_example.json -func ExampleApplicationTypesClient_List() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armservicefabric.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewApplicationTypesClient().List(ctx, "resRg", "myCluster", 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.ApplicationTypeResourceList = armservicefabric.ApplicationTypeResourceList{ - // Value: []*armservicefabric.ApplicationTypeResource{ - // { - // Name: to.Ptr("myCluster"), - // Type: to.Ptr("applicationTypes"), - // Etag: to.Ptr("W/\"636462502174844831\""), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/resRg/providers/Microsoft.ServiceFabric/clusters/myCluster/applicationTypes/myAppType"), - // Location: to.Ptr("eastus"), - // Tags: map[string]*string{ - // }, - // Properties: &armservicefabric.ApplicationTypeResourceProperties{ - // ProvisioningState: to.Ptr("Succeeded"), - // }, - // }}, - // } -} diff --git a/sdk/resourcemanager/servicefabric/armservicefabric/applicationtypeversions_client.go b/sdk/resourcemanager/servicefabric/armservicefabric/applicationtypeversions_client.go index 600edd13a734..c929f7774198 100644 --- a/sdk/resourcemanager/servicefabric/armservicefabric/applicationtypeversions_client.go +++ b/sdk/resourcemanager/servicefabric/armservicefabric/applicationtypeversions_client.go @@ -3,9 +3,8 @@ // 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. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. package armservicefabric @@ -61,7 +60,8 @@ func (client *ApplicationTypeVersionsClient) BeginCreateOrUpdate(ctx context.Con if err != nil { return nil, err } - return runtime.NewPoller[ApplicationTypeVersionsClientCreateOrUpdateResponse](resp, client.internal.Pipeline(), nil) + poller, err := runtime.NewPoller[ApplicationTypeVersionsClientCreateOrUpdateResponse](resp, client.internal.Pipeline(), nil) + return poller, err } else { return runtime.NewPollerFromResumeToken[ApplicationTypeVersionsClientCreateOrUpdateResponse](options.ResumeToken, client.internal.Pipeline(), nil) } @@ -72,18 +72,20 @@ func (client *ApplicationTypeVersionsClient) BeginCreateOrUpdate(ctx context.Con // // Generated from API version 2021-06-01 func (client *ApplicationTypeVersionsClient) createOrUpdate(ctx context.Context, resourceGroupName string, clusterName string, applicationTypeName string, version string, parameters ApplicationTypeVersionResource, options *ApplicationTypeVersionsClientBeginCreateOrUpdateOptions) (*http.Response, error) { + var err error req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, clusterName, applicationTypeName, version, parameters, options) if err != nil { return nil, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return nil, err } - if !runtime.HasStatusCode(resp, http.StatusAccepted) { - return nil, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusAccepted) { + err = runtime.NewResponseError(httpResp) + return nil, err } - return resp, nil + return httpResp, nil } // createOrUpdateCreateRequest creates the CreateOrUpdate request. @@ -117,7 +119,10 @@ func (client *ApplicationTypeVersionsClient) createOrUpdateCreateRequest(ctx con reqQP.Set("api-version", "2021-06-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, parameters) + if err := runtime.MarshalAsJSON(req, parameters); err != nil { + return nil, err + } + return req, nil } // BeginDelete - Delete a Service Fabric application type version resource with the specified name. @@ -136,7 +141,8 @@ func (client *ApplicationTypeVersionsClient) BeginDelete(ctx context.Context, re if err != nil { return nil, err } - return runtime.NewPoller[ApplicationTypeVersionsClientDeleteResponse](resp, client.internal.Pipeline(), nil) + poller, err := runtime.NewPoller[ApplicationTypeVersionsClientDeleteResponse](resp, client.internal.Pipeline(), nil) + return poller, err } else { return runtime.NewPollerFromResumeToken[ApplicationTypeVersionsClientDeleteResponse](options.ResumeToken, client.internal.Pipeline(), nil) } @@ -147,18 +153,20 @@ func (client *ApplicationTypeVersionsClient) BeginDelete(ctx context.Context, re // // Generated from API version 2021-06-01 func (client *ApplicationTypeVersionsClient) deleteOperation(ctx context.Context, resourceGroupName string, clusterName string, applicationTypeName string, version string, options *ApplicationTypeVersionsClientBeginDeleteOptions) (*http.Response, error) { + var err error req, err := client.deleteCreateRequest(ctx, resourceGroupName, clusterName, applicationTypeName, version, options) if err != nil { return nil, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return nil, err } - if !runtime.HasStatusCode(resp, http.StatusAccepted, http.StatusNoContent) { - return nil, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusAccepted, http.StatusNoContent) { + err = runtime.NewResponseError(httpResp) + return nil, err } - return resp, nil + return httpResp, nil } // deleteCreateRequest creates the Delete request. @@ -207,18 +215,21 @@ func (client *ApplicationTypeVersionsClient) deleteCreateRequest(ctx context.Con // - options - ApplicationTypeVersionsClientGetOptions contains the optional parameters for the ApplicationTypeVersionsClient.Get // method. func (client *ApplicationTypeVersionsClient) Get(ctx context.Context, resourceGroupName string, clusterName string, applicationTypeName string, version string, options *ApplicationTypeVersionsClientGetOptions) (ApplicationTypeVersionsClientGetResponse, error) { + var err error req, err := client.getCreateRequest(ctx, resourceGroupName, clusterName, applicationTypeName, version, options) if err != nil { return ApplicationTypeVersionsClientGetResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return ApplicationTypeVersionsClientGetResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return ApplicationTypeVersionsClientGetResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return ApplicationTypeVersionsClientGetResponse{}, err } - return client.getHandleResponse(resp) + resp, err := client.getHandleResponse(httpResp) + return resp, err } // getCreateRequest creates the Get request. @@ -264,29 +275,41 @@ func (client *ApplicationTypeVersionsClient) getHandleResponse(resp *http.Respon return result, nil } -// List - Gets all application type version resources created or in the process of being created in the Service Fabric application -// type name resource. -// If the operation fails it returns an *azcore.ResponseError type. +// NewListPager - Gets all application type version resources created or in the process of being created in the Service Fabric +// application type name resource. // // Generated from API version 2021-06-01 // - resourceGroupName - The name of the resource group. // - clusterName - The name of the cluster resource. // - applicationTypeName - The name of the application type name resource. -// - options - ApplicationTypeVersionsClientListOptions contains the optional parameters for the ApplicationTypeVersionsClient.List +// - options - ApplicationTypeVersionsClientListOptions contains the optional parameters for the ApplicationTypeVersionsClient.NewListPager // method. -func (client *ApplicationTypeVersionsClient) List(ctx context.Context, resourceGroupName string, clusterName string, applicationTypeName string, options *ApplicationTypeVersionsClientListOptions) (ApplicationTypeVersionsClientListResponse, error) { - req, err := client.listCreateRequest(ctx, resourceGroupName, clusterName, applicationTypeName, options) - if err != nil { - return ApplicationTypeVersionsClientListResponse{}, err - } - resp, err := client.internal.Pipeline().Do(req) - if err != nil { - return ApplicationTypeVersionsClientListResponse{}, err - } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return ApplicationTypeVersionsClientListResponse{}, runtime.NewResponseError(resp) - } - return client.listHandleResponse(resp) +func (client *ApplicationTypeVersionsClient) NewListPager(resourceGroupName string, clusterName string, applicationTypeName string, options *ApplicationTypeVersionsClientListOptions) *runtime.Pager[ApplicationTypeVersionsClientListResponse] { + return runtime.NewPager(runtime.PagingHandler[ApplicationTypeVersionsClientListResponse]{ + More: func(page ApplicationTypeVersionsClientListResponse) bool { + return page.NextLink != nil && len(*page.NextLink) > 0 + }, + Fetcher: func(ctx context.Context, page *ApplicationTypeVersionsClientListResponse) (ApplicationTypeVersionsClientListResponse, error) { + var req *policy.Request + var err error + if page == nil { + req, err = client.listCreateRequest(ctx, resourceGroupName, clusterName, applicationTypeName, options) + } else { + req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) + } + if err != nil { + return ApplicationTypeVersionsClientListResponse{}, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return ApplicationTypeVersionsClientListResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return ApplicationTypeVersionsClientListResponse{}, runtime.NewResponseError(resp) + } + return client.listHandleResponse(resp) + }, + }) } // listCreateRequest creates the List request. diff --git a/sdk/resourcemanager/servicefabric/armservicefabric/applicationtypeversions_client_example_test.go b/sdk/resourcemanager/servicefabric/armservicefabric/applicationtypeversions_client_example_test.go deleted file mode 100644 index 2245793cff54..000000000000 --- a/sdk/resourcemanager/servicefabric/armservicefabric/applicationtypeversions_client_example_test.go +++ /dev/null @@ -1,139 +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 armservicefabric_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/servicefabric/armservicefabric" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d55b8005f05b040b852c15e74a0f3e36494a15e1/specification/servicefabric/resource-manager/Microsoft.ServiceFabric/stable/2021-06-01/examples/ApplicationTypeVersionGetOperation_example.json -func ExampleApplicationTypeVersionsClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armservicefabric.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewApplicationTypeVersionsClient().Get(ctx, "resRg", "myCluster", "myAppType", "1.0", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.ApplicationTypeVersionResource = armservicefabric.ApplicationTypeVersionResource{ - // Name: to.Ptr("myCluster"), - // Type: to.Ptr("versions"), - // Etag: to.Ptr("W/\"636462502176040417\""), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/resRg/providers/Microsoft.ServiceFabric/clusters/myCluster/applicationTypes/myAppType/versions/1.0"), - // Location: to.Ptr("eastus"), - // Tags: map[string]*string{ - // }, - // Properties: &armservicefabric.ApplicationTypeVersionResourceProperties{ - // AppPackageURL: to.Ptr("http://fakelink.test.com/MyAppType"), - // DefaultParameterList: map[string]*string{ - // }, - // ProvisioningState: to.Ptr("Succeeded"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d55b8005f05b040b852c15e74a0f3e36494a15e1/specification/servicefabric/resource-manager/Microsoft.ServiceFabric/stable/2021-06-01/examples/ApplicationTypeVersionPutOperation_example.json -func ExampleApplicationTypeVersionsClient_BeginCreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armservicefabric.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewApplicationTypeVersionsClient().BeginCreateOrUpdate(ctx, "resRg", "myCluster", "myAppType", "1.0", armservicefabric.ApplicationTypeVersionResource{ - Tags: map[string]*string{}, - Properties: &armservicefabric.ApplicationTypeVersionResourceProperties{ - AppPackageURL: to.Ptr("http://fakelink.test.com/MyAppType"), - }, - }, 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/d55b8005f05b040b852c15e74a0f3e36494a15e1/specification/servicefabric/resource-manager/Microsoft.ServiceFabric/stable/2021-06-01/examples/ApplicationTypeVersionDeleteOperation_example.json -func ExampleApplicationTypeVersionsClient_BeginDelete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armservicefabric.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewApplicationTypeVersionsClient().BeginDelete(ctx, "resRg", "myCluster", "myAppType", "1.0", 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/d55b8005f05b040b852c15e74a0f3e36494a15e1/specification/servicefabric/resource-manager/Microsoft.ServiceFabric/stable/2021-06-01/examples/ApplicationTypeVersionListOperation_example.json -func ExampleApplicationTypeVersionsClient_List() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armservicefabric.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewApplicationTypeVersionsClient().List(ctx, "resRg", "myCluster", "myAppType", 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.ApplicationTypeVersionResourceList = armservicefabric.ApplicationTypeVersionResourceList{ - // Value: []*armservicefabric.ApplicationTypeVersionResource{ - // { - // Name: to.Ptr("myCluster"), - // Type: to.Ptr("versions"), - // Etag: to.Ptr("W/\"636462502176040417\""), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/resRg/providers/Microsoft.ServiceFabric/clusters/myCluster/applicationTypes/myAppType/versions/1.0"), - // Location: to.Ptr("eastus"), - // Tags: map[string]*string{ - // }, - // Properties: &armservicefabric.ApplicationTypeVersionResourceProperties{ - // AppPackageURL: to.Ptr("http://fakelink.test.com/MyAppType"), - // DefaultParameterList: map[string]*string{ - // }, - // ProvisioningState: to.Ptr("Succeeded"), - // }, - // }}, - // } -} diff --git a/sdk/resourcemanager/servicefabric/armservicefabric/autorest.md b/sdk/resourcemanager/servicefabric/armservicefabric/autorest.md index 044af84ad3ba..ae6af5949f9b 100644 --- a/sdk/resourcemanager/servicefabric/armservicefabric/autorest.md +++ b/sdk/resourcemanager/servicefabric/armservicefabric/autorest.md @@ -5,8 +5,8 @@ ``` yaml azure-arm: true require: -- https://github.com/Azure/azure-rest-api-specs/blob/d55b8005f05b040b852c15e74a0f3e36494a15e1/specification/servicefabric/resource-manager/readme.md -- https://github.com/Azure/azure-rest-api-specs/blob/d55b8005f05b040b852c15e74a0f3e36494a15e1/specification/servicefabric/resource-manager/readme.go.md +- /mnt/vss/_work/1/s/azure-rest-api-specs/specification/servicefabric/resource-manager/readme.md +- /mnt/vss/_work/1/s/azure-rest-api-specs/specification/servicefabric/resource-manager/readme.go.md license-header: MICROSOFT_MIT_NO_VERSION -module-version: 1.1.0 +module-version: 2.0.0 ``` \ No newline at end of file diff --git a/sdk/resourcemanager/servicefabric/armservicefabric/client_factory.go b/sdk/resourcemanager/servicefabric/armservicefabric/client_factory.go index 4d3aefd3571b..4c3c433f5405 100644 --- a/sdk/resourcemanager/servicefabric/armservicefabric/client_factory.go +++ b/sdk/resourcemanager/servicefabric/armservicefabric/client_factory.go @@ -3,9 +3,8 @@ // 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. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. package armservicefabric @@ -38,33 +37,33 @@ func NewClientFactory(subscriptionID string, credential azcore.TokenCredential, }, nil } -func (c *ClientFactory) NewClustersClient() *ClustersClient { - subClient, _ := NewClustersClient(c.subscriptionID, c.credential, c.options) +func (c *ClientFactory) NewApplicationTypeVersionsClient() *ApplicationTypeVersionsClient { + subClient, _ := NewApplicationTypeVersionsClient(c.subscriptionID, c.credential, c.options) return subClient } -func (c *ClientFactory) NewClusterVersionsClient() *ClusterVersionsClient { - subClient, _ := NewClusterVersionsClient(c.subscriptionID, c.credential, c.options) +func (c *ClientFactory) NewApplicationTypesClient() *ApplicationTypesClient { + subClient, _ := NewApplicationTypesClient(c.subscriptionID, c.credential, c.options) return subClient } -func (c *ClientFactory) NewOperationsClient() *OperationsClient { - subClient, _ := NewOperationsClient(c.credential, c.options) +func (c *ClientFactory) NewApplicationsClient() *ApplicationsClient { + subClient, _ := NewApplicationsClient(c.subscriptionID, c.credential, c.options) return subClient } -func (c *ClientFactory) NewApplicationTypesClient() *ApplicationTypesClient { - subClient, _ := NewApplicationTypesClient(c.subscriptionID, c.credential, c.options) +func (c *ClientFactory) NewClusterVersionsClient() *ClusterVersionsClient { + subClient, _ := NewClusterVersionsClient(c.subscriptionID, c.credential, c.options) return subClient } -func (c *ClientFactory) NewApplicationTypeVersionsClient() *ApplicationTypeVersionsClient { - subClient, _ := NewApplicationTypeVersionsClient(c.subscriptionID, c.credential, c.options) +func (c *ClientFactory) NewClustersClient() *ClustersClient { + subClient, _ := NewClustersClient(c.subscriptionID, c.credential, c.options) return subClient } -func (c *ClientFactory) NewApplicationsClient() *ApplicationsClient { - subClient, _ := NewApplicationsClient(c.subscriptionID, c.credential, c.options) +func (c *ClientFactory) NewOperationsClient() *OperationsClient { + subClient, _ := NewOperationsClient(c.credential, c.options) return subClient } diff --git a/sdk/resourcemanager/servicefabric/armservicefabric/clusters_client.go b/sdk/resourcemanager/servicefabric/armservicefabric/clusters_client.go index 9f13ce28cff2..c2dfc64ea5b6 100644 --- a/sdk/resourcemanager/servicefabric/armservicefabric/clusters_client.go +++ b/sdk/resourcemanager/servicefabric/armservicefabric/clusters_client.go @@ -3,9 +3,8 @@ // 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. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. package armservicefabric @@ -59,7 +58,8 @@ func (client *ClustersClient) BeginCreateOrUpdate(ctx context.Context, resourceG if err != nil { return nil, err } - return runtime.NewPoller[ClustersClientCreateOrUpdateResponse](resp, client.internal.Pipeline(), nil) + poller, err := runtime.NewPoller[ClustersClientCreateOrUpdateResponse](resp, client.internal.Pipeline(), nil) + return poller, err } else { return runtime.NewPollerFromResumeToken[ClustersClientCreateOrUpdateResponse](options.ResumeToken, client.internal.Pipeline(), nil) } @@ -70,18 +70,20 @@ func (client *ClustersClient) BeginCreateOrUpdate(ctx context.Context, resourceG // // Generated from API version 2021-06-01 func (client *ClustersClient) createOrUpdate(ctx context.Context, resourceGroupName string, clusterName string, parameters Cluster, options *ClustersClientBeginCreateOrUpdateOptions) (*http.Response, error) { + var err error req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, clusterName, parameters, options) if err != nil { return nil, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return nil, err } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted) { - return nil, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted) { + err = runtime.NewResponseError(httpResp) + return nil, err } - return resp, nil + return httpResp, nil } // createOrUpdateCreateRequest creates the CreateOrUpdate request. @@ -107,7 +109,10 @@ func (client *ClustersClient) createOrUpdateCreateRequest(ctx context.Context, r reqQP.Set("api-version", "2021-06-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, parameters) + if err := runtime.MarshalAsJSON(req, parameters); err != nil { + return nil, err + } + return req, nil } // Delete - Delete a Service Fabric cluster resource with the specified name. @@ -118,16 +123,18 @@ func (client *ClustersClient) createOrUpdateCreateRequest(ctx context.Context, r // - clusterName - The name of the cluster resource. // - options - ClustersClientDeleteOptions contains the optional parameters for the ClustersClient.Delete method. func (client *ClustersClient) Delete(ctx context.Context, resourceGroupName string, clusterName string, options *ClustersClientDeleteOptions) (ClustersClientDeleteResponse, error) { + var err error req, err := client.deleteCreateRequest(ctx, resourceGroupName, clusterName, options) if err != nil { return ClustersClientDeleteResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return ClustersClientDeleteResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusNoContent) { - return ClustersClientDeleteResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusNoContent) { + err = runtime.NewResponseError(httpResp) + return ClustersClientDeleteResponse{}, err } return ClustersClientDeleteResponse{}, nil } @@ -166,18 +173,21 @@ func (client *ClustersClient) deleteCreateRequest(ctx context.Context, resourceG // - clusterName - The name of the cluster resource. // - options - ClustersClientGetOptions contains the optional parameters for the ClustersClient.Get method. func (client *ClustersClient) Get(ctx context.Context, resourceGroupName string, clusterName string, options *ClustersClientGetOptions) (ClustersClientGetResponse, error) { + var err error req, err := client.getCreateRequest(ctx, resourceGroupName, clusterName, options) if err != nil { return ClustersClientGetResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return ClustersClientGetResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return ClustersClientGetResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return ClustersClientGetResponse{}, err } - return client.getHandleResponse(resp) + resp, err := client.getHandleResponse(httpResp) + return resp, err } // getCreateRequest creates the Get request. @@ -215,24 +225,36 @@ func (client *ClustersClient) getHandleResponse(resp *http.Response) (ClustersCl return result, nil } -// List - Gets all Service Fabric cluster resources created or in the process of being created in the subscription. -// If the operation fails it returns an *azcore.ResponseError type. +// NewListPager - Gets all Service Fabric cluster resources created or in the process of being created in the subscription. // // Generated from API version 2021-06-01 -// - options - ClustersClientListOptions contains the optional parameters for the ClustersClient.List method. -func (client *ClustersClient) List(ctx context.Context, options *ClustersClientListOptions) (ClustersClientListResponse, error) { - req, err := client.listCreateRequest(ctx, options) - if err != nil { - return ClustersClientListResponse{}, err - } - resp, err := client.internal.Pipeline().Do(req) - if err != nil { - return ClustersClientListResponse{}, err - } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return ClustersClientListResponse{}, runtime.NewResponseError(resp) - } - return client.listHandleResponse(resp) +// - options - ClustersClientListOptions contains the optional parameters for the ClustersClient.NewListPager method. +func (client *ClustersClient) NewListPager(options *ClustersClientListOptions) *runtime.Pager[ClustersClientListResponse] { + return runtime.NewPager(runtime.PagingHandler[ClustersClientListResponse]{ + More: func(page ClustersClientListResponse) bool { + return page.NextLink != nil && len(*page.NextLink) > 0 + }, + Fetcher: func(ctx context.Context, page *ClustersClientListResponse) (ClustersClientListResponse, error) { + var req *policy.Request + var err error + if page == nil { + req, err = client.listCreateRequest(ctx, options) + } else { + req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) + } + if err != nil { + return ClustersClientListResponse{}, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return ClustersClientListResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return ClustersClientListResponse{}, runtime.NewResponseError(resp) + } + return client.listHandleResponse(resp) + }, + }) } // listCreateRequest creates the List request. @@ -262,27 +284,39 @@ func (client *ClustersClient) listHandleResponse(resp *http.Response) (ClustersC return result, nil } -// ListByResourceGroup - Gets all Service Fabric cluster resources created or in the process of being created in the resource -// group. -// If the operation fails it returns an *azcore.ResponseError type. +// NewListByResourceGroupPager - Gets all Service Fabric cluster resources created or in the process of being created in the +// resource group. // // Generated from API version 2021-06-01 // - resourceGroupName - The name of the resource group. -// - options - ClustersClientListByResourceGroupOptions contains the optional parameters for the ClustersClient.ListByResourceGroup +// - options - ClustersClientListByResourceGroupOptions contains the optional parameters for the ClustersClient.NewListByResourceGroupPager // method. -func (client *ClustersClient) ListByResourceGroup(ctx context.Context, resourceGroupName string, options *ClustersClientListByResourceGroupOptions) (ClustersClientListByResourceGroupResponse, error) { - req, err := client.listByResourceGroupCreateRequest(ctx, resourceGroupName, options) - if err != nil { - return ClustersClientListByResourceGroupResponse{}, err - } - resp, err := client.internal.Pipeline().Do(req) - if err != nil { - return ClustersClientListByResourceGroupResponse{}, err - } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return ClustersClientListByResourceGroupResponse{}, runtime.NewResponseError(resp) - } - return client.listByResourceGroupHandleResponse(resp) +func (client *ClustersClient) NewListByResourceGroupPager(resourceGroupName string, options *ClustersClientListByResourceGroupOptions) *runtime.Pager[ClustersClientListByResourceGroupResponse] { + return runtime.NewPager(runtime.PagingHandler[ClustersClientListByResourceGroupResponse]{ + More: func(page ClustersClientListByResourceGroupResponse) bool { + return page.NextLink != nil && len(*page.NextLink) > 0 + }, + Fetcher: func(ctx context.Context, page *ClustersClientListByResourceGroupResponse) (ClustersClientListByResourceGroupResponse, error) { + var req *policy.Request + var err error + if page == nil { + req, err = client.listByResourceGroupCreateRequest(ctx, resourceGroupName, options) + } else { + req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) + } + if err != nil { + return ClustersClientListByResourceGroupResponse{}, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return ClustersClientListByResourceGroupResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return ClustersClientListByResourceGroupResponse{}, runtime.NewResponseError(resp) + } + return client.listByResourceGroupHandleResponse(resp) + }, + }) } // listByResourceGroupCreateRequest creates the ListByResourceGroup request. @@ -327,18 +361,21 @@ func (client *ClustersClient) listByResourceGroupHandleResponse(resp *http.Respo // - options - ClustersClientListUpgradableVersionsOptions contains the optional parameters for the ClustersClient.ListUpgradableVersions // method. func (client *ClustersClient) ListUpgradableVersions(ctx context.Context, resourceGroupName string, clusterName string, options *ClustersClientListUpgradableVersionsOptions) (ClustersClientListUpgradableVersionsResponse, error) { + var err error req, err := client.listUpgradableVersionsCreateRequest(ctx, resourceGroupName, clusterName, options) if err != nil { return ClustersClientListUpgradableVersionsResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return ClustersClientListUpgradableVersionsResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return ClustersClientListUpgradableVersionsResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return ClustersClientListUpgradableVersionsResponse{}, err } - return client.listUpgradableVersionsHandleResponse(resp) + resp, err := client.listUpgradableVersionsHandleResponse(httpResp) + return resp, err } // listUpgradableVersionsCreateRequest creates the ListUpgradableVersions request. @@ -365,7 +402,10 @@ func (client *ClustersClient) listUpgradableVersionsCreateRequest(ctx context.Co req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if options != nil && options.VersionsDescription != nil { - return req, runtime.MarshalAsJSON(req, *options.VersionsDescription) + if err := runtime.MarshalAsJSON(req, *options.VersionsDescription); err != nil { + return nil, err + } + return req, nil } return req, nil } @@ -393,7 +433,8 @@ func (client *ClustersClient) BeginUpdate(ctx context.Context, resourceGroupName if err != nil { return nil, err } - return runtime.NewPoller[ClustersClientUpdateResponse](resp, client.internal.Pipeline(), nil) + poller, err := runtime.NewPoller[ClustersClientUpdateResponse](resp, client.internal.Pipeline(), nil) + return poller, err } else { return runtime.NewPollerFromResumeToken[ClustersClientUpdateResponse](options.ResumeToken, client.internal.Pipeline(), nil) } @@ -404,18 +445,20 @@ func (client *ClustersClient) BeginUpdate(ctx context.Context, resourceGroupName // // Generated from API version 2021-06-01 func (client *ClustersClient) update(ctx context.Context, resourceGroupName string, clusterName string, parameters ClusterUpdateParameters, options *ClustersClientBeginUpdateOptions) (*http.Response, error) { + var err error req, err := client.updateCreateRequest(ctx, resourceGroupName, clusterName, parameters, options) if err != nil { return nil, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return nil, err } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted) { - return nil, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted) { + err = runtime.NewResponseError(httpResp) + return nil, err } - return resp, nil + return httpResp, nil } // updateCreateRequest creates the Update request. @@ -441,5 +484,8 @@ func (client *ClustersClient) updateCreateRequest(ctx context.Context, resourceG reqQP.Set("api-version", "2021-06-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, parameters) + if err := runtime.MarshalAsJSON(req, parameters); err != nil { + return nil, err + } + return req, nil } diff --git a/sdk/resourcemanager/servicefabric/armservicefabric/clusters_client_example_test.go b/sdk/resourcemanager/servicefabric/armservicefabric/clusters_client_example_test.go deleted file mode 100644 index 1ff795c87c37..000000000000 --- a/sdk/resourcemanager/servicefabric/armservicefabric/clusters_client_example_test.go +++ /dev/null @@ -1,1481 +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 armservicefabric_test - -import ( - "context" - "log" - - "time" - - "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/servicefabric/armservicefabric" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d55b8005f05b040b852c15e74a0f3e36494a15e1/specification/servicefabric/resource-manager/Microsoft.ServiceFabric/stable/2021-06-01/examples/ClusterGetOperation_example.json -func ExampleClustersClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armservicefabric.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewClustersClient().Get(ctx, "resRg", "myCluster", 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.Cluster = armservicefabric.Cluster{ - // Name: to.Ptr("myCluster"), - // Type: to.Ptr("Microsoft.ServiceFabric/clusters"), - // Etag: to.Ptr("W/\"636462502169240745\""), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/resRg/providers/Microsoft.ServiceFabric/clusters/myCluster"), - // Location: to.Ptr("eastus"), - // Tags: map[string]*string{ - // }, - // Properties: &armservicefabric.ClusterProperties{ - // AddOnFeatures: []*armservicefabric.AddOnFeatures{ - // to.Ptr(armservicefabric.AddOnFeaturesRepairManager), - // to.Ptr(armservicefabric.AddOnFeaturesDNSService), - // to.Ptr(armservicefabric.AddOnFeaturesBackupRestoreService), - // to.Ptr(armservicefabric.AddOnFeaturesResourceMonitorService)}, - // AvailableClusterVersions: []*armservicefabric.ClusterVersionDetails{ - // { - // CodeVersion: to.Ptr("6.1.480.9494"), - // Environment: to.Ptr(armservicefabric.ClusterEnvironmentWindows), - // SupportExpiryUTC: to.Ptr("2018-06-15T23:59:59.9999999"), - // }}, - // AzureActiveDirectory: &armservicefabric.AzureActiveDirectory{ - // ClientApplication: to.Ptr("d151ad89-4bce-4ae8-b3d1-1dc79679fa75"), - // ClusterApplication: to.Ptr("5886372e-7bf4-4878-a497-8098aba608ae"), - // TenantID: to.Ptr("6abcc6a0-8666-43f1-87b8-172cf86a9f9c"), - // }, - // CertificateCommonNames: &armservicefabric.ServerCertificateCommonNames{ - // CommonNames: []*armservicefabric.ServerCertificateCommonName{ - // { - // CertificateCommonName: to.Ptr("abc.com"), - // CertificateIssuerThumbprint: to.Ptr("12599211F8F14C90AFA9532AD79A6F2CA1C00622"), - // }}, - // X509StoreName: to.Ptr(armservicefabric.StoreNameMy), - // }, - // ClientCertificateCommonNames: []*armservicefabric.ClientCertificateCommonName{ - // { - // CertificateCommonName: to.Ptr("abc.com"), - // CertificateIssuerThumbprint: to.Ptr("5F3660C715EBBDA31DB1FFDCF508302348DE8E7A"), - // IsAdmin: to.Ptr(true), - // }}, - // ClientCertificateThumbprints: []*armservicefabric.ClientCertificateThumbprint{ - // { - // CertificateThumbprint: to.Ptr("5F3660C715EBBDA31DB1FFDCF508302348DE8E7A"), - // IsAdmin: to.Ptr(true), - // }}, - // ClusterCodeVersion: to.Ptr("6.1.480.9494"), - // ClusterEndpoint: to.Ptr("https://eastus.servicefabric.azure.com"), - // ClusterID: to.Ptr("92584666-9889-4ae8-8d02-91902923d37f"), - // ClusterState: to.Ptr(armservicefabric.ClusterStateWaitingForNodes), - // DiagnosticsStorageAccountConfig: &armservicefabric.DiagnosticsStorageAccountConfig{ - // BlobEndpoint: to.Ptr("https://diag.blob.core.windows.net/"), - // ProtectedAccountKeyName: to.Ptr("StorageAccountKey1"), - // QueueEndpoint: to.Ptr("https://diag.queue.core.windows.net/"), - // StorageAccountName: to.Ptr("diag"), - // TableEndpoint: to.Ptr("https://diag.table.core.windows.net/"), - // }, - // FabricSettings: []*armservicefabric.SettingsSectionDescription{ - // { - // Name: to.Ptr("UpgradeService"), - // Parameters: []*armservicefabric.SettingsParameterDescription{ - // { - // Name: to.Ptr("AppPollIntervalInSeconds"), - // Value: to.Ptr("60"), - // }}, - // }}, - // ManagementEndpoint: to.Ptr("https://myCluster.eastus.cloudapp.azure.com:19080"), - // NodeTypes: []*armservicefabric.NodeTypeDescription{ - // { - // Name: to.Ptr("nt1vm"), - // ApplicationPorts: &armservicefabric.EndpointRangeDescription{ - // EndPort: to.Ptr[int32](30000), - // StartPort: to.Ptr[int32](20000), - // }, - // ClientConnectionEndpointPort: to.Ptr[int32](19000), - // DurabilityLevel: to.Ptr(armservicefabric.DurabilityLevelBronze), - // EphemeralPorts: &armservicefabric.EndpointRangeDescription{ - // EndPort: to.Ptr[int32](64000), - // StartPort: to.Ptr[int32](49000), - // }, - // HTTPGatewayEndpointPort: to.Ptr[int32](19007), - // IsPrimary: to.Ptr(true), - // VMInstanceCount: to.Ptr[int32](5), - // }}, - // ProvisioningState: to.Ptr(armservicefabric.ProvisioningStateSucceeded), - // ReliabilityLevel: to.Ptr(armservicefabric.ReliabilityLevelSilver), - // ReverseProxyCertificateCommonNames: &armservicefabric.ServerCertificateCommonNames{ - // CommonNames: []*armservicefabric.ServerCertificateCommonName{ - // { - // CertificateCommonName: to.Ptr("abc.com"), - // CertificateIssuerThumbprint: to.Ptr("12599211F8F14C90AFA9532AD79A6F2CA1C00622"), - // }}, - // X509StoreName: to.Ptr(armservicefabric.StoreNameMy), - // }, - // UpgradeDescription: &armservicefabric.ClusterUpgradePolicy{ - // DeltaHealthPolicy: &armservicefabric.ClusterUpgradeDeltaHealthPolicy{ - // ApplicationDeltaHealthPolicies: map[string]*armservicefabric.ApplicationDeltaHealthPolicy{ - // "fabric:/myApp1": &armservicefabric.ApplicationDeltaHealthPolicy{ - // DefaultServiceTypeDeltaHealthPolicy: &armservicefabric.ServiceTypeDeltaHealthPolicy{ - // MaxPercentDeltaUnhealthyServices: to.Ptr[int32](0), - // }, - // ServiceTypeDeltaHealthPolicies: map[string]*armservicefabric.ServiceTypeDeltaHealthPolicy{ - // "myServiceType1": &armservicefabric.ServiceTypeDeltaHealthPolicy{ - // MaxPercentDeltaUnhealthyServices: to.Ptr[int32](0), - // }, - // }, - // }, - // }, - // MaxPercentDeltaUnhealthyApplications: to.Ptr[int32](0), - // MaxPercentDeltaUnhealthyNodes: to.Ptr[int32](0), - // MaxPercentUpgradeDomainDeltaUnhealthyNodes: to.Ptr[int32](0), - // }, - // ForceRestart: to.Ptr(false), - // HealthCheckRetryTimeout: to.Ptr("00:05:00"), - // HealthCheckStableDuration: to.Ptr("00:00:30"), - // HealthCheckWaitDuration: to.Ptr("00:00:30"), - // HealthPolicy: &armservicefabric.ClusterHealthPolicy{ - // ApplicationHealthPolicies: map[string]*armservicefabric.ApplicationHealthPolicy{ - // "fabric:/myApp1": &armservicefabric.ApplicationHealthPolicy{ - // DefaultServiceTypeHealthPolicy: &armservicefabric.ServiceTypeHealthPolicy{ - // MaxPercentUnhealthyServices: to.Ptr[int32](0), - // }, - // ServiceTypeHealthPolicies: map[string]*armservicefabric.ServiceTypeHealthPolicy{ - // "myServiceType1": &armservicefabric.ServiceTypeHealthPolicy{ - // MaxPercentUnhealthyServices: to.Ptr[int32](100), - // }, - // }, - // }, - // }, - // MaxPercentUnhealthyApplications: to.Ptr[int32](0), - // MaxPercentUnhealthyNodes: to.Ptr[int32](0), - // }, - // UpgradeDomainTimeout: to.Ptr("00:15:00"), - // UpgradeReplicaSetCheckTimeout: to.Ptr("00:10:00"), - // UpgradeTimeout: to.Ptr("01:00:00"), - // }, - // UpgradeMode: to.Ptr(armservicefabric.UpgradeModeManual), - // VMImage: to.Ptr("Windows"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d55b8005f05b040b852c15e74a0f3e36494a15e1/specification/servicefabric/resource-manager/Microsoft.ServiceFabric/stable/2021-06-01/examples/ClusterPutOperation_example_max.json -func ExampleClustersClient_BeginCreateOrUpdate_putAClusterWithMaximumParameters() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armservicefabric.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewClustersClient().BeginCreateOrUpdate(ctx, "resRg", "myCluster", armservicefabric.Cluster{ - Location: to.Ptr("eastus"), - Tags: map[string]*string{}, - Properties: &armservicefabric.ClusterProperties{ - AddOnFeatures: []*armservicefabric.AddOnFeatures{ - to.Ptr(armservicefabric.AddOnFeaturesRepairManager), - to.Ptr(armservicefabric.AddOnFeaturesDNSService), - to.Ptr(armservicefabric.AddOnFeaturesBackupRestoreService), - to.Ptr(armservicefabric.AddOnFeaturesResourceMonitorService)}, - ApplicationTypeVersionsCleanupPolicy: &armservicefabric.ApplicationTypeVersionsCleanupPolicy{ - MaxUnusedVersionsToKeep: to.Ptr[int64](2), - }, - AzureActiveDirectory: &armservicefabric.AzureActiveDirectory{ - ClientApplication: to.Ptr("d151ad89-4bce-4ae8-b3d1-1dc79679fa75"), - ClusterApplication: to.Ptr("5886372e-7bf4-4878-a497-8098aba608ae"), - TenantID: to.Ptr("6abcc6a0-8666-43f1-87b8-172cf86a9f9c"), - }, - CertificateCommonNames: &armservicefabric.ServerCertificateCommonNames{ - CommonNames: []*armservicefabric.ServerCertificateCommonName{ - { - CertificateCommonName: to.Ptr("abc.com"), - CertificateIssuerThumbprint: to.Ptr("12599211F8F14C90AFA9532AD79A6F2CA1C00622"), - }}, - X509StoreName: to.Ptr(armservicefabric.StoreNameMy), - }, - ClientCertificateCommonNames: []*armservicefabric.ClientCertificateCommonName{ - { - CertificateCommonName: to.Ptr("abc.com"), - CertificateIssuerThumbprint: to.Ptr("5F3660C715EBBDA31DB1FFDCF508302348DE8E7A"), - IsAdmin: to.Ptr(true), - }}, - ClientCertificateThumbprints: []*armservicefabric.ClientCertificateThumbprint{ - { - CertificateThumbprint: to.Ptr("5F3660C715EBBDA31DB1FFDCF508302348DE8E7A"), - IsAdmin: to.Ptr(true), - }}, - ClusterCodeVersion: to.Ptr("7.0.470.9590"), - DiagnosticsStorageAccountConfig: &armservicefabric.DiagnosticsStorageAccountConfig{ - BlobEndpoint: to.Ptr("https://diag.blob.core.windows.net/"), - ProtectedAccountKeyName: to.Ptr("StorageAccountKey1"), - QueueEndpoint: to.Ptr("https://diag.queue.core.windows.net/"), - StorageAccountName: to.Ptr("diag"), - TableEndpoint: to.Ptr("https://diag.table.core.windows.net/"), - }, - EventStoreServiceEnabled: to.Ptr(true), - FabricSettings: []*armservicefabric.SettingsSectionDescription{ - { - Name: to.Ptr("UpgradeService"), - Parameters: []*armservicefabric.SettingsParameterDescription{ - { - Name: to.Ptr("AppPollIntervalInSeconds"), - Value: to.Ptr("60"), - }}, - }}, - InfrastructureServiceManager: to.Ptr(true), - ManagementEndpoint: to.Ptr("https://myCluster.eastus.cloudapp.azure.com:19080"), - NodeTypes: []*armservicefabric.NodeTypeDescription{ - { - Name: to.Ptr("nt1vm"), - ApplicationPorts: &armservicefabric.EndpointRangeDescription{ - EndPort: to.Ptr[int32](30000), - StartPort: to.Ptr[int32](20000), - }, - ClientConnectionEndpointPort: to.Ptr[int32](19000), - DurabilityLevel: to.Ptr(armservicefabric.DurabilityLevelSilver), - EphemeralPorts: &armservicefabric.EndpointRangeDescription{ - EndPort: to.Ptr[int32](64000), - StartPort: to.Ptr[int32](49000), - }, - HTTPGatewayEndpointPort: to.Ptr[int32](19007), - IsPrimary: to.Ptr(true), - IsStateless: to.Ptr(false), - MultipleAvailabilityZones: to.Ptr(true), - VMInstanceCount: to.Ptr[int32](5), - }}, - Notifications: []*armservicefabric.Notification{ - { - IsEnabled: to.Ptr(true), - NotificationCategory: to.Ptr(armservicefabric.NotificationCategoryWaveProgress), - NotificationLevel: to.Ptr(armservicefabric.NotificationLevelCritical), - NotificationTargets: []*armservicefabric.NotificationTarget{ - { - NotificationChannel: to.Ptr(armservicefabric.NotificationChannelEmailUser), - Receivers: []*string{ - to.Ptr("****@microsoft.com"), - to.Ptr("****@microsoft.com")}, - }, - { - NotificationChannel: to.Ptr(armservicefabric.NotificationChannelEmailSubscription), - Receivers: []*string{ - to.Ptr("Owner"), - to.Ptr("AccountAdmin")}, - }}, - }, - { - IsEnabled: to.Ptr(true), - NotificationCategory: to.Ptr(armservicefabric.NotificationCategoryWaveProgress), - NotificationLevel: to.Ptr(armservicefabric.NotificationLevelAll), - NotificationTargets: []*armservicefabric.NotificationTarget{ - { - NotificationChannel: to.Ptr(armservicefabric.NotificationChannelEmailUser), - Receivers: []*string{ - to.Ptr("****@microsoft.com"), - to.Ptr("****@microsoft.com")}, - }, - { - NotificationChannel: to.Ptr(armservicefabric.NotificationChannelEmailSubscription), - Receivers: []*string{ - to.Ptr("Owner"), - to.Ptr("AccountAdmin")}, - }}, - }}, - ReliabilityLevel: to.Ptr(armservicefabric.ReliabilityLevelPlatinum), - ReverseProxyCertificateCommonNames: &armservicefabric.ServerCertificateCommonNames{ - CommonNames: []*armservicefabric.ServerCertificateCommonName{ - { - CertificateCommonName: to.Ptr("abc.com"), - CertificateIssuerThumbprint: to.Ptr("12599211F8F14C90AFA9532AD79A6F2CA1C00622"), - }}, - X509StoreName: to.Ptr(armservicefabric.StoreNameMy), - }, - SfZonalUpgradeMode: to.Ptr(armservicefabric.SfZonalUpgradeModeHierarchical), - UpgradeDescription: &armservicefabric.ClusterUpgradePolicy{ - DeltaHealthPolicy: &armservicefabric.ClusterUpgradeDeltaHealthPolicy{ - ApplicationDeltaHealthPolicies: map[string]*armservicefabric.ApplicationDeltaHealthPolicy{ - "fabric:/myApp1": { - DefaultServiceTypeDeltaHealthPolicy: &armservicefabric.ServiceTypeDeltaHealthPolicy{ - MaxPercentDeltaUnhealthyServices: to.Ptr[int32](0), - }, - ServiceTypeDeltaHealthPolicies: map[string]*armservicefabric.ServiceTypeDeltaHealthPolicy{ - "myServiceType1": { - MaxPercentDeltaUnhealthyServices: to.Ptr[int32](0), - }, - }, - }, - }, - MaxPercentDeltaUnhealthyApplications: to.Ptr[int32](0), - MaxPercentDeltaUnhealthyNodes: to.Ptr[int32](0), - MaxPercentUpgradeDomainDeltaUnhealthyNodes: to.Ptr[int32](0), - }, - ForceRestart: to.Ptr(false), - HealthCheckRetryTimeout: to.Ptr("00:05:00"), - HealthCheckStableDuration: to.Ptr("00:00:30"), - HealthCheckWaitDuration: to.Ptr("00:00:30"), - HealthPolicy: &armservicefabric.ClusterHealthPolicy{ - ApplicationHealthPolicies: map[string]*armservicefabric.ApplicationHealthPolicy{ - "fabric:/myApp1": { - DefaultServiceTypeHealthPolicy: &armservicefabric.ServiceTypeHealthPolicy{ - MaxPercentUnhealthyServices: to.Ptr[int32](0), - }, - ServiceTypeHealthPolicies: map[string]*armservicefabric.ServiceTypeHealthPolicy{ - "myServiceType1": { - MaxPercentUnhealthyServices: to.Ptr[int32](100), - }, - }, - }, - }, - MaxPercentUnhealthyApplications: to.Ptr[int32](0), - MaxPercentUnhealthyNodes: to.Ptr[int32](0), - }, - UpgradeDomainTimeout: to.Ptr("00:15:00"), - UpgradeReplicaSetCheckTimeout: to.Ptr("00:10:00"), - UpgradeTimeout: to.Ptr("01:00:00"), - }, - UpgradeMode: to.Ptr(armservicefabric.UpgradeModeManual), - UpgradePauseEndTimestampUTC: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-06-25T22:00:00Z"); return t }()), - UpgradePauseStartTimestampUTC: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-06-21T22:00:00Z"); return t }()), - UpgradeWave: to.Ptr(armservicefabric.ClusterUpgradeCadenceWave1), - VMImage: to.Ptr("Windows"), - VmssZonalUpgradeMode: to.Ptr(armservicefabric.VmssZonalUpgradeModeParallel), - }, - }, 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.Cluster = armservicefabric.Cluster{ - // Name: to.Ptr("myCluster"), - // Type: to.Ptr("Microsoft.ServiceFabric/clusters"), - // Etag: to.Ptr("W/\"636462502169240745\""), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/resRg/providers/Microsoft.ServiceFabric/clusters/myCluster"), - // Location: to.Ptr("eastus"), - // Tags: map[string]*string{ - // }, - // Properties: &armservicefabric.ClusterProperties{ - // AddOnFeatures: []*armservicefabric.AddOnFeatures{ - // to.Ptr(armservicefabric.AddOnFeaturesRepairManager), - // to.Ptr(armservicefabric.AddOnFeaturesDNSService), - // to.Ptr(armservicefabric.AddOnFeaturesBackupRestoreService), - // to.Ptr(armservicefabric.AddOnFeaturesResourceMonitorService)}, - // ApplicationTypeVersionsCleanupPolicy: &armservicefabric.ApplicationTypeVersionsCleanupPolicy{ - // MaxUnusedVersionsToKeep: to.Ptr[int64](2), - // }, - // AvailableClusterVersions: []*armservicefabric.ClusterVersionDetails{ - // { - // CodeVersion: to.Ptr("7.0.470.9590"), - // Environment: to.Ptr(armservicefabric.ClusterEnvironmentWindows), - // SupportExpiryUTC: to.Ptr("2018-06-15T23:59:59.9999999"), - // }}, - // AzureActiveDirectory: &armservicefabric.AzureActiveDirectory{ - // ClientApplication: to.Ptr("d151ad89-4bce-4ae8-b3d1-1dc79679fa75"), - // ClusterApplication: to.Ptr("5886372e-7bf4-4878-a497-8098aba608ae"), - // TenantID: to.Ptr("6abcc6a0-8666-43f1-87b8-172cf86a9f9c"), - // }, - // CertificateCommonNames: &armservicefabric.ServerCertificateCommonNames{ - // CommonNames: []*armservicefabric.ServerCertificateCommonName{ - // { - // CertificateCommonName: to.Ptr("abc.com"), - // CertificateIssuerThumbprint: to.Ptr("12599211F8F14C90AFA9532AD79A6F2CA1C00622"), - // }}, - // X509StoreName: to.Ptr(armservicefabric.StoreNameMy), - // }, - // ClientCertificateCommonNames: []*armservicefabric.ClientCertificateCommonName{ - // { - // CertificateCommonName: to.Ptr("abc.com"), - // CertificateIssuerThumbprint: to.Ptr("5F3660C715EBBDA31DB1FFDCF508302348DE8E7A"), - // IsAdmin: to.Ptr(true), - // }}, - // ClientCertificateThumbprints: []*armservicefabric.ClientCertificateThumbprint{ - // { - // CertificateThumbprint: to.Ptr("5F3660C715EBBDA31DB1FFDCF508302348DE8E7A"), - // IsAdmin: to.Ptr(false), - // }}, - // ClusterCodeVersion: to.Ptr("7.0.470.9590"), - // ClusterEndpoint: to.Ptr("https://eastus.servicefabric.azure.com"), - // ClusterID: to.Ptr("92584666-9889-4ae8-8d02-91902923d37f"), - // ClusterState: to.Ptr(armservicefabric.ClusterStateWaitingForNodes), - // DiagnosticsStorageAccountConfig: &armservicefabric.DiagnosticsStorageAccountConfig{ - // BlobEndpoint: to.Ptr("https://diag.blob.core.windows.net/"), - // ProtectedAccountKeyName: to.Ptr("StorageAccountKey1"), - // QueueEndpoint: to.Ptr("https://diag.queue.core.windows.net/"), - // StorageAccountName: to.Ptr("diag"), - // TableEndpoint: to.Ptr("https://diag.table.core.windows.net/"), - // }, - // EventStoreServiceEnabled: to.Ptr(true), - // FabricSettings: []*armservicefabric.SettingsSectionDescription{ - // { - // Name: to.Ptr("UpgradeService"), - // Parameters: []*armservicefabric.SettingsParameterDescription{ - // { - // Name: to.Ptr("AppPollIntervalInSeconds"), - // Value: to.Ptr("60"), - // }}, - // }}, - // InfrastructureServiceManager: to.Ptr(true), - // ManagementEndpoint: to.Ptr("https://myCluster.eastus.cloudapp.azure.com:19080"), - // NodeTypes: []*armservicefabric.NodeTypeDescription{ - // { - // Name: to.Ptr("nt1vm"), - // ApplicationPorts: &armservicefabric.EndpointRangeDescription{ - // EndPort: to.Ptr[int32](30000), - // StartPort: to.Ptr[int32](20000), - // }, - // ClientConnectionEndpointPort: to.Ptr[int32](19000), - // DurabilityLevel: to.Ptr(armservicefabric.DurabilityLevelSilver), - // EphemeralPorts: &armservicefabric.EndpointRangeDescription{ - // EndPort: to.Ptr[int32](64000), - // StartPort: to.Ptr[int32](49000), - // }, - // HTTPGatewayEndpointPort: to.Ptr[int32](19007), - // IsPrimary: to.Ptr(true), - // IsStateless: to.Ptr(false), - // MultipleAvailabilityZones: to.Ptr(true), - // VMInstanceCount: to.Ptr[int32](5), - // }}, - // Notifications: []*armservicefabric.Notification{ - // { - // IsEnabled: to.Ptr(true), - // NotificationCategory: to.Ptr(armservicefabric.NotificationCategoryWaveProgress), - // NotificationLevel: to.Ptr(armservicefabric.NotificationLevelCritical), - // NotificationTargets: []*armservicefabric.NotificationTarget{ - // { - // NotificationChannel: to.Ptr(armservicefabric.NotificationChannelEmailUser), - // Receivers: []*string{ - // to.Ptr("****@microsoft.com"), - // to.Ptr("****@microsoft.com")}, - // }, - // { - // NotificationChannel: to.Ptr(armservicefabric.NotificationChannelEmailSubscription), - // Receivers: []*string{ - // to.Ptr("Owner"), - // to.Ptr("AccountAdmin")}, - // }}, - // }, - // { - // IsEnabled: to.Ptr(true), - // NotificationCategory: to.Ptr(armservicefabric.NotificationCategoryWaveProgress), - // NotificationLevel: to.Ptr(armservicefabric.NotificationLevelAll), - // NotificationTargets: []*armservicefabric.NotificationTarget{ - // { - // NotificationChannel: to.Ptr(armservicefabric.NotificationChannelEmailUser), - // Receivers: []*string{ - // to.Ptr("****@microsoft.com"), - // to.Ptr("****@microsoft.com")}, - // }, - // { - // NotificationChannel: to.Ptr(armservicefabric.NotificationChannelEmailSubscription), - // Receivers: []*string{ - // to.Ptr("Owner"), - // to.Ptr("AccountAdmin")}, - // }}, - // }}, - // ProvisioningState: to.Ptr(armservicefabric.ProvisioningStateSucceeded), - // ReliabilityLevel: to.Ptr(armservicefabric.ReliabilityLevelPlatinum), - // ReverseProxyCertificateCommonNames: &armservicefabric.ServerCertificateCommonNames{ - // CommonNames: []*armservicefabric.ServerCertificateCommonName{ - // { - // CertificateCommonName: to.Ptr("abc.com"), - // CertificateIssuerThumbprint: to.Ptr("12599211F8F14C90AFA9532AD79A6F2CA1C00622"), - // }}, - // X509StoreName: to.Ptr(armservicefabric.StoreNameMy), - // }, - // SfZonalUpgradeMode: to.Ptr(armservicefabric.SfZonalUpgradeModeHierarchical), - // UpgradeDescription: &armservicefabric.ClusterUpgradePolicy{ - // DeltaHealthPolicy: &armservicefabric.ClusterUpgradeDeltaHealthPolicy{ - // ApplicationDeltaHealthPolicies: map[string]*armservicefabric.ApplicationDeltaHealthPolicy{ - // "fabric:/myApp1": &armservicefabric.ApplicationDeltaHealthPolicy{ - // DefaultServiceTypeDeltaHealthPolicy: &armservicefabric.ServiceTypeDeltaHealthPolicy{ - // MaxPercentDeltaUnhealthyServices: to.Ptr[int32](0), - // }, - // ServiceTypeDeltaHealthPolicies: map[string]*armservicefabric.ServiceTypeDeltaHealthPolicy{ - // "myServiceType1": &armservicefabric.ServiceTypeDeltaHealthPolicy{ - // MaxPercentDeltaUnhealthyServices: to.Ptr[int32](0), - // }, - // }, - // }, - // }, - // MaxPercentDeltaUnhealthyApplications: to.Ptr[int32](0), - // MaxPercentDeltaUnhealthyNodes: to.Ptr[int32](0), - // MaxPercentUpgradeDomainDeltaUnhealthyNodes: to.Ptr[int32](0), - // }, - // ForceRestart: to.Ptr(true), - // HealthCheckRetryTimeout: to.Ptr("00:05:00"), - // HealthCheckStableDuration: to.Ptr("00:00:30"), - // HealthCheckWaitDuration: to.Ptr("00:00:30"), - // HealthPolicy: &armservicefabric.ClusterHealthPolicy{ - // ApplicationHealthPolicies: map[string]*armservicefabric.ApplicationHealthPolicy{ - // "fabric:/myApp1": &armservicefabric.ApplicationHealthPolicy{ - // DefaultServiceTypeHealthPolicy: &armservicefabric.ServiceTypeHealthPolicy{ - // MaxPercentUnhealthyServices: to.Ptr[int32](0), - // }, - // ServiceTypeHealthPolicies: map[string]*armservicefabric.ServiceTypeHealthPolicy{ - // "myServiceType1": &armservicefabric.ServiceTypeHealthPolicy{ - // MaxPercentUnhealthyServices: to.Ptr[int32](100), - // }, - // }, - // }, - // }, - // MaxPercentUnhealthyApplications: to.Ptr[int32](0), - // MaxPercentUnhealthyNodes: to.Ptr[int32](0), - // }, - // UpgradeDomainTimeout: to.Ptr("00:15:00"), - // UpgradeReplicaSetCheckTimeout: to.Ptr("00:10:00"), - // UpgradeTimeout: to.Ptr("00:15:00"), - // }, - // UpgradeMode: to.Ptr(armservicefabric.UpgradeModeManual), - // UpgradePauseEndTimestampUTC: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-06-25T22:00:00Z"); return t}()), - // UpgradePauseStartTimestampUTC: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-06-21T22:00:00Z"); return t}()), - // UpgradeWave: to.Ptr(armservicefabric.ClusterUpgradeCadenceWave1), - // VMImage: to.Ptr("Windows"), - // VmssZonalUpgradeMode: to.Ptr(armservicefabric.VmssZonalUpgradeModeParallel), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d55b8005f05b040b852c15e74a0f3e36494a15e1/specification/servicefabric/resource-manager/Microsoft.ServiceFabric/stable/2021-06-01/examples/ClusterPutOperation_example_min.json -func ExampleClustersClient_BeginCreateOrUpdate_putAClusterWithMinimumParameters() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armservicefabric.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewClustersClient().BeginCreateOrUpdate(ctx, "resRg", "myCluster", armservicefabric.Cluster{ - Location: to.Ptr("eastus"), - Tags: map[string]*string{}, - Properties: &armservicefabric.ClusterProperties{ - DiagnosticsStorageAccountConfig: &armservicefabric.DiagnosticsStorageAccountConfig{ - BlobEndpoint: to.Ptr("https://diag.blob.core.windows.net/"), - ProtectedAccountKeyName: to.Ptr("StorageAccountKey1"), - QueueEndpoint: to.Ptr("https://diag.queue.core.windows.net/"), - StorageAccountName: to.Ptr("diag"), - TableEndpoint: to.Ptr("https://diag.table.core.windows.net/"), - }, - FabricSettings: []*armservicefabric.SettingsSectionDescription{ - { - Name: to.Ptr("UpgradeService"), - Parameters: []*armservicefabric.SettingsParameterDescription{ - { - Name: to.Ptr("AppPollIntervalInSeconds"), - Value: to.Ptr("60"), - }}, - }}, - ManagementEndpoint: to.Ptr("http://myCluster.eastus.cloudapp.azure.com:19080"), - NodeTypes: []*armservicefabric.NodeTypeDescription{ - { - Name: to.Ptr("nt1vm"), - ApplicationPorts: &armservicefabric.EndpointRangeDescription{ - EndPort: to.Ptr[int32](30000), - StartPort: to.Ptr[int32](20000), - }, - ClientConnectionEndpointPort: to.Ptr[int32](19000), - DurabilityLevel: to.Ptr(armservicefabric.DurabilityLevelBronze), - EphemeralPorts: &armservicefabric.EndpointRangeDescription{ - EndPort: to.Ptr[int32](64000), - StartPort: to.Ptr[int32](49000), - }, - HTTPGatewayEndpointPort: to.Ptr[int32](19007), - IsPrimary: to.Ptr(true), - VMInstanceCount: to.Ptr[int32](5), - }}, - ReliabilityLevel: to.Ptr(armservicefabric.ReliabilityLevelSilver), - UpgradeMode: to.Ptr(armservicefabric.UpgradeModeAutomatic), - }, - }, 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.Cluster = armservicefabric.Cluster{ - // Name: to.Ptr("myCluster"), - // Type: to.Ptr("Microsoft.ServiceFabric/clusters"), - // Etag: to.Ptr("W/\"636462502169240743\""), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/resRg/providers/Microsoft.ServiceFabric/clusters/myCluster"), - // Location: to.Ptr("eastus"), - // Tags: map[string]*string{ - // }, - // Properties: &armservicefabric.ClusterProperties{ - // AvailableClusterVersions: []*armservicefabric.ClusterVersionDetails{ - // { - // CodeVersion: to.Ptr("7.0.470.9590"), - // Environment: to.Ptr(armservicefabric.ClusterEnvironmentWindows), - // SupportExpiryUTC: to.Ptr("2018-06-15T23:59:59.9999999"), - // }}, - // ClientCertificateCommonNames: []*armservicefabric.ClientCertificateCommonName{ - // }, - // ClientCertificateThumbprints: []*armservicefabric.ClientCertificateThumbprint{ - // }, - // ClusterCodeVersion: to.Ptr("7.0.470.9590"), - // ClusterEndpoint: to.Ptr("https://eastus.servicefabric.azure.com"), - // ClusterID: to.Ptr("92584666-9889-4ae8-8d02-91902923d37f"), - // ClusterState: to.Ptr(armservicefabric.ClusterStateWaitingForNodes), - // DiagnosticsStorageAccountConfig: &armservicefabric.DiagnosticsStorageAccountConfig{ - // BlobEndpoint: to.Ptr("https://diag.blob.core.windows.net/"), - // ProtectedAccountKeyName: to.Ptr("StorageAccountKey1"), - // QueueEndpoint: to.Ptr("https://diag.queue.core.windows.net/"), - // StorageAccountName: to.Ptr("diag"), - // TableEndpoint: to.Ptr("https://diag.table.core.windows.net/"), - // }, - // FabricSettings: []*armservicefabric.SettingsSectionDescription{ - // { - // Name: to.Ptr("UpgradeService"), - // Parameters: []*armservicefabric.SettingsParameterDescription{ - // { - // Name: to.Ptr("AppPollIntervalInSeconds"), - // Value: to.Ptr("60"), - // }}, - // }}, - // ManagementEndpoint: to.Ptr("http://myCluster.eastus.cloudapp.azure.com:19080"), - // NodeTypes: []*armservicefabric.NodeTypeDescription{ - // { - // Name: to.Ptr("nt1vm"), - // ApplicationPorts: &armservicefabric.EndpointRangeDescription{ - // EndPort: to.Ptr[int32](30000), - // StartPort: to.Ptr[int32](20000), - // }, - // ClientConnectionEndpointPort: to.Ptr[int32](19000), - // DurabilityLevel: to.Ptr(armservicefabric.DurabilityLevelBronze), - // EphemeralPorts: &armservicefabric.EndpointRangeDescription{ - // EndPort: to.Ptr[int32](64000), - // StartPort: to.Ptr[int32](49000), - // }, - // HTTPGatewayEndpointPort: to.Ptr[int32](19007), - // IsPrimary: to.Ptr(true), - // VMInstanceCount: to.Ptr[int32](5), - // }}, - // ProvisioningState: to.Ptr(armservicefabric.ProvisioningStateSucceeded), - // ReliabilityLevel: to.Ptr(armservicefabric.ReliabilityLevelSilver), - // UpgradeDescription: &armservicefabric.ClusterUpgradePolicy{ - // DeltaHealthPolicy: &armservicefabric.ClusterUpgradeDeltaHealthPolicy{ - // MaxPercentDeltaUnhealthyApplications: to.Ptr[int32](0), - // MaxPercentDeltaUnhealthyNodes: to.Ptr[int32](0), - // MaxPercentUpgradeDomainDeltaUnhealthyNodes: to.Ptr[int32](0), - // }, - // ForceRestart: to.Ptr(false), - // HealthCheckRetryTimeout: to.Ptr("00:45:00"), - // HealthCheckStableDuration: to.Ptr("00:05:00"), - // HealthCheckWaitDuration: to.Ptr("00:05:00"), - // HealthPolicy: &armservicefabric.ClusterHealthPolicy{ - // MaxPercentUnhealthyApplications: to.Ptr[int32](100), - // MaxPercentUnhealthyNodes: to.Ptr[int32](100), - // }, - // UpgradeDomainTimeout: to.Ptr("02:00:00"), - // UpgradeReplicaSetCheckTimeout: to.Ptr("10675199.02:48:05.4775807"), - // UpgradeTimeout: to.Ptr("12:00:00"), - // }, - // UpgradeMode: to.Ptr(armservicefabric.UpgradeModeAutomatic), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d55b8005f05b040b852c15e74a0f3e36494a15e1/specification/servicefabric/resource-manager/Microsoft.ServiceFabric/stable/2021-06-01/examples/ClusterPatchOperation_example.json -func ExampleClustersClient_BeginUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armservicefabric.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewClustersClient().BeginUpdate(ctx, "resRg", "myCluster", armservicefabric.ClusterUpdateParameters{ - Properties: &armservicefabric.ClusterPropertiesUpdateParameters{ - EventStoreServiceEnabled: to.Ptr(true), - NodeTypes: []*armservicefabric.NodeTypeDescription{ - { - Name: to.Ptr("nt1vm"), - ApplicationPorts: &armservicefabric.EndpointRangeDescription{ - EndPort: to.Ptr[int32](30000), - StartPort: to.Ptr[int32](20000), - }, - ClientConnectionEndpointPort: to.Ptr[int32](19000), - DurabilityLevel: to.Ptr(armservicefabric.DurabilityLevelBronze), - EphemeralPorts: &armservicefabric.EndpointRangeDescription{ - EndPort: to.Ptr[int32](64000), - StartPort: to.Ptr[int32](49000), - }, - HTTPGatewayEndpointPort: to.Ptr[int32](19007), - IsPrimary: to.Ptr(true), - VMInstanceCount: to.Ptr[int32](5), - }, - { - Name: to.Ptr("testnt1"), - ApplicationPorts: &armservicefabric.EndpointRangeDescription{ - EndPort: to.Ptr[int32](2000), - StartPort: to.Ptr[int32](1000), - }, - ClientConnectionEndpointPort: to.Ptr[int32](0), - DurabilityLevel: to.Ptr(armservicefabric.DurabilityLevelBronze), - EphemeralPorts: &armservicefabric.EndpointRangeDescription{ - EndPort: to.Ptr[int32](4000), - StartPort: to.Ptr[int32](3000), - }, - HTTPGatewayEndpointPort: to.Ptr[int32](0), - IsPrimary: to.Ptr(false), - VMInstanceCount: to.Ptr[int32](3), - }}, - ReliabilityLevel: to.Ptr(armservicefabric.ReliabilityLevelBronze), - UpgradeMode: to.Ptr(armservicefabric.UpgradeModeAutomatic), - UpgradePauseEndTimestampUTC: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-06-25T22:00:00Z"); return t }()), - UpgradePauseStartTimestampUTC: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-06-21T22:00:00Z"); return t }()), - UpgradeWave: to.Ptr(armservicefabric.ClusterUpgradeCadence("Wave")), - }, - Tags: map[string]*string{ - "a": to.Ptr("b"), - }, - }, 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.Cluster = armservicefabric.Cluster{ - // Name: to.Ptr("myCluster"), - // Type: to.Ptr("Microsoft.ServiceFabric/clusters"), - // Etag: to.Ptr("W/\"636462502169240744\""), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/resRg/providers/Microsoft.ServiceFabric/clusters/myCluster"), - // Location: to.Ptr("eastus"), - // Tags: map[string]*string{ - // "a": to.Ptr("b"), - // }, - // Properties: &armservicefabric.ClusterProperties{ - // AvailableClusterVersions: []*armservicefabric.ClusterVersionDetails{ - // { - // CodeVersion: to.Ptr("6.1.480.9494"), - // Environment: to.Ptr(armservicefabric.ClusterEnvironmentWindows), - // SupportExpiryUTC: to.Ptr("2018-06-15T23:59:59.9999999"), - // }}, - // CertificateCommonNames: &armservicefabric.ServerCertificateCommonNames{ - // CommonNames: []*armservicefabric.ServerCertificateCommonName{ - // { - // CertificateCommonName: to.Ptr("abc.com"), - // CertificateIssuerThumbprint: to.Ptr("12599211F8F14C90AFA9532AD79A6F2CA1C00622"), - // }}, - // X509StoreName: to.Ptr(armservicefabric.StoreNameMy), - // }, - // ClientCertificateCommonNames: []*armservicefabric.ClientCertificateCommonName{ - // }, - // ClientCertificateThumbprints: []*armservicefabric.ClientCertificateThumbprint{ - // }, - // ClusterCodeVersion: to.Ptr("6.1.480.9494"), - // ClusterEndpoint: to.Ptr("https://eastus.servicefabric.azure.com"), - // ClusterID: to.Ptr("92584666-9889-4ae8-8d02-91902923d37f"), - // ClusterState: to.Ptr(armservicefabric.ClusterStateWaitingForNodes), - // DiagnosticsStorageAccountConfig: &armservicefabric.DiagnosticsStorageAccountConfig{ - // BlobEndpoint: to.Ptr("https://diag.blob.core.windows.net/"), - // ProtectedAccountKeyName: to.Ptr("StorageAccountKey1"), - // QueueEndpoint: to.Ptr("https://diag.queue.core.windows.net/"), - // StorageAccountName: to.Ptr("diag"), - // TableEndpoint: to.Ptr("https://diag.table.core.windows.net/"), - // }, - // EventStoreServiceEnabled: to.Ptr(true), - // FabricSettings: []*armservicefabric.SettingsSectionDescription{ - // { - // Name: to.Ptr("UpgradeService"), - // Parameters: []*armservicefabric.SettingsParameterDescription{ - // { - // Name: to.Ptr("AppPollIntervalInSeconds"), - // Value: to.Ptr("60"), - // }}, - // }}, - // ManagementEndpoint: to.Ptr("http://myCluster.eastus.cloudapp.azure.com:19080"), - // NodeTypes: []*armservicefabric.NodeTypeDescription{ - // { - // Name: to.Ptr("nt1vm"), - // ApplicationPorts: &armservicefabric.EndpointRangeDescription{ - // EndPort: to.Ptr[int32](30000), - // StartPort: to.Ptr[int32](20000), - // }, - // ClientConnectionEndpointPort: to.Ptr[int32](19000), - // DurabilityLevel: to.Ptr(armservicefabric.DurabilityLevelBronze), - // EphemeralPorts: &armservicefabric.EndpointRangeDescription{ - // EndPort: to.Ptr[int32](64000), - // StartPort: to.Ptr[int32](49000), - // }, - // HTTPGatewayEndpointPort: to.Ptr[int32](19007), - // IsPrimary: to.Ptr(true), - // VMInstanceCount: to.Ptr[int32](5), - // }, - // { - // Name: to.Ptr("testnt1"), - // ApplicationPorts: &armservicefabric.EndpointRangeDescription{ - // EndPort: to.Ptr[int32](2000), - // StartPort: to.Ptr[int32](1000), - // }, - // ClientConnectionEndpointPort: to.Ptr[int32](0), - // DurabilityLevel: to.Ptr(armservicefabric.DurabilityLevelBronze), - // EphemeralPorts: &armservicefabric.EndpointRangeDescription{ - // EndPort: to.Ptr[int32](4000), - // StartPort: to.Ptr[int32](3000), - // }, - // HTTPGatewayEndpointPort: to.Ptr[int32](0), - // IsPrimary: to.Ptr(false), - // VMInstanceCount: to.Ptr[int32](3), - // }}, - // Notifications: []*armservicefabric.Notification{ - // { - // IsEnabled: to.Ptr(true), - // NotificationCategory: to.Ptr(armservicefabric.NotificationCategoryWaveProgress), - // NotificationLevel: to.Ptr(armservicefabric.NotificationLevelCritical), - // NotificationTargets: []*armservicefabric.NotificationTarget{ - // { - // NotificationChannel: to.Ptr(armservicefabric.NotificationChannelEmailUser), - // Receivers: []*string{ - // to.Ptr("****@microsoft.com"), - // to.Ptr("****@microsoft.com")}, - // }, - // { - // NotificationChannel: to.Ptr(armservicefabric.NotificationChannelEmailSubscription), - // Receivers: []*string{ - // to.Ptr("Owner"), - // to.Ptr("AccountAdmin")}, - // }}, - // }, - // { - // IsEnabled: to.Ptr(true), - // NotificationCategory: to.Ptr(armservicefabric.NotificationCategoryWaveProgress), - // NotificationLevel: to.Ptr(armservicefabric.NotificationLevelAll), - // NotificationTargets: []*armservicefabric.NotificationTarget{ - // { - // NotificationChannel: to.Ptr(armservicefabric.NotificationChannelEmailUser), - // Receivers: []*string{ - // to.Ptr("****@microsoft.com"), - // to.Ptr("****@microsoft.com")}, - // }, - // { - // NotificationChannel: to.Ptr(armservicefabric.NotificationChannelEmailSubscription), - // Receivers: []*string{ - // to.Ptr("Owner"), - // to.Ptr("AccountAdmin")}, - // }}, - // }}, - // ProvisioningState: to.Ptr(armservicefabric.ProvisioningStateSucceeded), - // ReliabilityLevel: to.Ptr(armservicefabric.ReliabilityLevelBronze), - // UpgradeDescription: &armservicefabric.ClusterUpgradePolicy{ - // DeltaHealthPolicy: &armservicefabric.ClusterUpgradeDeltaHealthPolicy{ - // MaxPercentDeltaUnhealthyApplications: to.Ptr[int32](0), - // MaxPercentDeltaUnhealthyNodes: to.Ptr[int32](0), - // MaxPercentUpgradeDomainDeltaUnhealthyNodes: to.Ptr[int32](0), - // }, - // ForceRestart: to.Ptr(false), - // HealthCheckRetryTimeout: to.Ptr("00:05:00"), - // HealthCheckStableDuration: to.Ptr("00:00:30"), - // HealthCheckWaitDuration: to.Ptr("00:00:30"), - // HealthPolicy: &armservicefabric.ClusterHealthPolicy{ - // MaxPercentUnhealthyApplications: to.Ptr[int32](0), - // MaxPercentUnhealthyNodes: to.Ptr[int32](0), - // }, - // UpgradeDomainTimeout: to.Ptr("00:15:00"), - // UpgradeReplicaSetCheckTimeout: to.Ptr("00:10:00"), - // UpgradeTimeout: to.Ptr("01:00:00"), - // }, - // UpgradeMode: to.Ptr(armservicefabric.UpgradeModeAutomatic), - // UpgradePauseEndTimestampUTC: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-06-25T22:00:00Z"); return t}()), - // UpgradePauseStartTimestampUTC: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-06-21T22:00:00Z"); return t}()), - // UpgradeWave: to.Ptr(armservicefabric.ClusterUpgradeCadenceWave2), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d55b8005f05b040b852c15e74a0f3e36494a15e1/specification/servicefabric/resource-manager/Microsoft.ServiceFabric/stable/2021-06-01/examples/ClusterDeleteOperation_example.json -func ExampleClustersClient_Delete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armservicefabric.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = clientFactory.NewClustersClient().Delete(ctx, "resRg", "myCluster", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d55b8005f05b040b852c15e74a0f3e36494a15e1/specification/servicefabric/resource-manager/Microsoft.ServiceFabric/stable/2021-06-01/examples/ClusterListByResourceGroupOperation_example.json -func ExampleClustersClient_ListByResourceGroup() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armservicefabric.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewClustersClient().ListByResourceGroup(ctx, "resRg", 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.ClusterListResult = armservicefabric.ClusterListResult{ - // Value: []*armservicefabric.Cluster{ - // { - // Name: to.Ptr("myCluster"), - // Type: to.Ptr("Microsoft.ServiceFabric/clusters"), - // Etag: to.Ptr("W/\"636462502169240745\""), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/resRg/providers/Microsoft.ServiceFabric/clusters/myCluster"), - // Location: to.Ptr("eastus"), - // Tags: map[string]*string{ - // }, - // Properties: &armservicefabric.ClusterProperties{ - // AddOnFeatures: []*armservicefabric.AddOnFeatures{ - // to.Ptr(armservicefabric.AddOnFeaturesRepairManager), - // to.Ptr(armservicefabric.AddOnFeaturesDNSService), - // to.Ptr(armservicefabric.AddOnFeaturesBackupRestoreService), - // to.Ptr(armservicefabric.AddOnFeaturesResourceMonitorService)}, - // AvailableClusterVersions: []*armservicefabric.ClusterVersionDetails{ - // { - // CodeVersion: to.Ptr("6.1.480.9494"), - // Environment: to.Ptr(armservicefabric.ClusterEnvironmentWindows), - // SupportExpiryUTC: to.Ptr("2018-06-15T23:59:59.9999999"), - // }}, - // AzureActiveDirectory: &armservicefabric.AzureActiveDirectory{ - // ClientApplication: to.Ptr("d151ad89-4bce-4ae8-b3d1-1dc79679fa75"), - // ClusterApplication: to.Ptr("5886372e-7bf4-4878-a497-8098aba608ae"), - // TenantID: to.Ptr("6abcc6a0-8666-43f1-87b8-172cf86a9f9c"), - // }, - // CertificateCommonNames: &armservicefabric.ServerCertificateCommonNames{ - // CommonNames: []*armservicefabric.ServerCertificateCommonName{ - // { - // CertificateCommonName: to.Ptr("abc.com"), - // CertificateIssuerThumbprint: to.Ptr("12599211F8F14C90AFA9532AD79A6F2CA1C00622"), - // }}, - // X509StoreName: to.Ptr(armservicefabric.StoreNameMy), - // }, - // ClientCertificateCommonNames: []*armservicefabric.ClientCertificateCommonName{ - // { - // CertificateCommonName: to.Ptr("abc.com"), - // CertificateIssuerThumbprint: to.Ptr("5F3660C715EBBDA31DB1FFDCF508302348DE8E7A"), - // IsAdmin: to.Ptr(true), - // }}, - // ClientCertificateThumbprints: []*armservicefabric.ClientCertificateThumbprint{ - // { - // CertificateThumbprint: to.Ptr("5F3660C715EBBDA31DB1FFDCF508302348DE8E7A"), - // IsAdmin: to.Ptr(false), - // }}, - // ClusterCodeVersion: to.Ptr("6.1.480.9494"), - // ClusterEndpoint: to.Ptr("https://eastus.servicefabric.azure.com"), - // ClusterID: to.Ptr("92584666-9889-4ae8-8d02-91902923d37f"), - // ClusterState: to.Ptr(armservicefabric.ClusterStateWaitingForNodes), - // DiagnosticsStorageAccountConfig: &armservicefabric.DiagnosticsStorageAccountConfig{ - // BlobEndpoint: to.Ptr("https://diag.blob.core.windows.net/"), - // ProtectedAccountKeyName: to.Ptr("StorageAccountKey1"), - // QueueEndpoint: to.Ptr("https://diag.queue.core.windows.net/"), - // StorageAccountName: to.Ptr("diag"), - // TableEndpoint: to.Ptr("https://diag.table.core.windows.net/"), - // }, - // FabricSettings: []*armservicefabric.SettingsSectionDescription{ - // { - // Name: to.Ptr("UpgradeService"), - // Parameters: []*armservicefabric.SettingsParameterDescription{ - // { - // Name: to.Ptr("AppPollIntervalInSeconds"), - // Value: to.Ptr("60"), - // }}, - // }}, - // ManagementEndpoint: to.Ptr("https://myCluster.eastus.cloudapp.azure.com:19080"), - // NodeTypes: []*armservicefabric.NodeTypeDescription{ - // { - // Name: to.Ptr("nt1vm"), - // ApplicationPorts: &armservicefabric.EndpointRangeDescription{ - // EndPort: to.Ptr[int32](30000), - // StartPort: to.Ptr[int32](20000), - // }, - // ClientConnectionEndpointPort: to.Ptr[int32](19000), - // DurabilityLevel: to.Ptr(armservicefabric.DurabilityLevelBronze), - // EphemeralPorts: &armservicefabric.EndpointRangeDescription{ - // EndPort: to.Ptr[int32](64000), - // StartPort: to.Ptr[int32](49000), - // }, - // HTTPGatewayEndpointPort: to.Ptr[int32](19007), - // IsPrimary: to.Ptr(true), - // VMInstanceCount: to.Ptr[int32](5), - // }}, - // ProvisioningState: to.Ptr(armservicefabric.ProvisioningStateSucceeded), - // ReliabilityLevel: to.Ptr(armservicefabric.ReliabilityLevelSilver), - // ReverseProxyCertificateCommonNames: &armservicefabric.ServerCertificateCommonNames{ - // CommonNames: []*armservicefabric.ServerCertificateCommonName{ - // { - // CertificateCommonName: to.Ptr("abc.com"), - // CertificateIssuerThumbprint: to.Ptr("12599211F8F14C90AFA9532AD79A6F2CA1C00622"), - // }}, - // X509StoreName: to.Ptr(armservicefabric.StoreNameMy), - // }, - // UpgradeDescription: &armservicefabric.ClusterUpgradePolicy{ - // DeltaHealthPolicy: &armservicefabric.ClusterUpgradeDeltaHealthPolicy{ - // ApplicationDeltaHealthPolicies: map[string]*armservicefabric.ApplicationDeltaHealthPolicy{ - // "fabric:/myApp1": &armservicefabric.ApplicationDeltaHealthPolicy{ - // DefaultServiceTypeDeltaHealthPolicy: &armservicefabric.ServiceTypeDeltaHealthPolicy{ - // MaxPercentDeltaUnhealthyServices: to.Ptr[int32](0), - // }, - // ServiceTypeDeltaHealthPolicies: map[string]*armservicefabric.ServiceTypeDeltaHealthPolicy{ - // "myServiceType1": &armservicefabric.ServiceTypeDeltaHealthPolicy{ - // MaxPercentDeltaUnhealthyServices: to.Ptr[int32](0), - // }, - // }, - // }, - // }, - // MaxPercentDeltaUnhealthyApplications: to.Ptr[int32](0), - // MaxPercentDeltaUnhealthyNodes: to.Ptr[int32](0), - // MaxPercentUpgradeDomainDeltaUnhealthyNodes: to.Ptr[int32](0), - // }, - // ForceRestart: to.Ptr(false), - // HealthCheckRetryTimeout: to.Ptr("00:05:00"), - // HealthCheckStableDuration: to.Ptr("00:00:30"), - // HealthCheckWaitDuration: to.Ptr("00:00:30"), - // HealthPolicy: &armservicefabric.ClusterHealthPolicy{ - // ApplicationHealthPolicies: map[string]*armservicefabric.ApplicationHealthPolicy{ - // "fabric:/myApp1": &armservicefabric.ApplicationHealthPolicy{ - // DefaultServiceTypeHealthPolicy: &armservicefabric.ServiceTypeHealthPolicy{ - // MaxPercentUnhealthyServices: to.Ptr[int32](0), - // }, - // ServiceTypeHealthPolicies: map[string]*armservicefabric.ServiceTypeHealthPolicy{ - // "myServiceType1": &armservicefabric.ServiceTypeHealthPolicy{ - // MaxPercentUnhealthyServices: to.Ptr[int32](100), - // }, - // }, - // }, - // }, - // MaxPercentUnhealthyApplications: to.Ptr[int32](0), - // MaxPercentUnhealthyNodes: to.Ptr[int32](0), - // }, - // UpgradeDomainTimeout: to.Ptr("00:15:00"), - // UpgradeReplicaSetCheckTimeout: to.Ptr("00:10:00"), - // UpgradeTimeout: to.Ptr("01:00:00"), - // }, - // UpgradeMode: to.Ptr(armservicefabric.UpgradeModeManual), - // VMImage: to.Ptr("Windows"), - // }, - // }, - // { - // Name: to.Ptr("myCluster2"), - // Type: to.Ptr("Microsoft.ServiceFabric/clusters"), - // Etag: to.Ptr("W/\"636462502164040075\""), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/resRg/providers/Microsoft.ServiceFabric/clusters/myCluster2"), - // Location: to.Ptr("eastus"), - // Tags: map[string]*string{ - // }, - // Properties: &armservicefabric.ClusterProperties{ - // AddOnFeatures: []*armservicefabric.AddOnFeatures{ - // to.Ptr(armservicefabric.AddOnFeaturesRepairManager)}, - // AvailableClusterVersions: []*armservicefabric.ClusterVersionDetails{ - // { - // CodeVersion: to.Ptr("6.1.187.1"), - // Environment: to.Ptr(armservicefabric.ClusterEnvironmentLinux), - // SupportExpiryUTC: to.Ptr("2018-06-15T23:59:59.9999999"), - // }}, - // ClientCertificateCommonNames: []*armservicefabric.ClientCertificateCommonName{ - // }, - // ClientCertificateThumbprints: []*armservicefabric.ClientCertificateThumbprint{ - // }, - // ClusterCodeVersion: to.Ptr("6.1.187.1"), - // ClusterEndpoint: to.Ptr("https://eastus.servicefabric.azure.com"), - // ClusterID: to.Ptr("2747e469-b24e-4039-8a0a-46151419523f"), - // ClusterState: to.Ptr(armservicefabric.ClusterStateWaitingForNodes), - // DiagnosticsStorageAccountConfig: &armservicefabric.DiagnosticsStorageAccountConfig{ - // BlobEndpoint: to.Ptr("https://diag.blob.core.windows.net/"), - // ProtectedAccountKeyName: to.Ptr("StorageAccountKey1"), - // QueueEndpoint: to.Ptr("https://diag.queue.core.windows.net/"), - // StorageAccountName: to.Ptr("diag"), - // TableEndpoint: to.Ptr("https://diag.table.core.windows.net/"), - // }, - // FabricSettings: []*armservicefabric.SettingsSectionDescription{ - // { - // Name: to.Ptr("UpgradeService"), - // Parameters: []*armservicefabric.SettingsParameterDescription{ - // { - // Name: to.Ptr("AppPollIntervalInSeconds"), - // Value: to.Ptr("60"), - // }}, - // }}, - // ManagementEndpoint: to.Ptr("http://myCluster2.eastus.cloudapp.azure.com:19080"), - // NodeTypes: []*armservicefabric.NodeTypeDescription{ - // { - // Name: to.Ptr("nt1vm"), - // ApplicationPorts: &armservicefabric.EndpointRangeDescription{ - // EndPort: to.Ptr[int32](30000), - // StartPort: to.Ptr[int32](20000), - // }, - // ClientConnectionEndpointPort: to.Ptr[int32](19000), - // DurabilityLevel: to.Ptr(armservicefabric.DurabilityLevelBronze), - // EphemeralPorts: &armservicefabric.EndpointRangeDescription{ - // EndPort: to.Ptr[int32](64000), - // StartPort: to.Ptr[int32](49000), - // }, - // HTTPGatewayEndpointPort: to.Ptr[int32](19007), - // IsPrimary: to.Ptr(true), - // VMInstanceCount: to.Ptr[int32](5), - // }}, - // ProvisioningState: to.Ptr(armservicefabric.ProvisioningStateSucceeded), - // ReliabilityLevel: to.Ptr(armservicefabric.ReliabilityLevelSilver), - // UpgradeDescription: &armservicefabric.ClusterUpgradePolicy{ - // DeltaHealthPolicy: &armservicefabric.ClusterUpgradeDeltaHealthPolicy{ - // MaxPercentDeltaUnhealthyApplications: to.Ptr[int32](0), - // MaxPercentDeltaUnhealthyNodes: to.Ptr[int32](0), - // MaxPercentUpgradeDomainDeltaUnhealthyNodes: to.Ptr[int32](0), - // }, - // ForceRestart: to.Ptr(false), - // HealthCheckRetryTimeout: to.Ptr("00:05:00"), - // HealthCheckStableDuration: to.Ptr("00:00:30"), - // HealthCheckWaitDuration: to.Ptr("00:00:30"), - // HealthPolicy: &armservicefabric.ClusterHealthPolicy{ - // MaxPercentUnhealthyApplications: to.Ptr[int32](0), - // MaxPercentUnhealthyNodes: to.Ptr[int32](0), - // }, - // UpgradeDomainTimeout: to.Ptr("00:15:00"), - // UpgradeReplicaSetCheckTimeout: to.Ptr("00:10:00"), - // UpgradeTimeout: to.Ptr("01:00:00"), - // }, - // UpgradeMode: to.Ptr(armservicefabric.UpgradeModeManual), - // VMImage: to.Ptr("Ubuntu"), - // }, - // }}, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d55b8005f05b040b852c15e74a0f3e36494a15e1/specification/servicefabric/resource-manager/Microsoft.ServiceFabric/stable/2021-06-01/examples/ClusterListOperation_example.json -func ExampleClustersClient_List() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armservicefabric.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewClustersClient().List(ctx, 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.ClusterListResult = armservicefabric.ClusterListResult{ - // Value: []*armservicefabric.Cluster{ - // { - // Name: to.Ptr("myCluster"), - // Type: to.Ptr("Microsoft.ServiceFabric/clusters"), - // Etag: to.Ptr("W/\"636462502169240745\""), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/resRg/providers/Microsoft.ServiceFabric/clusters/myCluster"), - // Location: to.Ptr("eastus"), - // Tags: map[string]*string{ - // }, - // Properties: &armservicefabric.ClusterProperties{ - // AddOnFeatures: []*armservicefabric.AddOnFeatures{ - // to.Ptr(armservicefabric.AddOnFeaturesRepairManager), - // to.Ptr(armservicefabric.AddOnFeaturesDNSService), - // to.Ptr(armservicefabric.AddOnFeaturesBackupRestoreService), - // to.Ptr(armservicefabric.AddOnFeaturesResourceMonitorService)}, - // AvailableClusterVersions: []*armservicefabric.ClusterVersionDetails{ - // { - // CodeVersion: to.Ptr("6.1.480.9494"), - // Environment: to.Ptr(armservicefabric.ClusterEnvironmentWindows), - // SupportExpiryUTC: to.Ptr("2018-06-15T23:59:59.9999999"), - // }}, - // AzureActiveDirectory: &armservicefabric.AzureActiveDirectory{ - // ClientApplication: to.Ptr("d151ad89-4bce-4ae8-b3d1-1dc79679fa75"), - // ClusterApplication: to.Ptr("5886372e-7bf4-4878-a497-8098aba608ae"), - // TenantID: to.Ptr("6abcc6a0-8666-43f1-87b8-172cf86a9f9c"), - // }, - // CertificateCommonNames: &armservicefabric.ServerCertificateCommonNames{ - // CommonNames: []*armservicefabric.ServerCertificateCommonName{ - // { - // CertificateCommonName: to.Ptr("abc.com"), - // CertificateIssuerThumbprint: to.Ptr("12599211F8F14C90AFA9532AD79A6F2CA1C00622"), - // }}, - // X509StoreName: to.Ptr(armservicefabric.StoreNameMy), - // }, - // ClientCertificateCommonNames: []*armservicefabric.ClientCertificateCommonName{ - // { - // CertificateCommonName: to.Ptr("abc.com"), - // CertificateIssuerThumbprint: to.Ptr("5F3660C715EBBDA31DB1FFDCF508302348DE8E7A"), - // IsAdmin: to.Ptr(true), - // }}, - // ClientCertificateThumbprints: []*armservicefabric.ClientCertificateThumbprint{ - // { - // CertificateThumbprint: to.Ptr("5F3660C715EBBDA31DB1FFDCF508302348DE8E7A"), - // IsAdmin: to.Ptr(false), - // }}, - // ClusterCodeVersion: to.Ptr("6.1.480.9494"), - // ClusterEndpoint: to.Ptr("https://eastus.servicefabric.azure.com"), - // ClusterID: to.Ptr("92584666-9889-4ae8-8d02-91902923d37f"), - // ClusterState: to.Ptr(armservicefabric.ClusterStateWaitingForNodes), - // DiagnosticsStorageAccountConfig: &armservicefabric.DiagnosticsStorageAccountConfig{ - // BlobEndpoint: to.Ptr("https://diag.blob.core.windows.net/"), - // ProtectedAccountKeyName: to.Ptr("StorageAccountKey1"), - // QueueEndpoint: to.Ptr("https://diag.queue.core.windows.net/"), - // StorageAccountName: to.Ptr("diag"), - // TableEndpoint: to.Ptr("https://diag.table.core.windows.net/"), - // }, - // FabricSettings: []*armservicefabric.SettingsSectionDescription{ - // { - // Name: to.Ptr("UpgradeService"), - // Parameters: []*armservicefabric.SettingsParameterDescription{ - // { - // Name: to.Ptr("AppPollIntervalInSeconds"), - // Value: to.Ptr("60"), - // }}, - // }}, - // ManagementEndpoint: to.Ptr("https://myCluster.eastus.cloudapp.azure.com:19080"), - // NodeTypes: []*armservicefabric.NodeTypeDescription{ - // { - // Name: to.Ptr("nt1vm"), - // ApplicationPorts: &armservicefabric.EndpointRangeDescription{ - // EndPort: to.Ptr[int32](30000), - // StartPort: to.Ptr[int32](20000), - // }, - // ClientConnectionEndpointPort: to.Ptr[int32](19000), - // DurabilityLevel: to.Ptr(armservicefabric.DurabilityLevelBronze), - // EphemeralPorts: &armservicefabric.EndpointRangeDescription{ - // EndPort: to.Ptr[int32](64000), - // StartPort: to.Ptr[int32](49000), - // }, - // HTTPGatewayEndpointPort: to.Ptr[int32](19007), - // IsPrimary: to.Ptr(true), - // VMInstanceCount: to.Ptr[int32](5), - // }}, - // ProvisioningState: to.Ptr(armservicefabric.ProvisioningStateSucceeded), - // ReliabilityLevel: to.Ptr(armservicefabric.ReliabilityLevelSilver), - // ReverseProxyCertificateCommonNames: &armservicefabric.ServerCertificateCommonNames{ - // CommonNames: []*armservicefabric.ServerCertificateCommonName{ - // { - // CertificateCommonName: to.Ptr("abc.com"), - // CertificateIssuerThumbprint: to.Ptr("12599211F8F14C90AFA9532AD79A6F2CA1C00622"), - // }}, - // X509StoreName: to.Ptr(armservicefabric.StoreNameMy), - // }, - // UpgradeDescription: &armservicefabric.ClusterUpgradePolicy{ - // DeltaHealthPolicy: &armservicefabric.ClusterUpgradeDeltaHealthPolicy{ - // ApplicationDeltaHealthPolicies: map[string]*armservicefabric.ApplicationDeltaHealthPolicy{ - // "fabric:/myApp1": &armservicefabric.ApplicationDeltaHealthPolicy{ - // DefaultServiceTypeDeltaHealthPolicy: &armservicefabric.ServiceTypeDeltaHealthPolicy{ - // MaxPercentDeltaUnhealthyServices: to.Ptr[int32](0), - // }, - // ServiceTypeDeltaHealthPolicies: map[string]*armservicefabric.ServiceTypeDeltaHealthPolicy{ - // "myServiceType1": &armservicefabric.ServiceTypeDeltaHealthPolicy{ - // MaxPercentDeltaUnhealthyServices: to.Ptr[int32](0), - // }, - // }, - // }, - // }, - // MaxPercentDeltaUnhealthyApplications: to.Ptr[int32](0), - // MaxPercentDeltaUnhealthyNodes: to.Ptr[int32](0), - // MaxPercentUpgradeDomainDeltaUnhealthyNodes: to.Ptr[int32](0), - // }, - // ForceRestart: to.Ptr(false), - // HealthCheckRetryTimeout: to.Ptr("00:05:00"), - // HealthCheckStableDuration: to.Ptr("00:00:30"), - // HealthCheckWaitDuration: to.Ptr("00:00:30"), - // HealthPolicy: &armservicefabric.ClusterHealthPolicy{ - // ApplicationHealthPolicies: map[string]*armservicefabric.ApplicationHealthPolicy{ - // "fabric:/myApp1": &armservicefabric.ApplicationHealthPolicy{ - // DefaultServiceTypeHealthPolicy: &armservicefabric.ServiceTypeHealthPolicy{ - // MaxPercentUnhealthyServices: to.Ptr[int32](0), - // }, - // ServiceTypeHealthPolicies: map[string]*armservicefabric.ServiceTypeHealthPolicy{ - // "myServiceType1": &armservicefabric.ServiceTypeHealthPolicy{ - // MaxPercentUnhealthyServices: to.Ptr[int32](100), - // }, - // }, - // }, - // }, - // MaxPercentUnhealthyApplications: to.Ptr[int32](0), - // MaxPercentUnhealthyNodes: to.Ptr[int32](0), - // }, - // UpgradeDomainTimeout: to.Ptr("00:15:00"), - // UpgradeReplicaSetCheckTimeout: to.Ptr("00:10:00"), - // UpgradeTimeout: to.Ptr("01:00:00"), - // }, - // UpgradeMode: to.Ptr(armservicefabric.UpgradeModeManual), - // VMImage: to.Ptr("Windows"), - // }, - // }, - // { - // Name: to.Ptr("myCluster2"), - // Type: to.Ptr("Microsoft.ServiceFabric/clusters"), - // Etag: to.Ptr("W/\"636462502164040075\""), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/resRg/providers/Microsoft.ServiceFabric/clusters/myCluster2"), - // Location: to.Ptr("eastus"), - // Tags: map[string]*string{ - // }, - // Properties: &armservicefabric.ClusterProperties{ - // AddOnFeatures: []*armservicefabric.AddOnFeatures{ - // to.Ptr(armservicefabric.AddOnFeaturesRepairManager)}, - // AvailableClusterVersions: []*armservicefabric.ClusterVersionDetails{ - // { - // CodeVersion: to.Ptr("6.1.187.1"), - // Environment: to.Ptr(armservicefabric.ClusterEnvironmentLinux), - // SupportExpiryUTC: to.Ptr("2018-06-15T23:59:59.9999999"), - // }}, - // ClientCertificateCommonNames: []*armservicefabric.ClientCertificateCommonName{ - // }, - // ClientCertificateThumbprints: []*armservicefabric.ClientCertificateThumbprint{ - // }, - // ClusterCodeVersion: to.Ptr("6.1.187.1"), - // ClusterEndpoint: to.Ptr("https://eastus.servicefabric.azure.com"), - // ClusterID: to.Ptr("2747e469-b24e-4039-8a0a-46151419523f"), - // ClusterState: to.Ptr(armservicefabric.ClusterStateWaitingForNodes), - // DiagnosticsStorageAccountConfig: &armservicefabric.DiagnosticsStorageAccountConfig{ - // BlobEndpoint: to.Ptr("https://diag.blob.core.windows.net/"), - // ProtectedAccountKeyName: to.Ptr("StorageAccountKey1"), - // QueueEndpoint: to.Ptr("https://diag.queue.core.windows.net/"), - // StorageAccountName: to.Ptr("diag"), - // TableEndpoint: to.Ptr("https://diag.table.core.windows.net/"), - // }, - // FabricSettings: []*armservicefabric.SettingsSectionDescription{ - // { - // Name: to.Ptr("UpgradeService"), - // Parameters: []*armservicefabric.SettingsParameterDescription{ - // { - // Name: to.Ptr("AppPollIntervalInSeconds"), - // Value: to.Ptr("60"), - // }}, - // }}, - // ManagementEndpoint: to.Ptr("http://myCluster2.eastus.cloudapp.azure.com:19080"), - // NodeTypes: []*armservicefabric.NodeTypeDescription{ - // { - // Name: to.Ptr("nt1vm"), - // ApplicationPorts: &armservicefabric.EndpointRangeDescription{ - // EndPort: to.Ptr[int32](30000), - // StartPort: to.Ptr[int32](20000), - // }, - // ClientConnectionEndpointPort: to.Ptr[int32](19000), - // DurabilityLevel: to.Ptr(armservicefabric.DurabilityLevelBronze), - // EphemeralPorts: &armservicefabric.EndpointRangeDescription{ - // EndPort: to.Ptr[int32](64000), - // StartPort: to.Ptr[int32](49000), - // }, - // HTTPGatewayEndpointPort: to.Ptr[int32](19007), - // IsPrimary: to.Ptr(true), - // VMInstanceCount: to.Ptr[int32](5), - // }}, - // ProvisioningState: to.Ptr(armservicefabric.ProvisioningStateSucceeded), - // ReliabilityLevel: to.Ptr(armservicefabric.ReliabilityLevelSilver), - // UpgradeDescription: &armservicefabric.ClusterUpgradePolicy{ - // DeltaHealthPolicy: &armservicefabric.ClusterUpgradeDeltaHealthPolicy{ - // MaxPercentDeltaUnhealthyApplications: to.Ptr[int32](0), - // MaxPercentDeltaUnhealthyNodes: to.Ptr[int32](0), - // MaxPercentUpgradeDomainDeltaUnhealthyNodes: to.Ptr[int32](0), - // }, - // ForceRestart: to.Ptr(false), - // HealthCheckRetryTimeout: to.Ptr("00:05:00"), - // HealthCheckStableDuration: to.Ptr("00:00:30"), - // HealthCheckWaitDuration: to.Ptr("00:00:30"), - // HealthPolicy: &armservicefabric.ClusterHealthPolicy{ - // MaxPercentUnhealthyApplications: to.Ptr[int32](0), - // MaxPercentUnhealthyNodes: to.Ptr[int32](0), - // }, - // UpgradeDomainTimeout: to.Ptr("00:15:00"), - // UpgradeReplicaSetCheckTimeout: to.Ptr("00:10:00"), - // UpgradeTimeout: to.Ptr("01:00:00"), - // }, - // UpgradeMode: to.Ptr(armservicefabric.UpgradeModeManual), - // VMImage: to.Ptr("Ubuntu"), - // }, - // }}, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d55b8005f05b040b852c15e74a0f3e36494a15e1/specification/servicefabric/resource-manager/Microsoft.ServiceFabric/stable/2021-06-01/examples/ListUpgradableVersionsMinMax_example.json -func ExampleClustersClient_ListUpgradableVersions_getMinimumAndMaximumCodeVersions() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armservicefabric.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewClustersClient().ListUpgradableVersions(ctx, "resRg", "myCluster", &armservicefabric.ClustersClientListUpgradableVersionsOptions{VersionsDescription: 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.UpgradableVersionPathResult = armservicefabric.UpgradableVersionPathResult{ - // SupportedPath: []*string{ - // to.Ptr("7.0.0.0"), - // to.Ptr("7.2.0.0")}, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d55b8005f05b040b852c15e74a0f3e36494a15e1/specification/servicefabric/resource-manager/Microsoft.ServiceFabric/stable/2021-06-01/examples/ListUpgradableVersionsPath_example.json -func ExampleClustersClient_ListUpgradableVersions_getUpgradePath() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armservicefabric.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewClustersClient().ListUpgradableVersions(ctx, "resRg", "myCluster", &armservicefabric.ClustersClientListUpgradableVersionsOptions{VersionsDescription: &armservicefabric.UpgradableVersionsDescription{ - TargetVersion: to.Ptr("7.2.432.9590"), - }, - }) - 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.UpgradableVersionPathResult = armservicefabric.UpgradableVersionPathResult{ - // SupportedPath: []*string{ - // to.Ptr("6.4.664.9590"), - // to.Ptr("7.0.466.9590"), - // to.Ptr("7.0.470.9590"), - // to.Ptr("7.2.432.9590")}, - // } -} diff --git a/sdk/resourcemanager/servicefabric/armservicefabric/clusterversions_client.go b/sdk/resourcemanager/servicefabric/armservicefabric/clusterversions_client.go index 979d46623f85..4e087b3b9da8 100644 --- a/sdk/resourcemanager/servicefabric/armservicefabric/clusterversions_client.go +++ b/sdk/resourcemanager/servicefabric/armservicefabric/clusterversions_client.go @@ -3,9 +3,8 @@ // 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. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. package armservicefabric @@ -52,18 +51,21 @@ func NewClusterVersionsClient(subscriptionID string, credential azcore.TokenCred // - clusterVersion - The cluster code version. // - options - ClusterVersionsClientGetOptions contains the optional parameters for the ClusterVersionsClient.Get method. func (client *ClusterVersionsClient) Get(ctx context.Context, location string, clusterVersion string, options *ClusterVersionsClientGetOptions) (ClusterVersionsClientGetResponse, error) { + var err error req, err := client.getCreateRequest(ctx, location, clusterVersion, options) if err != nil { return ClusterVersionsClientGetResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return ClusterVersionsClientGetResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return ClusterVersionsClientGetResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return ClusterVersionsClientGetResponse{}, err } - return client.getHandleResponse(resp) + resp, err := client.getHandleResponse(httpResp) + return resp, err } // getCreateRequest creates the Get request. @@ -111,18 +113,21 @@ func (client *ClusterVersionsClient) getHandleResponse(resp *http.Response) (Clu // - options - ClusterVersionsClientGetByEnvironmentOptions contains the optional parameters for the ClusterVersionsClient.GetByEnvironment // method. func (client *ClusterVersionsClient) GetByEnvironment(ctx context.Context, location string, environment ClusterVersionsEnvironment, clusterVersion string, options *ClusterVersionsClientGetByEnvironmentOptions) (ClusterVersionsClientGetByEnvironmentResponse, error) { + var err error req, err := client.getByEnvironmentCreateRequest(ctx, location, environment, clusterVersion, options) if err != nil { return ClusterVersionsClientGetByEnvironmentResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return ClusterVersionsClientGetByEnvironmentResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return ClusterVersionsClientGetByEnvironmentResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return ClusterVersionsClientGetByEnvironmentResponse{}, err } - return client.getByEnvironmentHandleResponse(resp) + resp, err := client.getByEnvironmentHandleResponse(httpResp) + return resp, err } // getByEnvironmentCreateRequest creates the GetByEnvironment request. @@ -171,18 +176,21 @@ func (client *ClusterVersionsClient) getByEnvironmentHandleResponse(resp *http.R // - location - The location for the cluster code versions. This is different from cluster location. // - options - ClusterVersionsClientListOptions contains the optional parameters for the ClusterVersionsClient.List method. func (client *ClusterVersionsClient) List(ctx context.Context, location string, options *ClusterVersionsClientListOptions) (ClusterVersionsClientListResponse, error) { + var err error req, err := client.listCreateRequest(ctx, location, options) if err != nil { return ClusterVersionsClientListResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return ClusterVersionsClientListResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return ClusterVersionsClientListResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return ClusterVersionsClientListResponse{}, err } - return client.listHandleResponse(resp) + resp, err := client.listHandleResponse(httpResp) + return resp, err } // listCreateRequest creates the List request. @@ -225,18 +233,21 @@ func (client *ClusterVersionsClient) listHandleResponse(resp *http.Response) (Cl // - options - ClusterVersionsClientListByEnvironmentOptions contains the optional parameters for the ClusterVersionsClient.ListByEnvironment // method. func (client *ClusterVersionsClient) ListByEnvironment(ctx context.Context, location string, environment ClusterVersionsEnvironment, options *ClusterVersionsClientListByEnvironmentOptions) (ClusterVersionsClientListByEnvironmentResponse, error) { + var err error req, err := client.listByEnvironmentCreateRequest(ctx, location, environment, options) if err != nil { return ClusterVersionsClientListByEnvironmentResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return ClusterVersionsClientListByEnvironmentResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return ClusterVersionsClientListByEnvironmentResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return ClusterVersionsClientListByEnvironmentResponse{}, err } - return client.listByEnvironmentHandleResponse(resp) + resp, err := client.listByEnvironmentHandleResponse(httpResp) + return resp, err } // listByEnvironmentCreateRequest creates the ListByEnvironment request. diff --git a/sdk/resourcemanager/servicefabric/armservicefabric/clusterversions_client_example_test.go b/sdk/resourcemanager/servicefabric/armservicefabric/clusterversions_client_example_test.go deleted file mode 100644 index f89ed44d34f1..000000000000 --- a/sdk/resourcemanager/servicefabric/armservicefabric/clusterversions_client_example_test.go +++ /dev/null @@ -1,160 +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 armservicefabric_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/servicefabric/armservicefabric" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d55b8005f05b040b852c15e74a0f3e36494a15e1/specification/servicefabric/resource-manager/Microsoft.ServiceFabric/stable/2021-06-01/examples/ClusterVersionsGet_example.json -func ExampleClusterVersionsClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armservicefabric.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewClusterVersionsClient().Get(ctx, "eastus", "6.1.480.9494", 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.ClusterCodeVersionsListResult = armservicefabric.ClusterCodeVersionsListResult{ - // Value: []*armservicefabric.ClusterCodeVersionsResult{ - // { - // Name: to.Ptr("6.1.480.9494"), - // Type: to.Ptr("Microsoft.ServiceFabric/locations/environments/clusterVersions"), - // ID: to.Ptr("subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.ServiceFabric/locations/eastus/environments/Windows/clusterVersions/6.1.480.9494"), - // Properties: &armservicefabric.ClusterVersionDetails{ - // CodeVersion: to.Ptr("6.1.480.9494"), - // Environment: to.Ptr(armservicefabric.ClusterEnvironmentWindows), - // SupportExpiryUTC: to.Ptr("2018-06-15T23:59:59.9999999"), - // }, - // }}, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d55b8005f05b040b852c15e74a0f3e36494a15e1/specification/servicefabric/resource-manager/Microsoft.ServiceFabric/stable/2021-06-01/examples/ClusterVersionsGetByEnvironment_example.json -func ExampleClusterVersionsClient_GetByEnvironment() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armservicefabric.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewClusterVersionsClient().GetByEnvironment(ctx, "eastus", armservicefabric.ClusterVersionsEnvironmentWindows, "6.1.480.9494", 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.ClusterCodeVersionsListResult = armservicefabric.ClusterCodeVersionsListResult{ - // Value: []*armservicefabric.ClusterCodeVersionsResult{ - // { - // Name: to.Ptr("6.1.480.9494"), - // Type: to.Ptr("Microsoft.ServiceFabric/locations/environments/clusterVersions"), - // ID: to.Ptr("subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.ServiceFabric/locations/eastus/environments/Windows/clusterVersions/6.1.480.9494"), - // Properties: &armservicefabric.ClusterVersionDetails{ - // CodeVersion: to.Ptr("6.1.480.9494"), - // Environment: to.Ptr(armservicefabric.ClusterEnvironmentWindows), - // SupportExpiryUTC: to.Ptr("2018-06-15T23:59:59.9999999"), - // }, - // }}, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d55b8005f05b040b852c15e74a0f3e36494a15e1/specification/servicefabric/resource-manager/Microsoft.ServiceFabric/stable/2021-06-01/examples/ClusterVersionsList_example.json -func ExampleClusterVersionsClient_List() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armservicefabric.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewClusterVersionsClient().List(ctx, "eastus", 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.ClusterCodeVersionsListResult = armservicefabric.ClusterCodeVersionsListResult{ - // Value: []*armservicefabric.ClusterCodeVersionsResult{ - // { - // Name: to.Ptr("6.1.480.9494"), - // Type: to.Ptr("Microsoft.ServiceFabric/locations/environments/clusterVersions"), - // ID: to.Ptr("subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.ServiceFabric/locations/eastus/environments/Windows/clusterVersions/6.1.480.9494"), - // Properties: &armservicefabric.ClusterVersionDetails{ - // CodeVersion: to.Ptr("6.1.480.9494"), - // Environment: to.Ptr(armservicefabric.ClusterEnvironmentWindows), - // SupportExpiryUTC: to.Ptr("2018-06-15T23:59:59.9999999"), - // }, - // }, - // { - // Name: to.Ptr("6.1.187.1"), - // Type: to.Ptr("Microsoft.ServiceFabric/locations/environments/clusterVersions"), - // ID: to.Ptr("subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.ServiceFabric/locations/eastus/environments/Linux/clusterVersions/6.1.187.1"), - // Properties: &armservicefabric.ClusterVersionDetails{ - // CodeVersion: to.Ptr("6.1.187.1"), - // Environment: to.Ptr(armservicefabric.ClusterEnvironmentLinux), - // SupportExpiryUTC: to.Ptr("2018-06-15T23:59:59.9999999"), - // }, - // }}, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d55b8005f05b040b852c15e74a0f3e36494a15e1/specification/servicefabric/resource-manager/Microsoft.ServiceFabric/stable/2021-06-01/examples/ClusterVersionsListByEnvironment.json -func ExampleClusterVersionsClient_ListByEnvironment() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armservicefabric.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewClusterVersionsClient().ListByEnvironment(ctx, "eastus", armservicefabric.ClusterVersionsEnvironmentWindows, 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.ClusterCodeVersionsListResult = armservicefabric.ClusterCodeVersionsListResult{ - // Value: []*armservicefabric.ClusterCodeVersionsResult{ - // { - // Name: to.Ptr("6.1.480.9494"), - // Type: to.Ptr("Microsoft.ServiceFabric/locations/environments/clusterVersions"), - // ID: to.Ptr("subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.ServiceFabric/locations/eastus/environments/Windows/clusterVersions/6.1.480.9494"), - // Properties: &armservicefabric.ClusterVersionDetails{ - // CodeVersion: to.Ptr("6.1.480.9494"), - // Environment: to.Ptr(armservicefabric.ClusterEnvironmentWindows), - // SupportExpiryUTC: to.Ptr("2018-06-15T23:59:59.9999999"), - // }, - // }}, - // } -} diff --git a/sdk/resourcemanager/servicefabric/armservicefabric/constants.go b/sdk/resourcemanager/servicefabric/armservicefabric/constants.go index 0ada02b2d30c..6cabeadcba70 100644 --- a/sdk/resourcemanager/servicefabric/armservicefabric/constants.go +++ b/sdk/resourcemanager/servicefabric/armservicefabric/constants.go @@ -3,15 +3,14 @@ // 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. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. package armservicefabric const ( moduleName = "armservicefabric" - moduleVersion = "v1.1.0" + moduleVersion = "v2.0.0" ) // AddOnFeatures - Available cluster add-on features @@ -203,24 +202,24 @@ func PossibleDurabilityLevelValues() []DurabilityLevel { type ManagedIdentityType string const ( + // ManagedIdentityTypeNone - Indicates that no identity is associated with the resource. + ManagedIdentityTypeNone ManagedIdentityType = "None" // ManagedIdentityTypeSystemAssigned - Indicates that system assigned identity is associated with the resource. ManagedIdentityTypeSystemAssigned ManagedIdentityType = "SystemAssigned" - // ManagedIdentityTypeUserAssigned - Indicates that user assigned identity is associated with the resource. - ManagedIdentityTypeUserAssigned ManagedIdentityType = "UserAssigned" // ManagedIdentityTypeSystemAssignedUserAssigned - Indicates that both system assigned and user assigned identity are associated // with the resource. ManagedIdentityTypeSystemAssignedUserAssigned ManagedIdentityType = "SystemAssigned, UserAssigned" - // ManagedIdentityTypeNone - Indicates that no identity is associated with the resource. - ManagedIdentityTypeNone ManagedIdentityType = "None" + // ManagedIdentityTypeUserAssigned - Indicates that user assigned identity is associated with the resource. + ManagedIdentityTypeUserAssigned ManagedIdentityType = "UserAssigned" ) // PossibleManagedIdentityTypeValues returns the possible values for the ManagedIdentityType const type. func PossibleManagedIdentityTypeValues() []ManagedIdentityType { return []ManagedIdentityType{ + ManagedIdentityTypeNone, ManagedIdentityTypeSystemAssigned, - ManagedIdentityTypeUserAssigned, ManagedIdentityTypeSystemAssignedUserAssigned, - ManagedIdentityTypeNone, + ManagedIdentityTypeUserAssigned, } } diff --git a/sdk/resourcemanager/servicefabric/armservicefabric/go.mod b/sdk/resourcemanager/servicefabric/armservicefabric/go.mod index d0650c19479b..50cd98c68d66 100644 --- a/sdk/resourcemanager/servicefabric/armservicefabric/go.mod +++ b/sdk/resourcemanager/servicefabric/armservicefabric/go.mod @@ -1,16 +1,16 @@ -module github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/servicefabric/armservicefabric +module github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/servicefabric/armservicefabric/v2 go 1.18 require ( - github.com/Azure/azure-sdk-for-go/sdk/azcore v1.4.0 - github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.2.2 + github.com/Azure/azure-sdk-for-go/sdk/azcore v1.6.1 + github.com/Azure/azure-sdk-for-go/sdk/internal v1.3.0 github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/internal v1.1.2 github.com/stretchr/testify v1.7.0 ) require ( - github.com/Azure/azure-sdk-for-go/sdk/internal v1.2.0 // indirect + github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.2.2 // indirect github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/resources/armresources v1.0.0 // indirect github.com/AzureAD/microsoft-authentication-library-for-go v0.9.0 // indirect github.com/davecgh/go-spew v1.1.1 // indirect @@ -21,9 +21,9 @@ require ( github.com/pkg/browser v0.0.0-20210911075715-681adbf594b8 // indirect github.com/pmezard/go-difflib v1.0.0 // indirect golang.org/x/crypto v0.6.0 // indirect - golang.org/x/net v0.7.0 // indirect - golang.org/x/sys v0.5.0 // indirect - golang.org/x/text v0.7.0 // indirect + golang.org/x/net v0.8.0 // indirect + golang.org/x/sys v0.6.0 // indirect + golang.org/x/text v0.8.0 // indirect gopkg.in/yaml.v2 v2.4.0 // indirect gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b // indirect ) diff --git a/sdk/resourcemanager/servicefabric/armservicefabric/go.sum b/sdk/resourcemanager/servicefabric/armservicefabric/go.sum index 6e2c77825a2c..93fdfc2850cd 100644 --- a/sdk/resourcemanager/servicefabric/armservicefabric/go.sum +++ b/sdk/resourcemanager/servicefabric/armservicefabric/go.sum @@ -1,9 +1,9 @@ -github.com/Azure/azure-sdk-for-go/sdk/azcore v1.4.0 h1:rTnT/Jrcm+figWlYz4Ixzt0SJVR2cMC8lvZcimipiEY= -github.com/Azure/azure-sdk-for-go/sdk/azcore v1.4.0/go.mod h1:ON4tFdPTwRcgWEaVDrN3584Ef+b7GgSJaXxe5fW9t4M= +github.com/Azure/azure-sdk-for-go/sdk/azcore v1.6.1 h1:SEy2xmstIphdPwNBUi7uhvjyjhVKISfwjfOJmuy7kg4= +github.com/Azure/azure-sdk-for-go/sdk/azcore v1.6.1/go.mod h1:bjGvMhVMb+EEm3VRNQawDMUyMMjo+S5ewNjflkep/0Q= github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.2.2 h1:uqM+VoHjVH6zdlkLF2b6O0ZANcHoj3rO0PoQ3jglUJA= github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.2.2/go.mod h1:twTKAa1E6hLmSDjLhaCkbTMQKc7p/rNLU40rLxGEOCI= -github.com/Azure/azure-sdk-for-go/sdk/internal v1.2.0 h1:leh5DwKv6Ihwi+h60uHtn6UWAxBbZ0q8DwQVMzf61zw= -github.com/Azure/azure-sdk-for-go/sdk/internal v1.2.0/go.mod h1:eWRD7oawr1Mu1sLCawqVc0CUiF43ia3qQMxLscsKQ9w= +github.com/Azure/azure-sdk-for-go/sdk/internal v1.3.0 h1:sXr+ck84g/ZlZUOZiNELInmMgOsuGwdjjVkEIde0OtY= +github.com/Azure/azure-sdk-for-go/sdk/internal v1.3.0/go.mod h1:okt5dMMTOFjX/aovMlrjvvXoPMBVSPzk9185BT0+eZM= github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/internal v1.1.2 h1:mLY+pNLjCUeKhgnAJWAKhEUQM+RJQo2H1fuGSw1Ky1E= github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/internal v1.1.2/go.mod h1:FbdwsQ2EzwvXxOPcMFYO8ogEc9uMMIj3YkmCdXdAFmk= github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/resources/armresources v1.0.0 h1:ECsQtyERDVz3NP3kvDOTLvbQhqWp/x9EsGKtb4ogUr8= @@ -31,13 +31,13 @@ github.com/stretchr/testify v1.7.0 h1:nwc3DEeHmmLAfoZucVR881uASk0Mfjw8xYJ99tb5Cc github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= golang.org/x/crypto v0.6.0 h1:qfktjS5LUO+fFKeJXZ+ikTRijMmljikvG68fpMMruSc= golang.org/x/crypto v0.6.0/go.mod h1:OFC/31mSvZgRz0V1QTNCzfAI1aIRzbiufJtkMIlEp58= -golang.org/x/net v0.7.0 h1:rJrUqqhjsgNp7KqAIc25s9pZnjU7TUcSY7HcVZjdn1g= -golang.org/x/net v0.7.0/go.mod h1:2Tu9+aMcznHK/AK1HMvgo6xiTLG5rD5rZLDS+rp2Bjs= +golang.org/x/net v0.8.0 h1:Zrh2ngAOFYneWTAIAPethzeaQLuHwhuBkuV6ZiRnUaQ= +golang.org/x/net v0.8.0/go.mod h1:QVkue5JL9kW//ek3r6jTKnTFis1tRmNAW2P1shuFdJc= golang.org/x/sys v0.0.0-20210616045830-e2b7044e8c71/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.5.0 h1:MUK/U/4lj1t1oPg0HfuXDN/Z1wv31ZJ/YcPiGccS4DU= -golang.org/x/sys v0.5.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/text v0.7.0 h1:4BRB4x83lYWy72KwLD/qYDuTu7q9PjSagHvijDw7cLo= -golang.org/x/text v0.7.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= +golang.org/x/sys v0.6.0 h1:MVltZSvRTcU2ljQOhs94SXPftV6DCNnZViHeQps87pQ= +golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/text v0.8.0 h1:57P1ETyNKtuIjB4SRd15iJxuhj8Gc416Y78H3qgMh68= +golang.org/x/text v0.8.0/go.mod h1:e1OnstbJyHTd6l/uOt8jFFHp6TRDWZR/bV3emEE/zU8= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 h1:yhCVgyC4o1eVCa2tZl7eS0r+SDo693bJlVdllGtEeKM= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/yaml.v2 v2.2.1/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= diff --git a/sdk/resourcemanager/servicefabric/armservicefabric/interfaces.go b/sdk/resourcemanager/servicefabric/armservicefabric/interfaces.go new file mode 100644 index 000000000000..8d406fbbaae4 --- /dev/null +++ b/sdk/resourcemanager/servicefabric/armservicefabric/interfaces.go @@ -0,0 +1,45 @@ +//go:build go1.18 +// +build go1.18 + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +package armservicefabric + +// PartitionSchemeDescriptionClassification provides polymorphic access to related types. +// Call the interface's GetPartitionSchemeDescription() method to access the common type. +// Use a type switch to determine the concrete type. The possible types are: +// - *NamedPartitionSchemeDescription, *PartitionSchemeDescription, *SingletonPartitionSchemeDescription, *UniformInt64RangePartitionSchemeDescription +type PartitionSchemeDescriptionClassification interface { + // GetPartitionSchemeDescription returns the PartitionSchemeDescription content of the underlying type. + GetPartitionSchemeDescription() *PartitionSchemeDescription +} + +// ServicePlacementPolicyDescriptionClassification provides polymorphic access to related types. +// Call the interface's GetServicePlacementPolicyDescription() method to access the common type. +// Use a type switch to determine the concrete type. The possible types are: +// - *ServicePlacementPolicyDescription +type ServicePlacementPolicyDescriptionClassification interface { + // GetServicePlacementPolicyDescription returns the ServicePlacementPolicyDescription content of the underlying type. + GetServicePlacementPolicyDescription() *ServicePlacementPolicyDescription +} + +// ServiceResourcePropertiesClassification provides polymorphic access to related types. +// Call the interface's GetServiceResourceProperties() method to access the common type. +// Use a type switch to determine the concrete type. The possible types are: +// - *ServiceResourceProperties, *StatefulServiceProperties, *StatelessServiceProperties +type ServiceResourcePropertiesClassification interface { + // GetServiceResourceProperties returns the ServiceResourceProperties content of the underlying type. + GetServiceResourceProperties() *ServiceResourceProperties +} + +// ServiceResourceUpdatePropertiesClassification provides polymorphic access to related types. +// Call the interface's GetServiceResourceUpdateProperties() method to access the common type. +// Use a type switch to determine the concrete type. The possible types are: +// - *ServiceResourceUpdateProperties, *StatefulServiceUpdateProperties, *StatelessServiceUpdateProperties +type ServiceResourceUpdatePropertiesClassification interface { + // GetServiceResourceUpdateProperties returns the ServiceResourceUpdateProperties content of the underlying type. + GetServiceResourceUpdateProperties() *ServiceResourceUpdateProperties +} diff --git a/sdk/resourcemanager/servicefabric/armservicefabric/models.go b/sdk/resourcemanager/servicefabric/armservicefabric/models.go index 053576d93db5..52c342cd2f8d 100644 --- a/sdk/resourcemanager/servicefabric/armservicefabric/models.go +++ b/sdk/resourcemanager/servicefabric/armservicefabric/models.go @@ -3,9 +3,8 @@ // 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. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. package armservicefabric @@ -15,20 +14,20 @@ import "time" // child entities when upgrading the cluster. type ApplicationDeltaHealthPolicy struct { // The delta health policy used by default to evaluate the health of a service type when upgrading the cluster. - DefaultServiceTypeDeltaHealthPolicy *ServiceTypeDeltaHealthPolicy `json:"defaultServiceTypeDeltaHealthPolicy,omitempty"` + DefaultServiceTypeDeltaHealthPolicy *ServiceTypeDeltaHealthPolicy // The map with service type delta health policy per service type name. The map is empty by default. - ServiceTypeDeltaHealthPolicies map[string]*ServiceTypeDeltaHealthPolicy `json:"serviceTypeDeltaHealthPolicies,omitempty"` + ServiceTypeDeltaHealthPolicies map[string]*ServiceTypeDeltaHealthPolicy } // ApplicationHealthPolicy - Defines a health policy used to evaluate the health of an application or one of its children // entities. type ApplicationHealthPolicy struct { // The health policy used by default to evaluate the health of a service type. - DefaultServiceTypeHealthPolicy *ServiceTypeHealthPolicy `json:"defaultServiceTypeHealthPolicy,omitempty"` + DefaultServiceTypeHealthPolicy *ServiceTypeHealthPolicy // The map with service type health policy per service type name. The map is empty by default. - ServiceTypeHealthPolicies map[string]*ServiceTypeHealthPolicy `json:"serviceTypeHealthPolicies,omitempty"` + ServiceTypeHealthPolicies map[string]*ServiceTypeHealthPolicy } // ApplicationMetricDescription - Describes capacity information for a custom resource balancing metric. This can be used @@ -41,371 +40,296 @@ type ApplicationMetricDescription struct { // application with application capacity defined, the product of MaximumNodes and this value must always be smaller than or // equal to TotalApplicationCapacity. When updating existing application with // application capacity, the product of MaximumNodes and this value must always be smaller than or equal to TotalApplicationCapacity. - MaximumCapacity *int64 `json:"maximumCapacity,omitempty"` + MaximumCapacity *int64 // The name of the metric. - Name *string `json:"name,omitempty"` + Name *string // The node reservation capacity for Service Fabric application. This is the amount of load which is reserved on nodes which // have instances of this application. If MinimumNodes is specified, then the // product of these values will be the capacity reserved in the cluster for the application. If set to zero, no capacity is // reserved for this metric. When setting application capacity or when updating // application capacity; this value must be smaller than or equal to MaximumCapacity for each metric. - ReservationCapacity *int64 `json:"reservationCapacity,omitempty"` + ReservationCapacity *int64 // The total metric capacity for Service Fabric application. This is the total metric capacity for this application in the // cluster. Service Fabric will try to limit the sum of loads of services within // the application to this value. When creating a new application with application capacity defined, the product of MaximumNodes // and MaximumCapacity must always be smaller than or equal to this value. - TotalApplicationCapacity *int64 `json:"totalApplicationCapacity,omitempty"` + TotalApplicationCapacity *int64 } // ApplicationResource - The application resource. type ApplicationResource struct { // Describes the managed identities for an Azure resource. - Identity *ManagedIdentity `json:"identity,omitempty"` + Identity *ManagedIdentity // It will be deprecated in New API, resource location depends on the parent resource. - Location *string `json:"location,omitempty"` + Location *string // The application resource properties. - Properties *ApplicationResourceProperties `json:"properties,omitempty"` + Properties *ApplicationResourceProperties // Azure resource tags. - Tags map[string]*string `json:"tags,omitempty"` + Tags map[string]*string // READ-ONLY; Azure resource etag. - Etag *string `json:"etag,omitempty" azure:"ro"` + Etag *string // READ-ONLY; Azure resource identifier. - ID *string `json:"id,omitempty" azure:"ro"` + ID *string // READ-ONLY; Azure resource name. - Name *string `json:"name,omitempty" azure:"ro"` + Name *string // READ-ONLY; Metadata pertaining to creation and last modification of the resource. - SystemData *SystemData `json:"systemData,omitempty" azure:"ro"` + SystemData *SystemData // READ-ONLY; Azure resource type. - Type *string `json:"type,omitempty" azure:"ro"` + Type *string } // ApplicationResourceList - The list of application resources. type ApplicationResourceList struct { - Value []*ApplicationResource `json:"value,omitempty"` + Value []*ApplicationResource // READ-ONLY; URL to get the next set of application list results if there are any. - NextLink *string `json:"nextLink,omitempty" azure:"ro"` + NextLink *string } // ApplicationResourceProperties - The application resource properties. type ApplicationResourceProperties struct { // List of user assigned identities for the application, each mapped to a friendly name. - ManagedIdentities []*ApplicationUserAssignedIdentity `json:"managedIdentities,omitempty"` + ManagedIdentities []*ApplicationUserAssignedIdentity // The maximum number of nodes where Service Fabric will reserve capacity for this application. Note that this does not mean // that the services of this application will be placed on all of those nodes. By // default, the value of this property is zero and it means that the services can be placed on any node. - MaximumNodes *int64 `json:"maximumNodes,omitempty"` + MaximumNodes *int64 // List of application capacity metric description. - Metrics []*ApplicationMetricDescription `json:"metrics,omitempty"` + Metrics []*ApplicationMetricDescription // The minimum number of nodes where Service Fabric will reserve capacity for this application. Note that this does not mean // that the services of this application will be placed on all of those nodes. If // this property is set to zero, no capacity will be reserved. The value of this property cannot be more than the value of // the MaximumNodes property. - MinimumNodes *int64 `json:"minimumNodes,omitempty"` + MinimumNodes *int64 // List of application parameters with overridden values from their default values specified in the application manifest. - Parameters map[string]*string `json:"parameters,omitempty"` + Parameters map[string]*string // Remove the current application capacity settings. - RemoveApplicationCapacity *bool `json:"removeApplicationCapacity,omitempty"` + RemoveApplicationCapacity *bool // The application type name as defined in the application manifest. - TypeName *string `json:"typeName,omitempty"` + TypeName *string // The version of the application type as defined in the application manifest. - TypeVersion *string `json:"typeVersion,omitempty"` + TypeVersion *string // Describes the policy for a monitored application upgrade. - UpgradePolicy *ApplicationUpgradePolicy `json:"upgradePolicy,omitempty"` + UpgradePolicy *ApplicationUpgradePolicy // READ-ONLY; The current deployment or provisioning state, which only appears in the response - ProvisioningState *string `json:"provisioningState,omitempty" azure:"ro"` + ProvisioningState *string } // ApplicationResourceUpdate - The application resource for patch operations. type ApplicationResourceUpdate struct { // It will be deprecated in New API, resource location depends on the parent resource. - Location *string `json:"location,omitempty"` + Location *string // The application resource properties for patch operations. - Properties *ApplicationResourceUpdateProperties `json:"properties,omitempty"` + Properties *ApplicationResourceUpdateProperties // Azure resource tags. - Tags map[string]*string `json:"tags,omitempty"` + Tags map[string]*string // READ-ONLY; Azure resource etag. - Etag *string `json:"etag,omitempty" azure:"ro"` + Etag *string // READ-ONLY; Azure resource identifier. - ID *string `json:"id,omitempty" azure:"ro"` + ID *string // READ-ONLY; Azure resource name. - Name *string `json:"name,omitempty" azure:"ro"` + Name *string // READ-ONLY; Metadata pertaining to creation and last modification of the resource. - SystemData *SystemData `json:"systemData,omitempty" azure:"ro"` + SystemData *SystemData // READ-ONLY; Azure resource type. - Type *string `json:"type,omitempty" azure:"ro"` + Type *string } // ApplicationResourceUpdateProperties - The application resource properties for patch operations. type ApplicationResourceUpdateProperties struct { // List of user assigned identities for the application, each mapped to a friendly name. - ManagedIdentities []*ApplicationUserAssignedIdentity `json:"managedIdentities,omitempty"` + ManagedIdentities []*ApplicationUserAssignedIdentity // The maximum number of nodes where Service Fabric will reserve capacity for this application. Note that this does not mean // that the services of this application will be placed on all of those nodes. By // default, the value of this property is zero and it means that the services can be placed on any node. - MaximumNodes *int64 `json:"maximumNodes,omitempty"` + MaximumNodes *int64 // List of application capacity metric description. - Metrics []*ApplicationMetricDescription `json:"metrics,omitempty"` + Metrics []*ApplicationMetricDescription // The minimum number of nodes where Service Fabric will reserve capacity for this application. Note that this does not mean // that the services of this application will be placed on all of those nodes. If // this property is set to zero, no capacity will be reserved. The value of this property cannot be more than the value of // the MaximumNodes property. - MinimumNodes *int64 `json:"minimumNodes,omitempty"` + MinimumNodes *int64 // List of application parameters with overridden values from their default values specified in the application manifest. - Parameters map[string]*string `json:"parameters,omitempty"` + Parameters map[string]*string // Remove the current application capacity settings. - RemoveApplicationCapacity *bool `json:"removeApplicationCapacity,omitempty"` + RemoveApplicationCapacity *bool // The version of the application type as defined in the application manifest. - TypeVersion *string `json:"typeVersion,omitempty"` + TypeVersion *string // Describes the policy for a monitored application upgrade. - UpgradePolicy *ApplicationUpgradePolicy `json:"upgradePolicy,omitempty"` + UpgradePolicy *ApplicationUpgradePolicy } // ApplicationTypeResource - The application type name resource type ApplicationTypeResource struct { // It will be deprecated in New API, resource location depends on the parent resource. - Location *string `json:"location,omitempty"` + Location *string // The application type name properties - Properties *ApplicationTypeResourceProperties `json:"properties,omitempty"` + Properties *ApplicationTypeResourceProperties // Azure resource tags. - Tags map[string]*string `json:"tags,omitempty"` + Tags map[string]*string // READ-ONLY; Azure resource etag. - Etag *string `json:"etag,omitempty" azure:"ro"` + Etag *string // READ-ONLY; Azure resource identifier. - ID *string `json:"id,omitempty" azure:"ro"` + ID *string // READ-ONLY; Azure resource name. - Name *string `json:"name,omitempty" azure:"ro"` + Name *string // READ-ONLY; Metadata pertaining to creation and last modification of the resource. - SystemData *SystemData `json:"systemData,omitempty" azure:"ro"` + SystemData *SystemData // READ-ONLY; Azure resource type. - Type *string `json:"type,omitempty" azure:"ro"` + Type *string } // ApplicationTypeResourceList - The list of application type names. type ApplicationTypeResourceList struct { - Value []*ApplicationTypeResource `json:"value,omitempty"` + Value []*ApplicationTypeResource // READ-ONLY; URL to get the next set of application type list results if there are any. - NextLink *string `json:"nextLink,omitempty" azure:"ro"` + NextLink *string } // ApplicationTypeResourceProperties - The application type name properties type ApplicationTypeResourceProperties struct { // READ-ONLY; The current deployment or provisioning state, which only appears in the response. - ProvisioningState *string `json:"provisioningState,omitempty" azure:"ro"` + ProvisioningState *string } // ApplicationTypeVersionResource - An application type version resource for the specified application type name resource. type ApplicationTypeVersionResource struct { // It will be deprecated in New API, resource location depends on the parent resource. - Location *string `json:"location,omitempty"` + Location *string // The properties of the application type version resource. - Properties *ApplicationTypeVersionResourceProperties `json:"properties,omitempty"` + Properties *ApplicationTypeVersionResourceProperties // Azure resource tags. - Tags map[string]*string `json:"tags,omitempty"` + Tags map[string]*string // READ-ONLY; Azure resource etag. - Etag *string `json:"etag,omitempty" azure:"ro"` + Etag *string // READ-ONLY; Azure resource identifier. - ID *string `json:"id,omitempty" azure:"ro"` + ID *string // READ-ONLY; Azure resource name. - Name *string `json:"name,omitempty" azure:"ro"` + Name *string // READ-ONLY; Metadata pertaining to creation and last modification of the resource. - SystemData *SystemData `json:"systemData,omitempty" azure:"ro"` + SystemData *SystemData // READ-ONLY; Azure resource type. - Type *string `json:"type,omitempty" azure:"ro"` + Type *string } // ApplicationTypeVersionResourceList - The list of application type version resources for the specified application type // name resource. type ApplicationTypeVersionResourceList struct { - Value []*ApplicationTypeVersionResource `json:"value,omitempty"` + Value []*ApplicationTypeVersionResource // READ-ONLY; URL to get the next set of application type version list results if there are any. - NextLink *string `json:"nextLink,omitempty" azure:"ro"` + NextLink *string } // ApplicationTypeVersionResourceProperties - The properties of the application type version resource. type ApplicationTypeVersionResourceProperties struct { // REQUIRED; The URL to the application package - AppPackageURL *string `json:"appPackageUrl,omitempty"` + AppPackageURL *string // READ-ONLY; List of application type parameters that can be overridden when creating or updating the application. - DefaultParameterList map[string]*string `json:"defaultParameterList,omitempty" azure:"ro"` + DefaultParameterList map[string]*string // READ-ONLY; The current deployment or provisioning state, which only appears in the response - ProvisioningState *string `json:"provisioningState,omitempty" azure:"ro"` + ProvisioningState *string } type ApplicationTypeVersionsCleanupPolicy struct { // REQUIRED; Number of unused versions per application type to keep. - MaxUnusedVersionsToKeep *int64 `json:"maxUnusedVersionsToKeep,omitempty"` -} - -// ApplicationTypeVersionsClientBeginCreateOrUpdateOptions contains the optional parameters for the ApplicationTypeVersionsClient.BeginCreateOrUpdate -// method. -type ApplicationTypeVersionsClientBeginCreateOrUpdateOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// ApplicationTypeVersionsClientBeginDeleteOptions contains the optional parameters for the ApplicationTypeVersionsClient.BeginDelete -// method. -type ApplicationTypeVersionsClientBeginDeleteOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// ApplicationTypeVersionsClientGetOptions contains the optional parameters for the ApplicationTypeVersionsClient.Get method. -type ApplicationTypeVersionsClientGetOptions struct { - // placeholder for future optional parameters -} - -// ApplicationTypeVersionsClientListOptions contains the optional parameters for the ApplicationTypeVersionsClient.List method. -type ApplicationTypeVersionsClientListOptions struct { - // placeholder for future optional parameters -} - -// ApplicationTypesClientBeginDeleteOptions contains the optional parameters for the ApplicationTypesClient.BeginDelete method. -type ApplicationTypesClientBeginDeleteOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// ApplicationTypesClientCreateOrUpdateOptions contains the optional parameters for the ApplicationTypesClient.CreateOrUpdate -// method. -type ApplicationTypesClientCreateOrUpdateOptions struct { - // placeholder for future optional parameters -} - -// ApplicationTypesClientGetOptions contains the optional parameters for the ApplicationTypesClient.Get method. -type ApplicationTypesClientGetOptions struct { - // placeholder for future optional parameters -} - -// ApplicationTypesClientListOptions contains the optional parameters for the ApplicationTypesClient.List method. -type ApplicationTypesClientListOptions struct { - // placeholder for future optional parameters + MaxUnusedVersionsToKeep *int64 } // ApplicationUpgradePolicy - Describes the policy for a monitored application upgrade. type ApplicationUpgradePolicy struct { // Defines a health policy used to evaluate the health of an application or one of its children entities. - ApplicationHealthPolicy *ArmApplicationHealthPolicy `json:"applicationHealthPolicy,omitempty"` + ApplicationHealthPolicy *ArmApplicationHealthPolicy // If true, then processes are forcefully restarted during upgrade even when the code version has not changed (the upgrade // only changes configuration or data). - ForceRestart *bool `json:"forceRestart,omitempty"` + ForceRestart *bool // Determines whether the application should be recreated on update. If value=true, the rest of the upgrade policy parameters // are not allowed and it will result in availability loss. - RecreateApplication *bool `json:"recreateApplication,omitempty"` + RecreateApplication *bool // The policy used for monitoring the application upgrade - RollingUpgradeMonitoringPolicy *ArmRollingUpgradeMonitoringPolicy `json:"rollingUpgradeMonitoringPolicy,omitempty"` + RollingUpgradeMonitoringPolicy *ArmRollingUpgradeMonitoringPolicy // The mode used to monitor health during a rolling upgrade. The values are UnmonitoredAuto, UnmonitoredManual, and Monitored. - UpgradeMode *RollingUpgradeMode `json:"upgradeMode,omitempty"` + UpgradeMode *RollingUpgradeMode // The maximum amount of time to block processing of an upgrade domain and prevent loss of availability when there are unexpected // issues. When this timeout expires, processing of the upgrade domain will // proceed regardless of availability loss issues. The timeout is reset at the start of each upgrade domain. Valid values // are between 0 and 42949672925 inclusive. (unsigned 32-bit integer). - UpgradeReplicaSetCheckTimeout *string `json:"upgradeReplicaSetCheckTimeout,omitempty"` + UpgradeReplicaSetCheckTimeout *string } type ApplicationUserAssignedIdentity struct { // REQUIRED; The friendly name of user assigned identity. - Name *string `json:"name,omitempty"` + Name *string // REQUIRED; The principal id of user assigned identity. - PrincipalID *string `json:"principalId,omitempty"` -} - -// ApplicationsClientBeginCreateOrUpdateOptions contains the optional parameters for the ApplicationsClient.BeginCreateOrUpdate -// method. -type ApplicationsClientBeginCreateOrUpdateOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// ApplicationsClientBeginDeleteOptions contains the optional parameters for the ApplicationsClient.BeginDelete method. -type ApplicationsClientBeginDeleteOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// ApplicationsClientBeginUpdateOptions contains the optional parameters for the ApplicationsClient.BeginUpdate method. -type ApplicationsClientBeginUpdateOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// ApplicationsClientGetOptions contains the optional parameters for the ApplicationsClient.Get method. -type ApplicationsClientGetOptions struct { - // placeholder for future optional parameters -} - -// ApplicationsClientListOptions contains the optional parameters for the ApplicationsClient.List method. -type ApplicationsClientListOptions struct { - // placeholder for future optional parameters + PrincipalID *string } // ArmApplicationHealthPolicy - Defines a health policy used to evaluate the health of an application or one of its children // entities. type ArmApplicationHealthPolicy struct { // Indicates whether warnings are treated with the same severity as errors. - ConsiderWarningAsError *bool `json:"considerWarningAsError,omitempty"` + ConsiderWarningAsError *bool // The health policy used by default to evaluate the health of a service type. - DefaultServiceTypeHealthPolicy *ArmServiceTypeHealthPolicy `json:"defaultServiceTypeHealthPolicy,omitempty"` + DefaultServiceTypeHealthPolicy *ArmServiceTypeHealthPolicy // The maximum allowed percentage of unhealthy deployed applications. Allowed values are Byte values from zero to 100. The // percentage represents the maximum tolerated percentage of deployed applications @@ -413,171 +337,171 @@ type ArmApplicationHealthPolicy struct { // deployed applications over the number of nodes where the application is // currently deployed on in the cluster. The computation rounds up to tolerate one failure on small numbers of nodes. Default // percentage is zero. - MaxPercentUnhealthyDeployedApplications *int32 `json:"maxPercentUnhealthyDeployedApplications,omitempty"` + MaxPercentUnhealthyDeployedApplications *int32 // The map with service type health policy per service type name. The map is empty by default. - ServiceTypeHealthPolicyMap map[string]*ArmServiceTypeHealthPolicy `json:"serviceTypeHealthPolicyMap,omitempty"` + ServiceTypeHealthPolicyMap map[string]*ArmServiceTypeHealthPolicy } // ArmRollingUpgradeMonitoringPolicy - The policy used for monitoring the application upgrade type ArmRollingUpgradeMonitoringPolicy struct { // The activation Mode of the service package - FailureAction *ArmUpgradeFailureAction `json:"failureAction,omitempty"` + FailureAction *ArmUpgradeFailureAction // The amount of time to retry health evaluation when the application or cluster is unhealthy before FailureAction is executed. // It is first interpreted as a string representing an ISO 8601 duration. If // that fails, then it is interpreted as a number representing the total number of milliseconds. - HealthCheckRetryTimeout *string `json:"healthCheckRetryTimeout,omitempty"` + HealthCheckRetryTimeout *string // The amount of time that the application or cluster must remain healthy before the upgrade proceeds to the next upgrade // domain. It is first interpreted as a string representing an ISO 8601 duration. If // that fails, then it is interpreted as a number representing the total number of milliseconds. - HealthCheckStableDuration *string `json:"healthCheckStableDuration,omitempty"` + HealthCheckStableDuration *string // The amount of time to wait after completing an upgrade domain before applying health policies. It is first interpreted // as a string representing an ISO 8601 duration. If that fails, then it is // interpreted as a number representing the total number of milliseconds. - HealthCheckWaitDuration *string `json:"healthCheckWaitDuration,omitempty"` + HealthCheckWaitDuration *string // The amount of time each upgrade domain has to complete before FailureAction is executed. It is first interpreted as a string // representing an ISO 8601 duration. If that fails, then it is interpreted as // a number representing the total number of milliseconds. - UpgradeDomainTimeout *string `json:"upgradeDomainTimeout,omitempty"` + UpgradeDomainTimeout *string // The amount of time the overall upgrade has to complete before FailureAction is executed. It is first interpreted as a string // representing an ISO 8601 duration. If that fails, then it is interpreted as // a number representing the total number of milliseconds. - UpgradeTimeout *string `json:"upgradeTimeout,omitempty"` + UpgradeTimeout *string } // ArmServiceTypeHealthPolicy - Represents the health policy used to evaluate the health of services belonging to a service // type. type ArmServiceTypeHealthPolicy struct { // The maximum percentage of partitions per service allowed to be unhealthy before your application is considered in error. - MaxPercentUnhealthyPartitionsPerService *int32 `json:"maxPercentUnhealthyPartitionsPerService,omitempty"` + MaxPercentUnhealthyPartitionsPerService *int32 // The maximum percentage of replicas per partition allowed to be unhealthy before your application is considered in error. - MaxPercentUnhealthyReplicasPerPartition *int32 `json:"maxPercentUnhealthyReplicasPerPartition,omitempty"` + MaxPercentUnhealthyReplicasPerPartition *int32 // The maximum percentage of services allowed to be unhealthy before your application is considered in error. - MaxPercentUnhealthyServices *int32 `json:"maxPercentUnhealthyServices,omitempty"` + MaxPercentUnhealthyServices *int32 } // AvailableOperationDisplay - Operation supported by the Service Fabric resource provider type AvailableOperationDisplay struct { // Operation description - Description *string `json:"description,omitempty"` + Description *string // The operation that can be performed. - Operation *string `json:"operation,omitempty"` + Operation *string // The name of the provider. - Provider *string `json:"provider,omitempty"` + Provider *string // The resource on which the operation is performed - Resource *string `json:"resource,omitempty"` + Resource *string } // AzureActiveDirectory - The settings to enable AAD authentication on the cluster. type AzureActiveDirectory struct { // Azure active directory client application id. - ClientApplication *string `json:"clientApplication,omitempty"` + ClientApplication *string // Azure active directory cluster application id. - ClusterApplication *string `json:"clusterApplication,omitempty"` + ClusterApplication *string // Azure active directory tenant id. - TenantID *string `json:"tenantId,omitempty"` + TenantID *string } // CertificateDescription - Describes the certificate details. type CertificateDescription struct { // REQUIRED; Thumbprint of the primary certificate. - Thumbprint *string `json:"thumbprint,omitempty"` + Thumbprint *string // Thumbprint of the secondary certificate. - ThumbprintSecondary *string `json:"thumbprintSecondary,omitempty"` + ThumbprintSecondary *string // The local certificate store location. - X509StoreName *StoreName `json:"x509StoreName,omitempty"` + X509StoreName *StoreName } // ClientCertificateCommonName - Describes the client certificate details using common name. type ClientCertificateCommonName struct { // REQUIRED; The common name of the client certificate. - CertificateCommonName *string `json:"certificateCommonName,omitempty"` + CertificateCommonName *string // REQUIRED; The issuer thumbprint of the client certificate. - CertificateIssuerThumbprint *string `json:"certificateIssuerThumbprint,omitempty"` + CertificateIssuerThumbprint *string // REQUIRED; Indicates if the client certificate has admin access to the cluster. Non admin clients can perform only read // only operations on the cluster. - IsAdmin *bool `json:"isAdmin,omitempty"` + IsAdmin *bool } // ClientCertificateThumbprint - Describes the client certificate details using thumbprint. type ClientCertificateThumbprint struct { // REQUIRED; The thumbprint of the client certificate. - CertificateThumbprint *string `json:"certificateThumbprint,omitempty"` + CertificateThumbprint *string // REQUIRED; Indicates if the client certificate has admin access to the cluster. Non admin clients can perform only read // only operations on the cluster. - IsAdmin *bool `json:"isAdmin,omitempty"` + IsAdmin *bool } // Cluster - The cluster resource type Cluster struct { // REQUIRED; Azure resource location. - Location *string `json:"location,omitempty"` + Location *string // The cluster resource properties - Properties *ClusterProperties `json:"properties,omitempty"` + Properties *ClusterProperties // Azure resource tags. - Tags map[string]*string `json:"tags,omitempty"` + Tags map[string]*string // READ-ONLY; Azure resource etag. - Etag *string `json:"etag,omitempty" azure:"ro"` + Etag *string // READ-ONLY; Azure resource identifier. - ID *string `json:"id,omitempty" azure:"ro"` + ID *string // READ-ONLY; Azure resource name. - Name *string `json:"name,omitempty" azure:"ro"` + Name *string // READ-ONLY; Metadata pertaining to creation and last modification of the resource. - SystemData *SystemData `json:"systemData,omitempty" azure:"ro"` + SystemData *SystemData // READ-ONLY; Azure resource type. - Type *string `json:"type,omitempty" azure:"ro"` + Type *string } // ClusterCodeVersionsListResult - The list results of the Service Fabric runtime versions. type ClusterCodeVersionsListResult struct { // The URL to use for getting the next set of results. - NextLink *string `json:"nextLink,omitempty"` - Value []*ClusterCodeVersionsResult `json:"value,omitempty"` + NextLink *string + Value []*ClusterCodeVersionsResult } // ClusterCodeVersionsResult - The result of the Service Fabric runtime versions type ClusterCodeVersionsResult struct { // The identification of the result - ID *string `json:"id,omitempty"` + ID *string // The name of the result - Name *string `json:"name,omitempty"` + Name *string // The detail of the Service Fabric runtime version result - Properties *ClusterVersionDetails `json:"properties,omitempty"` + Properties *ClusterVersionDetails // The result resource type - Type *string `json:"type,omitempty"` + Type *string } // ClusterHealthPolicy - Defines a health policy used to evaluate the health of the cluster or of a cluster node. type ClusterHealthPolicy struct { // Defines the application health policy map used to evaluate the health of an application or one of its children entities. - ApplicationHealthPolicies map[string]*ApplicationHealthPolicy `json:"applicationHealthPolicies,omitempty"` + ApplicationHealthPolicies map[string]*ApplicationHealthPolicy // The maximum allowed percentage of unhealthy applications before reporting an error. For example, to allow 10% of applications // to be unhealthy, this value would be 10. @@ -588,7 +512,7 @@ type ClusterHealthPolicy struct { // applications of application types that are included in the ApplicationTypeHealthPolicyMap. The computation rounds up to // tolerate one failure on small numbers of applications. Default percentage is // zero. - MaxPercentUnhealthyApplications *int32 `json:"maxPercentUnhealthyApplications,omitempty"` + MaxPercentUnhealthyApplications *int32 // The maximum allowed percentage of unhealthy nodes before reporting an error. For example, to allow 10% of nodes to be unhealthy, // this value would be 10. @@ -599,66 +523,67 @@ type ClusterHealthPolicy struct { // one failure on small numbers of nodes. Default percentage is zero. // In large clusters, some nodes will always be down or out for repairs, so this percentage should be configured to tolerate // that. - MaxPercentUnhealthyNodes *int32 `json:"maxPercentUnhealthyNodes,omitempty"` + MaxPercentUnhealthyNodes *int32 } // ClusterListResult - Cluster list results type ClusterListResult struct { // The URL to use for getting the next set of results. - NextLink *string `json:"nextLink,omitempty"` - Value []*Cluster `json:"value,omitempty"` + NextLink *string + Value []*Cluster } // ClusterProperties - Describes the cluster resource properties. type ClusterProperties struct { // REQUIRED; The http management endpoint of the cluster. - ManagementEndpoint *string `json:"managementEndpoint,omitempty"` + ManagementEndpoint *string // REQUIRED; The list of node types in the cluster. - NodeTypes []*NodeTypeDescription `json:"nodeTypes,omitempty"` + NodeTypes []*NodeTypeDescription // The list of add-on features to enable in the cluster. - AddOnFeatures []*AddOnFeatures `json:"addOnFeatures,omitempty"` + AddOnFeatures []*AddOnFeatures // The policy used to clean up unused versions. - ApplicationTypeVersionsCleanupPolicy *ApplicationTypeVersionsCleanupPolicy `json:"applicationTypeVersionsCleanupPolicy,omitempty"` + ApplicationTypeVersionsCleanupPolicy *ApplicationTypeVersionsCleanupPolicy // The AAD authentication settings of the cluster. - AzureActiveDirectory *AzureActiveDirectory `json:"azureActiveDirectory,omitempty"` + AzureActiveDirectory *AzureActiveDirectory // The certificate to use for securing the cluster. The certificate provided will be used for node to node security within // the cluster, SSL certificate for cluster management endpoint and default admin // client. - Certificate *CertificateDescription `json:"certificate,omitempty"` + Certificate *CertificateDescription // Describes a list of server certificates referenced by common name that are used to secure the cluster. - CertificateCommonNames *ServerCertificateCommonNames `json:"certificateCommonNames,omitempty"` + CertificateCommonNames *ServerCertificateCommonNames // The list of client certificates referenced by common name that are allowed to manage the cluster. - ClientCertificateCommonNames []*ClientCertificateCommonName `json:"clientCertificateCommonNames,omitempty"` + ClientCertificateCommonNames []*ClientCertificateCommonName // The list of client certificates referenced by thumbprint that are allowed to manage the cluster. - ClientCertificateThumbprints []*ClientCertificateThumbprint `json:"clientCertificateThumbprints,omitempty"` + ClientCertificateThumbprints []*ClientCertificateThumbprint // The Service Fabric runtime version of the cluster. This property can only by set the user when upgradeMode is set to 'Manual'. // To get list of available Service Fabric versions for new clusters use - // ClusterVersion API [./ClusterVersion.md]. To get the list of available version for existing clusters use availableClusterVersions. - ClusterCodeVersion *string `json:"clusterCodeVersion,omitempty"` + // ClusterVersion API [https://learn.microsoft.com/rest/api/servicefabric/cluster-versions/list]. To get the list of available + // version for existing clusters use availableClusterVersions. + ClusterCodeVersion *string // The storage account information for storing Service Fabric diagnostic logs. - DiagnosticsStorageAccountConfig *DiagnosticsStorageAccountConfig `json:"diagnosticsStorageAccountConfig,omitempty"` + DiagnosticsStorageAccountConfig *DiagnosticsStorageAccountConfig // Indicates if the event store service is enabled. - EventStoreServiceEnabled *bool `json:"eventStoreServiceEnabled,omitempty"` + EventStoreServiceEnabled *bool // The list of custom fabric settings to configure the cluster. - FabricSettings []*SettingsSectionDescription `json:"fabricSettings,omitempty"` + FabricSettings []*SettingsSectionDescription // Indicates if infrastructure service manager is enabled. - InfrastructureServiceManager *bool `json:"infrastructureServiceManager,omitempty"` + InfrastructureServiceManager *bool // Indicates a list of notification channels for cluster events. - Notifications []*Notification `json:"notifications,omitempty"` + Notifications []*Notification // The reliability level sets the replica set size of system services. Learn about ReliabilityLevel [https://docs.microsoft.com/azure/service-fabric/service-fabric-cluster-capacity]. // * None - Run the System services with a target replica set count of 1. This should only be used for test clusters. @@ -666,54 +591,54 @@ type ClusterProperties struct { // * Silver - Run the System services with a target replica set count of 5. // * Gold - Run the System services with a target replica set count of 7. // * Platinum - Run the System services with a target replica set count of 9. - ReliabilityLevel *ReliabilityLevel `json:"reliabilityLevel,omitempty"` + ReliabilityLevel *ReliabilityLevel // The server certificate used by reverse proxy. - ReverseProxyCertificate *CertificateDescription `json:"reverseProxyCertificate,omitempty"` + ReverseProxyCertificate *CertificateDescription // Describes a list of server certificates referenced by common name that are used to secure the cluster. - ReverseProxyCertificateCommonNames *ServerCertificateCommonNames `json:"reverseProxyCertificateCommonNames,omitempty"` + ReverseProxyCertificateCommonNames *ServerCertificateCommonNames // This property controls the logical grouping of VMs in upgrade domains (UDs). This property can't be modified if a node // type with multiple Availability Zones is already present in the cluster. - SfZonalUpgradeMode *SfZonalUpgradeMode `json:"sfZonalUpgradeMode,omitempty"` + SfZonalUpgradeMode *SfZonalUpgradeMode // The policy to use when upgrading the cluster. - UpgradeDescription *ClusterUpgradePolicy `json:"upgradeDescription,omitempty"` + UpgradeDescription *ClusterUpgradePolicy // The upgrade mode of the cluster when new Service Fabric runtime version is available. - UpgradeMode *UpgradeMode `json:"upgradeMode,omitempty"` + UpgradeMode *UpgradeMode // Indicates the end date and time to pause automatic runtime version upgrades on the cluster for an specific period of time // on the cluster (UTC). - UpgradePauseEndTimestampUTC *time.Time `json:"upgradePauseEndTimestampUtc,omitempty"` + UpgradePauseEndTimestampUTC *time.Time // Indicates the start date and time to pause automatic runtime version upgrades on the cluster for an specific period of // time on the cluster (UTC). - UpgradePauseStartTimestampUTC *time.Time `json:"upgradePauseStartTimestampUtc,omitempty"` + UpgradePauseStartTimestampUTC *time.Time // Indicates when new cluster runtime version upgrades will be applied after they are released. By default is Wave0. Only // applies when upgradeMode is set to 'Automatic'. - UpgradeWave *ClusterUpgradeCadence `json:"upgradeWave,omitempty"` + UpgradeWave *ClusterUpgradeCadence // The VM image VMSS has been configured with. Generic names such as Windows or Linux can be used. - VMImage *string `json:"vmImage,omitempty"` + VMImage *string // This property defines the upgrade mode for the virtual machine scale set, it is mandatory if a node type with multiple // Availability Zones is added. - VmssZonalUpgradeMode *VmssZonalUpgradeMode `json:"vmssZonalUpgradeMode,omitempty"` + VmssZonalUpgradeMode *VmssZonalUpgradeMode // Boolean to pause automatic runtime version upgrades to the cluster. - WaveUpgradePaused *bool `json:"waveUpgradePaused,omitempty"` + WaveUpgradePaused *bool // READ-ONLY; The Service Fabric runtime versions available for this cluster. - AvailableClusterVersions []*ClusterVersionDetails `json:"availableClusterVersions,omitempty" azure:"ro"` + AvailableClusterVersions []*ClusterVersionDetails // READ-ONLY; The Azure Resource Provider endpoint. A system service in the cluster connects to this endpoint. - ClusterEndpoint *string `json:"clusterEndpoint,omitempty" azure:"ro"` + ClusterEndpoint *string // READ-ONLY; A service generated unique identifier for the cluster resource. - ClusterID *string `json:"clusterId,omitempty" azure:"ro"` + ClusterID *string // READ-ONLY; The current state of the cluster. // * WaitingForNodes - Indicates that the cluster resource is created and the resource provider is waiting for Service Fabric @@ -732,55 +657,56 @@ type ClusterProperties struct { // Clusters in this state cannot be managed by the Resource Provider. // * AutoScale - Indicates that the ReliabilityLevel of the cluster is being adjusted. // * Ready - Indicates that the cluster is in a stable state. - ClusterState *ClusterState `json:"clusterState,omitempty" azure:"ro"` + ClusterState *ClusterState // READ-ONLY; The provisioning state of the cluster resource. - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty" azure:"ro"` + ProvisioningState *ProvisioningState } // ClusterPropertiesUpdateParameters - Describes the cluster resource properties that can be updated during PATCH operation. type ClusterPropertiesUpdateParameters struct { // The list of add-on features to enable in the cluster. - AddOnFeatures []*AddOnFeatures `json:"addOnFeatures,omitempty"` + AddOnFeatures []*AddOnFeatures // The policy used to clean up unused versions. - ApplicationTypeVersionsCleanupPolicy *ApplicationTypeVersionsCleanupPolicy `json:"applicationTypeVersionsCleanupPolicy,omitempty"` + ApplicationTypeVersionsCleanupPolicy *ApplicationTypeVersionsCleanupPolicy // The certificate to use for securing the cluster. The certificate provided will be used for node to node security within // the cluster, SSL certificate for cluster management endpoint and default admin // client. - Certificate *CertificateDescription `json:"certificate,omitempty"` + Certificate *CertificateDescription // Describes a list of server certificates referenced by common name that are used to secure the cluster. - CertificateCommonNames *ServerCertificateCommonNames `json:"certificateCommonNames,omitempty"` + CertificateCommonNames *ServerCertificateCommonNames // The list of client certificates referenced by common name that are allowed to manage the cluster. This will overwrite the // existing list. - ClientCertificateCommonNames []*ClientCertificateCommonName `json:"clientCertificateCommonNames,omitempty"` + ClientCertificateCommonNames []*ClientCertificateCommonName // The list of client certificates referenced by thumbprint that are allowed to manage the cluster. This will overwrite the // existing list. - ClientCertificateThumbprints []*ClientCertificateThumbprint `json:"clientCertificateThumbprints,omitempty"` + ClientCertificateThumbprints []*ClientCertificateThumbprint // The Service Fabric runtime version of the cluster. This property can only by set the user when upgradeMode is set to 'Manual'. // To get list of available Service Fabric versions for new clusters use - // ClusterVersion API [./ClusterVersion.md]. To get the list of available version for existing clusters use availableClusterVersions. - ClusterCodeVersion *string `json:"clusterCodeVersion,omitempty"` + // ClusterVersion API [https://learn.microsoft.com/rest/api/servicefabric/cluster-versions/list]. To get the list of available + // version for existing clusters use availableClusterVersions. + ClusterCodeVersion *string // Indicates if the event store service is enabled. - EventStoreServiceEnabled *bool `json:"eventStoreServiceEnabled,omitempty"` + EventStoreServiceEnabled *bool // The list of custom fabric settings to configure the cluster. This will overwrite the existing list. - FabricSettings []*SettingsSectionDescription `json:"fabricSettings,omitempty"` + FabricSettings []*SettingsSectionDescription // Indicates if infrastructure service manager is enabled. - InfrastructureServiceManager *bool `json:"infrastructureServiceManager,omitempty"` + InfrastructureServiceManager *bool // The list of node types in the cluster. This will overwrite the existing list. - NodeTypes []*NodeTypeDescription `json:"nodeTypes,omitempty"` + NodeTypes []*NodeTypeDescription // Indicates a list of notification channels for cluster events. - Notifications []*Notification `json:"notifications,omitempty"` + Notifications []*Notification // The reliability level sets the replica set size of system services. Learn about ReliabilityLevel [https://docs.microsoft.com/azure/service-fabric/service-fabric-cluster-capacity]. // * None - Run the System services with a target replica set count of 1. This should only be used for test clusters. @@ -788,46 +714,46 @@ type ClusterPropertiesUpdateParameters struct { // * Silver - Run the System services with a target replica set count of 5. // * Gold - Run the System services with a target replica set count of 7. // * Platinum - Run the System services with a target replica set count of 9. - ReliabilityLevel *ReliabilityLevel `json:"reliabilityLevel,omitempty"` + ReliabilityLevel *ReliabilityLevel // The server certificate used by reverse proxy. - ReverseProxyCertificate *CertificateDescription `json:"reverseProxyCertificate,omitempty"` + ReverseProxyCertificate *CertificateDescription // This property controls the logical grouping of VMs in upgrade domains (UDs). This property can't be modified if a node // type with multiple Availability Zones is already present in the cluster. - SfZonalUpgradeMode *SfZonalUpgradeMode `json:"sfZonalUpgradeMode,omitempty"` + SfZonalUpgradeMode *SfZonalUpgradeMode // The policy to use when upgrading the cluster. - UpgradeDescription *ClusterUpgradePolicy `json:"upgradeDescription,omitempty"` + UpgradeDescription *ClusterUpgradePolicy // The upgrade mode of the cluster when new Service Fabric runtime version is available. - UpgradeMode *UpgradeMode `json:"upgradeMode,omitempty"` + UpgradeMode *UpgradeMode // The end timestamp of pause runtime version upgrades on the cluster (UTC). - UpgradePauseEndTimestampUTC *time.Time `json:"upgradePauseEndTimestampUtc,omitempty"` + UpgradePauseEndTimestampUTC *time.Time // The start timestamp to pause runtime version upgrades on the cluster (UTC). - UpgradePauseStartTimestampUTC *time.Time `json:"upgradePauseStartTimestampUtc,omitempty"` + UpgradePauseStartTimestampUTC *time.Time // Indicates when new cluster runtime version upgrades will be applied after they are released. By default is Wave0. Only // applies when upgradeMode is set to 'Automatic'. - UpgradeWave *ClusterUpgradeCadence `json:"upgradeWave,omitempty"` + UpgradeWave *ClusterUpgradeCadence // This property defines the upgrade mode for the virtual machine scale set, it is mandatory if a node type with multiple // Availability Zones is added. - VmssZonalUpgradeMode *VmssZonalUpgradeMode `json:"vmssZonalUpgradeMode,omitempty"` + VmssZonalUpgradeMode *VmssZonalUpgradeMode // Boolean to pause automatic runtime version upgrades to the cluster. - WaveUpgradePaused *bool `json:"waveUpgradePaused,omitempty"` + WaveUpgradePaused *bool } // ClusterUpdateParameters - Cluster update request type ClusterUpdateParameters struct { // Describes the cluster resource properties that can be updated during PATCH operation. - Properties *ClusterPropertiesUpdateParameters `json:"properties,omitempty"` + Properties *ClusterPropertiesUpdateParameters // Cluster update parameters - Tags map[string]*string `json:"tags,omitempty"` + Tags map[string]*string } // ClusterUpgradeDeltaHealthPolicy - Describes the delta health policies for the cluster upgrade. @@ -837,211 +763,150 @@ type ClusterUpgradeDeltaHealthPolicy struct { // of the applications at the time of the health evaluation. The check is performed after every upgrade domain upgrade completion // to make sure the global state of the cluster is within tolerated limits. // System services are not included in this. - MaxPercentDeltaUnhealthyApplications *int32 `json:"maxPercentDeltaUnhealthyApplications,omitempty"` + MaxPercentDeltaUnhealthyApplications *int32 // REQUIRED; The maximum allowed percentage of nodes health degradation allowed during cluster upgrades. The delta is measured // between the state of the nodes at the beginning of upgrade and the state of the nodes // at the time of the health evaluation. The check is performed after every upgrade domain upgrade completion to make sure // the global state of the cluster is within tolerated limits. - MaxPercentDeltaUnhealthyNodes *int32 `json:"maxPercentDeltaUnhealthyNodes,omitempty"` + MaxPercentDeltaUnhealthyNodes *int32 // REQUIRED; The maximum allowed percentage of upgrade domain nodes health degradation allowed during cluster upgrades. The // delta is measured between the state of the upgrade domain nodes at the beginning of // upgrade and the state of the upgrade domain nodes at the time of the health evaluation. The check is performed after every // upgrade domain upgrade completion for all completed upgrade domains to make // sure the state of the upgrade domains is within tolerated limits. - MaxPercentUpgradeDomainDeltaUnhealthyNodes *int32 `json:"maxPercentUpgradeDomainDeltaUnhealthyNodes,omitempty"` + MaxPercentUpgradeDomainDeltaUnhealthyNodes *int32 // Defines the application delta health policy map used to evaluate the health of an application or one of its child entities // when upgrading the cluster. - ApplicationDeltaHealthPolicies map[string]*ApplicationDeltaHealthPolicy `json:"applicationDeltaHealthPolicies,omitempty"` + ApplicationDeltaHealthPolicies map[string]*ApplicationDeltaHealthPolicy } // ClusterUpgradePolicy - Describes the policy used when upgrading the cluster. type ClusterUpgradePolicy struct { // REQUIRED; The amount of time to retry health evaluation when the application or cluster is unhealthy before the upgrade // rolls back. The timeout can be in either hh:mm:ss or in d.hh:mm:ss.ms format. - HealthCheckRetryTimeout *string `json:"healthCheckRetryTimeout,omitempty"` + HealthCheckRetryTimeout *string // REQUIRED; The amount of time that the application or cluster must remain healthy before the upgrade proceeds to the next // upgrade domain. The duration can be in either hh:mm:ss or in d.hh:mm:ss.ms format. - HealthCheckStableDuration *string `json:"healthCheckStableDuration,omitempty"` + HealthCheckStableDuration *string // REQUIRED; The length of time to wait after completing an upgrade domain before performing health checks. The duration can // be in either hh:mm:ss or in d.hh:mm:ss.ms format. - HealthCheckWaitDuration *string `json:"healthCheckWaitDuration,omitempty"` + HealthCheckWaitDuration *string // REQUIRED; The cluster health policy used when upgrading the cluster. - HealthPolicy *ClusterHealthPolicy `json:"healthPolicy,omitempty"` + HealthPolicy *ClusterHealthPolicy // REQUIRED; The amount of time each upgrade domain has to complete before the upgrade rolls back. The timeout can be in either // hh:mm:ss or in d.hh:mm:ss.ms format. - UpgradeDomainTimeout *string `json:"upgradeDomainTimeout,omitempty"` + UpgradeDomainTimeout *string // REQUIRED; The maximum amount of time to block processing of an upgrade domain and prevent loss of availability when there // are unexpected issues. When this timeout expires, processing of the upgrade domain will // proceed regardless of availability loss issues. The timeout is reset at the start of each upgrade domain. The timeout can // be in either hh:mm:ss or in d.hh:mm:ss.ms format. - UpgradeReplicaSetCheckTimeout *string `json:"upgradeReplicaSetCheckTimeout,omitempty"` + UpgradeReplicaSetCheckTimeout *string // REQUIRED; The amount of time the overall upgrade has to complete before the upgrade rolls back. The timeout can be in either // hh:mm:ss or in d.hh:mm:ss.ms format. - UpgradeTimeout *string `json:"upgradeTimeout,omitempty"` + UpgradeTimeout *string // The cluster delta health policy used when upgrading the cluster. - DeltaHealthPolicy *ClusterUpgradeDeltaHealthPolicy `json:"deltaHealthPolicy,omitempty"` + DeltaHealthPolicy *ClusterUpgradeDeltaHealthPolicy // If true, then processes are forcefully restarted during upgrade even when the code version has not changed (the upgrade // only changes configuration or data). - ForceRestart *bool `json:"forceRestart,omitempty"` + ForceRestart *bool } // ClusterVersionDetails - The detail of the Service Fabric runtime version result type ClusterVersionDetails struct { // The Service Fabric runtime version of the cluster. - CodeVersion *string `json:"codeVersion,omitempty"` + CodeVersion *string // Indicates if this version is for Windows or Linux operating system. - Environment *ClusterEnvironment `json:"environment,omitempty"` + Environment *ClusterEnvironment // The date of expiry of support of the version. - SupportExpiryUTC *string `json:"supportExpiryUtc,omitempty"` -} - -// ClusterVersionsClientGetByEnvironmentOptions contains the optional parameters for the ClusterVersionsClient.GetByEnvironment -// method. -type ClusterVersionsClientGetByEnvironmentOptions struct { - // placeholder for future optional parameters -} - -// ClusterVersionsClientGetOptions contains the optional parameters for the ClusterVersionsClient.Get method. -type ClusterVersionsClientGetOptions struct { - // placeholder for future optional parameters -} - -// ClusterVersionsClientListByEnvironmentOptions contains the optional parameters for the ClusterVersionsClient.ListByEnvironment -// method. -type ClusterVersionsClientListByEnvironmentOptions struct { - // placeholder for future optional parameters -} - -// ClusterVersionsClientListOptions contains the optional parameters for the ClusterVersionsClient.List method. -type ClusterVersionsClientListOptions struct { - // placeholder for future optional parameters -} - -// ClustersClientBeginCreateOrUpdateOptions contains the optional parameters for the ClustersClient.BeginCreateOrUpdate method. -type ClustersClientBeginCreateOrUpdateOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// ClustersClientBeginUpdateOptions contains the optional parameters for the ClustersClient.BeginUpdate method. -type ClustersClientBeginUpdateOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// ClustersClientDeleteOptions contains the optional parameters for the ClustersClient.Delete method. -type ClustersClientDeleteOptions struct { - // placeholder for future optional parameters -} - -// ClustersClientGetOptions contains the optional parameters for the ClustersClient.Get method. -type ClustersClientGetOptions struct { - // placeholder for future optional parameters -} - -// ClustersClientListByResourceGroupOptions contains the optional parameters for the ClustersClient.ListByResourceGroup method. -type ClustersClientListByResourceGroupOptions struct { - // placeholder for future optional parameters -} - -// ClustersClientListOptions contains the optional parameters for the ClustersClient.List method. -type ClustersClientListOptions struct { - // placeholder for future optional parameters -} - -// ClustersClientListUpgradableVersionsOptions contains the optional parameters for the ClustersClient.ListUpgradableVersions -// method. -type ClustersClientListUpgradableVersionsOptions struct { - // The upgrade path description with target version. - VersionsDescription *UpgradableVersionsDescription + SupportExpiryUTC *string } // DiagnosticsStorageAccountConfig - The storage account information for storing Service Fabric diagnostic logs. type DiagnosticsStorageAccountConfig struct { // REQUIRED; The blob endpoint of the azure storage account. - BlobEndpoint *string `json:"blobEndpoint,omitempty"` + BlobEndpoint *string // REQUIRED; The protected diagnostics storage key name. - ProtectedAccountKeyName *string `json:"protectedAccountKeyName,omitempty"` + ProtectedAccountKeyName *string // REQUIRED; The queue endpoint of the azure storage account. - QueueEndpoint *string `json:"queueEndpoint,omitempty"` + QueueEndpoint *string // REQUIRED; The Azure storage account name. - StorageAccountName *string `json:"storageAccountName,omitempty"` + StorageAccountName *string // REQUIRED; The table endpoint of the azure storage account. - TableEndpoint *string `json:"tableEndpoint,omitempty"` + TableEndpoint *string // The secondary protected diagnostics storage key name. If one of the storage account keys is rotated the cluster will fallback // to using the other. - ProtectedAccountKeyName2 *string `json:"protectedAccountKeyName2,omitempty"` + ProtectedAccountKeyName2 *string } // EndpointRangeDescription - Port range details type EndpointRangeDescription struct { // REQUIRED; End port of a range of ports - EndPort *int32 `json:"endPort,omitempty"` + EndPort *int32 // REQUIRED; Starting port of a range of ports - StartPort *int32 `json:"startPort,omitempty"` + StartPort *int32 } // ErrorModel - The structure of the error. type ErrorModel struct { // The error details. - Error *ErrorModelError `json:"error,omitempty"` + Error *ErrorModelError } // ErrorModelError - The error details. type ErrorModelError struct { // The error code. - Code *string `json:"code,omitempty"` + Code *string // The error message. - Message *string `json:"message,omitempty"` + Message *string } // ManagedIdentity - Describes the managed identities for an Azure resource. type ManagedIdentity struct { // The type of managed identity for the resource. - Type *ManagedIdentityType `json:"type,omitempty"` + Type *ManagedIdentityType // The list of user identities associated with the resource. The user identity dictionary key references will be ARM resource // ids in the form: // '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'. - UserAssignedIdentities map[string]*UserAssignedIdentity `json:"userAssignedIdentities,omitempty"` + UserAssignedIdentities map[string]*UserAssignedIdentity // READ-ONLY; The principal id of the managed identity. This property will only be provided for a system assigned identity. - PrincipalID *string `json:"principalId,omitempty" azure:"ro"` + PrincipalID *string // READ-ONLY; The tenant id of the managed identity. This property will only be provided for a system assigned identity. - TenantID *string `json:"tenantId,omitempty" azure:"ro"` + TenantID *string } // NamedPartitionSchemeDescription - Describes the named partition scheme of the service. type NamedPartitionSchemeDescription struct { // REQUIRED; The number of partitions. - Count *int32 `json:"count,omitempty"` + Count *int32 // REQUIRED; Array of size specified by the ‘count’ parameter, for the names of the partitions. - Names []*string `json:"names,omitempty"` + Names []*string // REQUIRED; Specifies how the service is partitioned. - PartitionScheme *PartitionScheme `json:"partitionScheme,omitempty"` + PartitionScheme *PartitionScheme } // GetPartitionSchemeDescription implements the PartitionSchemeDescriptionClassification interface for type NamedPartitionSchemeDescription. @@ -1054,125 +919,111 @@ func (n *NamedPartitionSchemeDescription) GetPartitionSchemeDescription() *Parti // NodeTypeDescription - Describes a node type in the cluster, each node type represents sub set of nodes in the cluster. type NodeTypeDescription struct { // REQUIRED; The TCP cluster management endpoint port. - ClientConnectionEndpointPort *int32 `json:"clientConnectionEndpointPort,omitempty"` + ClientConnectionEndpointPort *int32 // REQUIRED; The HTTP cluster management endpoint port. - HTTPGatewayEndpointPort *int32 `json:"httpGatewayEndpointPort,omitempty"` + HTTPGatewayEndpointPort *int32 // REQUIRED; The node type on which system services will run. Only one node type should be marked as primary. Primary node // type cannot be deleted or changed for existing clusters. - IsPrimary *bool `json:"isPrimary,omitempty"` + IsPrimary *bool // REQUIRED; The name of the node type. - Name *string `json:"name,omitempty"` + Name *string // REQUIRED; VMInstanceCount should be 1 to n, where n indicates the number of VM instances corresponding to this nodeType. // VMInstanceCount = 0 can be done only in these scenarios: NodeType is a secondary // nodeType. Durability = Bronze or Durability >= Bronze and InfrastructureServiceManager = true. If VMInstanceCount = 0, // implies the VMs for this nodeType will not be used for the initial cluster size // computation. - VMInstanceCount *int32 `json:"vmInstanceCount,omitempty"` + VMInstanceCount *int32 // The range of ports from which cluster assigned port to Service Fabric applications. - ApplicationPorts *EndpointRangeDescription `json:"applicationPorts,omitempty"` + ApplicationPorts *EndpointRangeDescription // The capacity tags applied to the nodes in the node type, the cluster resource manager uses these tags to understand how // much resource a node has. - Capacities map[string]*string `json:"capacities,omitempty"` + Capacities map[string]*string // The durability level of the node type. Learn about DurabilityLevel [https://docs.microsoft.com/azure/service-fabric/service-fabric-cluster-capacity]. // * Bronze - No privileges. This is the default. // * Silver - The infrastructure jobs can be paused for a duration of 10 minutes per UD. // * Gold - The infrastructure jobs can be paused for a duration of 2 hours per UD. Gold durability can be enabled only on // full node VM skus like D15_V2, G5 etc. - DurabilityLevel *DurabilityLevel `json:"durabilityLevel,omitempty"` + DurabilityLevel *DurabilityLevel // The range of ephemeral ports that nodes in this node type should be configured with. - EphemeralPorts *EndpointRangeDescription `json:"ephemeralPorts,omitempty"` + EphemeralPorts *EndpointRangeDescription // Indicates if the node type can only host Stateless workloads. - IsStateless *bool `json:"isStateless,omitempty"` + IsStateless *bool // Indicates if the node type is enabled to support multiple zones. - MultipleAvailabilityZones *bool `json:"multipleAvailabilityZones,omitempty"` + MultipleAvailabilityZones *bool // The placement tags applied to nodes in the node type, which can be used to indicate where certain services (workload) should // run. - PlacementProperties map[string]*string `json:"placementProperties,omitempty"` + PlacementProperties map[string]*string // The endpoint used by reverse proxy. - ReverseProxyEndpointPort *int32 `json:"reverseProxyEndpointPort,omitempty"` + ReverseProxyEndpointPort *int32 } // Notification - Describes the notification channel for cluster events. type Notification struct { // REQUIRED; Indicates if the notification is enabled. - IsEnabled *bool `json:"isEnabled,omitempty"` + IsEnabled *bool // REQUIRED; The category of notification. - NotificationCategory *NotificationCategory `json:"notificationCategory,omitempty"` + NotificationCategory *NotificationCategory // REQUIRED; The level of notification. - NotificationLevel *NotificationLevel `json:"notificationLevel,omitempty"` + NotificationLevel *NotificationLevel // REQUIRED; List of targets that subscribe to the notification. - NotificationTargets []*NotificationTarget `json:"notificationTargets,omitempty"` + NotificationTargets []*NotificationTarget } // NotificationTarget - Describes the notification target properties. type NotificationTarget struct { // REQUIRED; The notification channel indicates the type of receivers subscribed to the notification, either user or subscription. - NotificationChannel *NotificationChannel `json:"notificationChannel,omitempty"` + NotificationChannel *NotificationChannel // REQUIRED; List of targets that subscribe to the notification. - Receivers []*string `json:"receivers,omitempty"` + Receivers []*string } // OperationListResult - Describes the result of the request to list Service Fabric resource provider operations. type OperationListResult struct { // List of operations supported by the Service Fabric resource provider. - Value []*OperationResult `json:"value,omitempty"` + Value []*OperationResult // READ-ONLY; URL to get the next set of operation list results if there are any. - NextLink *string `json:"nextLink,omitempty" azure:"ro"` + NextLink *string } // OperationResult - Available operation list result type OperationResult struct { // The object that represents the operation. - Display *AvailableOperationDisplay `json:"display,omitempty"` + Display *AvailableOperationDisplay // Indicates whether the operation is a data action - IsDataAction *bool `json:"isDataAction,omitempty"` + IsDataAction *bool // The name of the operation. - Name *string `json:"name,omitempty"` + Name *string // The URL to use for getting the next set of results. - NextLink *string `json:"nextLink,omitempty"` + NextLink *string // Origin result - Origin *string `json:"origin,omitempty"` -} - -// OperationsClientListOptions contains the optional parameters for the OperationsClient.NewListPager method. -type OperationsClientListOptions struct { - // placeholder for future optional parameters -} - -// PartitionSchemeDescriptionClassification provides polymorphic access to related types. -// Call the interface's GetPartitionSchemeDescription() method to access the common type. -// Use a type switch to determine the concrete type. The possible types are: -// - *NamedPartitionSchemeDescription, *PartitionSchemeDescription, *SingletonPartitionSchemeDescription, *UniformInt64RangePartitionSchemeDescription -type PartitionSchemeDescriptionClassification interface { - // GetPartitionSchemeDescription returns the PartitionSchemeDescription content of the underlying type. - GetPartitionSchemeDescription() *PartitionSchemeDescription + Origin *string } // PartitionSchemeDescription - Describes how the service is partitioned. type PartitionSchemeDescription struct { // REQUIRED; Specifies how the service is partitioned. - PartitionScheme *PartitionScheme `json:"partitionScheme,omitempty"` + PartitionScheme *PartitionScheme } // GetPartitionSchemeDescription implements the PartitionSchemeDescriptionClassification interface for type PartitionSchemeDescription. @@ -1183,114 +1034,105 @@ func (p *PartitionSchemeDescription) GetPartitionSchemeDescription() *PartitionS // ProxyResource - The resource model definition for proxy-only resource. type ProxyResource struct { // It will be deprecated in New API, resource location depends on the parent resource. - Location *string `json:"location,omitempty"` + Location *string // Azure resource tags. - Tags map[string]*string `json:"tags,omitempty"` + Tags map[string]*string // READ-ONLY; Azure resource etag. - Etag *string `json:"etag,omitempty" azure:"ro"` + Etag *string // READ-ONLY; Azure resource identifier. - ID *string `json:"id,omitempty" azure:"ro"` + ID *string // READ-ONLY; Azure resource name. - Name *string `json:"name,omitempty" azure:"ro"` + Name *string // READ-ONLY; Metadata pertaining to creation and last modification of the resource. - SystemData *SystemData `json:"systemData,omitempty" azure:"ro"` + SystemData *SystemData // READ-ONLY; Azure resource type. - Type *string `json:"type,omitempty" azure:"ro"` + Type *string } // Resource - The resource model definition. type Resource struct { // REQUIRED; Azure resource location. - Location *string `json:"location,omitempty"` + Location *string // Azure resource tags. - Tags map[string]*string `json:"tags,omitempty"` + Tags map[string]*string // READ-ONLY; Azure resource etag. - Etag *string `json:"etag,omitempty" azure:"ro"` + Etag *string // READ-ONLY; Azure resource identifier. - ID *string `json:"id,omitempty" azure:"ro"` + ID *string // READ-ONLY; Azure resource name. - Name *string `json:"name,omitempty" azure:"ro"` + Name *string // READ-ONLY; Metadata pertaining to creation and last modification of the resource. - SystemData *SystemData `json:"systemData,omitempty" azure:"ro"` + SystemData *SystemData // READ-ONLY; Azure resource type. - Type *string `json:"type,omitempty" azure:"ro"` + Type *string } // ServerCertificateCommonName - Describes the server certificate details using common name. type ServerCertificateCommonName struct { // REQUIRED; The common name of the server certificate. - CertificateCommonName *string `json:"certificateCommonName,omitempty"` + CertificateCommonName *string // REQUIRED; The issuer thumbprint of the server certificate. - CertificateIssuerThumbprint *string `json:"certificateIssuerThumbprint,omitempty"` + CertificateIssuerThumbprint *string } // ServerCertificateCommonNames - Describes a list of server certificates referenced by common name that are used to secure // the cluster. type ServerCertificateCommonNames struct { // The list of server certificates referenced by common name that are used to secure the cluster. - CommonNames []*ServerCertificateCommonName `json:"commonNames,omitempty"` + CommonNames []*ServerCertificateCommonName // The local certificate store location. - X509StoreName *StoreName `json:"x509StoreName,omitempty"` + X509StoreName *StoreName } // ServiceCorrelationDescription - Creates a particular correlation between services. type ServiceCorrelationDescription struct { // REQUIRED; The ServiceCorrelationScheme which describes the relationship between this service and the service specified // via ServiceName. - Scheme *ServiceCorrelationScheme `json:"scheme,omitempty"` + Scheme *ServiceCorrelationScheme // REQUIRED; The name of the service that the correlation relationship is established with. - ServiceName *string `json:"serviceName,omitempty"` + ServiceName *string } // ServiceLoadMetricDescription - Specifies a metric to load balance a service during runtime. type ServiceLoadMetricDescription struct { // REQUIRED; The name of the metric. If the service chooses to report load during runtime, the load metric name should match // the name that is specified in Name exactly. Note that metric names are case sensitive. - Name *string `json:"name,omitempty"` + Name *string // Used only for Stateless services. The default amount of load, as a number, that this service creates for this metric. - DefaultLoad *int32 `json:"defaultLoad,omitempty"` + DefaultLoad *int32 // Used only for Stateful services. The default amount of load, as a number, that this service creates for this metric when // it is a Primary replica. - PrimaryDefaultLoad *int32 `json:"primaryDefaultLoad,omitempty"` + PrimaryDefaultLoad *int32 // Used only for Stateful services. The default amount of load, as a number, that this service creates for this metric when // it is a Secondary replica. - SecondaryDefaultLoad *int32 `json:"secondaryDefaultLoad,omitempty"` + SecondaryDefaultLoad *int32 // The service load metric relative weight, compared to other metrics configured for this service, as a number. - Weight *ServiceLoadMetricWeight `json:"weight,omitempty"` -} - -// ServicePlacementPolicyDescriptionClassification provides polymorphic access to related types. -// Call the interface's GetServicePlacementPolicyDescription() method to access the common type. -// Use a type switch to determine the concrete type. The possible types are: -// - *ServicePlacementPolicyDescription -type ServicePlacementPolicyDescriptionClassification interface { - // GetServicePlacementPolicyDescription returns the ServicePlacementPolicyDescription content of the underlying type. - GetServicePlacementPolicyDescription() *ServicePlacementPolicyDescription + Weight *ServiceLoadMetricWeight } // ServicePlacementPolicyDescription - Describes the policy to be used for placement of a Service Fabric service. type ServicePlacementPolicyDescription struct { // REQUIRED; The type of placement policy for a service fabric service. Following are the possible values. - Type *ServicePlacementPolicyType `json:"type,omitempty"` + Type *ServicePlacementPolicyType } // GetServicePlacementPolicyDescription implements the ServicePlacementPolicyDescriptionClassification interface for type @@ -1302,84 +1144,75 @@ func (s *ServicePlacementPolicyDescription) GetServicePlacementPolicyDescription // ServiceResource - The service resource. type ServiceResource struct { // It will be deprecated in New API, resource location depends on the parent resource. - Location *string `json:"location,omitempty"` + Location *string // The service resource properties. - Properties ServiceResourcePropertiesClassification `json:"properties,omitempty"` + Properties ServiceResourcePropertiesClassification // Azure resource tags. - Tags map[string]*string `json:"tags,omitempty"` + Tags map[string]*string // READ-ONLY; Azure resource etag. - Etag *string `json:"etag,omitempty" azure:"ro"` + Etag *string // READ-ONLY; Azure resource identifier. - ID *string `json:"id,omitempty" azure:"ro"` + ID *string // READ-ONLY; Azure resource name. - Name *string `json:"name,omitempty" azure:"ro"` + Name *string // READ-ONLY; Metadata pertaining to creation and last modification of the resource. - SystemData *SystemData `json:"systemData,omitempty" azure:"ro"` + SystemData *SystemData // READ-ONLY; Azure resource type. - Type *string `json:"type,omitempty" azure:"ro"` + Type *string } // ServiceResourceList - The list of service resources. type ServiceResourceList struct { - Value []*ServiceResource `json:"value,omitempty"` + Value []*ServiceResource // READ-ONLY; URL to get the next set of service list results if there are any. - NextLink *string `json:"nextLink,omitempty" azure:"ro"` -} - -// ServiceResourcePropertiesClassification provides polymorphic access to related types. -// Call the interface's GetServiceResourceProperties() method to access the common type. -// Use a type switch to determine the concrete type. The possible types are: -// - *ServiceResourceProperties, *StatefulServiceProperties, *StatelessServiceProperties -type ServiceResourcePropertiesClassification interface { - // GetServiceResourceProperties returns the ServiceResourceProperties content of the underlying type. - GetServiceResourceProperties() *ServiceResourceProperties + NextLink *string } // ServiceResourceProperties - The service resource properties. type ServiceResourceProperties struct { // REQUIRED; The kind of service (Stateless or Stateful). - ServiceKind *ServiceKind `json:"serviceKind,omitempty"` + ServiceKind *ServiceKind // A list that describes the correlation of the service with other services. - CorrelationScheme []*ServiceCorrelationDescription `json:"correlationScheme,omitempty"` + CorrelationScheme []*ServiceCorrelationDescription // Specifies the move cost for the service. - DefaultMoveCost *MoveCost `json:"defaultMoveCost,omitempty"` + DefaultMoveCost *MoveCost // Describes how the service is partitioned. - PartitionDescription PartitionSchemeDescriptionClassification `json:"partitionDescription,omitempty"` + PartitionDescription PartitionSchemeDescriptionClassification // The placement constraints as a string. Placement constraints are boolean expressions on node properties and allow for restricting // a service to particular nodes based on the service requirements. For // example, to place a service on nodes where NodeType is blue specify the following: "NodeColor == blue)". - PlacementConstraints *string `json:"placementConstraints,omitempty"` + PlacementConstraints *string // Dns name used for the service. If this is specified, then the service can be accessed via its DNS name instead of service // name. - ServiceDNSName *string `json:"serviceDnsName,omitempty"` + ServiceDNSName *string // The service load metrics is given as an array of ServiceLoadMetricDescription objects. - ServiceLoadMetrics []*ServiceLoadMetricDescription `json:"serviceLoadMetrics,omitempty"` + ServiceLoadMetrics []*ServiceLoadMetricDescription // The activation Mode of the service package - ServicePackageActivationMode *ArmServicePackageActivationMode `json:"servicePackageActivationMode,omitempty"` + ServicePackageActivationMode *ArmServicePackageActivationMode // A list that describes the correlation of the service with other services. - ServicePlacementPolicies []ServicePlacementPolicyDescriptionClassification `json:"servicePlacementPolicies,omitempty"` + ServicePlacementPolicies []ServicePlacementPolicyDescriptionClassification // The name of the service type - ServiceTypeName *string `json:"serviceTypeName,omitempty"` + ServiceTypeName *string // READ-ONLY; The current deployment or provisioning state, which only appears in the response - ProvisioningState *string `json:"provisioningState,omitempty" azure:"ro"` + ProvisioningState *string } // GetServiceResourceProperties implements the ServiceResourcePropertiesClassification interface for type ServiceResourceProperties. @@ -1390,80 +1223,71 @@ func (s *ServiceResourceProperties) GetServiceResourceProperties() *ServiceResou // ServiceResourcePropertiesBase - The common service resource properties. type ServiceResourcePropertiesBase struct { // A list that describes the correlation of the service with other services. - CorrelationScheme []*ServiceCorrelationDescription `json:"correlationScheme,omitempty"` + CorrelationScheme []*ServiceCorrelationDescription // Specifies the move cost for the service. - DefaultMoveCost *MoveCost `json:"defaultMoveCost,omitempty"` + DefaultMoveCost *MoveCost // The placement constraints as a string. Placement constraints are boolean expressions on node properties and allow for restricting // a service to particular nodes based on the service requirements. For // example, to place a service on nodes where NodeType is blue specify the following: "NodeColor == blue)". - PlacementConstraints *string `json:"placementConstraints,omitempty"` + PlacementConstraints *string // The service load metrics is given as an array of ServiceLoadMetricDescription objects. - ServiceLoadMetrics []*ServiceLoadMetricDescription `json:"serviceLoadMetrics,omitempty"` + ServiceLoadMetrics []*ServiceLoadMetricDescription // A list that describes the correlation of the service with other services. - ServicePlacementPolicies []ServicePlacementPolicyDescriptionClassification `json:"servicePlacementPolicies,omitempty"` + ServicePlacementPolicies []ServicePlacementPolicyDescriptionClassification } // ServiceResourceUpdate - The service resource for patch operations. type ServiceResourceUpdate struct { // It will be deprecated in New API, resource location depends on the parent resource. - Location *string `json:"location,omitempty"` + Location *string // The service resource properties for patch operations. - Properties ServiceResourceUpdatePropertiesClassification `json:"properties,omitempty"` + Properties ServiceResourceUpdatePropertiesClassification // Azure resource tags. - Tags map[string]*string `json:"tags,omitempty"` + Tags map[string]*string // READ-ONLY; Azure resource etag. - Etag *string `json:"etag,omitempty" azure:"ro"` + Etag *string // READ-ONLY; Azure resource identifier. - ID *string `json:"id,omitempty" azure:"ro"` + ID *string // READ-ONLY; Azure resource name. - Name *string `json:"name,omitempty" azure:"ro"` + Name *string // READ-ONLY; Metadata pertaining to creation and last modification of the resource. - SystemData *SystemData `json:"systemData,omitempty" azure:"ro"` + SystemData *SystemData // READ-ONLY; Azure resource type. - Type *string `json:"type,omitempty" azure:"ro"` -} - -// ServiceResourceUpdatePropertiesClassification provides polymorphic access to related types. -// Call the interface's GetServiceResourceUpdateProperties() method to access the common type. -// Use a type switch to determine the concrete type. The possible types are: -// - *ServiceResourceUpdateProperties, *StatefulServiceUpdateProperties, *StatelessServiceUpdateProperties -type ServiceResourceUpdatePropertiesClassification interface { - // GetServiceResourceUpdateProperties returns the ServiceResourceUpdateProperties content of the underlying type. - GetServiceResourceUpdateProperties() *ServiceResourceUpdateProperties + Type *string } // ServiceResourceUpdateProperties - The service resource properties for patch operations. type ServiceResourceUpdateProperties struct { // REQUIRED; The kind of service (Stateless or Stateful). - ServiceKind *ServiceKind `json:"serviceKind,omitempty"` + ServiceKind *ServiceKind // A list that describes the correlation of the service with other services. - CorrelationScheme []*ServiceCorrelationDescription `json:"correlationScheme,omitempty"` + CorrelationScheme []*ServiceCorrelationDescription // Specifies the move cost for the service. - DefaultMoveCost *MoveCost `json:"defaultMoveCost,omitempty"` + DefaultMoveCost *MoveCost // The placement constraints as a string. Placement constraints are boolean expressions on node properties and allow for restricting // a service to particular nodes based on the service requirements. For // example, to place a service on nodes where NodeType is blue specify the following: "NodeColor == blue)". - PlacementConstraints *string `json:"placementConstraints,omitempty"` + PlacementConstraints *string // The service load metrics is given as an array of ServiceLoadMetricDescription objects. - ServiceLoadMetrics []*ServiceLoadMetricDescription `json:"serviceLoadMetrics,omitempty"` + ServiceLoadMetrics []*ServiceLoadMetricDescription // A list that describes the correlation of the service with other services. - ServicePlacementPolicies []ServicePlacementPolicyDescriptionClassification `json:"servicePlacementPolicies,omitempty"` + ServicePlacementPolicies []ServicePlacementPolicyDescriptionClassification } // GetServiceResourceUpdateProperties implements the ServiceResourceUpdatePropertiesClassification interface for type ServiceResourceUpdateProperties. @@ -1478,65 +1302,37 @@ type ServiceTypeDeltaHealthPolicy struct { // the state of the services at the beginning of upgrade and the state of the // services at the time of the health evaluation. The check is performed after every upgrade domain upgrade completion to // make sure the global state of the cluster is within tolerated limits. - MaxPercentDeltaUnhealthyServices *int32 `json:"maxPercentDeltaUnhealthyServices,omitempty"` + MaxPercentDeltaUnhealthyServices *int32 } // ServiceTypeHealthPolicy - Represents the health policy used to evaluate the health of services belonging to a service type. type ServiceTypeHealthPolicy struct { // The maximum percentage of services allowed to be unhealthy before your application is considered in error. - MaxPercentUnhealthyServices *int32 `json:"maxPercentUnhealthyServices,omitempty"` -} - -// ServicesClientBeginCreateOrUpdateOptions contains the optional parameters for the ServicesClient.BeginCreateOrUpdate method. -type ServicesClientBeginCreateOrUpdateOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// ServicesClientBeginDeleteOptions contains the optional parameters for the ServicesClient.BeginDelete method. -type ServicesClientBeginDeleteOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// ServicesClientBeginUpdateOptions contains the optional parameters for the ServicesClient.BeginUpdate method. -type ServicesClientBeginUpdateOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// ServicesClientGetOptions contains the optional parameters for the ServicesClient.Get method. -type ServicesClientGetOptions struct { - // placeholder for future optional parameters -} - -// ServicesClientListOptions contains the optional parameters for the ServicesClient.List method. -type ServicesClientListOptions struct { - // placeholder for future optional parameters + MaxPercentUnhealthyServices *int32 } // SettingsParameterDescription - Describes a parameter in fabric settings of the cluster. type SettingsParameterDescription struct { // REQUIRED; The parameter name of fabric setting. - Name *string `json:"name,omitempty"` + Name *string // REQUIRED; The parameter value of fabric setting. - Value *string `json:"value,omitempty"` + Value *string } // SettingsSectionDescription - Describes a section in the fabric settings of the cluster. type SettingsSectionDescription struct { // REQUIRED; The section name of the fabric settings. - Name *string `json:"name,omitempty"` + Name *string // REQUIRED; The collection of parameters in the section. - Parameters []*SettingsParameterDescription `json:"parameters,omitempty"` + Parameters []*SettingsParameterDescription } // SingletonPartitionSchemeDescription type SingletonPartitionSchemeDescription struct { // REQUIRED; Specifies how the service is partitioned. - PartitionScheme *PartitionScheme `json:"partitionScheme,omitempty"` + PartitionScheme *PartitionScheme } // GetPartitionSchemeDescription implements the PartitionSchemeDescriptionClassification interface for type SingletonPartitionSchemeDescription. @@ -1549,138 +1345,138 @@ func (s *SingletonPartitionSchemeDescription) GetPartitionSchemeDescription() *P // StatefulServiceProperties - The properties of a stateful service resource. type StatefulServiceProperties struct { // REQUIRED; The kind of service (Stateless or Stateful). - ServiceKind *ServiceKind `json:"serviceKind,omitempty"` + ServiceKind *ServiceKind // A list that describes the correlation of the service with other services. - CorrelationScheme []*ServiceCorrelationDescription `json:"correlationScheme,omitempty"` + CorrelationScheme []*ServiceCorrelationDescription // Specifies the move cost for the service. - DefaultMoveCost *MoveCost `json:"defaultMoveCost,omitempty"` + DefaultMoveCost *MoveCost // A flag indicating whether this is a persistent service which stores states on the local disk. If it is then the value of // this property is true, if not it is false. - HasPersistedState *bool `json:"hasPersistedState,omitempty"` + HasPersistedState *bool // The minimum replica set size as a number. - MinReplicaSetSize *int32 `json:"minReplicaSetSize,omitempty"` + MinReplicaSetSize *int32 // Describes how the service is partitioned. - PartitionDescription PartitionSchemeDescriptionClassification `json:"partitionDescription,omitempty"` + PartitionDescription PartitionSchemeDescriptionClassification // The placement constraints as a string. Placement constraints are boolean expressions on node properties and allow for restricting // a service to particular nodes based on the service requirements. For // example, to place a service on nodes where NodeType is blue specify the following: "NodeColor == blue)". - PlacementConstraints *string `json:"placementConstraints,omitempty"` + PlacementConstraints *string // The maximum duration for which a partition is allowed to be in a state of quorum loss, represented in ISO 8601 format (hh:mm:ss.s). - QuorumLossWaitDuration *time.Time `json:"quorumLossWaitDuration,omitempty"` + QuorumLossWaitDuration *time.Time // The duration between when a replica goes down and when a new replica is created, represented in ISO 8601 format (hh:mm:ss.s). - ReplicaRestartWaitDuration *time.Time `json:"replicaRestartWaitDuration,omitempty"` + ReplicaRestartWaitDuration *time.Time // Dns name used for the service. If this is specified, then the service can be accessed via its DNS name instead of service // name. - ServiceDNSName *string `json:"serviceDnsName,omitempty"` + ServiceDNSName *string // The service load metrics is given as an array of ServiceLoadMetricDescription objects. - ServiceLoadMetrics []*ServiceLoadMetricDescription `json:"serviceLoadMetrics,omitempty"` + ServiceLoadMetrics []*ServiceLoadMetricDescription // The activation Mode of the service package - ServicePackageActivationMode *ArmServicePackageActivationMode `json:"servicePackageActivationMode,omitempty"` + ServicePackageActivationMode *ArmServicePackageActivationMode // A list that describes the correlation of the service with other services. - ServicePlacementPolicies []ServicePlacementPolicyDescriptionClassification `json:"servicePlacementPolicies,omitempty"` + ServicePlacementPolicies []ServicePlacementPolicyDescriptionClassification // The name of the service type - ServiceTypeName *string `json:"serviceTypeName,omitempty"` + ServiceTypeName *string // The definition on how long StandBy replicas should be maintained before being removed, represented in ISO 8601 format (hh:mm:ss.s). - StandByReplicaKeepDuration *time.Time `json:"standByReplicaKeepDuration,omitempty"` + StandByReplicaKeepDuration *time.Time // The target replica set size as a number. - TargetReplicaSetSize *int32 `json:"targetReplicaSetSize,omitempty"` + TargetReplicaSetSize *int32 // READ-ONLY; The current deployment or provisioning state, which only appears in the response - ProvisioningState *string `json:"provisioningState,omitempty" azure:"ro"` + ProvisioningState *string } // GetServiceResourceProperties implements the ServiceResourcePropertiesClassification interface for type StatefulServiceProperties. func (s *StatefulServiceProperties) GetServiceResourceProperties() *ServiceResourceProperties { return &ServiceResourceProperties{ - ProvisioningState: s.ProvisioningState, - ServiceKind: s.ServiceKind, - ServiceTypeName: s.ServiceTypeName, + CorrelationScheme: s.CorrelationScheme, + DefaultMoveCost: s.DefaultMoveCost, PartitionDescription: s.PartitionDescription, - ServicePackageActivationMode: s.ServicePackageActivationMode, - ServiceDNSName: s.ServiceDNSName, PlacementConstraints: s.PlacementConstraints, - CorrelationScheme: s.CorrelationScheme, + ProvisioningState: s.ProvisioningState, + ServiceDNSName: s.ServiceDNSName, + ServiceKind: s.ServiceKind, ServiceLoadMetrics: s.ServiceLoadMetrics, + ServicePackageActivationMode: s.ServicePackageActivationMode, ServicePlacementPolicies: s.ServicePlacementPolicies, - DefaultMoveCost: s.DefaultMoveCost, + ServiceTypeName: s.ServiceTypeName, } } // StatefulServiceUpdateProperties - The properties of a stateful service resource for patch operations. type StatefulServiceUpdateProperties struct { // REQUIRED; The kind of service (Stateless or Stateful). - ServiceKind *ServiceKind `json:"serviceKind,omitempty"` + ServiceKind *ServiceKind // A list that describes the correlation of the service with other services. - CorrelationScheme []*ServiceCorrelationDescription `json:"correlationScheme,omitempty"` + CorrelationScheme []*ServiceCorrelationDescription // Specifies the move cost for the service. - DefaultMoveCost *MoveCost `json:"defaultMoveCost,omitempty"` + DefaultMoveCost *MoveCost // The minimum replica set size as a number. - MinReplicaSetSize *int32 `json:"minReplicaSetSize,omitempty"` + MinReplicaSetSize *int32 // The placement constraints as a string. Placement constraints are boolean expressions on node properties and allow for restricting // a service to particular nodes based on the service requirements. For // example, to place a service on nodes where NodeType is blue specify the following: "NodeColor == blue)". - PlacementConstraints *string `json:"placementConstraints,omitempty"` + PlacementConstraints *string // The maximum duration for which a partition is allowed to be in a state of quorum loss, represented in ISO 8601 format (hh:mm:ss.s). - QuorumLossWaitDuration *time.Time `json:"quorumLossWaitDuration,omitempty"` + QuorumLossWaitDuration *time.Time // The duration between when a replica goes down and when a new replica is created, represented in ISO 8601 format (hh:mm:ss.s). - ReplicaRestartWaitDuration *time.Time `json:"replicaRestartWaitDuration,omitempty"` + ReplicaRestartWaitDuration *time.Time // The service load metrics is given as an array of ServiceLoadMetricDescription objects. - ServiceLoadMetrics []*ServiceLoadMetricDescription `json:"serviceLoadMetrics,omitempty"` + ServiceLoadMetrics []*ServiceLoadMetricDescription // A list that describes the correlation of the service with other services. - ServicePlacementPolicies []ServicePlacementPolicyDescriptionClassification `json:"servicePlacementPolicies,omitempty"` + ServicePlacementPolicies []ServicePlacementPolicyDescriptionClassification // The definition on how long StandBy replicas should be maintained before being removed, represented in ISO 8601 format (hh:mm:ss.s). - StandByReplicaKeepDuration *time.Time `json:"standByReplicaKeepDuration,omitempty"` + StandByReplicaKeepDuration *time.Time // The target replica set size as a number. - TargetReplicaSetSize *int32 `json:"targetReplicaSetSize,omitempty"` + TargetReplicaSetSize *int32 } // GetServiceResourceUpdateProperties implements the ServiceResourceUpdatePropertiesClassification interface for type StatefulServiceUpdateProperties. func (s *StatefulServiceUpdateProperties) GetServiceResourceUpdateProperties() *ServiceResourceUpdateProperties { return &ServiceResourceUpdateProperties{ - ServiceKind: s.ServiceKind, - PlacementConstraints: s.PlacementConstraints, CorrelationScheme: s.CorrelationScheme, + DefaultMoveCost: s.DefaultMoveCost, + PlacementConstraints: s.PlacementConstraints, + ServiceKind: s.ServiceKind, ServiceLoadMetrics: s.ServiceLoadMetrics, ServicePlacementPolicies: s.ServicePlacementPolicies, - DefaultMoveCost: s.DefaultMoveCost, } } // StatelessServiceProperties - The properties of a stateless service resource. type StatelessServiceProperties struct { // REQUIRED; The kind of service (Stateless or Stateful). - ServiceKind *ServiceKind `json:"serviceKind,omitempty"` + ServiceKind *ServiceKind // A list that describes the correlation of the service with other services. - CorrelationScheme []*ServiceCorrelationDescription `json:"correlationScheme,omitempty"` + CorrelationScheme []*ServiceCorrelationDescription // Specifies the move cost for the service. - DefaultMoveCost *MoveCost `json:"defaultMoveCost,omitempty"` + DefaultMoveCost *MoveCost // Delay duration for RequestDrain feature to ensures that the endpoint advertised by the stateless instance is removed before // the delay starts prior to closing the instance. This delay enables existing @@ -1688,66 +1484,66 @@ type StatelessServiceProperties struct { // (https://docs.microsoft.com/en-us/azure/service-fabric/service-fabric-application-upgrade-advanced#avoid-connection-drops-during-stateless-service-planned-downtime-preview). // It is represented in ISO // 8601 format (hh:mm:ss.s). - InstanceCloseDelayDuration *string `json:"instanceCloseDelayDuration,omitempty"` + InstanceCloseDelayDuration *string // The instance count. - InstanceCount *int32 `json:"instanceCount,omitempty"` + InstanceCount *int32 // Describes how the service is partitioned. - PartitionDescription PartitionSchemeDescriptionClassification `json:"partitionDescription,omitempty"` + PartitionDescription PartitionSchemeDescriptionClassification // The placement constraints as a string. Placement constraints are boolean expressions on node properties and allow for restricting // a service to particular nodes based on the service requirements. For // example, to place a service on nodes where NodeType is blue specify the following: "NodeColor == blue)". - PlacementConstraints *string `json:"placementConstraints,omitempty"` + PlacementConstraints *string // Dns name used for the service. If this is specified, then the service can be accessed via its DNS name instead of service // name. - ServiceDNSName *string `json:"serviceDnsName,omitempty"` + ServiceDNSName *string // The service load metrics is given as an array of ServiceLoadMetricDescription objects. - ServiceLoadMetrics []*ServiceLoadMetricDescription `json:"serviceLoadMetrics,omitempty"` + ServiceLoadMetrics []*ServiceLoadMetricDescription // The activation Mode of the service package - ServicePackageActivationMode *ArmServicePackageActivationMode `json:"servicePackageActivationMode,omitempty"` + ServicePackageActivationMode *ArmServicePackageActivationMode // A list that describes the correlation of the service with other services. - ServicePlacementPolicies []ServicePlacementPolicyDescriptionClassification `json:"servicePlacementPolicies,omitempty"` + ServicePlacementPolicies []ServicePlacementPolicyDescriptionClassification // The name of the service type - ServiceTypeName *string `json:"serviceTypeName,omitempty"` + ServiceTypeName *string // READ-ONLY; The current deployment or provisioning state, which only appears in the response - ProvisioningState *string `json:"provisioningState,omitempty" azure:"ro"` + ProvisioningState *string } // GetServiceResourceProperties implements the ServiceResourcePropertiesClassification interface for type StatelessServiceProperties. func (s *StatelessServiceProperties) GetServiceResourceProperties() *ServiceResourceProperties { return &ServiceResourceProperties{ - ProvisioningState: s.ProvisioningState, - ServiceKind: s.ServiceKind, - ServiceTypeName: s.ServiceTypeName, + CorrelationScheme: s.CorrelationScheme, + DefaultMoveCost: s.DefaultMoveCost, PartitionDescription: s.PartitionDescription, - ServicePackageActivationMode: s.ServicePackageActivationMode, - ServiceDNSName: s.ServiceDNSName, PlacementConstraints: s.PlacementConstraints, - CorrelationScheme: s.CorrelationScheme, + ProvisioningState: s.ProvisioningState, + ServiceDNSName: s.ServiceDNSName, + ServiceKind: s.ServiceKind, ServiceLoadMetrics: s.ServiceLoadMetrics, + ServicePackageActivationMode: s.ServicePackageActivationMode, ServicePlacementPolicies: s.ServicePlacementPolicies, - DefaultMoveCost: s.DefaultMoveCost, + ServiceTypeName: s.ServiceTypeName, } } // StatelessServiceUpdateProperties - The properties of a stateless service resource for patch operations. type StatelessServiceUpdateProperties struct { // REQUIRED; The kind of service (Stateless or Stateful). - ServiceKind *ServiceKind `json:"serviceKind,omitempty"` + ServiceKind *ServiceKind // A list that describes the correlation of the service with other services. - CorrelationScheme []*ServiceCorrelationDescription `json:"correlationScheme,omitempty"` + CorrelationScheme []*ServiceCorrelationDescription // Specifies the move cost for the service. - DefaultMoveCost *MoveCost `json:"defaultMoveCost,omitempty"` + DefaultMoveCost *MoveCost // Delay duration for RequestDrain feature to ensures that the endpoint advertised by the stateless instance is removed before // the delay starts prior to closing the instance. This delay enables existing @@ -1755,70 +1551,70 @@ type StatelessServiceUpdateProperties struct { // (https://docs.microsoft.com/en-us/azure/service-fabric/service-fabric-application-upgrade-advanced#avoid-connection-drops-during-stateless-service-planned-downtime-preview). // It is first interpreted as // a string representing an ISO 8601 duration. It is represented in ISO 8601 format (hh:mm:ss.s). - InstanceCloseDelayDuration *string `json:"instanceCloseDelayDuration,omitempty"` + InstanceCloseDelayDuration *string // The instance count. - InstanceCount *int32 `json:"instanceCount,omitempty"` + InstanceCount *int32 // The placement constraints as a string. Placement constraints are boolean expressions on node properties and allow for restricting // a service to particular nodes based on the service requirements. For // example, to place a service on nodes where NodeType is blue specify the following: "NodeColor == blue)". - PlacementConstraints *string `json:"placementConstraints,omitempty"` + PlacementConstraints *string // The service load metrics is given as an array of ServiceLoadMetricDescription objects. - ServiceLoadMetrics []*ServiceLoadMetricDescription `json:"serviceLoadMetrics,omitempty"` + ServiceLoadMetrics []*ServiceLoadMetricDescription // A list that describes the correlation of the service with other services. - ServicePlacementPolicies []ServicePlacementPolicyDescriptionClassification `json:"servicePlacementPolicies,omitempty"` + ServicePlacementPolicies []ServicePlacementPolicyDescriptionClassification } // GetServiceResourceUpdateProperties implements the ServiceResourceUpdatePropertiesClassification interface for type StatelessServiceUpdateProperties. func (s *StatelessServiceUpdateProperties) GetServiceResourceUpdateProperties() *ServiceResourceUpdateProperties { return &ServiceResourceUpdateProperties{ - ServiceKind: s.ServiceKind, - PlacementConstraints: s.PlacementConstraints, CorrelationScheme: s.CorrelationScheme, + DefaultMoveCost: s.DefaultMoveCost, + PlacementConstraints: s.PlacementConstraints, + ServiceKind: s.ServiceKind, ServiceLoadMetrics: s.ServiceLoadMetrics, ServicePlacementPolicies: s.ServicePlacementPolicies, - DefaultMoveCost: s.DefaultMoveCost, } } // SystemData - Metadata pertaining to creation and last modification of the resource. type SystemData struct { // The timestamp of resource creation (UTC). - CreatedAt *time.Time `json:"createdAt,omitempty"` + CreatedAt *time.Time // The identity that created the resource. - CreatedBy *string `json:"createdBy,omitempty"` + CreatedBy *string // The type of identity that created the resource. - CreatedByType *string `json:"createdByType,omitempty"` + CreatedByType *string // The timestamp of resource last modification (UTC). - LastModifiedAt *time.Time `json:"lastModifiedAt,omitempty"` + LastModifiedAt *time.Time // The identity that last modified the resource. - LastModifiedBy *string `json:"lastModifiedBy,omitempty"` + LastModifiedBy *string // The type of identity that last modified the resource. - LastModifiedByType *string `json:"lastModifiedByType,omitempty"` + LastModifiedByType *string } // UniformInt64RangePartitionSchemeDescription - Describes a partitioning scheme where an integer range is allocated evenly // across a number of partitions. type UniformInt64RangePartitionSchemeDescription struct { // REQUIRED; The number of partitions. - Count *int32 `json:"count,omitempty"` + Count *int32 // REQUIRED; String indicating the upper bound of the partition key range that should be split between the partition ‘count’ - HighKey *string `json:"highKey,omitempty"` + HighKey *string // REQUIRED; String indicating the lower bound of the partition key range that should be split between the partition ‘count’ - LowKey *string `json:"lowKey,omitempty"` + LowKey *string // REQUIRED; Specifies how the service is partitioned. - PartitionScheme *PartitionScheme `json:"partitionScheme,omitempty"` + PartitionScheme *PartitionScheme } // GetPartitionSchemeDescription implements the PartitionSchemeDescriptionClassification interface for type UniformInt64RangePartitionSchemeDescription. @@ -1831,18 +1627,18 @@ func (u *UniformInt64RangePartitionSchemeDescription) GetPartitionSchemeDescript // UpgradableVersionPathResult - The list of intermediate cluster code versions for an upgrade or downgrade. Or minimum and // maximum upgradable version if no target was given type UpgradableVersionPathResult struct { - SupportedPath []*string `json:"supportedPath,omitempty"` + SupportedPath []*string } type UpgradableVersionsDescription struct { // REQUIRED; The target code version. - TargetVersion *string `json:"targetVersion,omitempty"` + TargetVersion *string } type UserAssignedIdentity struct { // READ-ONLY; The client id of user assigned identity. - ClientID *string `json:"clientId,omitempty" azure:"ro"` + ClientID *string // READ-ONLY; The principal id of user assigned identity. - PrincipalID *string `json:"principalId,omitempty" azure:"ro"` + PrincipalID *string } diff --git a/sdk/resourcemanager/servicefabric/armservicefabric/models_serde.go b/sdk/resourcemanager/servicefabric/armservicefabric/models_serde.go index 5d6102dede63..2fef8bb150bc 100644 --- a/sdk/resourcemanager/servicefabric/armservicefabric/models_serde.go +++ b/sdk/resourcemanager/servicefabric/armservicefabric/models_serde.go @@ -3,9 +3,8 @@ // 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. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. package armservicefabric diff --git a/sdk/resourcemanager/servicefabric/armservicefabric/operations_client.go b/sdk/resourcemanager/servicefabric/armservicefabric/operations_client.go index 2227765a5b15..a75d360fe783 100644 --- a/sdk/resourcemanager/servicefabric/armservicefabric/operations_client.go +++ b/sdk/resourcemanager/servicefabric/armservicefabric/operations_client.go @@ -3,9 +3,8 @@ // 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. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. package armservicefabric diff --git a/sdk/resourcemanager/servicefabric/armservicefabric/operations_client_example_test.go b/sdk/resourcemanager/servicefabric/armservicefabric/operations_client_example_test.go deleted file mode 100644 index 55195b90b435..000000000000 --- a/sdk/resourcemanager/servicefabric/armservicefabric/operations_client_example_test.go +++ /dev/null @@ -1,57 +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 armservicefabric_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/servicefabric/armservicefabric" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d55b8005f05b040b852c15e74a0f3e36494a15e1/specification/servicefabric/resource-manager/Microsoft.ServiceFabric/stable/2021-06-01/examples/ListOperations.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 := armservicefabric.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 = armservicefabric.OperationListResult{ - // Value: []*armservicefabric.OperationResult{ - // { - // Name: to.Ptr("aaaaaaaaaaaaaaaaaaaaaaaaa"), - // Display: &armservicefabric.AvailableOperationDisplay{ - // Description: to.Ptr("aaaaaaaaaaaaaaa"), - // Operation: to.Ptr("aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"), - // Provider: to.Ptr("aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"), - // Resource: to.Ptr("aaaaaaaaaaaaaaaaaa"), - // }, - // IsDataAction: to.Ptr(true), - // Origin: to.Ptr("aaaaaaaaaaaaaa"), - // }}, - // } - } -} diff --git a/sdk/resourcemanager/servicefabric/armservicefabric/options.go b/sdk/resourcemanager/servicefabric/armservicefabric/options.go new file mode 100644 index 000000000000..8a37c8f05d82 --- /dev/null +++ b/sdk/resourcemanager/servicefabric/armservicefabric/options.go @@ -0,0 +1,180 @@ +//go:build go1.18 +// +build go1.18 + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +package armservicefabric + +// ApplicationTypeVersionsClientBeginCreateOrUpdateOptions contains the optional parameters for the ApplicationTypeVersionsClient.BeginCreateOrUpdate +// method. +type ApplicationTypeVersionsClientBeginCreateOrUpdateOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// ApplicationTypeVersionsClientBeginDeleteOptions contains the optional parameters for the ApplicationTypeVersionsClient.BeginDelete +// method. +type ApplicationTypeVersionsClientBeginDeleteOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// ApplicationTypeVersionsClientGetOptions contains the optional parameters for the ApplicationTypeVersionsClient.Get method. +type ApplicationTypeVersionsClientGetOptions struct { + // placeholder for future optional parameters +} + +// ApplicationTypeVersionsClientListOptions contains the optional parameters for the ApplicationTypeVersionsClient.NewListPager +// method. +type ApplicationTypeVersionsClientListOptions struct { + // placeholder for future optional parameters +} + +// ApplicationTypesClientBeginDeleteOptions contains the optional parameters for the ApplicationTypesClient.BeginDelete method. +type ApplicationTypesClientBeginDeleteOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// ApplicationTypesClientCreateOrUpdateOptions contains the optional parameters for the ApplicationTypesClient.CreateOrUpdate +// method. +type ApplicationTypesClientCreateOrUpdateOptions struct { + // placeholder for future optional parameters +} + +// ApplicationTypesClientGetOptions contains the optional parameters for the ApplicationTypesClient.Get method. +type ApplicationTypesClientGetOptions struct { + // placeholder for future optional parameters +} + +// ApplicationTypesClientListOptions contains the optional parameters for the ApplicationTypesClient.NewListPager method. +type ApplicationTypesClientListOptions struct { + // placeholder for future optional parameters +} + +// ApplicationsClientBeginCreateOrUpdateOptions contains the optional parameters for the ApplicationsClient.BeginCreateOrUpdate +// method. +type ApplicationsClientBeginCreateOrUpdateOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// ApplicationsClientBeginDeleteOptions contains the optional parameters for the ApplicationsClient.BeginDelete method. +type ApplicationsClientBeginDeleteOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// ApplicationsClientBeginUpdateOptions contains the optional parameters for the ApplicationsClient.BeginUpdate method. +type ApplicationsClientBeginUpdateOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// ApplicationsClientGetOptions contains the optional parameters for the ApplicationsClient.Get method. +type ApplicationsClientGetOptions struct { + // placeholder for future optional parameters +} + +// ApplicationsClientListOptions contains the optional parameters for the ApplicationsClient.NewListPager method. +type ApplicationsClientListOptions struct { + // placeholder for future optional parameters +} + +// ClusterVersionsClientGetByEnvironmentOptions contains the optional parameters for the ClusterVersionsClient.GetByEnvironment +// method. +type ClusterVersionsClientGetByEnvironmentOptions struct { + // placeholder for future optional parameters +} + +// ClusterVersionsClientGetOptions contains the optional parameters for the ClusterVersionsClient.Get method. +type ClusterVersionsClientGetOptions struct { + // placeholder for future optional parameters +} + +// ClusterVersionsClientListByEnvironmentOptions contains the optional parameters for the ClusterVersionsClient.ListByEnvironment +// method. +type ClusterVersionsClientListByEnvironmentOptions struct { + // placeholder for future optional parameters +} + +// ClusterVersionsClientListOptions contains the optional parameters for the ClusterVersionsClient.List method. +type ClusterVersionsClientListOptions struct { + // placeholder for future optional parameters +} + +// ClustersClientBeginCreateOrUpdateOptions contains the optional parameters for the ClustersClient.BeginCreateOrUpdate method. +type ClustersClientBeginCreateOrUpdateOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// ClustersClientBeginUpdateOptions contains the optional parameters for the ClustersClient.BeginUpdate method. +type ClustersClientBeginUpdateOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// ClustersClientDeleteOptions contains the optional parameters for the ClustersClient.Delete method. +type ClustersClientDeleteOptions struct { + // placeholder for future optional parameters +} + +// ClustersClientGetOptions contains the optional parameters for the ClustersClient.Get method. +type ClustersClientGetOptions struct { + // placeholder for future optional parameters +} + +// ClustersClientListByResourceGroupOptions contains the optional parameters for the ClustersClient.NewListByResourceGroupPager +// method. +type ClustersClientListByResourceGroupOptions struct { + // placeholder for future optional parameters +} + +// ClustersClientListOptions contains the optional parameters for the ClustersClient.NewListPager method. +type ClustersClientListOptions struct { + // placeholder for future optional parameters +} + +// ClustersClientListUpgradableVersionsOptions contains the optional parameters for the ClustersClient.ListUpgradableVersions +// method. +type ClustersClientListUpgradableVersionsOptions struct { + // The upgrade path description with target version. + VersionsDescription *UpgradableVersionsDescription +} + +// OperationsClientListOptions contains the optional parameters for the OperationsClient.NewListPager method. +type OperationsClientListOptions struct { + // placeholder for future optional parameters +} + +// ServicesClientBeginCreateOrUpdateOptions contains the optional parameters for the ServicesClient.BeginCreateOrUpdate method. +type ServicesClientBeginCreateOrUpdateOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// ServicesClientBeginDeleteOptions contains the optional parameters for the ServicesClient.BeginDelete method. +type ServicesClientBeginDeleteOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// ServicesClientBeginUpdateOptions contains the optional parameters for the ServicesClient.BeginUpdate method. +type ServicesClientBeginUpdateOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// ServicesClientGetOptions contains the optional parameters for the ServicesClient.Get method. +type ServicesClientGetOptions struct { + // placeholder for future optional parameters +} + +// ServicesClientListOptions contains the optional parameters for the ServicesClient.NewListPager method. +type ServicesClientListOptions struct { + // placeholder for future optional parameters +} diff --git a/sdk/resourcemanager/servicefabric/armservicefabric/polymorphic_helpers.go b/sdk/resourcemanager/servicefabric/armservicefabric/polymorphic_helpers.go index e3ff132b7b4b..ec5535dfbb3a 100644 --- a/sdk/resourcemanager/servicefabric/armservicefabric/polymorphic_helpers.go +++ b/sdk/resourcemanager/servicefabric/armservicefabric/polymorphic_helpers.go @@ -3,9 +3,8 @@ // 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. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. package armservicefabric @@ -30,7 +29,10 @@ func unmarshalPartitionSchemeDescriptionClassification(rawMsg json.RawMessage) ( default: b = &PartitionSchemeDescription{} } - return b, json.Unmarshal(rawMsg, b) + if err := json.Unmarshal(rawMsg, b); err != nil { + return nil, err + } + return b, nil } func unmarshalServicePlacementPolicyDescriptionClassification(rawMsg json.RawMessage) (ServicePlacementPolicyDescriptionClassification, error) { @@ -46,7 +48,10 @@ func unmarshalServicePlacementPolicyDescriptionClassification(rawMsg json.RawMes default: b = &ServicePlacementPolicyDescription{} } - return b, json.Unmarshal(rawMsg, b) + if err := json.Unmarshal(rawMsg, b); err != nil { + return nil, err + } + return b, nil } func unmarshalServicePlacementPolicyDescriptionClassificationArray(rawMsg json.RawMessage) ([]ServicePlacementPolicyDescriptionClassification, error) { @@ -85,7 +90,10 @@ func unmarshalServiceResourcePropertiesClassification(rawMsg json.RawMessage) (S default: b = &ServiceResourceProperties{} } - return b, json.Unmarshal(rawMsg, b) + if err := json.Unmarshal(rawMsg, b); err != nil { + return nil, err + } + return b, nil } func unmarshalServiceResourceUpdatePropertiesClassification(rawMsg json.RawMessage) (ServiceResourceUpdatePropertiesClassification, error) { @@ -105,5 +113,8 @@ func unmarshalServiceResourceUpdatePropertiesClassification(rawMsg json.RawMessa default: b = &ServiceResourceUpdateProperties{} } - return b, json.Unmarshal(rawMsg, b) + if err := json.Unmarshal(rawMsg, b); err != nil { + return nil, err + } + return b, nil } diff --git a/sdk/resourcemanager/servicefabric/armservicefabric/response_types.go b/sdk/resourcemanager/servicefabric/armservicefabric/response_types.go index d2bf2fe2eb9d..5a5cfd430ded 100644 --- a/sdk/resourcemanager/servicefabric/armservicefabric/response_types.go +++ b/sdk/resourcemanager/servicefabric/armservicefabric/response_types.go @@ -3,14 +3,14 @@ // 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. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. package armservicefabric // ApplicationTypeVersionsClientCreateOrUpdateResponse contains the response from method ApplicationTypeVersionsClient.BeginCreateOrUpdate. type ApplicationTypeVersionsClientCreateOrUpdateResponse struct { + // An application type version resource for the specified application type name resource. ApplicationTypeVersionResource } @@ -21,16 +21,19 @@ type ApplicationTypeVersionsClientDeleteResponse struct { // ApplicationTypeVersionsClientGetResponse contains the response from method ApplicationTypeVersionsClient.Get. type ApplicationTypeVersionsClientGetResponse struct { + // An application type version resource for the specified application type name resource. ApplicationTypeVersionResource } -// ApplicationTypeVersionsClientListResponse contains the response from method ApplicationTypeVersionsClient.List. +// ApplicationTypeVersionsClientListResponse contains the response from method ApplicationTypeVersionsClient.NewListPager. type ApplicationTypeVersionsClientListResponse struct { + // The list of application type version resources for the specified application type name resource. ApplicationTypeVersionResourceList } // ApplicationTypesClientCreateOrUpdateResponse contains the response from method ApplicationTypesClient.CreateOrUpdate. type ApplicationTypesClientCreateOrUpdateResponse struct { + // The application type name resource ApplicationTypeResource } @@ -41,16 +44,19 @@ type ApplicationTypesClientDeleteResponse struct { // ApplicationTypesClientGetResponse contains the response from method ApplicationTypesClient.Get. type ApplicationTypesClientGetResponse struct { + // The application type name resource ApplicationTypeResource } -// ApplicationTypesClientListResponse contains the response from method ApplicationTypesClient.List. +// ApplicationTypesClientListResponse contains the response from method ApplicationTypesClient.NewListPager. type ApplicationTypesClientListResponse struct { + // The list of application type names. ApplicationTypeResourceList } // ApplicationsClientCreateOrUpdateResponse contains the response from method ApplicationsClient.BeginCreateOrUpdate. type ApplicationsClientCreateOrUpdateResponse struct { + // The application resource. ApplicationResource } @@ -61,41 +67,49 @@ type ApplicationsClientDeleteResponse struct { // ApplicationsClientGetResponse contains the response from method ApplicationsClient.Get. type ApplicationsClientGetResponse struct { + // The application resource. ApplicationResource } -// ApplicationsClientListResponse contains the response from method ApplicationsClient.List. +// ApplicationsClientListResponse contains the response from method ApplicationsClient.NewListPager. type ApplicationsClientListResponse struct { + // The list of application resources. ApplicationResourceList } // ApplicationsClientUpdateResponse contains the response from method ApplicationsClient.BeginUpdate. type ApplicationsClientUpdateResponse struct { + // The application resource. ApplicationResource } // ClusterVersionsClientGetByEnvironmentResponse contains the response from method ClusterVersionsClient.GetByEnvironment. type ClusterVersionsClientGetByEnvironmentResponse struct { + // The list results of the Service Fabric runtime versions. ClusterCodeVersionsListResult } // ClusterVersionsClientGetResponse contains the response from method ClusterVersionsClient.Get. type ClusterVersionsClientGetResponse struct { + // The list results of the Service Fabric runtime versions. ClusterCodeVersionsListResult } // ClusterVersionsClientListByEnvironmentResponse contains the response from method ClusterVersionsClient.ListByEnvironment. type ClusterVersionsClientListByEnvironmentResponse struct { + // The list results of the Service Fabric runtime versions. ClusterCodeVersionsListResult } // ClusterVersionsClientListResponse contains the response from method ClusterVersionsClient.List. type ClusterVersionsClientListResponse struct { + // The list results of the Service Fabric runtime versions. ClusterCodeVersionsListResult } // ClustersClientCreateOrUpdateResponse contains the response from method ClustersClient.BeginCreateOrUpdate. type ClustersClientCreateOrUpdateResponse struct { + // The cluster resource Cluster } @@ -106,36 +120,44 @@ type ClustersClientDeleteResponse struct { // ClustersClientGetResponse contains the response from method ClustersClient.Get. type ClustersClientGetResponse struct { + // The cluster resource Cluster } -// ClustersClientListByResourceGroupResponse contains the response from method ClustersClient.ListByResourceGroup. +// ClustersClientListByResourceGroupResponse contains the response from method ClustersClient.NewListByResourceGroupPager. type ClustersClientListByResourceGroupResponse struct { + // Cluster list results ClusterListResult } -// ClustersClientListResponse contains the response from method ClustersClient.List. +// ClustersClientListResponse contains the response from method ClustersClient.NewListPager. type ClustersClientListResponse struct { + // Cluster list results ClusterListResult } // ClustersClientListUpgradableVersionsResponse contains the response from method ClustersClient.ListUpgradableVersions. type ClustersClientListUpgradableVersionsResponse struct { + // The list of intermediate cluster code versions for an upgrade or downgrade. Or minimum and maximum upgradable version if + // no target was given UpgradableVersionPathResult } // ClustersClientUpdateResponse contains the response from method ClustersClient.BeginUpdate. type ClustersClientUpdateResponse struct { + // The cluster resource Cluster } // OperationsClientListResponse contains the response from method OperationsClient.NewListPager. type OperationsClientListResponse struct { + // Describes the result of the request to list Service Fabric resource provider operations. OperationListResult } // ServicesClientCreateOrUpdateResponse contains the response from method ServicesClient.BeginCreateOrUpdate. type ServicesClientCreateOrUpdateResponse struct { + // The service resource. ServiceResource } @@ -146,15 +168,18 @@ type ServicesClientDeleteResponse struct { // ServicesClientGetResponse contains the response from method ServicesClient.Get. type ServicesClientGetResponse struct { + // The service resource. ServiceResource } -// ServicesClientListResponse contains the response from method ServicesClient.List. +// ServicesClientListResponse contains the response from method ServicesClient.NewListPager. type ServicesClientListResponse struct { + // The list of service resources. ServiceResourceList } // ServicesClientUpdateResponse contains the response from method ServicesClient.BeginUpdate. type ServicesClientUpdateResponse struct { + // The service resource. ServiceResource } diff --git a/sdk/resourcemanager/servicefabric/armservicefabric/servicefabric_live_test.go b/sdk/resourcemanager/servicefabric/armservicefabric/servicefabric_live_test.go index 4f4d4a4afca4..6fb55e9ef7f5 100644 --- a/sdk/resourcemanager/servicefabric/armservicefabric/servicefabric_live_test.go +++ b/sdk/resourcemanager/servicefabric/armservicefabric/servicefabric_live_test.go @@ -16,7 +16,7 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" "github.com/Azure/azure-sdk-for-go/sdk/internal/recording" "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/internal/testutil" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/servicefabric/armservicefabric" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/servicefabric/armservicefabric/v2" "github.com/stretchr/testify/suite" ) diff --git a/sdk/resourcemanager/servicefabric/armservicefabric/services_client.go b/sdk/resourcemanager/servicefabric/armservicefabric/services_client.go index f3640749f683..c319b39b995c 100644 --- a/sdk/resourcemanager/servicefabric/armservicefabric/services_client.go +++ b/sdk/resourcemanager/servicefabric/armservicefabric/services_client.go @@ -3,9 +3,8 @@ // 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. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. package armservicefabric @@ -61,7 +60,8 @@ func (client *ServicesClient) BeginCreateOrUpdate(ctx context.Context, resourceG if err != nil { return nil, err } - return runtime.NewPoller[ServicesClientCreateOrUpdateResponse](resp, client.internal.Pipeline(), nil) + poller, err := runtime.NewPoller[ServicesClientCreateOrUpdateResponse](resp, client.internal.Pipeline(), nil) + return poller, err } else { return runtime.NewPollerFromResumeToken[ServicesClientCreateOrUpdateResponse](options.ResumeToken, client.internal.Pipeline(), nil) } @@ -72,18 +72,20 @@ func (client *ServicesClient) BeginCreateOrUpdate(ctx context.Context, resourceG // // Generated from API version 2021-06-01 func (client *ServicesClient) createOrUpdate(ctx context.Context, resourceGroupName string, clusterName string, applicationName string, serviceName string, parameters ServiceResource, options *ServicesClientBeginCreateOrUpdateOptions) (*http.Response, error) { + var err error req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, clusterName, applicationName, serviceName, parameters, options) if err != nil { return nil, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return nil, err } - if !runtime.HasStatusCode(resp, http.StatusAccepted) { - return nil, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusAccepted) { + err = runtime.NewResponseError(httpResp) + return nil, err } - return resp, nil + return httpResp, nil } // createOrUpdateCreateRequest creates the CreateOrUpdate request. @@ -117,7 +119,10 @@ func (client *ServicesClient) createOrUpdateCreateRequest(ctx context.Context, r reqQP.Set("api-version", "2021-06-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, parameters) + if err := runtime.MarshalAsJSON(req, parameters); err != nil { + return nil, err + } + return req, nil } // BeginDelete - Delete a Service Fabric service resource with the specified name. @@ -135,7 +140,8 @@ func (client *ServicesClient) BeginDelete(ctx context.Context, resourceGroupName if err != nil { return nil, err } - return runtime.NewPoller[ServicesClientDeleteResponse](resp, client.internal.Pipeline(), nil) + poller, err := runtime.NewPoller[ServicesClientDeleteResponse](resp, client.internal.Pipeline(), nil) + return poller, err } else { return runtime.NewPollerFromResumeToken[ServicesClientDeleteResponse](options.ResumeToken, client.internal.Pipeline(), nil) } @@ -146,18 +152,20 @@ func (client *ServicesClient) BeginDelete(ctx context.Context, resourceGroupName // // Generated from API version 2021-06-01 func (client *ServicesClient) deleteOperation(ctx context.Context, resourceGroupName string, clusterName string, applicationName string, serviceName string, options *ServicesClientBeginDeleteOptions) (*http.Response, error) { + var err error req, err := client.deleteCreateRequest(ctx, resourceGroupName, clusterName, applicationName, serviceName, options) if err != nil { return nil, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return nil, err } - if !runtime.HasStatusCode(resp, http.StatusAccepted, http.StatusNoContent) { - return nil, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusAccepted, http.StatusNoContent) { + err = runtime.NewResponseError(httpResp) + return nil, err } - return resp, nil + return httpResp, nil } // deleteCreateRequest creates the Delete request. @@ -205,18 +213,21 @@ func (client *ServicesClient) deleteCreateRequest(ctx context.Context, resourceG // - serviceName - The name of the service resource in the format of {applicationName}~{serviceName}. // - options - ServicesClientGetOptions contains the optional parameters for the ServicesClient.Get method. func (client *ServicesClient) Get(ctx context.Context, resourceGroupName string, clusterName string, applicationName string, serviceName string, options *ServicesClientGetOptions) (ServicesClientGetResponse, error) { + var err error req, err := client.getCreateRequest(ctx, resourceGroupName, clusterName, applicationName, serviceName, options) if err != nil { return ServicesClientGetResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return ServicesClientGetResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return ServicesClientGetResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return ServicesClientGetResponse{}, err } - return client.getHandleResponse(resp) + resp, err := client.getHandleResponse(httpResp) + return resp, err } // getCreateRequest creates the Get request. @@ -262,27 +273,40 @@ func (client *ServicesClient) getHandleResponse(resp *http.Response) (ServicesCl return result, nil } -// List - Gets all service resources created or in the process of being created in the Service Fabric application resource. -// If the operation fails it returns an *azcore.ResponseError type. +// NewListPager - Gets all service resources created or in the process of being created in the Service Fabric application +// resource. // // Generated from API version 2021-06-01 // - resourceGroupName - The name of the resource group. // - clusterName - The name of the cluster resource. // - applicationName - The name of the application resource. -// - options - ServicesClientListOptions contains the optional parameters for the ServicesClient.List method. -func (client *ServicesClient) List(ctx context.Context, resourceGroupName string, clusterName string, applicationName string, options *ServicesClientListOptions) (ServicesClientListResponse, error) { - req, err := client.listCreateRequest(ctx, resourceGroupName, clusterName, applicationName, options) - if err != nil { - return ServicesClientListResponse{}, err - } - resp, err := client.internal.Pipeline().Do(req) - if err != nil { - return ServicesClientListResponse{}, err - } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return ServicesClientListResponse{}, runtime.NewResponseError(resp) - } - return client.listHandleResponse(resp) +// - options - ServicesClientListOptions contains the optional parameters for the ServicesClient.NewListPager method. +func (client *ServicesClient) NewListPager(resourceGroupName string, clusterName string, applicationName string, options *ServicesClientListOptions) *runtime.Pager[ServicesClientListResponse] { + return runtime.NewPager(runtime.PagingHandler[ServicesClientListResponse]{ + More: func(page ServicesClientListResponse) bool { + return page.NextLink != nil && len(*page.NextLink) > 0 + }, + Fetcher: func(ctx context.Context, page *ServicesClientListResponse) (ServicesClientListResponse, error) { + var req *policy.Request + var err error + if page == nil { + req, err = client.listCreateRequest(ctx, resourceGroupName, clusterName, applicationName, options) + } else { + req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) + } + if err != nil { + return ServicesClientListResponse{}, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return ServicesClientListResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return ServicesClientListResponse{}, runtime.NewResponseError(resp) + } + return client.listHandleResponse(resp) + }, + }) } // listCreateRequest creates the List request. @@ -340,7 +364,8 @@ func (client *ServicesClient) BeginUpdate(ctx context.Context, resourceGroupName if err != nil { return nil, err } - return runtime.NewPoller[ServicesClientUpdateResponse](resp, client.internal.Pipeline(), nil) + poller, err := runtime.NewPoller[ServicesClientUpdateResponse](resp, client.internal.Pipeline(), nil) + return poller, err } else { return runtime.NewPollerFromResumeToken[ServicesClientUpdateResponse](options.ResumeToken, client.internal.Pipeline(), nil) } @@ -351,18 +376,20 @@ func (client *ServicesClient) BeginUpdate(ctx context.Context, resourceGroupName // // Generated from API version 2021-06-01 func (client *ServicesClient) update(ctx context.Context, resourceGroupName string, clusterName string, applicationName string, serviceName string, parameters ServiceResourceUpdate, options *ServicesClientBeginUpdateOptions) (*http.Response, error) { + var err error req, err := client.updateCreateRequest(ctx, resourceGroupName, clusterName, applicationName, serviceName, parameters, options) if err != nil { return nil, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return nil, err } - if !runtime.HasStatusCode(resp, http.StatusAccepted) { - return nil, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusAccepted) { + err = runtime.NewResponseError(httpResp) + return nil, err } - return resp, nil + return httpResp, nil } // updateCreateRequest creates the Update request. @@ -396,5 +423,8 @@ func (client *ServicesClient) updateCreateRequest(ctx context.Context, resourceG reqQP.Set("api-version", "2021-06-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, parameters) + if err := runtime.MarshalAsJSON(req, parameters); err != nil { + return nil, err + } + return req, nil } diff --git a/sdk/resourcemanager/servicefabric/armservicefabric/services_client_example_test.go b/sdk/resourcemanager/servicefabric/armservicefabric/services_client_example_test.go deleted file mode 100644 index 765bb7c54cbb..000000000000 --- a/sdk/resourcemanager/servicefabric/armservicefabric/services_client_example_test.go +++ /dev/null @@ -1,243 +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 armservicefabric_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/servicefabric/armservicefabric" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d55b8005f05b040b852c15e74a0f3e36494a15e1/specification/servicefabric/resource-manager/Microsoft.ServiceFabric/stable/2021-06-01/examples/ServiceGetOperation_example.json -func ExampleServicesClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armservicefabric.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewServicesClient().Get(ctx, "resRg", "myCluster", "myApp", "myService", 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.ServiceResource = armservicefabric.ServiceResource{ - // Name: to.Ptr("myCluster"), - // Type: to.Ptr("services"), - // Etag: to.Ptr("W/\"636462502183671258\""), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/resRg/providers/Microsoft.ServiceFabric/clusters/myCluster/applications/myApp/services/myService"), - // Location: to.Ptr("eastus"), - // Tags: map[string]*string{ - // }, - // Properties: &armservicefabric.StatelessServiceProperties{ - // DefaultMoveCost: to.Ptr(armservicefabric.MoveCostMedium), - // PlacementConstraints: to.Ptr("NodeType==frontend"), - // ServiceLoadMetrics: []*armservicefabric.ServiceLoadMetricDescription{ - // { - // Name: to.Ptr("metric1"), - // Weight: to.Ptr(armservicefabric.ServiceLoadMetricWeightLow), - // }}, - // ServicePlacementPolicies: []armservicefabric.ServicePlacementPolicyDescriptionClassification{ - // }, - // PartitionDescription: &armservicefabric.SingletonPartitionSchemeDescription{ - // PartitionScheme: to.Ptr(armservicefabric.PartitionSchemeSingleton), - // }, - // ProvisioningState: to.Ptr("Succeeded"), - // ServiceKind: to.Ptr(armservicefabric.ServiceKindStateless), - // ServicePackageActivationMode: to.Ptr(armservicefabric.ArmServicePackageActivationModeSharedProcess), - // ServiceTypeName: to.Ptr("myServiceType"), - // InstanceCount: to.Ptr[int32](5), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d55b8005f05b040b852c15e74a0f3e36494a15e1/specification/servicefabric/resource-manager/Microsoft.ServiceFabric/stable/2021-06-01/examples/ServicePutOperation_example_max.json -func ExampleServicesClient_BeginCreateOrUpdate_putAServiceWithMaximumParameters() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armservicefabric.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewServicesClient().BeginCreateOrUpdate(ctx, "resRg", "myCluster", "myApp", "myService", armservicefabric.ServiceResource{ - Tags: map[string]*string{}, - Properties: &armservicefabric.StatelessServiceProperties{ - CorrelationScheme: []*armservicefabric.ServiceCorrelationDescription{ - { - Scheme: to.Ptr(armservicefabric.ServiceCorrelationSchemeAffinity), - ServiceName: to.Ptr("fabric:/app1/app1~svc1"), - }}, - DefaultMoveCost: to.Ptr(armservicefabric.MoveCostMedium), - PlacementConstraints: to.Ptr("NodeType==frontend"), - ServiceLoadMetrics: []*armservicefabric.ServiceLoadMetricDescription{ - { - Name: to.Ptr("metric1"), - Weight: to.Ptr(armservicefabric.ServiceLoadMetricWeightLow), - }}, - ServicePlacementPolicies: []armservicefabric.ServicePlacementPolicyDescriptionClassification{}, - PartitionDescription: &armservicefabric.SingletonPartitionSchemeDescription{ - PartitionScheme: to.Ptr(armservicefabric.PartitionSchemeSingleton), - }, - ServiceDNSName: to.Ptr("my.service.dns"), - ServiceKind: to.Ptr(armservicefabric.ServiceKindStateless), - ServicePackageActivationMode: to.Ptr(armservicefabric.ArmServicePackageActivationModeSharedProcess), - ServiceTypeName: to.Ptr("myServiceType"), - InstanceCount: to.Ptr[int32](5), - }, - }, 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/d55b8005f05b040b852c15e74a0f3e36494a15e1/specification/servicefabric/resource-manager/Microsoft.ServiceFabric/stable/2021-06-01/examples/ServicePutOperation_example_min.json -func ExampleServicesClient_BeginCreateOrUpdate_putAServiceWithMinimumParameters() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armservicefabric.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewServicesClient().BeginCreateOrUpdate(ctx, "resRg", "myCluster", "myApp", "myService", armservicefabric.ServiceResource{ - Tags: map[string]*string{}, - Properties: &armservicefabric.StatelessServiceProperties{ - PartitionDescription: &armservicefabric.SingletonPartitionSchemeDescription{ - PartitionScheme: to.Ptr(armservicefabric.PartitionSchemeSingleton), - }, - ServiceKind: to.Ptr(armservicefabric.ServiceKindStateless), - ServiceTypeName: to.Ptr("myServiceType"), - InstanceCount: to.Ptr[int32](1), - }, - }, 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/d55b8005f05b040b852c15e74a0f3e36494a15e1/specification/servicefabric/resource-manager/Microsoft.ServiceFabric/stable/2021-06-01/examples/ServicePatchOperation_example.json -func ExampleServicesClient_BeginUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armservicefabric.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewServicesClient().BeginUpdate(ctx, "resRg", "myCluster", "myApp", "myService", armservicefabric.ServiceResourceUpdate{ - Tags: map[string]*string{}, - Properties: &armservicefabric.StatelessServiceUpdateProperties{ - ServiceLoadMetrics: []*armservicefabric.ServiceLoadMetricDescription{ - { - Name: to.Ptr("metric1"), - Weight: to.Ptr(armservicefabric.ServiceLoadMetricWeightLow), - }}, - ServiceKind: to.Ptr(armservicefabric.ServiceKindStateless), - }, - }, 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/d55b8005f05b040b852c15e74a0f3e36494a15e1/specification/servicefabric/resource-manager/Microsoft.ServiceFabric/stable/2021-06-01/examples/ServiceDeleteOperation_example.json -func ExampleServicesClient_BeginDelete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armservicefabric.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewServicesClient().BeginDelete(ctx, "resRg", "myCluster", "myApp", "myService", 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/d55b8005f05b040b852c15e74a0f3e36494a15e1/specification/servicefabric/resource-manager/Microsoft.ServiceFabric/stable/2021-06-01/examples/ServiceListOperation_example.json -func ExampleServicesClient_List() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armservicefabric.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewServicesClient().List(ctx, "resRg", "myCluster", "myApp", 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.ServiceResourceList = armservicefabric.ServiceResourceList{ - // Value: []*armservicefabric.ServiceResource{ - // { - // Name: to.Ptr("myCluster"), - // Type: to.Ptr("services"), - // Etag: to.Ptr("W/\"636462502183671257\""), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/resRg/providers/Microsoft.ServiceFabric/clusters/myCluster/applications/myApp/services/myService"), - // Location: to.Ptr("eastus"), - // Tags: map[string]*string{ - // }, - // Properties: &armservicefabric.StatelessServiceProperties{ - // ServiceLoadMetrics: []*armservicefabric.ServiceLoadMetricDescription{ - // { - // Name: to.Ptr("metric1"), - // Weight: to.Ptr(armservicefabric.ServiceLoadMetricWeightLow), - // }}, - // PartitionDescription: &armservicefabric.SingletonPartitionSchemeDescription{ - // PartitionScheme: to.Ptr(armservicefabric.PartitionSchemeSingleton), - // }, - // ProvisioningState: to.Ptr("Succeeded"), - // ServiceKind: to.Ptr(armservicefabric.ServiceKindStateless), - // ServicePackageActivationMode: to.Ptr(armservicefabric.ArmServicePackageActivationModeSharedProcess), - // ServiceTypeName: to.Ptr("myServiceType"), - // InstanceCount: to.Ptr[int32](1), - // }, - // }}, - // } -} diff --git a/sdk/resourcemanager/servicefabric/armservicefabric/time_rfc3339.go b/sdk/resourcemanager/servicefabric/armservicefabric/time_rfc3339.go index 1f3ad56ee4ae..826938eb62d7 100644 --- a/sdk/resourcemanager/servicefabric/armservicefabric/time_rfc3339.go +++ b/sdk/resourcemanager/servicefabric/armservicefabric/time_rfc3339.go @@ -3,9 +3,8 @@ // 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. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. package armservicefabric