From 3a06eaba8c199e7b796fa438a9d386680857cdf3 Mon Sep 17 00:00:00 2001 From: SDKAuto Date: Thu, 1 Feb 2024 16:20:00 +0000 Subject: [PATCH] CodeGen from PR 27555 in Azure/azure-rest-api-specs Merge 15ead2aa0516bb3765a266cf48b1b7584d6fa756 into eca452ea5bedf668299276087531e98558540e3c --- .../armservicefabric/CHANGELOG.md | 4 + .../servicefabric/armservicefabric/README.md | 6 +- .../applications_client_example_test.go | 318 ---- .../applicationtypes_client_example_test.go | 145 -- ...icationtypeversions_client_example_test.go | 144 -- .../armservicefabric/autorest.md | 7 +- .../clusters_client_example_test.go | 1491 ----------------- .../clusterversions_client_example_test.go | 160 -- .../armservicefabric/constants.go | 2 +- .../servicefabric/armservicefabric/go.mod | 2 +- .../operations_client_example_test.go | 57 - .../services_client_example_test.go | 248 --- 12 files changed, 12 insertions(+), 2572 deletions(-) delete mode 100644 sdk/resourcemanager/servicefabric/armservicefabric/applications_client_example_test.go delete mode 100644 sdk/resourcemanager/servicefabric/armservicefabric/applicationtypes_client_example_test.go delete mode 100644 sdk/resourcemanager/servicefabric/armservicefabric/applicationtypeversions_client_example_test.go delete mode 100644 sdk/resourcemanager/servicefabric/armservicefabric/clusters_client_example_test.go delete mode 100644 sdk/resourcemanager/servicefabric/armservicefabric/clusterversions_client_example_test.go delete mode 100644 sdk/resourcemanager/servicefabric/armservicefabric/operations_client_example_test.go delete mode 100644 sdk/resourcemanager/servicefabric/armservicefabric/services_client_example_test.go diff --git a/sdk/resourcemanager/servicefabric/armservicefabric/CHANGELOG.md b/sdk/resourcemanager/servicefabric/armservicefabric/CHANGELOG.md index 134f02595352..de9199472f91 100644 --- a/sdk/resourcemanager/servicefabric/armservicefabric/CHANGELOG.md +++ b/sdk/resourcemanager/servicefabric/armservicefabric/CHANGELOG.md @@ -1,5 +1,9 @@ # Release History +## 2.0.1 (2024-02-01) +### Other Changes + + ## 2.0.0 (2023-12-22) ### Breaking Changes diff --git a/sdk/resourcemanager/servicefabric/armservicefabric/README.md b/sdk/resourcemanager/servicefabric/armservicefabric/README.md index aea4eb6929e6..64abc0b2898d 100644 --- a/sdk/resourcemanager/servicefabric/armservicefabric/README.md +++ b/sdk/resourcemanager/servicefabric/armservicefabric/README.md @@ -1,6 +1,6 @@ # Azure Service Fabric Module for Go -[![PkgGoDev](https://pkg.go.dev/badge/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/servicefabric/armservicefabric)](https://pkg.go.dev/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/servicefabric/armservicefabric) +[![PkgGoDev](https://pkg.go.dev/badge/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/servicefabric/armservicefabric/v2)](https://pkg.go.dev/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/servicefabric/armservicefabric/v2) The `armservicefabric` module provides operations for working with Azure Service Fabric. @@ -20,7 +20,7 @@ This project uses [Go modules](https://github.com/golang/go/wiki/Modules) for ve Install the Azure Service Fabric module: ```sh -go get github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/servicefabric/armservicefabric +go get github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/servicefabric/armservicefabric/v2 ``` ## Authorization @@ -57,7 +57,7 @@ clientFactory, err := armservicefabric.NewClientFactory(, cred, A client groups a set of related APIs, providing access to its functionality. Create one or more clients to access the APIs you require using client factory. ```go -client := clientFactory.NewServicesClient() +client := clientFactory.NewApplicationTypeVersionsClient() ``` ## Fakes 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 24ab081aac07..000000000000 --- a/sdk/resourcemanager/servicefabric/armservicefabric/applications_client_example_test.go +++ /dev/null @@ -1,318 +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/v2" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/b8c74fd80b415fa1ebb6fa787d454694c39e0fd5/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/b8c74fd80b415fa1ebb6fa787d454694c39e0fd5/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/b8c74fd80b415fa1ebb6fa787d454694c39e0fd5/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/b8c74fd80b415fa1ebb6fa787d454694c39e0fd5/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/b8c74fd80b415fa1ebb6fa787d454694c39e0fd5/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/b8c74fd80b415fa1ebb6fa787d454694c39e0fd5/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/b8c74fd80b415fa1ebb6fa787d454694c39e0fd5/specification/servicefabric/resource-manager/Microsoft.ServiceFabric/stable/2021-06-01/examples/ApplicationListOperation_example.json -func ExampleApplicationsClient_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.NewApplicationsClient().NewListPager("resRg", "myCluster", 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.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_example_test.go b/sdk/resourcemanager/servicefabric/armservicefabric/applicationtypes_client_example_test.go deleted file mode 100644 index 410653246495..000000000000 --- a/sdk/resourcemanager/servicefabric/armservicefabric/applicationtypes_client_example_test.go +++ /dev/null @@ -1,145 +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/v2" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/b8c74fd80b415fa1ebb6fa787d454694c39e0fd5/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/b8c74fd80b415fa1ebb6fa787d454694c39e0fd5/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/b8c74fd80b415fa1ebb6fa787d454694c39e0fd5/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/b8c74fd80b415fa1ebb6fa787d454694c39e0fd5/specification/servicefabric/resource-manager/Microsoft.ServiceFabric/stable/2021-06-01/examples/ApplicationTypeNameListOperation_example.json -func ExampleApplicationTypesClient_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.NewApplicationTypesClient().NewListPager("resRg", "myCluster", 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.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_example_test.go b/sdk/resourcemanager/servicefabric/armservicefabric/applicationtypeversions_client_example_test.go deleted file mode 100644 index 58a4fea3eb63..000000000000 --- a/sdk/resourcemanager/servicefabric/armservicefabric/applicationtypeversions_client_example_test.go +++ /dev/null @@ -1,144 +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/v2" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/b8c74fd80b415fa1ebb6fa787d454694c39e0fd5/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/b8c74fd80b415fa1ebb6fa787d454694c39e0fd5/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/b8c74fd80b415fa1ebb6fa787d454694c39e0fd5/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/b8c74fd80b415fa1ebb6fa787d454694c39e0fd5/specification/servicefabric/resource-manager/Microsoft.ServiceFabric/stable/2021-06-01/examples/ApplicationTypeVersionListOperation_example.json -func ExampleApplicationTypeVersionsClient_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.NewApplicationTypeVersionsClient().NewListPager("resRg", "myCluster", "myAppType", 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.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 858882c72a03..6d933193ae3a 100644 --- a/sdk/resourcemanager/servicefabric/armservicefabric/autorest.md +++ b/sdk/resourcemanager/servicefabric/armservicefabric/autorest.md @@ -5,9 +5,8 @@ ``` yaml azure-arm: true require: -- https://github.com/Azure/azure-rest-api-specs/blob/b8c74fd80b415fa1ebb6fa787d454694c39e0fd5/specification/servicefabric/resource-manager/readme.md -- https://github.com/Azure/azure-rest-api-specs/blob/b8c74fd80b415fa1ebb6fa787d454694c39e0fd5/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: 2.0.0 -tag: package-2021-06 +module-version: 2.0.1 ``` \ No newline at end of file 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 03c630eda56b..000000000000 --- a/sdk/resourcemanager/servicefabric/armservicefabric/clusters_client_example_test.go +++ /dev/null @@ -1,1491 +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/v2" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/b8c74fd80b415fa1ebb6fa787d454694c39e0fd5/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/b8c74fd80b415fa1ebb6fa787d454694c39e0fd5/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:00.000Z"); return t }()), - UpgradePauseStartTimestampUTC: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-06-21T22:00:00.000Z"); 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:00.000Z"); return t}()), - // UpgradePauseStartTimestampUTC: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-06-21T22:00:00.000Z"); 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/b8c74fd80b415fa1ebb6fa787d454694c39e0fd5/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/b8c74fd80b415fa1ebb6fa787d454694c39e0fd5/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:00.000Z"); return t }()), - UpgradePauseStartTimestampUTC: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-06-21T22:00:00.000Z"); 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:00.000Z"); return t}()), - // UpgradePauseStartTimestampUTC: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-06-21T22:00:00.000Z"); return t}()), - // UpgradeWave: to.Ptr(armservicefabric.ClusterUpgradeCadenceWave2), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/b8c74fd80b415fa1ebb6fa787d454694c39e0fd5/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/b8c74fd80b415fa1ebb6fa787d454694c39e0fd5/specification/servicefabric/resource-manager/Microsoft.ServiceFabric/stable/2021-06-01/examples/ClusterListByResourceGroupOperation_example.json -func ExampleClustersClient_NewListByResourceGroupPager() { - 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.NewClustersClient().NewListByResourceGroupPager("resRg", 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.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/b8c74fd80b415fa1ebb6fa787d454694c39e0fd5/specification/servicefabric/resource-manager/Microsoft.ServiceFabric/stable/2021-06-01/examples/ClusterListOperation_example.json -func ExampleClustersClient_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.NewClustersClient().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.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/b8c74fd80b415fa1ebb6fa787d454694c39e0fd5/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/b8c74fd80b415fa1ebb6fa787d454694c39e0fd5/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_example_test.go b/sdk/resourcemanager/servicefabric/armservicefabric/clusterversions_client_example_test.go deleted file mode 100644 index 7493febb6480..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/v2" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/b8c74fd80b415fa1ebb6fa787d454694c39e0fd5/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/b8c74fd80b415fa1ebb6fa787d454694c39e0fd5/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/b8c74fd80b415fa1ebb6fa787d454694c39e0fd5/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/b8c74fd80b415fa1ebb6fa787d454694c39e0fd5/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 7381d330329d..3e13f83a9f69 100644 --- a/sdk/resourcemanager/servicefabric/armservicefabric/constants.go +++ b/sdk/resourcemanager/servicefabric/armservicefabric/constants.go @@ -10,7 +10,7 @@ package armservicefabric const ( moduleName = "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/servicefabric/armservicefabric" - moduleVersion = "v2.0.0" + moduleVersion = "v2.0.1" ) // AddOnFeatures - Available cluster add-on features diff --git a/sdk/resourcemanager/servicefabric/armservicefabric/go.mod b/sdk/resourcemanager/servicefabric/armservicefabric/go.mod index a8d264d20d44..79014389b048 100644 --- a/sdk/resourcemanager/servicefabric/armservicefabric/go.mod +++ b/sdk/resourcemanager/servicefabric/armservicefabric/go.mod @@ -4,13 +4,13 @@ go 1.18 require ( github.com/Azure/azure-sdk-for-go/sdk/azcore v1.9.0 - github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.4.0 github.com/Azure/azure-sdk-for-go/sdk/internal v1.5.0 github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/internal/v2 v2.0.0 github.com/stretchr/testify v1.8.4 ) require ( + github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.4.0 // indirect github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/resources/armresources v1.1.1 // indirect github.com/AzureAD/microsoft-authentication-library-for-go v1.1.1 // indirect github.com/davecgh/go-spew v1.1.1 // indirect 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 e9e31900089d..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/v2" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/b8c74fd80b415fa1ebb6fa787d454694c39e0fd5/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/services_client_example_test.go b/sdk/resourcemanager/servicefabric/armservicefabric/services_client_example_test.go deleted file mode 100644 index 458deccc3052..000000000000 --- a/sdk/resourcemanager/servicefabric/armservicefabric/services_client_example_test.go +++ /dev/null @@ -1,248 +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/v2" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/b8c74fd80b415fa1ebb6fa787d454694c39e0fd5/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/b8c74fd80b415fa1ebb6fa787d454694c39e0fd5/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/b8c74fd80b415fa1ebb6fa787d454694c39e0fd5/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/b8c74fd80b415fa1ebb6fa787d454694c39e0fd5/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/b8c74fd80b415fa1ebb6fa787d454694c39e0fd5/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/b8c74fd80b415fa1ebb6fa787d454694c39e0fd5/specification/servicefabric/resource-manager/Microsoft.ServiceFabric/stable/2021-06-01/examples/ServiceListOperation_example.json -func ExampleServicesClient_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.NewServicesClient().NewListPager("resRg", "myCluster", "myApp", 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.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), - // }, - // }}, - // } - } -}