diff --git a/sdk/resourcemanager/hdinsight/armhdinsight/CHANGELOG.md b/sdk/resourcemanager/hdinsight/armhdinsight/CHANGELOG.md index 571d091b8498..e38ec2d38b56 100644 --- a/sdk/resourcemanager/hdinsight/armhdinsight/CHANGELOG.md +++ b/sdk/resourcemanager/hdinsight/armhdinsight/CHANGELOG.md @@ -1,5 +1,12 @@ # Release History +## 1.2.0-beta.2 (2023-08-21) +### Features Added + +- New enum type `OutboundDependenciesManagedType` with values `OutboundDependenciesManagedTypeExternal`, `OutboundDependenciesManagedTypeManaged` +- New field `OutboundDependenciesManagedType` in struct `NetworkProperties` + + ## 1.2.0-beta.1 (2023-07-28) ### Features Added diff --git a/sdk/resourcemanager/hdinsight/armhdinsight/applications_client.go b/sdk/resourcemanager/hdinsight/armhdinsight/applications_client.go index 3b14a6a1fefc..88d0db7df599 100644 --- a/sdk/resourcemanager/hdinsight/armhdinsight/applications_client.go +++ b/sdk/resourcemanager/hdinsight/armhdinsight/applications_client.go @@ -3,9 +3,8 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. package armhdinsight @@ -48,7 +47,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 2023-04-15-preview +// Generated from API version 2023-08-15-preview // - resourceGroupName - The name of the resource group. // - clusterName - The name of the cluster. // - applicationName - The constant value for the application name. @@ -61,9 +60,10 @@ func (client *ApplicationsClient) BeginCreate(ctx context.Context, resourceGroup if err != nil { return nil, err } - return runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[ApplicationsClientCreateResponse]{ + poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[ApplicationsClientCreateResponse]{ FinalStateVia: runtime.FinalStateViaLocation, }) + return poller, err } else { return runtime.NewPollerFromResumeToken[ApplicationsClientCreateResponse](options.ResumeToken, client.internal.Pipeline(), nil) } @@ -72,20 +72,22 @@ 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 2023-04-15-preview +// Generated from API version 2023-08-15-preview func (client *ApplicationsClient) create(ctx context.Context, resourceGroupName string, clusterName string, applicationName string, parameters Application, options *ApplicationsClientBeginCreateOptions) (*http.Response, error) { + var err error req, err := client.createCreateRequest(ctx, resourceGroupName, clusterName, applicationName, parameters, options) if err != nil { return nil, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return nil, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return nil, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return nil, err } - return resp, nil + return httpResp, nil } // createCreateRequest creates the Create request. @@ -112,16 +114,19 @@ func (client *ApplicationsClient) createCreateRequest(ctx context.Context, resou return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-04-15-preview") + reqQP.Set("api-version", "2023-08-15-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, parameters) + if err := runtime.MarshalAsJSON(req, parameters); err != nil { + return nil, err + } + return req, nil } // BeginDelete - Deletes the specified application on the HDInsight cluster. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-04-15-preview +// Generated from API version 2023-08-15-preview // - resourceGroupName - The name of the resource group. // - clusterName - The name of the cluster. // - applicationName - The constant value for the application name. @@ -133,9 +138,10 @@ func (client *ApplicationsClient) BeginDelete(ctx context.Context, resourceGroup if err != nil { return nil, err } - return runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[ApplicationsClientDeleteResponse]{ + poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[ApplicationsClientDeleteResponse]{ FinalStateVia: runtime.FinalStateViaLocation, }) + return poller, err } else { return runtime.NewPollerFromResumeToken[ApplicationsClientDeleteResponse](options.ResumeToken, client.internal.Pipeline(), nil) } @@ -144,20 +150,22 @@ 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 2023-04-15-preview +// Generated from API version 2023-08-15-preview func (client *ApplicationsClient) deleteOperation(ctx context.Context, resourceGroupName string, clusterName string, applicationName string, options *ApplicationsClientBeginDeleteOptions) (*http.Response, error) { + var err error req, err := client.deleteCreateRequest(ctx, resourceGroupName, clusterName, applicationName, options) if err != nil { return nil, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return nil, err } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted, http.StatusNoContent) { - return nil, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted, http.StatusNoContent) { + err = runtime.NewResponseError(httpResp) + return nil, err } - return resp, nil + return httpResp, nil } // deleteCreateRequest creates the Delete request. @@ -184,7 +192,7 @@ func (client *ApplicationsClient) deleteCreateRequest(ctx context.Context, resou return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-04-15-preview") + reqQP.Set("api-version", "2023-08-15-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -193,24 +201,27 @@ 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 2023-04-15-preview +// Generated from API version 2023-08-15-preview // - resourceGroupName - The name of the resource group. // - clusterName - The name of the cluster. // - applicationName - The constant value for the application name. // - options - ApplicationsClientGetOptions contains the optional parameters for the ApplicationsClient.Get method. func (client *ApplicationsClient) Get(ctx context.Context, resourceGroupName string, clusterName string, applicationName string, options *ApplicationsClientGetOptions) (ApplicationsClientGetResponse, error) { + var err error req, err := client.getCreateRequest(ctx, resourceGroupName, clusterName, applicationName, options) if err != nil { return ApplicationsClientGetResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return ApplicationsClientGetResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return ApplicationsClientGetResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return ApplicationsClientGetResponse{}, err } - return client.getHandleResponse(resp) + resp, err := client.getHandleResponse(httpResp) + return resp, err } // getCreateRequest creates the Get request. @@ -237,7 +248,7 @@ func (client *ApplicationsClient) getCreateRequest(ctx context.Context, resource return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-04-15-preview") + reqQP.Set("api-version", "2023-08-15-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -255,7 +266,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 2023-04-15-preview +// Generated from API version 2023-08-15-preview // - resourceGroupName - The name of the resource group. // - clusterName - The name of the cluster. // - applicationName - The constant value for the application name. @@ -263,18 +274,21 @@ func (client *ApplicationsClient) getHandleResponse(resp *http.Response) (Applic // - options - ApplicationsClientGetAzureAsyncOperationStatusOptions contains the optional parameters for the ApplicationsClient.GetAzureAsyncOperationStatus // method. func (client *ApplicationsClient) GetAzureAsyncOperationStatus(ctx context.Context, resourceGroupName string, clusterName string, applicationName string, operationID string, options *ApplicationsClientGetAzureAsyncOperationStatusOptions) (ApplicationsClientGetAzureAsyncOperationStatusResponse, error) { + var err error req, err := client.getAzureAsyncOperationStatusCreateRequest(ctx, resourceGroupName, clusterName, applicationName, operationID, options) if err != nil { return ApplicationsClientGetAzureAsyncOperationStatusResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return ApplicationsClientGetAzureAsyncOperationStatusResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return ApplicationsClientGetAzureAsyncOperationStatusResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return ApplicationsClientGetAzureAsyncOperationStatusResponse{}, err } - return client.getAzureAsyncOperationStatusHandleResponse(resp) + resp, err := client.getAzureAsyncOperationStatusHandleResponse(httpResp) + return resp, err } // getAzureAsyncOperationStatusCreateRequest creates the GetAzureAsyncOperationStatus request. @@ -305,7 +319,7 @@ func (client *ApplicationsClient) getAzureAsyncOperationStatusCreateRequest(ctx return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-04-15-preview") + reqQP.Set("api-version", "2023-08-15-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -322,7 +336,7 @@ func (client *ApplicationsClient) getAzureAsyncOperationStatusHandleResponse(res // NewListByClusterPager - Lists all of the applications for the HDInsight cluster. // -// Generated from API version 2023-04-15-preview +// Generated from API version 2023-08-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 +389,7 @@ func (client *ApplicationsClient) listByClusterCreateRequest(ctx context.Context return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-04-15-preview") + reqQP.Set("api-version", "2023-08-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 2bfe895c7272..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/310a0100f5b020c1900c527a6aa70d21992f078a/specification/hdinsight/resource-manager/Microsoft.HDInsight/preview/2023-04-15-preview/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/310a0100f5b020c1900c527a6aa70d21992f078a/specification/hdinsight/resource-manager/Microsoft.HDInsight/preview/2023-04-15-preview/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/310a0100f5b020c1900c527a6aa70d21992f078a/specification/hdinsight/resource-manager/Microsoft.HDInsight/preview/2023-04-15-preview/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/310a0100f5b020c1900c527a6aa70d21992f078a/specification/hdinsight/resource-manager/Microsoft.HDInsight/preview/2023-04-15-preview/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/310a0100f5b020c1900c527a6aa70d21992f078a/specification/hdinsight/resource-manager/Microsoft.HDInsight/preview/2023-04-15-preview/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/310a0100f5b020c1900c527a6aa70d21992f078a/specification/hdinsight/resource-manager/Microsoft.HDInsight/preview/2023-04-15-preview/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 0c84582e4008..6807ff605426 100644 --- a/sdk/resourcemanager/hdinsight/armhdinsight/autorest.md +++ b/sdk/resourcemanager/hdinsight/armhdinsight/autorest.md @@ -5,14 +5,13 @@ ``` yaml azure-arm: true require: -- https://github.com/Azure/azure-rest-api-specs/blob/310a0100f5b020c1900c527a6aa70d21992f078a/specification/hdinsight/resource-manager/readme.md -- https://github.com/Azure/azure-rest-api-specs/blob/310a0100f5b020c1900c527a6aa70d21992f078a/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.2.0-beta.1 +module-version: 1.2.0-beta.2 directive: - from: cluster.json where: $.definitions.Resource transform: > $["title"] = "Resource" -tag: package-2023-04-preview ``` \ No newline at end of file diff --git a/sdk/resourcemanager/hdinsight/armhdinsight/client_factory.go b/sdk/resourcemanager/hdinsight/armhdinsight/client_factory.go index 4702e9a71817..57500749120a 100644 --- a/sdk/resourcemanager/hdinsight/armhdinsight/client_factory.go +++ b/sdk/resourcemanager/hdinsight/armhdinsight/client_factory.go @@ -3,9 +3,8 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. package armhdinsight diff --git a/sdk/resourcemanager/hdinsight/armhdinsight/clusters_client.go b/sdk/resourcemanager/hdinsight/armhdinsight/clusters_client.go index 7a135702d7f0..278ff363d463 100644 --- a/sdk/resourcemanager/hdinsight/armhdinsight/clusters_client.go +++ b/sdk/resourcemanager/hdinsight/armhdinsight/clusters_client.go @@ -3,9 +3,8 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. package armhdinsight @@ -48,7 +47,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 2023-04-15-preview +// Generated from API version 2023-08-15-preview // - resourceGroupName - The name of the resource group. // - clusterName - The name of the cluster. // - parameters - The cluster create request. @@ -59,9 +58,10 @@ func (client *ClustersClient) BeginCreate(ctx context.Context, resourceGroupName if err != nil { return nil, err } - return runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[ClustersClientCreateResponse]{ + poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[ClustersClientCreateResponse]{ FinalStateVia: runtime.FinalStateViaLocation, }) + return poller, err } else { return runtime.NewPollerFromResumeToken[ClustersClientCreateResponse](options.ResumeToken, client.internal.Pipeline(), nil) } @@ -70,20 +70,22 @@ 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 2023-04-15-preview +// Generated from API version 2023-08-15-preview func (client *ClustersClient) create(ctx context.Context, resourceGroupName string, clusterName string, parameters ClusterCreateParametersExtended, options *ClustersClientBeginCreateOptions) (*http.Response, error) { + var err error req, err := client.createCreateRequest(ctx, resourceGroupName, clusterName, parameters, options) if err != nil { return nil, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return nil, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return nil, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return nil, err } - return resp, nil + return httpResp, nil } // createCreateRequest creates the Create request. @@ -106,16 +108,19 @@ func (client *ClustersClient) createCreateRequest(ctx context.Context, resourceG return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-04-15-preview") + reqQP.Set("api-version", "2023-08-15-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, parameters) + if err := runtime.MarshalAsJSON(req, parameters); err != nil { + return nil, err + } + return req, nil } // BeginDelete - Deletes the specified HDInsight cluster. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-04-15-preview +// Generated from API version 2023-08-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. @@ -125,9 +130,10 @@ func (client *ClustersClient) BeginDelete(ctx context.Context, resourceGroupName if err != nil { return nil, err } - return runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[ClustersClientDeleteResponse]{ + poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[ClustersClientDeleteResponse]{ FinalStateVia: runtime.FinalStateViaLocation, }) + return poller, err } else { return runtime.NewPollerFromResumeToken[ClustersClientDeleteResponse](options.ResumeToken, client.internal.Pipeline(), nil) } @@ -136,20 +142,22 @@ 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 2023-04-15-preview +// Generated from API version 2023-08-15-preview func (client *ClustersClient) deleteOperation(ctx context.Context, resourceGroupName string, clusterName string, options *ClustersClientBeginDeleteOptions) (*http.Response, error) { + var err error req, err := client.deleteCreateRequest(ctx, resourceGroupName, clusterName, options) if err != nil { return nil, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return nil, err } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted, http.StatusNoContent) { - return nil, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted, http.StatusNoContent) { + err = runtime.NewResponseError(httpResp) + return nil, err } - return resp, nil + return httpResp, nil } // deleteCreateRequest creates the Delete request. @@ -172,7 +180,7 @@ func (client *ClustersClient) deleteCreateRequest(ctx context.Context, resourceG return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-04-15-preview") + reqQP.Set("api-version", "2023-08-15-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -181,7 +189,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 2023-04-15-preview +// Generated from API version 2023-08-15-preview // - resourceGroupName - The name of the resource group. // - clusterName - The name of the cluster. // - parameters - The parameters for executing script actions. @@ -193,9 +201,10 @@ func (client *ClustersClient) BeginExecuteScriptActions(ctx context.Context, res if err != nil { return nil, err } - return runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[ClustersClientExecuteScriptActionsResponse]{ + poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[ClustersClientExecuteScriptActionsResponse]{ FinalStateVia: runtime.FinalStateViaLocation, }) + return poller, err } else { return runtime.NewPollerFromResumeToken[ClustersClientExecuteScriptActionsResponse](options.ResumeToken, client.internal.Pipeline(), nil) } @@ -204,20 +213,22 @@ 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 2023-04-15-preview +// Generated from API version 2023-08-15-preview func (client *ClustersClient) executeScriptActions(ctx context.Context, resourceGroupName string, clusterName string, parameters ExecuteScriptActionParameters, options *ClustersClientBeginExecuteScriptActionsOptions) (*http.Response, error) { + var err error req, err := client.executeScriptActionsCreateRequest(ctx, resourceGroupName, clusterName, parameters, options) if err != nil { return nil, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return nil, err } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted) { - return nil, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted) { + err = runtime.NewResponseError(httpResp) + return nil, err } - return resp, nil + return httpResp, nil } // executeScriptActionsCreateRequest creates the ExecuteScriptActions request. @@ -240,32 +251,38 @@ func (client *ClustersClient) executeScriptActionsCreateRequest(ctx context.Cont return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-04-15-preview") + reqQP.Set("api-version", "2023-08-15-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, parameters) + if err := runtime.MarshalAsJSON(req, parameters); err != nil { + return nil, err + } + return req, nil } // Get - Gets the specified cluster. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-04-15-preview +// Generated from API version 2023-08-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. func (client *ClustersClient) Get(ctx context.Context, resourceGroupName string, clusterName string, options *ClustersClientGetOptions) (ClustersClientGetResponse, error) { + var err error req, err := client.getCreateRequest(ctx, resourceGroupName, clusterName, options) if err != nil { return ClustersClientGetResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return ClustersClientGetResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return ClustersClientGetResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return ClustersClientGetResponse{}, err } - return client.getHandleResponse(resp) + resp, err := client.getHandleResponse(httpResp) + return resp, err } // getCreateRequest creates the Get request. @@ -288,7 +305,7 @@ func (client *ClustersClient) getCreateRequest(ctx context.Context, resourceGrou return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-04-15-preview") + reqQP.Set("api-version", "2023-08-15-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -306,25 +323,28 @@ 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 2023-04-15-preview +// Generated from API version 2023-08-15-preview // - resourceGroupName - The name of the resource group. // - clusterName - The name of the cluster. // - operationID - The long running operation id. // - options - ClustersClientGetAzureAsyncOperationStatusOptions contains the optional parameters for the ClustersClient.GetAzureAsyncOperationStatus // method. func (client *ClustersClient) GetAzureAsyncOperationStatus(ctx context.Context, resourceGroupName string, clusterName string, operationID string, options *ClustersClientGetAzureAsyncOperationStatusOptions) (ClustersClientGetAzureAsyncOperationStatusResponse, error) { + var err error req, err := client.getAzureAsyncOperationStatusCreateRequest(ctx, resourceGroupName, clusterName, operationID, options) if err != nil { return ClustersClientGetAzureAsyncOperationStatusResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return ClustersClientGetAzureAsyncOperationStatusResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return ClustersClientGetAzureAsyncOperationStatusResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return ClustersClientGetAzureAsyncOperationStatusResponse{}, err } - return client.getAzureAsyncOperationStatusHandleResponse(resp) + resp, err := client.getAzureAsyncOperationStatusHandleResponse(httpResp) + return resp, err } // getAzureAsyncOperationStatusCreateRequest creates the GetAzureAsyncOperationStatus request. @@ -351,7 +371,7 @@ func (client *ClustersClient) getAzureAsyncOperationStatusCreateRequest(ctx cont return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-04-15-preview") + reqQP.Set("api-version", "2023-08-15-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -369,24 +389,27 @@ 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 2023-04-15-preview +// Generated from API version 2023-08-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 // method. func (client *ClustersClient) GetGatewaySettings(ctx context.Context, resourceGroupName string, clusterName string, options *ClustersClientGetGatewaySettingsOptions) (ClustersClientGetGatewaySettingsResponse, error) { + var err error req, err := client.getGatewaySettingsCreateRequest(ctx, resourceGroupName, clusterName, options) if err != nil { return ClustersClientGetGatewaySettingsResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return ClustersClientGetGatewaySettingsResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return ClustersClientGetGatewaySettingsResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return ClustersClientGetGatewaySettingsResponse{}, err } - return client.getGatewaySettingsHandleResponse(resp) + resp, err := client.getGatewaySettingsHandleResponse(httpResp) + return resp, err } // getGatewaySettingsCreateRequest creates the GetGatewaySettings request. @@ -409,7 +432,7 @@ func (client *ClustersClient) getGatewaySettingsCreateRequest(ctx context.Contex return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-04-15-preview") + reqQP.Set("api-version", "2023-08-15-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -426,7 +449,7 @@ func (client *ClustersClient) getGatewaySettingsHandleResponse(resp *http.Respon // NewListPager - Lists all the HDInsight clusters under the subscription. // -// Generated from API version 2023-04-15-preview +// Generated from API version 2023-08-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 +491,7 @@ func (client *ClustersClient) listCreateRequest(ctx context.Context, options *Cl return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-04-15-preview") + reqQP.Set("api-version", "2023-08-15-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -485,7 +508,7 @@ func (client *ClustersClient) listHandleResponse(resp *http.Response) (ClustersC // NewListByResourceGroupPager - Lists the HDInsight clusters in a resource group. // -// Generated from API version 2023-04-15-preview +// Generated from API version 2023-08-15-preview // - resourceGroupName - The name of the resource group. // - options - ClustersClientListByResourceGroupOptions contains the optional parameters for the ClustersClient.NewListByResourceGroupPager // method. @@ -533,7 +556,7 @@ func (client *ClustersClient) listByResourceGroupCreateRequest(ctx context.Conte return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-04-15-preview") + reqQP.Set("api-version", "2023-08-15-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -551,7 +574,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 2023-04-15-preview +// Generated from API version 2023-08-15-preview // - resourceGroupName - The name of the resource group. // - clusterName - The name of the cluster. // - roleName - The constant value for the roleName @@ -563,9 +586,10 @@ func (client *ClustersClient) BeginResize(ctx context.Context, resourceGroupName if err != nil { return nil, err } - return runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[ClustersClientResizeResponse]{ + poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[ClustersClientResizeResponse]{ FinalStateVia: runtime.FinalStateViaLocation, }) + return poller, err } else { return runtime.NewPollerFromResumeToken[ClustersClientResizeResponse](options.ResumeToken, client.internal.Pipeline(), nil) } @@ -574,20 +598,22 @@ 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 2023-04-15-preview +// Generated from API version 2023-08-15-preview func (client *ClustersClient) resize(ctx context.Context, resourceGroupName string, clusterName string, roleName RoleName, parameters ClusterResizeParameters, options *ClustersClientBeginResizeOptions) (*http.Response, error) { + var err error req, err := client.resizeCreateRequest(ctx, resourceGroupName, clusterName, roleName, parameters, options) if err != nil { return nil, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return nil, err } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted) { - return nil, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted) { + err = runtime.NewResponseError(httpResp) + return nil, err } - return resp, nil + return httpResp, nil } // resizeCreateRequest creates the Resize request. @@ -614,16 +640,19 @@ func (client *ClustersClient) resizeCreateRequest(ctx context.Context, resourceG return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-04-15-preview") + reqQP.Set("api-version", "2023-08-15-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, parameters) + if err := runtime.MarshalAsJSON(req, parameters); err != nil { + return nil, err + } + return req, nil } // BeginRotateDiskEncryptionKey - Rotate disk encryption key of the specified HDInsight cluster. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-04-15-preview +// Generated from API version 2023-08-15-preview // - resourceGroupName - The name of the resource group. // - clusterName - The name of the cluster. // - parameters - The parameters for the disk encryption operation. @@ -635,9 +664,10 @@ func (client *ClustersClient) BeginRotateDiskEncryptionKey(ctx context.Context, if err != nil { return nil, err } - return runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[ClustersClientRotateDiskEncryptionKeyResponse]{ + poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[ClustersClientRotateDiskEncryptionKeyResponse]{ FinalStateVia: runtime.FinalStateViaLocation, }) + return poller, err } else { return runtime.NewPollerFromResumeToken[ClustersClientRotateDiskEncryptionKeyResponse](options.ResumeToken, client.internal.Pipeline(), nil) } @@ -646,20 +676,22 @@ 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 2023-04-15-preview +// Generated from API version 2023-08-15-preview func (client *ClustersClient) rotateDiskEncryptionKey(ctx context.Context, resourceGroupName string, clusterName string, parameters ClusterDiskEncryptionParameters, options *ClustersClientBeginRotateDiskEncryptionKeyOptions) (*http.Response, error) { + var err error req, err := client.rotateDiskEncryptionKeyCreateRequest(ctx, resourceGroupName, clusterName, parameters, options) if err != nil { return nil, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return nil, err } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted) { - return nil, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted) { + err = runtime.NewResponseError(httpResp) + return nil, err } - return resp, nil + return httpResp, nil } // rotateDiskEncryptionKeyCreateRequest creates the RotateDiskEncryptionKey request. @@ -682,33 +714,39 @@ func (client *ClustersClient) rotateDiskEncryptionKeyCreateRequest(ctx context.C return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-04-15-preview") + reqQP.Set("api-version", "2023-08-15-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, parameters) + if err := runtime.MarshalAsJSON(req, parameters); err != nil { + return nil, err + } + return req, nil } // Update - Patch HDInsight cluster with the specified parameters. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-04-15-preview +// Generated from API version 2023-08-15-preview // - resourceGroupName - The name of the resource group. // - clusterName - The name of the cluster. // - parameters - The cluster patch request. // - options - ClustersClientUpdateOptions contains the optional parameters for the ClustersClient.Update method. func (client *ClustersClient) Update(ctx context.Context, resourceGroupName string, clusterName string, parameters ClusterPatchParameters, options *ClustersClientUpdateOptions) (ClustersClientUpdateResponse, error) { + var err error req, err := client.updateCreateRequest(ctx, resourceGroupName, clusterName, parameters, options) if err != nil { return ClustersClientUpdateResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return ClustersClientUpdateResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return ClustersClientUpdateResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return ClustersClientUpdateResponse{}, err } - return client.updateHandleResponse(resp) + resp, err := client.updateHandleResponse(httpResp) + return resp, err } // updateCreateRequest creates the Update request. @@ -731,10 +769,13 @@ func (client *ClustersClient) updateCreateRequest(ctx context.Context, resourceG return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-04-15-preview") + reqQP.Set("api-version", "2023-08-15-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, parameters) + if err := runtime.MarshalAsJSON(req, parameters); err != nil { + return nil, err + } + return req, nil } // updateHandleResponse handles the Update response. @@ -749,7 +790,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 2023-04-15-preview +// Generated from API version 2023-08-15-preview // - resourceGroupName - The name of the resource group. // - clusterName - The name of the cluster. // - roleName - The constant value for the roleName @@ -762,9 +803,10 @@ func (client *ClustersClient) BeginUpdateAutoScaleConfiguration(ctx context.Cont if err != nil { return nil, err } - return runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[ClustersClientUpdateAutoScaleConfigurationResponse]{ + poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[ClustersClientUpdateAutoScaleConfigurationResponse]{ FinalStateVia: runtime.FinalStateViaLocation, }) + return poller, err } else { return runtime.NewPollerFromResumeToken[ClustersClientUpdateAutoScaleConfigurationResponse](options.ResumeToken, client.internal.Pipeline(), nil) } @@ -773,20 +815,22 @@ 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 2023-04-15-preview +// Generated from API version 2023-08-15-preview func (client *ClustersClient) updateAutoScaleConfiguration(ctx context.Context, resourceGroupName string, clusterName string, roleName RoleName, parameters AutoscaleConfigurationUpdateParameter, options *ClustersClientBeginUpdateAutoScaleConfigurationOptions) (*http.Response, error) { + var err error req, err := client.updateAutoScaleConfigurationCreateRequest(ctx, resourceGroupName, clusterName, roleName, parameters, options) if err != nil { return nil, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return nil, err } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted) { - return nil, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted) { + err = runtime.NewResponseError(httpResp) + return nil, err } - return resp, nil + return httpResp, nil } // updateAutoScaleConfigurationCreateRequest creates the UpdateAutoScaleConfiguration request. @@ -813,16 +857,19 @@ func (client *ClustersClient) updateAutoScaleConfigurationCreateRequest(ctx cont return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-04-15-preview") + reqQP.Set("api-version", "2023-08-15-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, parameters) + if err := runtime.MarshalAsJSON(req, parameters); err != nil { + return nil, err + } + return req, nil } // BeginUpdateGatewaySettings - Configures the gateway settings on the specified cluster. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-04-15-preview +// Generated from API version 2023-08-15-preview // - resourceGroupName - The name of the resource group. // - clusterName - The name of the cluster. // - parameters - The cluster configurations. @@ -834,9 +881,10 @@ func (client *ClustersClient) BeginUpdateGatewaySettings(ctx context.Context, re if err != nil { return nil, err } - return runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[ClustersClientUpdateGatewaySettingsResponse]{ + poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[ClustersClientUpdateGatewaySettingsResponse]{ FinalStateVia: runtime.FinalStateViaLocation, }) + return poller, err } else { return runtime.NewPollerFromResumeToken[ClustersClientUpdateGatewaySettingsResponse](options.ResumeToken, client.internal.Pipeline(), nil) } @@ -845,20 +893,22 @@ 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 2023-04-15-preview +// Generated from API version 2023-08-15-preview func (client *ClustersClient) updateGatewaySettings(ctx context.Context, resourceGroupName string, clusterName string, parameters UpdateGatewaySettingsParameters, options *ClustersClientBeginUpdateGatewaySettingsOptions) (*http.Response, error) { + var err error req, err := client.updateGatewaySettingsCreateRequest(ctx, resourceGroupName, clusterName, parameters, options) if err != nil { return nil, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return nil, err } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted) { - return nil, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted) { + err = runtime.NewResponseError(httpResp) + return nil, err } - return resp, nil + return httpResp, nil } // updateGatewaySettingsCreateRequest creates the UpdateGatewaySettings request. @@ -881,16 +931,19 @@ func (client *ClustersClient) updateGatewaySettingsCreateRequest(ctx context.Con return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-04-15-preview") + reqQP.Set("api-version", "2023-08-15-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, parameters) + if err := runtime.MarshalAsJSON(req, parameters); err != nil { + return nil, err + } + return req, nil } // BeginUpdateIdentityCertificate - Updates the cluster identity certificate. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-04-15-preview +// Generated from API version 2023-08-15-preview // - resourceGroupName - The name of the resource group. // - clusterName - The name of the cluster. // - parameters - The cluster configurations. @@ -902,9 +955,10 @@ func (client *ClustersClient) BeginUpdateIdentityCertificate(ctx context.Context if err != nil { return nil, err } - return runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[ClustersClientUpdateIdentityCertificateResponse]{ + poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[ClustersClientUpdateIdentityCertificateResponse]{ FinalStateVia: runtime.FinalStateViaLocation, }) + return poller, err } else { return runtime.NewPollerFromResumeToken[ClustersClientUpdateIdentityCertificateResponse](options.ResumeToken, client.internal.Pipeline(), nil) } @@ -913,20 +967,22 @@ 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 2023-04-15-preview +// Generated from API version 2023-08-15-preview func (client *ClustersClient) updateIdentityCertificate(ctx context.Context, resourceGroupName string, clusterName string, parameters UpdateClusterIdentityCertificateParameters, options *ClustersClientBeginUpdateIdentityCertificateOptions) (*http.Response, error) { + var err error req, err := client.updateIdentityCertificateCreateRequest(ctx, resourceGroupName, clusterName, parameters, options) if err != nil { return nil, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return nil, err } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted) { - return nil, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted) { + err = runtime.NewResponseError(httpResp) + return nil, err } - return resp, nil + return httpResp, nil } // updateIdentityCertificateCreateRequest creates the UpdateIdentityCertificate request. @@ -949,8 +1005,11 @@ func (client *ClustersClient) updateIdentityCertificateCreateRequest(ctx context return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-04-15-preview") + reqQP.Set("api-version", "2023-08-15-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, parameters) + if err := runtime.MarshalAsJSON(req, parameters); err != nil { + return nil, err + } + return req, nil } diff --git a/sdk/resourcemanager/hdinsight/armhdinsight/clusters_client_example_test.go b/sdk/resourcemanager/hdinsight/armhdinsight/clusters_client_example_test.go deleted file mode 100644 index 1718e845eede..000000000000 --- a/sdk/resourcemanager/hdinsight/armhdinsight/clusters_client_example_test.go +++ /dev/null @@ -1,3335 +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/310a0100f5b020c1900c527a6aa70d21992f078a/specification/hdinsight/resource-manager/Microsoft.HDInsight/preview/2023-04-15-preview/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"), - EnableSecureChannel: to.Ptr(true), - 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/310a0100f5b020c1900c527a6aa70d21992f078a/specification/hdinsight/resource-manager/Microsoft.HDInsight/preview/2023-04-15-preview/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"), - EnableSecureChannel: to.Ptr(true), - 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/310a0100f5b020c1900c527a6aa70d21992f078a/specification/hdinsight/resource-manager/Microsoft.HDInsight/preview/2023-04-15-preview/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"), - EnableSecureChannel: to.Ptr(true), - 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/310a0100f5b020c1900c527a6aa70d21992f078a/specification/hdinsight/resource-manager/Microsoft.HDInsight/preview/2023-04-15-preview/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"), - EnableSecureChannel: to.Ptr(true), - 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/310a0100f5b020c1900c527a6aa70d21992f078a/specification/hdinsight/resource-manager/Microsoft.HDInsight/preview/2023-04-15-preview/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"), - EnableSecureChannel: to.Ptr(true), - 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/310a0100f5b020c1900c527a6aa70d21992f078a/specification/hdinsight/resource-manager/Microsoft.HDInsight/preview/2023-04-15-preview/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"), - EnableSecureChannel: to.Ptr(true), - 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/310a0100f5b020c1900c527a6aa70d21992f078a/specification/hdinsight/resource-manager/Microsoft.HDInsight/preview/2023-04-15-preview/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"), - EnableSecureChannel: to.Ptr(true), - 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/310a0100f5b020c1900c527a6aa70d21992f078a/specification/hdinsight/resource-manager/Microsoft.HDInsight/preview/2023-04-15-preview/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"), - EnableSecureChannel: to.Ptr(true), - 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/310a0100f5b020c1900c527a6aa70d21992f078a/specification/hdinsight/resource-manager/Microsoft.HDInsight/preview/2023-04-15-preview/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"), - EnableSecureChannel: to.Ptr(true), - 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/310a0100f5b020c1900c527a6aa70d21992f078a/specification/hdinsight/resource-manager/Microsoft.HDInsight/preview/2023-04-15-preview/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"), - EnableSecureChannel: to.Ptr(true), - 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/310a0100f5b020c1900c527a6aa70d21992f078a/specification/hdinsight/resource-manager/Microsoft.HDInsight/preview/2023-04-15-preview/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"), - EnableSecureChannel: to.Ptr(true), - 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/310a0100f5b020c1900c527a6aa70d21992f078a/specification/hdinsight/resource-manager/Microsoft.HDInsight/preview/2023-04-15-preview/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"), - EnableSecureChannel: to.Ptr(true), - 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/310a0100f5b020c1900c527a6aa70d21992f078a/specification/hdinsight/resource-manager/Microsoft.HDInsight/preview/2023-04-15-preview/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"), - EnableSecureChannel: to.Ptr(true), - 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/310a0100f5b020c1900c527a6aa70d21992f078a/specification/hdinsight/resource-manager/Microsoft.HDInsight/preview/2023-04-15-preview/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/310a0100f5b020c1900c527a6aa70d21992f078a/specification/hdinsight/resource-manager/Microsoft.HDInsight/preview/2023-04-15-preview/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/310a0100f5b020c1900c527a6aa70d21992f078a/specification/hdinsight/resource-manager/Microsoft.HDInsight/preview/2023-04-15-preview/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/310a0100f5b020c1900c527a6aa70d21992f078a/specification/hdinsight/resource-manager/Microsoft.HDInsight/preview/2023-04-15-preview/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/310a0100f5b020c1900c527a6aa70d21992f078a/specification/hdinsight/resource-manager/Microsoft.HDInsight/preview/2023-04-15-preview/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/310a0100f5b020c1900c527a6aa70d21992f078a/specification/hdinsight/resource-manager/Microsoft.HDInsight/preview/2023-04-15-preview/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/310a0100f5b020c1900c527a6aa70d21992f078a/specification/hdinsight/resource-manager/Microsoft.HDInsight/preview/2023-04-15-preview/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/310a0100f5b020c1900c527a6aa70d21992f078a/specification/hdinsight/resource-manager/Microsoft.HDInsight/preview/2023-04-15-preview/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/310a0100f5b020c1900c527a6aa70d21992f078a/specification/hdinsight/resource-manager/Microsoft.HDInsight/preview/2023-04-15-preview/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/310a0100f5b020c1900c527a6aa70d21992f078a/specification/hdinsight/resource-manager/Microsoft.HDInsight/preview/2023-04-15-preview/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/310a0100f5b020c1900c527a6aa70d21992f078a/specification/hdinsight/resource-manager/Microsoft.HDInsight/preview/2023-04-15-preview/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/310a0100f5b020c1900c527a6aa70d21992f078a/specification/hdinsight/resource-manager/Microsoft.HDInsight/preview/2023-04-15-preview/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/310a0100f5b020c1900c527a6aa70d21992f078a/specification/hdinsight/resource-manager/Microsoft.HDInsight/preview/2023-04-15-preview/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/310a0100f5b020c1900c527a6aa70d21992f078a/specification/hdinsight/resource-manager/Microsoft.HDInsight/preview/2023-04-15-preview/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/310a0100f5b020c1900c527a6aa70d21992f078a/specification/hdinsight/resource-manager/Microsoft.HDInsight/preview/2023-04-15-preview/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/310a0100f5b020c1900c527a6aa70d21992f078a/specification/hdinsight/resource-manager/Microsoft.HDInsight/preview/2023-04-15-preview/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 d77db65e1106..fa915d0f5500 100644 --- a/sdk/resourcemanager/hdinsight/armhdinsight/configurations_client.go +++ b/sdk/resourcemanager/hdinsight/armhdinsight/configurations_client.go @@ -3,9 +3,8 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. package armhdinsight @@ -49,24 +48,27 @@ 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 2023-04-15-preview +// Generated from API version 2023-08-15-preview // - resourceGroupName - The name of the resource group. // - clusterName - The name of the cluster. // - configurationName - The name of the cluster configuration. // - options - ConfigurationsClientGetOptions contains the optional parameters for the ConfigurationsClient.Get method. func (client *ConfigurationsClient) Get(ctx context.Context, resourceGroupName string, clusterName string, configurationName string, options *ConfigurationsClientGetOptions) (ConfigurationsClientGetResponse, error) { + var err error req, err := client.getCreateRequest(ctx, resourceGroupName, clusterName, configurationName, options) if err != nil { return ConfigurationsClientGetResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return ConfigurationsClientGetResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return ConfigurationsClientGetResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return ConfigurationsClientGetResponse{}, err } - return client.getHandleResponse(resp) + resp, err := client.getHandleResponse(httpResp) + return resp, err } // getCreateRequest creates the Get request. @@ -93,7 +95,7 @@ func (client *ConfigurationsClient) getCreateRequest(ctx context.Context, resour return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-04-15-preview") + reqQP.Set("api-version", "2023-08-15-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -111,23 +113,26 @@ 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 2023-04-15-preview +// Generated from API version 2023-08-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. func (client *ConfigurationsClient) List(ctx context.Context, resourceGroupName string, clusterName string, options *ConfigurationsClientListOptions) (ConfigurationsClientListResponse, error) { + var err error req, err := client.listCreateRequest(ctx, resourceGroupName, clusterName, options) if err != nil { return ConfigurationsClientListResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return ConfigurationsClientListResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return ConfigurationsClientListResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return ConfigurationsClientListResponse{}, err } - return client.listHandleResponse(resp) + resp, err := client.listHandleResponse(httpResp) + return resp, err } // listCreateRequest creates the List request. @@ -150,7 +155,7 @@ func (client *ConfigurationsClient) listCreateRequest(ctx context.Context, resou return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-04-15-preview") + reqQP.Set("api-version", "2023-08-15-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -169,7 +174,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 2023-04-15-preview +// Generated from API version 2023-08-15-preview // - resourceGroupName - The name of the resource group. // - clusterName - The name of the cluster. // - configurationName - The name of the cluster configuration. @@ -182,9 +187,10 @@ func (client *ConfigurationsClient) BeginUpdate(ctx context.Context, resourceGro if err != nil { return nil, err } - return runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[ConfigurationsClientUpdateResponse]{ + poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[ConfigurationsClientUpdateResponse]{ FinalStateVia: runtime.FinalStateViaLocation, }) + return poller, err } else { return runtime.NewPollerFromResumeToken[ConfigurationsClientUpdateResponse](options.ResumeToken, client.internal.Pipeline(), nil) } @@ -194,20 +200,22 @@ 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 2023-04-15-preview +// Generated from API version 2023-08-15-preview func (client *ConfigurationsClient) update(ctx context.Context, resourceGroupName string, clusterName string, configurationName string, parameters map[string]*string, options *ConfigurationsClientBeginUpdateOptions) (*http.Response, error) { + var err error req, err := client.updateCreateRequest(ctx, resourceGroupName, clusterName, configurationName, parameters, options) if err != nil { return nil, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return nil, err } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted, http.StatusNoContent) { - return nil, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted, http.StatusNoContent) { + err = runtime.NewResponseError(httpResp) + return nil, err } - return resp, nil + return httpResp, nil } // updateCreateRequest creates the Update request. @@ -234,8 +242,11 @@ func (client *ConfigurationsClient) updateCreateRequest(ctx context.Context, res return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-04-15-preview") + reqQP.Set("api-version", "2023-08-15-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, parameters) + if err := runtime.MarshalAsJSON(req, parameters); err != nil { + return nil, err + } + return req, nil } diff --git a/sdk/resourcemanager/hdinsight/armhdinsight/configurations_client_example_test.go b/sdk/resourcemanager/hdinsight/armhdinsight/configurations_client_example_test.go deleted file mode 100644 index 2c99efb3c244..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/310a0100f5b020c1900c527a6aa70d21992f078a/specification/hdinsight/resource-manager/Microsoft.HDInsight/preview/2023-04-15-preview/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/310a0100f5b020c1900c527a6aa70d21992f078a/specification/hdinsight/resource-manager/Microsoft.HDInsight/preview/2023-04-15-preview/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/310a0100f5b020c1900c527a6aa70d21992f078a/specification/hdinsight/resource-manager/Microsoft.HDInsight/preview/2023-04-15-preview/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/310a0100f5b020c1900c527a6aa70d21992f078a/specification/hdinsight/resource-manager/Microsoft.HDInsight/preview/2023-04-15-preview/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 688022599485..13c03bc50cef 100644 --- a/sdk/resourcemanager/hdinsight/armhdinsight/constants.go +++ b/sdk/resourcemanager/hdinsight/armhdinsight/constants.go @@ -3,15 +3,14 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. package armhdinsight const ( moduleName = "armhdinsight" - moduleVersion = "v1.2.0-beta.1" + moduleVersion = "v1.2.0-beta.2" ) // AsyncOperationState - The async operation state. @@ -167,6 +166,24 @@ func PossibleOSTypeValues() []OSType { } } +// OutboundDependenciesManagedType - A value to describe how the outbound dependencies of a HDInsight cluster are managed. +// 'Managed' means that the outbound dependencies are managed by the HDInsight service. 'External' means that the +// outbound dependencies are managed by a customer specific solution. +type OutboundDependenciesManagedType string + +const ( + OutboundDependenciesManagedTypeExternal OutboundDependenciesManagedType = "External" + OutboundDependenciesManagedTypeManaged OutboundDependenciesManagedType = "Managed" +) + +// PossibleOutboundDependenciesManagedTypeValues returns the possible values for the OutboundDependenciesManagedType const type. +func PossibleOutboundDependenciesManagedTypeValues() []OutboundDependenciesManagedType { + return []OutboundDependenciesManagedType{ + OutboundDependenciesManagedTypeExternal, + OutboundDependenciesManagedTypeManaged, + } +} + // PrivateEndpointConnectionProvisioningState - The provisioning state, which only appears in the response. type PrivateEndpointConnectionProvisioningState string diff --git a/sdk/resourcemanager/hdinsight/armhdinsight/extensions_client.go b/sdk/resourcemanager/hdinsight/armhdinsight/extensions_client.go index 41bd4050f81a..bf06523c9745 100644 --- a/sdk/resourcemanager/hdinsight/armhdinsight/extensions_client.go +++ b/sdk/resourcemanager/hdinsight/armhdinsight/extensions_client.go @@ -3,9 +3,8 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. package armhdinsight @@ -48,7 +47,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 2023-04-15-preview +// Generated from API version 2023-08-15-preview // - resourceGroupName - The name of the resource group. // - clusterName - The name of the cluster. // - extensionName - The name of the cluster extension. @@ -60,9 +59,10 @@ func (client *ExtensionsClient) BeginCreate(ctx context.Context, resourceGroupNa if err != nil { return nil, err } - return runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[ExtensionsClientCreateResponse]{ + poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[ExtensionsClientCreateResponse]{ FinalStateVia: runtime.FinalStateViaLocation, }) + return poller, err } else { return runtime.NewPollerFromResumeToken[ExtensionsClientCreateResponse](options.ResumeToken, client.internal.Pipeline(), nil) } @@ -71,20 +71,22 @@ 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 2023-04-15-preview +// Generated from API version 2023-08-15-preview func (client *ExtensionsClient) create(ctx context.Context, resourceGroupName string, clusterName string, extensionName string, parameters Extension, options *ExtensionsClientBeginCreateOptions) (*http.Response, error) { + var err error req, err := client.createCreateRequest(ctx, resourceGroupName, clusterName, extensionName, parameters, options) if err != nil { return nil, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return nil, err } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted) { - return nil, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted) { + err = runtime.NewResponseError(httpResp) + return nil, err } - return resp, nil + return httpResp, nil } // createCreateRequest creates the Create request. @@ -111,16 +113,19 @@ func (client *ExtensionsClient) createCreateRequest(ctx context.Context, resourc return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-04-15-preview") + reqQP.Set("api-version", "2023-08-15-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, parameters) + if err := runtime.MarshalAsJSON(req, parameters); err != nil { + return nil, err + } + return req, nil } // BeginDelete - Deletes the specified extension for HDInsight cluster. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-04-15-preview +// Generated from API version 2023-08-15-preview // - resourceGroupName - The name of the resource group. // - clusterName - The name of the cluster. // - extensionName - The name of the cluster extension. @@ -131,9 +136,10 @@ func (client *ExtensionsClient) BeginDelete(ctx context.Context, resourceGroupNa if err != nil { return nil, err } - return runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[ExtensionsClientDeleteResponse]{ + poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[ExtensionsClientDeleteResponse]{ FinalStateVia: runtime.FinalStateViaLocation, }) + return poller, err } else { return runtime.NewPollerFromResumeToken[ExtensionsClientDeleteResponse](options.ResumeToken, client.internal.Pipeline(), nil) } @@ -142,20 +148,22 @@ 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 2023-04-15-preview +// Generated from API version 2023-08-15-preview func (client *ExtensionsClient) deleteOperation(ctx context.Context, resourceGroupName string, clusterName string, extensionName string, options *ExtensionsClientBeginDeleteOptions) (*http.Response, error) { + var err error req, err := client.deleteCreateRequest(ctx, resourceGroupName, clusterName, extensionName, options) if err != nil { return nil, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return nil, err } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted, http.StatusNoContent) { - return nil, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted, http.StatusNoContent) { + err = runtime.NewResponseError(httpResp) + return nil, err } - return resp, nil + return httpResp, nil } // deleteCreateRequest creates the Delete request. @@ -182,7 +190,7 @@ func (client *ExtensionsClient) deleteCreateRequest(ctx context.Context, resourc return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-04-15-preview") + reqQP.Set("api-version", "2023-08-15-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -191,7 +199,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 2023-04-15-preview +// Generated from API version 2023-08-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 @@ -202,9 +210,10 @@ func (client *ExtensionsClient) BeginDisableAzureMonitor(ctx context.Context, re if err != nil { return nil, err } - return runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[ExtensionsClientDisableAzureMonitorResponse]{ + poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[ExtensionsClientDisableAzureMonitorResponse]{ FinalStateVia: runtime.FinalStateViaLocation, }) + return poller, err } else { return runtime.NewPollerFromResumeToken[ExtensionsClientDisableAzureMonitorResponse](options.ResumeToken, client.internal.Pipeline(), nil) } @@ -213,20 +222,22 @@ 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 2023-04-15-preview +// Generated from API version 2023-08-15-preview func (client *ExtensionsClient) disableAzureMonitor(ctx context.Context, resourceGroupName string, clusterName string, options *ExtensionsClientBeginDisableAzureMonitorOptions) (*http.Response, error) { + var err error req, err := client.disableAzureMonitorCreateRequest(ctx, resourceGroupName, clusterName, options) if err != nil { return nil, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return nil, err } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted, http.StatusNoContent) { - return nil, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted, http.StatusNoContent) { + err = runtime.NewResponseError(httpResp) + return nil, err } - return resp, nil + return httpResp, nil } // disableAzureMonitorCreateRequest creates the DisableAzureMonitor request. @@ -249,7 +260,7 @@ func (client *ExtensionsClient) disableAzureMonitorCreateRequest(ctx context.Con return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-04-15-preview") + reqQP.Set("api-version", "2023-08-15-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -258,7 +269,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 2023-04-15-preview +// Generated from API version 2023-08-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 @@ -269,9 +280,10 @@ func (client *ExtensionsClient) BeginDisableMonitoring(ctx context.Context, reso if err != nil { return nil, err } - return runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[ExtensionsClientDisableMonitoringResponse]{ + poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[ExtensionsClientDisableMonitoringResponse]{ FinalStateVia: runtime.FinalStateViaLocation, }) + return poller, err } else { return runtime.NewPollerFromResumeToken[ExtensionsClientDisableMonitoringResponse](options.ResumeToken, client.internal.Pipeline(), nil) } @@ -280,20 +292,22 @@ 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 2023-04-15-preview +// Generated from API version 2023-08-15-preview func (client *ExtensionsClient) disableMonitoring(ctx context.Context, resourceGroupName string, clusterName string, options *ExtensionsClientBeginDisableMonitoringOptions) (*http.Response, error) { + var err error req, err := client.disableMonitoringCreateRequest(ctx, resourceGroupName, clusterName, options) if err != nil { return nil, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return nil, err } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted, http.StatusNoContent) { - return nil, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted, http.StatusNoContent) { + err = runtime.NewResponseError(httpResp) + return nil, err } - return resp, nil + return httpResp, nil } // disableMonitoringCreateRequest creates the DisableMonitoring request. @@ -316,7 +330,7 @@ func (client *ExtensionsClient) disableMonitoringCreateRequest(ctx context.Conte return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-04-15-preview") + reqQP.Set("api-version", "2023-08-15-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -325,7 +339,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 2023-04-15-preview +// Generated from API version 2023-08-15-preview // - resourceGroupName - The name of the resource group. // - clusterName - The name of the cluster. // - parameters - The Log Analytics workspace parameters. @@ -337,9 +351,10 @@ func (client *ExtensionsClient) BeginEnableAzureMonitor(ctx context.Context, res if err != nil { return nil, err } - return runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[ExtensionsClientEnableAzureMonitorResponse]{ + poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[ExtensionsClientEnableAzureMonitorResponse]{ FinalStateVia: runtime.FinalStateViaLocation, }) + return poller, err } else { return runtime.NewPollerFromResumeToken[ExtensionsClientEnableAzureMonitorResponse](options.ResumeToken, client.internal.Pipeline(), nil) } @@ -348,20 +363,22 @@ 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 2023-04-15-preview +// Generated from API version 2023-08-15-preview func (client *ExtensionsClient) enableAzureMonitor(ctx context.Context, resourceGroupName string, clusterName string, parameters AzureMonitorRequest, options *ExtensionsClientBeginEnableAzureMonitorOptions) (*http.Response, error) { + var err error req, err := client.enableAzureMonitorCreateRequest(ctx, resourceGroupName, clusterName, parameters, options) if err != nil { return nil, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return nil, err } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted) { - return nil, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted) { + err = runtime.NewResponseError(httpResp) + return nil, err } - return resp, nil + return httpResp, nil } // enableAzureMonitorCreateRequest creates the EnableAzureMonitor request. @@ -384,16 +401,19 @@ func (client *ExtensionsClient) enableAzureMonitorCreateRequest(ctx context.Cont return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-04-15-preview") + reqQP.Set("api-version", "2023-08-15-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, parameters) + if err := runtime.MarshalAsJSON(req, parameters); err != nil { + return nil, err + } + return req, nil } // 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 2023-04-15-preview +// Generated from API version 2023-08-15-preview // - resourceGroupName - The name of the resource group. // - clusterName - The name of the cluster. // - parameters - The Operations Management Suite (OMS) workspace parameters. @@ -405,9 +425,10 @@ func (client *ExtensionsClient) BeginEnableMonitoring(ctx context.Context, resou if err != nil { return nil, err } - return runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[ExtensionsClientEnableMonitoringResponse]{ + poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[ExtensionsClientEnableMonitoringResponse]{ FinalStateVia: runtime.FinalStateViaLocation, }) + return poller, err } else { return runtime.NewPollerFromResumeToken[ExtensionsClientEnableMonitoringResponse](options.ResumeToken, client.internal.Pipeline(), nil) } @@ -416,20 +437,22 @@ 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 2023-04-15-preview +// Generated from API version 2023-08-15-preview func (client *ExtensionsClient) enableMonitoring(ctx context.Context, resourceGroupName string, clusterName string, parameters ClusterMonitoringRequest, options *ExtensionsClientBeginEnableMonitoringOptions) (*http.Response, error) { + var err error req, err := client.enableMonitoringCreateRequest(ctx, resourceGroupName, clusterName, parameters, options) if err != nil { return nil, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return nil, err } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted) { - return nil, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted) { + err = runtime.NewResponseError(httpResp) + return nil, err } - return resp, nil + return httpResp, nil } // enableMonitoringCreateRequest creates the EnableMonitoring request. @@ -452,33 +475,39 @@ func (client *ExtensionsClient) enableMonitoringCreateRequest(ctx context.Contex return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-04-15-preview") + reqQP.Set("api-version", "2023-08-15-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, parameters) + if err := runtime.MarshalAsJSON(req, parameters); err != nil { + return nil, err + } + return req, nil } // 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 2023-04-15-preview +// Generated from API version 2023-08-15-preview // - resourceGroupName - The name of the resource group. // - clusterName - The name of the cluster. // - extensionName - The name of the cluster extension. // - options - ExtensionsClientGetOptions contains the optional parameters for the ExtensionsClient.Get method. func (client *ExtensionsClient) Get(ctx context.Context, resourceGroupName string, clusterName string, extensionName string, options *ExtensionsClientGetOptions) (ExtensionsClientGetResponse, error) { + var err error req, err := client.getCreateRequest(ctx, resourceGroupName, clusterName, extensionName, options) if err != nil { return ExtensionsClientGetResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return ExtensionsClientGetResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return ExtensionsClientGetResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return ExtensionsClientGetResponse{}, err } - return client.getHandleResponse(resp) + resp, err := client.getHandleResponse(httpResp) + return resp, err } // getCreateRequest creates the Get request. @@ -505,7 +534,7 @@ func (client *ExtensionsClient) getCreateRequest(ctx context.Context, resourceGr return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-04-15-preview") + reqQP.Set("api-version", "2023-08-15-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -523,7 +552,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 2023-04-15-preview +// Generated from API version 2023-08-15-preview // - resourceGroupName - The name of the resource group. // - clusterName - The name of the cluster. // - extensionName - The name of the cluster extension. @@ -531,18 +560,21 @@ func (client *ExtensionsClient) getHandleResponse(resp *http.Response) (Extensio // - options - ExtensionsClientGetAzureAsyncOperationStatusOptions contains the optional parameters for the ExtensionsClient.GetAzureAsyncOperationStatus // method. func (client *ExtensionsClient) GetAzureAsyncOperationStatus(ctx context.Context, resourceGroupName string, clusterName string, extensionName string, operationID string, options *ExtensionsClientGetAzureAsyncOperationStatusOptions) (ExtensionsClientGetAzureAsyncOperationStatusResponse, error) { + var err error req, err := client.getAzureAsyncOperationStatusCreateRequest(ctx, resourceGroupName, clusterName, extensionName, operationID, options) if err != nil { return ExtensionsClientGetAzureAsyncOperationStatusResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return ExtensionsClientGetAzureAsyncOperationStatusResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return ExtensionsClientGetAzureAsyncOperationStatusResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return ExtensionsClientGetAzureAsyncOperationStatusResponse{}, err } - return client.getAzureAsyncOperationStatusHandleResponse(resp) + resp, err := client.getAzureAsyncOperationStatusHandleResponse(httpResp) + return resp, err } // getAzureAsyncOperationStatusCreateRequest creates the GetAzureAsyncOperationStatus request. @@ -573,7 +605,7 @@ func (client *ExtensionsClient) getAzureAsyncOperationStatusCreateRequest(ctx co return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-04-15-preview") + reqQP.Set("api-version", "2023-08-15-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -591,24 +623,27 @@ 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 2023-04-15-preview +// Generated from API version 2023-08-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 // method. func (client *ExtensionsClient) GetAzureMonitorStatus(ctx context.Context, resourceGroupName string, clusterName string, options *ExtensionsClientGetAzureMonitorStatusOptions) (ExtensionsClientGetAzureMonitorStatusResponse, error) { + var err error req, err := client.getAzureMonitorStatusCreateRequest(ctx, resourceGroupName, clusterName, options) if err != nil { return ExtensionsClientGetAzureMonitorStatusResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return ExtensionsClientGetAzureMonitorStatusResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return ExtensionsClientGetAzureMonitorStatusResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return ExtensionsClientGetAzureMonitorStatusResponse{}, err } - return client.getAzureMonitorStatusHandleResponse(resp) + resp, err := client.getAzureMonitorStatusHandleResponse(httpResp) + return resp, err } // getAzureMonitorStatusCreateRequest creates the GetAzureMonitorStatus request. @@ -631,7 +666,7 @@ func (client *ExtensionsClient) getAzureMonitorStatusCreateRequest(ctx context.C return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-04-15-preview") + reqQP.Set("api-version", "2023-08-15-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -649,24 +684,27 @@ 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 2023-04-15-preview +// Generated from API version 2023-08-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 // method. func (client *ExtensionsClient) GetMonitoringStatus(ctx context.Context, resourceGroupName string, clusterName string, options *ExtensionsClientGetMonitoringStatusOptions) (ExtensionsClientGetMonitoringStatusResponse, error) { + var err error req, err := client.getMonitoringStatusCreateRequest(ctx, resourceGroupName, clusterName, options) if err != nil { return ExtensionsClientGetMonitoringStatusResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return ExtensionsClientGetMonitoringStatusResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return ExtensionsClientGetMonitoringStatusResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return ExtensionsClientGetMonitoringStatusResponse{}, err } - return client.getMonitoringStatusHandleResponse(resp) + resp, err := client.getMonitoringStatusHandleResponse(httpResp) + return resp, err } // getMonitoringStatusCreateRequest creates the GetMonitoringStatus request. @@ -689,7 +727,7 @@ func (client *ExtensionsClient) getMonitoringStatusCreateRequest(ctx context.Con return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-04-15-preview") + reqQP.Set("api-version", "2023-08-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 b05ebf827839..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/310a0100f5b020c1900c527a6aa70d21992f078a/specification/hdinsight/resource-manager/Microsoft.HDInsight/preview/2023-04-15-preview/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/310a0100f5b020c1900c527a6aa70d21992f078a/specification/hdinsight/resource-manager/Microsoft.HDInsight/preview/2023-04-15-preview/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/310a0100f5b020c1900c527a6aa70d21992f078a/specification/hdinsight/resource-manager/Microsoft.HDInsight/preview/2023-04-15-preview/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/310a0100f5b020c1900c527a6aa70d21992f078a/specification/hdinsight/resource-manager/Microsoft.HDInsight/preview/2023-04-15-preview/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/310a0100f5b020c1900c527a6aa70d21992f078a/specification/hdinsight/resource-manager/Microsoft.HDInsight/preview/2023-04-15-preview/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/310a0100f5b020c1900c527a6aa70d21992f078a/specification/hdinsight/resource-manager/Microsoft.HDInsight/preview/2023-04-15-preview/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/310a0100f5b020c1900c527a6aa70d21992f078a/specification/hdinsight/resource-manager/Microsoft.HDInsight/preview/2023-04-15-preview/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/310a0100f5b020c1900c527a6aa70d21992f078a/specification/hdinsight/resource-manager/Microsoft.HDInsight/preview/2023-04-15-preview/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/310a0100f5b020c1900c527a6aa70d21992f078a/specification/hdinsight/resource-manager/Microsoft.HDInsight/preview/2023-04-15-preview/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/310a0100f5b020c1900c527a6aa70d21992f078a/specification/hdinsight/resource-manager/Microsoft.HDInsight/preview/2023-04-15-preview/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 bab9c50a4849..b9cff84833c9 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.6.0 - github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.3.0 -) +require github.com/Azure/azure-sdk-for-go/sdk/azcore v1.6.1 require ( github.com/Azure/azure-sdk-for-go/sdk/internal v1.3.0 // indirect - github.com/AzureAD/microsoft-authentication-library-for-go v1.0.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.7.0 // indirect + github.com/davecgh/go-spew v1.1.1 // indirect golang.org/x/net v0.8.0 // indirect - golang.org/x/sys v0.6.0 // indirect golang.org/x/text v0.8.0 // indirect + gopkg.in/yaml.v3 v3.0.1 // indirect ) diff --git a/sdk/resourcemanager/hdinsight/armhdinsight/go.sum b/sdk/resourcemanager/hdinsight/armhdinsight/go.sum index 21718b486698..727ce838bdc8 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.6.0 h1:8kDqDngH+DmVBiCtIjCFTGa7MBnsIOkF9IccInFEbjk= -github.com/Azure/azure-sdk-for-go/sdk/azcore v1.6.0/go.mod h1:bjGvMhVMb+EEm3VRNQawDMUyMMjo+S5ewNjflkep/0Q= -github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.3.0 h1:vcYCAze6p19qBW7MhZybIsqD8sMV8js0NyQM8JDnVtg= -github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.3.0/go.mod h1:OQeznEEkTZ9OrhHJoDD8ZDq51FHgXjqtP9z6bEwBq9U= +github.com/Azure/azure-sdk-for-go/sdk/azcore v1.6.1 h1:SEy2xmstIphdPwNBUi7uhvjyjhVKISfwjfOJmuy7kg4= +github.com/Azure/azure-sdk-for-go/sdk/azcore v1.6.1/go.mod h1:bjGvMhVMb+EEm3VRNQawDMUyMMjo+S5ewNjflkep/0Q= github.com/Azure/azure-sdk-for-go/sdk/internal v1.3.0 h1:sXr+ck84g/ZlZUOZiNELInmMgOsuGwdjjVkEIde0OtY= github.com/Azure/azure-sdk-for-go/sdk/internal v1.3.0/go.mod h1:okt5dMMTOFjX/aovMlrjvvXoPMBVSPzk9185BT0+eZM= -github.com/AzureAD/microsoft-authentication-library-for-go v1.0.0 h1:OBhqkivkhkMqLPymWEppkm7vgPQY2XsHoEkaMQ0AdZY= -github.com/AzureAD/microsoft-authentication-library-for-go v1.0.0/go.mod h1:kgDmCTgBzIEPFElEF+FK0SdjAor06dRq2Go927dnQ6o= github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= -github.com/dnaeon/go-vcr v1.2.0 h1:zHCHvJYTMh1N7xnV7zf1m1GPBF9Ad0Jk/whtQ1663qI= -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.7.0 h1:AvwMYaRytfdeVt3u6mLaxYtErKYjxA2OXjJ1HHq6t3A= -golang.org/x/crypto v0.7.0/go.mod h1:pYwdfH91IfpZVANVyUOhSIPZaFoJGxTFbZhFTx+dXZU= golang.org/x/net v0.8.0 h1:Zrh2ngAOFYneWTAIAPethzeaQLuHwhuBkuV6ZiRnUaQ= golang.org/x/net v0.8.0/go.mod h1:QVkue5JL9kW//ek3r6jTKnTFis1tRmNAW2P1shuFdJc= -golang.org/x/sys v0.0.0-20210616045830-e2b7044e8c71/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.6.0 h1:MVltZSvRTcU2ljQOhs94SXPftV6DCNnZViHeQps87pQ= -golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/text v0.8.0 h1:57P1ETyNKtuIjB4SRd15iJxuhj8Gc416Y78H3qgMh68= golang.org/x/text v0.8.0/go.mod h1:e1OnstbJyHTd6l/uOt8jFFHp6TRDWZR/bV3emEE/zU8= -gopkg.in/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.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= +gopkg.in/yaml.v3 v3.0.1/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 57268b1034f2..dc77179a988d 100644 --- a/sdk/resourcemanager/hdinsight/armhdinsight/locations_client.go +++ b/sdk/resourcemanager/hdinsight/armhdinsight/locations_client.go @@ -3,9 +3,8 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. package armhdinsight @@ -48,23 +47,26 @@ 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 2023-04-15-preview +// Generated from API version 2023-08-15-preview // - location - The Azure location (region) for which to make the request. // - options - LocationsClientCheckNameAvailabilityOptions contains the optional parameters for the LocationsClient.CheckNameAvailability // method. func (client *LocationsClient) CheckNameAvailability(ctx context.Context, location string, parameters NameAvailabilityCheckRequestParameters, options *LocationsClientCheckNameAvailabilityOptions) (LocationsClientCheckNameAvailabilityResponse, error) { + var err error req, err := client.checkNameAvailabilityCreateRequest(ctx, location, parameters, options) if err != nil { return LocationsClientCheckNameAvailabilityResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return LocationsClientCheckNameAvailabilityResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return LocationsClientCheckNameAvailabilityResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return LocationsClientCheckNameAvailabilityResponse{}, err } - return client.checkNameAvailabilityHandleResponse(resp) + resp, err := client.checkNameAvailabilityHandleResponse(httpResp) + return resp, err } // checkNameAvailabilityCreateRequest creates the CheckNameAvailability request. @@ -83,10 +85,13 @@ func (client *LocationsClient) checkNameAvailabilityCreateRequest(ctx context.Co return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-04-15-preview") + reqQP.Set("api-version", "2023-08-15-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, parameters) + if err := runtime.MarshalAsJSON(req, parameters); err != nil { + return nil, err + } + return req, nil } // checkNameAvailabilityHandleResponse handles the CheckNameAvailability response. @@ -101,24 +106,27 @@ 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 2023-04-15-preview +// Generated from API version 2023-08-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 // method. func (client *LocationsClient) GetAzureAsyncOperationStatus(ctx context.Context, location string, operationID string, options *LocationsClientGetAzureAsyncOperationStatusOptions) (LocationsClientGetAzureAsyncOperationStatusResponse, error) { + var err error req, err := client.getAzureAsyncOperationStatusCreateRequest(ctx, location, operationID, options) if err != nil { return LocationsClientGetAzureAsyncOperationStatusResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return LocationsClientGetAzureAsyncOperationStatusResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return LocationsClientGetAzureAsyncOperationStatusResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return LocationsClientGetAzureAsyncOperationStatusResponse{}, err } - return client.getAzureAsyncOperationStatusHandleResponse(resp) + resp, err := client.getAzureAsyncOperationStatusHandleResponse(httpResp) + return resp, err } // getAzureAsyncOperationStatusCreateRequest creates the GetAzureAsyncOperationStatus request. @@ -141,7 +149,7 @@ func (client *LocationsClient) getAzureAsyncOperationStatusCreateRequest(ctx con return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-04-15-preview") + reqQP.Set("api-version", "2023-08-15-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -159,23 +167,26 @@ 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 2023-04-15-preview +// Generated from API version 2023-08-15-preview // - location - The Azure location (region) for which to make the request. // - options - LocationsClientGetCapabilitiesOptions contains the optional parameters for the LocationsClient.GetCapabilities // method. func (client *LocationsClient) GetCapabilities(ctx context.Context, location string, options *LocationsClientGetCapabilitiesOptions) (LocationsClientGetCapabilitiesResponse, error) { + var err error req, err := client.getCapabilitiesCreateRequest(ctx, location, options) if err != nil { return LocationsClientGetCapabilitiesResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return LocationsClientGetCapabilitiesResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return LocationsClientGetCapabilitiesResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return LocationsClientGetCapabilitiesResponse{}, err } - return client.getCapabilitiesHandleResponse(resp) + resp, err := client.getCapabilitiesHandleResponse(httpResp) + return resp, err } // getCapabilitiesCreateRequest creates the GetCapabilities request. @@ -194,7 +205,7 @@ func (client *LocationsClient) getCapabilitiesCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-04-15-preview") + reqQP.Set("api-version", "2023-08-15-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -212,23 +223,26 @@ 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 2023-04-15-preview +// Generated from API version 2023-08-15-preview // - location - The Azure location (region) for which to make the request. // - options - LocationsClientListBillingSpecsOptions contains the optional parameters for the LocationsClient.ListBillingSpecs // method. func (client *LocationsClient) ListBillingSpecs(ctx context.Context, location string, options *LocationsClientListBillingSpecsOptions) (LocationsClientListBillingSpecsResponse, error) { + var err error req, err := client.listBillingSpecsCreateRequest(ctx, location, options) if err != nil { return LocationsClientListBillingSpecsResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return LocationsClientListBillingSpecsResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return LocationsClientListBillingSpecsResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return LocationsClientListBillingSpecsResponse{}, err } - return client.listBillingSpecsHandleResponse(resp) + resp, err := client.listBillingSpecsHandleResponse(httpResp) + return resp, err } // listBillingSpecsCreateRequest creates the ListBillingSpecs request. @@ -247,7 +261,7 @@ func (client *LocationsClient) listBillingSpecsCreateRequest(ctx context.Context return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-04-15-preview") + reqQP.Set("api-version", "2023-08-15-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -265,22 +279,25 @@ 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 2023-04-15-preview +// Generated from API version 2023-08-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) { + var err error req, err := client.listUsagesCreateRequest(ctx, location, options) if err != nil { return LocationsClientListUsagesResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return LocationsClientListUsagesResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return LocationsClientListUsagesResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return LocationsClientListUsagesResponse{}, err } - return client.listUsagesHandleResponse(resp) + resp, err := client.listUsagesHandleResponse(httpResp) + return resp, err } // listUsagesCreateRequest creates the ListUsages request. @@ -299,7 +316,7 @@ func (client *LocationsClient) listUsagesCreateRequest(ctx context.Context, loca return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-04-15-preview") + reqQP.Set("api-version", "2023-08-15-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -317,23 +334,26 @@ 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 2023-04-15-preview +// Generated from API version 2023-08-15-preview // - location - The Azure location (region) for which to make the request. // - options - LocationsClientValidateClusterCreateRequestOptions contains the optional parameters for the LocationsClient.ValidateClusterCreateRequest // method. func (client *LocationsClient) ValidateClusterCreateRequest(ctx context.Context, location string, parameters ClusterCreateRequestValidationParameters, options *LocationsClientValidateClusterCreateRequestOptions) (LocationsClientValidateClusterCreateRequestResponse, error) { + var err error req, err := client.validateClusterCreateRequestCreateRequest(ctx, location, parameters, options) if err != nil { return LocationsClientValidateClusterCreateRequestResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return LocationsClientValidateClusterCreateRequestResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return LocationsClientValidateClusterCreateRequestResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return LocationsClientValidateClusterCreateRequestResponse{}, err } - return client.validateClusterCreateRequestHandleResponse(resp) + resp, err := client.validateClusterCreateRequestHandleResponse(httpResp) + return resp, err } // validateClusterCreateRequestCreateRequest creates the ValidateClusterCreateRequest request. @@ -352,10 +372,13 @@ func (client *LocationsClient) validateClusterCreateRequestCreateRequest(ctx con return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-04-15-preview") + reqQP.Set("api-version", "2023-08-15-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, parameters) + if err := runtime.MarshalAsJSON(req, parameters); err != nil { + return nil, err + } + return req, nil } // validateClusterCreateRequestHandleResponse handles the ValidateClusterCreateRequest response. 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 7250f4e92252..000000000000 --- a/sdk/resourcemanager/hdinsight/armhdinsight/locations_client_example_test.go +++ /dev/null @@ -1,661 +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/310a0100f5b020c1900c527a6aa70d21992f078a/specification/hdinsight/resource-manager/Microsoft.HDInsight/preview/2023-04-15-preview/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/310a0100f5b020c1900c527a6aa70d21992f078a/specification/hdinsight/resource-manager/Microsoft.HDInsight/preview/2023-04-15-preview/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/310a0100f5b020c1900c527a6aa70d21992f078a/specification/hdinsight/resource-manager/Microsoft.HDInsight/preview/2023-04-15-preview/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/310a0100f5b020c1900c527a6aa70d21992f078a/specification/hdinsight/resource-manager/Microsoft.HDInsight/preview/2023-04-15-preview/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/310a0100f5b020c1900c527a6aa70d21992f078a/specification/hdinsight/resource-manager/Microsoft.HDInsight/preview/2023-04-15-preview/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/310a0100f5b020c1900c527a6aa70d21992f078a/specification/hdinsight/resource-manager/Microsoft.HDInsight/preview/2023-04-15-preview/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"), - EnableSecureChannel: to.Ptr(true), - 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("PT20M"), - // ValidationErrors: []*armhdinsight.ValidationErrorInfo{ - // }, - // } -} diff --git a/sdk/resourcemanager/hdinsight/armhdinsight/models.go b/sdk/resourcemanager/hdinsight/armhdinsight/models.go index 763329d97fd5..1e493f23f91f 100644 --- a/sdk/resourcemanager/hdinsight/armhdinsight/models.go +++ b/sdk/resourcemanager/hdinsight/armhdinsight/models.go @@ -3,9 +3,8 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. package armhdinsight @@ -147,35 +146,6 @@ type ApplicationProperties struct { ProvisioningState *string } -// ApplicationsClientBeginCreateOptions contains the optional parameters for the ApplicationsClient.BeginCreate method. -type ApplicationsClientBeginCreateOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// ApplicationsClientBeginDeleteOptions contains the optional parameters for the ApplicationsClient.BeginDelete method. -type ApplicationsClientBeginDeleteOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// ApplicationsClientGetAzureAsyncOperationStatusOptions contains the optional parameters for the ApplicationsClient.GetAzureAsyncOperationStatus -// method. -type ApplicationsClientGetAzureAsyncOperationStatusOptions struct { - // placeholder for future optional parameters -} - -// ApplicationsClientGetOptions contains the optional parameters for the ApplicationsClient.Get method. -type ApplicationsClientGetOptions struct { - // placeholder for future optional parameters -} - -// ApplicationsClientListByClusterOptions contains the optional parameters for the ApplicationsClient.NewListByClusterPager -// method. -type ApplicationsClientListByClusterOptions struct { - // placeholder for future optional parameters -} - // AsyncOperationResult - The azure async operation response. type AsyncOperationResult struct { // The operation error information. @@ -663,91 +633,6 @@ type ClusterResizeParameters struct { TargetInstanceCount *int32 } -// ClustersClientBeginCreateOptions contains the optional parameters for the ClustersClient.BeginCreate method. -type ClustersClientBeginCreateOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// ClustersClientBeginDeleteOptions contains the optional parameters for the ClustersClient.BeginDelete method. -type ClustersClientBeginDeleteOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// ClustersClientBeginExecuteScriptActionsOptions contains the optional parameters for the ClustersClient.BeginExecuteScriptActions -// method. -type ClustersClientBeginExecuteScriptActionsOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// ClustersClientBeginResizeOptions contains the optional parameters for the ClustersClient.BeginResize method. -type ClustersClientBeginResizeOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// ClustersClientBeginRotateDiskEncryptionKeyOptions contains the optional parameters for the ClustersClient.BeginRotateDiskEncryptionKey -// method. -type ClustersClientBeginRotateDiskEncryptionKeyOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// ClustersClientBeginUpdateAutoScaleConfigurationOptions contains the optional parameters for the ClustersClient.BeginUpdateAutoScaleConfiguration -// method. -type ClustersClientBeginUpdateAutoScaleConfigurationOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// ClustersClientBeginUpdateGatewaySettingsOptions contains the optional parameters for the ClustersClient.BeginUpdateGatewaySettings -// method. -type ClustersClientBeginUpdateGatewaySettingsOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// ClustersClientBeginUpdateIdentityCertificateOptions contains the optional parameters for the ClustersClient.BeginUpdateIdentityCertificate -// method. -type ClustersClientBeginUpdateIdentityCertificateOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// ClustersClientGetAzureAsyncOperationStatusOptions contains the optional parameters for the ClustersClient.GetAzureAsyncOperationStatus -// method. -type ClustersClientGetAzureAsyncOperationStatusOptions struct { - // placeholder for future optional parameters -} - -// ClustersClientGetGatewaySettingsOptions contains the optional parameters for the ClustersClient.GetGatewaySettings method. -type ClustersClientGetGatewaySettingsOptions struct { - // placeholder for future optional parameters -} - -// ClustersClientGetOptions contains the optional parameters for the ClustersClient.Get method. -type ClustersClientGetOptions struct { - // placeholder for future optional parameters -} - -// ClustersClientListByResourceGroupOptions contains the optional parameters for the ClustersClient.NewListByResourceGroupPager -// method. -type ClustersClientListByResourceGroupOptions struct { - // placeholder for future optional parameters -} - -// ClustersClientListOptions contains the optional parameters for the ClustersClient.NewListPager method. -type ClustersClientListOptions struct { - // placeholder for future optional parameters -} - -// ClustersClientUpdateOptions contains the optional parameters for the ClustersClient.Update method. -type ClustersClientUpdateOptions struct { - // placeholder for future optional parameters -} - // ComputeIsolationProperties - The compute isolation properties. type ComputeIsolationProperties struct { // The flag indicates whether enable compute isolation or not. @@ -763,22 +648,6 @@ type ComputeProfile struct { Roles []*Role } -// ConfigurationsClientBeginUpdateOptions contains the optional parameters for the ConfigurationsClient.BeginUpdate method. -type ConfigurationsClientBeginUpdateOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// ConfigurationsClientGetOptions contains the optional parameters for the ConfigurationsClient.Get method. -type ConfigurationsClientGetOptions struct { - // placeholder for future optional parameters -} - -// ConfigurationsClientListOptions contains the optional parameters for the ConfigurationsClient.List method. -type ConfigurationsClientListOptions struct { - // placeholder for future optional parameters -} - // ConnectivityEndpoint - The connectivity properties type ConnectivityEndpoint struct { // The location of the endpoint. @@ -908,69 +777,6 @@ type Extension struct { WorkspaceID *string } -// ExtensionsClientBeginCreateOptions contains the optional parameters for the ExtensionsClient.BeginCreate method. -type ExtensionsClientBeginCreateOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// ExtensionsClientBeginDeleteOptions contains the optional parameters for the ExtensionsClient.BeginDelete method. -type ExtensionsClientBeginDeleteOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// ExtensionsClientBeginDisableAzureMonitorOptions contains the optional parameters for the ExtensionsClient.BeginDisableAzureMonitor -// method. -type ExtensionsClientBeginDisableAzureMonitorOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// ExtensionsClientBeginDisableMonitoringOptions contains the optional parameters for the ExtensionsClient.BeginDisableMonitoring -// method. -type ExtensionsClientBeginDisableMonitoringOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// ExtensionsClientBeginEnableAzureMonitorOptions contains the optional parameters for the ExtensionsClient.BeginEnableAzureMonitor -// method. -type ExtensionsClientBeginEnableAzureMonitorOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// ExtensionsClientBeginEnableMonitoringOptions contains the optional parameters for the ExtensionsClient.BeginEnableMonitoring -// method. -type ExtensionsClientBeginEnableMonitoringOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// ExtensionsClientGetAzureAsyncOperationStatusOptions contains the optional parameters for the ExtensionsClient.GetAzureAsyncOperationStatus -// method. -type ExtensionsClientGetAzureAsyncOperationStatusOptions struct { - // placeholder for future optional parameters -} - -// ExtensionsClientGetAzureMonitorStatusOptions contains the optional parameters for the ExtensionsClient.GetAzureMonitorStatus -// method. -type ExtensionsClientGetAzureMonitorStatusOptions struct { - // placeholder for future optional parameters -} - -// ExtensionsClientGetMonitoringStatusOptions contains the optional parameters for the ExtensionsClient.GetMonitoringStatus -// method. -type ExtensionsClientGetMonitoringStatusOptions struct { - // placeholder for future optional parameters -} - -// ExtensionsClientGetOptions contains the optional parameters for the ExtensionsClient.Get method. -type ExtensionsClientGetOptions struct { - // placeholder for future optional parameters -} - // GatewaySettings - Gateway settings. type GatewaySettings struct { // READ-ONLY; Indicates whether or not the gateway settings based authorization is enabled. @@ -1064,39 +870,6 @@ type LocalizedName struct { Value *string } -// LocationsClientCheckNameAvailabilityOptions contains the optional parameters for the LocationsClient.CheckNameAvailability -// method. -type LocationsClientCheckNameAvailabilityOptions struct { - // placeholder for future optional parameters -} - -// LocationsClientGetAzureAsyncOperationStatusOptions contains the optional parameters for the LocationsClient.GetAzureAsyncOperationStatus -// method. -type LocationsClientGetAzureAsyncOperationStatusOptions struct { - // placeholder for future optional parameters -} - -// LocationsClientGetCapabilitiesOptions contains the optional parameters for the LocationsClient.GetCapabilities method. -type LocationsClientGetCapabilitiesOptions struct { - // placeholder for future optional parameters -} - -// LocationsClientListBillingSpecsOptions contains the optional parameters for the LocationsClient.ListBillingSpecs method. -type LocationsClientListBillingSpecsOptions struct { - // placeholder for future optional parameters -} - -// LocationsClientListUsagesOptions contains the optional parameters for the LocationsClient.ListUsages method. -type LocationsClientListUsagesOptions struct { - // placeholder for future optional parameters -} - -// LocationsClientValidateClusterCreateRequestOptions contains the optional parameters for the LocationsClient.ValidateClusterCreateRequest -// method. -type LocationsClientValidateClusterCreateRequestOptions struct { - // placeholder for future optional parameters -} - // MetricSpecifications - The details of metric specifications. type MetricSpecifications struct { // The aggregation type of the metric specification. @@ -1174,6 +947,11 @@ type NameAvailabilityCheckResult struct { // NetworkProperties - The network properties. type NetworkProperties struct { + // A value to describe how the outbound dependencies of a HDInsight cluster are managed. 'Managed' means that the outbound + // dependencies are managed by the HDInsight service. 'External' means that the + // outbound dependencies are managed by a customer specific solution. + OutboundDependenciesManagedType *OutboundDependenciesManagedType + // Indicates whether or not private link is enabled. PrivateLink *PrivateLink @@ -1224,11 +1002,6 @@ type OperationProperties struct { ServiceSpecification *ServiceSpecification } -// OperationsClientListOptions contains the optional parameters for the OperationsClient.NewListPager method. -type OperationsClientListOptions struct { - // placeholder for future optional parameters -} - // OsProfile - The Linux operation systems profile. type OsProfile struct { // The Linux OS profile. @@ -1283,32 +1056,6 @@ type PrivateEndpointConnectionProperties struct { ProvisioningState *PrivateEndpointConnectionProvisioningState } -// PrivateEndpointConnectionsClientBeginCreateOrUpdateOptions contains the optional parameters for the PrivateEndpointConnectionsClient.BeginCreateOrUpdate -// method. -type PrivateEndpointConnectionsClientBeginCreateOrUpdateOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// PrivateEndpointConnectionsClientBeginDeleteOptions contains the optional parameters for the PrivateEndpointConnectionsClient.BeginDelete -// method. -type PrivateEndpointConnectionsClientBeginDeleteOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// PrivateEndpointConnectionsClientGetOptions contains the optional parameters for the PrivateEndpointConnectionsClient.Get -// method. -type PrivateEndpointConnectionsClientGetOptions struct { - // placeholder for future optional parameters -} - -// PrivateEndpointConnectionsClientListByClusterOptions contains the optional parameters for the PrivateEndpointConnectionsClient.NewListByClusterPager -// method. -type PrivateEndpointConnectionsClientListByClusterOptions struct { - // placeholder for future optional parameters -} - // PrivateLinkConfiguration - The private link configuration. type PrivateLinkConfiguration struct { // REQUIRED; The name of private link configuration. @@ -1373,17 +1120,6 @@ type PrivateLinkResourceProperties struct { RequiredMembers []*string } -// PrivateLinkResourcesClientGetOptions contains the optional parameters for the PrivateLinkResourcesClient.Get method. -type PrivateLinkResourcesClientGetOptions struct { - // placeholder for future optional parameters -} - -// PrivateLinkResourcesClientListByClusterOptions contains the optional parameters for the PrivateLinkResourcesClient.ListByCluster -// method. -type PrivateLinkResourcesClientListByClusterOptions struct { - // placeholder for future optional parameters -} - // PrivateLinkServiceConnectionState - The private link service connection state. type PrivateLinkServiceConnectionState struct { // REQUIRED; The concrete private link service connection. @@ -1616,29 +1352,6 @@ type ScriptActionPersistedGetResponseSpec struct { URI *string } -// ScriptActionsClientDeleteOptions contains the optional parameters for the ScriptActionsClient.Delete method. -type ScriptActionsClientDeleteOptions struct { - // placeholder for future optional parameters -} - -// ScriptActionsClientGetExecutionAsyncOperationStatusOptions contains the optional parameters for the ScriptActionsClient.GetExecutionAsyncOperationStatus -// method. -type ScriptActionsClientGetExecutionAsyncOperationStatusOptions struct { - // placeholder for future optional parameters -} - -// ScriptActionsClientGetExecutionDetailOptions contains the optional parameters for the ScriptActionsClient.GetExecutionDetail -// method. -type ScriptActionsClientGetExecutionDetailOptions struct { - // placeholder for future optional parameters -} - -// ScriptActionsClientListByClusterOptions contains the optional parameters for the ScriptActionsClient.NewListByClusterPager -// method. -type ScriptActionsClientListByClusterOptions struct { - // placeholder for future optional parameters -} - // ScriptActionsList - The persisted script action for the cluster. type ScriptActionsList struct { // The list of persisted script action details for the cluster. @@ -1648,18 +1361,6 @@ type ScriptActionsList struct { NextLink *string } -// ScriptExecutionHistoryClientListByClusterOptions contains the optional parameters for the ScriptExecutionHistoryClient.NewListByClusterPager -// method. -type ScriptExecutionHistoryClientListByClusterOptions struct { - // placeholder for future optional parameters -} - -// ScriptExecutionHistoryClientPromoteOptions contains the optional parameters for the ScriptExecutionHistoryClient.Promote -// method. -type ScriptExecutionHistoryClientPromoteOptions struct { - // placeholder for future optional parameters -} - // SecurityProfile - The security profile which contains Ssh public key for the HDInsight cluster. type SecurityProfile struct { // The resource ID of the user's Azure Active Directory Domain Service. @@ -1938,24 +1639,6 @@ type VersionsCapability struct { Available []*VersionSpec } -// VirtualMachinesClientBeginRestartHostsOptions contains the optional parameters for the VirtualMachinesClient.BeginRestartHosts -// method. -type VirtualMachinesClientBeginRestartHostsOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// VirtualMachinesClientGetAsyncOperationStatusOptions contains the optional parameters for the VirtualMachinesClient.GetAsyncOperationStatus -// method. -type VirtualMachinesClientGetAsyncOperationStatusOptions struct { - // placeholder for future optional parameters -} - -// VirtualMachinesClientListHostsOptions contains the optional parameters for the VirtualMachinesClient.ListHosts method. -type VirtualMachinesClientListHostsOptions struct { - // placeholder for future optional parameters -} - // VirtualNetworkProfile - The virtual network properties. type VirtualNetworkProfile struct { // The ID of the virtual network. diff --git a/sdk/resourcemanager/hdinsight/armhdinsight/models_serde.go b/sdk/resourcemanager/hdinsight/armhdinsight/models_serde.go index 5c60fa6d818f..3de2c330f6a2 100644 --- a/sdk/resourcemanager/hdinsight/armhdinsight/models_serde.go +++ b/sdk/resourcemanager/hdinsight/armhdinsight/models_serde.go @@ -3,9 +3,8 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. package armhdinsight @@ -2437,6 +2436,7 @@ func (n *NameAvailabilityCheckResult) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type NetworkProperties. func (n NetworkProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) + populate(objectMap, "outboundDependenciesManagedType", n.OutboundDependenciesManagedType) populate(objectMap, "privateLink", n.PrivateLink) populate(objectMap, "resourceProviderConnection", n.ResourceProviderConnection) return json.Marshal(objectMap) @@ -2451,6 +2451,9 @@ func (n *NetworkProperties) UnmarshalJSON(data []byte) error { for key, val := range rawMsg { var err error switch key { + case "outboundDependenciesManagedType": + err = unpopulate(val, "OutboundDependenciesManagedType", &n.OutboundDependenciesManagedType) + delete(rawMsg, key) case "privateLink": err = unpopulate(val, "PrivateLink", &n.PrivateLink) delete(rawMsg, key) diff --git a/sdk/resourcemanager/hdinsight/armhdinsight/operations_client.go b/sdk/resourcemanager/hdinsight/armhdinsight/operations_client.go index 72d557aee329..875b8bb719d0 100644 --- a/sdk/resourcemanager/hdinsight/armhdinsight/operations_client.go +++ b/sdk/resourcemanager/hdinsight/armhdinsight/operations_client.go @@ -3,9 +3,8 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. package armhdinsight @@ -40,7 +39,7 @@ func NewOperationsClient(credential azcore.TokenCredential, options *arm.ClientO // NewListPager - Lists all of the available HDInsight REST API operations. // -// Generated from API version 2023-04-15-preview +// Generated from API version 2023-08-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 +77,7 @@ func (client *OperationsClient) listCreateRequest(ctx context.Context, options * return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-04-15-preview") + reqQP.Set("api-version", "2023-08-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/operations_client_example_test.go b/sdk/resourcemanager/hdinsight/armhdinsight/operations_client_example_test.go deleted file mode 100644 index 05364b1d9c2b..000000000000 --- a/sdk/resourcemanager/hdinsight/armhdinsight/operations_client_example_test.go +++ /dev/null @@ -1,62 +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/310a0100f5b020c1900c527a6aa70d21992f078a/specification/hdinsight/resource-manager/Microsoft.HDInsight/preview/2023-04-15-preview/examples/ListHDInsightOperations.json -func ExampleOperationsClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armhdinsight.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewOperationsClient().NewListPager(nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.OperationListResult = armhdinsight.OperationListResult{ - // Value: []*armhdinsight.Operation{ - // { - // Name: to.Ptr("Microsoft.HDInsight/register/action"), - // Display: &armhdinsight.OperationDisplay{ - // Description: to.Ptr("Register HDInsight resource provider for the subscription"), - // Operation: to.Ptr("Register HDInsight resource provider"), - // Provider: to.Ptr("Microsoft.HDInsight"), - // }, - // }, - // { - // Name: to.Ptr("Microsoft.HDInsight/unregister/action"), - // Display: &armhdinsight.OperationDisplay{ - // Description: to.Ptr("Unregister HDInsight resource provider for the subscription"), - // Operation: to.Ptr("Unregister HDInsight resource provider"), - // Provider: to.Ptr("Microsoft.HDInsight"), - // }, - // }}, - // } - } -} diff --git a/sdk/resourcemanager/hdinsight/armhdinsight/options.go b/sdk/resourcemanager/hdinsight/armhdinsight/options.go new file mode 100644 index 000000000000..f0ca1dce8ca3 --- /dev/null +++ b/sdk/resourcemanager/hdinsight/armhdinsight/options.go @@ -0,0 +1,330 @@ +//go:build go1.18 +// +build go1.18 + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +package armhdinsight + +// ApplicationsClientBeginCreateOptions contains the optional parameters for the ApplicationsClient.BeginCreate method. +type ApplicationsClientBeginCreateOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// ApplicationsClientBeginDeleteOptions contains the optional parameters for the ApplicationsClient.BeginDelete method. +type ApplicationsClientBeginDeleteOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// ApplicationsClientGetAzureAsyncOperationStatusOptions contains the optional parameters for the ApplicationsClient.GetAzureAsyncOperationStatus +// method. +type ApplicationsClientGetAzureAsyncOperationStatusOptions struct { + // placeholder for future optional parameters +} + +// ApplicationsClientGetOptions contains the optional parameters for the ApplicationsClient.Get method. +type ApplicationsClientGetOptions struct { + // placeholder for future optional parameters +} + +// ApplicationsClientListByClusterOptions contains the optional parameters for the ApplicationsClient.NewListByClusterPager +// method. +type ApplicationsClientListByClusterOptions struct { + // placeholder for future optional parameters +} + +// ClustersClientBeginCreateOptions contains the optional parameters for the ClustersClient.BeginCreate method. +type ClustersClientBeginCreateOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// ClustersClientBeginDeleteOptions contains the optional parameters for the ClustersClient.BeginDelete method. +type ClustersClientBeginDeleteOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// ClustersClientBeginExecuteScriptActionsOptions contains the optional parameters for the ClustersClient.BeginExecuteScriptActions +// method. +type ClustersClientBeginExecuteScriptActionsOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// ClustersClientBeginResizeOptions contains the optional parameters for the ClustersClient.BeginResize method. +type ClustersClientBeginResizeOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// ClustersClientBeginRotateDiskEncryptionKeyOptions contains the optional parameters for the ClustersClient.BeginRotateDiskEncryptionKey +// method. +type ClustersClientBeginRotateDiskEncryptionKeyOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// ClustersClientBeginUpdateAutoScaleConfigurationOptions contains the optional parameters for the ClustersClient.BeginUpdateAutoScaleConfiguration +// method. +type ClustersClientBeginUpdateAutoScaleConfigurationOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// ClustersClientBeginUpdateGatewaySettingsOptions contains the optional parameters for the ClustersClient.BeginUpdateGatewaySettings +// method. +type ClustersClientBeginUpdateGatewaySettingsOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// ClustersClientBeginUpdateIdentityCertificateOptions contains the optional parameters for the ClustersClient.BeginUpdateIdentityCertificate +// method. +type ClustersClientBeginUpdateIdentityCertificateOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// ClustersClientGetAzureAsyncOperationStatusOptions contains the optional parameters for the ClustersClient.GetAzureAsyncOperationStatus +// method. +type ClustersClientGetAzureAsyncOperationStatusOptions struct { + // placeholder for future optional parameters +} + +// ClustersClientGetGatewaySettingsOptions contains the optional parameters for the ClustersClient.GetGatewaySettings method. +type ClustersClientGetGatewaySettingsOptions struct { + // placeholder for future optional parameters +} + +// ClustersClientGetOptions contains the optional parameters for the ClustersClient.Get method. +type ClustersClientGetOptions struct { + // placeholder for future optional parameters +} + +// ClustersClientListByResourceGroupOptions contains the optional parameters for the ClustersClient.NewListByResourceGroupPager +// method. +type ClustersClientListByResourceGroupOptions struct { + // placeholder for future optional parameters +} + +// ClustersClientListOptions contains the optional parameters for the ClustersClient.NewListPager method. +type ClustersClientListOptions struct { + // placeholder for future optional parameters +} + +// ClustersClientUpdateOptions contains the optional parameters for the ClustersClient.Update method. +type ClustersClientUpdateOptions struct { + // placeholder for future optional parameters +} + +// ConfigurationsClientBeginUpdateOptions contains the optional parameters for the ConfigurationsClient.BeginUpdate method. +type ConfigurationsClientBeginUpdateOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// ConfigurationsClientGetOptions contains the optional parameters for the ConfigurationsClient.Get method. +type ConfigurationsClientGetOptions struct { + // placeholder for future optional parameters +} + +// ConfigurationsClientListOptions contains the optional parameters for the ConfigurationsClient.List method. +type ConfigurationsClientListOptions struct { + // placeholder for future optional parameters +} + +// ExtensionsClientBeginCreateOptions contains the optional parameters for the ExtensionsClient.BeginCreate method. +type ExtensionsClientBeginCreateOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// ExtensionsClientBeginDeleteOptions contains the optional parameters for the ExtensionsClient.BeginDelete method. +type ExtensionsClientBeginDeleteOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// ExtensionsClientBeginDisableAzureMonitorOptions contains the optional parameters for the ExtensionsClient.BeginDisableAzureMonitor +// method. +type ExtensionsClientBeginDisableAzureMonitorOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// ExtensionsClientBeginDisableMonitoringOptions contains the optional parameters for the ExtensionsClient.BeginDisableMonitoring +// method. +type ExtensionsClientBeginDisableMonitoringOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// ExtensionsClientBeginEnableAzureMonitorOptions contains the optional parameters for the ExtensionsClient.BeginEnableAzureMonitor +// method. +type ExtensionsClientBeginEnableAzureMonitorOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// ExtensionsClientBeginEnableMonitoringOptions contains the optional parameters for the ExtensionsClient.BeginEnableMonitoring +// method. +type ExtensionsClientBeginEnableMonitoringOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// ExtensionsClientGetAzureAsyncOperationStatusOptions contains the optional parameters for the ExtensionsClient.GetAzureAsyncOperationStatus +// method. +type ExtensionsClientGetAzureAsyncOperationStatusOptions struct { + // placeholder for future optional parameters +} + +// ExtensionsClientGetAzureMonitorStatusOptions contains the optional parameters for the ExtensionsClient.GetAzureMonitorStatus +// method. +type ExtensionsClientGetAzureMonitorStatusOptions struct { + // placeholder for future optional parameters +} + +// ExtensionsClientGetMonitoringStatusOptions contains the optional parameters for the ExtensionsClient.GetMonitoringStatus +// method. +type ExtensionsClientGetMonitoringStatusOptions struct { + // placeholder for future optional parameters +} + +// ExtensionsClientGetOptions contains the optional parameters for the ExtensionsClient.Get method. +type ExtensionsClientGetOptions struct { + // placeholder for future optional parameters +} + +// LocationsClientCheckNameAvailabilityOptions contains the optional parameters for the LocationsClient.CheckNameAvailability +// method. +type LocationsClientCheckNameAvailabilityOptions struct { + // placeholder for future optional parameters +} + +// LocationsClientGetAzureAsyncOperationStatusOptions contains the optional parameters for the LocationsClient.GetAzureAsyncOperationStatus +// method. +type LocationsClientGetAzureAsyncOperationStatusOptions struct { + // placeholder for future optional parameters +} + +// LocationsClientGetCapabilitiesOptions contains the optional parameters for the LocationsClient.GetCapabilities method. +type LocationsClientGetCapabilitiesOptions struct { + // placeholder for future optional parameters +} + +// LocationsClientListBillingSpecsOptions contains the optional parameters for the LocationsClient.ListBillingSpecs method. +type LocationsClientListBillingSpecsOptions struct { + // placeholder for future optional parameters +} + +// LocationsClientListUsagesOptions contains the optional parameters for the LocationsClient.ListUsages method. +type LocationsClientListUsagesOptions struct { + // placeholder for future optional parameters +} + +// LocationsClientValidateClusterCreateRequestOptions contains the optional parameters for the LocationsClient.ValidateClusterCreateRequest +// method. +type LocationsClientValidateClusterCreateRequestOptions struct { + // placeholder for future optional parameters +} + +// OperationsClientListOptions contains the optional parameters for the OperationsClient.NewListPager method. +type OperationsClientListOptions struct { + // placeholder for future optional parameters +} + +// PrivateEndpointConnectionsClientBeginCreateOrUpdateOptions contains the optional parameters for the PrivateEndpointConnectionsClient.BeginCreateOrUpdate +// method. +type PrivateEndpointConnectionsClientBeginCreateOrUpdateOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// PrivateEndpointConnectionsClientBeginDeleteOptions contains the optional parameters for the PrivateEndpointConnectionsClient.BeginDelete +// method. +type PrivateEndpointConnectionsClientBeginDeleteOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// PrivateEndpointConnectionsClientGetOptions contains the optional parameters for the PrivateEndpointConnectionsClient.Get +// method. +type PrivateEndpointConnectionsClientGetOptions struct { + // placeholder for future optional parameters +} + +// PrivateEndpointConnectionsClientListByClusterOptions contains the optional parameters for the PrivateEndpointConnectionsClient.NewListByClusterPager +// method. +type PrivateEndpointConnectionsClientListByClusterOptions struct { + // placeholder for future optional parameters +} + +// PrivateLinkResourcesClientGetOptions contains the optional parameters for the PrivateLinkResourcesClient.Get method. +type PrivateLinkResourcesClientGetOptions struct { + // placeholder for future optional parameters +} + +// PrivateLinkResourcesClientListByClusterOptions contains the optional parameters for the PrivateLinkResourcesClient.ListByCluster +// method. +type PrivateLinkResourcesClientListByClusterOptions struct { + // placeholder for future optional parameters +} + +// ScriptActionsClientDeleteOptions contains the optional parameters for the ScriptActionsClient.Delete method. +type ScriptActionsClientDeleteOptions struct { + // placeholder for future optional parameters +} + +// ScriptActionsClientGetExecutionAsyncOperationStatusOptions contains the optional parameters for the ScriptActionsClient.GetExecutionAsyncOperationStatus +// method. +type ScriptActionsClientGetExecutionAsyncOperationStatusOptions struct { + // placeholder for future optional parameters +} + +// ScriptActionsClientGetExecutionDetailOptions contains the optional parameters for the ScriptActionsClient.GetExecutionDetail +// method. +type ScriptActionsClientGetExecutionDetailOptions struct { + // placeholder for future optional parameters +} + +// ScriptActionsClientListByClusterOptions contains the optional parameters for the ScriptActionsClient.NewListByClusterPager +// method. +type ScriptActionsClientListByClusterOptions struct { + // placeholder for future optional parameters +} + +// ScriptExecutionHistoryClientListByClusterOptions contains the optional parameters for the ScriptExecutionHistoryClient.NewListByClusterPager +// method. +type ScriptExecutionHistoryClientListByClusterOptions struct { + // placeholder for future optional parameters +} + +// ScriptExecutionHistoryClientPromoteOptions contains the optional parameters for the ScriptExecutionHistoryClient.Promote +// method. +type ScriptExecutionHistoryClientPromoteOptions struct { + // placeholder for future optional parameters +} + +// VirtualMachinesClientBeginRestartHostsOptions contains the optional parameters for the VirtualMachinesClient.BeginRestartHosts +// method. +type VirtualMachinesClientBeginRestartHostsOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// VirtualMachinesClientGetAsyncOperationStatusOptions contains the optional parameters for the VirtualMachinesClient.GetAsyncOperationStatus +// method. +type VirtualMachinesClientGetAsyncOperationStatusOptions struct { + // placeholder for future optional parameters +} + +// VirtualMachinesClientListHostsOptions contains the optional parameters for the VirtualMachinesClient.ListHosts method. +type VirtualMachinesClientListHostsOptions struct { + // placeholder for future optional parameters +} diff --git a/sdk/resourcemanager/hdinsight/armhdinsight/privateendpointconnections_client.go b/sdk/resourcemanager/hdinsight/armhdinsight/privateendpointconnections_client.go index 3d9480835c66..1b85d24f3c53 100644 --- a/sdk/resourcemanager/hdinsight/armhdinsight/privateendpointconnections_client.go +++ b/sdk/resourcemanager/hdinsight/armhdinsight/privateendpointconnections_client.go @@ -3,9 +3,8 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. package armhdinsight @@ -48,7 +47,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 2023-04-15-preview +// Generated from API version 2023-08-15-preview // - resourceGroupName - The name of the resource group. // - clusterName - The name of the cluster. // - privateEndpointConnectionName - The name of the private endpoint connection. @@ -61,9 +60,10 @@ func (client *PrivateEndpointConnectionsClient) BeginCreateOrUpdate(ctx context. if err != nil { return nil, err } - return runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[PrivateEndpointConnectionsClientCreateOrUpdateResponse]{ + poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[PrivateEndpointConnectionsClientCreateOrUpdateResponse]{ FinalStateVia: runtime.FinalStateViaAzureAsyncOp, }) + return poller, err } else { return runtime.NewPollerFromResumeToken[PrivateEndpointConnectionsClientCreateOrUpdateResponse](options.ResumeToken, client.internal.Pipeline(), nil) } @@ -72,20 +72,22 @@ 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 2023-04-15-preview +// Generated from API version 2023-08-15-preview func (client *PrivateEndpointConnectionsClient) createOrUpdate(ctx context.Context, resourceGroupName string, clusterName string, privateEndpointConnectionName string, parameters PrivateEndpointConnection, options *PrivateEndpointConnectionsClientBeginCreateOrUpdateOptions) (*http.Response, error) { + var err error req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, clusterName, privateEndpointConnectionName, parameters, options) if err != nil { return nil, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return nil, err } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusCreated) { - return nil, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusCreated) { + err = runtime.NewResponseError(httpResp) + return nil, err } - return resp, nil + return httpResp, nil } // createOrUpdateCreateRequest creates the CreateOrUpdate request. @@ -112,16 +114,19 @@ func (client *PrivateEndpointConnectionsClient) createOrUpdateCreateRequest(ctx return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-04-15-preview") + reqQP.Set("api-version", "2023-08-15-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, parameters) + if err := runtime.MarshalAsJSON(req, parameters); err != nil { + return nil, err + } + return req, nil } // BeginDelete - Deletes the specific private endpoint connection. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-04-15-preview +// Generated from API version 2023-08-15-preview // - resourceGroupName - The name of the resource group. // - clusterName - The name of the cluster. // - privateEndpointConnectionName - The name of the private endpoint connection. @@ -133,9 +138,10 @@ func (client *PrivateEndpointConnectionsClient) BeginDelete(ctx context.Context, if err != nil { return nil, err } - return runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[PrivateEndpointConnectionsClientDeleteResponse]{ + poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[PrivateEndpointConnectionsClientDeleteResponse]{ FinalStateVia: runtime.FinalStateViaAzureAsyncOp, }) + return poller, err } else { return runtime.NewPollerFromResumeToken[PrivateEndpointConnectionsClientDeleteResponse](options.ResumeToken, client.internal.Pipeline(), nil) } @@ -144,20 +150,22 @@ 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 2023-04-15-preview +// Generated from API version 2023-08-15-preview func (client *PrivateEndpointConnectionsClient) deleteOperation(ctx context.Context, resourceGroupName string, clusterName string, privateEndpointConnectionName string, options *PrivateEndpointConnectionsClientBeginDeleteOptions) (*http.Response, error) { + var err error req, err := client.deleteCreateRequest(ctx, resourceGroupName, clusterName, privateEndpointConnectionName, options) if err != nil { return nil, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return nil, err } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted, http.StatusNoContent) { - return nil, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted, http.StatusNoContent) { + err = runtime.NewResponseError(httpResp) + return nil, err } - return resp, nil + return httpResp, nil } // deleteCreateRequest creates the Delete request. @@ -184,7 +192,7 @@ func (client *PrivateEndpointConnectionsClient) deleteCreateRequest(ctx context. return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-04-15-preview") + reqQP.Set("api-version", "2023-08-15-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -193,25 +201,28 @@ 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 2023-04-15-preview +// Generated from API version 2023-08-15-preview // - resourceGroupName - The name of the resource group. // - clusterName - The name of the cluster. // - privateEndpointConnectionName - The name of the private endpoint connection. // - options - PrivateEndpointConnectionsClientGetOptions contains the optional parameters for the PrivateEndpointConnectionsClient.Get // method. func (client *PrivateEndpointConnectionsClient) Get(ctx context.Context, resourceGroupName string, clusterName string, privateEndpointConnectionName string, options *PrivateEndpointConnectionsClientGetOptions) (PrivateEndpointConnectionsClientGetResponse, error) { + var err error req, err := client.getCreateRequest(ctx, resourceGroupName, clusterName, privateEndpointConnectionName, options) if err != nil { return PrivateEndpointConnectionsClientGetResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return PrivateEndpointConnectionsClientGetResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return PrivateEndpointConnectionsClientGetResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return PrivateEndpointConnectionsClientGetResponse{}, err } - return client.getHandleResponse(resp) + resp, err := client.getHandleResponse(httpResp) + return resp, err } // getCreateRequest creates the Get request. @@ -238,7 +249,7 @@ func (client *PrivateEndpointConnectionsClient) getCreateRequest(ctx context.Con return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-04-15-preview") + reqQP.Set("api-version", "2023-08-15-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -255,7 +266,7 @@ func (client *PrivateEndpointConnectionsClient) getHandleResponse(resp *http.Res // NewListByClusterPager - Lists the private endpoint connections for a HDInsight cluster. // -// Generated from API version 2023-04-15-preview +// Generated from API version 2023-08-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 +319,7 @@ func (client *PrivateEndpointConnectionsClient) listByClusterCreateRequest(ctx c return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-04-15-preview") + reqQP.Set("api-version", "2023-08-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 9bc8754e6d3b..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/310a0100f5b020c1900c527a6aa70d21992f078a/specification/hdinsight/resource-manager/Microsoft.HDInsight/preview/2023-04-15-preview/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/310a0100f5b020c1900c527a6aa70d21992f078a/specification/hdinsight/resource-manager/Microsoft.HDInsight/preview/2023-04-15-preview/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/310a0100f5b020c1900c527a6aa70d21992f078a/specification/hdinsight/resource-manager/Microsoft.HDInsight/preview/2023-04-15-preview/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/310a0100f5b020c1900c527a6aa70d21992f078a/specification/hdinsight/resource-manager/Microsoft.HDInsight/preview/2023-04-15-preview/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 1e8edad8a354..848527c130e7 100644 --- a/sdk/resourcemanager/hdinsight/armhdinsight/privatelinkresources_client.go +++ b/sdk/resourcemanager/hdinsight/armhdinsight/privatelinkresources_client.go @@ -3,9 +3,8 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. package armhdinsight @@ -48,25 +47,28 @@ 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 2023-04-15-preview +// Generated from API version 2023-08-15-preview // - resourceGroupName - The name of the resource group. // - clusterName - The name of the cluster. // - privateLinkResourceName - The name of the private link resource. // - options - PrivateLinkResourcesClientGetOptions contains the optional parameters for the PrivateLinkResourcesClient.Get // method. func (client *PrivateLinkResourcesClient) Get(ctx context.Context, resourceGroupName string, clusterName string, privateLinkResourceName string, options *PrivateLinkResourcesClientGetOptions) (PrivateLinkResourcesClientGetResponse, error) { + var err error req, err := client.getCreateRequest(ctx, resourceGroupName, clusterName, privateLinkResourceName, options) if err != nil { return PrivateLinkResourcesClientGetResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return PrivateLinkResourcesClientGetResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return PrivateLinkResourcesClientGetResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return PrivateLinkResourcesClientGetResponse{}, err } - return client.getHandleResponse(resp) + resp, err := client.getHandleResponse(httpResp) + return resp, err } // getCreateRequest creates the Get request. @@ -93,7 +95,7 @@ func (client *PrivateLinkResourcesClient) getCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-04-15-preview") + reqQP.Set("api-version", "2023-08-15-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -111,24 +113,27 @@ 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 2023-04-15-preview +// Generated from API version 2023-08-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 // method. func (client *PrivateLinkResourcesClient) ListByCluster(ctx context.Context, resourceGroupName string, clusterName string, options *PrivateLinkResourcesClientListByClusterOptions) (PrivateLinkResourcesClientListByClusterResponse, error) { + var err error req, err := client.listByClusterCreateRequest(ctx, resourceGroupName, clusterName, options) if err != nil { return PrivateLinkResourcesClientListByClusterResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return PrivateLinkResourcesClientListByClusterResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return PrivateLinkResourcesClientListByClusterResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return PrivateLinkResourcesClientListByClusterResponse{}, err } - return client.listByClusterHandleResponse(resp) + resp, err := client.listByClusterHandleResponse(httpResp) + return resp, err } // listByClusterCreateRequest creates the ListByCluster request. @@ -151,7 +156,7 @@ func (client *PrivateLinkResourcesClient) listByClusterCreateRequest(ctx context return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-04-15-preview") + reqQP.Set("api-version", "2023-08-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 0e6bc4089828..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/310a0100f5b020c1900c527a6aa70d21992f078a/specification/hdinsight/resource-manager/Microsoft.HDInsight/preview/2023-04-15-preview/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/310a0100f5b020c1900c527a6aa70d21992f078a/specification/hdinsight/resource-manager/Microsoft.HDInsight/preview/2023-04-15-preview/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/response_types.go b/sdk/resourcemanager/hdinsight/armhdinsight/response_types.go index 0c2be861b5e1..859d77604cf5 100644 --- a/sdk/resourcemanager/hdinsight/armhdinsight/response_types.go +++ b/sdk/resourcemanager/hdinsight/armhdinsight/response_types.go @@ -3,14 +3,14 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. package armhdinsight // ApplicationsClientCreateResponse contains the response from method ApplicationsClient.BeginCreate. type ApplicationsClientCreateResponse struct { + // The HDInsight cluster application Application } @@ -21,21 +21,26 @@ type ApplicationsClientDeleteResponse struct { // ApplicationsClientGetAzureAsyncOperationStatusResponse contains the response from method ApplicationsClient.GetAzureAsyncOperationStatus. type ApplicationsClientGetAzureAsyncOperationStatusResponse struct { + // The azure async operation response. AsyncOperationResult } // ApplicationsClientGetResponse contains the response from method ApplicationsClient.Get. type ApplicationsClientGetResponse struct { + // The HDInsight cluster application Application } // ApplicationsClientListByClusterResponse contains the response from method ApplicationsClient.NewListByClusterPager. type ApplicationsClientListByClusterResponse struct { + // Result of the request to list cluster Applications. It contains a list of operations and a URL link to get the next set + // of results. ApplicationListResult } // ClustersClientCreateResponse contains the response from method ClustersClient.BeginCreate. type ClustersClientCreateResponse struct { + // The HDInsight cluster. Cluster } @@ -51,26 +56,31 @@ type ClustersClientExecuteScriptActionsResponse struct { // ClustersClientGetAzureAsyncOperationStatusResponse contains the response from method ClustersClient.GetAzureAsyncOperationStatus. type ClustersClientGetAzureAsyncOperationStatusResponse struct { + // The azure async operation response. AsyncOperationResult } // ClustersClientGetGatewaySettingsResponse contains the response from method ClustersClient.GetGatewaySettings. type ClustersClientGetGatewaySettingsResponse struct { + // Gateway settings. GatewaySettings } // ClustersClientGetResponse contains the response from method ClustersClient.Get. type ClustersClientGetResponse struct { + // The HDInsight cluster. Cluster } // ClustersClientListByResourceGroupResponse contains the response from method ClustersClient.NewListByResourceGroupPager. type ClustersClientListByResourceGroupResponse struct { + // The List Cluster operation response. ClusterListResult } // ClustersClientListResponse contains the response from method ClustersClient.NewListPager. type ClustersClientListResponse struct { + // The List Cluster operation response. ClusterListResult } @@ -101,6 +111,7 @@ type ClustersClientUpdateIdentityCertificateResponse struct { // ClustersClientUpdateResponse contains the response from method ClustersClient.Update. type ClustersClientUpdateResponse struct { + // The HDInsight cluster. Cluster } @@ -112,6 +123,7 @@ type ConfigurationsClientGetResponse struct { // ConfigurationsClientListResponse contains the response from method ConfigurationsClient.List. type ConfigurationsClientListResponse struct { + // The configuration object for the specified cluster. ClusterConfigurations } @@ -152,61 +164,74 @@ type ExtensionsClientEnableMonitoringResponse struct { // ExtensionsClientGetAzureAsyncOperationStatusResponse contains the response from method ExtensionsClient.GetAzureAsyncOperationStatus. type ExtensionsClientGetAzureAsyncOperationStatusResponse struct { + // The azure async operation response. AsyncOperationResult } // ExtensionsClientGetAzureMonitorStatusResponse contains the response from method ExtensionsClient.GetAzureMonitorStatus. type ExtensionsClientGetAzureMonitorStatusResponse struct { + // The azure monitor status response. AzureMonitorResponse } // ExtensionsClientGetMonitoringStatusResponse contains the response from method ExtensionsClient.GetMonitoringStatus. type ExtensionsClientGetMonitoringStatusResponse struct { + // The cluster monitoring status response. ClusterMonitoringResponse } // ExtensionsClientGetResponse contains the response from method ExtensionsClient.Get. type ExtensionsClientGetResponse struct { + // The cluster monitoring status response. ClusterMonitoringResponse } // LocationsClientCheckNameAvailabilityResponse contains the response from method LocationsClient.CheckNameAvailability. type LocationsClientCheckNameAvailabilityResponse struct { + // The response spec of checking name availability. NameAvailabilityCheckResult } // LocationsClientGetAzureAsyncOperationStatusResponse contains the response from method LocationsClient.GetAzureAsyncOperationStatus. type LocationsClientGetAzureAsyncOperationStatusResponse struct { + // The azure async operation response. AsyncOperationResult } // LocationsClientGetCapabilitiesResponse contains the response from method LocationsClient.GetCapabilities. type LocationsClientGetCapabilitiesResponse struct { + // The Get Capabilities operation response. CapabilitiesResult } // LocationsClientListBillingSpecsResponse contains the response from method LocationsClient.ListBillingSpecs. type LocationsClientListBillingSpecsResponse struct { + // The response for the operation to get regional billingSpecs for a subscription. BillingResponseListResult } // LocationsClientListUsagesResponse contains the response from method LocationsClient.ListUsages. type LocationsClientListUsagesResponse struct { + // The response for the operation to get regional usages for a subscription. UsagesListResult } // LocationsClientValidateClusterCreateRequestResponse contains the response from method LocationsClient.ValidateClusterCreateRequest. type LocationsClientValidateClusterCreateRequestResponse struct { + // The response of cluster create request validation. ClusterCreateValidationResult } // OperationsClientListResponse contains the response from method OperationsClient.NewListPager. type OperationsClientListResponse struct { + // Result of the request to list HDInsight operations. It contains a list of operations and a URL link to get the next set + // of results. OperationListResult } // PrivateEndpointConnectionsClientCreateOrUpdateResponse contains the response from method PrivateEndpointConnectionsClient.BeginCreateOrUpdate. type PrivateEndpointConnectionsClientCreateOrUpdateResponse struct { + // The private endpoint connection. PrivateEndpointConnection } @@ -217,21 +242,25 @@ type PrivateEndpointConnectionsClientDeleteResponse struct { // PrivateEndpointConnectionsClientGetResponse contains the response from method PrivateEndpointConnectionsClient.Get. type PrivateEndpointConnectionsClientGetResponse struct { + // The private endpoint connection. PrivateEndpointConnection } // PrivateEndpointConnectionsClientListByClusterResponse contains the response from method PrivateEndpointConnectionsClient.NewListByClusterPager. type PrivateEndpointConnectionsClientListByClusterResponse struct { + // The list private endpoint connections response. PrivateEndpointConnectionListResult } // PrivateLinkResourcesClientGetResponse contains the response from method PrivateLinkResourcesClient.Get. type PrivateLinkResourcesClientGetResponse struct { + // A private link resource PrivateLinkResource } // PrivateLinkResourcesClientListByClusterResponse contains the response from method PrivateLinkResourcesClient.ListByCluster. type PrivateLinkResourcesClientListByClusterResponse struct { + // A list of private link resources PrivateLinkResourceListResult } @@ -242,21 +271,25 @@ type ScriptActionsClientDeleteResponse struct { // ScriptActionsClientGetExecutionAsyncOperationStatusResponse contains the response from method ScriptActionsClient.GetExecutionAsyncOperationStatus. type ScriptActionsClientGetExecutionAsyncOperationStatusResponse struct { + // The azure async operation response. AsyncOperationResult } // ScriptActionsClientGetExecutionDetailResponse contains the response from method ScriptActionsClient.GetExecutionDetail. type ScriptActionsClientGetExecutionDetailResponse struct { + // The execution details of a script action. RuntimeScriptActionDetail } // ScriptActionsClientListByClusterResponse contains the response from method ScriptActionsClient.NewListByClusterPager. type ScriptActionsClientListByClusterResponse struct { + // The persisted script action for the cluster. ScriptActionsList } // ScriptExecutionHistoryClientListByClusterResponse contains the response from method ScriptExecutionHistoryClient.NewListByClusterPager. type ScriptExecutionHistoryClientListByClusterResponse struct { + // The list script execution history response. ScriptActionExecutionHistoryList } @@ -267,6 +300,7 @@ type ScriptExecutionHistoryClientPromoteResponse struct { // VirtualMachinesClientGetAsyncOperationStatusResponse contains the response from method VirtualMachinesClient.GetAsyncOperationStatus. type VirtualMachinesClientGetAsyncOperationStatusResponse struct { + // The azure async operation response. AsyncOperationResult } diff --git a/sdk/resourcemanager/hdinsight/armhdinsight/scriptactions_client.go b/sdk/resourcemanager/hdinsight/armhdinsight/scriptactions_client.go index 8ff30aa53c03..039b1974d338 100644 --- a/sdk/resourcemanager/hdinsight/armhdinsight/scriptactions_client.go +++ b/sdk/resourcemanager/hdinsight/armhdinsight/scriptactions_client.go @@ -3,9 +3,8 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. package armhdinsight @@ -48,22 +47,24 @@ 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 2023-04-15-preview +// Generated from API version 2023-08-15-preview // - resourceGroupName - The name of the resource group. // - clusterName - The name of the cluster. // - scriptName - The name of the script. // - options - ScriptActionsClientDeleteOptions contains the optional parameters for the ScriptActionsClient.Delete method. func (client *ScriptActionsClient) Delete(ctx context.Context, resourceGroupName string, clusterName string, scriptName string, options *ScriptActionsClientDeleteOptions) (ScriptActionsClientDeleteResponse, error) { + var err error req, err := client.deleteCreateRequest(ctx, resourceGroupName, clusterName, scriptName, options) if err != nil { return ScriptActionsClientDeleteResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return ScriptActionsClientDeleteResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusNoContent) { - return ScriptActionsClientDeleteResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusNoContent) { + err = runtime.NewResponseError(httpResp) + return ScriptActionsClientDeleteResponse{}, err } return ScriptActionsClientDeleteResponse{}, nil } @@ -92,7 +93,7 @@ func (client *ScriptActionsClient) deleteCreateRequest(ctx context.Context, reso return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-04-15-preview") + reqQP.Set("api-version", "2023-08-15-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -101,25 +102,28 @@ 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 2023-04-15-preview +// Generated from API version 2023-08-15-preview // - resourceGroupName - The name of the resource group. // - clusterName - The name of the cluster. // - operationID - The long running operation id. // - options - ScriptActionsClientGetExecutionAsyncOperationStatusOptions contains the optional parameters for the ScriptActionsClient.GetExecutionAsyncOperationStatus // method. func (client *ScriptActionsClient) GetExecutionAsyncOperationStatus(ctx context.Context, resourceGroupName string, clusterName string, operationID string, options *ScriptActionsClientGetExecutionAsyncOperationStatusOptions) (ScriptActionsClientGetExecutionAsyncOperationStatusResponse, error) { + var err error req, err := client.getExecutionAsyncOperationStatusCreateRequest(ctx, resourceGroupName, clusterName, operationID, options) if err != nil { return ScriptActionsClientGetExecutionAsyncOperationStatusResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return ScriptActionsClientGetExecutionAsyncOperationStatusResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return ScriptActionsClientGetExecutionAsyncOperationStatusResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return ScriptActionsClientGetExecutionAsyncOperationStatusResponse{}, err } - return client.getExecutionAsyncOperationStatusHandleResponse(resp) + resp, err := client.getExecutionAsyncOperationStatusHandleResponse(httpResp) + return resp, err } // getExecutionAsyncOperationStatusCreateRequest creates the GetExecutionAsyncOperationStatus request. @@ -146,7 +150,7 @@ func (client *ScriptActionsClient) getExecutionAsyncOperationStatusCreateRequest return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-04-15-preview") + reqQP.Set("api-version", "2023-08-15-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -164,25 +168,28 @@ 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 2023-04-15-preview +// Generated from API version 2023-08-15-preview // - resourceGroupName - The name of the resource group. // - clusterName - The name of the cluster. // - scriptExecutionID - The script execution Id // - options - ScriptActionsClientGetExecutionDetailOptions contains the optional parameters for the ScriptActionsClient.GetExecutionDetail // method. func (client *ScriptActionsClient) GetExecutionDetail(ctx context.Context, resourceGroupName string, clusterName string, scriptExecutionID string, options *ScriptActionsClientGetExecutionDetailOptions) (ScriptActionsClientGetExecutionDetailResponse, error) { + var err error req, err := client.getExecutionDetailCreateRequest(ctx, resourceGroupName, clusterName, scriptExecutionID, options) if err != nil { return ScriptActionsClientGetExecutionDetailResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return ScriptActionsClientGetExecutionDetailResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return ScriptActionsClientGetExecutionDetailResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return ScriptActionsClientGetExecutionDetailResponse{}, err } - return client.getExecutionDetailHandleResponse(resp) + resp, err := client.getExecutionDetailHandleResponse(httpResp) + return resp, err } // getExecutionDetailCreateRequest creates the GetExecutionDetail request. @@ -209,7 +216,7 @@ func (client *ScriptActionsClient) getExecutionDetailCreateRequest(ctx context.C return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-04-15-preview") + reqQP.Set("api-version", "2023-08-15-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -226,7 +233,7 @@ func (client *ScriptActionsClient) getExecutionDetailHandleResponse(resp *http.R // NewListByClusterPager - Lists all the persisted script actions for the specified cluster. // -// Generated from API version 2023-04-15-preview +// Generated from API version 2023-08-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 +286,7 @@ func (client *ScriptActionsClient) listByClusterCreateRequest(ctx context.Contex return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-04-15-preview") + reqQP.Set("api-version", "2023-08-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 c44497a4b218..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/310a0100f5b020c1900c527a6aa70d21992f078a/specification/hdinsight/resource-manager/Microsoft.HDInsight/preview/2023-04-15-preview/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/310a0100f5b020c1900c527a6aa70d21992f078a/specification/hdinsight/resource-manager/Microsoft.HDInsight/preview/2023-04-15-preview/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/310a0100f5b020c1900c527a6aa70d21992f078a/specification/hdinsight/resource-manager/Microsoft.HDInsight/preview/2023-04-15-preview/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/310a0100f5b020c1900c527a6aa70d21992f078a/specification/hdinsight/resource-manager/Microsoft.HDInsight/preview/2023-04-15-preview/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 a5b009ebc4c0..051e76b50f90 100644 --- a/sdk/resourcemanager/hdinsight/armhdinsight/scriptexecutionhistory_client.go +++ b/sdk/resourcemanager/hdinsight/armhdinsight/scriptexecutionhistory_client.go @@ -3,9 +3,8 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. package armhdinsight @@ -47,7 +46,7 @@ func NewScriptExecutionHistoryClient(subscriptionID string, credential azcore.To // NewListByClusterPager - Lists all scripts' execution history for the specified cluster. // -// Generated from API version 2023-04-15-preview +// Generated from API version 2023-08-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 +99,7 @@ func (client *ScriptExecutionHistoryClient) listByClusterCreateRequest(ctx conte return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-04-15-preview") + reqQP.Set("api-version", "2023-08-15-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -118,23 +117,25 @@ 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 2023-04-15-preview +// Generated from API version 2023-08-15-preview // - resourceGroupName - The name of the resource group. // - clusterName - The name of the cluster. // - scriptExecutionID - The script execution Id // - options - ScriptExecutionHistoryClientPromoteOptions contains the optional parameters for the ScriptExecutionHistoryClient.Promote // method. func (client *ScriptExecutionHistoryClient) Promote(ctx context.Context, resourceGroupName string, clusterName string, scriptExecutionID string, options *ScriptExecutionHistoryClientPromoteOptions) (ScriptExecutionHistoryClientPromoteResponse, error) { + var err error req, err := client.promoteCreateRequest(ctx, resourceGroupName, clusterName, scriptExecutionID, options) if err != nil { return ScriptExecutionHistoryClientPromoteResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return ScriptExecutionHistoryClientPromoteResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return ScriptExecutionHistoryClientPromoteResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return ScriptExecutionHistoryClientPromoteResponse{}, err } return ScriptExecutionHistoryClientPromoteResponse{}, nil } @@ -163,7 +164,7 @@ func (client *ScriptExecutionHistoryClient) promoteCreateRequest(ctx context.Con return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-04-15-preview") + reqQP.Set("api-version", "2023-08-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 641af1d3f295..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/310a0100f5b020c1900c527a6aa70d21992f078a/specification/hdinsight/resource-manager/Microsoft.HDInsight/preview/2023-04-15-preview/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/310a0100f5b020c1900c527a6aa70d21992f078a/specification/hdinsight/resource-manager/Microsoft.HDInsight/preview/2023-04-15-preview/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/time_rfc3339.go b/sdk/resourcemanager/hdinsight/armhdinsight/time_rfc3339.go index 9fafbcd1d91d..fa0d077b5141 100644 --- a/sdk/resourcemanager/hdinsight/armhdinsight/time_rfc3339.go +++ b/sdk/resourcemanager/hdinsight/armhdinsight/time_rfc3339.go @@ -3,9 +3,8 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. package armhdinsight diff --git a/sdk/resourcemanager/hdinsight/armhdinsight/virtualmachines_client.go b/sdk/resourcemanager/hdinsight/armhdinsight/virtualmachines_client.go index fe3dace89cca..0a4c2f98e328 100644 --- a/sdk/resourcemanager/hdinsight/armhdinsight/virtualmachines_client.go +++ b/sdk/resourcemanager/hdinsight/armhdinsight/virtualmachines_client.go @@ -3,9 +3,8 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. package armhdinsight @@ -48,25 +47,28 @@ 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 2023-04-15-preview +// Generated from API version 2023-08-15-preview // - resourceGroupName - The name of the resource group. // - clusterName - The name of the cluster. // - operationID - The long running operation id. // - options - VirtualMachinesClientGetAsyncOperationStatusOptions contains the optional parameters for the VirtualMachinesClient.GetAsyncOperationStatus // method. func (client *VirtualMachinesClient) GetAsyncOperationStatus(ctx context.Context, resourceGroupName string, clusterName string, operationID string, options *VirtualMachinesClientGetAsyncOperationStatusOptions) (VirtualMachinesClientGetAsyncOperationStatusResponse, error) { + var err error req, err := client.getAsyncOperationStatusCreateRequest(ctx, resourceGroupName, clusterName, operationID, options) if err != nil { return VirtualMachinesClientGetAsyncOperationStatusResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return VirtualMachinesClientGetAsyncOperationStatusResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return VirtualMachinesClientGetAsyncOperationStatusResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return VirtualMachinesClientGetAsyncOperationStatusResponse{}, err } - return client.getAsyncOperationStatusHandleResponse(resp) + resp, err := client.getAsyncOperationStatusHandleResponse(httpResp) + return resp, err } // getAsyncOperationStatusCreateRequest creates the GetAsyncOperationStatus request. @@ -93,7 +95,7 @@ func (client *VirtualMachinesClient) getAsyncOperationStatusCreateRequest(ctx co return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-04-15-preview") + reqQP.Set("api-version", "2023-08-15-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -111,24 +113,27 @@ 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 2023-04-15-preview +// Generated from API version 2023-08-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 // method. func (client *VirtualMachinesClient) ListHosts(ctx context.Context, resourceGroupName string, clusterName string, options *VirtualMachinesClientListHostsOptions) (VirtualMachinesClientListHostsResponse, error) { + var err error req, err := client.listHostsCreateRequest(ctx, resourceGroupName, clusterName, options) if err != nil { return VirtualMachinesClientListHostsResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return VirtualMachinesClientListHostsResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return VirtualMachinesClientListHostsResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return VirtualMachinesClientListHostsResponse{}, err } - return client.listHostsHandleResponse(resp) + resp, err := client.listHostsHandleResponse(httpResp) + return resp, err } // listHostsCreateRequest creates the ListHosts request. @@ -151,7 +156,7 @@ func (client *VirtualMachinesClient) listHostsCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-04-15-preview") + reqQP.Set("api-version", "2023-08-15-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -169,7 +174,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 2023-04-15-preview +// Generated from API version 2023-08-15-preview // - resourceGroupName - The name of the resource group. // - clusterName - The name of the cluster. // - hosts - The list of hosts to restart @@ -181,9 +186,10 @@ func (client *VirtualMachinesClient) BeginRestartHosts(ctx context.Context, reso if err != nil { return nil, err } - return runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[VirtualMachinesClientRestartHostsResponse]{ + poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[VirtualMachinesClientRestartHostsResponse]{ FinalStateVia: runtime.FinalStateViaLocation, }) + return poller, err } else { return runtime.NewPollerFromResumeToken[VirtualMachinesClientRestartHostsResponse](options.ResumeToken, client.internal.Pipeline(), nil) } @@ -192,20 +198,22 @@ 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 2023-04-15-preview +// Generated from API version 2023-08-15-preview func (client *VirtualMachinesClient) restartHosts(ctx context.Context, resourceGroupName string, clusterName string, hosts []*string, options *VirtualMachinesClientBeginRestartHostsOptions) (*http.Response, error) { + var err error req, err := client.restartHostsCreateRequest(ctx, resourceGroupName, clusterName, hosts, options) if err != nil { return nil, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return nil, err } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted) { - return nil, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted) { + err = runtime.NewResponseError(httpResp) + return nil, err } - return resp, nil + return httpResp, nil } // restartHostsCreateRequest creates the RestartHosts request. @@ -228,8 +236,11 @@ func (client *VirtualMachinesClient) restartHostsCreateRequest(ctx context.Conte return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-04-15-preview") + reqQP.Set("api-version", "2023-08-15-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, hosts) + if err := runtime.MarshalAsJSON(req, hosts); err != nil { + return nil, err + } + return req, nil } 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 9188f9cce718..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/310a0100f5b020c1900c527a6aa70d21992f078a/specification/hdinsight/resource-manager/Microsoft.HDInsight/preview/2023-04-15-preview/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/310a0100f5b020c1900c527a6aa70d21992f078a/specification/hdinsight/resource-manager/Microsoft.HDInsight/preview/2023-04-15-preview/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/310a0100f5b020c1900c527a6aa70d21992f078a/specification/hdinsight/resource-manager/Microsoft.HDInsight/preview/2023-04-15-preview/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), - // } -}