diff --git a/sdk/resourcemanager/hdinsight/armhdinsight/CHANGELOG.md b/sdk/resourcemanager/hdinsight/armhdinsight/CHANGELOG.md index cba4a7688598..3eb08169e46a 100644 --- a/sdk/resourcemanager/hdinsight/armhdinsight/CHANGELOG.md +++ b/sdk/resourcemanager/hdinsight/armhdinsight/CHANGELOG.md @@ -1,5 +1,11 @@ # Release History +## 1.2.0-beta.1 (2023-06-05) +### Features Added + +- New field `EnableSecureChannel` in struct `StorageAccount` + + ## 1.1.1 (2023-04-14) ### Bug Fixes diff --git a/sdk/resourcemanager/hdinsight/armhdinsight/applications_client.go b/sdk/resourcemanager/hdinsight/armhdinsight/applications_client.go index 80083525eb5d..3b14a6a1fefc 100644 --- a/sdk/resourcemanager/hdinsight/armhdinsight/applications_client.go +++ b/sdk/resourcemanager/hdinsight/armhdinsight/applications_client.go @@ -48,7 +48,7 @@ func NewApplicationsClient(subscriptionID string, credential azcore.TokenCredent // BeginCreate - Creates applications for the HDInsight cluster. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2021-06-01 +// Generated from API version 2023-04-15-preview // - resourceGroupName - The name of the resource group. // - clusterName - The name of the cluster. // - applicationName - The constant value for the application name. @@ -72,7 +72,7 @@ func (client *ApplicationsClient) BeginCreate(ctx context.Context, resourceGroup // Create - Creates applications for the HDInsight cluster. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2021-06-01 +// Generated from API version 2023-04-15-preview func (client *ApplicationsClient) create(ctx context.Context, resourceGroupName string, clusterName string, applicationName string, parameters Application, options *ApplicationsClientBeginCreateOptions) (*http.Response, error) { req, err := client.createCreateRequest(ctx, resourceGroupName, clusterName, applicationName, parameters, options) if err != nil { @@ -112,7 +112,7 @@ func (client *ApplicationsClient) createCreateRequest(ctx context.Context, resou return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-06-01") + reqQP.Set("api-version", "2023-04-15-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, parameters) @@ -121,7 +121,7 @@ func (client *ApplicationsClient) createCreateRequest(ctx context.Context, resou // BeginDelete - Deletes the specified application on the HDInsight cluster. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2021-06-01 +// Generated from API version 2023-04-15-preview // - resourceGroupName - The name of the resource group. // - clusterName - The name of the cluster. // - applicationName - The constant value for the application name. @@ -144,7 +144,7 @@ func (client *ApplicationsClient) BeginDelete(ctx context.Context, resourceGroup // Delete - Deletes the specified application on the HDInsight cluster. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2021-06-01 +// Generated from API version 2023-04-15-preview func (client *ApplicationsClient) deleteOperation(ctx context.Context, resourceGroupName string, clusterName string, applicationName string, options *ApplicationsClientBeginDeleteOptions) (*http.Response, error) { req, err := client.deleteCreateRequest(ctx, resourceGroupName, clusterName, applicationName, options) if err != nil { @@ -184,7 +184,7 @@ func (client *ApplicationsClient) deleteCreateRequest(ctx context.Context, resou return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-06-01") + reqQP.Set("api-version", "2023-04-15-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -193,7 +193,7 @@ func (client *ApplicationsClient) deleteCreateRequest(ctx context.Context, resou // Get - Gets properties of the specified application. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2021-06-01 +// Generated from API version 2023-04-15-preview // - resourceGroupName - The name of the resource group. // - clusterName - The name of the cluster. // - applicationName - The constant value for the application name. @@ -237,7 +237,7 @@ func (client *ApplicationsClient) getCreateRequest(ctx context.Context, resource return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-06-01") + reqQP.Set("api-version", "2023-04-15-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -255,7 +255,7 @@ func (client *ApplicationsClient) getHandleResponse(resp *http.Response) (Applic // GetAzureAsyncOperationStatus - Gets the async operation status. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2021-06-01 +// Generated from API version 2023-04-15-preview // - resourceGroupName - The name of the resource group. // - clusterName - The name of the cluster. // - applicationName - The constant value for the application name. @@ -305,7 +305,7 @@ func (client *ApplicationsClient) getAzureAsyncOperationStatusCreateRequest(ctx return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-06-01") + reqQP.Set("api-version", "2023-04-15-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -322,7 +322,7 @@ func (client *ApplicationsClient) getAzureAsyncOperationStatusHandleResponse(res // NewListByClusterPager - Lists all of the applications for the HDInsight cluster. // -// Generated from API version 2021-06-01 +// Generated from API version 2023-04-15-preview // - resourceGroupName - The name of the resource group. // - clusterName - The name of the cluster. // - options - ApplicationsClientListByClusterOptions contains the optional parameters for the ApplicationsClient.NewListByClusterPager @@ -375,7 +375,7 @@ func (client *ApplicationsClient) listByClusterCreateRequest(ctx context.Context return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-06-01") + reqQP.Set("api-version", "2023-04-15-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/hdinsight/armhdinsight/applications_client_example_test.go b/sdk/resourcemanager/hdinsight/armhdinsight/applications_client_example_test.go deleted file mode 100644 index 9414d5cf7260..000000000000 --- a/sdk/resourcemanager/hdinsight/armhdinsight/applications_client_example_test.go +++ /dev/null @@ -1,417 +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 armhdinsight_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/hdinsight/armhdinsight" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7a2ac91de424f271cf91cc8009f3fe9ee8249086/specification/hdinsight/resource-manager/Microsoft.HDInsight/stable/2021-06-01/examples/GetAllApplications.json -func ExampleApplicationsClient_NewListByClusterPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armhdinsight.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewApplicationsClient().NewListByClusterPager("rg1", "cluster1", 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.ApplicationListResult = armhdinsight.ApplicationListResult{ - // Value: []*armhdinsight.Application{ - // { - // Name: to.Ptr("app"), - // Type: to.Ptr("Microsoft.HDInsight/clusters/applications"), - // ID: to.Ptr("/subscriptions/subId/resourceGroups/rg1/providers/Microsoft.HDInsight/clusters/cluster1/applications/app"), - // Etag: to.Ptr("CF938302-6B4D-44A0-A6D2-C0D67E847AEC"), - // Properties: &armhdinsight.ApplicationProperties{ - // ApplicationState: to.Ptr("Running"), - // ApplicationType: to.Ptr("CustomApplication"), - // ComputeProfile: &armhdinsight.ComputeProfile{ - // Roles: []*armhdinsight.Role{ - // { - // Name: to.Ptr("edgenode"), - // HardwareProfile: &armhdinsight.HardwareProfile{ - // VMSize: to.Ptr("Standard_D12_v2"), - // }, - // TargetInstanceCount: to.Ptr[int32](1), - // }}, - // }, - // CreatedDate: to.Ptr("2017-03-22T21:34:39.293"), - // HTTPSEndpoints: []*armhdinsight.ApplicationGetHTTPSEndpoint{ - // { - // AccessModes: []*string{ - // to.Ptr("WebPage")}, - // DestinationPort: to.Ptr[int32](20000), - // Location: to.Ptr("https://cluster1-app.apps.azurehdinsight.net:443"), - // PublicPort: to.Ptr[int32](443), - // }}, - // InstallScriptActions: []*armhdinsight.RuntimeScriptAction{ - // { - // Name: to.Ptr("app-install-app"), - // Roles: []*string{ - // to.Ptr("edgenode")}, - // URI: to.Ptr("http://testurl.com/public/hdi-app/20170301/hdinsight-app-install.sh"), - // }}, - // MarketplaceIdentifier: to.Ptr("app-on-hdiapp-on-hdi.1.0.3"), - // ProvisioningState: to.Ptr("Succeeded"), - // SSHEndpoints: []*armhdinsight.ApplicationGetEndpoint{ - // { - // DestinationPort: to.Ptr[int32](22), - // Location: to.Ptr("app.cluster1-ssh.azurehdinsight.net:22"), - // PublicPort: to.Ptr[int32](22), - // }}, - // UninstallScriptActions: []*armhdinsight.RuntimeScriptAction{ - // }, - // }, - // Tags: map[string]*string{ - // "key1": to.Ptr("val1"), - // }, - // }, - // { - // Name: to.Ptr("app2"), - // Type: to.Ptr("Microsoft.HDInsight/clusters/applications"), - // ID: to.Ptr("/subscriptions/subId/resourceGroups/rg1/providers/Microsoft.HDInsight/clusters/cluster1/applications/app2"), - // Etag: to.Ptr("2C128F8E-BB26-4637-99E4-18EBC39FD51F"), - // Properties: &armhdinsight.ApplicationProperties{ - // ApplicationState: to.Ptr("AzureVMConfiguration"), - // ApplicationType: to.Ptr("CustomApplication"), - // ComputeProfile: &armhdinsight.ComputeProfile{ - // Roles: []*armhdinsight.Role{ - // { - // Name: to.Ptr("edgenode"), - // HardwareProfile: &armhdinsight.HardwareProfile{ - // VMSize: to.Ptr("Standard_D3"), - // }, - // TargetInstanceCount: to.Ptr[int32](1), - // }}, - // }, - // CreatedDate: to.Ptr("2017-03-28T02:01:25.107"), - // HTTPSEndpoints: []*armhdinsight.ApplicationGetHTTPSEndpoint{ - // { - // AccessModes: []*string{ - // to.Ptr("WebPage")}, - // DestinationPort: to.Ptr[int32](18630), - // Location: to.Ptr("location"), - // PublicPort: to.Ptr[int32](443), - // }}, - // InstallScriptActions: []*armhdinsight.RuntimeScriptAction{ - // { - // Name: to.Ptr("app2-Install"), - // Roles: []*string{ - // to.Ptr("edgenode")}, - // URI: to.Ptr("https://app2url.com/azure/2.4.0.0/app2_install.sh"), - // }}, - // MarketplaceIdentifier: to.Ptr("app2-hdinsightsmall.1.0.8"), - // ProvisioningState: to.Ptr("Succeeded"), - // SSHEndpoints: []*armhdinsight.ApplicationGetEndpoint{ - // }, - // UninstallScriptActions: []*armhdinsight.RuntimeScriptAction{ - // }, - // }, - // Tags: map[string]*string{ - // "key1": to.Ptr("val1"), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7a2ac91de424f271cf91cc8009f3fe9ee8249086/specification/hdinsight/resource-manager/Microsoft.HDInsight/stable/2021-06-01/examples/GetApplicationInProgress.json -func ExampleApplicationsClient_Get_getApplicationOnHdInsightClusterCreationInProgress() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armhdinsight.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewApplicationsClient().Get(ctx, "rg1", "cluster1", "app", 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.Application = armhdinsight.Application{ - // Name: to.Ptr("app"), - // Type: to.Ptr("Microsoft.HDInsight/clusters/applications"), - // ID: to.Ptr("/subscriptions/subId/resourceGroups/rg1/providers/Microsoft.HDInsight/clusters/cluster1/applications/app"), - // Etag: to.Ptr("2C128F8E-BB26-4637-99E4-18EBC39FD51F"), - // Properties: &armhdinsight.ApplicationProperties{ - // ApplicationState: to.Ptr("AzureVMConfiguration"), - // ApplicationType: to.Ptr("CustomApplication"), - // ComputeProfile: &armhdinsight.ComputeProfile{ - // Roles: []*armhdinsight.Role{ - // { - // Name: to.Ptr("edgenode"), - // HardwareProfile: &armhdinsight.HardwareProfile{ - // VMSize: to.Ptr("Standard_D3"), - // }, - // TargetInstanceCount: to.Ptr[int32](1), - // }}, - // }, - // CreatedDate: to.Ptr("2017-03-28T02:01:25.107"), - // HTTPSEndpoints: []*armhdinsight.ApplicationGetHTTPSEndpoint{ - // { - // AccessModes: []*string{ - // to.Ptr("WebPage")}, - // DestinationPort: to.Ptr[int32](18630), - // Location: to.Ptr("location"), - // PublicPort: to.Ptr[int32](443), - // }}, - // InstallScriptActions: []*armhdinsight.RuntimeScriptAction{ - // { - // Name: to.Ptr("app-Install"), - // Roles: []*string{ - // to.Ptr("edgenode")}, - // URI: to.Ptr("https://app.com/azure/app_install.sh"), - // }}, - // MarketplaceIdentifier: to.Ptr("id"), - // ProvisioningState: to.Ptr("Succeeded"), - // SSHEndpoints: []*armhdinsight.ApplicationGetEndpoint{ - // }, - // UninstallScriptActions: []*armhdinsight.RuntimeScriptAction{ - // }, - // }, - // Tags: map[string]*string{ - // "key1": to.Ptr("val1"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7a2ac91de424f271cf91cc8009f3fe9ee8249086/specification/hdinsight/resource-manager/Microsoft.HDInsight/stable/2021-06-01/examples/GetApplicationCreated.json -func ExampleApplicationsClient_Get_getApplicationOnHdInsightClusterSuccessfullyCreated() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armhdinsight.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewApplicationsClient().Get(ctx, "rg1", "cluster1", "app", 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.Application = armhdinsight.Application{ - // Name: to.Ptr("app"), - // Type: to.Ptr("Microsoft.HDInsight/clusters/applications"), - // ID: to.Ptr("/subscriptions/subId/resourceGroups/rg1/providers/Microsoft.HDInsight/clusters/cluster1/applications/app"), - // Etag: to.Ptr("CF938302-6B4D-44A0-A6D2-C0D67E847AEC"), - // Properties: &armhdinsight.ApplicationProperties{ - // ApplicationState: to.Ptr("Running"), - // ApplicationType: to.Ptr("CustomApplication"), - // ComputeProfile: &armhdinsight.ComputeProfile{ - // Roles: []*armhdinsight.Role{ - // { - // Name: to.Ptr("edgenode"), - // HardwareProfile: &armhdinsight.HardwareProfile{ - // VMSize: to.Ptr("Standard_D12_v2"), - // }, - // TargetInstanceCount: to.Ptr[int32](1), - // }}, - // }, - // CreatedDate: to.Ptr("2017-03-22T21:34:39.293"), - // HTTPSEndpoints: []*armhdinsight.ApplicationGetHTTPSEndpoint{ - // { - // AccessModes: []*string{ - // to.Ptr("WebPage")}, - // DestinationPort: to.Ptr[int32](20000), - // Location: to.Ptr("https://cluster1.apps.azurehdinsight.net:443"), - // PublicPort: to.Ptr[int32](443), - // }}, - // InstallScriptActions: []*armhdinsight.RuntimeScriptAction{ - // { - // Name: to.Ptr("app-install"), - // Roles: []*string{ - // to.Ptr("edgenode")}, - // URI: to.Ptr("http://app.com/public/hdi-app/20170301/app-install.sh"), - // }}, - // MarketplaceIdentifier: to.Ptr("appMarketId"), - // ProvisioningState: to.Ptr("Succeeded"), - // SSHEndpoints: []*armhdinsight.ApplicationGetEndpoint{ - // { - // DestinationPort: to.Ptr[int32](22), - // Location: to.Ptr("cluster1-ssh.azurehdinsight.net:22"), - // PublicPort: to.Ptr[int32](22), - // }}, - // UninstallScriptActions: []*armhdinsight.RuntimeScriptAction{ - // }, - // }, - // Tags: map[string]*string{ - // "key1": to.Ptr("val1"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7a2ac91de424f271cf91cc8009f3fe9ee8249086/specification/hdinsight/resource-manager/Microsoft.HDInsight/stable/2021-06-01/examples/CreateApplication.json -func ExampleApplicationsClient_BeginCreate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armhdinsight.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewApplicationsClient().BeginCreate(ctx, "rg1", "cluster1", "hue", armhdinsight.Application{ - Properties: &armhdinsight.ApplicationProperties{ - ApplicationType: to.Ptr("CustomApplication"), - ComputeProfile: &armhdinsight.ComputeProfile{ - Roles: []*armhdinsight.Role{ - { - Name: to.Ptr("edgenode"), - HardwareProfile: &armhdinsight.HardwareProfile{ - VMSize: to.Ptr("Standard_D12_v2"), - }, - TargetInstanceCount: to.Ptr[int32](1), - }}, - }, - Errors: []*armhdinsight.Errors{}, - HTTPSEndpoints: []*armhdinsight.ApplicationGetHTTPSEndpoint{ - { - AccessModes: []*string{ - to.Ptr("WebPage")}, - DestinationPort: to.Ptr[int32](20000), - SubDomainSuffix: to.Ptr("dss"), - }}, - InstallScriptActions: []*armhdinsight.RuntimeScriptAction{ - { - Name: to.Ptr("app-install-app1"), - Parameters: to.Ptr("-version latest -port 20000"), - Roles: []*string{ - to.Ptr("edgenode")}, - URI: to.Ptr("https://.../install.sh"), - }}, - UninstallScriptActions: []*armhdinsight.RuntimeScriptAction{}, - }, - }, 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.Application = armhdinsight.Application{ - // Name: to.Ptr("hue"), - // Type: to.Ptr("Microsoft.HDInsight/clusters/applications"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.HDInsight/clusters/cluster1/applications/hue"), - // Etag: to.Ptr("etag"), - // Properties: &armhdinsight.ApplicationProperties{ - // ApplicationState: to.Ptr("ApplicationConfiguration"), - // ApplicationType: to.Ptr("CustomApplication"), - // ComputeProfile: &armhdinsight.ComputeProfile{ - // Roles: []*armhdinsight.Role{ - // { - // Name: to.Ptr("edgenode"), - // HardwareProfile: &armhdinsight.HardwareProfile{ - // VMSize: to.Ptr("Standard_D12_v2"), - // }, - // TargetInstanceCount: to.Ptr[int32](1), - // }}, - // }, - // CreatedDate: to.Ptr("2017-02-28"), - // Errors: []*armhdinsight.Errors{ - // }, - // HTTPSEndpoints: []*armhdinsight.ApplicationGetHTTPSEndpoint{ - // { - // AccessModes: []*string{ - // to.Ptr("WebPage")}, - // DestinationPort: to.Ptr[int32](20000), - // }}, - // InstallScriptActions: []*armhdinsight.RuntimeScriptAction{ - // { - // Name: to.Ptr("app-install-app1"), - // Roles: []*string{ - // to.Ptr("edgenode")}, - // URI: to.Ptr("https://.../install.sh"), - // }}, - // ProvisioningState: to.Ptr("Succeeded"), - // SSHEndpoints: []*armhdinsight.ApplicationGetEndpoint{ - // }, - // UninstallScriptActions: []*armhdinsight.RuntimeScriptAction{ - // }, - // }, - // Tags: map[string]*string{ - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7a2ac91de424f271cf91cc8009f3fe9ee8249086/specification/hdinsight/resource-manager/Microsoft.HDInsight/stable/2021-06-01/examples/DeleteApplication.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 := armhdinsight.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewApplicationsClient().BeginDelete(ctx, "rg1", "cluster1", "hue", 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/7a2ac91de424f271cf91cc8009f3fe9ee8249086/specification/hdinsight/resource-manager/Microsoft.HDInsight/stable/2021-06-01/examples/GetApplicationCreationAsyncOperationStatus.json -func ExampleApplicationsClient_GetAzureAsyncOperationStatus() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armhdinsight.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewApplicationsClient().GetAzureAsyncOperationStatus(ctx, "rg1", "cluster1", "app", "CF938302-6B4D-44A0-A6D2-C0D67E847AEC", 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.AsyncOperationResult = armhdinsight.AsyncOperationResult{ - // Status: to.Ptr(armhdinsight.AsyncOperationStateInProgress), - // } -} diff --git a/sdk/resourcemanager/hdinsight/armhdinsight/autorest.md b/sdk/resourcemanager/hdinsight/armhdinsight/autorest.md index facedca77f1d..ec9e67468e39 100644 --- a/sdk/resourcemanager/hdinsight/armhdinsight/autorest.md +++ b/sdk/resourcemanager/hdinsight/armhdinsight/autorest.md @@ -5,10 +5,10 @@ ``` yaml azure-arm: true require: -- https://github.com/Azure/azure-rest-api-specs/blob/7a2ac91de424f271cf91cc8009f3fe9ee8249086/specification/hdinsight/resource-manager/readme.md -- https://github.com/Azure/azure-rest-api-specs/blob/7a2ac91de424f271cf91cc8009f3fe9ee8249086/specification/hdinsight/resource-manager/readme.go.md +- /mnt/vss/_work/1/s/azure-rest-api-specs/specification/hdinsight/resource-manager/readme.md +- /mnt/vss/_work/1/s/azure-rest-api-specs/specification/hdinsight/resource-manager/readme.go.md license-header: MICROSOFT_MIT_NO_VERSION -module-version: 1.1.1 +module-version: 1.2.0-beta.1 directive: - from: cluster.json where: $.definitions.Resource diff --git a/sdk/resourcemanager/hdinsight/armhdinsight/client_factory.go b/sdk/resourcemanager/hdinsight/armhdinsight/client_factory.go index 6927254bff70..4702e9a71817 100644 --- a/sdk/resourcemanager/hdinsight/armhdinsight/client_factory.go +++ b/sdk/resourcemanager/hdinsight/armhdinsight/client_factory.go @@ -39,18 +39,13 @@ func NewClientFactory(subscriptionID string, credential azcore.TokenCredential, }, nil } -func (c *ClientFactory) NewClustersClient() *ClustersClient { - subClient, _ := NewClustersClient(c.subscriptionID, c.credential, c.options) - return subClient -} - func (c *ClientFactory) NewApplicationsClient() *ApplicationsClient { subClient, _ := NewApplicationsClient(c.subscriptionID, c.credential, c.options) return subClient } -func (c *ClientFactory) NewLocationsClient() *LocationsClient { - subClient, _ := NewLocationsClient(c.subscriptionID, c.credential, c.options) +func (c *ClientFactory) NewClustersClient() *ClustersClient { + subClient, _ := NewClustersClient(c.subscriptionID, c.credential, c.options) return subClient } @@ -64,13 +59,8 @@ func (c *ClientFactory) NewExtensionsClient() *ExtensionsClient { return subClient } -func (c *ClientFactory) NewScriptActionsClient() *ScriptActionsClient { - subClient, _ := NewScriptActionsClient(c.subscriptionID, c.credential, c.options) - return subClient -} - -func (c *ClientFactory) NewScriptExecutionHistoryClient() *ScriptExecutionHistoryClient { - subClient, _ := NewScriptExecutionHistoryClient(c.subscriptionID, c.credential, c.options) +func (c *ClientFactory) NewLocationsClient() *LocationsClient { + subClient, _ := NewLocationsClient(c.subscriptionID, c.credential, c.options) return subClient } @@ -79,11 +69,6 @@ func (c *ClientFactory) NewOperationsClient() *OperationsClient { return subClient } -func (c *ClientFactory) NewVirtualMachinesClient() *VirtualMachinesClient { - subClient, _ := NewVirtualMachinesClient(c.subscriptionID, c.credential, c.options) - return subClient -} - func (c *ClientFactory) NewPrivateEndpointConnectionsClient() *PrivateEndpointConnectionsClient { subClient, _ := NewPrivateEndpointConnectionsClient(c.subscriptionID, c.credential, c.options) return subClient @@ -93,3 +78,18 @@ func (c *ClientFactory) NewPrivateLinkResourcesClient() *PrivateLinkResourcesCli subClient, _ := NewPrivateLinkResourcesClient(c.subscriptionID, c.credential, c.options) return subClient } + +func (c *ClientFactory) NewScriptActionsClient() *ScriptActionsClient { + subClient, _ := NewScriptActionsClient(c.subscriptionID, c.credential, c.options) + return subClient +} + +func (c *ClientFactory) NewScriptExecutionHistoryClient() *ScriptExecutionHistoryClient { + subClient, _ := NewScriptExecutionHistoryClient(c.subscriptionID, c.credential, c.options) + return subClient +} + +func (c *ClientFactory) NewVirtualMachinesClient() *VirtualMachinesClient { + subClient, _ := NewVirtualMachinesClient(c.subscriptionID, c.credential, c.options) + return subClient +} diff --git a/sdk/resourcemanager/hdinsight/armhdinsight/clusters_client.go b/sdk/resourcemanager/hdinsight/armhdinsight/clusters_client.go index 74ba10cb9a66..7a135702d7f0 100644 --- a/sdk/resourcemanager/hdinsight/armhdinsight/clusters_client.go +++ b/sdk/resourcemanager/hdinsight/armhdinsight/clusters_client.go @@ -48,7 +48,7 @@ func NewClustersClient(subscriptionID string, credential azcore.TokenCredential, // BeginCreate - Creates a new HDInsight cluster with the specified parameters. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2021-06-01 +// Generated from API version 2023-04-15-preview // - resourceGroupName - The name of the resource group. // - clusterName - The name of the cluster. // - parameters - The cluster create request. @@ -70,7 +70,7 @@ func (client *ClustersClient) BeginCreate(ctx context.Context, resourceGroupName // Create - Creates a new HDInsight cluster with the specified parameters. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2021-06-01 +// Generated from API version 2023-04-15-preview func (client *ClustersClient) create(ctx context.Context, resourceGroupName string, clusterName string, parameters ClusterCreateParametersExtended, options *ClustersClientBeginCreateOptions) (*http.Response, error) { req, err := client.createCreateRequest(ctx, resourceGroupName, clusterName, parameters, options) if err != nil { @@ -106,7 +106,7 @@ func (client *ClustersClient) createCreateRequest(ctx context.Context, resourceG return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-06-01") + reqQP.Set("api-version", "2023-04-15-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, parameters) @@ -115,7 +115,7 @@ func (client *ClustersClient) createCreateRequest(ctx context.Context, resourceG // BeginDelete - Deletes the specified HDInsight cluster. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2021-06-01 +// Generated from API version 2023-04-15-preview // - resourceGroupName - The name of the resource group. // - clusterName - The name of the cluster. // - options - ClustersClientBeginDeleteOptions contains the optional parameters for the ClustersClient.BeginDelete method. @@ -136,7 +136,7 @@ func (client *ClustersClient) BeginDelete(ctx context.Context, resourceGroupName // Delete - Deletes the specified HDInsight cluster. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2021-06-01 +// Generated from API version 2023-04-15-preview func (client *ClustersClient) deleteOperation(ctx context.Context, resourceGroupName string, clusterName string, options *ClustersClientBeginDeleteOptions) (*http.Response, error) { req, err := client.deleteCreateRequest(ctx, resourceGroupName, clusterName, options) if err != nil { @@ -172,7 +172,7 @@ func (client *ClustersClient) deleteCreateRequest(ctx context.Context, resourceG return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-06-01") + reqQP.Set("api-version", "2023-04-15-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -181,7 +181,7 @@ func (client *ClustersClient) deleteCreateRequest(ctx context.Context, resourceG // BeginExecuteScriptActions - Executes script actions on the specified HDInsight cluster. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2021-06-01 +// Generated from API version 2023-04-15-preview // - resourceGroupName - The name of the resource group. // - clusterName - The name of the cluster. // - parameters - The parameters for executing script actions. @@ -204,7 +204,7 @@ func (client *ClustersClient) BeginExecuteScriptActions(ctx context.Context, res // ExecuteScriptActions - Executes script actions on the specified HDInsight cluster. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2021-06-01 +// Generated from API version 2023-04-15-preview func (client *ClustersClient) executeScriptActions(ctx context.Context, resourceGroupName string, clusterName string, parameters ExecuteScriptActionParameters, options *ClustersClientBeginExecuteScriptActionsOptions) (*http.Response, error) { req, err := client.executeScriptActionsCreateRequest(ctx, resourceGroupName, clusterName, parameters, options) if err != nil { @@ -240,7 +240,7 @@ func (client *ClustersClient) executeScriptActionsCreateRequest(ctx context.Cont return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-06-01") + reqQP.Set("api-version", "2023-04-15-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, parameters) @@ -249,7 +249,7 @@ func (client *ClustersClient) executeScriptActionsCreateRequest(ctx context.Cont // Get - Gets the specified cluster. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2021-06-01 +// Generated from API version 2023-04-15-preview // - resourceGroupName - The name of the resource group. // - clusterName - The name of the cluster. // - options - ClustersClientGetOptions contains the optional parameters for the ClustersClient.Get method. @@ -288,7 +288,7 @@ func (client *ClustersClient) getCreateRequest(ctx context.Context, resourceGrou return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-06-01") + reqQP.Set("api-version", "2023-04-15-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -306,7 +306,7 @@ func (client *ClustersClient) getHandleResponse(resp *http.Response) (ClustersCl // GetAzureAsyncOperationStatus - The the async operation status. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2021-06-01 +// Generated from API version 2023-04-15-preview // - resourceGroupName - The name of the resource group. // - clusterName - The name of the cluster. // - operationID - The long running operation id. @@ -351,7 +351,7 @@ func (client *ClustersClient) getAzureAsyncOperationStatusCreateRequest(ctx cont return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-06-01") + reqQP.Set("api-version", "2023-04-15-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -369,7 +369,7 @@ func (client *ClustersClient) getAzureAsyncOperationStatusHandleResponse(resp *h // GetGatewaySettings - Gets the gateway settings for the specified cluster. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2021-06-01 +// Generated from API version 2023-04-15-preview // - resourceGroupName - The name of the resource group. // - clusterName - The name of the cluster. // - options - ClustersClientGetGatewaySettingsOptions contains the optional parameters for the ClustersClient.GetGatewaySettings @@ -409,7 +409,7 @@ func (client *ClustersClient) getGatewaySettingsCreateRequest(ctx context.Contex return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-06-01") + reqQP.Set("api-version", "2023-04-15-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -426,7 +426,7 @@ func (client *ClustersClient) getGatewaySettingsHandleResponse(resp *http.Respon // NewListPager - Lists all the HDInsight clusters under the subscription. // -// Generated from API version 2021-06-01 +// Generated from API version 2023-04-15-preview // - options - ClustersClientListOptions contains the optional parameters for the ClustersClient.NewListPager method. func (client *ClustersClient) NewListPager(options *ClustersClientListOptions) *runtime.Pager[ClustersClientListResponse] { return runtime.NewPager(runtime.PagingHandler[ClustersClientListResponse]{ @@ -468,7 +468,7 @@ func (client *ClustersClient) listCreateRequest(ctx context.Context, options *Cl return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-06-01") + reqQP.Set("api-version", "2023-04-15-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -485,7 +485,7 @@ func (client *ClustersClient) listHandleResponse(resp *http.Response) (ClustersC // NewListByResourceGroupPager - Lists the HDInsight clusters in a resource group. // -// Generated from API version 2021-06-01 +// Generated from API version 2023-04-15-preview // - resourceGroupName - The name of the resource group. // - options - ClustersClientListByResourceGroupOptions contains the optional parameters for the ClustersClient.NewListByResourceGroupPager // method. @@ -533,7 +533,7 @@ func (client *ClustersClient) listByResourceGroupCreateRequest(ctx context.Conte return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-06-01") + reqQP.Set("api-version", "2023-04-15-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -551,7 +551,7 @@ func (client *ClustersClient) listByResourceGroupHandleResponse(resp *http.Respo // BeginResize - Resizes the specified HDInsight cluster to the specified size. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2021-06-01 +// Generated from API version 2023-04-15-preview // - resourceGroupName - The name of the resource group. // - clusterName - The name of the cluster. // - roleName - The constant value for the roleName @@ -574,7 +574,7 @@ func (client *ClustersClient) BeginResize(ctx context.Context, resourceGroupName // Resize - Resizes the specified HDInsight cluster to the specified size. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2021-06-01 +// Generated from API version 2023-04-15-preview func (client *ClustersClient) resize(ctx context.Context, resourceGroupName string, clusterName string, roleName RoleName, parameters ClusterResizeParameters, options *ClustersClientBeginResizeOptions) (*http.Response, error) { req, err := client.resizeCreateRequest(ctx, resourceGroupName, clusterName, roleName, parameters, options) if err != nil { @@ -614,7 +614,7 @@ func (client *ClustersClient) resizeCreateRequest(ctx context.Context, resourceG return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-06-01") + reqQP.Set("api-version", "2023-04-15-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, parameters) @@ -623,7 +623,7 @@ func (client *ClustersClient) resizeCreateRequest(ctx context.Context, resourceG // BeginRotateDiskEncryptionKey - Rotate disk encryption key of the specified HDInsight cluster. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2021-06-01 +// Generated from API version 2023-04-15-preview // - resourceGroupName - The name of the resource group. // - clusterName - The name of the cluster. // - parameters - The parameters for the disk encryption operation. @@ -646,7 +646,7 @@ func (client *ClustersClient) BeginRotateDiskEncryptionKey(ctx context.Context, // RotateDiskEncryptionKey - Rotate disk encryption key of the specified HDInsight cluster. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2021-06-01 +// Generated from API version 2023-04-15-preview func (client *ClustersClient) rotateDiskEncryptionKey(ctx context.Context, resourceGroupName string, clusterName string, parameters ClusterDiskEncryptionParameters, options *ClustersClientBeginRotateDiskEncryptionKeyOptions) (*http.Response, error) { req, err := client.rotateDiskEncryptionKeyCreateRequest(ctx, resourceGroupName, clusterName, parameters, options) if err != nil { @@ -682,7 +682,7 @@ func (client *ClustersClient) rotateDiskEncryptionKeyCreateRequest(ctx context.C return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-06-01") + reqQP.Set("api-version", "2023-04-15-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, parameters) @@ -691,7 +691,7 @@ func (client *ClustersClient) rotateDiskEncryptionKeyCreateRequest(ctx context.C // Update - Patch HDInsight cluster with the specified parameters. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2021-06-01 +// Generated from API version 2023-04-15-preview // - resourceGroupName - The name of the resource group. // - clusterName - The name of the cluster. // - parameters - The cluster patch request. @@ -731,7 +731,7 @@ func (client *ClustersClient) updateCreateRequest(ctx context.Context, resourceG return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-06-01") + reqQP.Set("api-version", "2023-04-15-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, parameters) @@ -749,7 +749,7 @@ func (client *ClustersClient) updateHandleResponse(resp *http.Response) (Cluster // BeginUpdateAutoScaleConfiguration - Updates the Autoscale Configuration for HDInsight cluster. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2021-06-01 +// Generated from API version 2023-04-15-preview // - resourceGroupName - The name of the resource group. // - clusterName - The name of the cluster. // - roleName - The constant value for the roleName @@ -773,7 +773,7 @@ func (client *ClustersClient) BeginUpdateAutoScaleConfiguration(ctx context.Cont // UpdateAutoScaleConfiguration - Updates the Autoscale Configuration for HDInsight cluster. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2021-06-01 +// Generated from API version 2023-04-15-preview func (client *ClustersClient) updateAutoScaleConfiguration(ctx context.Context, resourceGroupName string, clusterName string, roleName RoleName, parameters AutoscaleConfigurationUpdateParameter, options *ClustersClientBeginUpdateAutoScaleConfigurationOptions) (*http.Response, error) { req, err := client.updateAutoScaleConfigurationCreateRequest(ctx, resourceGroupName, clusterName, roleName, parameters, options) if err != nil { @@ -813,7 +813,7 @@ func (client *ClustersClient) updateAutoScaleConfigurationCreateRequest(ctx cont return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-06-01") + reqQP.Set("api-version", "2023-04-15-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, parameters) @@ -822,7 +822,7 @@ func (client *ClustersClient) updateAutoScaleConfigurationCreateRequest(ctx cont // BeginUpdateGatewaySettings - Configures the gateway settings on the specified cluster. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2021-06-01 +// Generated from API version 2023-04-15-preview // - resourceGroupName - The name of the resource group. // - clusterName - The name of the cluster. // - parameters - The cluster configurations. @@ -845,7 +845,7 @@ func (client *ClustersClient) BeginUpdateGatewaySettings(ctx context.Context, re // UpdateGatewaySettings - Configures the gateway settings on the specified cluster. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2021-06-01 +// Generated from API version 2023-04-15-preview func (client *ClustersClient) updateGatewaySettings(ctx context.Context, resourceGroupName string, clusterName string, parameters UpdateGatewaySettingsParameters, options *ClustersClientBeginUpdateGatewaySettingsOptions) (*http.Response, error) { req, err := client.updateGatewaySettingsCreateRequest(ctx, resourceGroupName, clusterName, parameters, options) if err != nil { @@ -881,7 +881,7 @@ func (client *ClustersClient) updateGatewaySettingsCreateRequest(ctx context.Con return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-06-01") + reqQP.Set("api-version", "2023-04-15-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, parameters) @@ -890,7 +890,7 @@ func (client *ClustersClient) updateGatewaySettingsCreateRequest(ctx context.Con // BeginUpdateIdentityCertificate - Updates the cluster identity certificate. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2021-06-01 +// Generated from API version 2023-04-15-preview // - resourceGroupName - The name of the resource group. // - clusterName - The name of the cluster. // - parameters - The cluster configurations. @@ -913,7 +913,7 @@ func (client *ClustersClient) BeginUpdateIdentityCertificate(ctx context.Context // UpdateIdentityCertificate - Updates the cluster identity certificate. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2021-06-01 +// Generated from API version 2023-04-15-preview func (client *ClustersClient) updateIdentityCertificate(ctx context.Context, resourceGroupName string, clusterName string, parameters UpdateClusterIdentityCertificateParameters, options *ClustersClientBeginUpdateIdentityCertificateOptions) (*http.Response, error) { req, err := client.updateIdentityCertificateCreateRequest(ctx, resourceGroupName, clusterName, parameters, options) if err != nil { @@ -949,7 +949,7 @@ func (client *ClustersClient) updateIdentityCertificateCreateRequest(ctx context return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-06-01") + reqQP.Set("api-version", "2023-04-15-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, parameters) diff --git a/sdk/resourcemanager/hdinsight/armhdinsight/clusters_client_example_test.go b/sdk/resourcemanager/hdinsight/armhdinsight/clusters_client_example_test.go deleted file mode 100644 index 0fe117311760..000000000000 --- a/sdk/resourcemanager/hdinsight/armhdinsight/clusters_client_example_test.go +++ /dev/null @@ -1,3322 +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 armhdinsight_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/hdinsight/armhdinsight" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7a2ac91de424f271cf91cc8009f3fe9ee8249086/specification/hdinsight/resource-manager/Microsoft.HDInsight/stable/2021-06-01/examples/CreateHDInsightClusterWithAutoscaleConfig.json -func ExampleClustersClient_BeginCreate_createHdInsightClusterWithAutoscaleConfiguration() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armhdinsight.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewClustersClient().BeginCreate(ctx, "rg1", "cluster1", armhdinsight.ClusterCreateParametersExtended{ - Properties: &armhdinsight.ClusterCreateProperties{ - ClusterDefinition: &armhdinsight.ClusterDefinition{ - ComponentVersion: map[string]*string{ - "Hadoop": to.Ptr("2.7"), - }, - Configurations: map[string]any{ - "gateway": map[string]any{ - "restAuthCredential.isEnabled": true, - "restAuthCredential.password": "**********", - "restAuthCredential.username": "admin", - }, - }, - Kind: to.Ptr("hadoop"), - }, - ClusterVersion: to.Ptr("3.6"), - ComputeProfile: &armhdinsight.ComputeProfile{ - Roles: []*armhdinsight.Role{ - { - Name: to.Ptr("workernode"), - AutoscaleConfiguration: &armhdinsight.Autoscale{ - Recurrence: &armhdinsight.AutoscaleRecurrence{ - Schedule: []*armhdinsight.AutoscaleSchedule{ - { - Days: []*armhdinsight.DaysOfWeek{ - to.Ptr(armhdinsight.DaysOfWeekMonday), - to.Ptr(armhdinsight.DaysOfWeekTuesday), - to.Ptr(armhdinsight.DaysOfWeekWednesday), - to.Ptr(armhdinsight.DaysOfWeekThursday), - to.Ptr(armhdinsight.DaysOfWeekFriday)}, - TimeAndCapacity: &armhdinsight.AutoscaleTimeAndCapacity{ - MaxInstanceCount: to.Ptr[int32](3), - MinInstanceCount: to.Ptr[int32](3), - Time: to.Ptr("09:00"), - }, - }, - { - Days: []*armhdinsight.DaysOfWeek{ - to.Ptr(armhdinsight.DaysOfWeekMonday), - to.Ptr(armhdinsight.DaysOfWeekTuesday), - to.Ptr(armhdinsight.DaysOfWeekWednesday), - to.Ptr(armhdinsight.DaysOfWeekThursday), - to.Ptr(armhdinsight.DaysOfWeekFriday)}, - TimeAndCapacity: &armhdinsight.AutoscaleTimeAndCapacity{ - MaxInstanceCount: to.Ptr[int32](6), - MinInstanceCount: to.Ptr[int32](6), - Time: to.Ptr("18:00"), - }, - }, - { - Days: []*armhdinsight.DaysOfWeek{ - to.Ptr(armhdinsight.DaysOfWeekSaturday), - to.Ptr(armhdinsight.DaysOfWeekSunday)}, - TimeAndCapacity: &armhdinsight.AutoscaleTimeAndCapacity{ - MaxInstanceCount: to.Ptr[int32](2), - MinInstanceCount: to.Ptr[int32](2), - Time: to.Ptr("09:00"), - }, - }, - { - Days: []*armhdinsight.DaysOfWeek{ - to.Ptr(armhdinsight.DaysOfWeekSaturday), - to.Ptr(armhdinsight.DaysOfWeekSunday)}, - TimeAndCapacity: &armhdinsight.AutoscaleTimeAndCapacity{ - MaxInstanceCount: to.Ptr[int32](4), - MinInstanceCount: to.Ptr[int32](4), - Time: to.Ptr("18:00"), - }, - }}, - TimeZone: to.Ptr("China Standard Time"), - }, - }, - HardwareProfile: &armhdinsight.HardwareProfile{ - VMSize: to.Ptr("Standard_D4_V2"), - }, - OSProfile: &armhdinsight.OsProfile{ - LinuxOperatingSystemProfile: &armhdinsight.LinuxOperatingSystemProfile{ - Password: to.Ptr("**********"), - Username: to.Ptr("sshuser"), - }, - }, - ScriptActions: []*armhdinsight.ScriptAction{}, - TargetInstanceCount: to.Ptr[int32](4), - }}, - }, - OSType: to.Ptr(armhdinsight.OSTypeLinux), - StorageProfile: &armhdinsight.StorageProfile{ - Storageaccounts: []*armhdinsight.StorageAccount{ - { - Name: to.Ptr("mystorage.blob.core.windows.net"), - Container: to.Ptr("hdinsight-autoscale-tes-2019-06-18t05-49-16-591z"), - IsDefault: to.Ptr(true), - Key: to.Ptr("storagekey"), - }}, - }, - Tier: to.Ptr(armhdinsight.TierStandard), - }, - }, 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 = armhdinsight.Cluster{ - // Name: to.Ptr("cluster1"), - // Type: to.Ptr("Microsoft.HDInsight/clusters"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.HDInsight/clusters/cluster1"), - // Location: to.Ptr("East US"), - // Etag: to.Ptr("fdf2a6e8-ce83-42cc-8c2d-0ceb11a370ff"), - // Properties: &armhdinsight.ClusterGetProperties{ - // ClusterDefinition: &armhdinsight.ClusterDefinition{ - // Blueprint: to.Ptr("https://blueprints.azurehdinsight.net/hadoop-4.0.1000.1.1910270459.json"), - // ComponentVersion: map[string]*string{ - // "Hadoop": to.Ptr("3.1"), - // }, - // Kind: to.Ptr("HADOOP"), - // }, - // ClusterState: to.Ptr("Running"), - // ClusterVersion: to.Ptr("4.0.1000.1"), - // ComputeProfile: &armhdinsight.ComputeProfile{ - // Roles: []*armhdinsight.Role{ - // { - // Name: to.Ptr("headnode"), - // HardwareProfile: &armhdinsight.HardwareProfile{ - // VMSize: to.Ptr("standard_d12_v2"), - // }, - // OSProfile: &armhdinsight.OsProfile{ - // LinuxOperatingSystemProfile: &armhdinsight.LinuxOperatingSystemProfile{ - // Username: to.Ptr("sshuser"), - // }, - // }, - // TargetInstanceCount: to.Ptr[int32](2), - // }, - // { - // Name: to.Ptr("workernode"), - // HardwareProfile: &armhdinsight.HardwareProfile{ - // VMSize: to.Ptr("standard_d4_v2"), - // }, - // OSProfile: &armhdinsight.OsProfile{ - // LinuxOperatingSystemProfile: &armhdinsight.LinuxOperatingSystemProfile{ - // Username: to.Ptr("sshuser"), - // }, - // }, - // TargetInstanceCount: to.Ptr[int32](4), - // }, - // { - // Name: to.Ptr("zookeepernode"), - // HardwareProfile: &armhdinsight.HardwareProfile{ - // VMSize: to.Ptr("standard_a2_v2"), - // }, - // OSProfile: &armhdinsight.OsProfile{ - // LinuxOperatingSystemProfile: &armhdinsight.LinuxOperatingSystemProfile{ - // Username: to.Ptr("sshuser"), - // }, - // }, - // TargetInstanceCount: to.Ptr[int32](3), - // }}, - // }, - // ConnectivityEndpoints: []*armhdinsight.ConnectivityEndpoint{ - // { - // Name: to.Ptr("SSH"), - // Location: to.Ptr("cluster1-ssh.azurehdinsight.net"), - // Port: to.Ptr[int32](22), - // Protocol: to.Ptr("TCP"), - // }, - // { - // Name: to.Ptr("HTTPS"), - // Location: to.Ptr("cluster1.azurehdinsight.net"), - // Port: to.Ptr[int32](443), - // Protocol: to.Ptr("TCP"), - // }}, - // CreatedDate: to.Ptr("2019-11-18T12:25:43.48"), - // OSType: to.Ptr(armhdinsight.OSTypeLinux), - // ProvisioningState: to.Ptr(armhdinsight.HDInsightClusterProvisioningStateSucceeded), - // QuotaInfo: &armhdinsight.QuotaInfo{ - // CoresUsed: to.Ptr[int32](40), - // }, - // Tier: to.Ptr(armhdinsight.TierStandard), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7a2ac91de424f271cf91cc8009f3fe9ee8249086/specification/hdinsight/resource-manager/Microsoft.HDInsight/stable/2021-06-01/examples/CreateLinuxHadoopAdlsGen2.json -func ExampleClustersClient_BeginCreate_createHadoopClusterWithAzureDataLakeStorageGen2() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armhdinsight.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewClustersClient().BeginCreate(ctx, "rg1", "cluster1", armhdinsight.ClusterCreateParametersExtended{ - Properties: &armhdinsight.ClusterCreateProperties{ - ClusterDefinition: &armhdinsight.ClusterDefinition{ - Configurations: map[string]any{ - "gateway": map[string]any{ - "restAuthCredential.isEnabled": "true", - "restAuthCredential.password": "**********", - "restAuthCredential.username": "admin", - }, - }, - Kind: to.Ptr("Hadoop"), - }, - ClusterVersion: to.Ptr("3.6"), - ComputeProfile: &armhdinsight.ComputeProfile{ - Roles: []*armhdinsight.Role{ - { - Name: to.Ptr("headnode"), - HardwareProfile: &armhdinsight.HardwareProfile{ - VMSize: to.Ptr("Standard_D3_V2"), - }, - MinInstanceCount: to.Ptr[int32](1), - OSProfile: &armhdinsight.OsProfile{ - LinuxOperatingSystemProfile: &armhdinsight.LinuxOperatingSystemProfile{ - Password: to.Ptr("**********"), - Username: to.Ptr("sshuser"), - }, - }, - TargetInstanceCount: to.Ptr[int32](2), - }, - { - Name: to.Ptr("workernode"), - HardwareProfile: &armhdinsight.HardwareProfile{ - VMSize: to.Ptr("Standard_D3_V2"), - }, - MinInstanceCount: to.Ptr[int32](1), - OSProfile: &armhdinsight.OsProfile{ - LinuxOperatingSystemProfile: &armhdinsight.LinuxOperatingSystemProfile{ - Password: to.Ptr("**********"), - Username: to.Ptr("sshuser"), - }, - }, - TargetInstanceCount: to.Ptr[int32](4), - }, - { - Name: to.Ptr("zookeepernode"), - HardwareProfile: &armhdinsight.HardwareProfile{ - VMSize: to.Ptr("Small"), - }, - MinInstanceCount: to.Ptr[int32](1), - OSProfile: &armhdinsight.OsProfile{ - LinuxOperatingSystemProfile: &armhdinsight.LinuxOperatingSystemProfile{ - Password: to.Ptr("**********"), - Username: to.Ptr("sshuser"), - }, - }, - TargetInstanceCount: to.Ptr[int32](3), - }}, - }, - OSType: to.Ptr(armhdinsight.OSTypeLinux), - StorageProfile: &armhdinsight.StorageProfile{ - Storageaccounts: []*armhdinsight.StorageAccount{ - { - Name: to.Ptr("mystorage.dfs.core.windows.net"), - FileSystem: to.Ptr("default"), - IsDefault: to.Ptr(true), - Key: to.Ptr("storagekey"), - }}, - }, - Tier: to.Ptr(armhdinsight.TierStandard), - }, - Tags: map[string]*string{ - "key1": to.Ptr("val1"), - }, - }, 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 = armhdinsight.Cluster{ - // Name: to.Ptr("cluster1"), - // Type: to.Ptr("Microsoft.HDInsight/clusters"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.HDInsight/clusters/cluster1"), - // Location: to.Ptr("East US"), - // Etag: to.Ptr("fdf2a6e8-ce83-42cc-8c2d-0ceb11a370ff"), - // Properties: &armhdinsight.ClusterGetProperties{ - // ClusterDefinition: &armhdinsight.ClusterDefinition{ - // Blueprint: to.Ptr("https://blueprints.azurehdinsight.net/hadoop-4.0.1000.1.1910270459.json"), - // ComponentVersion: map[string]*string{ - // "Hadoop": to.Ptr("3.1"), - // }, - // Kind: to.Ptr("HADOOP"), - // }, - // ClusterState: to.Ptr("Running"), - // ClusterVersion: to.Ptr("4.0.1000.1"), - // ComputeProfile: &armhdinsight.ComputeProfile{ - // Roles: []*armhdinsight.Role{ - // { - // Name: to.Ptr("headnode"), - // HardwareProfile: &armhdinsight.HardwareProfile{ - // VMSize: to.Ptr("standard_d12_v2"), - // }, - // OSProfile: &armhdinsight.OsProfile{ - // LinuxOperatingSystemProfile: &armhdinsight.LinuxOperatingSystemProfile{ - // Username: to.Ptr("sshuser"), - // }, - // }, - // TargetInstanceCount: to.Ptr[int32](2), - // }, - // { - // Name: to.Ptr("workernode"), - // HardwareProfile: &armhdinsight.HardwareProfile{ - // VMSize: to.Ptr("standard_d4_v2"), - // }, - // OSProfile: &armhdinsight.OsProfile{ - // LinuxOperatingSystemProfile: &armhdinsight.LinuxOperatingSystemProfile{ - // Username: to.Ptr("sshuser"), - // }, - // }, - // TargetInstanceCount: to.Ptr[int32](4), - // }, - // { - // Name: to.Ptr("zookeepernode"), - // HardwareProfile: &armhdinsight.HardwareProfile{ - // VMSize: to.Ptr("standard_a2_v2"), - // }, - // OSProfile: &armhdinsight.OsProfile{ - // LinuxOperatingSystemProfile: &armhdinsight.LinuxOperatingSystemProfile{ - // Username: to.Ptr("sshuser"), - // }, - // }, - // TargetInstanceCount: to.Ptr[int32](3), - // }}, - // }, - // ConnectivityEndpoints: []*armhdinsight.ConnectivityEndpoint{ - // { - // Name: to.Ptr("SSH"), - // Location: to.Ptr("cluster1-ssh.azurehdinsight.net"), - // Port: to.Ptr[int32](22), - // Protocol: to.Ptr("TCP"), - // }, - // { - // Name: to.Ptr("HTTPS"), - // Location: to.Ptr("cluster1.azurehdinsight.net"), - // Port: to.Ptr[int32](443), - // Protocol: to.Ptr("TCP"), - // }}, - // CreatedDate: to.Ptr("2019-11-18T12:25:43.48"), - // OSType: to.Ptr(armhdinsight.OSTypeLinux), - // ProvisioningState: to.Ptr(armhdinsight.HDInsightClusterProvisioningStateSucceeded), - // QuotaInfo: &armhdinsight.QuotaInfo{ - // CoresUsed: to.Ptr[int32](40), - // }, - // Tier: to.Ptr(armhdinsight.TierStandard), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7a2ac91de424f271cf91cc8009f3fe9ee8249086/specification/hdinsight/resource-manager/Microsoft.HDInsight/stable/2021-06-01/examples/CreateLinuxHadoopSshPassword.json -func ExampleClustersClient_BeginCreate_createHadoopOnLinuxClusterWithSshPassword() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armhdinsight.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewClustersClient().BeginCreate(ctx, "rg1", "cluster1", armhdinsight.ClusterCreateParametersExtended{ - Properties: &armhdinsight.ClusterCreateProperties{ - ClusterDefinition: &armhdinsight.ClusterDefinition{ - Configurations: map[string]any{ - "gateway": map[string]any{ - "restAuthCredential.isEnabled": "true", - "restAuthCredential.password": "**********", - "restAuthCredential.username": "admin", - }, - }, - Kind: to.Ptr("Hadoop"), - }, - ClusterVersion: to.Ptr("3.5"), - ComputeProfile: &armhdinsight.ComputeProfile{ - Roles: []*armhdinsight.Role{ - { - Name: to.Ptr("headnode"), - HardwareProfile: &armhdinsight.HardwareProfile{ - VMSize: to.Ptr("Standard_D3_V2"), - }, - MinInstanceCount: to.Ptr[int32](1), - OSProfile: &armhdinsight.OsProfile{ - LinuxOperatingSystemProfile: &armhdinsight.LinuxOperatingSystemProfile{ - Password: to.Ptr("**********"), - Username: to.Ptr("sshuser"), - }, - }, - TargetInstanceCount: to.Ptr[int32](2), - }, - { - Name: to.Ptr("workernode"), - HardwareProfile: &armhdinsight.HardwareProfile{ - VMSize: to.Ptr("Standard_D3_V2"), - }, - MinInstanceCount: to.Ptr[int32](1), - OSProfile: &armhdinsight.OsProfile{ - LinuxOperatingSystemProfile: &armhdinsight.LinuxOperatingSystemProfile{ - Password: to.Ptr("**********"), - Username: to.Ptr("sshuser"), - }, - }, - TargetInstanceCount: to.Ptr[int32](4), - }, - { - Name: to.Ptr("zookeepernode"), - HardwareProfile: &armhdinsight.HardwareProfile{ - VMSize: to.Ptr("Small"), - }, - MinInstanceCount: to.Ptr[int32](1), - OSProfile: &armhdinsight.OsProfile{ - LinuxOperatingSystemProfile: &armhdinsight.LinuxOperatingSystemProfile{ - Password: to.Ptr("**********"), - Username: to.Ptr("sshuser"), - }, - }, - TargetInstanceCount: to.Ptr[int32](3), - }}, - }, - OSType: to.Ptr(armhdinsight.OSTypeLinux), - StorageProfile: &armhdinsight.StorageProfile{ - Storageaccounts: []*armhdinsight.StorageAccount{ - { - Name: to.Ptr("mystorage.blob.core.windows.net"), - Container: to.Ptr("containername"), - IsDefault: to.Ptr(true), - Key: to.Ptr("storagekey"), - }}, - }, - Tier: to.Ptr(armhdinsight.TierStandard), - }, - Tags: map[string]*string{ - "key1": to.Ptr("val1"), - }, - }, 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 = armhdinsight.Cluster{ - // Name: to.Ptr("cluster1"), - // Type: to.Ptr("Microsoft.HDInsight/clusters"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.HDInsight/clusters/cluster1"), - // Location: to.Ptr("East US"), - // Etag: to.Ptr("fdf2a6e8-ce83-42cc-8c2d-0ceb11a370ff"), - // Properties: &armhdinsight.ClusterGetProperties{ - // ClusterDefinition: &armhdinsight.ClusterDefinition{ - // Blueprint: to.Ptr("https://blueprints.azurehdinsight.net/hadoop-4.0.1000.1.1910270459.json"), - // ComponentVersion: map[string]*string{ - // "Hadoop": to.Ptr("3.1"), - // }, - // Kind: to.Ptr("HADOOP"), - // }, - // ClusterState: to.Ptr("Running"), - // ClusterVersion: to.Ptr("4.0.1000.1"), - // ComputeProfile: &armhdinsight.ComputeProfile{ - // Roles: []*armhdinsight.Role{ - // { - // Name: to.Ptr("headnode"), - // HardwareProfile: &armhdinsight.HardwareProfile{ - // VMSize: to.Ptr("standard_d12_v2"), - // }, - // OSProfile: &armhdinsight.OsProfile{ - // LinuxOperatingSystemProfile: &armhdinsight.LinuxOperatingSystemProfile{ - // Username: to.Ptr("sshuser"), - // }, - // }, - // TargetInstanceCount: to.Ptr[int32](2), - // }, - // { - // Name: to.Ptr("workernode"), - // HardwareProfile: &armhdinsight.HardwareProfile{ - // VMSize: to.Ptr("standard_d4_v2"), - // }, - // OSProfile: &armhdinsight.OsProfile{ - // LinuxOperatingSystemProfile: &armhdinsight.LinuxOperatingSystemProfile{ - // Username: to.Ptr("sshuser"), - // }, - // }, - // TargetInstanceCount: to.Ptr[int32](4), - // }, - // { - // Name: to.Ptr("zookeepernode"), - // HardwareProfile: &armhdinsight.HardwareProfile{ - // VMSize: to.Ptr("standard_a2_v2"), - // }, - // OSProfile: &armhdinsight.OsProfile{ - // LinuxOperatingSystemProfile: &armhdinsight.LinuxOperatingSystemProfile{ - // Username: to.Ptr("sshuser"), - // }, - // }, - // TargetInstanceCount: to.Ptr[int32](3), - // }}, - // }, - // ConnectivityEndpoints: []*armhdinsight.ConnectivityEndpoint{ - // { - // Name: to.Ptr("SSH"), - // Location: to.Ptr("cluster1-ssh.azurehdinsight.net"), - // Port: to.Ptr[int32](22), - // Protocol: to.Ptr("TCP"), - // }, - // { - // Name: to.Ptr("HTTPS"), - // Location: to.Ptr("cluster1.azurehdinsight.net"), - // Port: to.Ptr[int32](443), - // Protocol: to.Ptr("TCP"), - // }}, - // CreatedDate: to.Ptr("2019-11-18T12:25:43.48"), - // OSType: to.Ptr(armhdinsight.OSTypeLinux), - // ProvisioningState: to.Ptr(armhdinsight.HDInsightClusterProvisioningStateSucceeded), - // QuotaInfo: &armhdinsight.QuotaInfo{ - // CoresUsed: to.Ptr[int32](40), - // }, - // Tier: to.Ptr(armhdinsight.TierStandard), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7a2ac91de424f271cf91cc8009f3fe9ee8249086/specification/hdinsight/resource-manager/Microsoft.HDInsight/stable/2021-06-01/examples/CreateLinuxHadoopSshPublicKey.json -func ExampleClustersClient_BeginCreate_createHadoopOnLinuxClusterWithSshPublicKey() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armhdinsight.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewClustersClient().BeginCreate(ctx, "rg1", "cluster1", armhdinsight.ClusterCreateParametersExtended{ - Properties: &armhdinsight.ClusterCreateProperties{ - ClusterDefinition: &armhdinsight.ClusterDefinition{ - Configurations: map[string]any{ - "gateway": map[string]any{ - "restAuthCredential.isEnabled": true, - "restAuthCredential.password": "**********", - "restAuthCredential.username": "admin", - }, - }, - Kind: to.Ptr("Hadoop"), - }, - ClusterVersion: to.Ptr("3.5"), - ComputeProfile: &armhdinsight.ComputeProfile{ - Roles: []*armhdinsight.Role{ - { - Name: to.Ptr("headnode"), - HardwareProfile: &armhdinsight.HardwareProfile{ - VMSize: to.Ptr("Standard_D3_V2"), - }, - MinInstanceCount: to.Ptr[int32](1), - OSProfile: &armhdinsight.OsProfile{ - LinuxOperatingSystemProfile: &armhdinsight.LinuxOperatingSystemProfile{ - SSHProfile: &armhdinsight.SSHProfile{ - PublicKeys: []*armhdinsight.SSHPublicKey{ - { - CertificateData: to.Ptr("**********"), - }}, - }, - Username: to.Ptr("sshuser"), - }, - }, - TargetInstanceCount: to.Ptr[int32](2), - }, - { - Name: to.Ptr("workernode"), - HardwareProfile: &armhdinsight.HardwareProfile{ - VMSize: to.Ptr("Standard_D3_V2"), - }, - MinInstanceCount: to.Ptr[int32](1), - OSProfile: &armhdinsight.OsProfile{ - LinuxOperatingSystemProfile: &armhdinsight.LinuxOperatingSystemProfile{ - Password: to.Ptr("**********"), - Username: to.Ptr("sshuser"), - }, - }, - TargetInstanceCount: to.Ptr[int32](4), - }, - { - Name: to.Ptr("zookeepernode"), - HardwareProfile: &armhdinsight.HardwareProfile{ - VMSize: to.Ptr("Small"), - }, - MinInstanceCount: to.Ptr[int32](1), - OSProfile: &armhdinsight.OsProfile{ - LinuxOperatingSystemProfile: &armhdinsight.LinuxOperatingSystemProfile{ - Password: to.Ptr("**********"), - Username: to.Ptr("sshuser"), - }, - }, - TargetInstanceCount: to.Ptr[int32](3), - }}, - }, - OSType: to.Ptr(armhdinsight.OSTypeLinux), - StorageProfile: &armhdinsight.StorageProfile{ - Storageaccounts: []*armhdinsight.StorageAccount{ - { - Name: to.Ptr("mystorage.blob.core.windows.net"), - Container: to.Ptr("containername"), - IsDefault: to.Ptr(true), - Key: to.Ptr("storagekey"), - }}, - }, - Tier: to.Ptr(armhdinsight.TierStandard), - }, - Tags: map[string]*string{ - "key1": to.Ptr("val1"), - }, - }, 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 = armhdinsight.Cluster{ - // Name: to.Ptr("cluster1"), - // Type: to.Ptr("Microsoft.HDInsight/clusters"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.HDInsight/clusters/cluster1"), - // Location: to.Ptr("East US"), - // Etag: to.Ptr("fdf2a6e8-ce83-42cc-8c2d-0ceb11a370ff"), - // Properties: &armhdinsight.ClusterGetProperties{ - // ClusterDefinition: &armhdinsight.ClusterDefinition{ - // Blueprint: to.Ptr("https://blueprints.azurehdinsight.net/hadoop-4.0.1000.1.1910270459.json"), - // ComponentVersion: map[string]*string{ - // "Hadoop": to.Ptr("3.1"), - // }, - // Kind: to.Ptr("HADOOP"), - // }, - // ClusterState: to.Ptr("Running"), - // ClusterVersion: to.Ptr("4.0.1000.1"), - // ComputeProfile: &armhdinsight.ComputeProfile{ - // Roles: []*armhdinsight.Role{ - // { - // Name: to.Ptr("headnode"), - // HardwareProfile: &armhdinsight.HardwareProfile{ - // VMSize: to.Ptr("standard_d12_v2"), - // }, - // OSProfile: &armhdinsight.OsProfile{ - // LinuxOperatingSystemProfile: &armhdinsight.LinuxOperatingSystemProfile{ - // Username: to.Ptr("sshuser"), - // }, - // }, - // TargetInstanceCount: to.Ptr[int32](2), - // }, - // { - // Name: to.Ptr("workernode"), - // HardwareProfile: &armhdinsight.HardwareProfile{ - // VMSize: to.Ptr("standard_d4_v2"), - // }, - // OSProfile: &armhdinsight.OsProfile{ - // LinuxOperatingSystemProfile: &armhdinsight.LinuxOperatingSystemProfile{ - // Username: to.Ptr("sshuser"), - // }, - // }, - // TargetInstanceCount: to.Ptr[int32](4), - // }, - // { - // Name: to.Ptr("zookeepernode"), - // HardwareProfile: &armhdinsight.HardwareProfile{ - // VMSize: to.Ptr("standard_a2_v2"), - // }, - // OSProfile: &armhdinsight.OsProfile{ - // LinuxOperatingSystemProfile: &armhdinsight.LinuxOperatingSystemProfile{ - // Username: to.Ptr("sshuser"), - // }, - // }, - // TargetInstanceCount: to.Ptr[int32](3), - // }}, - // }, - // ConnectivityEndpoints: []*armhdinsight.ConnectivityEndpoint{ - // { - // Name: to.Ptr("SSH"), - // Location: to.Ptr("cluster1-ssh.azurehdinsight.net"), - // Port: to.Ptr[int32](22), - // Protocol: to.Ptr("TCP"), - // }, - // { - // Name: to.Ptr("HTTPS"), - // Location: to.Ptr("cluster1.azurehdinsight.net"), - // Port: to.Ptr[int32](443), - // Protocol: to.Ptr("TCP"), - // }}, - // CreatedDate: to.Ptr("2019-11-18T12:25:43.48"), - // OSType: to.Ptr(armhdinsight.OSTypeLinux), - // ProvisioningState: to.Ptr(armhdinsight.HDInsightClusterProvisioningStateSucceeded), - // QuotaInfo: &armhdinsight.QuotaInfo{ - // CoresUsed: to.Ptr[int32](40), - // }, - // Tier: to.Ptr(armhdinsight.TierStandard), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7a2ac91de424f271cf91cc8009f3fe9ee8249086/specification/hdinsight/resource-manager/Microsoft.HDInsight/stable/2021-06-01/examples/CreateKafkaClusterWithKafkaRestProxy.json -func ExampleClustersClient_BeginCreate_createKafkaClusterWithKafkaRestProxy() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armhdinsight.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewClustersClient().BeginCreate(ctx, "rg1", "cluster1", armhdinsight.ClusterCreateParametersExtended{ - Properties: &armhdinsight.ClusterCreateProperties{ - ClusterDefinition: &armhdinsight.ClusterDefinition{ - ComponentVersion: map[string]*string{ - "Kafka": to.Ptr("2.1"), - }, - Configurations: map[string]any{ - "gateway": map[string]any{ - "restAuthCredential.isEnabled": true, - "restAuthCredential.password": "**********", - "restAuthCredential.username": "admin", - }, - }, - Kind: to.Ptr("kafka"), - }, - ClusterVersion: to.Ptr("4.0"), - ComputeProfile: &armhdinsight.ComputeProfile{ - Roles: []*armhdinsight.Role{ - { - Name: to.Ptr("headnode"), - HardwareProfile: &armhdinsight.HardwareProfile{ - VMSize: to.Ptr("Large"), - }, - OSProfile: &armhdinsight.OsProfile{ - LinuxOperatingSystemProfile: &armhdinsight.LinuxOperatingSystemProfile{ - Password: to.Ptr("**********"), - Username: to.Ptr("sshuser"), - }, - }, - TargetInstanceCount: to.Ptr[int32](2), - }, - { - Name: to.Ptr("workernode"), - DataDisksGroups: []*armhdinsight.DataDisksGroups{ - { - DisksPerNode: to.Ptr[int32](8), - }}, - HardwareProfile: &armhdinsight.HardwareProfile{ - VMSize: to.Ptr("Large"), - }, - OSProfile: &armhdinsight.OsProfile{ - LinuxOperatingSystemProfile: &armhdinsight.LinuxOperatingSystemProfile{ - Password: to.Ptr("**********"), - Username: to.Ptr("sshuser"), - }, - }, - TargetInstanceCount: to.Ptr[int32](3), - }, - { - Name: to.Ptr("zookeepernode"), - HardwareProfile: &armhdinsight.HardwareProfile{ - VMSize: to.Ptr("Small"), - }, - OSProfile: &armhdinsight.OsProfile{ - LinuxOperatingSystemProfile: &armhdinsight.LinuxOperatingSystemProfile{ - Password: to.Ptr("**********"), - Username: to.Ptr("sshuser"), - }, - }, - TargetInstanceCount: to.Ptr[int32](3), - }, - { - Name: to.Ptr("kafkamanagementnode"), - HardwareProfile: &armhdinsight.HardwareProfile{ - VMSize: to.Ptr("Standard_D4_v2"), - }, - OSProfile: &armhdinsight.OsProfile{ - LinuxOperatingSystemProfile: &armhdinsight.LinuxOperatingSystemProfile{ - Password: to.Ptr("**********"), - Username: to.Ptr("kafkauser"), - }, - }, - TargetInstanceCount: to.Ptr[int32](2), - }}, - }, - KafkaRestProperties: &armhdinsight.KafkaRestProperties{ - ClientGroupInfo: &armhdinsight.ClientGroupInfo{ - GroupID: to.Ptr("00000000-0000-0000-0000-111111111111"), - GroupName: to.Ptr("Kafka security group name"), - }, - }, - OSType: to.Ptr(armhdinsight.OSTypeLinux), - StorageProfile: &armhdinsight.StorageProfile{ - Storageaccounts: []*armhdinsight.StorageAccount{ - { - Name: to.Ptr("mystorage.blob.core.windows.net"), - Container: to.Ptr("containername"), - IsDefault: to.Ptr(true), - Key: to.Ptr("storagekey"), - }}, - }, - Tier: to.Ptr(armhdinsight.TierStandard), - }, - }, 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 = armhdinsight.Cluster{ - // Name: to.Ptr("cluster1"), - // Type: to.Ptr("Microsoft.HDInsight/clusters"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.HDInsight/clusters/cluster1"), - // Location: to.Ptr("South Central US"), - // Etag: to.Ptr("e1266b83-9bda-4797-a906-1bf82c8eb09a"), - // Properties: &armhdinsight.ClusterGetProperties{ - // ClusterDefinition: &armhdinsight.ClusterDefinition{ - // Blueprint: to.Ptr("https://blueprints.azurehdinsight.net/kafka-4.0.1000.1.1911212244.json"), - // ComponentVersion: map[string]*string{ - // "Kafka": to.Ptr("2.1"), - // }, - // Kind: to.Ptr("KAFKA"), - // }, - // ClusterState: to.Ptr("Running"), - // ClusterVersion: to.Ptr("4.0.1000.1"), - // ComputeProfile: &armhdinsight.ComputeProfile{ - // Roles: []*armhdinsight.Role{ - // { - // Name: to.Ptr("headnode"), - // HardwareProfile: &armhdinsight.HardwareProfile{ - // VMSize: to.Ptr("standard_d3_v2"), - // }, - // OSProfile: &armhdinsight.OsProfile{ - // LinuxOperatingSystemProfile: &armhdinsight.LinuxOperatingSystemProfile{ - // Username: to.Ptr("sshuser"), - // }, - // }, - // TargetInstanceCount: to.Ptr[int32](2), - // }, - // { - // Name: to.Ptr("workernode"), - // DataDisksGroups: []*armhdinsight.DataDisksGroups{ - // { - // DiskSizeGB: to.Ptr[int32](1023), - // DisksPerNode: to.Ptr[int32](2), - // StorageAccountType: to.Ptr("Standard_LRS"), - // }}, - // HardwareProfile: &armhdinsight.HardwareProfile{ - // VMSize: to.Ptr("standard_d3_v2"), - // }, - // OSProfile: &armhdinsight.OsProfile{ - // LinuxOperatingSystemProfile: &armhdinsight.LinuxOperatingSystemProfile{ - // Username: to.Ptr("sshuser"), - // }, - // }, - // TargetInstanceCount: to.Ptr[int32](4), - // }, - // { - // Name: to.Ptr("kafkamanagementnode"), - // HardwareProfile: &armhdinsight.HardwareProfile{ - // VMSize: to.Ptr("standard_d4_v2"), - // }, - // OSProfile: &armhdinsight.OsProfile{ - // LinuxOperatingSystemProfile: &armhdinsight.LinuxOperatingSystemProfile{ - // Username: to.Ptr("sshuser"), - // }, - // }, - // TargetInstanceCount: to.Ptr[int32](2), - // }, - // { - // Name: to.Ptr("zookeepernode"), - // HardwareProfile: &armhdinsight.HardwareProfile{ - // VMSize: to.Ptr("standard_a4_v2"), - // }, - // OSProfile: &armhdinsight.OsProfile{ - // LinuxOperatingSystemProfile: &armhdinsight.LinuxOperatingSystemProfile{ - // Username: to.Ptr("sshuser"), - // }, - // }, - // TargetInstanceCount: to.Ptr[int32](3), - // }}, - // }, - // ConnectivityEndpoints: []*armhdinsight.ConnectivityEndpoint{ - // { - // Name: to.Ptr("SSH"), - // Location: to.Ptr("cluster1-ssh.azurehdinsight.net"), - // Port: to.Ptr[int32](22), - // Protocol: to.Ptr("TCP"), - // }, - // { - // Name: to.Ptr("HTTPS"), - // Location: to.Ptr("cluster1.azurehdinsight.net"), - // Port: to.Ptr[int32](443), - // Protocol: to.Ptr("TCP"), - // }, - // { - // Name: to.Ptr("KafkaRestProxyPublicEndpoint"), - // Location: to.Ptr("cluster1-kafkarest.azurehdinsight.net"), - // Port: to.Ptr[int32](443), - // Protocol: to.Ptr("TCP"), - // }}, - // CreatedDate: to.Ptr("2019-11-25T03:43:23.663"), - // KafkaRestProperties: &armhdinsight.KafkaRestProperties{ - // ClientGroupInfo: &armhdinsight.ClientGroupInfo{ - // GroupID: to.Ptr("00000000-0000-0000-0000-000000000000"), - // GroupName: to.Ptr("security group name"), - // }, - // }, - // OSType: to.Ptr(armhdinsight.OSTypeLinux), - // ProvisioningState: to.Ptr(armhdinsight.HDInsightClusterProvisioningStateSucceeded), - // QuotaInfo: &armhdinsight.QuotaInfo{ - // CoresUsed: to.Ptr[int32](52), - // }, - // Tier: to.Ptr(armhdinsight.TierStandard), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7a2ac91de424f271cf91cc8009f3fe9ee8249086/specification/hdinsight/resource-manager/Microsoft.HDInsight/stable/2021-06-01/examples/CreateLinuxHadoopSecureHadoop.json -func ExampleClustersClient_BeginCreate_createSecureHadoopCluster() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armhdinsight.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewClustersClient().BeginCreate(ctx, "rg1", "cluster1", armhdinsight.ClusterCreateParametersExtended{ - Properties: &armhdinsight.ClusterCreateProperties{ - ClusterDefinition: &armhdinsight.ClusterDefinition{ - Configurations: map[string]any{ - "gateway": map[string]any{ - "restAuthCredential.isEnabled": true, - "restAuthCredential.password": "**********", - "restAuthCredential.username": "admin", - }, - }, - Kind: to.Ptr("Hadoop"), - }, - ClusterVersion: to.Ptr("3.5"), - ComputeProfile: &armhdinsight.ComputeProfile{ - Roles: []*armhdinsight.Role{ - { - Name: to.Ptr("headnode"), - HardwareProfile: &armhdinsight.HardwareProfile{ - VMSize: to.Ptr("Standard_D3_V2"), - }, - MinInstanceCount: to.Ptr[int32](1), - OSProfile: &armhdinsight.OsProfile{ - LinuxOperatingSystemProfile: &armhdinsight.LinuxOperatingSystemProfile{ - Password: to.Ptr("**********"), - SSHProfile: &armhdinsight.SSHProfile{ - PublicKeys: []*armhdinsight.SSHPublicKey{ - { - CertificateData: to.Ptr("**********"), - }}, - }, - Username: to.Ptr("sshuser"), - }, - }, - ScriptActions: []*armhdinsight.ScriptAction{}, - TargetInstanceCount: to.Ptr[int32](2), - VirtualNetworkProfile: &armhdinsight.VirtualNetworkProfile{ - ID: to.Ptr("/subscriptions/subId/resourceGroups/rg/providers/Microsoft.Network/virtualNetworks/vnetname"), - Subnet: to.Ptr("/subscriptions/subId/resourceGroups/rg/providers/Microsoft.Network/virtualNetworks/vnetname/subnets/vnetsubnet"), - }, - }, - { - Name: to.Ptr("workernode"), - HardwareProfile: &armhdinsight.HardwareProfile{ - VMSize: to.Ptr("Standard_D3_V2"), - }, - MinInstanceCount: to.Ptr[int32](1), - OSProfile: &armhdinsight.OsProfile{ - LinuxOperatingSystemProfile: &armhdinsight.LinuxOperatingSystemProfile{ - Password: to.Ptr("**********"), - SSHProfile: &armhdinsight.SSHProfile{ - PublicKeys: []*armhdinsight.SSHPublicKey{ - { - CertificateData: to.Ptr("**********"), - }}, - }, - Username: to.Ptr("sshuser"), - }, - }, - ScriptActions: []*armhdinsight.ScriptAction{}, - TargetInstanceCount: to.Ptr[int32](4), - VirtualNetworkProfile: &armhdinsight.VirtualNetworkProfile{ - ID: to.Ptr("/subscriptions/subId/resourceGroups/rg/providers/Microsoft.Network/virtualNetworks/vnetname"), - Subnet: to.Ptr("/subscriptions/subId/resourceGroups/rg/providers/Microsoft.Network/virtualNetworks/vnetname/subnets/vnetsubnet"), - }, - }, - { - Name: to.Ptr("zookeepernode"), - HardwareProfile: &armhdinsight.HardwareProfile{ - VMSize: to.Ptr("Small"), - }, - MinInstanceCount: to.Ptr[int32](1), - OSProfile: &armhdinsight.OsProfile{ - LinuxOperatingSystemProfile: &armhdinsight.LinuxOperatingSystemProfile{ - Password: to.Ptr("**********"), - SSHProfile: &armhdinsight.SSHProfile{ - PublicKeys: []*armhdinsight.SSHPublicKey{ - { - CertificateData: to.Ptr("**********"), - }}, - }, - Username: to.Ptr("sshuser"), - }, - }, - ScriptActions: []*armhdinsight.ScriptAction{}, - TargetInstanceCount: to.Ptr[int32](3), - VirtualNetworkProfile: &armhdinsight.VirtualNetworkProfile{ - ID: to.Ptr("/subscriptions/subId/resourceGroups/rg/providers/Microsoft.Network/virtualNetworks/vnetname"), - Subnet: to.Ptr("/subscriptions/subId/resourceGroups/rg/providers/Microsoft.Network/virtualNetworks/vnetname/subnets/vnetsubnet"), - }, - }}, - }, - OSType: to.Ptr(armhdinsight.OSTypeLinux), - SecurityProfile: &armhdinsight.SecurityProfile{ - ClusterUsersGroupDNs: []*string{ - to.Ptr("hdiusers")}, - DirectoryType: to.Ptr(armhdinsight.DirectoryTypeActiveDirectory), - Domain: to.Ptr("DomainName"), - DomainUserPassword: to.Ptr("**********"), - DomainUsername: to.Ptr("DomainUsername"), - LdapsUrls: []*string{ - to.Ptr("ldaps://10.10.0.4:636")}, - OrganizationalUnitDN: to.Ptr("OU=Hadoop,DC=hdinsight,DC=test"), - }, - StorageProfile: &armhdinsight.StorageProfile{ - Storageaccounts: []*armhdinsight.StorageAccount{ - { - Name: to.Ptr("mystorage.blob.core.windows.net"), - Container: to.Ptr("containername"), - IsDefault: to.Ptr(true), - Key: to.Ptr("storage account key"), - }}, - }, - Tier: to.Ptr(armhdinsight.TierPremium), - }, - Tags: map[string]*string{ - "key1": to.Ptr("val1"), - }, - }, 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 = armhdinsight.Cluster{ - // Name: to.Ptr("cluster1"), - // Type: to.Ptr("Microsoft.HDInsight/clusters"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.HDInsight/clusters/cluster1"), - // Location: to.Ptr("East US"), - // Etag: to.Ptr("fdf2a6e8-ce83-42cc-8c2d-0ceb11a370ff"), - // Properties: &armhdinsight.ClusterGetProperties{ - // ClusterDefinition: &armhdinsight.ClusterDefinition{ - // Blueprint: to.Ptr("https://blueprints.azurehdinsight.net/hadoop-4.0.1000.1.1910270459.json"), - // ComponentVersion: map[string]*string{ - // "Hadoop": to.Ptr("3.1"), - // }, - // Kind: to.Ptr("HADOOP"), - // }, - // ClusterState: to.Ptr("Running"), - // ClusterVersion: to.Ptr("4.0.1000.1"), - // ComputeProfile: &armhdinsight.ComputeProfile{ - // Roles: []*armhdinsight.Role{ - // { - // Name: to.Ptr("headnode"), - // HardwareProfile: &armhdinsight.HardwareProfile{ - // VMSize: to.Ptr("standard_d12_v2"), - // }, - // OSProfile: &armhdinsight.OsProfile{ - // LinuxOperatingSystemProfile: &armhdinsight.LinuxOperatingSystemProfile{ - // Username: to.Ptr("sshuser"), - // }, - // }, - // TargetInstanceCount: to.Ptr[int32](2), - // }, - // { - // Name: to.Ptr("workernode"), - // HardwareProfile: &armhdinsight.HardwareProfile{ - // VMSize: to.Ptr("standard_d4_v2"), - // }, - // OSProfile: &armhdinsight.OsProfile{ - // LinuxOperatingSystemProfile: &armhdinsight.LinuxOperatingSystemProfile{ - // Username: to.Ptr("sshuser"), - // }, - // }, - // TargetInstanceCount: to.Ptr[int32](4), - // }, - // { - // Name: to.Ptr("zookeepernode"), - // HardwareProfile: &armhdinsight.HardwareProfile{ - // VMSize: to.Ptr("standard_a2_v2"), - // }, - // OSProfile: &armhdinsight.OsProfile{ - // LinuxOperatingSystemProfile: &armhdinsight.LinuxOperatingSystemProfile{ - // Username: to.Ptr("sshuser"), - // }, - // }, - // TargetInstanceCount: to.Ptr[int32](3), - // }}, - // }, - // ConnectivityEndpoints: []*armhdinsight.ConnectivityEndpoint{ - // { - // Name: to.Ptr("SSH"), - // Location: to.Ptr("cluster1-ssh.azurehdinsight.net"), - // Port: to.Ptr[int32](22), - // Protocol: to.Ptr("TCP"), - // }, - // { - // Name: to.Ptr("HTTPS"), - // Location: to.Ptr("cluster1.azurehdinsight.net"), - // Port: to.Ptr[int32](443), - // Protocol: to.Ptr("TCP"), - // }}, - // CreatedDate: to.Ptr("2019-11-18T12:25:43.48"), - // OSType: to.Ptr(armhdinsight.OSTypeLinux), - // ProvisioningState: to.Ptr(armhdinsight.HDInsightClusterProvisioningStateSucceeded), - // QuotaInfo: &armhdinsight.QuotaInfo{ - // CoresUsed: to.Ptr[int32](40), - // }, - // Tier: to.Ptr(armhdinsight.TierStandard), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7a2ac91de424f271cf91cc8009f3fe9ee8249086/specification/hdinsight/resource-manager/Microsoft.HDInsight/stable/2021-06-01/examples/CreateLinuxSparkSshPassword.json -func ExampleClustersClient_BeginCreate_createSparkOnLinuxClusterWithSshPassword() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armhdinsight.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewClustersClient().BeginCreate(ctx, "rg1", "cluster1", armhdinsight.ClusterCreateParametersExtended{ - Properties: &armhdinsight.ClusterCreateProperties{ - ClusterDefinition: &armhdinsight.ClusterDefinition{ - ComponentVersion: map[string]*string{ - "Spark": to.Ptr("2.0"), - }, - Configurations: map[string]any{ - "gateway": map[string]any{ - "restAuthCredential.isEnabled": true, - "restAuthCredential.password": "**********", - "restAuthCredential.username": "admin", - }, - }, - Kind: to.Ptr("Spark"), - }, - ClusterVersion: to.Ptr("3.5"), - ComputeProfile: &armhdinsight.ComputeProfile{ - Roles: []*armhdinsight.Role{ - { - Name: to.Ptr("headnode"), - HardwareProfile: &armhdinsight.HardwareProfile{ - VMSize: to.Ptr("Standard_D12_V2"), - }, - MinInstanceCount: to.Ptr[int32](1), - OSProfile: &armhdinsight.OsProfile{ - LinuxOperatingSystemProfile: &armhdinsight.LinuxOperatingSystemProfile{ - Password: to.Ptr("**********"), - Username: to.Ptr("sshuser"), - }, - }, - TargetInstanceCount: to.Ptr[int32](2), - }, - { - Name: to.Ptr("workernode"), - HardwareProfile: &armhdinsight.HardwareProfile{ - VMSize: to.Ptr("Standard_D4_V2"), - }, - MinInstanceCount: to.Ptr[int32](1), - OSProfile: &armhdinsight.OsProfile{ - LinuxOperatingSystemProfile: &armhdinsight.LinuxOperatingSystemProfile{ - Password: to.Ptr("**********"), - Username: to.Ptr("sshuser"), - }, - }, - TargetInstanceCount: to.Ptr[int32](4), - }}, - }, - OSType: to.Ptr(armhdinsight.OSTypeLinux), - StorageProfile: &armhdinsight.StorageProfile{ - Storageaccounts: []*armhdinsight.StorageAccount{ - { - Name: to.Ptr("mystorage.blob.core.windows.net"), - Container: to.Ptr("containername"), - IsDefault: to.Ptr(true), - Key: to.Ptr("storageapikey*"), - }}, - }, - Tier: to.Ptr(armhdinsight.TierStandard), - }, - Tags: map[string]*string{ - "key1": to.Ptr("val1"), - }, - }, 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 = armhdinsight.Cluster{ - // Name: to.Ptr("cluster1"), - // Type: to.Ptr("Microsoft.HDInsight/clusters"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.HDInsight/clusters/cluster1"), - // Location: to.Ptr("East US"), - // Etag: to.Ptr("fdf2a6e8-ce83-42cc-8c2d-0ceb11a370ff"), - // Properties: &armhdinsight.ClusterGetProperties{ - // ClusterDefinition: &armhdinsight.ClusterDefinition{ - // Blueprint: to.Ptr("https://blueprints.azurehdinsight.net/hadoop-4.0.1000.1.1910270459.json"), - // ComponentVersion: map[string]*string{ - // "Hadoop": to.Ptr("3.1"), - // }, - // Kind: to.Ptr("SPARK"), - // }, - // ClusterState: to.Ptr("Running"), - // ClusterVersion: to.Ptr("4.0.1000.1"), - // ComputeProfile: &armhdinsight.ComputeProfile{ - // Roles: []*armhdinsight.Role{ - // { - // Name: to.Ptr("headnode"), - // HardwareProfile: &armhdinsight.HardwareProfile{ - // VMSize: to.Ptr("standard_d12_v2"), - // }, - // OSProfile: &armhdinsight.OsProfile{ - // LinuxOperatingSystemProfile: &armhdinsight.LinuxOperatingSystemProfile{ - // Username: to.Ptr("sshuser"), - // }, - // }, - // TargetInstanceCount: to.Ptr[int32](2), - // }, - // { - // Name: to.Ptr("workernode"), - // HardwareProfile: &armhdinsight.HardwareProfile{ - // VMSize: to.Ptr("standard_d4_v2"), - // }, - // OSProfile: &armhdinsight.OsProfile{ - // LinuxOperatingSystemProfile: &armhdinsight.LinuxOperatingSystemProfile{ - // Username: to.Ptr("sshuser"), - // }, - // }, - // TargetInstanceCount: to.Ptr[int32](4), - // }, - // { - // Name: to.Ptr("zookeepernode"), - // HardwareProfile: &armhdinsight.HardwareProfile{ - // VMSize: to.Ptr("standard_a2_v2"), - // }, - // OSProfile: &armhdinsight.OsProfile{ - // LinuxOperatingSystemProfile: &armhdinsight.LinuxOperatingSystemProfile{ - // Username: to.Ptr("sshuser"), - // }, - // }, - // TargetInstanceCount: to.Ptr[int32](3), - // }}, - // }, - // ConnectivityEndpoints: []*armhdinsight.ConnectivityEndpoint{ - // { - // Name: to.Ptr("SSH"), - // Location: to.Ptr("cluster1-ssh.azurehdinsight.net"), - // Port: to.Ptr[int32](22), - // Protocol: to.Ptr("TCP"), - // }, - // { - // Name: to.Ptr("HTTPS"), - // Location: to.Ptr("cluster1.azurehdinsight.net"), - // Port: to.Ptr[int32](443), - // Protocol: to.Ptr("TCP"), - // }}, - // CreatedDate: to.Ptr("2019-11-18T12:25:43.48"), - // OSType: to.Ptr(armhdinsight.OSTypeLinux), - // ProvisioningState: to.Ptr(armhdinsight.HDInsightClusterProvisioningStateSucceeded), - // QuotaInfo: &armhdinsight.QuotaInfo{ - // CoresUsed: to.Ptr[int32](40), - // }, - // Tier: to.Ptr(armhdinsight.TierStandard), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7a2ac91de424f271cf91cc8009f3fe9ee8249086/specification/hdinsight/resource-manager/Microsoft.HDInsight/stable/2021-06-01/examples/CreateHDInsightClusterWithTLS12.json -func ExampleClustersClient_BeginCreate_createClusterWithTls12() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armhdinsight.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewClustersClient().BeginCreate(ctx, "rg1", "cluster1", armhdinsight.ClusterCreateParametersExtended{ - Properties: &armhdinsight.ClusterCreateProperties{ - ClusterDefinition: &armhdinsight.ClusterDefinition{ - Configurations: map[string]any{ - "gateway": map[string]any{ - "restAuthCredential.isEnabled": true, - "restAuthCredential.password": "**********", - "restAuthCredential.username": "admin", - }, - }, - Kind: to.Ptr("Hadoop"), - }, - ClusterVersion: to.Ptr("3.6"), - ComputeProfile: &armhdinsight.ComputeProfile{ - Roles: []*armhdinsight.Role{ - { - Name: to.Ptr("headnode"), - HardwareProfile: &armhdinsight.HardwareProfile{ - VMSize: to.Ptr("Large"), - }, - OSProfile: &armhdinsight.OsProfile{ - LinuxOperatingSystemProfile: &armhdinsight.LinuxOperatingSystemProfile{ - Password: to.Ptr("**********"), - Username: to.Ptr("sshuser"), - }, - }, - TargetInstanceCount: to.Ptr[int32](2), - }, - { - Name: to.Ptr("workernode"), - HardwareProfile: &armhdinsight.HardwareProfile{ - VMSize: to.Ptr("Large"), - }, - OSProfile: &armhdinsight.OsProfile{ - LinuxOperatingSystemProfile: &armhdinsight.LinuxOperatingSystemProfile{ - Password: to.Ptr("**********"), - Username: to.Ptr("sshuser"), - }, - }, - TargetInstanceCount: to.Ptr[int32](3), - }, - { - Name: to.Ptr("zookeepernode"), - HardwareProfile: &armhdinsight.HardwareProfile{ - VMSize: to.Ptr("Small"), - }, - OSProfile: &armhdinsight.OsProfile{ - LinuxOperatingSystemProfile: &armhdinsight.LinuxOperatingSystemProfile{ - Password: to.Ptr("**********"), - Username: to.Ptr("sshuser"), - }, - }, - TargetInstanceCount: to.Ptr[int32](3), - }}, - }, - MinSupportedTLSVersion: to.Ptr("1.2"), - OSType: to.Ptr(armhdinsight.OSTypeLinux), - StorageProfile: &armhdinsight.StorageProfile{ - Storageaccounts: []*armhdinsight.StorageAccount{ - { - Name: to.Ptr("mystorage.blob.core.windows.net"), - Container: to.Ptr("default8525"), - IsDefault: to.Ptr(true), - Key: to.Ptr("storagekey"), - }}, - }, - Tier: to.Ptr(armhdinsight.TierStandard), - }, - }, 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 = armhdinsight.Cluster{ - // Name: to.Ptr("cluster1"), - // Type: to.Ptr("Microsoft.HDInsight/clusters"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.HDInsight/clusters/cluster1"), - // Location: to.Ptr("South Central US"), - // Etag: to.Ptr("3b76ce3d-892c-4036-9d8b-8ade18ba7a4b"), - // Properties: &armhdinsight.ClusterGetProperties{ - // ClusterDefinition: &armhdinsight.ClusterDefinition{ - // Blueprint: to.Ptr("https://blueprints.azurehdinsight.net/hadoop-3.6.1000.67.2001080246.json"), - // ComponentVersion: map[string]*string{ - // "Hadoop": to.Ptr("2.7"), - // }, - // Kind: to.Ptr("Hadoop"), - // }, - // ClusterState: to.Ptr("Running"), - // ClusterVersion: to.Ptr("3.6.1000.67"), - // ComputeProfile: &armhdinsight.ComputeProfile{ - // Roles: []*armhdinsight.Role{ - // { - // Name: to.Ptr("headnode"), - // HardwareProfile: &armhdinsight.HardwareProfile{ - // VMSize: to.Ptr("standard_a4_v2"), - // }, - // OSProfile: &armhdinsight.OsProfile{ - // LinuxOperatingSystemProfile: &armhdinsight.LinuxOperatingSystemProfile{ - // Username: to.Ptr("sshuser"), - // }, - // }, - // TargetInstanceCount: to.Ptr[int32](2), - // }, - // { - // Name: to.Ptr("workernode"), - // HardwareProfile: &armhdinsight.HardwareProfile{ - // VMSize: to.Ptr("standard_a4_v2"), - // }, - // OSProfile: &armhdinsight.OsProfile{ - // LinuxOperatingSystemProfile: &armhdinsight.LinuxOperatingSystemProfile{ - // Username: to.Ptr("sshuser"), - // }, - // }, - // TargetInstanceCount: to.Ptr[int32](3), - // }, - // { - // Name: to.Ptr("zookeepernode"), - // HardwareProfile: &armhdinsight.HardwareProfile{ - // VMSize: to.Ptr("standard_a2_v2"), - // }, - // OSProfile: &armhdinsight.OsProfile{ - // LinuxOperatingSystemProfile: &armhdinsight.LinuxOperatingSystemProfile{ - // Username: to.Ptr("sshuser"), - // }, - // }, - // TargetInstanceCount: to.Ptr[int32](3), - // }}, - // }, - // ConnectivityEndpoints: []*armhdinsight.ConnectivityEndpoint{ - // { - // Name: to.Ptr("SSH"), - // Location: to.Ptr("cluster1-ssh.azurehdinsight.net"), - // Port: to.Ptr[int32](22), - // Protocol: to.Ptr("TCP"), - // }, - // { - // Name: to.Ptr("HTTPS"), - // Location: to.Ptr("cluster1.azurehdinsight.net"), - // Port: to.Ptr[int32](443), - // Protocol: to.Ptr("TCP"), - // }}, - // CreatedDate: to.Ptr("2020-01-10T08:36:39.153"), - // MinSupportedTLSVersion: to.Ptr("1.2"), - // OSType: to.Ptr(armhdinsight.OSTypeLinux), - // ProvisioningState: to.Ptr(armhdinsight.HDInsightClusterProvisioningStateSucceeded), - // QuotaInfo: &armhdinsight.QuotaInfo{ - // CoresUsed: to.Ptr[int32](20), - // }, - // Tier: to.Ptr(armhdinsight.TierStandard), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7a2ac91de424f271cf91cc8009f3fe9ee8249086/specification/hdinsight/resource-manager/Microsoft.HDInsight/stable/2021-06-01/examples/CreateHDInsightClusterWithAvailabilityZones.json -func ExampleClustersClient_BeginCreate_createClusterWithAvailabilityZones() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armhdinsight.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewClustersClient().BeginCreate(ctx, "rg1", "cluster1", armhdinsight.ClusterCreateParametersExtended{ - Properties: &armhdinsight.ClusterCreateProperties{ - ClusterDefinition: &armhdinsight.ClusterDefinition{ - Configurations: map[string]any{ - "ambari-conf": map[string]any{ - "database-name": "{ambari database name}", - "database-server": "{sql server name}.database.windows.net", - "database-user-name": "**********", - "database-user-password": "**********", - }, - "gateway": map[string]any{ - "restAuthCredential.isEnabled": true, - "restAuthCredential.password": "**********", - "restAuthCredential.username": "admin", - }, - "hive-env": map[string]any{ - "hive_database": "Existing MSSQL Server database with SQL authentication", - "hive_database_name": "{hive metastore name}", - "hive_database_type": "mssql", - "hive_existing_mssql_server_database": "{hive metastore name}", - "hive_existing_mssql_server_host": "{sql server name}.database.windows.net", - "hive_hostname": "{sql server name}.database.windows.net", - }, - "hive-site": map[string]any{ - "javax.jdo.option.ConnectionDriverName": "com.microsoft.sqlserver.jdbc.SQLServerDriver", - "javax.jdo.option.ConnectionPassword": "**********!", - "javax.jdo.option.ConnectionURL": "jdbc:sqlserver://{sql server name}.database.windows.net;database={hive metastore name};encrypt=true;trustServerCertificate=true;create=false;loginTimeout=300;sendStringParametersAsUnicode=true;prepareSQL=0", - "javax.jdo.option.ConnectionUserName": "**********", - }, - "oozie-env": map[string]any{ - "oozie_database": "Existing MSSQL Server database with SQL authentication", - "oozie_database_name": "{oozie metastore name}", - "oozie_database_type": "mssql", - "oozie_existing_mssql_server_database": "{oozie metastore name}", - "oozie_existing_mssql_server_host": "{sql server name}.database.windows.net", - "oozie_hostname": "{sql server name}.database.windows.net", - }, - "oozie-site": map[string]any{ - "oozie.db.schema.name": "oozie", - "oozie.service.JPAService.jdbc.driver": "com.microsoft.sqlserver.jdbc.SQLServerDriver", - "oozie.service.JPAService.jdbc.password": "**********", - "oozie.service.JPAService.jdbc.url": "jdbc:sqlserver://{sql server name}.database.windows.net;database={oozie metastore name};encrypt=true;trustServerCertificate=true;create=false;loginTimeout=300;sendStringParametersAsUnicode=true;prepareSQL=0", - "oozie.service.JPAService.jdbc.username": "**********", - }, - }, - Kind: to.Ptr("hadoop"), - }, - ClusterVersion: to.Ptr("3.6"), - ComputeProfile: &armhdinsight.ComputeProfile{ - Roles: []*armhdinsight.Role{ - { - Name: to.Ptr("headnode"), - HardwareProfile: &armhdinsight.HardwareProfile{ - VMSize: to.Ptr("standard_d3"), - }, - OSProfile: &armhdinsight.OsProfile{ - LinuxOperatingSystemProfile: &armhdinsight.LinuxOperatingSystemProfile{ - Password: to.Ptr("**********"), - SSHProfile: &armhdinsight.SSHProfile{ - PublicKeys: []*armhdinsight.SSHPublicKey{ - { - CertificateData: to.Ptr("**********"), - }}, - }, - Username: to.Ptr("sshuser"), - }, - }, - TargetInstanceCount: to.Ptr[int32](2), - VirtualNetworkProfile: &armhdinsight.VirtualNetworkProfile{ - ID: to.Ptr("/subscriptions/subId/resourceGroups/rg/providers/Microsoft.Network/virtualNetworks/vnetname"), - Subnet: to.Ptr("/subscriptions/subId/resourceGroups/rg/providers/Microsoft.Network/virtualNetworks/vnetname/subnets/vnetsubnet"), - }, - }, - { - Name: to.Ptr("workernode"), - HardwareProfile: &armhdinsight.HardwareProfile{ - VMSize: to.Ptr("standard_d3"), - }, - OSProfile: &armhdinsight.OsProfile{ - LinuxOperatingSystemProfile: &armhdinsight.LinuxOperatingSystemProfile{ - Password: to.Ptr("**********"), - SSHProfile: &armhdinsight.SSHProfile{ - PublicKeys: []*armhdinsight.SSHPublicKey{ - { - CertificateData: to.Ptr("**********"), - }}, - }, - Username: to.Ptr("sshuser"), - }, - }, - TargetInstanceCount: to.Ptr[int32](2), - VirtualNetworkProfile: &armhdinsight.VirtualNetworkProfile{ - ID: to.Ptr("/subscriptions/subId/resourceGroups/rg/providers/Microsoft.Network/virtualNetworks/vnetname"), - Subnet: to.Ptr("/subscriptions/subId/resourceGroups/rg/providers/Microsoft.Network/virtualNetworks/vnetname/subnets/vnetsubnet"), - }, - }}, - }, - OSType: to.Ptr(armhdinsight.OSTypeLinux), - StorageProfile: &armhdinsight.StorageProfile{ - Storageaccounts: []*armhdinsight.StorageAccount{ - { - Name: to.Ptr("mystorage"), - Container: to.Ptr("containername"), - IsDefault: to.Ptr(true), - Key: to.Ptr("storage account key"), - }}, - }, - }, - Zones: []*string{ - to.Ptr("1")}, - }, 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 = armhdinsight.Cluster{ - // Name: to.Ptr("cluster1"), - // Type: to.Ptr("Microsoft.HDInsight/clusters"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.HDInsight/clusters/cluster1"), - // Location: to.Ptr("South Central US"), - // Etag: to.Ptr("fdf2a6e8-ce83-42cc-8c2d-0ceb11a370ff"), - // Properties: &armhdinsight.ClusterGetProperties{ - // ClusterDefinition: &armhdinsight.ClusterDefinition{ - // Blueprint: to.Ptr("https://blueprints.azurehdinsight.net/hadoop-3.6.1000.67.2005040905.json"), - // Kind: to.Ptr("hadoop"), - // }, - // ClusterID: to.Ptr("8186508b6234470e9d16c9e8e13bd821"), - // ClusterState: to.Ptr("Running"), - // ClusterVersion: to.Ptr("3.6.1000.67"), - // ComputeProfile: &armhdinsight.ComputeProfile{ - // Roles: []*armhdinsight.Role{ - // { - // Name: to.Ptr("headnode"), - // HardwareProfile: &armhdinsight.HardwareProfile{ - // VMSize: to.Ptr("standard_d3"), - // }, - // OSProfile: &armhdinsight.OsProfile{ - // LinuxOperatingSystemProfile: &armhdinsight.LinuxOperatingSystemProfile{ - // Username: to.Ptr("sshuser"), - // }, - // }, - // TargetInstanceCount: to.Ptr[int32](2), - // VirtualNetworkProfile: &armhdinsight.VirtualNetworkProfile{ - // ID: to.Ptr("/subscriptions/subId/resourceGroups/rg/providers/Microsoft.Network/virtualNetworks/vnetname"), - // Subnet: to.Ptr("/subscriptions/subId/resourceGroups/rg/providers/Microsoft.Network/virtualNetworks/vnetname/subnets/vnetsubnet"), - // }, - // }, - // { - // Name: to.Ptr("workernode"), - // HardwareProfile: &armhdinsight.HardwareProfile{ - // VMSize: to.Ptr("standard_d3"), - // }, - // OSProfile: &armhdinsight.OsProfile{ - // LinuxOperatingSystemProfile: &armhdinsight.LinuxOperatingSystemProfile{ - // Username: to.Ptr("sshuser"), - // }, - // }, - // TargetInstanceCount: to.Ptr[int32](2), - // VirtualNetworkProfile: &armhdinsight.VirtualNetworkProfile{ - // ID: to.Ptr("/subscriptions/subId/resourceGroups/rg/providers/Microsoft.Network/virtualNetworks/vnetname"), - // Subnet: to.Ptr("/subscriptions/subId/resourceGroups/rg/providers/Microsoft.Network/virtualNetworks/vnetname/subnets/vnetsubnet"), - // }, - // }}, - // }, - // CreatedDate: to.Ptr("2020-06-09T12:25:43.48"), - // OSType: to.Ptr(armhdinsight.OSTypeLinux), - // ProvisioningState: to.Ptr(armhdinsight.HDInsightClusterProvisioningStateSucceeded), - // QuotaInfo: &armhdinsight.QuotaInfo{ - // CoresUsed: to.Ptr[int32](16), - // }, - // Tier: to.Ptr(armhdinsight.TierStandard), - // }, - // Zones: []*string{ - // to.Ptr("1")}, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7a2ac91de424f271cf91cc8009f3fe9ee8249086/specification/hdinsight/resource-manager/Microsoft.HDInsight/stable/2021-06-01/examples/CreateHDInsightClusterWithComputeIsolationProperties.json -func ExampleClustersClient_BeginCreate_createClusterWithComputeIsolationProperties() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armhdinsight.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewClustersClient().BeginCreate(ctx, "rg1", "cluster1", armhdinsight.ClusterCreateParametersExtended{ - Properties: &armhdinsight.ClusterCreateProperties{ - ClusterDefinition: &armhdinsight.ClusterDefinition{ - Configurations: map[string]any{ - "gateway": map[string]any{ - "restAuthCredential.isEnabled": true, - "restAuthCredential.password": "**********", - "restAuthCredential.username": "admin", - }, - }, - Kind: to.Ptr("hadoop"), - }, - ClusterVersion: to.Ptr("3.6"), - ComputeIsolationProperties: &armhdinsight.ComputeIsolationProperties{ - EnableComputeIsolation: to.Ptr(true), - }, - ComputeProfile: &armhdinsight.ComputeProfile{ - Roles: []*armhdinsight.Role{ - { - Name: to.Ptr("headnode"), - HardwareProfile: &armhdinsight.HardwareProfile{ - VMSize: to.Ptr("standard_d3"), - }, - OSProfile: &armhdinsight.OsProfile{ - LinuxOperatingSystemProfile: &armhdinsight.LinuxOperatingSystemProfile{ - Password: to.Ptr("**********"), - SSHProfile: &armhdinsight.SSHProfile{ - PublicKeys: []*armhdinsight.SSHPublicKey{ - { - CertificateData: to.Ptr("**********"), - }}, - }, - Username: to.Ptr("sshuser"), - }, - }, - TargetInstanceCount: to.Ptr[int32](2), - }, - { - Name: to.Ptr("workernode"), - HardwareProfile: &armhdinsight.HardwareProfile{ - VMSize: to.Ptr("standard_d3"), - }, - OSProfile: &armhdinsight.OsProfile{ - LinuxOperatingSystemProfile: &armhdinsight.LinuxOperatingSystemProfile{ - Password: to.Ptr("**********"), - SSHProfile: &armhdinsight.SSHProfile{ - PublicKeys: []*armhdinsight.SSHPublicKey{ - { - CertificateData: to.Ptr("**********"), - }}, - }, - Username: to.Ptr("sshuser"), - }, - }, - TargetInstanceCount: to.Ptr[int32](2), - }}, - }, - OSType: to.Ptr(armhdinsight.OSTypeLinux), - StorageProfile: &armhdinsight.StorageProfile{ - Storageaccounts: []*armhdinsight.StorageAccount{ - { - Name: to.Ptr("mystorage"), - Container: to.Ptr("containername"), - IsDefault: to.Ptr(true), - Key: to.Ptr("storage account key"), - }}, - }, - }, - }, 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 = armhdinsight.Cluster{ - // Name: to.Ptr("cluster1"), - // Type: to.Ptr("Microsoft.HDInsight/clusters"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.HDInsight/clusters/cluster1"), - // Location: to.Ptr("South Central US"), - // Etag: to.Ptr("fdf2a6e8-ce83-42cc-8c2d-0ceb11a370ff"), - // Properties: &armhdinsight.ClusterGetProperties{ - // ClusterDefinition: &armhdinsight.ClusterDefinition{ - // Blueprint: to.Ptr("https://blueprints.azurehdinsight.net/hadoop-3.6.1000.67.2005040905.json"), - // Kind: to.Ptr("hadoop"), - // }, - // ClusterID: to.Ptr("8186508b6234470e9d16c9e8e13bd821"), - // ClusterState: to.Ptr("Running"), - // ClusterVersion: to.Ptr("3.6.1000.67"), - // ComputeIsolationProperties: &armhdinsight.ComputeIsolationProperties{ - // EnableComputeIsolation: to.Ptr(true), - // }, - // ComputeProfile: &armhdinsight.ComputeProfile{ - // Roles: []*armhdinsight.Role{ - // { - // Name: to.Ptr("headnode"), - // HardwareProfile: &armhdinsight.HardwareProfile{ - // VMSize: to.Ptr("standard_d3"), - // }, - // OSProfile: &armhdinsight.OsProfile{ - // LinuxOperatingSystemProfile: &armhdinsight.LinuxOperatingSystemProfile{ - // Username: to.Ptr("sshuser"), - // }, - // }, - // TargetInstanceCount: to.Ptr[int32](2), - // VirtualNetworkProfile: &armhdinsight.VirtualNetworkProfile{ - // ID: to.Ptr("/subscriptions/subId/resourceGroups/rg/providers/Microsoft.Network/virtualNetworks/vnetname"), - // Subnet: to.Ptr("/subscriptions/subId/resourceGroups/rg/providers/Microsoft.Network/virtualNetworks/vnetname/subnets/vnetsubnet"), - // }, - // }, - // { - // Name: to.Ptr("workernode"), - // HardwareProfile: &armhdinsight.HardwareProfile{ - // VMSize: to.Ptr("standard_d3"), - // }, - // OSProfile: &armhdinsight.OsProfile{ - // LinuxOperatingSystemProfile: &armhdinsight.LinuxOperatingSystemProfile{ - // Username: to.Ptr("sshuser"), - // }, - // }, - // TargetInstanceCount: to.Ptr[int32](2), - // }}, - // }, - // CreatedDate: to.Ptr("2020-06-09T12:25:43.48"), - // OSType: to.Ptr(armhdinsight.OSTypeLinux), - // ProvisioningState: to.Ptr(armhdinsight.HDInsightClusterProvisioningStateSucceeded), - // QuotaInfo: &armhdinsight.QuotaInfo{ - // CoresUsed: to.Ptr[int32](16), - // }, - // Tier: to.Ptr(armhdinsight.TierStandard), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7a2ac91de424f271cf91cc8009f3fe9ee8249086/specification/hdinsight/resource-manager/Microsoft.HDInsight/stable/2021-06-01/examples/CreateHDInsightClusterWithEncryptionAtHost.json -func ExampleClustersClient_BeginCreate_createClusterWithEncryptionAtHost() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armhdinsight.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewClustersClient().BeginCreate(ctx, "rg1", "cluster1", armhdinsight.ClusterCreateParametersExtended{ - Properties: &armhdinsight.ClusterCreateProperties{ - ClusterDefinition: &armhdinsight.ClusterDefinition{ - Configurations: map[string]any{ - "gateway": map[string]any{ - "restAuthCredential.isEnabled": true, - "restAuthCredential.password": "**********", - "restAuthCredential.username": "admin", - }, - }, - Kind: to.Ptr("Hadoop"), - }, - ClusterVersion: to.Ptr("3.6"), - ComputeProfile: &armhdinsight.ComputeProfile{ - Roles: []*armhdinsight.Role{ - { - Name: to.Ptr("headnode"), - HardwareProfile: &armhdinsight.HardwareProfile{ - VMSize: to.Ptr("Standard_DS14_v2"), - }, - OSProfile: &armhdinsight.OsProfile{ - LinuxOperatingSystemProfile: &armhdinsight.LinuxOperatingSystemProfile{ - Password: to.Ptr("**********"), - Username: to.Ptr("sshuser"), - }, - }, - TargetInstanceCount: to.Ptr[int32](2), - }, - { - Name: to.Ptr("workernode"), - HardwareProfile: &armhdinsight.HardwareProfile{ - VMSize: to.Ptr("Standard_DS14_v2"), - }, - OSProfile: &armhdinsight.OsProfile{ - LinuxOperatingSystemProfile: &armhdinsight.LinuxOperatingSystemProfile{ - Password: to.Ptr("**********"), - Username: to.Ptr("sshuser"), - }, - }, - TargetInstanceCount: to.Ptr[int32](3), - }, - { - Name: to.Ptr("zookeepernode"), - HardwareProfile: &armhdinsight.HardwareProfile{ - VMSize: to.Ptr("Standard_DS14_v2"), - }, - OSProfile: &armhdinsight.OsProfile{ - LinuxOperatingSystemProfile: &armhdinsight.LinuxOperatingSystemProfile{ - Password: to.Ptr("**********"), - Username: to.Ptr("sshuser"), - }, - }, - TargetInstanceCount: to.Ptr[int32](3), - }}, - }, - DiskEncryptionProperties: &armhdinsight.DiskEncryptionProperties{ - EncryptionAtHost: to.Ptr(true), - }, - OSType: to.Ptr(armhdinsight.OSTypeLinux), - StorageProfile: &armhdinsight.StorageProfile{ - Storageaccounts: []*armhdinsight.StorageAccount{ - { - Name: to.Ptr("mystorage.blob.core.windows.net"), - Container: to.Ptr("default8525"), - IsDefault: to.Ptr(true), - Key: to.Ptr("storagekey"), - }}, - }, - Tier: to.Ptr(armhdinsight.TierStandard), - }, - }, 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 = armhdinsight.Cluster{ - // Name: to.Ptr("cluster1"), - // Type: to.Ptr("Microsoft.HDInsight/clusters"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.HDInsight/clusters/cluster1"), - // Location: to.Ptr("South Central US"), - // Etag: to.Ptr("3b76ce3d-892c-4036-9d8b-8ade18ba7a4b"), - // Properties: &armhdinsight.ClusterGetProperties{ - // ClusterDefinition: &armhdinsight.ClusterDefinition{ - // Blueprint: to.Ptr("https://blueprints.azurehdinsight.net/hadoop-3.6.1000.67.2001080246.json"), - // ComponentVersion: map[string]*string{ - // "Hadoop": to.Ptr("2.7"), - // }, - // Kind: to.Ptr("Hadoop"), - // }, - // ClusterState: to.Ptr("Running"), - // ClusterVersion: to.Ptr("3.6.1000.67"), - // ComputeProfile: &armhdinsight.ComputeProfile{ - // Roles: []*armhdinsight.Role{ - // { - // Name: to.Ptr("headnode"), - // HardwareProfile: &armhdinsight.HardwareProfile{ - // VMSize: to.Ptr("standard_ds14_v2"), - // }, - // OSProfile: &armhdinsight.OsProfile{ - // LinuxOperatingSystemProfile: &armhdinsight.LinuxOperatingSystemProfile{ - // Username: to.Ptr("sshuser"), - // }, - // }, - // TargetInstanceCount: to.Ptr[int32](2), - // }, - // { - // Name: to.Ptr("workernode"), - // HardwareProfile: &armhdinsight.HardwareProfile{ - // VMSize: to.Ptr("standard_ds14_v2"), - // }, - // OSProfile: &armhdinsight.OsProfile{ - // LinuxOperatingSystemProfile: &armhdinsight.LinuxOperatingSystemProfile{ - // Username: to.Ptr("sshuser"), - // }, - // }, - // TargetInstanceCount: to.Ptr[int32](3), - // }, - // { - // Name: to.Ptr("zookeepernode"), - // HardwareProfile: &armhdinsight.HardwareProfile{ - // VMSize: to.Ptr("standard_ds14_v2"), - // }, - // OSProfile: &armhdinsight.OsProfile{ - // LinuxOperatingSystemProfile: &armhdinsight.LinuxOperatingSystemProfile{ - // Username: to.Ptr("sshuser"), - // }, - // }, - // TargetInstanceCount: to.Ptr[int32](3), - // }}, - // }, - // ConnectivityEndpoints: []*armhdinsight.ConnectivityEndpoint{ - // { - // Name: to.Ptr("SSH"), - // Location: to.Ptr("cluster1-ssh.azurehdinsight.net"), - // Port: to.Ptr[int32](22), - // Protocol: to.Ptr("TCP"), - // }, - // { - // Name: to.Ptr("HTTPS"), - // Location: to.Ptr("cluster1.azurehdinsight.net"), - // Port: to.Ptr[int32](443), - // Protocol: to.Ptr("TCP"), - // }}, - // CreatedDate: to.Ptr("2020-01-10T08:36:39.153"), - // DiskEncryptionProperties: &armhdinsight.DiskEncryptionProperties{ - // EncryptionAtHost: to.Ptr(true), - // }, - // OSType: to.Ptr(armhdinsight.OSTypeLinux), - // ProvisioningState: to.Ptr(armhdinsight.HDInsightClusterProvisioningStateSucceeded), - // QuotaInfo: &armhdinsight.QuotaInfo{ - // CoresUsed: to.Ptr[int32](20), - // }, - // Tier: to.Ptr(armhdinsight.TierStandard), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7a2ac91de424f271cf91cc8009f3fe9ee8249086/specification/hdinsight/resource-manager/Microsoft.HDInsight/stable/2021-06-01/examples/CreateHDInsightClusterWithEncryptionInTransit.json -func ExampleClustersClient_BeginCreate_createClusterWithEncryptionInTransit() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armhdinsight.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewClustersClient().BeginCreate(ctx, "rg1", "cluster1", armhdinsight.ClusterCreateParametersExtended{ - Properties: &armhdinsight.ClusterCreateProperties{ - ClusterDefinition: &armhdinsight.ClusterDefinition{ - Configurations: map[string]any{ - "gateway": map[string]any{ - "restAuthCredential.isEnabled": true, - "restAuthCredential.password": "**********", - "restAuthCredential.username": "admin", - }, - }, - Kind: to.Ptr("Hadoop"), - }, - ClusterVersion: to.Ptr("3.6"), - ComputeProfile: &armhdinsight.ComputeProfile{ - Roles: []*armhdinsight.Role{ - { - Name: to.Ptr("headnode"), - HardwareProfile: &armhdinsight.HardwareProfile{ - VMSize: to.Ptr("Large"), - }, - OSProfile: &armhdinsight.OsProfile{ - LinuxOperatingSystemProfile: &armhdinsight.LinuxOperatingSystemProfile{ - Password: to.Ptr("**********"), - Username: to.Ptr("sshuser"), - }, - }, - TargetInstanceCount: to.Ptr[int32](2), - }, - { - Name: to.Ptr("workernode"), - HardwareProfile: &armhdinsight.HardwareProfile{ - VMSize: to.Ptr("Large"), - }, - OSProfile: &armhdinsight.OsProfile{ - LinuxOperatingSystemProfile: &armhdinsight.LinuxOperatingSystemProfile{ - Password: to.Ptr("**********"), - Username: to.Ptr("sshuser"), - }, - }, - TargetInstanceCount: to.Ptr[int32](3), - }, - { - Name: to.Ptr("zookeepernode"), - HardwareProfile: &armhdinsight.HardwareProfile{ - VMSize: to.Ptr("Small"), - }, - OSProfile: &armhdinsight.OsProfile{ - LinuxOperatingSystemProfile: &armhdinsight.LinuxOperatingSystemProfile{ - Password: to.Ptr("**********"), - Username: to.Ptr("sshuser"), - }, - }, - TargetInstanceCount: to.Ptr[int32](3), - }}, - }, - EncryptionInTransitProperties: &armhdinsight.EncryptionInTransitProperties{ - IsEncryptionInTransitEnabled: to.Ptr(true), - }, - OSType: to.Ptr(armhdinsight.OSTypeLinux), - StorageProfile: &armhdinsight.StorageProfile{ - Storageaccounts: []*armhdinsight.StorageAccount{ - { - Name: to.Ptr("mystorage.blob.core.windows.net"), - Container: to.Ptr("default8525"), - IsDefault: to.Ptr(true), - Key: to.Ptr("storagekey"), - }}, - }, - Tier: to.Ptr(armhdinsight.TierStandard), - }, - }, 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 = armhdinsight.Cluster{ - // Name: to.Ptr("cluster1"), - // Type: to.Ptr("Microsoft.HDInsight/clusters"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.HDInsight/clusters/cluster1"), - // Location: to.Ptr("South Central US"), - // Etag: to.Ptr("3b76ce3d-892c-4036-9d8b-8ade18ba7a4b"), - // Properties: &armhdinsight.ClusterGetProperties{ - // ClusterDefinition: &armhdinsight.ClusterDefinition{ - // Blueprint: to.Ptr("https://blueprints.azurehdinsight.net/hadoop-3.6.1000.67.2001080246.json"), - // ComponentVersion: map[string]*string{ - // "Hadoop": to.Ptr("2.7"), - // }, - // Kind: to.Ptr("Hadoop"), - // }, - // ClusterState: to.Ptr("Running"), - // ClusterVersion: to.Ptr("3.6.1000.67"), - // ComputeProfile: &armhdinsight.ComputeProfile{ - // Roles: []*armhdinsight.Role{ - // { - // Name: to.Ptr("headnode"), - // HardwareProfile: &armhdinsight.HardwareProfile{ - // VMSize: to.Ptr("standard_a4_v2"), - // }, - // OSProfile: &armhdinsight.OsProfile{ - // LinuxOperatingSystemProfile: &armhdinsight.LinuxOperatingSystemProfile{ - // Username: to.Ptr("sshuser"), - // }, - // }, - // TargetInstanceCount: to.Ptr[int32](2), - // }, - // { - // Name: to.Ptr("workernode"), - // HardwareProfile: &armhdinsight.HardwareProfile{ - // VMSize: to.Ptr("standard_a4_v2"), - // }, - // OSProfile: &armhdinsight.OsProfile{ - // LinuxOperatingSystemProfile: &armhdinsight.LinuxOperatingSystemProfile{ - // Username: to.Ptr("sshuser"), - // }, - // }, - // TargetInstanceCount: to.Ptr[int32](3), - // }, - // { - // Name: to.Ptr("zookeepernode"), - // HardwareProfile: &armhdinsight.HardwareProfile{ - // VMSize: to.Ptr("standard_a2_v2"), - // }, - // OSProfile: &armhdinsight.OsProfile{ - // LinuxOperatingSystemProfile: &armhdinsight.LinuxOperatingSystemProfile{ - // Username: to.Ptr("sshuser"), - // }, - // }, - // TargetInstanceCount: to.Ptr[int32](3), - // }}, - // }, - // ConnectivityEndpoints: []*armhdinsight.ConnectivityEndpoint{ - // { - // Name: to.Ptr("SSH"), - // Location: to.Ptr("cluster1-ssh.azurehdinsight.net"), - // Port: to.Ptr[int32](22), - // Protocol: to.Ptr("TCP"), - // }, - // { - // Name: to.Ptr("HTTPS"), - // Location: to.Ptr("cluster1.azurehdinsight.net"), - // Port: to.Ptr[int32](443), - // Protocol: to.Ptr("TCP"), - // }}, - // CreatedDate: to.Ptr("2020-01-10T08:36:39.153"), - // EncryptionInTransitProperties: &armhdinsight.EncryptionInTransitProperties{ - // IsEncryptionInTransitEnabled: to.Ptr(true), - // }, - // OSType: to.Ptr(armhdinsight.OSTypeLinux), - // ProvisioningState: to.Ptr(armhdinsight.HDInsightClusterProvisioningStateSucceeded), - // QuotaInfo: &armhdinsight.QuotaInfo{ - // CoresUsed: to.Ptr[int32](20), - // }, - // Tier: to.Ptr(armhdinsight.TierStandard), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7a2ac91de424f271cf91cc8009f3fe9ee8249086/specification/hdinsight/resource-manager/Microsoft.HDInsight/stable/2021-06-01/examples/CreateHDInsightClusterWithCustomNetworkProperties.json -func ExampleClustersClient_BeginCreate_createClusterWithNetworkProperties() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armhdinsight.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewClustersClient().BeginCreate(ctx, "rg1", "cluster1", armhdinsight.ClusterCreateParametersExtended{ - Properties: &armhdinsight.ClusterCreateProperties{ - ClusterDefinition: &armhdinsight.ClusterDefinition{ - Configurations: map[string]any{ - "gateway": map[string]any{ - "restAuthCredential.isEnabled": true, - "restAuthCredential.password": "**********", - "restAuthCredential.username": "admin", - }, - }, - Kind: to.Ptr("hadoop"), - }, - ClusterVersion: to.Ptr("3.6"), - ComputeProfile: &armhdinsight.ComputeProfile{ - Roles: []*armhdinsight.Role{ - { - Name: to.Ptr("headnode"), - HardwareProfile: &armhdinsight.HardwareProfile{ - VMSize: to.Ptr("standard_d3"), - }, - OSProfile: &armhdinsight.OsProfile{ - LinuxOperatingSystemProfile: &armhdinsight.LinuxOperatingSystemProfile{ - Password: to.Ptr("**********"), - SSHProfile: &armhdinsight.SSHProfile{ - PublicKeys: []*armhdinsight.SSHPublicKey{ - { - CertificateData: to.Ptr("**********"), - }}, - }, - Username: to.Ptr("sshuser"), - }, - }, - TargetInstanceCount: to.Ptr[int32](2), - VirtualNetworkProfile: &armhdinsight.VirtualNetworkProfile{ - ID: to.Ptr("/subscriptions/subId/resourceGroups/rg/providers/Microsoft.Network/virtualNetworks/vnetname"), - Subnet: to.Ptr("/subscriptions/subId/resourceGroups/rg/providers/Microsoft.Network/virtualNetworks/vnetname/subnets/vnetsubnet"), - }, - }, - { - Name: to.Ptr("workernode"), - HardwareProfile: &armhdinsight.HardwareProfile{ - VMSize: to.Ptr("standard_d3"), - }, - OSProfile: &armhdinsight.OsProfile{ - LinuxOperatingSystemProfile: &armhdinsight.LinuxOperatingSystemProfile{ - Password: to.Ptr("**********"), - SSHProfile: &armhdinsight.SSHProfile{ - PublicKeys: []*armhdinsight.SSHPublicKey{ - { - CertificateData: to.Ptr("**********"), - }}, - }, - Username: to.Ptr("sshuser"), - }, - }, - TargetInstanceCount: to.Ptr[int32](2), - VirtualNetworkProfile: &armhdinsight.VirtualNetworkProfile{ - ID: to.Ptr("/subscriptions/subId/resourceGroups/rg/providers/Microsoft.Network/virtualNetworks/vnetname"), - Subnet: to.Ptr("/subscriptions/subId/resourceGroups/rg/providers/Microsoft.Network/virtualNetworks/vnetname/subnets/vnetsubnet"), - }, - }}, - }, - NetworkProperties: &armhdinsight.NetworkProperties{ - PrivateLink: to.Ptr(armhdinsight.PrivateLinkEnabled), - ResourceProviderConnection: to.Ptr(armhdinsight.ResourceProviderConnectionOutbound), - }, - OSType: to.Ptr(armhdinsight.OSTypeLinux), - StorageProfile: &armhdinsight.StorageProfile{ - Storageaccounts: []*armhdinsight.StorageAccount{ - { - Name: to.Ptr("mystorage"), - Container: to.Ptr("containername"), - IsDefault: to.Ptr(true), - Key: to.Ptr("storage account key"), - }}, - }, - }, - }, 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 = armhdinsight.Cluster{ - // Name: to.Ptr("cluster1"), - // Type: to.Ptr("Microsoft.HDInsight/clusters"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.HDInsight/clusters/cluster1"), - // Location: to.Ptr("South Central US"), - // Etag: to.Ptr("fdf2a6e8-ce83-42cc-8c2d-0ceb11a370ff"), - // Properties: &armhdinsight.ClusterGetProperties{ - // ClusterDefinition: &armhdinsight.ClusterDefinition{ - // Blueprint: to.Ptr("https://blueprints.azurehdinsight.net/hadoop-3.6.1000.67.2005040905.json"), - // Kind: to.Ptr("hadoop"), - // }, - // ClusterID: to.Ptr("8186508b6234470e9d16c9e8e13bd821"), - // ClusterState: to.Ptr("Running"), - // ClusterVersion: to.Ptr("3.6.1000.67"), - // ComputeProfile: &armhdinsight.ComputeProfile{ - // Roles: []*armhdinsight.Role{ - // { - // Name: to.Ptr("headnode"), - // HardwareProfile: &armhdinsight.HardwareProfile{ - // VMSize: to.Ptr("standard_d3"), - // }, - // OSProfile: &armhdinsight.OsProfile{ - // LinuxOperatingSystemProfile: &armhdinsight.LinuxOperatingSystemProfile{ - // Username: to.Ptr("sshuser"), - // }, - // }, - // TargetInstanceCount: to.Ptr[int32](2), - // VirtualNetworkProfile: &armhdinsight.VirtualNetworkProfile{ - // ID: to.Ptr("/subscriptions/subId/resourceGroups/rg/providers/Microsoft.Network/virtualNetworks/vnetname"), - // Subnet: to.Ptr("/subscriptions/subId/resourceGroups/rg/providers/Microsoft.Network/virtualNetworks/vnetname/subnets/vnetsubnet"), - // }, - // }, - // { - // Name: to.Ptr("workernode"), - // HardwareProfile: &armhdinsight.HardwareProfile{ - // VMSize: to.Ptr("standard_d3"), - // }, - // OSProfile: &armhdinsight.OsProfile{ - // LinuxOperatingSystemProfile: &armhdinsight.LinuxOperatingSystemProfile{ - // Username: to.Ptr("sshuser"), - // }, - // }, - // TargetInstanceCount: to.Ptr[int32](2), - // VirtualNetworkProfile: &armhdinsight.VirtualNetworkProfile{ - // ID: to.Ptr("/subscriptions/subId/resourceGroups/rg/providers/Microsoft.Network/virtualNetworks/vnetname"), - // Subnet: to.Ptr("/subscriptions/subId/resourceGroups/rg/providers/Microsoft.Network/virtualNetworks/vnetname/subnets/vnetsubnet"), - // }, - // }}, - // }, - // CreatedDate: to.Ptr("2020-06-09T12:25:43.48"), - // NetworkProperties: &armhdinsight.NetworkProperties{ - // PrivateLink: to.Ptr(armhdinsight.PrivateLinkEnabled), - // ResourceProviderConnection: to.Ptr(armhdinsight.ResourceProviderConnectionOutbound), - // }, - // OSType: to.Ptr(armhdinsight.OSTypeLinux), - // ProvisioningState: to.Ptr(armhdinsight.HDInsightClusterProvisioningStateSucceeded), - // QuotaInfo: &armhdinsight.QuotaInfo{ - // CoresUsed: to.Ptr[int32](16), - // }, - // Tier: to.Ptr(armhdinsight.TierStandard), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7a2ac91de424f271cf91cc8009f3fe9ee8249086/specification/hdinsight/resource-manager/Microsoft.HDInsight/stable/2021-06-01/examples/PatchLinuxHadoopCluster.json -func ExampleClustersClient_Update() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armhdinsight.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewClustersClient().Update(ctx, "rg1", "cluster1", armhdinsight.ClusterPatchParameters{ - Tags: map[string]*string{ - "key1": to.Ptr("val1"), - "key2": to.Ptr("val2"), - }, - }, 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 = armhdinsight.Cluster{ - // Name: to.Ptr("cluster1"), - // Type: to.Ptr("Microsoft.HDInsight/clusters"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.HDInsight/clusters/cluster1"), - // Location: to.Ptr("West US"), - // Tags: map[string]*string{ - // "key1": to.Ptr("val1"), - // "key2": to.Ptr("val2"), - // }, - // Etag: to.Ptr("f0212a39-b827-45e0-9ffa-4f5232e58851"), - // Properties: &armhdinsight.ClusterGetProperties{ - // ClusterDefinition: &armhdinsight.ClusterDefinition{ - // Blueprint: to.Ptr("https://blueprints.azurehdinsight.net/hadoop-3.5.1000.0.9243893.json"), - // Kind: to.Ptr("hadoop"), - // }, - // ClusterState: to.Ptr("Running"), - // ClusterVersion: to.Ptr("3.5.1000.0"), - // ComputeProfile: &armhdinsight.ComputeProfile{ - // Roles: []*armhdinsight.Role{ - // { - // Name: to.Ptr("headnode"), - // HardwareProfile: &armhdinsight.HardwareProfile{ - // VMSize: to.Ptr("Standard_D3_V2"), - // }, - // OSProfile: &armhdinsight.OsProfile{ - // LinuxOperatingSystemProfile: &armhdinsight.LinuxOperatingSystemProfile{ - // Username: to.Ptr("sshuser"), - // }, - // }, - // TargetInstanceCount: to.Ptr[int32](2), - // }, - // { - // Name: to.Ptr("workernode"), - // HardwareProfile: &armhdinsight.HardwareProfile{ - // VMSize: to.Ptr("Standard_D3_V2"), - // }, - // OSProfile: &armhdinsight.OsProfile{ - // LinuxOperatingSystemProfile: &armhdinsight.LinuxOperatingSystemProfile{ - // Username: to.Ptr("sshuser"), - // }, - // }, - // TargetInstanceCount: to.Ptr[int32](4), - // }, - // { - // Name: to.Ptr("zookeepernode"), - // HardwareProfile: &armhdinsight.HardwareProfile{ - // VMSize: to.Ptr("Medium"), - // }, - // OSProfile: &armhdinsight.OsProfile{ - // LinuxOperatingSystemProfile: &armhdinsight.LinuxOperatingSystemProfile{ - // Username: to.Ptr("sshuser"), - // }, - // }, - // TargetInstanceCount: to.Ptr[int32](3), - // }}, - // }, - // ConnectivityEndpoints: []*armhdinsight.ConnectivityEndpoint{ - // { - // Name: to.Ptr("SSH"), - // Location: to.Ptr("cluster1-ssh.azurehdinsight.net"), - // Port: to.Ptr[int32](22), - // Protocol: to.Ptr("TCP"), - // }, - // { - // Name: to.Ptr("HTTPS"), - // Location: to.Ptr("cluster1.azurehdinsight.net"), - // Port: to.Ptr[int32](443), - // Protocol: to.Ptr("TCP"), - // }}, - // CreatedDate: to.Ptr("2017-01-11T18:58:26.187"), - // OSType: to.Ptr(armhdinsight.OSTypeLinux), - // ProvisioningState: to.Ptr(armhdinsight.HDInsightClusterProvisioningStateSucceeded), - // QuotaInfo: &armhdinsight.QuotaInfo{ - // CoresUsed: to.Ptr[int32](24), - // }, - // Tier: to.Ptr(armhdinsight.TierStandard), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7a2ac91de424f271cf91cc8009f3fe9ee8249086/specification/hdinsight/resource-manager/Microsoft.HDInsight/stable/2021-06-01/examples/DeleteLinuxHadoopCluster.json -func ExampleClustersClient_BeginDelete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armhdinsight.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewClustersClient().BeginDelete(ctx, "rg1", "cluster1", 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/7a2ac91de424f271cf91cc8009f3fe9ee8249086/specification/hdinsight/resource-manager/Microsoft.HDInsight/stable/2021-06-01/examples/GetLinuxHadoopCluster.json -func ExampleClustersClient_Get_getHadoopOnLinuxCluster() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armhdinsight.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewClustersClient().Get(ctx, "rg1", "cluster1", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.Cluster = armhdinsight.Cluster{ - // Name: to.Ptr("cluster1"), - // Type: to.Ptr("Microsoft.HDInsight/clusters"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.HDInsight/clusters/cluster1"), - // Location: to.Ptr("West US"), - // Tags: map[string]*string{ - // "key1": to.Ptr("val1"), - // }, - // Etag: to.Ptr("f0212a39-b827-45e0-9ffa-4f5232e58851"), - // Properties: &armhdinsight.ClusterGetProperties{ - // ClusterDefinition: &armhdinsight.ClusterDefinition{ - // Blueprint: to.Ptr("https://blueprints.azurehdinsight.net/hadoop-3.5.1000.0.9243893.json"), - // Kind: to.Ptr("hadoop"), - // }, - // ClusterState: to.Ptr("Running"), - // ClusterVersion: to.Ptr("3.5.1000.0"), - // ComputeProfile: &armhdinsight.ComputeProfile{ - // Roles: []*armhdinsight.Role{ - // { - // Name: to.Ptr("headnode"), - // HardwareProfile: &armhdinsight.HardwareProfile{ - // VMSize: to.Ptr("Standard_D3_V2"), - // }, - // OSProfile: &armhdinsight.OsProfile{ - // LinuxOperatingSystemProfile: &armhdinsight.LinuxOperatingSystemProfile{ - // Username: to.Ptr("sshuser"), - // }, - // }, - // TargetInstanceCount: to.Ptr[int32](2), - // }, - // { - // Name: to.Ptr("workernode"), - // HardwareProfile: &armhdinsight.HardwareProfile{ - // VMSize: to.Ptr("Standard_D3_V2"), - // }, - // OSProfile: &armhdinsight.OsProfile{ - // LinuxOperatingSystemProfile: &armhdinsight.LinuxOperatingSystemProfile{ - // Username: to.Ptr("sshuser"), - // }, - // }, - // TargetInstanceCount: to.Ptr[int32](4), - // }, - // { - // Name: to.Ptr("zookeepernode"), - // HardwareProfile: &armhdinsight.HardwareProfile{ - // VMSize: to.Ptr("Medium"), - // }, - // OSProfile: &armhdinsight.OsProfile{ - // LinuxOperatingSystemProfile: &armhdinsight.LinuxOperatingSystemProfile{ - // Username: to.Ptr("sshuser"), - // }, - // }, - // TargetInstanceCount: to.Ptr[int32](3), - // }}, - // }, - // ConnectivityEndpoints: []*armhdinsight.ConnectivityEndpoint{ - // { - // Name: to.Ptr("SSH"), - // Location: to.Ptr("cluster1-ssh.azurehdinsight.net"), - // Port: to.Ptr[int32](22), - // Protocol: to.Ptr("TCP"), - // }, - // { - // Name: to.Ptr("HTTPS"), - // Location: to.Ptr("cluster1.azurehdinsight.net"), - // Port: to.Ptr[int32](443), - // Protocol: to.Ptr("TCP"), - // }}, - // CreatedDate: to.Ptr("2017-01-11T18:58:26.187"), - // OSType: to.Ptr(armhdinsight.OSTypeLinux), - // ProvisioningState: to.Ptr(armhdinsight.HDInsightClusterProvisioningStateSucceeded), - // QuotaInfo: &armhdinsight.QuotaInfo{ - // CoresUsed: to.Ptr[int32](24), - // }, - // Tier: to.Ptr(armhdinsight.TierStandard), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7a2ac91de424f271cf91cc8009f3fe9ee8249086/specification/hdinsight/resource-manager/Microsoft.HDInsight/stable/2021-06-01/examples/GetLinuxSparkCluster.json -func ExampleClustersClient_Get_getSparkOnLinuxCluster() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armhdinsight.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewClustersClient().Get(ctx, "rg1", "cluster1", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.Cluster = armhdinsight.Cluster{ - // Name: to.Ptr("cluster1"), - // Type: to.Ptr("Microsoft.HDInsight/clusters"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.HDInsight/clusters/cluster1"), - // Location: to.Ptr("West US"), - // Tags: map[string]*string{ - // "key1": to.Ptr("val1"), - // }, - // Etag: to.Ptr("4cd8b5a9-ca9c-4239-9e5b-3916032e994c"), - // Properties: &armhdinsight.ClusterGetProperties{ - // ClusterDefinition: &armhdinsight.ClusterDefinition{ - // Blueprint: to.Ptr("https://blueprints.azurehdinsight.net/spark-3.5.1000.0.9625065.json"), - // ComponentVersion: map[string]*string{ - // "Spark": to.Ptr("2.0"), - // }, - // Kind: to.Ptr("SPARK"), - // }, - // ClusterState: to.Ptr("Running"), - // ClusterVersion: to.Ptr("3.5.1000.0"), - // ComputeProfile: &armhdinsight.ComputeProfile{ - // Roles: []*armhdinsight.Role{ - // { - // Name: to.Ptr("headnode"), - // HardwareProfile: &armhdinsight.HardwareProfile{ - // VMSize: to.Ptr("Standard_D12_V2"), - // }, - // OSProfile: &armhdinsight.OsProfile{ - // LinuxOperatingSystemProfile: &armhdinsight.LinuxOperatingSystemProfile{ - // Username: to.Ptr("sshuser"), - // }, - // }, - // TargetInstanceCount: to.Ptr[int32](2), - // }, - // { - // Name: to.Ptr("workernode"), - // HardwareProfile: &armhdinsight.HardwareProfile{ - // VMSize: to.Ptr("Standard_D4_V2"), - // }, - // OSProfile: &armhdinsight.OsProfile{ - // LinuxOperatingSystemProfile: &armhdinsight.LinuxOperatingSystemProfile{ - // Username: to.Ptr("sshuser"), - // }, - // }, - // TargetInstanceCount: to.Ptr[int32](4), - // }, - // { - // Name: to.Ptr("zookeepernode"), - // HardwareProfile: &armhdinsight.HardwareProfile{ - // VMSize: to.Ptr("Medium"), - // }, - // OSProfile: &armhdinsight.OsProfile{ - // LinuxOperatingSystemProfile: &armhdinsight.LinuxOperatingSystemProfile{ - // Username: to.Ptr("sshuser"), - // }, - // }, - // TargetInstanceCount: to.Ptr[int32](3), - // }}, - // }, - // ConnectivityEndpoints: []*armhdinsight.ConnectivityEndpoint{ - // { - // Name: to.Ptr("SSH"), - // Location: to.Ptr("cluster1-ssh.azurehdinsight.net"), - // Port: to.Ptr[int32](22), - // Protocol: to.Ptr("TCP"), - // }, - // { - // Name: to.Ptr("HTTPS"), - // Location: to.Ptr("cluster1.azurehdinsight.net"), - // Port: to.Ptr[int32](443), - // Protocol: to.Ptr("TCP"), - // }}, - // CreatedDate: to.Ptr("2017-03-03T08:35:07.323"), - // OSType: to.Ptr(armhdinsight.OSTypeLinux), - // ProvisioningState: to.Ptr(armhdinsight.HDInsightClusterProvisioningStateSucceeded), - // QuotaInfo: &armhdinsight.QuotaInfo{ - // CoresUsed: to.Ptr[int32](40), - // }, - // Tier: to.Ptr(armhdinsight.TierStandard), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7a2ac91de424f271cf91cc8009f3fe9ee8249086/specification/hdinsight/resource-manager/Microsoft.HDInsight/stable/2021-06-01/examples/GetLinuxHadoopAllClustersInResourceGroup.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 := armhdinsight.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewClustersClient().NewListByResourceGroupPager("rg1", nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.ClusterListResult = armhdinsight.ClusterListResult{ - // Value: []*armhdinsight.Cluster{ - // { - // Name: to.Ptr("cluster1"), - // Type: to.Ptr("Microsoft.HDInsight/clusters"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.HDInsight/clusters/cluster1"), - // Location: to.Ptr("West US"), - // Tags: map[string]*string{ - // "key1": to.Ptr("val1"), - // }, - // Etag: to.Ptr("f0212a39-b827-45e0-9ffa-4f5232e58851"), - // Properties: &armhdinsight.ClusterGetProperties{ - // ClusterDefinition: &armhdinsight.ClusterDefinition{ - // Blueprint: to.Ptr("https://blueprints.azurehdinsight.net/hadoop-3.5.1000.0.9243893.json"), - // Kind: to.Ptr("hadoop"), - // }, - // ClusterState: to.Ptr("Running"), - // ClusterVersion: to.Ptr("3.5.1000.0"), - // ComputeProfile: &armhdinsight.ComputeProfile{ - // Roles: []*armhdinsight.Role{ - // { - // Name: to.Ptr("headnode"), - // HardwareProfile: &armhdinsight.HardwareProfile{ - // VMSize: to.Ptr("Standard_D3_V2"), - // }, - // OSProfile: &armhdinsight.OsProfile{ - // LinuxOperatingSystemProfile: &armhdinsight.LinuxOperatingSystemProfile{ - // Username: to.Ptr("pulkitssh"), - // }, - // }, - // TargetInstanceCount: to.Ptr[int32](2), - // }, - // { - // Name: to.Ptr("workernode"), - // HardwareProfile: &armhdinsight.HardwareProfile{ - // VMSize: to.Ptr("Standard_D3_V2"), - // }, - // OSProfile: &armhdinsight.OsProfile{ - // LinuxOperatingSystemProfile: &armhdinsight.LinuxOperatingSystemProfile{ - // Username: to.Ptr("pulkitssh"), - // }, - // }, - // TargetInstanceCount: to.Ptr[int32](4), - // }, - // { - // Name: to.Ptr("zookeepernode"), - // HardwareProfile: &armhdinsight.HardwareProfile{ - // VMSize: to.Ptr("Medium"), - // }, - // OSProfile: &armhdinsight.OsProfile{ - // LinuxOperatingSystemProfile: &armhdinsight.LinuxOperatingSystemProfile{ - // Username: to.Ptr("pulkitssh"), - // }, - // }, - // TargetInstanceCount: to.Ptr[int32](3), - // }}, - // }, - // ConnectivityEndpoints: []*armhdinsight.ConnectivityEndpoint{ - // { - // Name: to.Ptr("SSH"), - // Location: to.Ptr("cluster1-ssh.azurehdinsight.net"), - // Port: to.Ptr[int32](22), - // Protocol: to.Ptr("TCP"), - // }, - // { - // Name: to.Ptr("HTTPS"), - // Location: to.Ptr("cluster1.azurehdinsight.net"), - // Port: to.Ptr[int32](443), - // Protocol: to.Ptr("TCP"), - // }}, - // CreatedDate: to.Ptr("2017-01-11T18:58:26.187"), - // OSType: to.Ptr(armhdinsight.OSTypeLinux), - // ProvisioningState: to.Ptr(armhdinsight.HDInsightClusterProvisioningStateSucceeded), - // QuotaInfo: &armhdinsight.QuotaInfo{ - // CoresUsed: to.Ptr[int32](24), - // }, - // Tier: to.Ptr(armhdinsight.TierStandard), - // }, - // }, - // { - // Name: to.Ptr("cluster2"), - // Type: to.Ptr("Microsoft.HDInsight/clusters"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.HDInsight/clusters/cluster2"), - // Location: to.Ptr("West US"), - // Tags: map[string]*string{ - // "key1": to.Ptr("val1"), - // }, - // Etag: to.Ptr("f0212a39-b827-45e0-9ffa-4f5232e58851"), - // Properties: &armhdinsight.ClusterGetProperties{ - // ClusterDefinition: &armhdinsight.ClusterDefinition{ - // Blueprint: to.Ptr("https://blueprints.azurehdinsight.net/hadoop-3.5.1000.0.9243893.json"), - // Kind: to.Ptr("hadoop"), - // }, - // ClusterState: to.Ptr("Running"), - // ClusterVersion: to.Ptr("3.5.1000.0"), - // ComputeProfile: &armhdinsight.ComputeProfile{ - // Roles: []*armhdinsight.Role{ - // { - // Name: to.Ptr("headnode"), - // HardwareProfile: &armhdinsight.HardwareProfile{ - // VMSize: to.Ptr("Standard_D3_V2"), - // }, - // OSProfile: &armhdinsight.OsProfile{ - // LinuxOperatingSystemProfile: &armhdinsight.LinuxOperatingSystemProfile{ - // Username: to.Ptr("pulkitssh"), - // }, - // }, - // TargetInstanceCount: to.Ptr[int32](2), - // }, - // { - // Name: to.Ptr("workernode"), - // HardwareProfile: &armhdinsight.HardwareProfile{ - // VMSize: to.Ptr("Standard_D3_V2"), - // }, - // OSProfile: &armhdinsight.OsProfile{ - // LinuxOperatingSystemProfile: &armhdinsight.LinuxOperatingSystemProfile{ - // Username: to.Ptr("pulkitssh"), - // }, - // }, - // TargetInstanceCount: to.Ptr[int32](4), - // }, - // { - // Name: to.Ptr("zookeepernode"), - // HardwareProfile: &armhdinsight.HardwareProfile{ - // VMSize: to.Ptr("Medium"), - // }, - // OSProfile: &armhdinsight.OsProfile{ - // LinuxOperatingSystemProfile: &armhdinsight.LinuxOperatingSystemProfile{ - // Username: to.Ptr("pulkitssh"), - // }, - // }, - // TargetInstanceCount: to.Ptr[int32](3), - // }}, - // }, - // ConnectivityEndpoints: []*armhdinsight.ConnectivityEndpoint{ - // { - // Name: to.Ptr("SSH"), - // Location: to.Ptr("cluster2-ssh.azurehdinsight.net"), - // Port: to.Ptr[int32](22), - // Protocol: to.Ptr("TCP"), - // }, - // { - // Name: to.Ptr("HTTPS"), - // Location: to.Ptr("cluster2.azurehdinsight.net"), - // Port: to.Ptr[int32](443), - // Protocol: to.Ptr("TCP"), - // }}, - // CreatedDate: to.Ptr("2017-01-11T18:58:26.187"), - // OSType: to.Ptr(armhdinsight.OSTypeLinux), - // ProvisioningState: to.Ptr(armhdinsight.HDInsightClusterProvisioningStateSucceeded), - // QuotaInfo: &armhdinsight.QuotaInfo{ - // CoresUsed: to.Ptr[int32](24), - // }, - // Tier: to.Ptr(armhdinsight.TierStandard), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7a2ac91de424f271cf91cc8009f3fe9ee8249086/specification/hdinsight/resource-manager/Microsoft.HDInsight/stable/2021-06-01/examples/ResizeLinuxHadoopCluster.json -func ExampleClustersClient_BeginResize() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armhdinsight.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewClustersClient().BeginResize(ctx, "rg1", "cluster1", armhdinsight.RoleNameWorkernode, armhdinsight.ClusterResizeParameters{ - TargetInstanceCount: to.Ptr[int32](10), - }, 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/7a2ac91de424f271cf91cc8009f3fe9ee8249086/specification/hdinsight/resource-manager/Microsoft.HDInsight/stable/2021-06-01/examples/DisableClusterAutoScale.json -func ExampleClustersClient_BeginUpdateAutoScaleConfiguration_disableAutoscaleForTheHdInsightCluster() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armhdinsight.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewClustersClient().BeginUpdateAutoScaleConfiguration(ctx, "rg1", "cluster1", armhdinsight.RoleNameWorkernode, armhdinsight.AutoscaleConfigurationUpdateParameter{}, 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/7a2ac91de424f271cf91cc8009f3fe9ee8249086/specification/hdinsight/resource-manager/Microsoft.HDInsight/stable/2021-06-01/examples/EnableOrUpdateAutoScaleWithLoadBasedConfiguration.json -func ExampleClustersClient_BeginUpdateAutoScaleConfiguration_enableOrUpdateAutoscaleWithTheLoadBasedConfigurationForHdInsightCluster() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armhdinsight.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewClustersClient().BeginUpdateAutoScaleConfiguration(ctx, "rg1", "cluster1", armhdinsight.RoleNameWorkernode, armhdinsight.AutoscaleConfigurationUpdateParameter{ - Autoscale: &armhdinsight.Autoscale{ - Capacity: &armhdinsight.AutoscaleCapacity{ - MaxInstanceCount: to.Ptr[int32](5), - MinInstanceCount: to.Ptr[int32](3), - }, - }, - }, 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/7a2ac91de424f271cf91cc8009f3fe9ee8249086/specification/hdinsight/resource-manager/Microsoft.HDInsight/stable/2021-06-01/examples/EnableOrUpdateAutoScaleWithScheduleBasedConfiguration.json -func ExampleClustersClient_BeginUpdateAutoScaleConfiguration_enableOrUpdateAutoscaleWithTheScheduleBasedConfigurationForHdInsightCluster() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armhdinsight.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewClustersClient().BeginUpdateAutoScaleConfiguration(ctx, "rg1", "cluster1", armhdinsight.RoleNameWorkernode, armhdinsight.AutoscaleConfigurationUpdateParameter{ - Autoscale: &armhdinsight.Autoscale{ - Recurrence: &armhdinsight.AutoscaleRecurrence{ - Schedule: []*armhdinsight.AutoscaleSchedule{ - { - Days: []*armhdinsight.DaysOfWeek{ - to.Ptr(armhdinsight.DaysOfWeekThursday)}, - TimeAndCapacity: &armhdinsight.AutoscaleTimeAndCapacity{ - MaxInstanceCount: to.Ptr[int32](4), - MinInstanceCount: to.Ptr[int32](4), - Time: to.Ptr("16:00"), - }, - }}, - TimeZone: to.Ptr("China Standard Time"), - }, - }, - }, 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/7a2ac91de424f271cf91cc8009f3fe9ee8249086/specification/hdinsight/resource-manager/Microsoft.HDInsight/stable/2021-06-01/examples/GetLinuxHadoopAllClusters.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 := armhdinsight.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 = armhdinsight.ClusterListResult{ - // Value: []*armhdinsight.Cluster{ - // { - // Name: to.Ptr("cluster1"), - // Type: to.Ptr("Microsoft.HDInsight/clusters"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.HDInsight/clusters/cluster1"), - // Location: to.Ptr("West US"), - // Tags: map[string]*string{ - // "key1": to.Ptr("val1"), - // }, - // Etag: to.Ptr("f0212a39-b827-45e0-9ffa-4f5232e58851"), - // Properties: &armhdinsight.ClusterGetProperties{ - // ClusterDefinition: &armhdinsight.ClusterDefinition{ - // Blueprint: to.Ptr("https://blueprints.azurehdinsight.net/hadoop-3.5.1000.0.9243893.json"), - // Kind: to.Ptr("hadoop"), - // }, - // ClusterState: to.Ptr("Running"), - // ClusterVersion: to.Ptr("3.5.1000.0"), - // ComputeProfile: &armhdinsight.ComputeProfile{ - // Roles: []*armhdinsight.Role{ - // { - // Name: to.Ptr("headnode"), - // HardwareProfile: &armhdinsight.HardwareProfile{ - // VMSize: to.Ptr("Standard_D3_V2"), - // }, - // OSProfile: &armhdinsight.OsProfile{ - // LinuxOperatingSystemProfile: &armhdinsight.LinuxOperatingSystemProfile{ - // Username: to.Ptr("pulkitssh"), - // }, - // }, - // TargetInstanceCount: to.Ptr[int32](2), - // }, - // { - // Name: to.Ptr("workernode"), - // HardwareProfile: &armhdinsight.HardwareProfile{ - // VMSize: to.Ptr("Standard_D3_V2"), - // }, - // OSProfile: &armhdinsight.OsProfile{ - // LinuxOperatingSystemProfile: &armhdinsight.LinuxOperatingSystemProfile{ - // Username: to.Ptr("pulkitssh"), - // }, - // }, - // TargetInstanceCount: to.Ptr[int32](4), - // }, - // { - // Name: to.Ptr("zookeepernode"), - // HardwareProfile: &armhdinsight.HardwareProfile{ - // VMSize: to.Ptr("Medium"), - // }, - // OSProfile: &armhdinsight.OsProfile{ - // LinuxOperatingSystemProfile: &armhdinsight.LinuxOperatingSystemProfile{ - // Username: to.Ptr("pulkitssh"), - // }, - // }, - // TargetInstanceCount: to.Ptr[int32](3), - // }}, - // }, - // ConnectivityEndpoints: []*armhdinsight.ConnectivityEndpoint{ - // { - // Name: to.Ptr("SSH"), - // Location: to.Ptr("cluster1-ssh.azurehdinsight.net"), - // Port: to.Ptr[int32](22), - // Protocol: to.Ptr("TCP"), - // }, - // { - // Name: to.Ptr("HTTPS"), - // Location: to.Ptr("cluster1.azurehdinsight.net"), - // Port: to.Ptr[int32](443), - // Protocol: to.Ptr("TCP"), - // }}, - // CreatedDate: to.Ptr("2017-01-11T18:58:26.187"), - // OSType: to.Ptr(armhdinsight.OSTypeLinux), - // ProvisioningState: to.Ptr(armhdinsight.HDInsightClusterProvisioningStateSucceeded), - // QuotaInfo: &armhdinsight.QuotaInfo{ - // CoresUsed: to.Ptr[int32](24), - // }, - // Tier: to.Ptr(armhdinsight.TierStandard), - // }, - // }, - // { - // Name: to.Ptr("cluster2"), - // Type: to.Ptr("Microsoft.HDInsight/clusters"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.HDInsight/clusters/cluster2"), - // Location: to.Ptr("West US"), - // Tags: map[string]*string{ - // "key1": to.Ptr("val1"), - // }, - // Etag: to.Ptr("f0212a39-b827-45e0-9ffa-4f5232e58851"), - // Properties: &armhdinsight.ClusterGetProperties{ - // ClusterDefinition: &armhdinsight.ClusterDefinition{ - // Blueprint: to.Ptr("https://blueprints.azurehdinsight.net/hadoop-3.5.1000.0.9243893.json"), - // Kind: to.Ptr("hadoop"), - // }, - // ClusterState: to.Ptr("Running"), - // ClusterVersion: to.Ptr("3.5.1000.0"), - // ComputeProfile: &armhdinsight.ComputeProfile{ - // Roles: []*armhdinsight.Role{ - // { - // Name: to.Ptr("headnode"), - // HardwareProfile: &armhdinsight.HardwareProfile{ - // VMSize: to.Ptr("Standard_D3_V2"), - // }, - // OSProfile: &armhdinsight.OsProfile{ - // LinuxOperatingSystemProfile: &armhdinsight.LinuxOperatingSystemProfile{ - // Username: to.Ptr("pulkitssh"), - // }, - // }, - // TargetInstanceCount: to.Ptr[int32](2), - // }, - // { - // Name: to.Ptr("workernode"), - // HardwareProfile: &armhdinsight.HardwareProfile{ - // VMSize: to.Ptr("Standard_D3_V2"), - // }, - // OSProfile: &armhdinsight.OsProfile{ - // LinuxOperatingSystemProfile: &armhdinsight.LinuxOperatingSystemProfile{ - // Username: to.Ptr("pulkitssh"), - // }, - // }, - // TargetInstanceCount: to.Ptr[int32](4), - // }, - // { - // Name: to.Ptr("zookeepernode"), - // HardwareProfile: &armhdinsight.HardwareProfile{ - // VMSize: to.Ptr("Medium"), - // }, - // OSProfile: &armhdinsight.OsProfile{ - // LinuxOperatingSystemProfile: &armhdinsight.LinuxOperatingSystemProfile{ - // Username: to.Ptr("pulkitssh"), - // }, - // }, - // TargetInstanceCount: to.Ptr[int32](3), - // }}, - // }, - // ConnectivityEndpoints: []*armhdinsight.ConnectivityEndpoint{ - // { - // Name: to.Ptr("SSH"), - // Location: to.Ptr("cluster2-ssh.azurehdinsight.net"), - // Port: to.Ptr[int32](22), - // Protocol: to.Ptr("TCP"), - // }, - // { - // Name: to.Ptr("HTTPS"), - // Location: to.Ptr("cluster2.azurehdinsight.net"), - // Port: to.Ptr[int32](443), - // Protocol: to.Ptr("TCP"), - // }}, - // CreatedDate: to.Ptr("2017-01-11T18:58:26.187"), - // OSType: to.Ptr(armhdinsight.OSTypeLinux), - // ProvisioningState: to.Ptr(armhdinsight.HDInsightClusterProvisioningStateSucceeded), - // QuotaInfo: &armhdinsight.QuotaInfo{ - // CoresUsed: to.Ptr[int32](24), - // }, - // Tier: to.Ptr(armhdinsight.TierStandard), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7a2ac91de424f271cf91cc8009f3fe9ee8249086/specification/hdinsight/resource-manager/Microsoft.HDInsight/stable/2021-06-01/examples/RotateLinuxHadoopClusterDiskEncryptionKey.json -func ExampleClustersClient_BeginRotateDiskEncryptionKey() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armhdinsight.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewClustersClient().BeginRotateDiskEncryptionKey(ctx, "rg1", "cluster1", armhdinsight.ClusterDiskEncryptionParameters{ - KeyName: to.Ptr("newkeyname"), - KeyVersion: to.Ptr("newkeyversion"), - VaultURI: to.Ptr("https://newkeyvault.vault.azure.net/"), - }, 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/7a2ac91de424f271cf91cc8009f3fe9ee8249086/specification/hdinsight/resource-manager/Microsoft.HDInsight/stable/2021-06-01/examples/HDI_Clusters_GetGatewaySettings.json -func ExampleClustersClient_GetGatewaySettings() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armhdinsight.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewClustersClient().GetGatewaySettings(ctx, "rg1", "cluster1", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.GatewaySettings = armhdinsight.GatewaySettings{ - // IsCredentialEnabled: to.Ptr("true"), - // Password: to.Ptr("**********"), - // UserName: to.Ptr("hadoop"), - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7a2ac91de424f271cf91cc8009f3fe9ee8249086/specification/hdinsight/resource-manager/Microsoft.HDInsight/stable/2021-06-01/examples/HDI_Clusters_UpdateGatewaySettings_Enable.json -func ExampleClustersClient_BeginUpdateGatewaySettings() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armhdinsight.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewClustersClient().BeginUpdateGatewaySettings(ctx, "rg1", "cluster1", armhdinsight.UpdateGatewaySettingsParameters{ - IsCredentialEnabled: to.Ptr(true), - Password: to.Ptr("**********"), - UserName: to.Ptr("hadoop"), - }, 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/7a2ac91de424f271cf91cc8009f3fe9ee8249086/specification/hdinsight/resource-manager/Microsoft.HDInsight/stable/2021-06-01/examples/GetClusterCreatingAsyncOperationStatus.json -func ExampleClustersClient_GetAzureAsyncOperationStatus() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armhdinsight.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewClustersClient().GetAzureAsyncOperationStatus(ctx, "rg1", "cluster1", "CF938302-6B4D-44A0-A6D2-C0D67E847AEC", 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.AsyncOperationResult = armhdinsight.AsyncOperationResult{ - // Status: to.Ptr(armhdinsight.AsyncOperationStateInProgress), - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7a2ac91de424f271cf91cc8009f3fe9ee8249086/specification/hdinsight/resource-manager/Microsoft.HDInsight/stable/2021-06-01/examples/HDI_Clusters_UpdateClusterIdentityCertificate.json -func ExampleClustersClient_BeginUpdateIdentityCertificate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armhdinsight.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewClustersClient().BeginUpdateIdentityCertificate(ctx, "rg1", "cluster1", armhdinsight.UpdateClusterIdentityCertificateParameters{ - ApplicationID: to.Ptr("applicationId"), - Certificate: to.Ptr("base64encodedcertificate"), - CertificatePassword: to.Ptr("**********"), - }, 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/7a2ac91de424f271cf91cc8009f3fe9ee8249086/specification/hdinsight/resource-manager/Microsoft.HDInsight/stable/2021-06-01/examples/PostExecuteScriptAction.json -func ExampleClustersClient_BeginExecuteScriptActions() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armhdinsight.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewClustersClient().BeginExecuteScriptActions(ctx, "rg1", "cluster1", armhdinsight.ExecuteScriptActionParameters{ - PersistOnSuccess: to.Ptr(false), - ScriptActions: []*armhdinsight.RuntimeScriptAction{ - { - Name: to.Ptr("Test"), - Parameters: to.Ptr(""), - Roles: []*string{ - to.Ptr("headnode"), - to.Ptr("workernode")}, - URI: to.Ptr("http://testurl.com/install.ssh"), - }}, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} diff --git a/sdk/resourcemanager/hdinsight/armhdinsight/configurations_client.go b/sdk/resourcemanager/hdinsight/armhdinsight/configurations_client.go index 9d7c02371338..d77db65e1106 100644 --- a/sdk/resourcemanager/hdinsight/armhdinsight/configurations_client.go +++ b/sdk/resourcemanager/hdinsight/armhdinsight/configurations_client.go @@ -49,7 +49,7 @@ func NewConfigurationsClient(subscriptionID string, credential azcore.TokenCrede // Please consider using List configurations API instead. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2021-06-01 +// Generated from API version 2023-04-15-preview // - resourceGroupName - The name of the resource group. // - clusterName - The name of the cluster. // - configurationName - The name of the cluster configuration. @@ -93,7 +93,7 @@ func (client *ConfigurationsClient) getCreateRequest(ctx context.Context, resour return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-06-01") + reqQP.Set("api-version", "2023-04-15-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -111,7 +111,7 @@ func (client *ConfigurationsClient) getHandleResponse(resp *http.Response) (Conf // List - Gets all configuration information for an HDI cluster. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2021-06-01 +// Generated from API version 2023-04-15-preview // - resourceGroupName - The name of the resource group. // - clusterName - The name of the cluster. // - options - ConfigurationsClientListOptions contains the optional parameters for the ConfigurationsClient.List method. @@ -150,7 +150,7 @@ func (client *ConfigurationsClient) listCreateRequest(ctx context.Context, resou return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-06-01") + reqQP.Set("api-version", "2023-04-15-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -169,7 +169,7 @@ func (client *ConfigurationsClient) listHandleResponse(resp *http.Response) (Con // in cluster endpoint instead. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2021-06-01 +// Generated from API version 2023-04-15-preview // - resourceGroupName - The name of the resource group. // - clusterName - The name of the cluster. // - configurationName - The name of the cluster configuration. @@ -194,7 +194,7 @@ func (client *ConfigurationsClient) BeginUpdate(ctx context.Context, resourceGro // in cluster endpoint instead. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2021-06-01 +// Generated from API version 2023-04-15-preview func (client *ConfigurationsClient) update(ctx context.Context, resourceGroupName string, clusterName string, configurationName string, parameters map[string]*string, options *ConfigurationsClientBeginUpdateOptions) (*http.Response, error) { req, err := client.updateCreateRequest(ctx, resourceGroupName, clusterName, configurationName, parameters, options) if err != nil { @@ -234,7 +234,7 @@ func (client *ConfigurationsClient) updateCreateRequest(ctx context.Context, res return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-06-01") + reqQP.Set("api-version", "2023-04-15-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, parameters) diff --git a/sdk/resourcemanager/hdinsight/armhdinsight/configurations_client_example_test.go b/sdk/resourcemanager/hdinsight/armhdinsight/configurations_client_example_test.go deleted file mode 100644 index 6e1d61fa71af..000000000000 --- a/sdk/resourcemanager/hdinsight/armhdinsight/configurations_client_example_test.go +++ /dev/null @@ -1,124 +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 armhdinsight_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/hdinsight/armhdinsight" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7a2ac91de424f271cf91cc8009f3fe9ee8249086/specification/hdinsight/resource-manager/Microsoft.HDInsight/stable/2021-06-01/examples/HDI_Configurations_List.json -func ExampleConfigurationsClient_List() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armhdinsight.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewConfigurationsClient().List(ctx, "rg1", "cluster1", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.ClusterConfigurations = armhdinsight.ClusterConfigurations{ - // Configurations: map[string]map[string]*string{ - // "core-site": map[string]*string{ - // "fs.azure.account.key.test.blob.core.windows.net": to.Ptr("accountKey"), - // "fs.defaultFS": to.Ptr("wasb://test.blob.core.windows.net"), - // }, - // "gateway": map[string]*string{ - // "restAuthCredential.isEnabled": to.Ptr("true"), - // "restAuthCredential.password": to.Ptr("**********"), - // "restAuthCredential.username": to.Ptr("admin"), - // }, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7a2ac91de424f271cf91cc8009f3fe9ee8249086/specification/hdinsight/resource-manager/Microsoft.HDInsight/stable/2021-06-01/examples/ChangeHttpConnectivityDisable.json -func ExampleConfigurationsClient_BeginUpdate_disableHttpConnectivity() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armhdinsight.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewConfigurationsClient().BeginUpdate(ctx, "rg1", "cluster1", "gateway", map[string]*string{ - "restAuthCredential.isEnabled": to.Ptr("false"), - }, 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/7a2ac91de424f271cf91cc8009f3fe9ee8249086/specification/hdinsight/resource-manager/Microsoft.HDInsight/stable/2021-06-01/examples/ChangeHttpConnectivityEnable.json -func ExampleConfigurationsClient_BeginUpdate_enableHttpConnectivity() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armhdinsight.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewConfigurationsClient().BeginUpdate(ctx, "rg1", "cluster1", "gateway", map[string]*string{ - "restAuthCredential.isEnabled": to.Ptr("true"), - "restAuthCredential.password": to.Ptr("**********"), - "restAuthCredential.username": to.Ptr("hadoop"), - }, 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/7a2ac91de424f271cf91cc8009f3fe9ee8249086/specification/hdinsight/resource-manager/Microsoft.HDInsight/stable/2021-06-01/examples/HDI_Configurations_Get.json -func ExampleConfigurationsClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armhdinsight.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewConfigurationsClient().Get(ctx, "rg1", "cluster1", "core-site", 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.Value = map[string]*string{ - // "fs.azure.account.key.test.blob.core.windows.net": to.Ptr("accountKey"), - // "fs.defaultFS": to.Ptr("wasb://test.blob.core.windows.net"), - // } -} diff --git a/sdk/resourcemanager/hdinsight/armhdinsight/constants.go b/sdk/resourcemanager/hdinsight/armhdinsight/constants.go index 406ec6fe9bfe..688022599485 100644 --- a/sdk/resourcemanager/hdinsight/armhdinsight/constants.go +++ b/sdk/resourcemanager/hdinsight/armhdinsight/constants.go @@ -11,7 +11,7 @@ package armhdinsight const ( moduleName = "armhdinsight" - moduleVersion = "v1.1.1" + moduleVersion = "v1.2.0-beta.1" ) // AsyncOperationState - The async operation state. diff --git a/sdk/resourcemanager/hdinsight/armhdinsight/extensions_client.go b/sdk/resourcemanager/hdinsight/armhdinsight/extensions_client.go index b747bc5c2524..41bd4050f81a 100644 --- a/sdk/resourcemanager/hdinsight/armhdinsight/extensions_client.go +++ b/sdk/resourcemanager/hdinsight/armhdinsight/extensions_client.go @@ -48,7 +48,7 @@ func NewExtensionsClient(subscriptionID string, credential azcore.TokenCredentia // BeginCreate - Creates an HDInsight cluster extension. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2021-06-01 +// Generated from API version 2023-04-15-preview // - resourceGroupName - The name of the resource group. // - clusterName - The name of the cluster. // - extensionName - The name of the cluster extension. @@ -71,7 +71,7 @@ func (client *ExtensionsClient) BeginCreate(ctx context.Context, resourceGroupNa // Create - Creates an HDInsight cluster extension. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2021-06-01 +// Generated from API version 2023-04-15-preview func (client *ExtensionsClient) create(ctx context.Context, resourceGroupName string, clusterName string, extensionName string, parameters Extension, options *ExtensionsClientBeginCreateOptions) (*http.Response, error) { req, err := client.createCreateRequest(ctx, resourceGroupName, clusterName, extensionName, parameters, options) if err != nil { @@ -111,7 +111,7 @@ func (client *ExtensionsClient) createCreateRequest(ctx context.Context, resourc return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-06-01") + reqQP.Set("api-version", "2023-04-15-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, parameters) @@ -120,7 +120,7 @@ func (client *ExtensionsClient) createCreateRequest(ctx context.Context, resourc // BeginDelete - Deletes the specified extension for HDInsight cluster. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2021-06-01 +// Generated from API version 2023-04-15-preview // - resourceGroupName - The name of the resource group. // - clusterName - The name of the cluster. // - extensionName - The name of the cluster extension. @@ -142,7 +142,7 @@ func (client *ExtensionsClient) BeginDelete(ctx context.Context, resourceGroupNa // Delete - Deletes the specified extension for HDInsight cluster. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2021-06-01 +// Generated from API version 2023-04-15-preview func (client *ExtensionsClient) deleteOperation(ctx context.Context, resourceGroupName string, clusterName string, extensionName string, options *ExtensionsClientBeginDeleteOptions) (*http.Response, error) { req, err := client.deleteCreateRequest(ctx, resourceGroupName, clusterName, extensionName, options) if err != nil { @@ -182,7 +182,7 @@ func (client *ExtensionsClient) deleteCreateRequest(ctx context.Context, resourc return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-06-01") + reqQP.Set("api-version", "2023-04-15-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -191,7 +191,7 @@ func (client *ExtensionsClient) deleteCreateRequest(ctx context.Context, resourc // BeginDisableAzureMonitor - Disables the Azure Monitor on the HDInsight cluster. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2021-06-01 +// Generated from API version 2023-04-15-preview // - resourceGroupName - The name of the resource group. // - clusterName - The name of the cluster. // - options - ExtensionsClientBeginDisableAzureMonitorOptions contains the optional parameters for the ExtensionsClient.BeginDisableAzureMonitor @@ -213,7 +213,7 @@ func (client *ExtensionsClient) BeginDisableAzureMonitor(ctx context.Context, re // DisableAzureMonitor - Disables the Azure Monitor on the HDInsight cluster. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2021-06-01 +// Generated from API version 2023-04-15-preview func (client *ExtensionsClient) disableAzureMonitor(ctx context.Context, resourceGroupName string, clusterName string, options *ExtensionsClientBeginDisableAzureMonitorOptions) (*http.Response, error) { req, err := client.disableAzureMonitorCreateRequest(ctx, resourceGroupName, clusterName, options) if err != nil { @@ -249,7 +249,7 @@ func (client *ExtensionsClient) disableAzureMonitorCreateRequest(ctx context.Con return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-06-01") + reqQP.Set("api-version", "2023-04-15-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -258,7 +258,7 @@ func (client *ExtensionsClient) disableAzureMonitorCreateRequest(ctx context.Con // BeginDisableMonitoring - Disables the Operations Management Suite (OMS) on the HDInsight cluster. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2021-06-01 +// Generated from API version 2023-04-15-preview // - resourceGroupName - The name of the resource group. // - clusterName - The name of the cluster. // - options - ExtensionsClientBeginDisableMonitoringOptions contains the optional parameters for the ExtensionsClient.BeginDisableMonitoring @@ -280,7 +280,7 @@ func (client *ExtensionsClient) BeginDisableMonitoring(ctx context.Context, reso // DisableMonitoring - Disables the Operations Management Suite (OMS) on the HDInsight cluster. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2021-06-01 +// Generated from API version 2023-04-15-preview func (client *ExtensionsClient) disableMonitoring(ctx context.Context, resourceGroupName string, clusterName string, options *ExtensionsClientBeginDisableMonitoringOptions) (*http.Response, error) { req, err := client.disableMonitoringCreateRequest(ctx, resourceGroupName, clusterName, options) if err != nil { @@ -316,7 +316,7 @@ func (client *ExtensionsClient) disableMonitoringCreateRequest(ctx context.Conte return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-06-01") + reqQP.Set("api-version", "2023-04-15-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -325,7 +325,7 @@ func (client *ExtensionsClient) disableMonitoringCreateRequest(ctx context.Conte // BeginEnableAzureMonitor - Enables the Azure Monitor on the HDInsight cluster. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2021-06-01 +// Generated from API version 2023-04-15-preview // - resourceGroupName - The name of the resource group. // - clusterName - The name of the cluster. // - parameters - The Log Analytics workspace parameters. @@ -348,7 +348,7 @@ func (client *ExtensionsClient) BeginEnableAzureMonitor(ctx context.Context, res // EnableAzureMonitor - Enables the Azure Monitor on the HDInsight cluster. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2021-06-01 +// Generated from API version 2023-04-15-preview func (client *ExtensionsClient) enableAzureMonitor(ctx context.Context, resourceGroupName string, clusterName string, parameters AzureMonitorRequest, options *ExtensionsClientBeginEnableAzureMonitorOptions) (*http.Response, error) { req, err := client.enableAzureMonitorCreateRequest(ctx, resourceGroupName, clusterName, parameters, options) if err != nil { @@ -384,7 +384,7 @@ func (client *ExtensionsClient) enableAzureMonitorCreateRequest(ctx context.Cont return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-06-01") + reqQP.Set("api-version", "2023-04-15-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, parameters) @@ -393,7 +393,7 @@ func (client *ExtensionsClient) enableAzureMonitorCreateRequest(ctx context.Cont // BeginEnableMonitoring - Enables the Operations Management Suite (OMS) on the HDInsight cluster. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2021-06-01 +// Generated from API version 2023-04-15-preview // - resourceGroupName - The name of the resource group. // - clusterName - The name of the cluster. // - parameters - The Operations Management Suite (OMS) workspace parameters. @@ -416,7 +416,7 @@ func (client *ExtensionsClient) BeginEnableMonitoring(ctx context.Context, resou // EnableMonitoring - Enables the Operations Management Suite (OMS) on the HDInsight cluster. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2021-06-01 +// Generated from API version 2023-04-15-preview func (client *ExtensionsClient) enableMonitoring(ctx context.Context, resourceGroupName string, clusterName string, parameters ClusterMonitoringRequest, options *ExtensionsClientBeginEnableMonitoringOptions) (*http.Response, error) { req, err := client.enableMonitoringCreateRequest(ctx, resourceGroupName, clusterName, parameters, options) if err != nil { @@ -452,7 +452,7 @@ func (client *ExtensionsClient) enableMonitoringCreateRequest(ctx context.Contex return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-06-01") + reqQP.Set("api-version", "2023-04-15-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, parameters) @@ -461,7 +461,7 @@ func (client *ExtensionsClient) enableMonitoringCreateRequest(ctx context.Contex // Get - Gets the extension properties for the specified HDInsight cluster extension. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2021-06-01 +// Generated from API version 2023-04-15-preview // - resourceGroupName - The name of the resource group. // - clusterName - The name of the cluster. // - extensionName - The name of the cluster extension. @@ -505,7 +505,7 @@ func (client *ExtensionsClient) getCreateRequest(ctx context.Context, resourceGr return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-06-01") + reqQP.Set("api-version", "2023-04-15-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -523,7 +523,7 @@ func (client *ExtensionsClient) getHandleResponse(resp *http.Response) (Extensio // GetAzureAsyncOperationStatus - Gets the async operation status. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2021-06-01 +// Generated from API version 2023-04-15-preview // - resourceGroupName - The name of the resource group. // - clusterName - The name of the cluster. // - extensionName - The name of the cluster extension. @@ -573,7 +573,7 @@ func (client *ExtensionsClient) getAzureAsyncOperationStatusCreateRequest(ctx co return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-06-01") + reqQP.Set("api-version", "2023-04-15-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -591,7 +591,7 @@ func (client *ExtensionsClient) getAzureAsyncOperationStatusHandleResponse(resp // GetAzureMonitorStatus - Gets the status of Azure Monitor on the HDInsight cluster. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2021-06-01 +// Generated from API version 2023-04-15-preview // - resourceGroupName - The name of the resource group. // - clusterName - The name of the cluster. // - options - ExtensionsClientGetAzureMonitorStatusOptions contains the optional parameters for the ExtensionsClient.GetAzureMonitorStatus @@ -631,7 +631,7 @@ func (client *ExtensionsClient) getAzureMonitorStatusCreateRequest(ctx context.C return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-06-01") + reqQP.Set("api-version", "2023-04-15-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -649,7 +649,7 @@ func (client *ExtensionsClient) getAzureMonitorStatusHandleResponse(resp *http.R // GetMonitoringStatus - Gets the status of Operations Management Suite (OMS) on the HDInsight cluster. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2021-06-01 +// Generated from API version 2023-04-15-preview // - resourceGroupName - The name of the resource group. // - clusterName - The name of the cluster. // - options - ExtensionsClientGetMonitoringStatusOptions contains the optional parameters for the ExtensionsClient.GetMonitoringStatus @@ -689,7 +689,7 @@ func (client *ExtensionsClient) getMonitoringStatusCreateRequest(ctx context.Con return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-06-01") + reqQP.Set("api-version", "2023-04-15-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/hdinsight/armhdinsight/extensions_client_example_test.go b/sdk/resourcemanager/hdinsight/armhdinsight/extensions_client_example_test.go deleted file mode 100644 index eccfc0efa0b8..000000000000 --- a/sdk/resourcemanager/hdinsight/armhdinsight/extensions_client_example_test.go +++ /dev/null @@ -1,249 +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 armhdinsight_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/hdinsight/armhdinsight" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7a2ac91de424f271cf91cc8009f3fe9ee8249086/specification/hdinsight/resource-manager/Microsoft.HDInsight/stable/2021-06-01/examples/EnableLinuxClusterMonitoring.json -func ExampleExtensionsClient_BeginEnableMonitoring() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armhdinsight.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewExtensionsClient().BeginEnableMonitoring(ctx, "rg1", "cluster1", armhdinsight.ClusterMonitoringRequest{ - PrimaryKey: to.Ptr("**********"), - WorkspaceID: to.Ptr("a2090ead-8c9f-4fba-b70e-533e3e003163"), - }, 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/7a2ac91de424f271cf91cc8009f3fe9ee8249086/specification/hdinsight/resource-manager/Microsoft.HDInsight/stable/2021-06-01/examples/GetLinuxClusterMonitoringStatus.json -func ExampleExtensionsClient_GetMonitoringStatus() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armhdinsight.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewExtensionsClient().GetMonitoringStatus(ctx, "rg1", "cluster1", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.ClusterMonitoringResponse = armhdinsight.ClusterMonitoringResponse{ - // ClusterMonitoringEnabled: to.Ptr(true), - // WorkspaceID: to.Ptr("id"), - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7a2ac91de424f271cf91cc8009f3fe9ee8249086/specification/hdinsight/resource-manager/Microsoft.HDInsight/stable/2021-06-01/examples/DisableLinuxClusterMonitoring.json -func ExampleExtensionsClient_BeginDisableMonitoring() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armhdinsight.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewExtensionsClient().BeginDisableMonitoring(ctx, "rg1", "cluster1", 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/7a2ac91de424f271cf91cc8009f3fe9ee8249086/specification/hdinsight/resource-manager/Microsoft.HDInsight/stable/2021-06-01/examples/EnableLinuxClusterAzureMonitor.json -func ExampleExtensionsClient_BeginEnableAzureMonitor() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armhdinsight.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewExtensionsClient().BeginEnableAzureMonitor(ctx, "rg1", "cluster1", armhdinsight.AzureMonitorRequest{ - PrimaryKey: to.Ptr("**********"), - WorkspaceID: to.Ptr("a2090ead-8c9f-4fba-b70e-533e3e003163"), - }, 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/7a2ac91de424f271cf91cc8009f3fe9ee8249086/specification/hdinsight/resource-manager/Microsoft.HDInsight/stable/2021-06-01/examples/GetLinuxClusterAzureMonitorStatus.json -func ExampleExtensionsClient_GetAzureMonitorStatus() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armhdinsight.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewExtensionsClient().GetAzureMonitorStatus(ctx, "rg1", "cluster1", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.AzureMonitorResponse = armhdinsight.AzureMonitorResponse{ - // ClusterMonitoringEnabled: to.Ptr(true), - // WorkspaceID: to.Ptr("id"), - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7a2ac91de424f271cf91cc8009f3fe9ee8249086/specification/hdinsight/resource-manager/Microsoft.HDInsight/stable/2021-06-01/examples/DisableLinuxClusterAzureMonitor.json -func ExampleExtensionsClient_BeginDisableAzureMonitor() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armhdinsight.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewExtensionsClient().BeginDisableAzureMonitor(ctx, "rg1", "cluster1", 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/7a2ac91de424f271cf91cc8009f3fe9ee8249086/specification/hdinsight/resource-manager/Microsoft.HDInsight/stable/2021-06-01/examples/CreateExtension.json -func ExampleExtensionsClient_BeginCreate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armhdinsight.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewExtensionsClient().BeginCreate(ctx, "rg1", "cluster1", "clustermonitoring", armhdinsight.Extension{ - PrimaryKey: to.Ptr("**********"), - WorkspaceID: to.Ptr("a2090ead-8c9f-4fba-b70e-533e3e003163"), - }, 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/7a2ac91de424f271cf91cc8009f3fe9ee8249086/specification/hdinsight/resource-manager/Microsoft.HDInsight/stable/2021-06-01/examples/GetExtension.json -func ExampleExtensionsClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armhdinsight.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewExtensionsClient().Get(ctx, "rg1", "cluster1", "clustermonitoring", 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.ClusterMonitoringResponse = armhdinsight.ClusterMonitoringResponse{ - // ClusterMonitoringEnabled: to.Ptr(true), - // WorkspaceID: to.Ptr("id"), - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7a2ac91de424f271cf91cc8009f3fe9ee8249086/specification/hdinsight/resource-manager/Microsoft.HDInsight/stable/2021-06-01/examples/DeleteExtension.json -func ExampleExtensionsClient_BeginDelete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armhdinsight.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewExtensionsClient().BeginDelete(ctx, "rg1", "cluster1", "clustermonitoring", 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/7a2ac91de424f271cf91cc8009f3fe9ee8249086/specification/hdinsight/resource-manager/Microsoft.HDInsight/stable/2021-06-01/examples/GetExtensionCreationAsyncOperationStatus.json -func ExampleExtensionsClient_GetAzureAsyncOperationStatus() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armhdinsight.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewExtensionsClient().GetAzureAsyncOperationStatus(ctx, "rg1", "cluster1", "azuremonitor", "CF938302-6B4D-44A0-A6D2-C0D67E847AEC", 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.AsyncOperationResult = armhdinsight.AsyncOperationResult{ - // Status: to.Ptr(armhdinsight.AsyncOperationStateInProgress), - // } -} diff --git a/sdk/resourcemanager/hdinsight/armhdinsight/go.mod b/sdk/resourcemanager/hdinsight/armhdinsight/go.mod index a49a337a25a2..968cb5078f85 100644 --- a/sdk/resourcemanager/hdinsight/armhdinsight/go.mod +++ b/sdk/resourcemanager/hdinsight/armhdinsight/go.mod @@ -2,20 +2,12 @@ module github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/hdinsight/armhdinsi go 1.18 -require ( - github.com/Azure/azure-sdk-for-go/sdk/azcore v1.4.0 - github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.2.2 -) +require github.com/Azure/azure-sdk-for-go/sdk/azcore v1.4.0 require ( github.com/Azure/azure-sdk-for-go/sdk/internal v1.2.0 // indirect - github.com/AzureAD/microsoft-authentication-library-for-go v0.9.0 // indirect - github.com/golang-jwt/jwt/v4 v4.5.0 // indirect - github.com/google/uuid v1.3.0 // indirect - github.com/kylelemons/godebug v1.1.0 // indirect - github.com/pkg/browser v0.0.0-20210911075715-681adbf594b8 // indirect - golang.org/x/crypto v0.6.0 // indirect + github.com/davecgh/go-spew v1.1.1 // indirect golang.org/x/net v0.7.0 // indirect - golang.org/x/sys v0.5.0 // indirect golang.org/x/text v0.7.0 // indirect + gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b // indirect ) diff --git a/sdk/resourcemanager/hdinsight/armhdinsight/go.sum b/sdk/resourcemanager/hdinsight/armhdinsight/go.sum index 8ba445a8c4da..b6bd7eaad1ba 100644 --- a/sdk/resourcemanager/hdinsight/armhdinsight/go.sum +++ b/sdk/resourcemanager/hdinsight/armhdinsight/go.sum @@ -1,31 +1,15 @@ github.com/Azure/azure-sdk-for-go/sdk/azcore v1.4.0 h1:rTnT/Jrcm+figWlYz4Ixzt0SJVR2cMC8lvZcimipiEY= github.com/Azure/azure-sdk-for-go/sdk/azcore v1.4.0/go.mod h1:ON4tFdPTwRcgWEaVDrN3584Ef+b7GgSJaXxe5fW9t4M= -github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.2.2 h1:uqM+VoHjVH6zdlkLF2b6O0ZANcHoj3rO0PoQ3jglUJA= -github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.2.2/go.mod h1:twTKAa1E6hLmSDjLhaCkbTMQKc7p/rNLU40rLxGEOCI= github.com/Azure/azure-sdk-for-go/sdk/internal v1.2.0 h1:leh5DwKv6Ihwi+h60uHtn6UWAxBbZ0q8DwQVMzf61zw= github.com/Azure/azure-sdk-for-go/sdk/internal v1.2.0/go.mod h1:eWRD7oawr1Mu1sLCawqVc0CUiF43ia3qQMxLscsKQ9w= -github.com/AzureAD/microsoft-authentication-library-for-go v0.9.0 h1:UE9n9rkJF62ArLb1F3DEjRt8O3jLwMWdSoypKV4f3MU= -github.com/AzureAD/microsoft-authentication-library-for-go v0.9.0/go.mod h1:kgDmCTgBzIEPFElEF+FK0SdjAor06dRq2Go927dnQ6o= github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= -github.com/dnaeon/go-vcr v1.1.0 h1:ReYa/UBrRyQdant9B4fNHGoCNKw6qh6P0fsdGmZpR7c= -github.com/golang-jwt/jwt/v4 v4.5.0 h1:7cYmW1XlMY7h7ii7UhUyChSgS5wUJEnm9uZVTGqOWzg= -github.com/golang-jwt/jwt/v4 v4.5.0/go.mod h1:m21LjoU+eqJr34lmDMbreY2eSTRJ1cv77w39/MY0Ch0= -github.com/google/uuid v1.3.0 h1:t6JiXgmwXMjEs8VusXIJk2BXHsn+wx8BZdTaoZ5fu7I= -github.com/google/uuid v1.3.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= -github.com/kylelemons/godebug v1.1.0 h1:RPNrshWIDI6G2gRW9EHilWtl7Z6Sb1BR0xunSBf0SNc= -github.com/kylelemons/godebug v1.1.0/go.mod h1:9/0rRGxNHcop5bhtWyNeEfOS8JIWk580+fNqagV/RAw= -github.com/pkg/browser v0.0.0-20210911075715-681adbf594b8 h1:KoWmjvw+nsYOo29YJK9vDA65RGE3NrOnUtO7a+RF9HU= -github.com/pkg/browser v0.0.0-20210911075715-681adbf594b8/go.mod h1:HKlIX3XHQyzLZPlr7++PzdhaXEj94dEiJgZDTsxEqUI= +github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/stretchr/testify v1.7.0 h1:nwc3DEeHmmLAfoZucVR881uASk0Mfjw8xYJ99tb5CcY= -golang.org/x/crypto v0.6.0 h1:qfktjS5LUO+fFKeJXZ+ikTRijMmljikvG68fpMMruSc= -golang.org/x/crypto v0.6.0/go.mod h1:OFC/31mSvZgRz0V1QTNCzfAI1aIRzbiufJtkMIlEp58= golang.org/x/net v0.7.0 h1:rJrUqqhjsgNp7KqAIc25s9pZnjU7TUcSY7HcVZjdn1g= golang.org/x/net v0.7.0/go.mod h1:2Tu9+aMcznHK/AK1HMvgo6xiTLG5rD5rZLDS+rp2Bjs= -golang.org/x/sys v0.0.0-20210616045830-e2b7044e8c71/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.5.0 h1:MUK/U/4lj1t1oPg0HfuXDN/Z1wv31ZJ/YcPiGccS4DU= -golang.org/x/sys v0.5.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/text v0.7.0 h1:4BRB4x83lYWy72KwLD/qYDuTu7q9PjSagHvijDw7cLo= golang.org/x/text v0.7.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= -gopkg.in/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY= +gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b h1:h8qDotaEPuJATrMmW04NCwg7v22aHH28wwpauUhK9Oo= +gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= diff --git a/sdk/resourcemanager/hdinsight/armhdinsight/locations_client.go b/sdk/resourcemanager/hdinsight/armhdinsight/locations_client.go index bdac71e432af..57268b1034f2 100644 --- a/sdk/resourcemanager/hdinsight/armhdinsight/locations_client.go +++ b/sdk/resourcemanager/hdinsight/armhdinsight/locations_client.go @@ -48,7 +48,7 @@ func NewLocationsClient(subscriptionID string, credential azcore.TokenCredential // CheckNameAvailability - Check the cluster name is available or not. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2021-06-01 +// Generated from API version 2023-04-15-preview // - location - The Azure location (region) for which to make the request. // - options - LocationsClientCheckNameAvailabilityOptions contains the optional parameters for the LocationsClient.CheckNameAvailability // method. @@ -83,7 +83,7 @@ func (client *LocationsClient) checkNameAvailabilityCreateRequest(ctx context.Co return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-06-01") + reqQP.Set("api-version", "2023-04-15-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, parameters) @@ -101,7 +101,7 @@ func (client *LocationsClient) checkNameAvailabilityHandleResponse(resp *http.Re // GetAzureAsyncOperationStatus - Get the async operation status. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2021-06-01 +// Generated from API version 2023-04-15-preview // - location - The Azure location (region) for which to make the request. // - operationID - The long running operation id. // - options - LocationsClientGetAzureAsyncOperationStatusOptions contains the optional parameters for the LocationsClient.GetAzureAsyncOperationStatus @@ -141,7 +141,7 @@ func (client *LocationsClient) getAzureAsyncOperationStatusCreateRequest(ctx con return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-06-01") + reqQP.Set("api-version", "2023-04-15-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -159,7 +159,7 @@ func (client *LocationsClient) getAzureAsyncOperationStatusHandleResponse(resp * // GetCapabilities - Gets the capabilities for the specified location. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2021-06-01 +// Generated from API version 2023-04-15-preview // - location - The Azure location (region) for which to make the request. // - options - LocationsClientGetCapabilitiesOptions contains the optional parameters for the LocationsClient.GetCapabilities // method. @@ -194,7 +194,7 @@ func (client *LocationsClient) getCapabilitiesCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-06-01") + reqQP.Set("api-version", "2023-04-15-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -212,7 +212,7 @@ func (client *LocationsClient) getCapabilitiesHandleResponse(resp *http.Response // ListBillingSpecs - Lists the billingSpecs for the specified subscription and location. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2021-06-01 +// Generated from API version 2023-04-15-preview // - location - The Azure location (region) for which to make the request. // - options - LocationsClientListBillingSpecsOptions contains the optional parameters for the LocationsClient.ListBillingSpecs // method. @@ -247,7 +247,7 @@ func (client *LocationsClient) listBillingSpecsCreateRequest(ctx context.Context return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-06-01") + reqQP.Set("api-version", "2023-04-15-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -265,7 +265,7 @@ func (client *LocationsClient) listBillingSpecsHandleResponse(resp *http.Respons // ListUsages - Lists the usages for the specified location. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2021-06-01 +// Generated from API version 2023-04-15-preview // - location - The Azure location (region) for which to make the request. // - options - LocationsClientListUsagesOptions contains the optional parameters for the LocationsClient.ListUsages method. func (client *LocationsClient) ListUsages(ctx context.Context, location string, options *LocationsClientListUsagesOptions) (LocationsClientListUsagesResponse, error) { @@ -299,7 +299,7 @@ func (client *LocationsClient) listUsagesCreateRequest(ctx context.Context, loca return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-06-01") + reqQP.Set("api-version", "2023-04-15-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -317,7 +317,7 @@ func (client *LocationsClient) listUsagesHandleResponse(resp *http.Response) (Lo // ValidateClusterCreateRequest - Validate the cluster create request spec is valid or not. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2021-06-01 +// Generated from API version 2023-04-15-preview // - location - The Azure location (region) for which to make the request. // - options - LocationsClientValidateClusterCreateRequestOptions contains the optional parameters for the LocationsClient.ValidateClusterCreateRequest // method. @@ -352,7 +352,7 @@ func (client *LocationsClient) validateClusterCreateRequestCreateRequest(ctx con return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-06-01") + reqQP.Set("api-version", "2023-04-15-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, parameters) diff --git a/sdk/resourcemanager/hdinsight/armhdinsight/locations_client_example_test.go b/sdk/resourcemanager/hdinsight/armhdinsight/locations_client_example_test.go deleted file mode 100644 index 539bab38f38d..000000000000 --- a/sdk/resourcemanager/hdinsight/armhdinsight/locations_client_example_test.go +++ /dev/null @@ -1,660 +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 armhdinsight_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/hdinsight/armhdinsight" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7a2ac91de424f271cf91cc8009f3fe9ee8249086/specification/hdinsight/resource-manager/Microsoft.HDInsight/stable/2021-06-01/examples/GetHDInsightCapabilities.json -func ExampleLocationsClient_GetCapabilities() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armhdinsight.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewLocationsClient().GetCapabilities(ctx, "West US", 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.CapabilitiesResult = armhdinsight.CapabilitiesResult{ - // Features: []*string{ - // to.Ptr("ALLOW_GATEWAY_AUTH_BYPASS"), - // to.Ptr("AUX_IAAS_FUNCTIONALITIES"), - // to.Ptr("BLOCK_APPS_FOR_SECURE_CLUSTER"), - // to.Ptr("CLUSTER_RESIZE"), - // to.Ptr("CLUSTERS_CONTRACT_1"), - // to.Ptr("CLUSTERS_CONTRACT_1_SDK"), - // to.Ptr("CLUSTERS_CONTRACT_2_SDK"), - // to.Ptr("CLUSTERS_CONTRACT_VERSION_3_SDK"), - // to.Ptr("COLLECTANONYMIZEDLOGS"), - // to.Ptr("CONTAINER_LOG_COLLECTOR"), - // to.Ptr("CONTAINER_RESOURCE_V3"), - // to.Ptr("CUSTOM_ACTIONS_V2"), - // to.Ptr("DATALAKE"), - // to.Ptr("DATALAKE_3_2"), - // to.Ptr("DATALAKE_3_4"), - // to.Ptr("DATALAKE_3_5"), - // to.Ptr("DATALAKE_DEFAULTFS_3_5"), - // to.Ptr("DEFAULT_CONTAINER_IDENTIFIER_AND_STORAGEFQDN_ALREADY_USED"), - // to.Ptr("DOCUMENT_VALIDATION_IN_API"), - // to.Ptr("ENABLEDATALAKE"), - // to.Ptr("ENABLEGENEVAANALYTICS"), - // to.Ptr("HADOOP_VIRTUAL_NETWORK_ENABLED"), - // to.Ptr("HS2_ZK_ROUTER_INTERACTIVEHIVE"), - // to.Ptr("IAAS_ALLOW_CUSTOM_DNS"), - // to.Ptr("IAAS_AMBARI_APP_TIMELINE_SERVER_HA_SERVICE"), - // to.Ptr("IAAS_AMBARI_DEPENDENCY_BASED_DEPLOYMENT"), - // to.Ptr("IAAS_AMBARI_HA_SERVICES"), - // to.Ptr("IAAS_AMBARI_HISTORYSERVER_HA_SERVICE"), - // to.Ptr("IAAS_AMBARI_LOWER_LATENCY"), - // to.Ptr("IAAS_AMBARI_SKIP_COMPONENTS_INSTALL"), - // to.Ptr("IAAS_ARM_PROVISIONING"), - // to.Ptr("IAAS_CLOSE_HEAD_HTTPS_END_POINT_AFTER_CLUSTER_CREATE"), - // to.Ptr("IAAS_CLUSTER_APPLICATION_ALLOW_MULTIPLE_ROLE_INSTANCES"), - // to.Ptr("IAAS_CLUSTER_APPLICATION_REMOVE"), - // to.Ptr("IAAS_CLUSTER_CONTAINER_PREUPLOAD_SUBMIT_WAIT"), - // to.Ptr("IAAS_CLUSTER_RSERVER"), - // to.Ptr("IAAS_DB_CREATION_IN_PARALLEL_TO_VM"), - // to.Ptr("IAAS_DELETE_LEAKED_RESOURCES"), - // to.Ptr("IAAS_DEPLOYMENTS"), - // to.Ptr("IAAS_DO_NOT_CREATE_WASB_TABLES_IN_CUSTOMER_STORAGE"), - // to.Ptr("IAAS_ENABLE_CLUSTER_CONFIG_OVERRIDES"), - // to.Ptr("IAAS_ENABLE_OFFLINE_CLEANUP"), - // to.Ptr("IAAS_ENABLE_OFFLINE_CLEANUP_FOR_DELETING_VMS"), - // to.Ptr("IAAS_INCLUDE_STORAGE_IN_SUBSCRIPTION_SELECTION"), - // to.Ptr("IAAS_PARALLEL_DB_CREATE"), - // to.Ptr("IAAS_PREPROVISION_METASTORES_SCHEMAS"), - // to.Ptr("IAAS_SCRIPTACTIONS_DELETE_VMS_CRUD_FAILURES"), - // to.Ptr("IAAS_SCRIPTACTIONS_RUNNING"), - // to.Ptr("IAAS_SHORT_VM_NAME"), - // to.Ptr("IAAS_SUBMIT_AMBARI_REQUEST_ONCE_LINUX_VM_ARE_AVAILABLE"), - // to.Ptr("IAAS_TEZ_ATS_V15"), - // to.Ptr("IAAS_USE_UNATTENDED_UPGRADES_FOR_PATCHING"), - // to.Ptr("IAAS_VALIDATE_CUSTOM_VNET"), - // to.Ptr("IAAS_VALIDATE_NSG"), - // to.Ptr("IAAS_WAIT_FOR_CLOSING_HEAD_HTTPS_END_POINT_AFTER_CLUSTER_CREATE"), - // to.Ptr("IAAS_YARN_HDINSIGHT_SQL_TIMELINE_STORE"), - // to.Ptr("IAAS_YARN_HDINSIGHT_TIMELINE_STORE"), - // to.Ptr("INTERACTIVEHIVE"), - // to.Ptr("MDSCENTRALLOGGING"), - // to.Ptr("NODE_SETUP_POLLER_ENABLED"), - // to.Ptr("OVERPROVISION_HOSTGROUP_edgenode"), - // to.Ptr("OVERPROVISION_HOSTGROUP_Gateway"), - // to.Ptr("OVERPROVISION_HOSTGROUP_Workernode"), - // to.Ptr("OVERPROVISION_HOSTGROUP_zookeepernode"), - // to.Ptr("PERF_OPTIMIZED_RESOURCE_LOCATION_FETCH"), - // to.Ptr("PORTALAPPINSTALL"), - // to.Ptr("POWERSHELL_SCRIPT_ACTION"), - // to.Ptr("POWERSHELL_SCRIPT_ACTION_SDK"), - // to.Ptr("PREMIUM_TIER_PREVIEW"), - // to.Ptr("PROVISIONING_AGENT"), - // to.Ptr("RMHA"), - // to.Ptr("RSERVER_CLUSTERTYPE_3_5_ENABLED"), - // to.Ptr("RSERVER_CLUSTERTYPE_ENABLED"), - // to.Ptr("SHOW_HUMBOLDT_GA"), - // to.Ptr("SHOW_IBIZA_CREATE"), - // to.Ptr("SPARK_2_1"), - // to.Ptr("SPARK_EXPERIMENTAL"), - // to.Ptr("STORM_PREVIEW"), - // to.Ptr("UI_CREATE_WIZARD_V2"), - // to.Ptr("VIRTUAL_NETWORK_ENABLED"), - // to.Ptr("VMSIZES_AUX")}, - // Quota: &armhdinsight.QuotaCapability{ - // CoresUsed: to.Ptr[int64](0), - // MaxCoresAllowed: to.Ptr[int64](3000), - // RegionalQuotas: []*armhdinsight.RegionalQuotaCapability{ - // { - // CoresAvailable: to.Ptr[int64](1000), - // CoresUsed: to.Ptr[int64](0), - // RegionName: to.Ptr("Australia East"), - // }, - // { - // CoresAvailable: to.Ptr[int64](1000), - // CoresUsed: to.Ptr[int64](0), - // RegionName: to.Ptr("Australia Southeast"), - // }, - // { - // CoresAvailable: to.Ptr[int64](1000), - // CoresUsed: to.Ptr[int64](0), - // RegionName: to.Ptr("Brazil South"), - // }, - // { - // CoresAvailable: to.Ptr[int64](1000), - // CoresUsed: to.Ptr[int64](0), - // RegionName: to.Ptr("Canada Central"), - // }, - // { - // CoresAvailable: to.Ptr[int64](1000), - // CoresUsed: to.Ptr[int64](0), - // RegionName: to.Ptr("Canada East"), - // }, - // { - // CoresAvailable: to.Ptr[int64](1000), - // CoresUsed: to.Ptr[int64](0), - // RegionName: to.Ptr("Central India"), - // }, - // { - // CoresAvailable: to.Ptr[int64](1000), - // CoresUsed: to.Ptr[int64](24), - // RegionName: to.Ptr("Central US"), - // }, - // { - // CoresAvailable: to.Ptr[int64](1000), - // CoresUsed: to.Ptr[int64](0), - // RegionName: to.Ptr("Central US EUAP"), - // }, - // { - // CoresAvailable: to.Ptr[int64](1000), - // CoresUsed: to.Ptr[int64](24), - // RegionName: to.Ptr("East Asia"), - // }, - // { - // CoresAvailable: to.Ptr[int64](1000), - // CoresUsed: to.Ptr[int64](24), - // RegionName: to.Ptr("East US"), - // }, - // { - // CoresAvailable: to.Ptr[int64](1000), - // CoresUsed: to.Ptr[int64](0), - // RegionName: to.Ptr("East US 2"), - // }, - // { - // CoresAvailable: to.Ptr[int64](1000), - // CoresUsed: to.Ptr[int64](0), - // RegionName: to.Ptr("Japan East"), - // }, - // { - // CoresAvailable: to.Ptr[int64](1000), - // CoresUsed: to.Ptr[int64](0), - // RegionName: to.Ptr("Japan West"), - // }, - // { - // CoresAvailable: to.Ptr[int64](1000), - // CoresUsed: to.Ptr[int64](0), - // RegionName: to.Ptr("North Central US"), - // }, - // { - // CoresAvailable: to.Ptr[int64](1000), - // CoresUsed: to.Ptr[int64](0), - // RegionName: to.Ptr("North Europe"), - // }, - // { - // CoresAvailable: to.Ptr[int64](1000), - // CoresUsed: to.Ptr[int64](0), - // RegionName: to.Ptr("South Central US"), - // }, - // { - // CoresAvailable: to.Ptr[int64](1000), - // CoresUsed: to.Ptr[int64](0), - // RegionName: to.Ptr("Southeast Asia"), - // }, - // { - // CoresAvailable: to.Ptr[int64](1000), - // CoresUsed: to.Ptr[int64](0), - // RegionName: to.Ptr("West Central US"), - // }, - // { - // CoresAvailable: to.Ptr[int64](1000), - // CoresUsed: to.Ptr[int64](0), - // RegionName: to.Ptr("West Europe"), - // }, - // { - // CoresAvailable: to.Ptr[int64](1000), - // CoresUsed: to.Ptr[int64](132), - // RegionName: to.Ptr("West US"), - // }, - // { - // CoresAvailable: to.Ptr[int64](1000), - // CoresUsed: to.Ptr[int64](0), - // RegionName: to.Ptr("West US 2"), - // }}, - // }, - // Regions: map[string]*armhdinsight.RegionsCapability{ - // "iaas": &armhdinsight.RegionsCapability{ - // Available: []*string{ - // to.Ptr("AUSTRALIA EAST"), - // to.Ptr("AUSTRALIA SOUTHEAST"), - // to.Ptr("BRAZIL SOUTH"), - // to.Ptr("CANADA CENTRAL"), - // to.Ptr("CANADA EAST"), - // to.Ptr("CENTRAL INDIA"), - // to.Ptr("CENTRAL US"), - // to.Ptr("CENTRAL US EUAP"), - // to.Ptr("EAST ASIA"), - // to.Ptr("EAST US"), - // to.Ptr("EAST US 2"), - // to.Ptr("JAPAN EAST"), - // to.Ptr("JAPAN WEST"), - // to.Ptr("NORTH CENTRAL US"), - // to.Ptr("NORTH EUROPE"), - // to.Ptr("SOUTH CENTRAL US"), - // to.Ptr("SOUTHEAST ASIA"), - // to.Ptr("WEST CENTRAL US"), - // to.Ptr("WEST EUROPE"), - // to.Ptr("WEST US"), - // to.Ptr("WEST US 2")}, - // }, - // "paas": &armhdinsight.RegionsCapability{ - // Available: []*string{ - // to.Ptr("AUSTRALIA EAST"), - // to.Ptr("AUSTRALIA SOUTHEAST"), - // to.Ptr("BRAZIL SOUTH"), - // to.Ptr("CENTRAL INDIA"), - // to.Ptr("CENTRAL US"), - // to.Ptr("EAST ASIA"), - // to.Ptr("EAST US"), - // to.Ptr("EAST US 2"), - // to.Ptr("JAPAN EAST"), - // to.Ptr("JAPAN WEST"), - // to.Ptr("NORTH CENTRAL US"), - // to.Ptr("NORTH EUROPE"), - // to.Ptr("SOUTH CENTRAL US"), - // to.Ptr("SOUTHEAST ASIA"), - // to.Ptr("WEST EUROPE"), - // to.Ptr("WEST US"), - // to.Ptr("WEST US 2")}, - // }, - // }, - // Versions: map[string]*armhdinsight.VersionsCapability{ - // "iaas": &armhdinsight.VersionsCapability{ - // Available: []*armhdinsight.VersionSpec{ - // { - // ComponentVersions: map[string]*string{ - // "HBase": to.Ptr("0.98.4"), - // "HDP": to.Ptr("2.2"), - // "Hadoop": to.Ptr("2.6.0"), - // "Storm": to.Ptr("0.9.3"), - // }, - // DisplayName: to.Ptr("Version 3.2.1000.0.8840373"), - // FriendlyName: to.Ptr("3.2"), - // IsDefault: to.Ptr(false), - // }, - // { - // ComponentVersions: map[string]*string{ - // "HBase": to.Ptr("1.1.2"), - // "HDP": to.Ptr("2.3"), - // "Hadoop": to.Ptr("2.7.0"), - // "Spark": to.Ptr("1.5.2"), - // "Storm": to.Ptr("0.10.0"), - // }, - // DisplayName: to.Ptr("Version 3.3.1000.0.9776961"), - // FriendlyName: to.Ptr("3.3"), - // IsDefault: to.Ptr(false), - // }, - // { - // ComponentVersions: map[string]*string{ - // "HBase": to.Ptr("1.1.2"), - // "HDP": to.Ptr("2.4"), - // "Hadoop": to.Ptr("2.7.1"), - // "RServer": to.Ptr("8.0"), - // "Spark": to.Ptr("1.6.2"), - // "Storm": to.Ptr("0.10.0"), - // }, - // DisplayName: to.Ptr("Version 3.4.1000.0.9719475"), - // FriendlyName: to.Ptr("3.4"), - // IsDefault: to.Ptr(false), - // }, - // { - // ComponentVersions: map[string]*string{ - // "HBase": to.Ptr("1.1.2"), - // "HDP": to.Ptr("2.5"), - // "Hadoop": to.Ptr("2.7.3"), - // "InteractiveHive": to.Ptr("2.1.0"), - // "RServer": to.Ptr("9.0"), - // "Spark": to.Ptr("1.6.3,2.0.2"), - // "Storm": to.Ptr("1.0.1"), - // }, - // DisplayName: to.Ptr("Version 3.5.1000.0.9732704"), - // FriendlyName: to.Ptr("3.5"), - // IsDefault: to.Ptr(true), - // }, - // { - // ComponentVersions: map[string]*string{ - // "HDP": to.Ptr("2.6"), - // "Spark": to.Ptr("2.1.0"), - // }, - // DisplayName: to.Ptr("Version 3.6.1000.0.9503998"), - // FriendlyName: to.Ptr("3.6"), - // IsDefault: to.Ptr(false), - // }, - // { - // DisplayName: to.Ptr("Version 99.152.1000.0.6943836"), - // FriendlyName: to.Ptr("99.152"), - // IsDefault: to.Ptr(false), - // }}, - // }, - // "paas": &armhdinsight.VersionsCapability{ - // Available: []*armhdinsight.VersionSpec{ - // { - // DisplayName: to.Ptr("HdInsight version 1.6.1.0.335536"), - // FriendlyName: to.Ptr("1.6"), - // IsDefault: to.Ptr(false), - // }, - // { - // ComponentVersions: map[string]*string{ - // "HDP": to.Ptr("1.3"), - // "Hadoop": to.Ptr("1.2.0"), - // }, - // DisplayName: to.Ptr("Version 2.1.9.406.1221105"), - // FriendlyName: to.Ptr("2.1"), - // IsDefault: to.Ptr(false), - // }, - // { - // ComponentVersions: map[string]*string{ - // "HDP": to.Ptr("2.0"), - // "Hadoop": to.Ptr("2.2.0"), - // }, - // DisplayName: to.Ptr("Version 3.0.6.989.2441725"), - // FriendlyName: to.Ptr("3.0"), - // IsDefault: to.Ptr(false), - // }, - // { - // ComponentVersions: map[string]*string{ - // "HBase": to.Ptr("0.98"), - // "HDP": to.Ptr("2.1.7"), - // "Hadoop": to.Ptr("2.4.0"), - // }, - // DisplayName: to.Ptr("Version 3.1.4.989.2441725"), - // FriendlyName: to.Ptr("3.1"), - // IsDefault: to.Ptr(false), - // }, - // { - // ComponentVersions: map[string]*string{ - // "HBase": to.Ptr("0.98.4"), - // "HDP": to.Ptr("2.2"), - // "Hadoop": to.Ptr("2.6.0"), - // "Storm": to.Ptr("0.9.3"), - // }, - // DisplayName: to.Ptr("Version 3.2.7.989.2441725"), - // FriendlyName: to.Ptr("3.2"), - // IsDefault: to.Ptr(false), - // }, - // { - // ComponentVersions: map[string]*string{ - // "HBase": to.Ptr("1.1.2"), - // "HDP": to.Ptr("2.3"), - // "Hadoop": to.Ptr("2.7.0"), - // "Storm": to.Ptr("0.10.0"), - // }, - // DisplayName: to.Ptr("Version 3.3.0.989.2441725"), - // FriendlyName: to.Ptr("3.3"), - // IsDefault: to.Ptr(true), - // }}, - // }, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7a2ac91de424f271cf91cc8009f3fe9ee8249086/specification/hdinsight/resource-manager/Microsoft.HDInsight/stable/2021-06-01/examples/GetHDInsightUsages.json -func ExampleLocationsClient_ListUsages() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armhdinsight.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewLocationsClient().ListUsages(ctx, "West US", 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.UsagesListResult = armhdinsight.UsagesListResult{ - // Value: []*armhdinsight.Usage{ - // { - // Name: &armhdinsight.LocalizedName{ - // LocalizedValue: to.Ptr("Cores"), - // Value: to.Ptr("cores"), - // }, - // CurrentValue: to.Ptr[int64](0), - // Limit: to.Ptr[int64](5000), - // Unit: to.Ptr("Count"), - // }}, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7a2ac91de424f271cf91cc8009f3fe9ee8249086/specification/hdinsight/resource-manager/Microsoft.HDInsight/stable/2021-06-01/examples/HDI_Locations_ListBillingSpecs.json -func ExampleLocationsClient_ListBillingSpecs() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armhdinsight.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewLocationsClient().ListBillingSpecs(ctx, "East US 2", 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.BillingResponseListResult = armhdinsight.BillingResponseListResult{ - // BillingResources: []*armhdinsight.BillingResources{ - // { - // BillingMeters: []*armhdinsight.BillingMeters{ - // }, - // DiskBillingMeters: []*armhdinsight.DiskBillingMeters{ - // }, - // Region: to.Ptr("East US 2"), - // }, - // { - // BillingMeters: []*armhdinsight.BillingMeters{ - // { - // Meter: to.Ptr("11111111-1111-1111-1111-111111111111"), - // MeterParameter: to.Ptr("default"), - // Unit: to.Ptr("CoreHours"), - // }, - // { - // Meter: to.Ptr("11111111-1111-1111-1111-111111111111"), - // MeterParameter: to.Ptr("Kafka"), - // Unit: to.Ptr("CoreHours"), - // }}, - // DiskBillingMeters: []*armhdinsight.DiskBillingMeters{ - // { - // DiskRpMeter: to.Ptr("11111111-1111-1111-1111-111111111111"), - // SKU: to.Ptr("All"), - // Tier: to.Ptr(armhdinsight.TierStandard), - // }, - // { - // DiskRpMeter: to.Ptr("11111111-1111-1111-1111-111111111111"), - // SKU: to.Ptr("All"), - // Tier: to.Ptr(armhdinsight.TierStandard), - // }}, - // Region: to.Ptr("default"), - // }}, - // VMSizeFilters: []*armhdinsight.VMSizeCompatibilityFilterV2{ - // { - // FilterMode: to.Ptr(armhdinsight.FilterModeExclude), - // }}, - // VMSizes: []*string{ - // to.Ptr("A5"), - // to.Ptr("A6"), - // to.Ptr("A7")}, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7a2ac91de424f271cf91cc8009f3fe9ee8249086/specification/hdinsight/resource-manager/Microsoft.HDInsight/stable/2021-06-01/examples/HDI_Locations_GetAsyncOperationStatus.json -func ExampleLocationsClient_GetAzureAsyncOperationStatus() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armhdinsight.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewLocationsClient().GetAzureAsyncOperationStatus(ctx, "East US 2", "8a0348f4-8a85-4ec2-abe0-03b26104a9a0-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.AsyncOperationResult = armhdinsight.AsyncOperationResult{ - // Status: to.Ptr(armhdinsight.AsyncOperationStateSucceeded), - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7a2ac91de424f271cf91cc8009f3fe9ee8249086/specification/hdinsight/resource-manager/Microsoft.HDInsight/stable/2021-06-01/examples/HDI_Locations_CheckClusterNameAvailability.json -func ExampleLocationsClient_CheckNameAvailability() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armhdinsight.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewLocationsClient().CheckNameAvailability(ctx, "westus", armhdinsight.NameAvailabilityCheckRequestParameters{ - Name: to.Ptr("test123"), - Type: to.Ptr("clusters"), - }, 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.NameAvailabilityCheckResult = armhdinsight.NameAvailabilityCheckResult{ - // Message: to.Ptr("Cluster name 'test123' is unavailable"), - // NameAvailable: to.Ptr(false), - // Reason: to.Ptr("AlreadyExists"), - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7a2ac91de424f271cf91cc8009f3fe9ee8249086/specification/hdinsight/resource-manager/Microsoft.HDInsight/stable/2021-06-01/examples/HDI_Locations_ValidateClusterCreateRequest.json -func ExampleLocationsClient_ValidateClusterCreateRequest() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armhdinsight.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewLocationsClient().ValidateClusterCreateRequest(ctx, "southcentralus", armhdinsight.ClusterCreateRequestValidationParameters{ - Location: to.Ptr("southcentralus"), - Properties: &armhdinsight.ClusterCreateProperties{ - ClusterDefinition: &armhdinsight.ClusterDefinition{ - ComponentVersion: map[string]*string{ - "Spark": to.Ptr("2.4"), - }, - Configurations: map[string]any{ - "gateway": map[string]any{ - "restAuthCredential.isEnabled": true, - "restAuthCredential.password": "**********", - "restAuthCredential.username": "admin", - }, - }, - Kind: to.Ptr("spark"), - }, - ClusterVersion: to.Ptr("4.0"), - ComputeProfile: &armhdinsight.ComputeProfile{ - Roles: []*armhdinsight.Role{ - { - Name: to.Ptr("headnode"), - HardwareProfile: &armhdinsight.HardwareProfile{ - VMSize: to.Ptr("Standard_E8_V3"), - }, - MinInstanceCount: to.Ptr[int32](1), - OSProfile: &armhdinsight.OsProfile{ - LinuxOperatingSystemProfile: &armhdinsight.LinuxOperatingSystemProfile{ - Password: to.Ptr("********"), - Username: to.Ptr("sshuser"), - }, - }, - ScriptActions: []*armhdinsight.ScriptAction{}, - TargetInstanceCount: to.Ptr[int32](2), - }, - { - Name: to.Ptr("workernode"), - HardwareProfile: &armhdinsight.HardwareProfile{ - VMSize: to.Ptr("Standard_E8_V3"), - }, - OSProfile: &armhdinsight.OsProfile{ - LinuxOperatingSystemProfile: &armhdinsight.LinuxOperatingSystemProfile{ - Password: to.Ptr("********"), - Username: to.Ptr("sshuser"), - }, - }, - ScriptActions: []*armhdinsight.ScriptAction{}, - TargetInstanceCount: to.Ptr[int32](4), - }, - { - Name: to.Ptr("zookeepernode"), - HardwareProfile: &armhdinsight.HardwareProfile{ - VMSize: to.Ptr("Standard_D13_V2"), - }, - MinInstanceCount: to.Ptr[int32](1), - OSProfile: &armhdinsight.OsProfile{ - LinuxOperatingSystemProfile: &armhdinsight.LinuxOperatingSystemProfile{ - Password: to.Ptr("**********"), - Username: to.Ptr("sshuser"), - }, - }, - ScriptActions: []*armhdinsight.ScriptAction{}, - TargetInstanceCount: to.Ptr[int32](3), - }}, - }, - MinSupportedTLSVersion: to.Ptr("1.2"), - OSType: to.Ptr(armhdinsight.OSTypeLinux), - StorageProfile: &armhdinsight.StorageProfile{ - Storageaccounts: []*armhdinsight.StorageAccount{ - { - Name: to.Ptr("storagename.blob.core.windows.net"), - Container: to.Ptr("contianername"), - IsDefault: to.Ptr(true), - Key: to.Ptr("*******"), - ResourceID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Storage/storageAccounts/storagename"), - }}, - }, - Tier: to.Ptr(armhdinsight.TierStandard), - }, - Tags: map[string]*string{}, - Name: to.Ptr("testclustername"), - Type: to.Ptr("Microsoft.HDInsight/clusters"), - FetchAaddsResource: to.Ptr(false), - TenantID: to.Ptr("00000000-0000-0000-0000-000000000000"), - }, 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.ClusterCreateValidationResult = armhdinsight.ClusterCreateValidationResult{ - // EstimatedCreationDuration: to.Ptr("00:20:00"), - // ValidationErrors: []*armhdinsight.ValidationErrorInfo{ - // }, - // } -} diff --git a/sdk/resourcemanager/hdinsight/armhdinsight/models.go b/sdk/resourcemanager/hdinsight/armhdinsight/models.go index 05db414a3ddf..763329d97fd5 100644 --- a/sdk/resourcemanager/hdinsight/armhdinsight/models.go +++ b/sdk/resourcemanager/hdinsight/armhdinsight/models.go @@ -1701,6 +1701,10 @@ type StorageAccount struct { // The container in the storage account, only to be specified for WASB storage accounts. Container *string + // Enable secure channel or not, it's an optional field. Default value is false when cluster version < 5.1 and true when cluster + // version >= 5.1 , + EnableSecureChannel *bool + // The filesystem, only to be specified for Azure Data Lake Storage Gen 2. FileSystem *string diff --git a/sdk/resourcemanager/hdinsight/armhdinsight/models_serde.go b/sdk/resourcemanager/hdinsight/armhdinsight/models_serde.go index fe615a58ab95..5c60fa6d818f 100644 --- a/sdk/resourcemanager/hdinsight/armhdinsight/models_serde.go +++ b/sdk/resourcemanager/hdinsight/armhdinsight/models_serde.go @@ -3695,6 +3695,7 @@ func (s *ServiceSpecification) UnmarshalJSON(data []byte) error { func (s StorageAccount) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) populate(objectMap, "container", s.Container) + populate(objectMap, "enableSecureChannel", s.EnableSecureChannel) populate(objectMap, "fileSystem", s.FileSystem) populate(objectMap, "fileshare", s.Fileshare) populate(objectMap, "isDefault", s.IsDefault) @@ -3718,6 +3719,9 @@ func (s *StorageAccount) UnmarshalJSON(data []byte) error { case "container": err = unpopulate(val, "Container", &s.Container) delete(rawMsg, key) + case "enableSecureChannel": + err = unpopulate(val, "EnableSecureChannel", &s.EnableSecureChannel) + delete(rawMsg, key) case "fileSystem": err = unpopulate(val, "FileSystem", &s.FileSystem) delete(rawMsg, key) diff --git a/sdk/resourcemanager/hdinsight/armhdinsight/operations_client.go b/sdk/resourcemanager/hdinsight/armhdinsight/operations_client.go index 4fba766d70ff..72d557aee329 100644 --- a/sdk/resourcemanager/hdinsight/armhdinsight/operations_client.go +++ b/sdk/resourcemanager/hdinsight/armhdinsight/operations_client.go @@ -40,7 +40,7 @@ func NewOperationsClient(credential azcore.TokenCredential, options *arm.ClientO // NewListPager - Lists all of the available HDInsight REST API operations. // -// Generated from API version 2021-06-01 +// Generated from API version 2023-04-15-preview // - options - OperationsClientListOptions contains the optional parameters for the OperationsClient.NewListPager method. func (client *OperationsClient) NewListPager(options *OperationsClientListOptions) *runtime.Pager[OperationsClientListResponse] { return runtime.NewPager(runtime.PagingHandler[OperationsClientListResponse]{ @@ -78,7 +78,7 @@ func (client *OperationsClient) listCreateRequest(ctx context.Context, options * return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-06-01") + reqQP.Set("api-version", "2023-04-15-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/hdinsight/armhdinsight/privateendpointconnections_client.go b/sdk/resourcemanager/hdinsight/armhdinsight/privateendpointconnections_client.go index c2c50dfae6d7..3d9480835c66 100644 --- a/sdk/resourcemanager/hdinsight/armhdinsight/privateendpointconnections_client.go +++ b/sdk/resourcemanager/hdinsight/armhdinsight/privateendpointconnections_client.go @@ -48,7 +48,7 @@ func NewPrivateEndpointConnectionsClient(subscriptionID string, credential azcor // BeginCreateOrUpdate - Approve or reject a private endpoint connection manually. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2021-06-01 +// Generated from API version 2023-04-15-preview // - resourceGroupName - The name of the resource group. // - clusterName - The name of the cluster. // - privateEndpointConnectionName - The name of the private endpoint connection. @@ -72,7 +72,7 @@ func (client *PrivateEndpointConnectionsClient) BeginCreateOrUpdate(ctx context. // CreateOrUpdate - Approve or reject a private endpoint connection manually. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2021-06-01 +// Generated from API version 2023-04-15-preview func (client *PrivateEndpointConnectionsClient) createOrUpdate(ctx context.Context, resourceGroupName string, clusterName string, privateEndpointConnectionName string, parameters PrivateEndpointConnection, options *PrivateEndpointConnectionsClientBeginCreateOrUpdateOptions) (*http.Response, error) { req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, clusterName, privateEndpointConnectionName, parameters, options) if err != nil { @@ -112,7 +112,7 @@ func (client *PrivateEndpointConnectionsClient) createOrUpdateCreateRequest(ctx return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-06-01") + reqQP.Set("api-version", "2023-04-15-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, parameters) @@ -121,7 +121,7 @@ func (client *PrivateEndpointConnectionsClient) createOrUpdateCreateRequest(ctx // BeginDelete - Deletes the specific private endpoint connection. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2021-06-01 +// Generated from API version 2023-04-15-preview // - resourceGroupName - The name of the resource group. // - clusterName - The name of the cluster. // - privateEndpointConnectionName - The name of the private endpoint connection. @@ -144,7 +144,7 @@ func (client *PrivateEndpointConnectionsClient) BeginDelete(ctx context.Context, // Delete - Deletes the specific private endpoint connection. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2021-06-01 +// Generated from API version 2023-04-15-preview func (client *PrivateEndpointConnectionsClient) deleteOperation(ctx context.Context, resourceGroupName string, clusterName string, privateEndpointConnectionName string, options *PrivateEndpointConnectionsClientBeginDeleteOptions) (*http.Response, error) { req, err := client.deleteCreateRequest(ctx, resourceGroupName, clusterName, privateEndpointConnectionName, options) if err != nil { @@ -184,7 +184,7 @@ func (client *PrivateEndpointConnectionsClient) deleteCreateRequest(ctx context. return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-06-01") + reqQP.Set("api-version", "2023-04-15-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -193,7 +193,7 @@ func (client *PrivateEndpointConnectionsClient) deleteCreateRequest(ctx context. // Get - Gets the specific private endpoint connection. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2021-06-01 +// Generated from API version 2023-04-15-preview // - resourceGroupName - The name of the resource group. // - clusterName - The name of the cluster. // - privateEndpointConnectionName - The name of the private endpoint connection. @@ -238,7 +238,7 @@ func (client *PrivateEndpointConnectionsClient) getCreateRequest(ctx context.Con return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-06-01") + reqQP.Set("api-version", "2023-04-15-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -255,7 +255,7 @@ func (client *PrivateEndpointConnectionsClient) getHandleResponse(resp *http.Res // NewListByClusterPager - Lists the private endpoint connections for a HDInsight cluster. // -// Generated from API version 2021-06-01 +// Generated from API version 2023-04-15-preview // - resourceGroupName - The name of the resource group. // - clusterName - The name of the cluster. // - options - PrivateEndpointConnectionsClientListByClusterOptions contains the optional parameters for the PrivateEndpointConnectionsClient.NewListByClusterPager @@ -308,7 +308,7 @@ func (client *PrivateEndpointConnectionsClient) listByClusterCreateRequest(ctx c return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-06-01") + reqQP.Set("api-version", "2023-04-15-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/hdinsight/armhdinsight/privateendpointconnections_client_example_test.go b/sdk/resourcemanager/hdinsight/armhdinsight/privateendpointconnections_client_example_test.go deleted file mode 100644 index 0a06558b457b..000000000000 --- a/sdk/resourcemanager/hdinsight/armhdinsight/privateendpointconnections_client_example_test.go +++ /dev/null @@ -1,171 +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 armhdinsight_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/hdinsight/armhdinsight" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7a2ac91de424f271cf91cc8009f3fe9ee8249086/specification/hdinsight/resource-manager/Microsoft.HDInsight/stable/2021-06-01/examples/GetAllPrivateEndpointConnectionsInCluster.json -func ExamplePrivateEndpointConnectionsClient_NewListByClusterPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armhdinsight.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewPrivateEndpointConnectionsClient().NewListByClusterPager("rg1", "cluster1", 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.PrivateEndpointConnectionListResult = armhdinsight.PrivateEndpointConnectionListResult{ - // Value: []*armhdinsight.PrivateEndpointConnection{ - // { - // Name: to.Ptr("testprivateep.b3bf5fed-9b12-4560-b7d0-2abe1bba07e2"), - // Type: to.Ptr("Microsoft.HDInsight/clusters/privateEndpointConnections"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.HDInsight/clusters/cluster1/privateEndpointConnections/testprivateep.b3bf5fed-9b12-4560-b7d0-2abe1bba07e2"), - // Properties: &armhdinsight.PrivateEndpointConnectionProperties{ - // LinkIdentifier: to.Ptr("620815036"), - // PrivateEndpoint: &armhdinsight.PrivateEndpoint{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg2/providers/Microsoft.Network/privateEndpoints/testprivateep"), - // }, - // PrivateLinkServiceConnectionState: &armhdinsight.PrivateLinkServiceConnectionState{ - // Description: to.Ptr(""), - // ActionsRequired: to.Ptr("None"), - // Status: to.Ptr(armhdinsight.PrivateLinkServiceConnectionStatusApproved), - // }, - // ProvisioningState: to.Ptr(armhdinsight.PrivateEndpointConnectionProvisioningStateSucceeded), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7a2ac91de424f271cf91cc8009f3fe9ee8249086/specification/hdinsight/resource-manager/Microsoft.HDInsight/stable/2021-06-01/examples/ApprovePrivateEndpointConnection.json -func ExamplePrivateEndpointConnectionsClient_BeginCreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armhdinsight.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewPrivateEndpointConnectionsClient().BeginCreateOrUpdate(ctx, "rg1", "cluster1", "testprivateep.b3bf5fed-9b12-4560-b7d0-2abe1bba07e2", armhdinsight.PrivateEndpointConnection{ - Properties: &armhdinsight.PrivateEndpointConnectionProperties{ - PrivateLinkServiceConnectionState: &armhdinsight.PrivateLinkServiceConnectionState{ - Description: to.Ptr("update it from pending to approved."), - ActionsRequired: to.Ptr("None"), - Status: to.Ptr(armhdinsight.PrivateLinkServiceConnectionStatusApproved), - }, - }, - }, 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.PrivateEndpointConnection = armhdinsight.PrivateEndpointConnection{ - // Name: to.Ptr("testprivateep.b3bf5fed-9b12-4560-b7d0-2abe1bba07e2"), - // Type: to.Ptr("Microsoft.HDInsight/clusters/privateEndpointConnections"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.HDInsight/clusters/cluster1/privateEndpointConnections/testprivateep.b3bf5fed-9b12-4560-b7d0-2abe1bba07e2"), - // Properties: &armhdinsight.PrivateEndpointConnectionProperties{ - // LinkIdentifier: to.Ptr("620815036"), - // PrivateEndpoint: &armhdinsight.PrivateEndpoint{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg2/providers/Microsoft.Network/privateEndpoints/testprivateep"), - // }, - // PrivateLinkServiceConnectionState: &armhdinsight.PrivateLinkServiceConnectionState{ - // Description: to.Ptr("update it from pending to approved."), - // ActionsRequired: to.Ptr("None"), - // Status: to.Ptr(armhdinsight.PrivateLinkServiceConnectionStatusApproved), - // }, - // ProvisioningState: to.Ptr(armhdinsight.PrivateEndpointConnectionProvisioningStateSucceeded), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7a2ac91de424f271cf91cc8009f3fe9ee8249086/specification/hdinsight/resource-manager/Microsoft.HDInsight/stable/2021-06-01/examples/GetPrivateEndpointConnection.json -func ExamplePrivateEndpointConnectionsClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armhdinsight.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewPrivateEndpointConnectionsClient().Get(ctx, "rg1", "cluster1", "testprivateep.b3bf5fed-9b12-4560-b7d0-2abe1bba07e2", 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.PrivateEndpointConnection = armhdinsight.PrivateEndpointConnection{ - // Name: to.Ptr("testprivateep.b3bf5fed-9b12-4560-b7d0-2abe1bba07e2"), - // Type: to.Ptr("Microsoft.HDInsight/clusters/privateEndpointConnections"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.HDInsight/clusters/cluster1/privateEndpointConnections/testprivateep.b3bf5fed-9b12-4560-b7d0-2abe1bba07e2"), - // Properties: &armhdinsight.PrivateEndpointConnectionProperties{ - // LinkIdentifier: to.Ptr("620815036"), - // PrivateEndpoint: &armhdinsight.PrivateEndpoint{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg2/providers/Microsoft.Network/privateEndpoints/testprivateep"), - // }, - // PrivateLinkServiceConnectionState: &armhdinsight.PrivateLinkServiceConnectionState{ - // Description: to.Ptr(""), - // ActionsRequired: to.Ptr("None"), - // Status: to.Ptr(armhdinsight.PrivateLinkServiceConnectionStatusApproved), - // }, - // ProvisioningState: to.Ptr(armhdinsight.PrivateEndpointConnectionProvisioningStateSucceeded), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7a2ac91de424f271cf91cc8009f3fe9ee8249086/specification/hdinsight/resource-manager/Microsoft.HDInsight/stable/2021-06-01/examples/DeletePrivateEndpointConnection.json -func ExamplePrivateEndpointConnectionsClient_BeginDelete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armhdinsight.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewPrivateEndpointConnectionsClient().BeginDelete(ctx, "rg1", "cluster1", "testprivateep.b3bf5fed-9b12-4560-b7d0-2abe1bba07e2", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} diff --git a/sdk/resourcemanager/hdinsight/armhdinsight/privatelinkresources_client.go b/sdk/resourcemanager/hdinsight/armhdinsight/privatelinkresources_client.go index f4dcb843580a..1e8edad8a354 100644 --- a/sdk/resourcemanager/hdinsight/armhdinsight/privatelinkresources_client.go +++ b/sdk/resourcemanager/hdinsight/armhdinsight/privatelinkresources_client.go @@ -48,7 +48,7 @@ func NewPrivateLinkResourcesClient(subscriptionID string, credential azcore.Toke // Get - Gets the specific private link resource. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2021-06-01 +// Generated from API version 2023-04-15-preview // - resourceGroupName - The name of the resource group. // - clusterName - The name of the cluster. // - privateLinkResourceName - The name of the private link resource. @@ -93,7 +93,7 @@ func (client *PrivateLinkResourcesClient) getCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-06-01") + reqQP.Set("api-version", "2023-04-15-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -111,7 +111,7 @@ func (client *PrivateLinkResourcesClient) getHandleResponse(resp *http.Response) // ListByCluster - Lists the private link resources in a HDInsight cluster. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2021-06-01 +// Generated from API version 2023-04-15-preview // - resourceGroupName - The name of the resource group. // - clusterName - The name of the cluster. // - options - PrivateLinkResourcesClientListByClusterOptions contains the optional parameters for the PrivateLinkResourcesClient.ListByCluster @@ -151,7 +151,7 @@ func (client *PrivateLinkResourcesClient) listByClusterCreateRequest(ctx context return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-06-01") + reqQP.Set("api-version", "2023-04-15-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/hdinsight/armhdinsight/privatelinkresources_client_example_test.go b/sdk/resourcemanager/hdinsight/armhdinsight/privatelinkresources_client_example_test.go deleted file mode 100644 index 494690c9aac3..000000000000 --- a/sdk/resourcemanager/hdinsight/armhdinsight/privatelinkresources_client_example_test.go +++ /dev/null @@ -1,97 +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 armhdinsight_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/hdinsight/armhdinsight" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7a2ac91de424f271cf91cc8009f3fe9ee8249086/specification/hdinsight/resource-manager/Microsoft.HDInsight/stable/2021-06-01/examples/GetAllPrivateLinkResourcesInCluster.json -func ExamplePrivateLinkResourcesClient_ListByCluster() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armhdinsight.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewPrivateLinkResourcesClient().ListByCluster(ctx, "rg1", "cluster1", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.PrivateLinkResourceListResult = armhdinsight.PrivateLinkResourceListResult{ - // Value: []*armhdinsight.PrivateLinkResource{ - // { - // Name: to.Ptr("gateway"), - // Type: to.Ptr("Microsoft.HDInsight/clusters/privateLinkResources"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.HDInsight/clusters/cluster1/privateLinkResources/gateway"), - // Properties: &armhdinsight.PrivateLinkResourceProperties{ - // GroupID: to.Ptr("gateway"), - // RequiredMembers: []*string{ - // to.Ptr("gateway")}, - // RequiredZoneNames: []*string{ - // to.Ptr("privatelink.azurehdinsight.net")}, - // }, - // }, - // { - // Name: to.Ptr("headnode"), - // Type: to.Ptr("Microsoft.HDInsight/clusters/privateLinkResources"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.HDInsight/clusters/cluster1/privateLinkResources/headnode"), - // Properties: &armhdinsight.PrivateLinkResourceProperties{ - // GroupID: to.Ptr("headnode"), - // RequiredMembers: []*string{ - // to.Ptr("headnode")}, - // RequiredZoneNames: []*string{ - // to.Ptr("privatelink.azurehdinsight.net")}, - // }, - // }}, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7a2ac91de424f271cf91cc8009f3fe9ee8249086/specification/hdinsight/resource-manager/Microsoft.HDInsight/stable/2021-06-01/examples/GetPrivateLinkResource.json -func ExamplePrivateLinkResourcesClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armhdinsight.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewPrivateLinkResourcesClient().Get(ctx, "rg1", "cluster1", "gateway", 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.PrivateLinkResource = armhdinsight.PrivateLinkResource{ - // Name: to.Ptr("gateway"), - // Type: to.Ptr("Microsoft.HDInsight/clusters/privateLinkResources"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.HDInsight/clusters/cluster1/privateLinkResources/gateway"), - // Properties: &armhdinsight.PrivateLinkResourceProperties{ - // GroupID: to.Ptr("gateway"), - // RequiredMembers: []*string{ - // to.Ptr("gateway")}, - // RequiredZoneNames: []*string{ - // to.Ptr("privatelink.azurehdinsight.net")}, - // }, - // } -} diff --git a/sdk/resourcemanager/hdinsight/armhdinsight/scriptactions_client.go b/sdk/resourcemanager/hdinsight/armhdinsight/scriptactions_client.go index 936e562d5fe6..8ff30aa53c03 100644 --- a/sdk/resourcemanager/hdinsight/armhdinsight/scriptactions_client.go +++ b/sdk/resourcemanager/hdinsight/armhdinsight/scriptactions_client.go @@ -48,7 +48,7 @@ func NewScriptActionsClient(subscriptionID string, credential azcore.TokenCreden // Delete - Deletes a specified persisted script action of the cluster. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2021-06-01 +// Generated from API version 2023-04-15-preview // - resourceGroupName - The name of the resource group. // - clusterName - The name of the cluster. // - scriptName - The name of the script. @@ -92,7 +92,7 @@ func (client *ScriptActionsClient) deleteCreateRequest(ctx context.Context, reso return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-06-01") + reqQP.Set("api-version", "2023-04-15-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -101,7 +101,7 @@ func (client *ScriptActionsClient) deleteCreateRequest(ctx context.Context, reso // GetExecutionAsyncOperationStatus - Gets the async operation status of execution operation. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2021-06-01 +// Generated from API version 2023-04-15-preview // - resourceGroupName - The name of the resource group. // - clusterName - The name of the cluster. // - operationID - The long running operation id. @@ -146,7 +146,7 @@ func (client *ScriptActionsClient) getExecutionAsyncOperationStatusCreateRequest return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-06-01") + reqQP.Set("api-version", "2023-04-15-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -164,7 +164,7 @@ func (client *ScriptActionsClient) getExecutionAsyncOperationStatusHandleRespons // GetExecutionDetail - Gets the script execution detail for the given script execution ID. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2021-06-01 +// Generated from API version 2023-04-15-preview // - resourceGroupName - The name of the resource group. // - clusterName - The name of the cluster. // - scriptExecutionID - The script execution Id @@ -209,7 +209,7 @@ func (client *ScriptActionsClient) getExecutionDetailCreateRequest(ctx context.C return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-06-01") + reqQP.Set("api-version", "2023-04-15-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -226,7 +226,7 @@ func (client *ScriptActionsClient) getExecutionDetailHandleResponse(resp *http.R // NewListByClusterPager - Lists all the persisted script actions for the specified cluster. // -// Generated from API version 2021-06-01 +// Generated from API version 2023-04-15-preview // - resourceGroupName - The name of the resource group. // - clusterName - The name of the cluster. // - options - ScriptActionsClientListByClusterOptions contains the optional parameters for the ScriptActionsClient.NewListByClusterPager @@ -279,7 +279,7 @@ func (client *ScriptActionsClient) listByClusterCreateRequest(ctx context.Contex return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-06-01") + reqQP.Set("api-version", "2023-04-15-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/hdinsight/armhdinsight/scriptactions_client_example_test.go b/sdk/resourcemanager/hdinsight/armhdinsight/scriptactions_client_example_test.go deleted file mode 100644 index df049e285204..000000000000 --- a/sdk/resourcemanager/hdinsight/armhdinsight/scriptactions_client_example_test.go +++ /dev/null @@ -1,129 +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 armhdinsight_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/hdinsight/armhdinsight" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7a2ac91de424f271cf91cc8009f3fe9ee8249086/specification/hdinsight/resource-manager/Microsoft.HDInsight/stable/2021-06-01/examples/DeleteScriptAction.json -func ExampleScriptActionsClient_Delete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armhdinsight.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = clientFactory.NewScriptActionsClient().Delete(ctx, "rg1", "cluster1", "scriptName", 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/7a2ac91de424f271cf91cc8009f3fe9ee8249086/specification/hdinsight/resource-manager/Microsoft.HDInsight/stable/2021-06-01/examples/GetLinuxHadoopScriptAction.json -func ExampleScriptActionsClient_NewListByClusterPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armhdinsight.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewScriptActionsClient().NewListByClusterPager("rg1", "cluster1", 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.ScriptActionsList = armhdinsight.ScriptActionsList{ - // Value: []*armhdinsight.RuntimeScriptActionDetail{ - // { - // Name: to.Ptr("app-Install"), - // ApplicationName: to.Ptr("app"), - // Roles: []*string{ - // to.Ptr("edgenode")}, - // URI: to.Ptr("https://app.com/azure/app_install.sh"), - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7a2ac91de424f271cf91cc8009f3fe9ee8249086/specification/hdinsight/resource-manager/Microsoft.HDInsight/stable/2021-06-01/examples/GetScriptActionById.json -func ExampleScriptActionsClient_GetExecutionDetail() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armhdinsight.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewScriptActionsClient().GetExecutionDetail(ctx, "rg1", "cluster1", "391145124054712", 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.RuntimeScriptActionDetail = armhdinsight.RuntimeScriptActionDetail{ - // Name: to.Ptr("Test"), - // ApplicationName: to.Ptr("app1"), - // Roles: []*string{ - // to.Ptr("headnode"), - // to.Ptr("workernode")}, - // URI: to.Ptr("http://testurl.com/install.ssh"), - // DebugInformation: to.Ptr(""), - // EndTime: to.Ptr("2017-03-22T21:34:39.293"), - // ExecutionSummary: []*armhdinsight.ScriptActionExecutionSummary{ - // }, - // Operation: to.Ptr("PostClusterCreateScriptActionRequest"), - // ScriptExecutionID: to.Ptr[int64](391145124054712), - // StartTime: to.Ptr("2017-03-22T21:34:39.293"), - // Status: to.Ptr("ValidationFailed"), - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7a2ac91de424f271cf91cc8009f3fe9ee8249086/specification/hdinsight/resource-manager/Microsoft.HDInsight/stable/2021-06-01/examples/GetScriptExecutionAsyncOperationStatus.json -func ExampleScriptActionsClient_GetExecutionAsyncOperationStatus() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armhdinsight.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewScriptActionsClient().GetExecutionAsyncOperationStatus(ctx, "rg1", "cluster1", "CF938302-6B4D-44A0-A6D2-C0D67E847AEC", 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.AsyncOperationResult = armhdinsight.AsyncOperationResult{ - // Status: to.Ptr(armhdinsight.AsyncOperationStateInProgress), - // } -} diff --git a/sdk/resourcemanager/hdinsight/armhdinsight/scriptexecutionhistory_client.go b/sdk/resourcemanager/hdinsight/armhdinsight/scriptexecutionhistory_client.go index 5aa06335a438..a5b009ebc4c0 100644 --- a/sdk/resourcemanager/hdinsight/armhdinsight/scriptexecutionhistory_client.go +++ b/sdk/resourcemanager/hdinsight/armhdinsight/scriptexecutionhistory_client.go @@ -47,7 +47,7 @@ func NewScriptExecutionHistoryClient(subscriptionID string, credential azcore.To // NewListByClusterPager - Lists all scripts' execution history for the specified cluster. // -// Generated from API version 2021-06-01 +// Generated from API version 2023-04-15-preview // - resourceGroupName - The name of the resource group. // - clusterName - The name of the cluster. // - options - ScriptExecutionHistoryClientListByClusterOptions contains the optional parameters for the ScriptExecutionHistoryClient.NewListByClusterPager @@ -100,7 +100,7 @@ func (client *ScriptExecutionHistoryClient) listByClusterCreateRequest(ctx conte return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-06-01") + reqQP.Set("api-version", "2023-04-15-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -118,7 +118,7 @@ func (client *ScriptExecutionHistoryClient) listByClusterHandleResponse(resp *ht // Promote - Promotes the specified ad-hoc script execution to a persisted script. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2021-06-01 +// Generated from API version 2023-04-15-preview // - resourceGroupName - The name of the resource group. // - clusterName - The name of the cluster. // - scriptExecutionID - The script execution Id @@ -163,7 +163,7 @@ func (client *ScriptExecutionHistoryClient) promoteCreateRequest(ctx context.Con return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-06-01") + reqQP.Set("api-version", "2023-04-15-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/hdinsight/armhdinsight/scriptexecutionhistory_client_example_test.go b/sdk/resourcemanager/hdinsight/armhdinsight/scriptexecutionhistory_client_example_test.go deleted file mode 100644 index 963f184bcc38..000000000000 --- a/sdk/resourcemanager/hdinsight/armhdinsight/scriptexecutionhistory_client_example_test.go +++ /dev/null @@ -1,93 +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 armhdinsight_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/hdinsight/armhdinsight" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7a2ac91de424f271cf91cc8009f3fe9ee8249086/specification/hdinsight/resource-manager/Microsoft.HDInsight/stable/2021-06-01/examples/GetScriptExecutionHistory.json -func ExampleScriptExecutionHistoryClient_NewListByClusterPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armhdinsight.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewScriptExecutionHistoryClient().NewListByClusterPager("rg1", "cluster1", 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.ScriptActionExecutionHistoryList = armhdinsight.ScriptActionExecutionHistoryList{ - // Value: []*armhdinsight.RuntimeScriptActionDetail{ - // { - // Name: to.Ptr("Test"), - // ApplicationName: to.Ptr("app1"), - // Roles: []*string{ - // to.Ptr("headnode"), - // to.Ptr("workernode")}, - // URI: to.Ptr("http://testurl.com/install.ssh"), - // EndTime: to.Ptr("2017-03-22T21:34:39.293"), - // ExecutionSummary: []*armhdinsight.ScriptActionExecutionSummary{ - // }, - // Operation: to.Ptr("PostClusterCreateScriptActionRequest"), - // ScriptExecutionID: to.Ptr[int64](391145124054712), - // StartTime: to.Ptr("2017-03-22T21:34:39.293"), - // Status: to.Ptr("ValidationFailed"), - // }, - // { - // Name: to.Ptr("Test"), - // ApplicationName: to.Ptr("app2"), - // Roles: []*string{ - // to.Ptr("headnode"), - // to.Ptr("workernode")}, - // URI: to.Ptr("http://testurl.com/install-script.ssh"), - // EndTime: to.Ptr("2017-03-22T21:34:39.293"), - // ExecutionSummary: []*armhdinsight.ScriptActionExecutionSummary{ - // }, - // Operation: to.Ptr("PostClusterCreateScriptActionRequest"), - // ScriptExecutionID: to.Ptr[int64](391144597342127), - // StartTime: to.Ptr("2017-03-22T21:34:39.293"), - // Status: to.Ptr("ValidationFailed"), - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7a2ac91de424f271cf91cc8009f3fe9ee8249086/specification/hdinsight/resource-manager/Microsoft.HDInsight/stable/2021-06-01/examples/PromoteLinuxHadoopScriptAction.json -func ExampleScriptExecutionHistoryClient_Promote() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armhdinsight.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = clientFactory.NewScriptExecutionHistoryClient().Promote(ctx, "rg1", "cluster1", "391145124054712", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } -} diff --git a/sdk/resourcemanager/hdinsight/armhdinsight/virtualmachines_client.go b/sdk/resourcemanager/hdinsight/armhdinsight/virtualmachines_client.go index 20009ba603dd..fe3dace89cca 100644 --- a/sdk/resourcemanager/hdinsight/armhdinsight/virtualmachines_client.go +++ b/sdk/resourcemanager/hdinsight/armhdinsight/virtualmachines_client.go @@ -48,7 +48,7 @@ func NewVirtualMachinesClient(subscriptionID string, credential azcore.TokenCred // GetAsyncOperationStatus - Gets the async operation status. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2021-06-01 +// Generated from API version 2023-04-15-preview // - resourceGroupName - The name of the resource group. // - clusterName - The name of the cluster. // - operationID - The long running operation id. @@ -93,7 +93,7 @@ func (client *VirtualMachinesClient) getAsyncOperationStatusCreateRequest(ctx co return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-06-01") + reqQP.Set("api-version", "2023-04-15-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -111,7 +111,7 @@ func (client *VirtualMachinesClient) getAsyncOperationStatusHandleResponse(resp // ListHosts - Lists the HDInsight clusters hosts // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2021-06-01 +// Generated from API version 2023-04-15-preview // - resourceGroupName - The name of the resource group. // - clusterName - The name of the cluster. // - options - VirtualMachinesClientListHostsOptions contains the optional parameters for the VirtualMachinesClient.ListHosts @@ -151,7 +151,7 @@ func (client *VirtualMachinesClient) listHostsCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-06-01") + reqQP.Set("api-version", "2023-04-15-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -169,7 +169,7 @@ func (client *VirtualMachinesClient) listHostsHandleResponse(resp *http.Response // BeginRestartHosts - Restarts the specified HDInsight cluster hosts. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2021-06-01 +// Generated from API version 2023-04-15-preview // - resourceGroupName - The name of the resource group. // - clusterName - The name of the cluster. // - hosts - The list of hosts to restart @@ -192,7 +192,7 @@ func (client *VirtualMachinesClient) BeginRestartHosts(ctx context.Context, reso // RestartHosts - Restarts the specified HDInsight cluster hosts. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2021-06-01 +// Generated from API version 2023-04-15-preview func (client *VirtualMachinesClient) restartHosts(ctx context.Context, resourceGroupName string, clusterName string, hosts []*string, options *VirtualMachinesClientBeginRestartHostsOptions) (*http.Response, error) { req, err := client.restartHostsCreateRequest(ctx, resourceGroupName, clusterName, hosts, options) if err != nil { @@ -228,7 +228,7 @@ func (client *VirtualMachinesClient) restartHostsCreateRequest(ctx context.Conte return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-06-01") + reqQP.Set("api-version", "2023-04-15-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, hosts) diff --git a/sdk/resourcemanager/hdinsight/armhdinsight/virtualmachines_client_example_test.go b/sdk/resourcemanager/hdinsight/armhdinsight/virtualmachines_client_example_test.go deleted file mode 100644 index c3123a08a177..000000000000 --- a/sdk/resourcemanager/hdinsight/armhdinsight/virtualmachines_client_example_test.go +++ /dev/null @@ -1,113 +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 armhdinsight_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/hdinsight/armhdinsight" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7a2ac91de424f271cf91cc8009f3fe9ee8249086/specification/hdinsight/resource-manager/Microsoft.HDInsight/stable/2021-06-01/examples/GetClusterVirtualMachines.json -func ExampleVirtualMachinesClient_ListHosts() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armhdinsight.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewVirtualMachinesClient().ListHosts(ctx, "rg1", "cluster1", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.HostInfoArray = []*armhdinsight.HostInfo{ - // { - // Name: to.Ptr("gateway1"), - // }, - // { - // Name: to.Ptr("gateway3"), - // }, - // { - // Name: to.Ptr("headnode0"), - // }, - // { - // Name: to.Ptr("headnode3"), - // }, - // { - // Name: to.Ptr("workernode0"), - // }, - // { - // Name: to.Ptr("workernode1"), - // }, - // { - // Name: to.Ptr("zookeepernode0"), - // }, - // { - // Name: to.Ptr("zookeepernode2"), - // }, - // { - // Name: to.Ptr("zookeepernode3"), - // }} -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7a2ac91de424f271cf91cc8009f3fe9ee8249086/specification/hdinsight/resource-manager/Microsoft.HDInsight/stable/2021-06-01/examples/RestartVirtualMachinesOperation.json -func ExampleVirtualMachinesClient_BeginRestartHosts() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armhdinsight.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewVirtualMachinesClient().BeginRestartHosts(ctx, "rg1", "cluster1", []*string{ - to.Ptr("gateway1"), - to.Ptr("gateway3")}, 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/7a2ac91de424f271cf91cc8009f3fe9ee8249086/specification/hdinsight/resource-manager/Microsoft.HDInsight/stable/2021-06-01/examples/GetRestartHostsAsyncOperationStatus.json -func ExampleVirtualMachinesClient_GetAsyncOperationStatus() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armhdinsight.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewVirtualMachinesClient().GetAsyncOperationStatus(ctx, "rg1", "cluster1", "CF938302-6B4D-44A0-A6D2-C0D67E847AEC", 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.AsyncOperationResult = armhdinsight.AsyncOperationResult{ - // Status: to.Ptr(armhdinsight.AsyncOperationStateInProgress), - // } -}