diff --git a/sdk/resourcemanager/hdinsight/armhdinsight/CHANGELOG.md b/sdk/resourcemanager/hdinsight/armhdinsight/CHANGELOG.md index feb166d6cd62..91314f903fba 100644 --- a/sdk/resourcemanager/hdinsight/armhdinsight/CHANGELOG.md +++ b/sdk/resourcemanager/hdinsight/armhdinsight/CHANGELOG.md @@ -1,5 +1,21 @@ # Release History +## 1.3.0-beta.4 (2026-02-10) +### Breaking Changes + +- Struct `ClusterListPersistedScriptActionsResult` has been removed +- Struct `ScriptActionPersistedGetResponseSpec` has been removed + +### Features Added + +- New struct `ErrorAdditionalInfo` +- New struct `ErrorDetail` +- New struct `ErrorResponseAutoGenerated` +- New field `SystemData` in struct `ProxyResource` +- New field `SystemData` in struct `Resource` +- New field `SystemData` in struct `TrackedResource` + + ## 1.3.0-beta.3 (2025-10-23) ### Features Added diff --git a/sdk/resourcemanager/hdinsight/armhdinsight/applications_client.go b/sdk/resourcemanager/hdinsight/armhdinsight/applications_client.go index cfc7b30268d8..7eb311cb9af8 100644 --- a/sdk/resourcemanager/hdinsight/armhdinsight/applications_client.go +++ b/sdk/resourcemanager/hdinsight/armhdinsight/applications_client.go @@ -25,10 +25,9 @@ type ApplicationsClient struct { } // NewApplicationsClient creates a new instance of ApplicationsClient with the specified values. -// - subscriptionID - The subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID -// forms part of the URI for every service call. +// - subscriptionID - The ID of the target subscription. // - credential - used to authorize requests. Usually a credential from azidentity. -// - options - pass nil to accept the default values. +// - options - Contains optional client configuration. Pass nil to accept the default values. func NewApplicationsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*ApplicationsClient, error) { cl, err := arm.NewClient(moduleName, moduleVersion, credential, options) if err != nil { @@ -45,7 +44,7 @@ func NewApplicationsClient(subscriptionID string, credential azcore.TokenCredent // If the operation fails it returns an *azcore.ResponseError type. // // Generated from API version 2025-01-15-preview -// - resourceGroupName - The name of the resource group. +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - clusterName - The name of the cluster. // - applicationName - The constant value for the application name. // - parameters - The application create request. @@ -131,7 +130,7 @@ func (client *ApplicationsClient) createCreateRequest(ctx context.Context, resou // If the operation fails it returns an *azcore.ResponseError type. // // Generated from API version 2025-01-15-preview -// - resourceGroupName - The name of the resource group. +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - clusterName - The name of the cluster. // - applicationName - The constant value for the application name. // - options - ApplicationsClientBeginDeleteOptions contains the optional parameters for the ApplicationsClient.BeginDelete @@ -213,7 +212,7 @@ func (client *ApplicationsClient) deleteCreateRequest(ctx context.Context, resou // If the operation fails it returns an *azcore.ResponseError type. // // Generated from API version 2025-01-15-preview -// - resourceGroupName - The name of the resource group. +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - 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. @@ -282,7 +281,7 @@ func (client *ApplicationsClient) getHandleResponse(resp *http.Response) (Applic // If the operation fails it returns an *azcore.ResponseError type. // // Generated from API version 2025-01-15-preview -// - resourceGroupName - The name of the resource group. +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - clusterName - The name of the cluster. // - applicationName - The constant value for the application name. // - operationID - The long running operation id. @@ -356,7 +355,7 @@ func (client *ApplicationsClient) getAzureAsyncOperationStatusHandleResponse(res // NewListByClusterPager - Lists all of the applications for the HDInsight cluster. // // Generated from API version 2025-01-15-preview -// - resourceGroupName - The name of the resource group. +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - clusterName - The name of the cluster. // - options - ApplicationsClientListByClusterOptions contains the optional parameters for the ApplicationsClient.NewListByClusterPager // method. diff --git a/sdk/resourcemanager/hdinsight/armhdinsight/applications_client_example_test.go b/sdk/resourcemanager/hdinsight/armhdinsight/applications_client_example_test.go index 75d94ded8769..273c60715078 100644 --- a/sdk/resourcemanager/hdinsight/armhdinsight/applications_client_example_test.go +++ b/sdk/resourcemanager/hdinsight/armhdinsight/applications_client_example_test.go @@ -1,8 +1,7 @@ // 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_test @@ -15,7 +14,7 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/hdinsight/armhdinsight" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/8a9dbb28e788355a47dc5bad3ea5f8da212b4bf6/specification/hdinsight/resource-manager/Microsoft.HDInsight/preview/2025-01-15-preview/examples/GetAllApplications.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/6312b1c8676b0973f86f078c1177dcb7510158df/specification/hdinsight/resource-manager/Microsoft.HDInsight/HDInsight/preview/2025-01-15-preview/examples/GetAllApplications.json func ExampleApplicationsClient_NewListByClusterPager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -137,7 +136,7 @@ func ExampleApplicationsClient_NewListByClusterPager() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/8a9dbb28e788355a47dc5bad3ea5f8da212b4bf6/specification/hdinsight/resource-manager/Microsoft.HDInsight/preview/2025-01-15-preview/examples/GetApplicationInProgress.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/6312b1c8676b0973f86f078c1177dcb7510158df/specification/hdinsight/resource-manager/Microsoft.HDInsight/HDInsight/preview/2025-01-15-preview/examples/GetApplicationInProgress.json func ExampleApplicationsClient_Get_getApplicationOnHdInsightClusterCreationInProgress() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -202,7 +201,7 @@ func ExampleApplicationsClient_Get_getApplicationOnHdInsightClusterCreationInPro // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/8a9dbb28e788355a47dc5bad3ea5f8da212b4bf6/specification/hdinsight/resource-manager/Microsoft.HDInsight/preview/2025-01-15-preview/examples/GetApplicationCreated.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/6312b1c8676b0973f86f078c1177dcb7510158df/specification/hdinsight/resource-manager/Microsoft.HDInsight/HDInsight/preview/2025-01-15-preview/examples/GetApplicationCreated.json func ExampleApplicationsClient_Get_getApplicationOnHdInsightClusterSuccessfullyCreated() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -271,7 +270,7 @@ func ExampleApplicationsClient_Get_getApplicationOnHdInsightClusterSuccessfullyC // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/8a9dbb28e788355a47dc5bad3ea5f8da212b4bf6/specification/hdinsight/resource-manager/Microsoft.HDInsight/preview/2025-01-15-preview/examples/CreateApplication.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/6312b1c8676b0973f86f078c1177dcb7510158df/specification/hdinsight/resource-manager/Microsoft.HDInsight/HDInsight/preview/2025-01-15-preview/examples/CreateApplication.json func ExampleApplicationsClient_BeginCreate() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -369,7 +368,7 @@ func ExampleApplicationsClient_BeginCreate() { // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/8a9dbb28e788355a47dc5bad3ea5f8da212b4bf6/specification/hdinsight/resource-manager/Microsoft.HDInsight/preview/2025-01-15-preview/examples/DeleteApplication.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/6312b1c8676b0973f86f078c1177dcb7510158df/specification/hdinsight/resource-manager/Microsoft.HDInsight/HDInsight/preview/2025-01-15-preview/examples/DeleteApplication.json func ExampleApplicationsClient_BeginDelete() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -390,7 +389,7 @@ func ExampleApplicationsClient_BeginDelete() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/8a9dbb28e788355a47dc5bad3ea5f8da212b4bf6/specification/hdinsight/resource-manager/Microsoft.HDInsight/preview/2025-01-15-preview/examples/GetApplicationCreationAsyncOperationStatus.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/6312b1c8676b0973f86f078c1177dcb7510158df/specification/hdinsight/resource-manager/Microsoft.HDInsight/HDInsight/preview/2025-01-15-preview/examples/GetApplicationCreationAsyncOperationStatus.json func ExampleApplicationsClient_GetAzureAsyncOperationStatus() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { diff --git a/sdk/resourcemanager/hdinsight/armhdinsight/autorest.md b/sdk/resourcemanager/hdinsight/armhdinsight/autorest.md index 1875f66c12c5..3d378415648c 100644 --- a/sdk/resourcemanager/hdinsight/armhdinsight/autorest.md +++ b/sdk/resourcemanager/hdinsight/armhdinsight/autorest.md @@ -5,10 +5,12 @@ ``` yaml azure-arm: true require: -- https://github.com/Azure/azure-rest-api-specs/blob/8a9dbb28e788355a47dc5bad3ea5f8da212b4bf6/specification/hdinsight/resource-manager/readme.md -- https://github.com/Azure/azure-rest-api-specs/blob/8a9dbb28e788355a47dc5bad3ea5f8da212b4bf6/specification/hdinsight/resource-manager/readme.go.md +- https://github.com/Azure/azure-rest-api-specs/blob/6312b1c8676b0973f86f078c1177dcb7510158df/specification/hdinsight/resource-manager/Microsoft.HDInsight/HDInsight/readme.md +- https://github.com/Azure/azure-rest-api-specs/blob/6312b1c8676b0973f86f078c1177dcb7510158df/specification/hdinsight/resource-manager/Microsoft.HDInsight/HDInsight/readme.go.md license-header: MICROSOFT_MIT_NO_VERSION -module-version: 1.3.0-beta.3 +module-version: 1.3.0-beta.4 +modelerfour: + lenient-model-deduplication: true directive: - from: cluster.json where: $.definitions.Resource diff --git a/sdk/resourcemanager/hdinsight/armhdinsight/client_factory.go b/sdk/resourcemanager/hdinsight/armhdinsight/client_factory.go index af10a47b9149..d2c97fb250aa 100644 --- a/sdk/resourcemanager/hdinsight/armhdinsight/client_factory.go +++ b/sdk/resourcemanager/hdinsight/armhdinsight/client_factory.go @@ -19,8 +19,7 @@ type ClientFactory struct { // NewClientFactory creates a new instance of ClientFactory with the specified values. // The parameter values will be propagated to any client created from this factory. -// - subscriptionID - The subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID -// forms part of the URI for every service call. +// - subscriptionID - The ID of the target subscription. // - credential - used to authorize requests. Usually a credential from azidentity. // - options - pass nil to accept the default values. func NewClientFactory(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*ClientFactory, error) { diff --git a/sdk/resourcemanager/hdinsight/armhdinsight/clusters_client.go b/sdk/resourcemanager/hdinsight/armhdinsight/clusters_client.go index c3abd9c9b1fd..7c79ea8b6c37 100644 --- a/sdk/resourcemanager/hdinsight/armhdinsight/clusters_client.go +++ b/sdk/resourcemanager/hdinsight/armhdinsight/clusters_client.go @@ -25,10 +25,9 @@ type ClustersClient struct { } // NewClustersClient creates a new instance of ClustersClient with the specified values. -// - subscriptionID - The subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID -// forms part of the URI for every service call. +// - subscriptionID - The ID of the target subscription. // - credential - used to authorize requests. Usually a credential from azidentity. -// - options - pass nil to accept the default values. +// - options - Contains optional client configuration. Pass nil to accept the default values. func NewClustersClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*ClustersClient, error) { cl, err := arm.NewClient(moduleName, moduleVersion, credential, options) if err != nil { @@ -45,7 +44,7 @@ func NewClustersClient(subscriptionID string, credential azcore.TokenCredential, // If the operation fails it returns an *azcore.ResponseError type. // // Generated from API version 2025-01-15-preview -// - resourceGroupName - The name of the resource group. +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - clusterName - The name of the cluster. // - parameters - The cluster create request. // - options - ClustersClientBeginCreateOptions contains the optional parameters for the ClustersClient.BeginCreate method. @@ -125,7 +124,7 @@ func (client *ClustersClient) createCreateRequest(ctx context.Context, resourceG // If the operation fails it returns an *azcore.ResponseError type. // // Generated from API version 2025-01-15-preview -// - resourceGroupName - The name of the resource group. +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - clusterName - The name of the cluster. // - options - ClustersClientBeginDeleteOptions contains the optional parameters for the ClustersClient.BeginDelete method. func (client *ClustersClient) BeginDelete(ctx context.Context, resourceGroupName string, clusterName string, options *ClustersClientBeginDeleteOptions) (*runtime.Poller[ClustersClientDeleteResponse], error) { @@ -201,7 +200,7 @@ func (client *ClustersClient) deleteCreateRequest(ctx context.Context, resourceG // If the operation fails it returns an *azcore.ResponseError type. // // Generated from API version 2025-01-15-preview -// - resourceGroupName - The name of the resource group. +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - clusterName - The name of the cluster. // - parameters - The parameters for executing script actions. // - options - ClustersClientBeginExecuteScriptActionsOptions contains the optional parameters for the ClustersClient.BeginExecuteScriptActions @@ -282,7 +281,7 @@ func (client *ClustersClient) executeScriptActionsCreateRequest(ctx context.Cont // If the operation fails it returns an *azcore.ResponseError type. // // Generated from API version 2025-01-15-preview -// - resourceGroupName - The name of the resource group. +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - 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) { @@ -346,7 +345,7 @@ func (client *ClustersClient) getHandleResponse(resp *http.Response) (ClustersCl // If the operation fails it returns an *azcore.ResponseError type. // // Generated from API version 2025-01-15-preview -// - resourceGroupName - The name of the resource group. +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - clusterName - The name of the cluster. // - operationID - The long running operation id. // - options - ClustersClientGetAzureAsyncOperationStatusOptions contains the optional parameters for the ClustersClient.GetAzureAsyncOperationStatus @@ -416,7 +415,7 @@ func (client *ClustersClient) getAzureAsyncOperationStatusHandleResponse(resp *h // If the operation fails it returns an *azcore.ResponseError type. // // Generated from API version 2025-01-15-preview -// - resourceGroupName - The name of the resource group. +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - clusterName - The name of the cluster. // - options - ClustersClientGetGatewaySettingsOptions contains the optional parameters for the ClustersClient.GetGatewaySettings // method. @@ -534,7 +533,7 @@ func (client *ClustersClient) listHandleResponse(resp *http.Response) (ClustersC // NewListByResourceGroupPager - Lists the HDInsight clusters in a resource group. // // Generated from API version 2025-01-15-preview -// - resourceGroupName - The name of the resource group. +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - options - ClustersClientListByResourceGroupOptions contains the optional parameters for the ClustersClient.NewListByResourceGroupPager // method. func (client *ClustersClient) NewListByResourceGroupPager(resourceGroupName string, options *ClustersClientListByResourceGroupOptions) *runtime.Pager[ClustersClientListByResourceGroupResponse] { @@ -595,7 +594,7 @@ func (client *ClustersClient) listByResourceGroupHandleResponse(resp *http.Respo // If the operation fails it returns an *azcore.ResponseError type. // // Generated from API version 2025-01-15-preview -// - resourceGroupName - The name of the resource group. +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - clusterName - The name of the cluster. // - roleName - The constant value for the roleName // - parameters - The parameters for the resize operation. @@ -680,7 +679,7 @@ func (client *ClustersClient) resizeCreateRequest(ctx context.Context, resourceG // If the operation fails it returns an *azcore.ResponseError type. // // Generated from API version 2025-01-15-preview -// - resourceGroupName - The name of the resource group. +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - clusterName - The name of the cluster. // - parameters - The parameters for the disk encryption operation. // - options - ClustersClientBeginRotateDiskEncryptionKeyOptions contains the optional parameters for the ClustersClient.BeginRotateDiskEncryptionKey @@ -761,7 +760,7 @@ func (client *ClustersClient) rotateDiskEncryptionKeyCreateRequest(ctx context.C // If the operation fails it returns an *azcore.ResponseError type. // // Generated from API version 2025-01-15-preview -// - resourceGroupName - The name of the resource group. +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - clusterName - The name of the cluster. // - parameters - The cluster patch request. // - options - ClustersClientUpdateOptions contains the optional parameters for the ClustersClient.Update method. @@ -829,7 +828,7 @@ func (client *ClustersClient) updateHandleResponse(resp *http.Response) (Cluster // If the operation fails it returns an *azcore.ResponseError type. // // Generated from API version 2025-01-15-preview -// - resourceGroupName - The name of the resource group. +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - clusterName - The name of the cluster. // - roleName - The constant value for the roleName // - parameters - The parameters for the update autoscale configuration operation. @@ -915,7 +914,7 @@ func (client *ClustersClient) updateAutoScaleConfigurationCreateRequest(ctx cont // If the operation fails it returns an *azcore.ResponseError type. // // Generated from API version 2025-01-15-preview -// - resourceGroupName - The name of the resource group. +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - clusterName - The name of the cluster. // - parameters - The cluster configurations. // - options - ClustersClientBeginUpdateGatewaySettingsOptions contains the optional parameters for the ClustersClient.BeginUpdateGatewaySettings @@ -996,7 +995,7 @@ func (client *ClustersClient) updateGatewaySettingsCreateRequest(ctx context.Con // If the operation fails it returns an *azcore.ResponseError type. // // Generated from API version 2025-01-15-preview -// - resourceGroupName - The name of the resource group. +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - clusterName - The name of the cluster. // - parameters - The cluster configurations. // - options - ClustersClientBeginUpdateIdentityCertificateOptions contains the optional parameters for the ClustersClient.BeginUpdateIdentityCertificate diff --git a/sdk/resourcemanager/hdinsight/armhdinsight/clusters_client_example_test.go b/sdk/resourcemanager/hdinsight/armhdinsight/clusters_client_example_test.go index c3c90cc91c39..d8b257f189ae 100644 --- a/sdk/resourcemanager/hdinsight/armhdinsight/clusters_client_example_test.go +++ b/sdk/resourcemanager/hdinsight/armhdinsight/clusters_client_example_test.go @@ -1,8 +1,7 @@ // 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_test @@ -15,207 +14,8 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/hdinsight/armhdinsight" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/8a9dbb28e788355a47dc5bad3ea5f8da212b4bf6/specification/hdinsight/resource-manager/Microsoft.HDInsight/preview/2025-01-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/8a9dbb28e788355a47dc5bad3ea5f8da212b4bf6/specification/hdinsight/resource-manager/Microsoft.HDInsight/preview/2025-01-15-preview/examples/CreateLinuxHadoopAdlsGen2.json -func ExampleClustersClient_BeginCreate_createHadoopClusterWithAzureDataLakeStorageGen2() { +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/6312b1c8676b0973f86f078c1177dcb7510158df/specification/hdinsight/resource-manager/Microsoft.HDInsight/HDInsight/preview/2025-01-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) @@ -225,172 +25,179 @@ func ExampleClustersClient_BeginCreate_createHadoopClusterWithAzureDataLakeStora 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), - // }, - // } + 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/8a9dbb28e788355a47dc5bad3ea5f8da212b4bf6/specification/hdinsight/resource-manager/Microsoft.HDInsight/preview/2025-01-15-preview/examples/CreateLinuxHadoopSshPassword.json -func ExampleClustersClient_BeginCreate_createHadoopOnLinuxClusterWithSshPassword() { +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/6312b1c8676b0973f86f078c1177dcb7510158df/specification/hdinsight/resource-manager/Microsoft.HDInsight/HDInsight/preview/2025-01-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) @@ -400,172 +207,179 @@ func ExampleClustersClient_BeginCreate_createHadoopOnLinuxClusterWithSshPassword 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) + 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), + // }, + // }}, + // } } - // 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/8a9dbb28e788355a47dc5bad3ea5f8da212b4bf6/specification/hdinsight/resource-manager/Microsoft.HDInsight/preview/2025-01-15-preview/examples/CreateLinuxHadoopSshPublicKey.json -func ExampleClustersClient_BeginCreate_createHadoopOnLinuxClusterWithSshPublicKey() { +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/6312b1c8676b0973f86f078c1177dcb7510158df/specification/hdinsight/resource-manager/Microsoft.HDInsight/HDInsight/preview/2025-01-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) @@ -575,118 +389,35 @@ func ExampleClustersClient_BeginCreate_createHadoopOnLinuxClusterWithSshPublicKe 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) + res, err := clientFactory.NewClustersClient().Get(ctx, "rg1", "cluster1", 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"), + // 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-4.0.1000.1.1910270459.json"), - // ComponentVersion: map[string]*string{ - // "Hadoop": to.Ptr("3.1"), - // }, - // Kind: to.Ptr("HADOOP"), + // 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("4.0.1000.1"), + // 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"), + // VMSize: to.Ptr("Standard_D3_V2"), // }, // OSProfile: &armhdinsight.OsProfile{ // LinuxOperatingSystemProfile: &armhdinsight.LinuxOperatingSystemProfile{ @@ -698,7 +429,7 @@ func ExampleClustersClient_BeginCreate_createHadoopOnLinuxClusterWithSshPublicKe // { // Name: to.Ptr("workernode"), // HardwareProfile: &armhdinsight.HardwareProfile{ - // VMSize: to.Ptr("standard_d4_v2"), + // VMSize: to.Ptr("Standard_D3_V2"), // }, // OSProfile: &armhdinsight.OsProfile{ // LinuxOperatingSystemProfile: &armhdinsight.LinuxOperatingSystemProfile{ @@ -710,7 +441,7 @@ func ExampleClustersClient_BeginCreate_createHadoopOnLinuxClusterWithSshPublicKe // { // Name: to.Ptr("zookeepernode"), // HardwareProfile: &armhdinsight.HardwareProfile{ - // VMSize: to.Ptr("standard_a2_v2"), + // VMSize: to.Ptr("Medium"), // }, // OSProfile: &armhdinsight.OsProfile{ // LinuxOperatingSystemProfile: &armhdinsight.LinuxOperatingSystemProfile{ @@ -733,19 +464,19 @@ func ExampleClustersClient_BeginCreate_createHadoopOnLinuxClusterWithSshPublicKe // Port: to.Ptr[int32](443), // Protocol: to.Ptr("TCP"), // }}, - // CreatedDate: to.Ptr("2019-11-18T12:25:43.48"), + // 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](40), + // CoresUsed: to.Ptr[int32](24), // }, // Tier: to.Ptr(armhdinsight.TierStandard), // }, // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/8a9dbb28e788355a47dc5bad3ea5f8da212b4bf6/specification/hdinsight/resource-manager/Microsoft.HDInsight/preview/2025-01-15-preview/examples/CreateKafkaClusterWithKafkaRestProxy.json -func ExampleClustersClient_BeginCreate_createKafkaClusterWithKafkaRestProxy() { +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/6312b1c8676b0973f86f078c1177dcb7510158df/specification/hdinsight/resource-manager/Microsoft.HDInsight/HDInsight/preview/2025-01-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) @@ -755,133 +486,38 @@ func ExampleClustersClient_BeginCreate_createKafkaClusterWithKafkaRestProxy() { 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) + res, err := clientFactory.NewClustersClient().Get(ctx, "rg1", "cluster1", 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"), + // 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/kafka-4.0.1000.1.1911212244.json"), + // Blueprint: to.Ptr("https://blueprints.azurehdinsight.net/spark-3.5.1000.0.9625065.json"), // ComponentVersion: map[string]*string{ - // "Kafka": to.Ptr("2.1"), + // "Spark": to.Ptr("2.0"), // }, - // Kind: to.Ptr("KAFKA"), + // Kind: to.Ptr("SPARK"), // }, // ClusterState: to.Ptr("Running"), - // ClusterVersion: to.Ptr("4.0.1000.1"), + // 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"), + // VMSize: to.Ptr("Standard_D12_V2"), // }, // OSProfile: &armhdinsight.OsProfile{ // LinuxOperatingSystemProfile: &armhdinsight.LinuxOperatingSystemProfile{ @@ -892,14 +528,8 @@ func ExampleClustersClient_BeginCreate_createKafkaClusterWithKafkaRestProxy() { // }, // { // 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"), + // VMSize: to.Ptr("Standard_D4_V2"), // }, // OSProfile: &armhdinsight.OsProfile{ // LinuxOperatingSystemProfile: &armhdinsight.LinuxOperatingSystemProfile{ @@ -909,21 +539,9 @@ func ExampleClustersClient_BeginCreate_createKafkaClusterWithKafkaRestProxy() { // 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"), + // VMSize: to.Ptr("Medium"), // }, // OSProfile: &armhdinsight.OsProfile{ // LinuxOperatingSystemProfile: &armhdinsight.LinuxOperatingSystemProfile{ @@ -945,32 +563,20 @@ func ExampleClustersClient_BeginCreate_createKafkaClusterWithKafkaRestProxy() { // 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"), - // }, - // }, + // 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](52), + // CoresUsed: to.Ptr[int32](40), // }, // Tier: to.Ptr(armhdinsight.TierStandard), // }, // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/8a9dbb28e788355a47dc5bad3ea5f8da212b4bf6/specification/hdinsight/resource-manager/Microsoft.HDInsight/preview/2025-01-15-preview/examples/CreateLinuxHadoopSecureHadoop.json -func ExampleClustersClient_BeginCreate_createSecureHadoopCluster() { +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/6312b1c8676b0973f86f078c1177dcb7510158df/specification/hdinsight/resource-manager/Microsoft.HDInsight/HDInsight/preview/2025-01-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) @@ -983,6 +589,9 @@ func ExampleClustersClient_BeginCreate_createSecureHadoopCluster() { 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, @@ -990,113 +599,90 @@ func ExampleClustersClient_BeginCreate_createSecureHadoopCluster() { "restAuthCredential.username": "admin", }, }, - Kind: to.Ptr("Hadoop"), + Kind: to.Ptr("hadoop"), }, - ClusterVersion: to.Ptr("3.5"), + 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("**********"), - 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"), + 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"), }, }, - 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"), + VMSize: to.Ptr("Standard_D4_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](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"), - }, + TargetInstanceCount: to.Ptr[int32](4), }}, }, 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"), + Container: to.Ptr("hdinsight-autoscale-tes-2019-06-18t05-49-16-591z"), EnableSecureChannel: to.Ptr(true), IsDefault: to.Ptr(true), - Key: to.Ptr("storage account key"), + Key: to.Ptr("storagekey"), }}, }, - Tier: to.Ptr(armhdinsight.TierPremium), - }, - Tags: map[string]*string{ - "key1": to.Ptr("val1"), + Tier: to.Ptr(armhdinsight.TierStandard), }, }, nil) if err != nil { @@ -1188,8 +774,8 @@ func ExampleClustersClient_BeginCreate_createSecureHadoopCluster() { // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/8a9dbb28e788355a47dc5bad3ea5f8da212b4bf6/specification/hdinsight/resource-manager/Microsoft.HDInsight/preview/2025-01-15-preview/examples/CreateLinuxSparkSshPassword.json -func ExampleClustersClient_BeginCreate_createSparkOnLinuxClusterWithSshPassword() { +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/6312b1c8676b0973f86f078c1177dcb7510158df/specification/hdinsight/resource-manager/Microsoft.HDInsight/HDInsight/preview/2025-01-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) @@ -1202,25 +788,22 @@ func ExampleClustersClient_BeginCreate_createSparkOnLinuxClusterWithSshPassword( 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.isEnabled": "true", "restAuthCredential.password": "**********", "restAuthCredential.username": "admin", }, }, - Kind: to.Ptr("Spark"), + Kind: to.Ptr("Hadoop"), }, - ClusterVersion: to.Ptr("3.5"), + ClusterVersion: to.Ptr("3.6"), ComputeProfile: &armhdinsight.ComputeProfile{ Roles: []*armhdinsight.Role{ { Name: to.Ptr("headnode"), HardwareProfile: &armhdinsight.HardwareProfile{ - VMSize: to.Ptr("Standard_D12_V2"), + VMSize: to.Ptr("Standard_D3_V2"), }, MinInstanceCount: to.Ptr[int32](1), OSProfile: &armhdinsight.OsProfile{ @@ -1234,7 +817,7 @@ func ExampleClustersClient_BeginCreate_createSparkOnLinuxClusterWithSshPassword( { Name: to.Ptr("workernode"), HardwareProfile: &armhdinsight.HardwareProfile{ - VMSize: to.Ptr("Standard_D4_V2"), + VMSize: to.Ptr("Standard_D3_V2"), }, MinInstanceCount: to.Ptr[int32](1), OSProfile: &armhdinsight.OsProfile{ @@ -1244,17 +827,31 @@ func ExampleClustersClient_BeginCreate_createSparkOnLinuxClusterWithSshPassword( }, }, 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"), + Name: to.Ptr("mystorage.dfs.core.windows.net"), EnableSecureChannel: to.Ptr(true), + FileSystem: to.Ptr("default"), IsDefault: to.Ptr(true), - Key: to.Ptr("storageapikey*"), + Key: to.Ptr("storagekey"), }}, }, Tier: to.Ptr(armhdinsight.TierStandard), @@ -1285,7 +882,7 @@ func ExampleClustersClient_BeginCreate_createSparkOnLinuxClusterWithSshPassword( // ComponentVersion: map[string]*string{ // "Hadoop": to.Ptr("3.1"), // }, - // Kind: to.Ptr("SPARK"), + // Kind: to.Ptr("HADOOP"), // }, // ClusterState: to.Ptr("Running"), // ClusterVersion: to.Ptr("4.0.1000.1"), @@ -1352,8 +949,8 @@ func ExampleClustersClient_BeginCreate_createSparkOnLinuxClusterWithSshPassword( // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/8a9dbb28e788355a47dc5bad3ea5f8da212b4bf6/specification/hdinsight/resource-manager/Microsoft.HDInsight/preview/2025-01-15-preview/examples/CreateHDInsightClusterWithEntraUser.json -func ExampleClustersClient_BeginCreate_createClusterWithEntraUser() { +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/6312b1c8676b0973f86f078c1177dcb7510158df/specification/hdinsight/resource-manager/Microsoft.HDInsight/HDInsight/preview/2025-01-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) @@ -1368,26 +965,22 @@ func ExampleClustersClient_BeginCreate_createClusterWithEntraUser() { ClusterDefinition: &armhdinsight.ClusterDefinition{ Configurations: map[string]any{ "gateway": map[string]any{ - "restAuthCredential.isEnabled": false, - "restAuthEntraUsers": []any{ - map[string]any{ - "displayName": "displayName", - "objectId": "00000000-0000-0000-0000-000000000000", - "upn": "user@microsoft.com", - }, - }, + "restAuthCredential.isEnabled": "true", + "restAuthCredential.password": "**********", + "restAuthCredential.username": "admin", }, }, Kind: to.Ptr("Hadoop"), }, - ClusterVersion: to.Ptr("5.1"), + ClusterVersion: to.Ptr("3.5"), ComputeProfile: &armhdinsight.ComputeProfile{ Roles: []*armhdinsight.Role{ { Name: to.Ptr("headnode"), HardwareProfile: &armhdinsight.HardwareProfile{ - VMSize: to.Ptr("Standard_E8_V3"), + VMSize: to.Ptr("Standard_D3_V2"), }, + MinInstanceCount: to.Ptr[int32](1), OSProfile: &armhdinsight.OsProfile{ LinuxOperatingSystemProfile: &armhdinsight.LinuxOperatingSystemProfile{ Password: to.Ptr("**********"), @@ -1399,21 +992,23 @@ func ExampleClustersClient_BeginCreate_createClusterWithEntraUser() { { Name: to.Ptr("workernode"), HardwareProfile: &armhdinsight.HardwareProfile{ - VMSize: to.Ptr("Standard_E8_V3"), + 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](3), + TargetInstanceCount: to.Ptr[int32](4), }, { Name: to.Ptr("zookeepernode"), HardwareProfile: &armhdinsight.HardwareProfile{ - VMSize: to.Ptr("Standard_E8_V3"), + VMSize: to.Ptr("Small"), }, + MinInstanceCount: to.Ptr[int32](1), OSProfile: &armhdinsight.OsProfile{ LinuxOperatingSystemProfile: &armhdinsight.LinuxOperatingSystemProfile{ Password: to.Ptr("**********"), @@ -1436,6 +1031,9 @@ func ExampleClustersClient_BeginCreate_createClusterWithEntraUser() { }, 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) @@ -1451,24 +1049,24 @@ func ExampleClustersClient_BeginCreate_createClusterWithEntraUser() { // 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 Asia"), - // Etag: to.Ptr("ebd5623e-21a6-4968-aba6-f0a3c028b30e"), + // 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-5.1.3000.0.2504170544.json"), + // Blueprint: to.Ptr("https://blueprints.azurehdinsight.net/hadoop-4.0.1000.1.1910270459.json"), // ComponentVersion: map[string]*string{ - // "Hadoop": to.Ptr("3.3"), + // "Hadoop": to.Ptr("3.1"), // }, - // Kind: to.Ptr("Hadoop"), + // Kind: to.Ptr("HADOOP"), // }, // ClusterState: to.Ptr("Running"), - // ClusterVersion: to.Ptr("5.1.3000.0"), + // ClusterVersion: to.Ptr("4.0.1000.1"), // ComputeProfile: &armhdinsight.ComputeProfile{ // Roles: []*armhdinsight.Role{ // { // Name: to.Ptr("headnode"), // HardwareProfile: &armhdinsight.HardwareProfile{ - // VMSize: to.Ptr("Standard_E8_V3"), + // VMSize: to.Ptr("standard_d12_v2"), // }, // OSProfile: &armhdinsight.OsProfile{ // LinuxOperatingSystemProfile: &armhdinsight.LinuxOperatingSystemProfile{ @@ -1480,19 +1078,19 @@ func ExampleClustersClient_BeginCreate_createClusterWithEntraUser() { // { // Name: to.Ptr("workernode"), // HardwareProfile: &armhdinsight.HardwareProfile{ - // VMSize: to.Ptr("Standard_E8_V3"), + // VMSize: to.Ptr("standard_d4_v2"), // }, // OSProfile: &armhdinsight.OsProfile{ // LinuxOperatingSystemProfile: &armhdinsight.LinuxOperatingSystemProfile{ // Username: to.Ptr("sshuser"), // }, // }, - // TargetInstanceCount: to.Ptr[int32](3), + // TargetInstanceCount: to.Ptr[int32](4), // }, // { // Name: to.Ptr("zookeepernode"), // HardwareProfile: &armhdinsight.HardwareProfile{ - // VMSize: to.Ptr("Standard_E8_V3"), + // VMSize: to.Ptr("standard_a2_v2"), // }, // OSProfile: &armhdinsight.OsProfile{ // LinuxOperatingSystemProfile: &armhdinsight.LinuxOperatingSystemProfile{ @@ -1515,7 +1113,7 @@ func ExampleClustersClient_BeginCreate_createClusterWithEntraUser() { // Port: to.Ptr[int32](443), // Protocol: to.Ptr("TCP"), // }}, - // CreatedDate: to.Ptr("2025-05-08T08:07:09.813"), + // CreatedDate: to.Ptr("2019-11-18T12:25:43.48"), // OSType: to.Ptr(armhdinsight.OSTypeLinux), // ProvisioningState: to.Ptr(armhdinsight.HDInsightClusterProvisioningStateSucceeded), // QuotaInfo: &armhdinsight.QuotaInfo{ @@ -1526,8 +1124,8 @@ func ExampleClustersClient_BeginCreate_createClusterWithEntraUser() { // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/8a9dbb28e788355a47dc5bad3ea5f8da212b4bf6/specification/hdinsight/resource-manager/Microsoft.HDInsight/preview/2025-01-15-preview/examples/CreateHDInsightClusterWithTLS12.json -func ExampleClustersClient_BeginCreate_createClusterWithTls12() { +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/6312b1c8676b0973f86f078c1177dcb7510158df/specification/hdinsight/resource-manager/Microsoft.HDInsight/HDInsight/preview/2025-01-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) @@ -1549,17 +1147,23 @@ func ExampleClustersClient_BeginCreate_createClusterWithTls12() { }, Kind: to.Ptr("Hadoop"), }, - ClusterVersion: to.Ptr("3.6"), + ClusterVersion: to.Ptr("3.5"), ComputeProfile: &armhdinsight.ComputeProfile{ Roles: []*armhdinsight.Role{ { Name: to.Ptr("headnode"), HardwareProfile: &armhdinsight.HardwareProfile{ - VMSize: to.Ptr("Large"), + 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"), }, }, @@ -1568,21 +1172,23 @@ func ExampleClustersClient_BeginCreate_createClusterWithTls12() { { Name: to.Ptr("workernode"), HardwareProfile: &armhdinsight.HardwareProfile{ - VMSize: to.Ptr("Large"), + 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](3), + 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("**********"), @@ -1592,13 +1198,12 @@ func ExampleClustersClient_BeginCreate_createClusterWithTls12() { TargetInstanceCount: to.Ptr[int32](3), }}, }, - MinSupportedTLSVersion: to.Ptr("1.2"), - OSType: to.Ptr(armhdinsight.OSTypeLinux), + OSType: to.Ptr(armhdinsight.OSTypeLinux), StorageProfile: &armhdinsight.StorageProfile{ Storageaccounts: []*armhdinsight.StorageAccount{ { Name: to.Ptr("mystorage.blob.core.windows.net"), - Container: to.Ptr("default8525"), + Container: to.Ptr("containername"), EnableSecureChannel: to.Ptr(true), IsDefault: to.Ptr(true), Key: to.Ptr("storagekey"), @@ -1606,6 +1211,9 @@ func ExampleClustersClient_BeginCreate_createClusterWithTls12() { }, 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) @@ -1621,24 +1229,24 @@ func ExampleClustersClient_BeginCreate_createClusterWithTls12() { // 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"), + // 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-3.6.1000.67.2001080246.json"), + // Blueprint: to.Ptr("https://blueprints.azurehdinsight.net/hadoop-4.0.1000.1.1910270459.json"), // ComponentVersion: map[string]*string{ - // "Hadoop": to.Ptr("2.7"), + // "Hadoop": to.Ptr("3.1"), // }, - // Kind: to.Ptr("Hadoop"), + // Kind: to.Ptr("HADOOP"), // }, // ClusterState: to.Ptr("Running"), - // ClusterVersion: to.Ptr("3.6.1000.67"), + // ClusterVersion: to.Ptr("4.0.1000.1"), // ComputeProfile: &armhdinsight.ComputeProfile{ // Roles: []*armhdinsight.Role{ // { // Name: to.Ptr("headnode"), // HardwareProfile: &armhdinsight.HardwareProfile{ - // VMSize: to.Ptr("standard_a4_v2"), + // VMSize: to.Ptr("standard_d12_v2"), // }, // OSProfile: &armhdinsight.OsProfile{ // LinuxOperatingSystemProfile: &armhdinsight.LinuxOperatingSystemProfile{ @@ -1650,14 +1258,14 @@ func ExampleClustersClient_BeginCreate_createClusterWithTls12() { // { // Name: to.Ptr("workernode"), // HardwareProfile: &armhdinsight.HardwareProfile{ - // VMSize: to.Ptr("standard_a4_v2"), + // VMSize: to.Ptr("standard_d4_v2"), // }, // OSProfile: &armhdinsight.OsProfile{ // LinuxOperatingSystemProfile: &armhdinsight.LinuxOperatingSystemProfile{ // Username: to.Ptr("sshuser"), // }, // }, - // TargetInstanceCount: to.Ptr[int32](3), + // TargetInstanceCount: to.Ptr[int32](4), // }, // { // Name: to.Ptr("zookeepernode"), @@ -1685,20 +1293,19 @@ func ExampleClustersClient_BeginCreate_createClusterWithTls12() { // Port: to.Ptr[int32](443), // Protocol: to.Ptr("TCP"), // }}, - // CreatedDate: to.Ptr("2020-01-10T08:36:39.153"), - // MinSupportedTLSVersion: to.Ptr("1.2"), + // 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](20), + // CoresUsed: to.Ptr[int32](40), // }, // Tier: to.Ptr(armhdinsight.TierStandard), // }, // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/8a9dbb28e788355a47dc5bad3ea5f8da212b4bf6/specification/hdinsight/resource-manager/Microsoft.HDInsight/preview/2025-01-15-preview/examples/CreateHDInsightClusterWithAvailabilityZones.json -func ExampleClustersClient_BeginCreate_createClusterWithAvailabilityZones() { +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/6312b1c8676b0973f86f078c1177dcb7510158df/specification/hdinsight/resource-manager/Microsoft.HDInsight/HDInsight/preview/2025-01-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) @@ -1711,114 +1318,97 @@ func ExampleClustersClient_BeginCreate_createClusterWithAvailabilityZones() { 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{ - "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"), + Kind: to.Ptr("kafka"), }, - ClusterVersion: to.Ptr("3.6"), + ClusterVersion: to.Ptr("4.0"), ComputeProfile: &armhdinsight.ComputeProfile{ Roles: []*armhdinsight.Role{ { - Name: to.Ptr("headnode"), + 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("standard_d3"), + VMSize: to.Ptr("Small"), }, 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"), - }, + TargetInstanceCount: to.Ptr[int32](3), }, { - Name: to.Ptr("workernode"), + Name: to.Ptr("kafkamanagementnode"), HardwareProfile: &armhdinsight.HardwareProfile{ - VMSize: to.Ptr("standard_d3"), + VMSize: to.Ptr("Standard_D4_v2"), }, OSProfile: &armhdinsight.OsProfile{ LinuxOperatingSystemProfile: &armhdinsight.LinuxOperatingSystemProfile{ Password: to.Ptr("**********"), - SSHProfile: &armhdinsight.SSHProfile{ - PublicKeys: []*armhdinsight.SSHPublicKey{ - { - CertificateData: to.Ptr("**********"), - }}, - }, - Username: to.Ptr("sshuser"), + Username: to.Ptr("kafkauser"), }, }, 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"), - }, }}, }, + 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"), + 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"), + Key: to.Ptr("storagekey"), }}, }, + Tier: to.Ptr(armhdinsight.TierStandard), }, - Zones: []*string{ - to.Ptr("1")}, }, nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) @@ -1835,21 +1425,23 @@ func ExampleClustersClient_BeginCreate_createClusterWithAvailabilityZones() { // 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"), + // Etag: to.Ptr("e1266b83-9bda-4797-a906-1bf82c8eb09a"), // Properties: &armhdinsight.ClusterGetProperties{ // ClusterDefinition: &armhdinsight.ClusterDefinition{ - // Blueprint: to.Ptr("https://blueprints.azurehdinsight.net/hadoop-3.6.1000.67.2005040905.json"), - // Kind: to.Ptr("hadoop"), + // 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"), // }, - // ClusterID: to.Ptr("8186508b6234470e9d16c9e8e13bd821"), // ClusterState: to.Ptr("Running"), - // ClusterVersion: to.Ptr("3.6.1000.67"), + // 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"), + // VMSize: to.Ptr("standard_d3_v2"), // }, // OSProfile: &armhdinsight.OsProfile{ // LinuxOperatingSystemProfile: &armhdinsight.LinuxOperatingSystemProfile{ @@ -1857,15 +1449,29 @@ func ExampleClustersClient_BeginCreate_createClusterWithAvailabilityZones() { // }, // }, // 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"), + // 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"), + // 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{ @@ -1873,27 +1479,58 @@ func ExampleClustersClient_BeginCreate_createClusterWithAvailabilityZones() { // }, // }, // 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("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), // }}, // }, - // CreatedDate: to.Ptr("2020-06-09T12:25:43.48"), + // 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](16), + // CoresUsed: to.Ptr[int32](52), // }, // Tier: to.Ptr(armhdinsight.TierStandard), // }, - // Zones: []*string{ - // to.Ptr("1")}, - // } + // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/8a9dbb28e788355a47dc5bad3ea5f8da212b4bf6/specification/hdinsight/resource-manager/Microsoft.HDInsight/preview/2025-01-15-preview/examples/CreateHDInsightClusterWithComputeIsolationProperties.json -func ExampleClustersClient_BeginCreate_createClusterWithComputeIsolationProperties() { +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/6312b1c8676b0973f86f078c1177dcb7510158df/specification/hdinsight/resource-manager/Microsoft.HDInsight/HDInsight/preview/2025-01-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) @@ -1913,19 +1550,17 @@ func ExampleClustersClient_BeginCreate_createClusterWithComputeIsolationProperti "restAuthCredential.username": "admin", }, }, - Kind: to.Ptr("hadoop"), - }, - ClusterVersion: to.Ptr("3.6"), - ComputeIsolationProperties: &armhdinsight.ComputeIsolationProperties{ - EnableComputeIsolation: to.Ptr(true), + 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"), + VMSize: to.Ptr("Standard_D3_V2"), }, + MinInstanceCount: to.Ptr[int32](1), OSProfile: &armhdinsight.OsProfile{ LinuxOperatingSystemProfile: &armhdinsight.LinuxOperatingSystemProfile{ Password: to.Ptr("**********"), @@ -1938,13 +1573,19 @@ func ExampleClustersClient_BeginCreate_createClusterWithComputeIsolationProperti 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"), + VMSize: to.Ptr("Standard_D3_V2"), }, + MinInstanceCount: to.Ptr[int32](1), OSProfile: &armhdinsight.OsProfile{ LinuxOperatingSystemProfile: &armhdinsight.LinuxOperatingSystemProfile{ Password: to.Ptr("**********"), @@ -1957,20 +1598,65 @@ func ExampleClustersClient_BeginCreate_createClusterWithComputeIsolationProperti Username: to.Ptr("sshuser"), }, }, - TargetInstanceCount: to.Ptr[int32](2), + 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"), + 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 { @@ -1987,25 +1673,24 @@ func ExampleClustersClient_BeginCreate_createClusterWithComputeIsolationProperti // 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"), + // 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-3.6.1000.67.2005040905.json"), - // Kind: to.Ptr("hadoop"), + // 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"), // }, - // ClusterID: to.Ptr("8186508b6234470e9d16c9e8e13bd821"), // ClusterState: to.Ptr("Running"), - // ClusterVersion: to.Ptr("3.6.1000.67"), - // ComputeIsolationProperties: &armhdinsight.ComputeIsolationProperties{ - // EnableComputeIsolation: to.Ptr(true), - // }, + // 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"), + // VMSize: to.Ptr("standard_d12_v2"), // }, // OSProfile: &armhdinsight.OsProfile{ // LinuxOperatingSystemProfile: &armhdinsight.LinuxOperatingSystemProfile{ @@ -2013,37 +1698,58 @@ func ExampleClustersClient_BeginCreate_createClusterWithComputeIsolationProperti // }, // }, // 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"), + // VMSize: to.Ptr("standard_d4_v2"), // }, // OSProfile: &armhdinsight.OsProfile{ // LinuxOperatingSystemProfile: &armhdinsight.LinuxOperatingSystemProfile{ // Username: to.Ptr("sshuser"), // }, // }, - // TargetInstanceCount: to.Ptr[int32](2), + // 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), // }}, // }, - // CreatedDate: to.Ptr("2020-06-09T12:25:43.48"), + // 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](16), + // CoresUsed: to.Ptr[int32](40), // }, // Tier: to.Ptr(armhdinsight.TierStandard), // }, // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/8a9dbb28e788355a47dc5bad3ea5f8da212b4bf6/specification/hdinsight/resource-manager/Microsoft.HDInsight/preview/2025-01-15-preview/examples/CreateHDInsightClusterWithEncryptionAtHost.json -func ExampleClustersClient_BeginCreate_createClusterWithEncryptionAtHost() { +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/6312b1c8676b0973f86f078c1177dcb7510158df/specification/hdinsight/resource-manager/Microsoft.HDInsight/HDInsight/preview/2025-01-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) @@ -2056,6 +1762,9 @@ func ExampleClustersClient_BeginCreate_createClusterWithEncryptionAtHost() { 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, @@ -2063,16 +1772,17 @@ func ExampleClustersClient_BeginCreate_createClusterWithEncryptionAtHost() { "restAuthCredential.username": "admin", }, }, - Kind: to.Ptr("Hadoop"), + Kind: to.Ptr("Spark"), }, - ClusterVersion: to.Ptr("3.6"), + ClusterVersion: to.Ptr("3.5"), ComputeProfile: &armhdinsight.ComputeProfile{ Roles: []*armhdinsight.Role{ { Name: to.Ptr("headnode"), HardwareProfile: &armhdinsight.HardwareProfile{ - VMSize: to.Ptr("Standard_DS14_v2"), + VMSize: to.Ptr("Standard_D12_V2"), }, + MinInstanceCount: to.Ptr[int32](1), OSProfile: &armhdinsight.OsProfile{ LinuxOperatingSystemProfile: &armhdinsight.LinuxOperatingSystemProfile{ Password: to.Ptr("**********"), @@ -2084,46 +1794,34 @@ func ExampleClustersClient_BeginCreate_createClusterWithEncryptionAtHost() { { 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"), + 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](3), + TargetInstanceCount: to.Ptr[int32](4), }}, }, - 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"), + Container: to.Ptr("containername"), EnableSecureChannel: to.Ptr(true), IsDefault: to.Ptr(true), - Key: to.Ptr("storagekey"), + 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) @@ -2139,24 +1837,24 @@ func ExampleClustersClient_BeginCreate_createClusterWithEncryptionAtHost() { // 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"), + // 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-3.6.1000.67.2001080246.json"), + // Blueprint: to.Ptr("https://blueprints.azurehdinsight.net/hadoop-4.0.1000.1.1910270459.json"), // ComponentVersion: map[string]*string{ - // "Hadoop": to.Ptr("2.7"), + // "Hadoop": to.Ptr("3.1"), // }, - // Kind: to.Ptr("Hadoop"), + // Kind: to.Ptr("SPARK"), // }, // ClusterState: to.Ptr("Running"), - // ClusterVersion: to.Ptr("3.6.1000.67"), + // ClusterVersion: to.Ptr("4.0.1000.1"), // ComputeProfile: &armhdinsight.ComputeProfile{ // Roles: []*armhdinsight.Role{ // { // Name: to.Ptr("headnode"), // HardwareProfile: &armhdinsight.HardwareProfile{ - // VMSize: to.Ptr("standard_ds14_v2"), + // VMSize: to.Ptr("standard_d12_v2"), // }, // OSProfile: &armhdinsight.OsProfile{ // LinuxOperatingSystemProfile: &armhdinsight.LinuxOperatingSystemProfile{ @@ -2168,19 +1866,19 @@ func ExampleClustersClient_BeginCreate_createClusterWithEncryptionAtHost() { // { // Name: to.Ptr("workernode"), // HardwareProfile: &armhdinsight.HardwareProfile{ - // VMSize: to.Ptr("standard_ds14_v2"), + // VMSize: to.Ptr("standard_d4_v2"), // }, // OSProfile: &armhdinsight.OsProfile{ // LinuxOperatingSystemProfile: &armhdinsight.LinuxOperatingSystemProfile{ // Username: to.Ptr("sshuser"), // }, // }, - // TargetInstanceCount: to.Ptr[int32](3), + // TargetInstanceCount: to.Ptr[int32](4), // }, // { // Name: to.Ptr("zookeepernode"), // HardwareProfile: &armhdinsight.HardwareProfile{ - // VMSize: to.Ptr("standard_ds14_v2"), + // VMSize: to.Ptr("standard_a2_v2"), // }, // OSProfile: &armhdinsight.OsProfile{ // LinuxOperatingSystemProfile: &armhdinsight.LinuxOperatingSystemProfile{ @@ -2203,22 +1901,19 @@ func ExampleClustersClient_BeginCreate_createClusterWithEncryptionAtHost() { // 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), - // }, + // 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](20), + // CoresUsed: to.Ptr[int32](40), // }, // Tier: to.Ptr(armhdinsight.TierStandard), // }, // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/8a9dbb28e788355a47dc5bad3ea5f8da212b4bf6/specification/hdinsight/resource-manager/Microsoft.HDInsight/preview/2025-01-15-preview/examples/CreateHDInsightClusterWithEncryptionInTransit.json -func ExampleClustersClient_BeginCreate_createClusterWithEncryptionInTransit() { +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/6312b1c8676b0973f86f078c1177dcb7510158df/specification/hdinsight/resource-manager/Microsoft.HDInsight/HDInsight/preview/2025-01-15-preview/examples/CreateHDInsightClusterWithEntraUser.json +func ExampleClustersClient_BeginCreate_createClusterWithEntraUser() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) @@ -2233,20 +1928,25 @@ func ExampleClustersClient_BeginCreate_createClusterWithEncryptionInTransit() { ClusterDefinition: &armhdinsight.ClusterDefinition{ Configurations: map[string]any{ "gateway": map[string]any{ - "restAuthCredential.isEnabled": true, - "restAuthCredential.password": "**********", - "restAuthCredential.username": "admin", + "restAuthCredential.isEnabled": false, + "restAuthEntraUsers": []any{ + map[string]any{ + "displayName": "displayName", + "objectId": "00000000-0000-0000-0000-000000000000", + "upn": "user@microsoft.com", + }, + }, }, }, Kind: to.Ptr("Hadoop"), }, - ClusterVersion: to.Ptr("3.6"), + ClusterVersion: to.Ptr("5.1"), ComputeProfile: &armhdinsight.ComputeProfile{ Roles: []*armhdinsight.Role{ { Name: to.Ptr("headnode"), HardwareProfile: &armhdinsight.HardwareProfile{ - VMSize: to.Ptr("Large"), + VMSize: to.Ptr("Standard_E8_V3"), }, OSProfile: &armhdinsight.OsProfile{ LinuxOperatingSystemProfile: &armhdinsight.LinuxOperatingSystemProfile{ @@ -2259,7 +1959,7 @@ func ExampleClustersClient_BeginCreate_createClusterWithEncryptionInTransit() { { Name: to.Ptr("workernode"), HardwareProfile: &armhdinsight.HardwareProfile{ - VMSize: to.Ptr("Large"), + VMSize: to.Ptr("Standard_E8_V3"), }, OSProfile: &armhdinsight.OsProfile{ LinuxOperatingSystemProfile: &armhdinsight.LinuxOperatingSystemProfile{ @@ -2272,7 +1972,7 @@ func ExampleClustersClient_BeginCreate_createClusterWithEncryptionInTransit() { { Name: to.Ptr("zookeepernode"), HardwareProfile: &armhdinsight.HardwareProfile{ - VMSize: to.Ptr("Small"), + VMSize: to.Ptr("Standard_E8_V3"), }, OSProfile: &armhdinsight.OsProfile{ LinuxOperatingSystemProfile: &armhdinsight.LinuxOperatingSystemProfile{ @@ -2283,15 +1983,12 @@ func ExampleClustersClient_BeginCreate_createClusterWithEncryptionInTransit() { 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"), + Container: to.Ptr("containername"), EnableSecureChannel: to.Ptr(true), IsDefault: to.Ptr(true), Key: to.Ptr("storagekey"), @@ -2314,24 +2011,24 @@ func ExampleClustersClient_BeginCreate_createClusterWithEncryptionInTransit() { // 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"), + // Location: to.Ptr("East Asia"), + // Etag: to.Ptr("ebd5623e-21a6-4968-aba6-f0a3c028b30e"), // Properties: &armhdinsight.ClusterGetProperties{ // ClusterDefinition: &armhdinsight.ClusterDefinition{ - // Blueprint: to.Ptr("https://blueprints.azurehdinsight.net/hadoop-3.6.1000.67.2001080246.json"), + // Blueprint: to.Ptr("https://blueprints.azurehdinsight.net/hadoop-5.1.3000.0.2504170544.json"), // ComponentVersion: map[string]*string{ - // "Hadoop": to.Ptr("2.7"), + // "Hadoop": to.Ptr("3.3"), // }, // Kind: to.Ptr("Hadoop"), // }, // ClusterState: to.Ptr("Running"), - // ClusterVersion: to.Ptr("3.6.1000.67"), + // ClusterVersion: to.Ptr("5.1.3000.0"), // ComputeProfile: &armhdinsight.ComputeProfile{ // Roles: []*armhdinsight.Role{ // { // Name: to.Ptr("headnode"), // HardwareProfile: &armhdinsight.HardwareProfile{ - // VMSize: to.Ptr("standard_a4_v2"), + // VMSize: to.Ptr("Standard_E8_V3"), // }, // OSProfile: &armhdinsight.OsProfile{ // LinuxOperatingSystemProfile: &armhdinsight.LinuxOperatingSystemProfile{ @@ -2343,7 +2040,7 @@ func ExampleClustersClient_BeginCreate_createClusterWithEncryptionInTransit() { // { // Name: to.Ptr("workernode"), // HardwareProfile: &armhdinsight.HardwareProfile{ - // VMSize: to.Ptr("standard_a4_v2"), + // VMSize: to.Ptr("Standard_E8_V3"), // }, // OSProfile: &armhdinsight.OsProfile{ // LinuxOperatingSystemProfile: &armhdinsight.LinuxOperatingSystemProfile{ @@ -2355,7 +2052,7 @@ func ExampleClustersClient_BeginCreate_createClusterWithEncryptionInTransit() { // { // Name: to.Ptr("zookeepernode"), // HardwareProfile: &armhdinsight.HardwareProfile{ - // VMSize: to.Ptr("standard_a2_v2"), + // VMSize: to.Ptr("Standard_E8_V3"), // }, // OSProfile: &armhdinsight.OsProfile{ // LinuxOperatingSystemProfile: &armhdinsight.LinuxOperatingSystemProfile{ @@ -2378,22 +2075,19 @@ func ExampleClustersClient_BeginCreate_createClusterWithEncryptionInTransit() { // 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), - // }, + // CreatedDate: to.Ptr("2025-05-08T08:07:09.813"), // OSType: to.Ptr(armhdinsight.OSTypeLinux), // ProvisioningState: to.Ptr(armhdinsight.HDInsightClusterProvisioningStateSucceeded), // QuotaInfo: &armhdinsight.QuotaInfo{ - // CoresUsed: to.Ptr[int32](20), + // CoresUsed: to.Ptr[int32](40), // }, // Tier: to.Ptr(armhdinsight.TierStandard), // }, // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/8a9dbb28e788355a47dc5bad3ea5f8da212b4bf6/specification/hdinsight/resource-manager/Microsoft.HDInsight/preview/2025-01-15-preview/examples/CreateHDInsightClusterWithCustomNetworkProperties.json -func ExampleClustersClient_BeginCreate_createClusterWithNetworkProperties() { +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/6312b1c8676b0973f86f078c1177dcb7510158df/specification/hdinsight/resource-manager/Microsoft.HDInsight/HDInsight/preview/2025-01-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) @@ -2413,7 +2107,7 @@ func ExampleClustersClient_BeginCreate_createClusterWithNetworkProperties() { "restAuthCredential.username": "admin", }, }, - Kind: to.Ptr("hadoop"), + Kind: to.Ptr("Hadoop"), }, ClusterVersion: to.Ptr("3.6"), ComputeProfile: &armhdinsight.ComputeProfile{ @@ -2421,69 +2115,56 @@ func ExampleClustersClient_BeginCreate_createClusterWithNetworkProperties() { { Name: to.Ptr("headnode"), HardwareProfile: &armhdinsight.HardwareProfile{ - VMSize: to.Ptr("standard_d3"), + VMSize: to.Ptr("Large"), }, 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"), + VMSize: to.Ptr("Large"), }, 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"), + 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), }}, }, - NetworkProperties: &armhdinsight.NetworkProperties{ - PrivateLink: to.Ptr(armhdinsight.PrivateLinkEnabled), - PublicIPTag: &armhdinsight.IPTag{ - IPTagType: to.Ptr("FirstPartyUsage"), - Tag: to.Ptr("/"), - }, - ResourceProviderConnection: to.Ptr(armhdinsight.ResourceProviderConnectionOutbound), - }, - OSType: to.Ptr(armhdinsight.OSTypeLinux), + MinSupportedTLSVersion: to.Ptr("1.2"), + OSType: to.Ptr(armhdinsight.OSTypeLinux), StorageProfile: &armhdinsight.StorageProfile{ Storageaccounts: []*armhdinsight.StorageAccount{ { - Name: to.Ptr("mystorage"), - Container: to.Ptr("containername"), + Name: to.Ptr("mystorage.blob.core.windows.net"), + Container: to.Ptr("default8525"), EnableSecureChannel: to.Ptr(true), IsDefault: to.Ptr(true), - Key: to.Ptr("storage account key"), + Key: to.Ptr("storagekey"), }}, }, + Tier: to.Ptr(armhdinsight.TierStandard), }, }, nil) if err != nil { @@ -2501,13 +2182,15 @@ func ExampleClustersClient_BeginCreate_createClusterWithNetworkProperties() { // 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"), + // 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.2005040905.json"), - // Kind: to.Ptr("hadoop"), + // 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"), // }, - // ClusterID: to.Ptr("8186508b6234470e9d16c9e8e13bd821"), // ClusterState: to.Ptr("Running"), // ClusterVersion: to.Ptr("3.6.1000.67"), // ComputeProfile: &armhdinsight.ComputeProfile{ @@ -2515,7 +2198,7 @@ func ExampleClustersClient_BeginCreate_createClusterWithNetworkProperties() { // { // Name: to.Ptr("headnode"), // HardwareProfile: &armhdinsight.HardwareProfile{ - // VMSize: to.Ptr("standard_d3"), + // VMSize: to.Ptr("standard_a4_v2"), // }, // OSProfile: &armhdinsight.OsProfile{ // LinuxOperatingSystemProfile: &armhdinsight.LinuxOperatingSystemProfile{ @@ -2523,49 +2206,59 @@ func ExampleClustersClient_BeginCreate_createClusterWithNetworkProperties() { // }, // }, // 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"), + // VMSize: to.Ptr("standard_a4_v2"), // }, // 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"), + // 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), // }}, // }, - // CreatedDate: to.Ptr("2020-06-09T12:25:43.48"), - // NetworkProperties: &armhdinsight.NetworkProperties{ - // PrivateLink: to.Ptr(armhdinsight.PrivateLinkEnabled), - // PublicIPTag: &armhdinsight.IPTag{ - // IPTagType: to.Ptr("FirstPartyUsage"), - // Tag: to.Ptr("/"), + // ConnectivityEndpoints: []*armhdinsight.ConnectivityEndpoint{ + // { + // Name: to.Ptr("SSH"), + // Location: to.Ptr("cluster1-ssh.azurehdinsight.net"), + // Port: to.Ptr[int32](22), + // Protocol: to.Ptr("TCP"), // }, - // ResourceProviderConnection: to.Ptr(armhdinsight.ResourceProviderConnectionOutbound), - // }, + // { + // 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](16), + // CoresUsed: to.Ptr[int32](20), // }, // Tier: to.Ptr(armhdinsight.TierStandard), // }, // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/8a9dbb28e788355a47dc5bad3ea5f8da212b4bf6/specification/hdinsight/resource-manager/Microsoft.HDInsight/preview/2025-01-15-preview/examples/CreateHDInsightClusterWithADLSGen2Msi.json -func ExampleClustersClient_BeginCreate_createClusterWithStorageAdlsGen2Msi() { +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/6312b1c8676b0973f86f078c1177dcb7510158df/specification/hdinsight/resource-manager/Microsoft.HDInsight/HDInsight/preview/2025-01-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) @@ -2576,81 +2269,99 @@ func ExampleClustersClient_BeginCreate_createClusterWithStorageAdlsGen2Msi() { log.Fatalf("failed to create client: %v", err) } poller, err := clientFactory.NewClustersClient().BeginCreate(ctx, "rg1", "cluster1", armhdinsight.ClusterCreateParametersExtended{ - Identity: &armhdinsight.ClusterIdentity{ - Type: to.Ptr(armhdinsight.ResourceIdentityTypeUserAssigned), - UserAssignedIdentities: map[string]*armhdinsight.UserAssignedIdentity{ - "/subscriptions/subId/resourceGroups/rg1/providers/Microsoft.ManagedIdentity/userAssignedIdentities/msi": {}, - }, - }, 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"), + Kind: to.Ptr("hadoop"), }, - ClusterVersion: to.Ptr("5.1"), + ClusterVersion: to.Ptr("3.6"), ComputeProfile: &armhdinsight.ComputeProfile{ Roles: []*armhdinsight.Role{ { Name: to.Ptr("headnode"), HardwareProfile: &armhdinsight.HardwareProfile{ - VMSize: to.Ptr("Standard_E8_V3"), + VMSize: to.Ptr("standard_d3"), }, - 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/rg1/providers/Microsoft.Network/virtualNetworks/vnetname"), - Subnet: to.Ptr("/subscriptions/subId/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/vnetname/subnets/vnetsubnet"), + 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_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](3), - VirtualNetworkProfile: &armhdinsight.VirtualNetworkProfile{ - ID: to.Ptr("/subscriptions/subId/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/vnetname"), - Subnet: to.Ptr("/subscriptions/subId/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/vnetname/subnets/vnetsubnet"), - }, - }, - { - Name: to.Ptr("zookeepernode"), - HardwareProfile: &armhdinsight.HardwareProfile{ - VMSize: to.Ptr("Standard_E8_V3"), + VMSize: to.Ptr("standard_d3"), }, - 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), + TargetInstanceCount: to.Ptr[int32](2), VirtualNetworkProfile: &armhdinsight.VirtualNetworkProfile{ - ID: to.Ptr("/subscriptions/subId/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/vnetname"), - Subnet: to.Ptr("/subscriptions/subId/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/vnetname/subnets/vnetsubnet"), + 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"), }, }}, }, @@ -2658,18 +2369,16 @@ func ExampleClustersClient_BeginCreate_createClusterWithStorageAdlsGen2Msi() { StorageProfile: &armhdinsight.StorageProfile{ Storageaccounts: []*armhdinsight.StorageAccount{ { - Name: to.Ptr("mystorage.blob.core.windows.net"), - FileSystem: to.Ptr("default"), - IsDefault: to.Ptr(true), - MsiResourceID: to.Ptr("/subscriptions/subId/resourceGroups/rg1/providers/Microsoft.ManagedIdentity/userAssignedIdentities/msi"), - ResourceID: to.Ptr("/subscriptions/subId/resourceGroups/rg1/providers/Microsoft.Storage/storageAccounts/mystorage"), + Name: to.Ptr("mystorage"), + Container: to.Ptr("containername"), + EnableSecureChannel: to.Ptr(true), + IsDefault: to.Ptr(true), + Key: to.Ptr("storage account key"), }}, }, - Tier: to.Ptr(armhdinsight.TierStandard), - }, - Tags: map[string]*string{ - "key1": to.Ptr("val1"), }, + Zones: []*string{ + to.Ptr("1")}, }, nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) @@ -2685,24 +2394,22 @@ func ExampleClustersClient_BeginCreate_createClusterWithStorageAdlsGen2Msi() { // 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 Asia"), - // Etag: to.Ptr("ebd7702e-21a6-4968-aba6-f0a3c028b30e"), + // 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-5.1.3000.0.2504170544.json"), - // ComponentVersion: map[string]*string{ - // "Hadoop": to.Ptr("3.3"), - // }, - // Kind: to.Ptr("Hadoop"), + // 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("5.1.3000.0"), + // ClusterVersion: to.Ptr("3.6.1000.67"), // ComputeProfile: &armhdinsight.ComputeProfile{ // Roles: []*armhdinsight.Role{ // { // Name: to.Ptr("headnode"), // HardwareProfile: &armhdinsight.HardwareProfile{ - // VMSize: to.Ptr("Standard_E8_V3"), + // VMSize: to.Ptr("standard_d3"), // }, // OSProfile: &armhdinsight.OsProfile{ // LinuxOperatingSystemProfile: &armhdinsight.LinuxOperatingSystemProfile{ @@ -2710,58 +2417,43 @@ func ExampleClustersClient_BeginCreate_createClusterWithStorageAdlsGen2Msi() { // }, // }, // 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_E8_V3"), + // VMSize: to.Ptr("standard_d3"), // }, // 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_E8_V3"), - // }, - // 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"), // }, - // 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("2025-05-08T08:07:09.813"), + // 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](40), + // 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/8a9dbb28e788355a47dc5bad3ea5f8da212b4bf6/specification/hdinsight/resource-manager/Microsoft.HDInsight/preview/2025-01-15-preview/examples/CreateHDInsightClusterWithWasbMsi.json -func ExampleClustersClient_BeginCreate_createClusterWithStorageWasbMsi() { +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/6312b1c8676b0973f86f078c1177dcb7510158df/specification/hdinsight/resource-manager/Microsoft.HDInsight/HDInsight/preview/2025-01-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) @@ -2772,12 +2464,6 @@ func ExampleClustersClient_BeginCreate_createClusterWithStorageWasbMsi() { log.Fatalf("failed to create client: %v", err) } poller, err := clientFactory.NewClustersClient().BeginCreate(ctx, "rg1", "cluster1", armhdinsight.ClusterCreateParametersExtended{ - Identity: &armhdinsight.ClusterIdentity{ - Type: to.Ptr(armhdinsight.ResourceIdentityTypeUserAssigned), - UserAssignedIdentities: map[string]*armhdinsight.UserAssignedIdentity{ - "/subscriptions/subId/resourceGroups/rg1/providers/Microsoft.ManagedIdentity/userAssignedIdentities/msi": {}, - }, - }, Properties: &armhdinsight.ClusterCreateProperties{ ClusterDefinition: &armhdinsight.ClusterDefinition{ Configurations: map[string]any{ @@ -2787,84 +2473,64 @@ func ExampleClustersClient_BeginCreate_createClusterWithStorageWasbMsi() { "restAuthCredential.username": "admin", }, }, - Kind: to.Ptr("Hadoop"), + Kind: to.Ptr("hadoop"), + }, + ClusterVersion: to.Ptr("3.6"), + ComputeIsolationProperties: &armhdinsight.ComputeIsolationProperties{ + EnableComputeIsolation: to.Ptr(true), }, - ClusterVersion: to.Ptr("5.1"), ComputeProfile: &armhdinsight.ComputeProfile{ Roles: []*armhdinsight.Role{ { Name: to.Ptr("headnode"), HardwareProfile: &armhdinsight.HardwareProfile{ - VMSize: to.Ptr("Standard_E8_V3"), + VMSize: to.Ptr("standard_d3"), }, - 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/rg1/providers/Microsoft.Network/virtualNetworks/vnetname"), - Subnet: to.Ptr("/subscriptions/subId/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/vnetname/subnets/vnetsubnet"), - }, }, { Name: to.Ptr("workernode"), 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](3), - VirtualNetworkProfile: &armhdinsight.VirtualNetworkProfile{ - ID: to.Ptr("/subscriptions/subId/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/vnetname"), - Subnet: to.Ptr("/subscriptions/subId/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/vnetname/subnets/vnetsubnet"), - }, - }, - { - Name: to.Ptr("zookeepernode"), - HardwareProfile: &armhdinsight.HardwareProfile{ - VMSize: to.Ptr("Standard_E8_V3"), + VMSize: to.Ptr("standard_d3"), }, - 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/rg1/providers/Microsoft.Network/virtualNetworks/vnetname"), - Subnet: to.Ptr("/subscriptions/subId/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/vnetname/subnets/vnetsubnet"), - }, + TargetInstanceCount: to.Ptr[int32](2), }}, }, OSType: to.Ptr(armhdinsight.OSTypeLinux), StorageProfile: &armhdinsight.StorageProfile{ Storageaccounts: []*armhdinsight.StorageAccount{ { - Name: to.Ptr("mystorage.blob.core.windows.net"), - Container: to.Ptr("containername"), - IsDefault: to.Ptr(true), - MsiResourceID: to.Ptr("/subscriptions/subId/resourceGroups/rg1/providers/Microsoft.ManagedIdentity/userAssignedIdentities/msi"), - ResourceID: to.Ptr("/subscriptions/subId/resourceGroups/rg1/providers/Microsoft.Storage/storageAccounts/mystorage"), + Name: to.Ptr("mystorage"), + Container: to.Ptr("containername"), + EnableSecureChannel: to.Ptr(true), + IsDefault: to.Ptr(true), + Key: to.Ptr("storage account key"), }}, }, - Tier: to.Ptr(armhdinsight.TierStandard), - }, - Tags: map[string]*string{ - "key1": to.Ptr("val1"), }, }, nil) if err != nil { @@ -2881,83 +2547,63 @@ func ExampleClustersClient_BeginCreate_createClusterWithStorageWasbMsi() { // 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 Asia"), - // Etag: to.Ptr("ebd7702e-yr32-4968-aba6-f0a3c028b30e"), + // 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-5.1.3000.0.2504170544.json"), - // ComponentVersion: map[string]*string{ - // "Hadoop": to.Ptr("3.3"), - // }, - // Kind: to.Ptr("Hadoop"), + // 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("5.1.3000.0"), + // 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_E8_V3"), + // VMSize: to.Ptr("standard_d3"), // }, // 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_E8_V3"), - // }, - // 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"), // }, - // TargetInstanceCount: to.Ptr[int32](3), // }, // { - // Name: to.Ptr("zookeepernode"), + // Name: to.Ptr("workernode"), // HardwareProfile: &armhdinsight.HardwareProfile{ - // VMSize: to.Ptr("Standard_E8_V3"), + // VMSize: to.Ptr("standard_d3"), // }, // OSProfile: &armhdinsight.OsProfile{ // LinuxOperatingSystemProfile: &armhdinsight.LinuxOperatingSystemProfile{ // Username: to.Ptr("sshuser"), // }, // }, - // TargetInstanceCount: to.Ptr[int32](3), + // TargetInstanceCount: to.Ptr[int32](2), // }}, // }, - // 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("2025-05-08T08:07:09.813"), + // 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](40), + // CoresUsed: to.Ptr[int32](16), // }, // Tier: to.Ptr(armhdinsight.TierStandard), // }, // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/8a9dbb28e788355a47dc5bad3ea5f8da212b4bf6/specification/hdinsight/resource-manager/Microsoft.HDInsight/preview/2025-01-15-preview/examples/PatchLinuxHadoopCluster.json -func ExampleClustersClient_Update_patchHdInsightLinuxClusters() { +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/6312b1c8676b0973f86f078c1177dcb7510158df/specification/hdinsight/resource-manager/Microsoft.HDInsight/HDInsight/preview/2025-01-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) @@ -2967,41 +2613,110 @@ func ExampleClustersClient_Update_patchHdInsightLinuxClusters() { 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"), + 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/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"), + // 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.5.1000.0.9243893.json"), - // Kind: to.Ptr("hadoop"), + // 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.5.1000.0"), + // 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_V2"), + // VMSize: to.Ptr("standard_ds14_v2"), // }, // OSProfile: &armhdinsight.OsProfile{ // LinuxOperatingSystemProfile: &armhdinsight.LinuxOperatingSystemProfile{ @@ -3013,19 +2728,19 @@ func ExampleClustersClient_Update_patchHdInsightLinuxClusters() { // { // Name: to.Ptr("workernode"), // HardwareProfile: &armhdinsight.HardwareProfile{ - // VMSize: to.Ptr("Standard_D3_V2"), + // VMSize: to.Ptr("standard_ds14_v2"), // }, // OSProfile: &armhdinsight.OsProfile{ // LinuxOperatingSystemProfile: &armhdinsight.LinuxOperatingSystemProfile{ // Username: to.Ptr("sshuser"), // }, // }, - // TargetInstanceCount: to.Ptr[int32](4), + // TargetInstanceCount: to.Ptr[int32](3), // }, // { // Name: to.Ptr("zookeepernode"), // HardwareProfile: &armhdinsight.HardwareProfile{ - // VMSize: to.Ptr("Medium"), + // VMSize: to.Ptr("standard_ds14_v2"), // }, // OSProfile: &armhdinsight.OsProfile{ // LinuxOperatingSystemProfile: &armhdinsight.LinuxOperatingSystemProfile{ @@ -3048,19 +2763,22 @@ func ExampleClustersClient_Update_patchHdInsightLinuxClusters() { // Port: to.Ptr[int32](443), // Protocol: to.Ptr("TCP"), // }}, - // CreatedDate: to.Ptr("2017-01-11T18:58:26.187"), + // 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](24), + // CoresUsed: to.Ptr[int32](20), // }, // Tier: to.Ptr(armhdinsight.TierStandard), // }, // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/8a9dbb28e788355a47dc5bad3ea5f8da212b4bf6/specification/hdinsight/resource-manager/Microsoft.HDInsight/preview/2025-01-15-preview/examples/PatchLinuxHadoopClusterWithSystemMSI.json -func ExampleClustersClient_Update_patchHdInsightLinuxClustersWithSystemAssignedMsi() { +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/6312b1c8676b0973f86f078c1177dcb7510158df/specification/hdinsight/resource-manager/Microsoft.HDInsight/HDInsight/preview/2025-01-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) @@ -3070,49 +2788,110 @@ func ExampleClustersClient_Update_patchHdInsightLinuxClustersWithSystemAssignedM if err != nil { log.Fatalf("failed to create client: %v", err) } - res, err := clientFactory.NewClustersClient().Update(ctx, "rg1", "cluster1", armhdinsight.ClusterPatchParameters{ - Identity: &armhdinsight.ClusterIdentity{ - Type: to.Ptr(armhdinsight.ResourceIdentityTypeSystemAssigned), - }, - Tags: map[string]*string{ - "key1": to.Ptr("val1"), - "key2": to.Ptr("val2"), + 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/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"), - // Identity: &armhdinsight.ClusterIdentity{ - // Type: to.Ptr(armhdinsight.ResourceIdentityTypeSystemAssigned), - // PrincipalID: to.Ptr("principalId"), - // TenantID: to.Ptr("tenantId"), - // }, + // 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.5.1000.0.9243893.json"), - // Kind: to.Ptr("hadoop"), + // 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.5.1000.0"), + // 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_V2"), + // VMSize: to.Ptr("standard_a4_v2"), // }, // OSProfile: &armhdinsight.OsProfile{ // LinuxOperatingSystemProfile: &armhdinsight.LinuxOperatingSystemProfile{ @@ -3124,19 +2903,19 @@ func ExampleClustersClient_Update_patchHdInsightLinuxClustersWithSystemAssignedM // { // Name: to.Ptr("workernode"), // HardwareProfile: &armhdinsight.HardwareProfile{ - // VMSize: to.Ptr("Standard_D3_V2"), + // VMSize: to.Ptr("standard_a4_v2"), // }, // OSProfile: &armhdinsight.OsProfile{ // LinuxOperatingSystemProfile: &armhdinsight.LinuxOperatingSystemProfile{ // Username: to.Ptr("sshuser"), // }, // }, - // TargetInstanceCount: to.Ptr[int32](4), + // TargetInstanceCount: to.Ptr[int32](3), // }, // { // Name: to.Ptr("zookeepernode"), // HardwareProfile: &armhdinsight.HardwareProfile{ - // VMSize: to.Ptr("Medium"), + // VMSize: to.Ptr("standard_a2_v2"), // }, // OSProfile: &armhdinsight.OsProfile{ // LinuxOperatingSystemProfile: &armhdinsight.LinuxOperatingSystemProfile{ @@ -3159,19 +2938,22 @@ func ExampleClustersClient_Update_patchHdInsightLinuxClustersWithSystemAssignedM // Port: to.Ptr[int32](443), // Protocol: to.Ptr("TCP"), // }}, - // CreatedDate: to.Ptr("2017-01-11T18:58:26.187"), + // 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](24), + // CoresUsed: to.Ptr[int32](20), // }, // Tier: to.Ptr(armhdinsight.TierStandard), // }, // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/8a9dbb28e788355a47dc5bad3ea5f8da212b4bf6/specification/hdinsight/resource-manager/Microsoft.HDInsight/preview/2025-01-15-preview/examples/DeleteLinuxHadoopCluster.json -func ExampleClustersClient_BeginDelete() { +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/6312b1c8676b0973f86f078c1177dcb7510158df/specification/hdinsight/resource-manager/Microsoft.HDInsight/HDInsight/preview/2025-01-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) @@ -3181,56 +2963,119 @@ func ExampleClustersClient_BeginDelete() { if err != nil { log.Fatalf("failed to create client: %v", err) } - poller, err := clientFactory.NewClustersClient().BeginDelete(ctx, "rg1", "cluster1", nil) + 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), + PublicIPTag: &armhdinsight.IPTag{ + IPTagType: to.Ptr("FirstPartyUsage"), + Tag: to.Ptr("/"), + }, + 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) } - _, err = poller.PollUntilDone(ctx, nil) + res, 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/8a9dbb28e788355a47dc5bad3ea5f8da212b4bf6/specification/hdinsight/resource-manager/Microsoft.HDInsight/preview/2025-01-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"), + // 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.5.1000.0.9243893.json"), + // 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.5.1000.0"), + // 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_V2"), + // VMSize: to.Ptr("standard_d3"), // }, // OSProfile: &armhdinsight.OsProfile{ // LinuxOperatingSystemProfile: &armhdinsight.LinuxOperatingSystemProfile{ @@ -3238,58 +3083,49 @@ func ExampleClustersClient_Get_getHadoopOnLinuxCluster() { // }, // }, // 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"), + // VMSize: to.Ptr("standard_d3"), // }, // 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](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"), // }, - // 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"), + // CreatedDate: to.Ptr("2020-06-09T12:25:43.48"), + // NetworkProperties: &armhdinsight.NetworkProperties{ + // PrivateLink: to.Ptr(armhdinsight.PrivateLinkEnabled), + // PublicIPTag: &armhdinsight.IPTag{ + // IPTagType: to.Ptr("FirstPartyUsage"), + // Tag: to.Ptr("/"), // }, - // { - // 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"), + // ResourceProviderConnection: to.Ptr(armhdinsight.ResourceProviderConnectionOutbound), + // }, // OSType: to.Ptr(armhdinsight.OSTypeLinux), // ProvisioningState: to.Ptr(armhdinsight.HDInsightClusterProvisioningStateSucceeded), // QuotaInfo: &armhdinsight.QuotaInfo{ - // CoresUsed: to.Ptr[int32](24), + // CoresUsed: to.Ptr[int32](16), // }, // Tier: to.Ptr(armhdinsight.TierStandard), // }, // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/8a9dbb28e788355a47dc5bad3ea5f8da212b4bf6/specification/hdinsight/resource-manager/Microsoft.HDInsight/preview/2025-01-15-preview/examples/GetLinuxSparkCluster.json -func ExampleClustersClient_Get_getSparkOnLinuxCluster() { +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/6312b1c8676b0973f86f078c1177dcb7510158df/specification/hdinsight/resource-manager/Microsoft.HDInsight/HDInsight/preview/2025-01-15-preview/examples/CreateHDInsightClusterWithADLSGen2Msi.json +func ExampleClustersClient_BeginCreate_createClusterWithStorageAdlsGen2Msi() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) @@ -3297,11 +3133,110 @@ func ExampleClustersClient_Get_getSparkOnLinuxCluster() { ctx := context.Background() clientFactory, err := armhdinsight.NewClientFactory("", cred, nil) if err != nil { - log.Fatalf("failed to create client: %v", err) + log.Fatalf("failed to create client: %v", err) + } + poller, err := clientFactory.NewClustersClient().BeginCreate(ctx, "rg1", "cluster1", armhdinsight.ClusterCreateParametersExtended{ + Identity: &armhdinsight.ClusterIdentity{ + Type: to.Ptr(armhdinsight.ResourceIdentityTypeUserAssigned), + UserAssignedIdentities: map[string]*armhdinsight.UserAssignedIdentity{ + "/subscriptions/subId/resourceGroups/rg1/providers/Microsoft.ManagedIdentity/userAssignedIdentities/msi": {}, + }, + }, + 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("5.1"), + 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), + VirtualNetworkProfile: &armhdinsight.VirtualNetworkProfile{ + ID: to.Ptr("/subscriptions/subId/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/vnetname"), + Subnet: to.Ptr("/subscriptions/subId/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/vnetname/subnets/vnetsubnet"), + }, + }, + { + Name: to.Ptr("workernode"), + 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](3), + VirtualNetworkProfile: &armhdinsight.VirtualNetworkProfile{ + ID: to.Ptr("/subscriptions/subId/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/vnetname"), + Subnet: to.Ptr("/subscriptions/subId/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/vnetname/subnets/vnetsubnet"), + }, + }, + { + Name: to.Ptr("zookeepernode"), + 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](3), + VirtualNetworkProfile: &armhdinsight.VirtualNetworkProfile{ + ID: to.Ptr("/subscriptions/subId/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/vnetname"), + Subnet: to.Ptr("/subscriptions/subId/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/vnetname/subnets/vnetsubnet"), + }, + }}, + }, + OSType: to.Ptr(armhdinsight.OSTypeLinux), + StorageProfile: &armhdinsight.StorageProfile{ + Storageaccounts: []*armhdinsight.StorageAccount{ + { + Name: to.Ptr("mystorage.blob.core.windows.net"), + FileSystem: to.Ptr("default"), + IsDefault: to.Ptr(true), + MsiResourceID: to.Ptr("/subscriptions/subId/resourceGroups/rg1/providers/Microsoft.ManagedIdentity/userAssignedIdentities/msi"), + ResourceID: to.Ptr("/subscriptions/subId/resourceGroups/rg1/providers/Microsoft.Storage/storageAccounts/mystorage"), + }}, + }, + 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 := clientFactory.NewClustersClient().Get(ctx, "rg1", "cluster1", nil) + res, err := poller.PollUntilDone(ctx, nil) if err != nil { - log.Fatalf("failed to finish the request: %v", err) + log.Fatalf("failed to pull the result: %v", err) } // You could use response here. We use blank identifier for just demo purposes. _ = res @@ -3309,28 +3244,25 @@ func ExampleClustersClient_Get_getSparkOnLinuxCluster() { // 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"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.HDInsight/clusters/cluster1"), + // Location: to.Ptr("East Asia"), + // Etag: to.Ptr("ebd7702e-21a6-4968-aba6-f0a3c028b30e"), // Properties: &armhdinsight.ClusterGetProperties{ // ClusterDefinition: &armhdinsight.ClusterDefinition{ - // Blueprint: to.Ptr("https://blueprints.azurehdinsight.net/spark-3.5.1000.0.9625065.json"), + // Blueprint: to.Ptr("https://blueprints.azurehdinsight.net/hadoop-5.1.3000.0.2504170544.json"), // ComponentVersion: map[string]*string{ - // "Spark": to.Ptr("2.0"), + // "Hadoop": to.Ptr("3.3"), // }, - // Kind: to.Ptr("SPARK"), + // Kind: to.Ptr("Hadoop"), // }, // ClusterState: to.Ptr("Running"), - // ClusterVersion: to.Ptr("3.5.1000.0"), + // ClusterVersion: to.Ptr("5.1.3000.0"), // ComputeProfile: &armhdinsight.ComputeProfile{ // Roles: []*armhdinsight.Role{ // { // Name: to.Ptr("headnode"), // HardwareProfile: &armhdinsight.HardwareProfile{ - // VMSize: to.Ptr("Standard_D12_V2"), + // VMSize: to.Ptr("Standard_E8_V3"), // }, // OSProfile: &armhdinsight.OsProfile{ // LinuxOperatingSystemProfile: &armhdinsight.LinuxOperatingSystemProfile{ @@ -3342,19 +3274,19 @@ func ExampleClustersClient_Get_getSparkOnLinuxCluster() { // { // Name: to.Ptr("workernode"), // HardwareProfile: &armhdinsight.HardwareProfile{ - // VMSize: to.Ptr("Standard_D4_V2"), + // VMSize: to.Ptr("Standard_E8_V3"), // }, // OSProfile: &armhdinsight.OsProfile{ // LinuxOperatingSystemProfile: &armhdinsight.LinuxOperatingSystemProfile{ // Username: to.Ptr("sshuser"), // }, // }, - // TargetInstanceCount: to.Ptr[int32](4), + // TargetInstanceCount: to.Ptr[int32](3), // }, // { // Name: to.Ptr("zookeepernode"), // HardwareProfile: &armhdinsight.HardwareProfile{ - // VMSize: to.Ptr("Medium"), + // VMSize: to.Ptr("Standard_E8_V3"), // }, // OSProfile: &armhdinsight.OsProfile{ // LinuxOperatingSystemProfile: &armhdinsight.LinuxOperatingSystemProfile{ @@ -3377,7 +3309,7 @@ func ExampleClustersClient_Get_getSparkOnLinuxCluster() { // Port: to.Ptr[int32](443), // Protocol: to.Ptr("TCP"), // }}, - // CreatedDate: to.Ptr("2017-03-03T08:35:07.323"), + // CreatedDate: to.Ptr("2025-05-08T08:07:09.813"), // OSType: to.Ptr(armhdinsight.OSTypeLinux), // ProvisioningState: to.Ptr(armhdinsight.HDInsightClusterProvisioningStateSucceeded), // QuotaInfo: &armhdinsight.QuotaInfo{ @@ -3388,213 +3320,8 @@ func ExampleClustersClient_Get_getSparkOnLinuxCluster() { // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/8a9dbb28e788355a47dc5bad3ea5f8da212b4bf6/specification/hdinsight/resource-manager/Microsoft.HDInsight/preview/2025-01-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/8a9dbb28e788355a47dc5bad3ea5f8da212b4bf6/specification/hdinsight/resource-manager/Microsoft.HDInsight/preview/2025-01-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/8a9dbb28e788355a47dc5bad3ea5f8da212b4bf6/specification/hdinsight/resource-manager/Microsoft.HDInsight/preview/2025-01-15-preview/examples/DisableClusterAutoScale.json -func ExampleClustersClient_BeginUpdateAutoScaleConfiguration_disableAutoscaleForTheHdInsightCluster() { +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/6312b1c8676b0973f86f078c1177dcb7510158df/specification/hdinsight/resource-manager/Microsoft.HDInsight/HDInsight/preview/2025-01-15-preview/examples/CreateHDInsightClusterWithWasbMsi.json +func ExampleClustersClient_BeginCreate_createClusterWithStorageWasbMsi() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) @@ -3604,18 +3331,193 @@ func ExampleClustersClient_BeginUpdateAutoScaleConfiguration_disableAutoscaleFor if err != nil { log.Fatalf("failed to create client: %v", err) } - poller, err := clientFactory.NewClustersClient().BeginUpdateAutoScaleConfiguration(ctx, "rg1", "cluster1", armhdinsight.RoleNameWorkernode, armhdinsight.AutoscaleConfigurationUpdateParameter{}, nil) + poller, err := clientFactory.NewClustersClient().BeginCreate(ctx, "rg1", "cluster1", armhdinsight.ClusterCreateParametersExtended{ + Identity: &armhdinsight.ClusterIdentity{ + Type: to.Ptr(armhdinsight.ResourceIdentityTypeUserAssigned), + UserAssignedIdentities: map[string]*armhdinsight.UserAssignedIdentity{ + "/subscriptions/subId/resourceGroups/rg1/providers/Microsoft.ManagedIdentity/userAssignedIdentities/msi": {}, + }, + }, + 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("5.1"), + 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), + VirtualNetworkProfile: &armhdinsight.VirtualNetworkProfile{ + ID: to.Ptr("/subscriptions/subId/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/vnetname"), + Subnet: to.Ptr("/subscriptions/subId/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/vnetname/subnets/vnetsubnet"), + }, + }, + { + Name: to.Ptr("workernode"), + 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](3), + VirtualNetworkProfile: &armhdinsight.VirtualNetworkProfile{ + ID: to.Ptr("/subscriptions/subId/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/vnetname"), + Subnet: to.Ptr("/subscriptions/subId/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/vnetname/subnets/vnetsubnet"), + }, + }, + { + Name: to.Ptr("zookeepernode"), + 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](3), + VirtualNetworkProfile: &armhdinsight.VirtualNetworkProfile{ + ID: to.Ptr("/subscriptions/subId/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/vnetname"), + Subnet: to.Ptr("/subscriptions/subId/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/vnetname/subnets/vnetsubnet"), + }, + }}, + }, + OSType: to.Ptr(armhdinsight.OSTypeLinux), + StorageProfile: &armhdinsight.StorageProfile{ + Storageaccounts: []*armhdinsight.StorageAccount{ + { + Name: to.Ptr("mystorage.blob.core.windows.net"), + Container: to.Ptr("containername"), + IsDefault: to.Ptr(true), + MsiResourceID: to.Ptr("/subscriptions/subId/resourceGroups/rg1/providers/Microsoft.ManagedIdentity/userAssignedIdentities/msi"), + ResourceID: to.Ptr("/subscriptions/subId/resourceGroups/rg1/providers/Microsoft.Storage/storageAccounts/mystorage"), + }}, + }, + 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) } - _, err = poller.PollUntilDone(ctx, nil) + 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 Asia"), + // Etag: to.Ptr("ebd7702e-yr32-4968-aba6-f0a3c028b30e"), + // Properties: &armhdinsight.ClusterGetProperties{ + // ClusterDefinition: &armhdinsight.ClusterDefinition{ + // Blueprint: to.Ptr("https://blueprints.azurehdinsight.net/hadoop-5.1.3000.0.2504170544.json"), + // ComponentVersion: map[string]*string{ + // "Hadoop": to.Ptr("3.3"), + // }, + // Kind: to.Ptr("Hadoop"), + // }, + // ClusterState: to.Ptr("Running"), + // ClusterVersion: to.Ptr("5.1.3000.0"), + // ComputeProfile: &armhdinsight.ComputeProfile{ + // Roles: []*armhdinsight.Role{ + // { + // Name: to.Ptr("headnode"), + // HardwareProfile: &armhdinsight.HardwareProfile{ + // VMSize: to.Ptr("Standard_E8_V3"), + // }, + // 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_E8_V3"), + // }, + // 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_E8_V3"), + // }, + // 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("2025-05-08T08:07:09.813"), + // 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/8a9dbb28e788355a47dc5bad3ea5f8da212b4bf6/specification/hdinsight/resource-manager/Microsoft.HDInsight/preview/2025-01-15-preview/examples/EnableOrUpdateAutoScaleWithLoadBasedConfiguration.json -func ExampleClustersClient_BeginUpdateAutoScaleConfiguration_enableOrUpdateAutoscaleWithTheLoadBasedConfigurationForHdInsightCluster() { +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/6312b1c8676b0973f86f078c1177dcb7510158df/specification/hdinsight/resource-manager/Microsoft.HDInsight/HDInsight/preview/2025-01-15-preview/examples/PatchLinuxHadoopCluster.json +func ExampleClustersClient_Update_patchHdInsightLinuxClusters() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) @@ -3625,25 +3527,100 @@ func ExampleClustersClient_BeginUpdateAutoScaleConfiguration_enableOrUpdateAutos 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), - }, + 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) } - _, 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/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/8a9dbb28e788355a47dc5bad3ea5f8da212b4bf6/specification/hdinsight/resource-manager/Microsoft.HDInsight/preview/2025-01-15-preview/examples/EnableOrUpdateAutoScaleWithScheduleBasedConfiguration.json -func ExampleClustersClient_BeginUpdateAutoScaleConfiguration_enableOrUpdateAutoscaleWithTheScheduleBasedConfigurationForHdInsightCluster() { +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/6312b1c8676b0973f86f078c1177dcb7510158df/specification/hdinsight/resource-manager/Microsoft.HDInsight/HDInsight/preview/2025-01-15-preview/examples/PatchLinuxHadoopClusterWithSystemMSI.json +func ExampleClustersClient_Update_patchHdInsightLinuxClustersWithSystemAssignedMsi() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) @@ -3653,216 +3630,129 @@ func ExampleClustersClient_BeginUpdateAutoScaleConfiguration_enableOrUpdateAutos 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"), - }, + res, err := clientFactory.NewClustersClient().Update(ctx, "rg1", "cluster1", armhdinsight.ClusterPatchParameters{ + Identity: &armhdinsight.ClusterIdentity{ + Type: to.Ptr(armhdinsight.ResourceIdentityTypeSystemAssigned), + }, + 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) } - _, 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/8a9dbb28e788355a47dc5bad3ea5f8da212b4bf6/specification/hdinsight/resource-manager/Microsoft.HDInsight/preview/2025-01-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), - // }, - // }}, - // } + // 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"), + // Identity: &armhdinsight.ClusterIdentity{ + // Type: to.Ptr(armhdinsight.ResourceIdentityTypeSystemAssigned), + // PrincipalID: to.Ptr("principalId"), + // TenantID: to.Ptr("tenantId"), + // }, + // 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/6312b1c8676b0973f86f078c1177dcb7510158df/specification/hdinsight/resource-manager/Microsoft.HDInsight/HDInsight/preview/2025-01-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/8a9dbb28e788355a47dc5bad3ea5f8da212b4bf6/specification/hdinsight/resource-manager/Microsoft.HDInsight/preview/2025-01-15-preview/examples/RotateLinuxHadoopClusterDiskEncryptionKey.json -func ExampleClustersClient_BeginRotateDiskEncryptionKey() { +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/6312b1c8676b0973f86f078c1177dcb7510158df/specification/hdinsight/resource-manager/Microsoft.HDInsight/HDInsight/preview/2025-01-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) @@ -3872,10 +3762,40 @@ func ExampleClustersClient_BeginRotateDiskEncryptionKey() { 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/"), + 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/6312b1c8676b0973f86f078c1177dcb7510158df/specification/hdinsight/resource-manager/Microsoft.HDInsight/HDInsight/preview/2025-01-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) @@ -3886,7 +3806,7 @@ func ExampleClustersClient_BeginRotateDiskEncryptionKey() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/8a9dbb28e788355a47dc5bad3ea5f8da212b4bf6/specification/hdinsight/resource-manager/Microsoft.HDInsight/preview/2025-01-15-preview/examples/HDI_Clusters_GetGatewaySettings.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/6312b1c8676b0973f86f078c1177dcb7510158df/specification/hdinsight/resource-manager/Microsoft.HDInsight/HDInsight/preview/2025-01-15-preview/examples/HDI_Clusters_GetGatewaySettings.json func ExampleClustersClient_GetGatewaySettings() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -3911,8 +3831,8 @@ func ExampleClustersClient_GetGatewaySettings() { // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/8a9dbb28e788355a47dc5bad3ea5f8da212b4bf6/specification/hdinsight/resource-manager/Microsoft.HDInsight/preview/2025-01-15-preview/examples/HDI_Clusters_UpdateGatewaySettings_Enable.json -func ExampleClustersClient_BeginUpdateGatewaySettings_enableHttpConnectivity() { +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/6312b1c8676b0973f86f078c1177dcb7510158df/specification/hdinsight/resource-manager/Microsoft.HDInsight/HDInsight/preview/2025-01-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) @@ -3922,10 +3842,34 @@ func ExampleClustersClient_BeginUpdateGatewaySettings_enableHttpConnectivity() { 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"), + 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/6312b1c8676b0973f86f078c1177dcb7510158df/specification/hdinsight/resource-manager/Microsoft.HDInsight/HDInsight/preview/2025-01-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) @@ -3936,8 +3880,8 @@ func ExampleClustersClient_BeginUpdateGatewaySettings_enableHttpConnectivity() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/8a9dbb28e788355a47dc5bad3ea5f8da212b4bf6/specification/hdinsight/resource-manager/Microsoft.HDInsight/preview/2025-01-15-preview/examples/HDI_Clusters_UpdateGatewaySettings_EntraUser.json -func ExampleClustersClient_BeginUpdateGatewaySettings_updateEntraUserInHdInsight() { +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/6312b1c8676b0973f86f078c1177dcb7510158df/specification/hdinsight/resource-manager/Microsoft.HDInsight/HDInsight/preview/2025-01-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) @@ -3947,14 +3891,22 @@ func ExampleClustersClient_BeginUpdateGatewaySettings_updateEntraUserInHdInsight if err != nil { log.Fatalf("failed to create client: %v", err) } - poller, err := clientFactory.NewClustersClient().BeginUpdateGatewaySettings(ctx, "rg1", "cluster1", armhdinsight.UpdateGatewaySettingsParameters{ - IsCredentialEnabled: to.Ptr(false), - RestAuthEntraUsers: []*armhdinsight.EntraUserInfo{ - { - DisplayName: to.Ptr("displayName"), - ObjectID: to.Ptr("00000000-0000-0000-0000-000000000000"), - Upn: to.Ptr("user@microsoft.com"), - }}, + 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) @@ -3965,8 +3917,8 @@ func ExampleClustersClient_BeginUpdateGatewaySettings_updateEntraUserInHdInsight } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/8a9dbb28e788355a47dc5bad3ea5f8da212b4bf6/specification/hdinsight/resource-manager/Microsoft.HDInsight/preview/2025-01-15-preview/examples/GetClusterCreatingAsyncOperationStatus.json -func ExampleClustersClient_GetAzureAsyncOperationStatus() { +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/6312b1c8676b0973f86f078c1177dcb7510158df/specification/hdinsight/resource-manager/Microsoft.HDInsight/HDInsight/preview/2025-01-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) @@ -3976,19 +3928,44 @@ func ExampleClustersClient_GetAzureAsyncOperationStatus() { 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) + 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) } - // 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), - // } + _, 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/6312b1c8676b0973f86f078c1177dcb7510158df/specification/hdinsight/resource-manager/Microsoft.HDInsight/HDInsight/preview/2025-01-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/8a9dbb28e788355a47dc5bad3ea5f8da212b4bf6/specification/hdinsight/resource-manager/Microsoft.HDInsight/preview/2025-01-15-preview/examples/HDI_Clusters_UpdateClusterIdentityCertificate.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/6312b1c8676b0973f86f078c1177dcb7510158df/specification/hdinsight/resource-manager/Microsoft.HDInsight/HDInsight/preview/2025-01-15-preview/examples/HDI_Clusters_UpdateClusterIdentityCertificate.json func ExampleClustersClient_BeginUpdateIdentityCertificate() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -4013,8 +3990,8 @@ func ExampleClustersClient_BeginUpdateIdentityCertificate() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/8a9dbb28e788355a47dc5bad3ea5f8da212b4bf6/specification/hdinsight/resource-manager/Microsoft.HDInsight/preview/2025-01-15-preview/examples/PostExecuteScriptAction.json -func ExampleClustersClient_BeginExecuteScriptActions() { +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/6312b1c8676b0973f86f078c1177dcb7510158df/specification/hdinsight/resource-manager/Microsoft.HDInsight/HDInsight/preview/2025-01-15-preview/examples/HDI_Clusters_UpdateGatewaySettings_Enable.json +func ExampleClustersClient_BeginUpdateGatewaySettings_enableHttpConnectivity() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) @@ -4024,16 +4001,38 @@ func ExampleClustersClient_BeginExecuteScriptActions() { 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{ + 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/6312b1c8676b0973f86f078c1177dcb7510158df/specification/hdinsight/resource-manager/Microsoft.HDInsight/HDInsight/preview/2025-01-15-preview/examples/HDI_Clusters_UpdateGatewaySettings_EntraUser.json +func ExampleClustersClient_BeginUpdateGatewaySettings_updateEntraUserInHdInsight() { + 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(false), + RestAuthEntraUsers: []*armhdinsight.EntraUserInfo{ { - Name: to.Ptr("Test"), - Parameters: to.Ptr(""), - Roles: []*string{ - to.Ptr("headnode"), - to.Ptr("workernode")}, - URI: to.Ptr("http://testurl.com/install.ssh"), + DisplayName: to.Ptr("displayName"), + ObjectID: to.Ptr("00000000-0000-0000-0000-000000000000"), + Upn: to.Ptr("user@microsoft.com"), }}, }, nil) if err != nil { diff --git a/sdk/resourcemanager/hdinsight/armhdinsight/configurations_client.go b/sdk/resourcemanager/hdinsight/armhdinsight/configurations_client.go index cf6a6608f5c5..d9ff521bf4c8 100644 --- a/sdk/resourcemanager/hdinsight/armhdinsight/configurations_client.go +++ b/sdk/resourcemanager/hdinsight/armhdinsight/configurations_client.go @@ -25,10 +25,9 @@ type ConfigurationsClient struct { } // NewConfigurationsClient creates a new instance of ConfigurationsClient with the specified values. -// - subscriptionID - The subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID -// forms part of the URI for every service call. +// - subscriptionID - The ID of the target subscription. // - credential - used to authorize requests. Usually a credential from azidentity. -// - options - pass nil to accept the default values. +// - options - Contains optional client configuration. Pass nil to accept the default values. func NewConfigurationsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*ConfigurationsClient, error) { cl, err := arm.NewClient(moduleName, moduleVersion, credential, options) if err != nil { @@ -46,7 +45,7 @@ func NewConfigurationsClient(subscriptionID string, credential azcore.TokenCrede // If the operation fails it returns an *azcore.ResponseError type. // // Generated from API version 2025-01-15-preview -// - resourceGroupName - The name of the resource group. +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - clusterName - The name of the cluster. // - configurationName - The name of the cluster configuration. // - options - ConfigurationsClientGetOptions contains the optional parameters for the ConfigurationsClient.Get method. @@ -115,7 +114,7 @@ func (client *ConfigurationsClient) getHandleResponse(resp *http.Response) (Conf // If the operation fails it returns an *azcore.ResponseError type. // // Generated from API version 2025-01-15-preview -// - resourceGroupName - The name of the resource group. +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - 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) { @@ -180,7 +179,7 @@ func (client *ConfigurationsClient) listHandleResponse(resp *http.Response) (Con // If the operation fails it returns an *azcore.ResponseError type. // // Generated from API version 2025-01-15-preview -// - resourceGroupName - The name of the resource group. +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - clusterName - The name of the cluster. // - configurationName - The name of the cluster configuration. // - parameters - The cluster configurations. diff --git a/sdk/resourcemanager/hdinsight/armhdinsight/configurations_client_example_test.go b/sdk/resourcemanager/hdinsight/armhdinsight/configurations_client_example_test.go index 8e81e55c0275..3a15b94b5499 100644 --- a/sdk/resourcemanager/hdinsight/armhdinsight/configurations_client_example_test.go +++ b/sdk/resourcemanager/hdinsight/armhdinsight/configurations_client_example_test.go @@ -1,8 +1,7 @@ // 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_test @@ -15,7 +14,7 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/hdinsight/armhdinsight" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/8a9dbb28e788355a47dc5bad3ea5f8da212b4bf6/specification/hdinsight/resource-manager/Microsoft.HDInsight/preview/2025-01-15-preview/examples/HDI_Configurations_List.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/6312b1c8676b0973f86f078c1177dcb7510158df/specification/hdinsight/resource-manager/Microsoft.HDInsight/HDInsight/preview/2025-01-15-preview/examples/HDI_Configurations_List.json func ExampleConfigurationsClient_List() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -48,8 +47,8 @@ func ExampleConfigurationsClient_List() { // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/8a9dbb28e788355a47dc5bad3ea5f8da212b4bf6/specification/hdinsight/resource-manager/Microsoft.HDInsight/preview/2025-01-15-preview/examples/ChangeHttpConnectivityDisable.json -func ExampleConfigurationsClient_BeginUpdate_disableHttpConnectivity() { +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/6312b1c8676b0973f86f078c1177dcb7510158df/specification/hdinsight/resource-manager/Microsoft.HDInsight/HDInsight/preview/2025-01-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) @@ -59,20 +58,21 @@ func ExampleConfigurationsClient_BeginUpdate_disableHttpConnectivity() { 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) + res, err := clientFactory.NewConfigurationsClient().Get(ctx, "rg1", "cluster1", "core-site", 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) - } + // 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"), + // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/8a9dbb28e788355a47dc5bad3ea5f8da212b4bf6/specification/hdinsight/resource-manager/Microsoft.HDInsight/preview/2025-01-15-preview/examples/ChangeHttpConnectivityEnable.json -func ExampleConfigurationsClient_BeginUpdate_enableHttpConnectivity() { +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/6312b1c8676b0973f86f078c1177dcb7510158df/specification/hdinsight/resource-manager/Microsoft.HDInsight/HDInsight/preview/2025-01-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) @@ -83,9 +83,7 @@ func ExampleConfigurationsClient_BeginUpdate_enableHttpConnectivity() { 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"), + "restAuthCredential.isEnabled": to.Ptr("false"), }, nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) @@ -96,8 +94,8 @@ func ExampleConfigurationsClient_BeginUpdate_enableHttpConnectivity() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/8a9dbb28e788355a47dc5bad3ea5f8da212b4bf6/specification/hdinsight/resource-manager/Microsoft.HDInsight/preview/2025-01-15-preview/examples/HDI_Configurations_Get.json -func ExampleConfigurationsClient_Get() { +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/6312b1c8676b0973f86f078c1177dcb7510158df/specification/hdinsight/resource-manager/Microsoft.HDInsight/HDInsight/preview/2025-01-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) @@ -107,15 +105,16 @@ func ExampleConfigurationsClient_Get() { if err != nil { log.Fatalf("failed to create client: %v", err) } - res, err := clientFactory.NewConfigurationsClient().Get(ctx, "rg1", "cluster1", "core-site", nil) + 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) } - // 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"), - // } + _, err = poller.PollUntilDone(ctx, nil) + if err != nil { + log.Fatalf("failed to pull the result: %v", err) + } } diff --git a/sdk/resourcemanager/hdinsight/armhdinsight/constants.go b/sdk/resourcemanager/hdinsight/armhdinsight/constants.go index e41826167e04..e9221a092bee 100644 --- a/sdk/resourcemanager/hdinsight/armhdinsight/constants.go +++ b/sdk/resourcemanager/hdinsight/armhdinsight/constants.go @@ -9,9 +9,12 @@ package armhdinsight type AsyncOperationState string const ( - AsyncOperationStateFailed AsyncOperationState = "Failed" + // AsyncOperationStateFailed - Failed + AsyncOperationStateFailed AsyncOperationState = "Failed" + // AsyncOperationStateInProgress - InProgress AsyncOperationStateInProgress AsyncOperationState = "InProgress" - AsyncOperationStateSucceeded AsyncOperationState = "Succeeded" + // AsyncOperationStateSucceeded - Succeeded + AsyncOperationStateSucceeded AsyncOperationState = "Succeeded" ) // PossibleAsyncOperationStateValues returns the possible values for the AsyncOperationState const type. @@ -46,12 +49,19 @@ func PossibleCreatedByTypeValues() []CreatedByType { type DaysOfWeek string const ( - DaysOfWeekFriday DaysOfWeek = "Friday" - DaysOfWeekMonday DaysOfWeek = "Monday" - DaysOfWeekSaturday DaysOfWeek = "Saturday" - DaysOfWeekSunday DaysOfWeek = "Sunday" - DaysOfWeekThursday DaysOfWeek = "Thursday" - DaysOfWeekTuesday DaysOfWeek = "Tuesday" + // DaysOfWeekFriday - Friday + DaysOfWeekFriday DaysOfWeek = "Friday" + // DaysOfWeekMonday - Monday + DaysOfWeekMonday DaysOfWeek = "Monday" + // DaysOfWeekSaturday - Saturday + DaysOfWeekSaturday DaysOfWeek = "Saturday" + // DaysOfWeekSunday - Sunday + DaysOfWeekSunday DaysOfWeek = "Sunday" + // DaysOfWeekThursday - Thursday + DaysOfWeekThursday DaysOfWeek = "Thursday" + // DaysOfWeekTuesday - Tuesday + DaysOfWeekTuesday DaysOfWeek = "Tuesday" + // DaysOfWeekWednesday - Wednesday DaysOfWeekWednesday DaysOfWeek = "Wednesday" ) @@ -72,6 +82,7 @@ func PossibleDaysOfWeekValues() []DaysOfWeek { type DirectoryType string const ( + // DirectoryTypeActiveDirectory - ActiveDirectory DirectoryTypeActiveDirectory DirectoryType = "ActiveDirectory" ) @@ -86,9 +97,13 @@ func PossibleDirectoryTypeValues() []DirectoryType { type FilterMode string const ( - FilterModeDefault FilterMode = "Default" - FilterModeExclude FilterMode = "Exclude" - FilterModeInclude FilterMode = "Include" + // FilterModeDefault - Default + FilterModeDefault FilterMode = "Default" + // FilterModeExclude - Exclude + FilterModeExclude FilterMode = "Exclude" + // FilterModeInclude - Include + FilterModeInclude FilterMode = "Include" + // FilterModeRecommend - Recommend FilterModeRecommend FilterMode = "Recommend" ) @@ -106,11 +121,16 @@ func PossibleFilterModeValues() []FilterMode { type HDInsightClusterProvisioningState string const ( - HDInsightClusterProvisioningStateCanceled HDInsightClusterProvisioningState = "Canceled" - HDInsightClusterProvisioningStateDeleting HDInsightClusterProvisioningState = "Deleting" - HDInsightClusterProvisioningStateFailed HDInsightClusterProvisioningState = "Failed" + // HDInsightClusterProvisioningStateCanceled - Canceled + HDInsightClusterProvisioningStateCanceled HDInsightClusterProvisioningState = "Canceled" + // HDInsightClusterProvisioningStateDeleting - Deleting + HDInsightClusterProvisioningStateDeleting HDInsightClusterProvisioningState = "Deleting" + // HDInsightClusterProvisioningStateFailed - Failed + HDInsightClusterProvisioningStateFailed HDInsightClusterProvisioningState = "Failed" + // HDInsightClusterProvisioningStateInProgress - InProgress HDInsightClusterProvisioningStateInProgress HDInsightClusterProvisioningState = "InProgress" - HDInsightClusterProvisioningStateSucceeded HDInsightClusterProvisioningState = "Succeeded" + // HDInsightClusterProvisioningStateSucceeded - Succeeded + HDInsightClusterProvisioningStateSucceeded HDInsightClusterProvisioningState = "Succeeded" ) // PossibleHDInsightClusterProvisioningStateValues returns the possible values for the HDInsightClusterProvisioningState const type. @@ -128,8 +148,11 @@ func PossibleHDInsightClusterProvisioningStateValues() []HDInsightClusterProvisi type JSONWebKeyEncryptionAlgorithm string const ( - JSONWebKeyEncryptionAlgorithmRSA15 JSONWebKeyEncryptionAlgorithm = "RSA1_5" - JSONWebKeyEncryptionAlgorithmRSAOAEP JSONWebKeyEncryptionAlgorithm = "RSA-OAEP" + // JSONWebKeyEncryptionAlgorithmRSA15 - RSA1_5 + JSONWebKeyEncryptionAlgorithmRSA15 JSONWebKeyEncryptionAlgorithm = "RSA1_5" + // JSONWebKeyEncryptionAlgorithmRSAOAEP - RSA-OAEP + JSONWebKeyEncryptionAlgorithmRSAOAEP JSONWebKeyEncryptionAlgorithm = "RSA-OAEP" + // JSONWebKeyEncryptionAlgorithmRSAOAEP256 - RSA-OAEP-256 JSONWebKeyEncryptionAlgorithmRSAOAEP256 JSONWebKeyEncryptionAlgorithm = "RSA-OAEP-256" ) @@ -146,7 +169,9 @@ func PossibleJSONWebKeyEncryptionAlgorithmValues() []JSONWebKeyEncryptionAlgorit type OSType string const ( - OSTypeLinux OSType = "Linux" + // OSTypeLinux - Linux + OSTypeLinux OSType = "Linux" + // OSTypeWindows - Windows OSTypeWindows OSType = "Windows" ) @@ -164,8 +189,10 @@ func PossibleOSTypeValues() []OSType { type OutboundDependenciesManagedType string const ( + // OutboundDependenciesManagedTypeExternal - External OutboundDependenciesManagedTypeExternal OutboundDependenciesManagedType = "External" - OutboundDependenciesManagedTypeManaged OutboundDependenciesManagedType = "Managed" + // OutboundDependenciesManagedTypeManaged - Managed + OutboundDependenciesManagedTypeManaged OutboundDependenciesManagedType = "Managed" ) // PossibleOutboundDependenciesManagedTypeValues returns the possible values for the OutboundDependenciesManagedType const type. @@ -180,12 +207,18 @@ func PossibleOutboundDependenciesManagedTypeValues() []OutboundDependenciesManag type PrivateEndpointConnectionProvisioningState string const ( - PrivateEndpointConnectionProvisioningStateCanceled PrivateEndpointConnectionProvisioningState = "Canceled" - PrivateEndpointConnectionProvisioningStateDeleting PrivateEndpointConnectionProvisioningState = "Deleting" - PrivateEndpointConnectionProvisioningStateFailed PrivateEndpointConnectionProvisioningState = "Failed" + // PrivateEndpointConnectionProvisioningStateCanceled - Canceled + PrivateEndpointConnectionProvisioningStateCanceled PrivateEndpointConnectionProvisioningState = "Canceled" + // PrivateEndpointConnectionProvisioningStateDeleting - Deleting + PrivateEndpointConnectionProvisioningStateDeleting PrivateEndpointConnectionProvisioningState = "Deleting" + // PrivateEndpointConnectionProvisioningStateFailed - Failed + PrivateEndpointConnectionProvisioningStateFailed PrivateEndpointConnectionProvisioningState = "Failed" + // PrivateEndpointConnectionProvisioningStateInProgress - InProgress PrivateEndpointConnectionProvisioningStateInProgress PrivateEndpointConnectionProvisioningState = "InProgress" - PrivateEndpointConnectionProvisioningStateSucceeded PrivateEndpointConnectionProvisioningState = "Succeeded" - PrivateEndpointConnectionProvisioningStateUpdating PrivateEndpointConnectionProvisioningState = "Updating" + // PrivateEndpointConnectionProvisioningStateSucceeded - Succeeded + PrivateEndpointConnectionProvisioningStateSucceeded PrivateEndpointConnectionProvisioningState = "Succeeded" + // PrivateEndpointConnectionProvisioningStateUpdating - Updating + PrivateEndpointConnectionProvisioningStateUpdating PrivateEndpointConnectionProvisioningState = "Updating" ) // PossiblePrivateEndpointConnectionProvisioningStateValues returns the possible values for the PrivateEndpointConnectionProvisioningState const type. @@ -204,8 +237,10 @@ func PossiblePrivateEndpointConnectionProvisioningStateValues() []PrivateEndpoin type PrivateIPAllocationMethod string const ( + // PrivateIPAllocationMethodDynamic - dynamic PrivateIPAllocationMethodDynamic PrivateIPAllocationMethod = "dynamic" - PrivateIPAllocationMethodStatic PrivateIPAllocationMethod = "static" + // PrivateIPAllocationMethodStatic - static + PrivateIPAllocationMethodStatic PrivateIPAllocationMethod = "static" ) // PossiblePrivateIPAllocationMethodValues returns the possible values for the PrivateIPAllocationMethod const type. @@ -220,8 +255,10 @@ func PossiblePrivateIPAllocationMethodValues() []PrivateIPAllocationMethod { type PrivateLink string const ( + // PrivateLinkDisabled - Disabled PrivateLinkDisabled PrivateLink = "Disabled" - PrivateLinkEnabled PrivateLink = "Enabled" + // PrivateLinkEnabled - Enabled + PrivateLinkEnabled PrivateLink = "Enabled" ) // PossiblePrivateLinkValues returns the possible values for the PrivateLink const type. @@ -237,11 +274,16 @@ func PossiblePrivateLinkValues() []PrivateLink { type PrivateLinkConfigurationProvisioningState string const ( - PrivateLinkConfigurationProvisioningStateCanceled PrivateLinkConfigurationProvisioningState = "Canceled" - PrivateLinkConfigurationProvisioningStateDeleting PrivateLinkConfigurationProvisioningState = "Deleting" - PrivateLinkConfigurationProvisioningStateFailed PrivateLinkConfigurationProvisioningState = "Failed" + // PrivateLinkConfigurationProvisioningStateCanceled - Canceled + PrivateLinkConfigurationProvisioningStateCanceled PrivateLinkConfigurationProvisioningState = "Canceled" + // PrivateLinkConfigurationProvisioningStateDeleting - Deleting + PrivateLinkConfigurationProvisioningStateDeleting PrivateLinkConfigurationProvisioningState = "Deleting" + // PrivateLinkConfigurationProvisioningStateFailed - Failed + PrivateLinkConfigurationProvisioningStateFailed PrivateLinkConfigurationProvisioningState = "Failed" + // PrivateLinkConfigurationProvisioningStateInProgress - InProgress PrivateLinkConfigurationProvisioningStateInProgress PrivateLinkConfigurationProvisioningState = "InProgress" - PrivateLinkConfigurationProvisioningStateSucceeded PrivateLinkConfigurationProvisioningState = "Succeeded" + // PrivateLinkConfigurationProvisioningStateSucceeded - Succeeded + PrivateLinkConfigurationProvisioningStateSucceeded PrivateLinkConfigurationProvisioningState = "Succeeded" ) // PossiblePrivateLinkConfigurationProvisioningStateValues returns the possible values for the PrivateLinkConfigurationProvisioningState const type. @@ -259,10 +301,14 @@ func PossiblePrivateLinkConfigurationProvisioningStateValues() []PrivateLinkConf type PrivateLinkServiceConnectionStatus string const ( + // PrivateLinkServiceConnectionStatusApproved - Approved PrivateLinkServiceConnectionStatusApproved PrivateLinkServiceConnectionStatus = "Approved" - PrivateLinkServiceConnectionStatusPending PrivateLinkServiceConnectionStatus = "Pending" + // PrivateLinkServiceConnectionStatusPending - Pending + PrivateLinkServiceConnectionStatusPending PrivateLinkServiceConnectionStatus = "Pending" + // PrivateLinkServiceConnectionStatusRejected - Rejected PrivateLinkServiceConnectionStatusRejected PrivateLinkServiceConnectionStatus = "Rejected" - PrivateLinkServiceConnectionStatusRemoved PrivateLinkServiceConnectionStatus = "Removed" + // PrivateLinkServiceConnectionStatusRemoved - Removed + PrivateLinkServiceConnectionStatusRemoved PrivateLinkServiceConnectionStatus = "Removed" ) // PossiblePrivateLinkServiceConnectionStatusValues returns the possible values for the PrivateLinkServiceConnectionStatus const type. @@ -280,10 +326,14 @@ func PossiblePrivateLinkServiceConnectionStatusValues() []PrivateLinkServiceConn type ResourceIdentityType string const ( - ResourceIdentityTypeNone ResourceIdentityType = "None" - ResourceIdentityTypeSystemAssigned ResourceIdentityType = "SystemAssigned" + // ResourceIdentityTypeNone - None + ResourceIdentityTypeNone ResourceIdentityType = "None" + // ResourceIdentityTypeSystemAssigned - SystemAssigned + ResourceIdentityTypeSystemAssigned ResourceIdentityType = "SystemAssigned" + // ResourceIdentityTypeSystemAssignedUserAssigned - SystemAssigned, UserAssigned ResourceIdentityTypeSystemAssignedUserAssigned ResourceIdentityType = "SystemAssigned, UserAssigned" - ResourceIdentityTypeUserAssigned ResourceIdentityType = "UserAssigned" + // ResourceIdentityTypeUserAssigned - UserAssigned + ResourceIdentityTypeUserAssigned ResourceIdentityType = "UserAssigned" ) // PossibleResourceIdentityTypeValues returns the possible values for the ResourceIdentityType const type. @@ -300,7 +350,9 @@ func PossibleResourceIdentityTypeValues() []ResourceIdentityType { type ResourceProviderConnection string const ( - ResourceProviderConnectionInbound ResourceProviderConnection = "Inbound" + // ResourceProviderConnectionInbound - Inbound + ResourceProviderConnectionInbound ResourceProviderConnection = "Inbound" + // ResourceProviderConnectionOutbound - Outbound ResourceProviderConnectionOutbound ResourceProviderConnection = "Outbound" ) @@ -315,6 +367,7 @@ func PossibleResourceProviderConnectionValues() []ResourceProviderConnection { type RoleName string const ( + // RoleNameWorkernode - workernode RoleNameWorkernode RoleName = "workernode" ) @@ -329,7 +382,9 @@ func PossibleRoleNameValues() []RoleName { type Tier string const ( - TierPremium Tier = "Premium" + // TierPremium - Premium + TierPremium Tier = "Premium" + // TierStandard - Standard TierStandard Tier = "Standard" ) diff --git a/sdk/resourcemanager/hdinsight/armhdinsight/extensions_client.go b/sdk/resourcemanager/hdinsight/armhdinsight/extensions_client.go index d77f25242a04..2e13687454cf 100644 --- a/sdk/resourcemanager/hdinsight/armhdinsight/extensions_client.go +++ b/sdk/resourcemanager/hdinsight/armhdinsight/extensions_client.go @@ -25,10 +25,9 @@ type ExtensionsClient struct { } // NewExtensionsClient creates a new instance of ExtensionsClient with the specified values. -// - subscriptionID - The subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID -// forms part of the URI for every service call. +// - subscriptionID - The ID of the target subscription. // - credential - used to authorize requests. Usually a credential from azidentity. -// - options - pass nil to accept the default values. +// - options - Contains optional client configuration. Pass nil to accept the default values. func NewExtensionsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*ExtensionsClient, error) { cl, err := arm.NewClient(moduleName, moduleVersion, credential, options) if err != nil { @@ -45,7 +44,7 @@ func NewExtensionsClient(subscriptionID string, credential azcore.TokenCredentia // If the operation fails it returns an *azcore.ResponseError type. // // Generated from API version 2025-01-15-preview -// - resourceGroupName - The name of the resource group. +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - clusterName - The name of the cluster. // - extensionName - The name of the cluster extension. // - parameters - The cluster extensions create request. @@ -130,7 +129,7 @@ func (client *ExtensionsClient) createCreateRequest(ctx context.Context, resourc // If the operation fails it returns an *azcore.ResponseError type. // // Generated from API version 2025-01-15-preview -// - resourceGroupName - The name of the resource group. +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - clusterName - The name of the cluster. // - extensionName - The name of the cluster extension. // - options - ExtensionsClientBeginDeleteOptions contains the optional parameters for the ExtensionsClient.BeginDelete method. @@ -211,7 +210,7 @@ func (client *ExtensionsClient) deleteCreateRequest(ctx context.Context, resourc // If the operation fails it returns an *azcore.ResponseError type. // // Generated from API version 2025-01-15-preview -// - resourceGroupName - The name of the resource group. +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - clusterName - The name of the cluster. // - options - ExtensionsClientBeginDisableAzureMonitorOptions contains the optional parameters for the ExtensionsClient.BeginDisableAzureMonitor // method. @@ -288,7 +287,7 @@ func (client *ExtensionsClient) disableAzureMonitorCreateRequest(ctx context.Con // If the operation fails it returns an *azcore.ResponseError type. // // Generated from API version 2025-01-15-preview -// - resourceGroupName - The name of the resource group. +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - clusterName - The name of the cluster. // - options - ExtensionsClientBeginDisableAzureMonitorAgentOptions contains the optional parameters for the ExtensionsClient.BeginDisableAzureMonitorAgent // method. @@ -365,7 +364,7 @@ func (client *ExtensionsClient) disableAzureMonitorAgentCreateRequest(ctx contex // If the operation fails it returns an *azcore.ResponseError type. // // Generated from API version 2025-01-15-preview -// - resourceGroupName - The name of the resource group. +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - clusterName - The name of the cluster. // - options - ExtensionsClientBeginDisableMonitoringOptions contains the optional parameters for the ExtensionsClient.BeginDisableMonitoring // method. @@ -442,7 +441,7 @@ func (client *ExtensionsClient) disableMonitoringCreateRequest(ctx context.Conte // If the operation fails it returns an *azcore.ResponseError type. // // Generated from API version 2025-01-15-preview -// - resourceGroupName - The name of the resource group. +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - clusterName - The name of the cluster. // - parameters - The Log Analytics workspace parameters. // - options - ExtensionsClientBeginEnableAzureMonitorOptions contains the optional parameters for the ExtensionsClient.BeginEnableAzureMonitor @@ -523,7 +522,7 @@ func (client *ExtensionsClient) enableAzureMonitorCreateRequest(ctx context.Cont // If the operation fails it returns an *azcore.ResponseError type. // // Generated from API version 2025-01-15-preview -// - resourceGroupName - The name of the resource group. +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - clusterName - The name of the cluster. // - parameters - The Log Analytics workspace parameters. // - options - ExtensionsClientBeginEnableAzureMonitorAgentOptions contains the optional parameters for the ExtensionsClient.BeginEnableAzureMonitorAgent @@ -604,7 +603,7 @@ func (client *ExtensionsClient) enableAzureMonitorAgentCreateRequest(ctx context // If the operation fails it returns an *azcore.ResponseError type. // // Generated from API version 2025-01-15-preview -// - resourceGroupName - The name of the resource group. +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - clusterName - The name of the cluster. // - parameters - The Operations Management Suite (OMS) workspace parameters. // - options - ExtensionsClientBeginEnableMonitoringOptions contains the optional parameters for the ExtensionsClient.BeginEnableMonitoring @@ -685,7 +684,7 @@ func (client *ExtensionsClient) enableMonitoringCreateRequest(ctx context.Contex // If the operation fails it returns an *azcore.ResponseError type. // // Generated from API version 2025-01-15-preview -// - resourceGroupName - The name of the resource group. +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - clusterName - The name of the cluster. // - extensionName - The name of the cluster extension. // - options - ExtensionsClientGetOptions contains the optional parameters for the ExtensionsClient.Get method. @@ -754,7 +753,7 @@ func (client *ExtensionsClient) getHandleResponse(resp *http.Response) (Extensio // If the operation fails it returns an *azcore.ResponseError type. // // Generated from API version 2025-01-15-preview -// - resourceGroupName - The name of the resource group. +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - clusterName - The name of the cluster. // - extensionName - The name of the cluster extension. // - operationID - The long running operation id. @@ -829,7 +828,7 @@ func (client *ExtensionsClient) getAzureAsyncOperationStatusHandleResponse(resp // If the operation fails it returns an *azcore.ResponseError type. // // Generated from API version 2025-01-15-preview -// - resourceGroupName - The name of the resource group. +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - clusterName - The name of the cluster. // - options - ExtensionsClientGetAzureMonitorAgentStatusOptions contains the optional parameters for the ExtensionsClient.GetAzureMonitorAgentStatus // method. @@ -894,7 +893,7 @@ func (client *ExtensionsClient) getAzureMonitorAgentStatusHandleResponse(resp *h // If the operation fails it returns an *azcore.ResponseError type. // // Generated from API version 2025-01-15-preview -// - resourceGroupName - The name of the resource group. +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - clusterName - The name of the cluster. // - options - ExtensionsClientGetAzureMonitorStatusOptions contains the optional parameters for the ExtensionsClient.GetAzureMonitorStatus // method. @@ -959,7 +958,7 @@ func (client *ExtensionsClient) getAzureMonitorStatusHandleResponse(resp *http.R // If the operation fails it returns an *azcore.ResponseError type. // // Generated from API version 2025-01-15-preview -// - resourceGroupName - The name of the resource group. +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - clusterName - The name of the cluster. // - options - ExtensionsClientGetMonitoringStatusOptions contains the optional parameters for the ExtensionsClient.GetMonitoringStatus // method. diff --git a/sdk/resourcemanager/hdinsight/armhdinsight/extensions_client_example_test.go b/sdk/resourcemanager/hdinsight/armhdinsight/extensions_client_example_test.go index 430c171af10a..52047eb5c540 100644 --- a/sdk/resourcemanager/hdinsight/armhdinsight/extensions_client_example_test.go +++ b/sdk/resourcemanager/hdinsight/armhdinsight/extensions_client_example_test.go @@ -1,8 +1,7 @@ // 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_test @@ -15,8 +14,8 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/hdinsight/armhdinsight" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/8a9dbb28e788355a47dc5bad3ea5f8da212b4bf6/specification/hdinsight/resource-manager/Microsoft.HDInsight/preview/2025-01-15-preview/examples/EnableLinuxClusterMonitoring.json -func ExampleExtensionsClient_BeginEnableMonitoring() { +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/6312b1c8676b0973f86f078c1177dcb7510158df/specification/hdinsight/resource-manager/Microsoft.HDInsight/HDInsight/preview/2025-01-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) @@ -26,21 +25,21 @@ func ExampleExtensionsClient_BeginEnableMonitoring() { 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) + res, err := clientFactory.NewExtensionsClient().Get(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) - } + // 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/8a9dbb28e788355a47dc5bad3ea5f8da212b4bf6/specification/hdinsight/resource-manager/Microsoft.HDInsight/preview/2025-01-15-preview/examples/GetLinuxClusterMonitoringStatus.json -func ExampleExtensionsClient_GetMonitoringStatus() { +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/6312b1c8676b0973f86f078c1177dcb7510158df/specification/hdinsight/resource-manager/Microsoft.HDInsight/HDInsight/preview/2025-01-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) @@ -50,21 +49,21 @@ func ExampleExtensionsClient_GetMonitoringStatus() { if err != nil { log.Fatalf("failed to create client: %v", err) } - res, err := clientFactory.NewExtensionsClient().GetMonitoringStatus(ctx, "rg1", "cluster1", nil) + 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) } - // 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"), - // } + _, 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/8a9dbb28e788355a47dc5bad3ea5f8da212b4bf6/specification/hdinsight/resource-manager/Microsoft.HDInsight/preview/2025-01-15-preview/examples/DisableLinuxClusterMonitoring.json -func ExampleExtensionsClient_BeginDisableMonitoring() { +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/6312b1c8676b0973f86f078c1177dcb7510158df/specification/hdinsight/resource-manager/Microsoft.HDInsight/HDInsight/preview/2025-01-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) @@ -74,7 +73,7 @@ func ExampleExtensionsClient_BeginDisableMonitoring() { if err != nil { log.Fatalf("failed to create client: %v", err) } - poller, err := clientFactory.NewExtensionsClient().BeginDisableMonitoring(ctx, "rg1", "cluster1", nil) + poller, err := clientFactory.NewExtensionsClient().BeginDelete(ctx, "rg1", "cluster1", "clustermonitoring", nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } @@ -84,8 +83,8 @@ func ExampleExtensionsClient_BeginDisableMonitoring() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/8a9dbb28e788355a47dc5bad3ea5f8da212b4bf6/specification/hdinsight/resource-manager/Microsoft.HDInsight/preview/2025-01-15-preview/examples/EnableLinuxClusterAzureMonitor.json -func ExampleExtensionsClient_BeginEnableAzureMonitor() { +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/6312b1c8676b0973f86f078c1177dcb7510158df/specification/hdinsight/resource-manager/Microsoft.HDInsight/HDInsight/preview/2025-01-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) @@ -95,20 +94,19 @@ func ExampleExtensionsClient_BeginEnableAzureMonitor() { 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) + 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) } - _, 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.AsyncOperationResult = armhdinsight.AsyncOperationResult{ + // Status: to.Ptr(armhdinsight.AsyncOperationStateInProgress), + // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/8a9dbb28e788355a47dc5bad3ea5f8da212b4bf6/specification/hdinsight/resource-manager/Microsoft.HDInsight/preview/2025-01-15-preview/examples/GetLinuxClusterAzureMonitorStatus.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/6312b1c8676b0973f86f078c1177dcb7510158df/specification/hdinsight/resource-manager/Microsoft.HDInsight/HDInsight/preview/2025-01-15-preview/examples/GetLinuxClusterAzureMonitorStatus.json func ExampleExtensionsClient_GetAzureMonitorStatus() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -132,8 +130,8 @@ func ExampleExtensionsClient_GetAzureMonitorStatus() { // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/8a9dbb28e788355a47dc5bad3ea5f8da212b4bf6/specification/hdinsight/resource-manager/Microsoft.HDInsight/preview/2025-01-15-preview/examples/DisableLinuxClusterAzureMonitor.json -func ExampleExtensionsClient_BeginDisableAzureMonitor() { +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/6312b1c8676b0973f86f078c1177dcb7510158df/specification/hdinsight/resource-manager/Microsoft.HDInsight/HDInsight/preview/2025-01-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) @@ -143,7 +141,10 @@ func ExampleExtensionsClient_BeginDisableAzureMonitor() { if err != nil { log.Fatalf("failed to create client: %v", err) } - poller, err := clientFactory.NewExtensionsClient().BeginDisableAzureMonitor(ctx, "rg1", "cluster1", nil) + 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) } @@ -153,8 +154,8 @@ func ExampleExtensionsClient_BeginDisableAzureMonitor() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/8a9dbb28e788355a47dc5bad3ea5f8da212b4bf6/specification/hdinsight/resource-manager/Microsoft.HDInsight/preview/2025-01-15-preview/examples/EnableLinuxClusterAzureMonitorAgent.json -func ExampleExtensionsClient_BeginEnableAzureMonitorAgent() { +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/6312b1c8676b0973f86f078c1177dcb7510158df/specification/hdinsight/resource-manager/Microsoft.HDInsight/HDInsight/preview/2025-01-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) @@ -164,10 +165,7 @@ func ExampleExtensionsClient_BeginEnableAzureMonitorAgent() { if err != nil { log.Fatalf("failed to create client: %v", err) } - poller, err := clientFactory.NewExtensionsClient().BeginEnableAzureMonitorAgent(ctx, "rg1", "cluster1", armhdinsight.AzureMonitorRequest{ - PrimaryKey: to.Ptr("**********"), - WorkspaceID: to.Ptr("a2090ead-8c9f-4fba-b70e-533e3e003163"), - }, nil) + poller, err := clientFactory.NewExtensionsClient().BeginDisableAzureMonitor(ctx, "rg1", "cluster1", nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } @@ -177,7 +175,7 @@ func ExampleExtensionsClient_BeginEnableAzureMonitorAgent() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/8a9dbb28e788355a47dc5bad3ea5f8da212b4bf6/specification/hdinsight/resource-manager/Microsoft.HDInsight/preview/2025-01-15-preview/examples/GetLinuxClusterAzureMonitorAgentStatus.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/6312b1c8676b0973f86f078c1177dcb7510158df/specification/hdinsight/resource-manager/Microsoft.HDInsight/HDInsight/preview/2025-01-15-preview/examples/GetLinuxClusterAzureMonitorAgentStatus.json func ExampleExtensionsClient_GetAzureMonitorAgentStatus() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -201,8 +199,8 @@ func ExampleExtensionsClient_GetAzureMonitorAgentStatus() { // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/8a9dbb28e788355a47dc5bad3ea5f8da212b4bf6/specification/hdinsight/resource-manager/Microsoft.HDInsight/preview/2025-01-15-preview/examples/DisableLinuxClusterAzureMonitorAgent.json -func ExampleExtensionsClient_BeginDisableAzureMonitorAgent() { +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/6312b1c8676b0973f86f078c1177dcb7510158df/specification/hdinsight/resource-manager/Microsoft.HDInsight/HDInsight/preview/2025-01-15-preview/examples/EnableLinuxClusterAzureMonitorAgent.json +func ExampleExtensionsClient_BeginEnableAzureMonitorAgent() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) @@ -212,7 +210,10 @@ func ExampleExtensionsClient_BeginDisableAzureMonitorAgent() { if err != nil { log.Fatalf("failed to create client: %v", err) } - poller, err := clientFactory.NewExtensionsClient().BeginDisableAzureMonitorAgent(ctx, "rg1", "cluster1", nil) + poller, err := clientFactory.NewExtensionsClient().BeginEnableAzureMonitorAgent(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) } @@ -222,8 +223,8 @@ func ExampleExtensionsClient_BeginDisableAzureMonitorAgent() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/8a9dbb28e788355a47dc5bad3ea5f8da212b4bf6/specification/hdinsight/resource-manager/Microsoft.HDInsight/preview/2025-01-15-preview/examples/CreateExtension.json -func ExampleExtensionsClient_BeginCreate() { +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/6312b1c8676b0973f86f078c1177dcb7510158df/specification/hdinsight/resource-manager/Microsoft.HDInsight/HDInsight/preview/2025-01-15-preview/examples/DisableLinuxClusterAzureMonitorAgent.json +func ExampleExtensionsClient_BeginDisableAzureMonitorAgent() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) @@ -233,10 +234,7 @@ func ExampleExtensionsClient_BeginCreate() { 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) + poller, err := clientFactory.NewExtensionsClient().BeginDisableAzureMonitorAgent(ctx, "rg1", "cluster1", nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } @@ -246,8 +244,8 @@ func ExampleExtensionsClient_BeginCreate() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/8a9dbb28e788355a47dc5bad3ea5f8da212b4bf6/specification/hdinsight/resource-manager/Microsoft.HDInsight/preview/2025-01-15-preview/examples/GetExtension.json -func ExampleExtensionsClient_Get() { +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/6312b1c8676b0973f86f078c1177dcb7510158df/specification/hdinsight/resource-manager/Microsoft.HDInsight/HDInsight/preview/2025-01-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) @@ -257,7 +255,7 @@ func ExampleExtensionsClient_Get() { if err != nil { log.Fatalf("failed to create client: %v", err) } - res, err := clientFactory.NewExtensionsClient().Get(ctx, "rg1", "cluster1", "clustermonitoring", nil) + res, err := clientFactory.NewExtensionsClient().GetMonitoringStatus(ctx, "rg1", "cluster1", nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } @@ -270,8 +268,8 @@ func ExampleExtensionsClient_Get() { // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/8a9dbb28e788355a47dc5bad3ea5f8da212b4bf6/specification/hdinsight/resource-manager/Microsoft.HDInsight/preview/2025-01-15-preview/examples/DeleteExtension.json -func ExampleExtensionsClient_BeginDelete() { +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/6312b1c8676b0973f86f078c1177dcb7510158df/specification/hdinsight/resource-manager/Microsoft.HDInsight/HDInsight/preview/2025-01-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) @@ -281,7 +279,10 @@ func ExampleExtensionsClient_BeginDelete() { if err != nil { log.Fatalf("failed to create client: %v", err) } - poller, err := clientFactory.NewExtensionsClient().BeginDelete(ctx, "rg1", "cluster1", "clustermonitoring", nil) + 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) } @@ -291,8 +292,8 @@ func ExampleExtensionsClient_BeginDelete() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/8a9dbb28e788355a47dc5bad3ea5f8da212b4bf6/specification/hdinsight/resource-manager/Microsoft.HDInsight/preview/2025-01-15-preview/examples/GetExtensionCreationAsyncOperationStatus.json -func ExampleExtensionsClient_GetAzureAsyncOperationStatus() { +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/6312b1c8676b0973f86f078c1177dcb7510158df/specification/hdinsight/resource-manager/Microsoft.HDInsight/HDInsight/preview/2025-01-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) @@ -302,14 +303,12 @@ func ExampleExtensionsClient_GetAzureAsyncOperationStatus() { 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) + poller, err := clientFactory.NewExtensionsClient().BeginDisableMonitoring(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.AsyncOperationResult = armhdinsight.AsyncOperationResult{ - // Status: to.Ptr(armhdinsight.AsyncOperationStateInProgress), - // } + _, err = poller.PollUntilDone(ctx, nil) + if err != nil { + log.Fatalf("failed to pull the result: %v", err) + } } diff --git a/sdk/resourcemanager/hdinsight/armhdinsight/go.mod b/sdk/resourcemanager/hdinsight/armhdinsight/go.mod index 99b71dc0e982..fc06740fd9d6 100644 --- a/sdk/resourcemanager/hdinsight/armhdinsight/go.mod +++ b/sdk/resourcemanager/hdinsight/armhdinsight/go.mod @@ -3,19 +3,19 @@ module github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/hdinsight/armhdinsi go 1.24.0 require ( - github.com/Azure/azure-sdk-for-go/sdk/azcore v1.20.0 - github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.13.1 + github.com/Azure/azure-sdk-for-go/sdk/azcore v1.21.0 + github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.10.1 ) require ( github.com/Azure/azure-sdk-for-go/sdk/internal v1.11.2 // indirect - github.com/AzureAD/microsoft-authentication-library-for-go v1.6.0 // indirect - github.com/golang-jwt/jwt/v5 v5.3.0 // indirect + github.com/AzureAD/microsoft-authentication-library-for-go v1.4.2 // indirect + github.com/golang-jwt/jwt/v5 v5.2.2 // indirect github.com/google/uuid v1.6.0 // indirect github.com/kylelemons/godebug v1.1.0 // indirect github.com/pkg/browser v0.0.0-20240102092130-5ac0b6a4141c // indirect - golang.org/x/crypto v0.45.0 // indirect - golang.org/x/net v0.47.0 // indirect - golang.org/x/sys v0.38.0 // indirect - golang.org/x/text v0.31.0 // indirect + golang.org/x/crypto v0.48.0 // indirect + golang.org/x/net v0.50.0 // indirect + golang.org/x/sys v0.41.0 // indirect + golang.org/x/text v0.34.0 // indirect ) diff --git a/sdk/resourcemanager/hdinsight/armhdinsight/go.sum b/sdk/resourcemanager/hdinsight/armhdinsight/go.sum index 5d2c5e78eb37..1c971073f650 100644 --- a/sdk/resourcemanager/hdinsight/armhdinsight/go.sum +++ b/sdk/resourcemanager/hdinsight/armhdinsight/go.sum @@ -1,19 +1,23 @@ -github.com/Azure/azure-sdk-for-go/sdk/azcore v1.20.0 h1:JXg2dwJUmPB9JmtVmdEB16APJ7jurfbY5jnfXpJoRMc= -github.com/Azure/azure-sdk-for-go/sdk/azcore v1.20.0/go.mod h1:YD5h/ldMsG0XiIw7PdyNhLxaM317eFh5yNLccNfGdyw= -github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.13.1 h1:Hk5QBxZQC1jb2Fwj6mpzme37xbCDdNTxU7O9eb5+LB4= -github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.13.1/go.mod h1:IYus9qsFobWIc2YVwe/WPjcnyCkPKtnHAqUYeebc8z0= +github.com/Azure/azure-sdk-for-go/sdk/azcore v1.21.0 h1:fou+2+WFTib47nS+nz/ozhEBnvU96bKHy6LjRsY4E28= +github.com/Azure/azure-sdk-for-go/sdk/azcore v1.21.0/go.mod h1:t76Ruy8AHvUAC8GfMWJMa0ElSbuIcO03NLpynfbgsPA= +github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.10.1 h1:B+blDbyVIG3WaikNxPnhPiJ1MThR03b3vKGtER95TP4= +github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.10.1/go.mod h1:JdM5psgjfBf5fo2uWOZhflPWyDBZ/O/CNAH9CtsuZE4= github.com/Azure/azure-sdk-for-go/sdk/azidentity/cache v0.3.2 h1:yz1bePFlP5Vws5+8ez6T3HWXPmwOK7Yvq8QxDBD3SKY= github.com/Azure/azure-sdk-for-go/sdk/azidentity/cache v0.3.2/go.mod h1:Pa9ZNPuoNu/GztvBSKk9J1cDJW6vk/n0zLtV4mgd8N8= github.com/Azure/azure-sdk-for-go/sdk/internal v1.11.2 h1:9iefClla7iYpfYWdzPCRDozdmndjTm8DXdpCzPajMgA= github.com/Azure/azure-sdk-for-go/sdk/internal v1.11.2/go.mod h1:XtLgD3ZD34DAaVIIAyG3objl5DynM3CQ/vMcbBNJZGI= github.com/AzureAD/microsoft-authentication-extensions-for-go/cache v0.1.1 h1:WJTmL004Abzc5wDB5VtZG2PJk5ndYDgVacGqfirKxjM= github.com/AzureAD/microsoft-authentication-extensions-for-go/cache v0.1.1/go.mod h1:tCcJZ0uHAmvjsVYzEFivsRTN00oz5BEsRgQHu5JZ9WE= -github.com/AzureAD/microsoft-authentication-library-for-go v1.6.0 h1:XRzhVemXdgvJqCH0sFfrBUTnUJSBrBf7++ypk+twtRs= -github.com/AzureAD/microsoft-authentication-library-for-go v1.6.0/go.mod h1:HKpQxkWaGLJ+D/5H8QRpyQXA1eKjxkFlOMwck5+33Jk= +github.com/AzureAD/microsoft-authentication-library-for-go v1.4.2 h1:oygO0locgZJe7PpYPXT5A29ZkwJaPqcva7BVeemZOZs= +github.com/AzureAD/microsoft-authentication-library-for-go v1.4.2/go.mod h1:wP83P5OoQ5p6ip3ScPr0BAq0BvuPAvacpEuSzyouqAI= +github.com/cespare/xxhash/v2 v2.3.0 h1:UL815xU9SqsFlibzuggzjXhog7bL6oX9BbNZnL2UFvs= +github.com/cespare/xxhash/v2 v2.3.0/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= -github.com/golang-jwt/jwt/v5 v5.3.0 h1:pv4AsKCKKZuqlgs5sUmn4x8UlGa0kEVt/puTpKx9vvo= -github.com/golang-jwt/jwt/v5 v5.3.0/go.mod h1:fxCRLWMO43lRc8nhHWY6LGqRcf+1gQWArsqaEUEa5bE= +github.com/dgryski/go-rendezvous v0.0.0-20200823014737-9f7001d12a5f h1:lO4WD4F/rVNCu3HqELle0jiPLLBs70cWOduZpkS1E78= +github.com/dgryski/go-rendezvous v0.0.0-20200823014737-9f7001d12a5f/go.mod h1:cuUVRXasLTGF7a8hSLbxyZXjz+1KgoB3wDUb6vlszIc= +github.com/golang-jwt/jwt/v5 v5.2.2 h1:Rl4B7itRWVtYIHFrSNd7vhTiz9UpLdi6gZhZ3wEeDy8= +github.com/golang-jwt/jwt/v5 v5.2.2/go.mod h1:pqrtFR0X4osieyHYxtmOUWsAWrfe1Q5UVIyoH402zdk= github.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0= github.com/google/uuid v1.6.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/keybase/go-keychain v0.0.1 h1:way+bWYa6lDppZoZcgMbYsvC7GxljxrskdNInRtuthU= @@ -24,16 +28,18 @@ github.com/pkg/browser v0.0.0-20240102092130-5ac0b6a4141c h1:+mdjkGKdHQG3305AYmd github.com/pkg/browser v0.0.0-20240102092130-5ac0b6a4141c/go.mod h1:7rwL4CYBLnjLxUqIJNnCWiEdr3bn6IUYi15bNlnbCCU= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= +github.com/redis/go-redis/v9 v9.8.0 h1:q3nRvjrlge/6UD7eTu/DSg2uYiU2mCL0G/uzBWqhicI= +github.com/redis/go-redis/v9 v9.8.0/go.mod h1:huWgSWd8mW6+m0VPhJjSSQ+d6Nh1VICQ6Q5lHuCH/Iw= github.com/stretchr/testify v1.11.1 h1:7s2iGBzp5EwR7/aIZr8ao5+dra3wiQyKjjFuvgVKu7U= github.com/stretchr/testify v1.11.1/go.mod h1:wZwfW3scLgRK+23gO65QZefKpKQRnfz6sD981Nm4B6U= -golang.org/x/crypto v0.45.0 h1:jMBrvKuj23MTlT0bQEOBcAE0mjg8mK9RXFhRH6nyF3Q= -golang.org/x/crypto v0.45.0/go.mod h1:XTGrrkGJve7CYK7J8PEww4aY7gM3qMCElcJQ8n8JdX4= -golang.org/x/net v0.47.0 h1:Mx+4dIFzqraBXUugkia1OOvlD6LemFo1ALMHjrXDOhY= -golang.org/x/net v0.47.0/go.mod h1:/jNxtkgq5yWUGYkaZGqo27cfGZ1c5Nen03aYrrKpVRU= +golang.org/x/crypto v0.48.0 h1:/VRzVqiRSggnhY7gNRxPauEQ5Drw9haKdM0jqfcCFts= +golang.org/x/crypto v0.48.0/go.mod h1:r0kV5h3qnFPlQnBSrULhlsRfryS2pmewsg+XfMgkVos= +golang.org/x/net v0.50.0 h1:ucWh9eiCGyDR3vtzso0WMQinm2Dnt8cFMuQa9K33J60= +golang.org/x/net v0.50.0/go.mod h1:UgoSli3F/pBgdJBHCTc+tp3gmrU4XswgGRgtnwWTfyM= golang.org/x/sys v0.1.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.38.0 h1:3yZWxaJjBmCWXqhN1qh02AkOnCQ1poK6oF+a7xWL6Gc= -golang.org/x/sys v0.38.0/go.mod h1:OgkHotnGiDImocRcuBABYBEXf8A9a87e/uXjp9XT3ks= -golang.org/x/text v0.31.0 h1:aC8ghyu4JhP8VojJ2lEHBnochRno1sgL6nEi9WGFGMM= -golang.org/x/text v0.31.0/go.mod h1:tKRAlv61yKIjGGHX/4tP1LTbc13YSec1pxVEWXzfoeM= +golang.org/x/sys v0.41.0 h1:Ivj+2Cp/ylzLiEU89QhWblYnOE9zerudt9Ftecq2C6k= +golang.org/x/sys v0.41.0/go.mod h1:OgkHotnGiDImocRcuBABYBEXf8A9a87e/uXjp9XT3ks= +golang.org/x/text v0.34.0 h1:oL/Qq0Kdaqxa1KbNeMKwQq0reLCCaFtqu2eNuSeNHbk= +golang.org/x/text v0.34.0/go.mod h1:homfLqTYRFyVYemLBFl5GgL/DWEiH5wcsQ5gSh1yziA= 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 53537a798c51..b2cd9971943a 100644 --- a/sdk/resourcemanager/hdinsight/armhdinsight/locations_client.go +++ b/sdk/resourcemanager/hdinsight/armhdinsight/locations_client.go @@ -25,10 +25,9 @@ type LocationsClient struct { } // NewLocationsClient creates a new instance of LocationsClient with the specified values. -// - subscriptionID - The subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID -// forms part of the URI for every service call. +// - subscriptionID - The ID of the target subscription. // - credential - used to authorize requests. Usually a credential from azidentity. -// - options - pass nil to accept the default values. +// - options - Contains optional client configuration. Pass nil to accept the default values. func NewLocationsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*LocationsClient, error) { cl, err := arm.NewClient(moduleName, moduleVersion, credential, options) if err != nil { @@ -45,7 +44,8 @@ func NewLocationsClient(subscriptionID string, credential azcore.TokenCredential // If the operation fails it returns an *azcore.ResponseError type. // // Generated from API version 2025-01-15-preview -// - location - The Azure location (region) for which to make the request. +// - location - The name of Azure region. +// - parameters - The request body // - 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) { @@ -108,7 +108,7 @@ func (client *LocationsClient) checkNameAvailabilityHandleResponse(resp *http.Re // If the operation fails it returns an *azcore.ResponseError type. // // Generated from API version 2025-01-15-preview -// - location - The Azure location (region) for which to make the request. +// - location - The name of Azure region. // - operationID - The long running operation id. // - options - LocationsClientGetAzureAsyncOperationStatusOptions contains the optional parameters for the LocationsClient.GetAzureAsyncOperationStatus // method. @@ -173,7 +173,7 @@ func (client *LocationsClient) getAzureAsyncOperationStatusHandleResponse(resp * // If the operation fails it returns an *azcore.ResponseError type. // // Generated from API version 2025-01-15-preview -// - location - The Azure location (region) for which to make the request. +// - location - The name of Azure region. // - options - LocationsClientGetCapabilitiesOptions contains the optional parameters for the LocationsClient.GetCapabilities // method. func (client *LocationsClient) GetCapabilities(ctx context.Context, location string, options *LocationsClientGetCapabilitiesOptions) (LocationsClientGetCapabilitiesResponse, error) { @@ -233,7 +233,7 @@ func (client *LocationsClient) getCapabilitiesHandleResponse(resp *http.Response // If the operation fails it returns an *azcore.ResponseError type. // // Generated from API version 2025-01-15-preview -// - location - The Azure location (region) for which to make the request. +// - location - The name of Azure region. // - options - LocationsClientListBillingSpecsOptions contains the optional parameters for the LocationsClient.ListBillingSpecs // method. func (client *LocationsClient) ListBillingSpecs(ctx context.Context, location string, options *LocationsClientListBillingSpecsOptions) (LocationsClientListBillingSpecsResponse, error) { @@ -293,7 +293,7 @@ func (client *LocationsClient) listBillingSpecsHandleResponse(resp *http.Respons // If the operation fails it returns an *azcore.ResponseError type. // // Generated from API version 2025-01-15-preview -// - location - The Azure location (region) for which to make the request. +// - location - The name of Azure region. // - 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 @@ -352,7 +352,8 @@ func (client *LocationsClient) listUsagesHandleResponse(resp *http.Response) (Lo // If the operation fails it returns an *azcore.ResponseError type. // // Generated from API version 2025-01-15-preview -// - location - The Azure location (region) for which to make the request. +// - location - The name of Azure region. +// - parameters - The request body // - 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) { diff --git a/sdk/resourcemanager/hdinsight/armhdinsight/locations_client_example_test.go b/sdk/resourcemanager/hdinsight/armhdinsight/locations_client_example_test.go index 1994b5ad2e67..bb19e0767cbe 100644 --- a/sdk/resourcemanager/hdinsight/armhdinsight/locations_client_example_test.go +++ b/sdk/resourcemanager/hdinsight/armhdinsight/locations_client_example_test.go @@ -1,8 +1,7 @@ // 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_test @@ -15,7 +14,93 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/hdinsight/armhdinsight" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/8a9dbb28e788355a47dc5bad3ea5f8da212b4bf6/specification/hdinsight/resource-manager/Microsoft.HDInsight/preview/2025-01-15-preview/examples/GetHDInsightCapabilities.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/6312b1c8676b0973f86f078c1177dcb7510158df/specification/hdinsight/resource-manager/Microsoft.HDInsight/HDInsight/preview/2025-01-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/6312b1c8676b0973f86f078c1177dcb7510158df/specification/hdinsight/resource-manager/Microsoft.HDInsight/HDInsight/preview/2025-01-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/6312b1c8676b0973f86f078c1177dcb7510158df/specification/hdinsight/resource-manager/Microsoft.HDInsight/HDInsight/preview/2025-01-15-preview/examples/GetHDInsightCapabilities.json func ExampleLocationsClient_GetCapabilities() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -402,8 +487,8 @@ func ExampleLocationsClient_GetCapabilities() { // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/8a9dbb28e788355a47dc5bad3ea5f8da212b4bf6/specification/hdinsight/resource-manager/Microsoft.HDInsight/preview/2025-01-15-preview/examples/GetHDInsightUsages.json -func ExampleLocationsClient_ListUsages() { +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/6312b1c8676b0973f86f078c1177dcb7510158df/specification/hdinsight/resource-manager/Microsoft.HDInsight/HDInsight/preview/2025-01-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) @@ -413,29 +498,25 @@ func ExampleLocationsClient_ListUsages() { if err != nil { log.Fatalf("failed to create client: %v", err) } - res, err := clientFactory.NewLocationsClient().ListUsages(ctx, "West US", nil) + 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.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"), - // }}, + // 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/8a9dbb28e788355a47dc5bad3ea5f8da212b4bf6/specification/hdinsight/resource-manager/Microsoft.HDInsight/preview/2025-01-15-preview/examples/HDI_Locations_ListBillingSpecs.json -func ExampleLocationsClient_ListBillingSpecs() { +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/6312b1c8676b0973f86f078c1177dcb7510158df/specification/hdinsight/resource-manager/Microsoft.HDInsight/HDInsight/preview/2025-01-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) @@ -445,110 +526,28 @@ func ExampleLocationsClient_ListBillingSpecs() { if err != nil { log.Fatalf("failed to create client: %v", err) } - res, err := clientFactory.NewLocationsClient().ListBillingSpecs(ctx, "East US 2", nil) + 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.BillingResponseListResult = armhdinsight.BillingResponseListResult{ - // BillingResources: []*armhdinsight.BillingResources{ + // res.UsagesListResult = armhdinsight.UsagesListResult{ + // Value: []*armhdinsight.Usage{ // { - // BillingMeters: []*armhdinsight.BillingMeters{ - // }, - // DiskBillingMeters: []*armhdinsight.DiskBillingMeters{ + // Name: &armhdinsight.LocalizedName{ + // LocalizedValue: to.Ptr("Cores"), + // Value: to.Ptr("cores"), // }, - // 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), + // CurrentValue: to.Ptr[int64](0), + // Limit: to.Ptr[int64](5000), + // Unit: to.Ptr("Count"), // }}, - // VMSizes: []*string{ - // to.Ptr("A5"), - // to.Ptr("A6"), - // to.Ptr("A7")}, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/8a9dbb28e788355a47dc5bad3ea5f8da212b4bf6/specification/hdinsight/resource-manager/Microsoft.HDInsight/preview/2025-01-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/8a9dbb28e788355a47dc5bad3ea5f8da212b4bf6/specification/hdinsight/resource-manager/Microsoft.HDInsight/preview/2025-01-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/8a9dbb28e788355a47dc5bad3ea5f8da212b4bf6/specification/hdinsight/resource-manager/Microsoft.HDInsight/preview/2025-01-15-preview/examples/HDI_Locations_ValidateClusterCreateRequest.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/6312b1c8676b0973f86f078c1177dcb7510158df/specification/hdinsight/resource-manager/Microsoft.HDInsight/HDInsight/preview/2025-01-15-preview/examples/HDI_Locations_ValidateClusterCreateRequest.json func ExampleLocationsClient_ValidateClusterCreateRequest() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { diff --git a/sdk/resourcemanager/hdinsight/armhdinsight/models.go b/sdk/resourcemanager/hdinsight/armhdinsight/models.go index 51836c5d3c65..fdc2ba4fd393 100644 --- a/sdk/resourcemanager/hdinsight/armhdinsight/models.go +++ b/sdk/resourcemanager/hdinsight/armhdinsight/models.go @@ -48,7 +48,7 @@ type Application struct { // READ-ONLY; The name of the resource Name *string - // READ-ONLY; Metadata pertaining to creation and last modification of the resource. + // READ-ONLY; Azure Resource Manager metadata containing createdBy and modifiedBy information. SystemData *SystemData // READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" @@ -94,13 +94,12 @@ type ApplicationGetHTTPSEndpoint struct { PublicPort *int32 } -// ApplicationListResult - 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 - The response of a Application list operation. type ApplicationListResult struct { - // The list of HDInsight applications installed on HDInsight cluster. + // REQUIRED; The Application items on this page Value []*Application - // READ-ONLY; The URL to get the next set of operation list results if there are any. + // The link to the next page of items NextLink *string } @@ -299,11 +298,11 @@ type CapabilitiesResult struct { // The virtual machine size compatibility features. Regions map[string]*RegionsCapability - // The version capability. - Versions map[string]*VersionsCapability - // READ-ONLY; The quota capability. Quota *QuotaCapability + + // READ-ONLY; The version capability. + Versions map[string]*VersionsCapability } // ClientGroupInfo - The information of AAD security group. @@ -341,7 +340,7 @@ type Cluster struct { // READ-ONLY; The name of the resource Name *string - // READ-ONLY; Metadata pertaining to creation and last modification of the resource. + // READ-ONLY; Azure Resource Manager metadata containing createdBy and modifiedBy information. SystemData *SystemData // READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" @@ -582,21 +581,12 @@ type ClusterIdentity struct { TenantID *string } -// ClusterListPersistedScriptActionsResult - The ListPersistedScriptActions operation response. -type ClusterListPersistedScriptActionsResult struct { - // The list of Persisted Script Actions. - Value []*RuntimeScriptAction - - // READ-ONLY; The link (url) to the next page of results. - NextLink *string -} - -// ClusterListResult - The List Cluster operation response. +// ClusterListResult - The response of a Cluster list operation. type ClusterListResult struct { - // The list of Clusters. + // REQUIRED; The Cluster items on this page Value []*Cluster - // READ-ONLY; The link (url) to the next page of results. + // The link to the next page of items NextLink *string } @@ -745,6 +735,33 @@ type EntraUserInfo struct { Upn *string } +// ErrorAdditionalInfo - The resource management error additional info. +type ErrorAdditionalInfo struct { + // READ-ONLY; The additional info. + Info any + + // READ-ONLY; The additional info type. + Type *string +} + +// ErrorDetail - The error detail. +type ErrorDetail struct { + // READ-ONLY; The error additional info. + AdditionalInfo []*ErrorAdditionalInfo + + // READ-ONLY; The error code. + Code *string + + // READ-ONLY; The error details. + Details []*ErrorDetail + + // READ-ONLY; The error message. + Message *string + + // READ-ONLY; The error target. + Target *string +} + // ErrorResponse - Describes the format of Error response. type ErrorResponse struct { // Error code @@ -754,6 +771,13 @@ type ErrorResponse struct { Message *string } +// ErrorResponseAutoGenerated - Common error response for all Azure Resource Manager APIs to return error details for failed +// operations. (This also follows the OData error response format.). +type ErrorResponseAutoGenerated struct { + // The error object. + Error *ErrorDetail +} + // Errors - The error message associated with the cluster creation. type Errors struct { // The error code. @@ -1020,7 +1044,7 @@ type OperationListResult struct { // The URL to get the next set of operation list results if there are any. NextLink *string - // The list of HDInsight operations supported by the HDInsight resource provider. + // READ-ONLY; The list of HDInsight operations supported by the HDInsight resource provider. Value []*Operation } @@ -1053,19 +1077,19 @@ type PrivateEndpointConnection struct { // READ-ONLY; The name of the resource Name *string - // READ-ONLY; Metadata pertaining to creation and last modification of the resource. + // READ-ONLY; Azure Resource Manager metadata containing createdBy and modifiedBy information. SystemData *SystemData // READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" Type *string } -// PrivateEndpointConnectionListResult - The list private endpoint connections response. +// PrivateEndpointConnectionListResult - The response of a PrivateEndpointConnection list operation. type PrivateEndpointConnectionListResult struct { - // The list of private endpoint connections. + // REQUIRED; The PrivateEndpointConnection items on this page Value []*PrivateEndpointConnection - // READ-ONLY; The link (url) to the next page of results. + // The link to the next page of items NextLink *string } @@ -1123,7 +1147,7 @@ type PrivateLinkResource struct { // READ-ONLY; The name of the resource Name *string - // READ-ONLY; Metadata pertaining to creation and last modification of the resource. + // READ-ONLY; Azure Resource Manager metadata containing createdBy and modifiedBy information. SystemData *SystemData // READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" @@ -1169,6 +1193,9 @@ type ProxyResource struct { // READ-ONLY; The name of the resource Name *string + // READ-ONLY; Azure Resource Manager metadata containing createdBy and modifiedBy information. + SystemData *SystemData + // READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" Type *string } @@ -1181,7 +1208,7 @@ type QuotaCapability struct { // The number of cores that the subscription allowed. MaxCoresAllowed *int64 - // The list of region quota capabilities. + // READ-ONLY; The list of region quota capabilities. RegionalQuotas []*RegionalQuotaCapability } @@ -1217,6 +1244,9 @@ type Resource struct { // READ-ONLY; The name of the resource Name *string + // READ-ONLY; Azure Resource Manager metadata containing createdBy and modifiedBy information. + SystemData *SystemData + // READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" Type *string } @@ -1346,11 +1376,11 @@ type ScriptAction struct { // ScriptActionExecutionHistoryList - The list script execution history response. type ScriptActionExecutionHistoryList struct { - // READ-ONLY; The link (url) to the next page of results. - NextLink *string - - // READ-ONLY; The list of persisted script action details for the cluster. + // READ-ONLY; The RuntimeScriptActionDetail items on this page Value []*RuntimeScriptActionDetail + + // The link to the next page of items + NextLink *string } // ScriptActionExecutionSummary - The execution summary of a script action. @@ -1362,30 +1392,12 @@ type ScriptActionExecutionSummary struct { Status *string } -// ScriptActionPersistedGetResponseSpec - The persisted script action for cluster. -type ScriptActionPersistedGetResponseSpec struct { - // The application name for the script action. - ApplicationName *string - - // The name of script action. - Name *string - - // The parameters for the script provided. - Parameters *string - - // The list of roles where script will be executed. - Roles []*string - - // The URI to the script. - URI *string -} - // ScriptActionsList - The persisted script action for the cluster. type ScriptActionsList struct { - // The list of persisted script action details for the cluster. + // REQUIRED; The RuntimeScriptActionDetail items on this page Value []*RuntimeScriptActionDetail - // READ-ONLY; The link (url) to the next page of results. + // The link to the next page of items NextLink *string } @@ -1502,6 +1514,9 @@ type TrackedResource struct { // READ-ONLY; The name of the resource Name *string + // READ-ONLY; Azure Resource Manager metadata containing createdBy and modifiedBy information. + SystemData *SystemData + // READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" Type *string } @@ -1551,7 +1566,7 @@ type Usage struct { // UsagesListResult - The response for the operation to get regional usages for a subscription. type UsagesListResult struct { - // The list of usages. + // READ-ONLY; The list of usages. Value []*Usage } @@ -1667,7 +1682,7 @@ type VersionSpec struct { // VersionsCapability - The version capability. type VersionsCapability struct { - // The list of version capabilities. + // READ-ONLY; The list of version capabilities. Available []*VersionSpec } diff --git a/sdk/resourcemanager/hdinsight/armhdinsight/models_serde.go b/sdk/resourcemanager/hdinsight/armhdinsight/models_serde.go index b96221de8454..0db5c1f5a109 100644 --- a/sdk/resourcemanager/hdinsight/armhdinsight/models_serde.go +++ b/sdk/resourcemanager/hdinsight/armhdinsight/models_serde.go @@ -1380,37 +1380,6 @@ func (c *ClusterIdentity) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type ClusterListPersistedScriptActionsResult. -func (c ClusterListPersistedScriptActionsResult) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "nextLink", c.NextLink) - populate(objectMap, "value", c.Value) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type ClusterListPersistedScriptActionsResult. -func (c *ClusterListPersistedScriptActionsResult) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", c, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "nextLink": - err = unpopulate(val, "NextLink", &c.NextLink) - delete(rawMsg, key) - case "value": - err = unpopulate(val, "Value", &c.Value) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", c, err) - } - } - return nil -} - // MarshalJSON implements the json.Marshaller interface for type ClusterListResult. func (c ClusterListResult) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) @@ -1881,6 +1850,80 @@ func (e *EntraUserInfo) UnmarshalJSON(data []byte) error { return nil } +// MarshalJSON implements the json.Marshaller interface for type ErrorAdditionalInfo. +func (e ErrorAdditionalInfo) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populateAny(objectMap, "info", e.Info) + populate(objectMap, "type", e.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ErrorAdditionalInfo. +func (e *ErrorAdditionalInfo) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", e, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "info": + err = unpopulate(val, "Info", &e.Info) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &e.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", e, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ErrorDetail. +func (e ErrorDetail) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "additionalInfo", e.AdditionalInfo) + populate(objectMap, "code", e.Code) + populate(objectMap, "details", e.Details) + populate(objectMap, "message", e.Message) + populate(objectMap, "target", e.Target) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ErrorDetail. +func (e *ErrorDetail) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", e, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "additionalInfo": + err = unpopulate(val, "AdditionalInfo", &e.AdditionalInfo) + delete(rawMsg, key) + case "code": + err = unpopulate(val, "Code", &e.Code) + delete(rawMsg, key) + case "details": + err = unpopulate(val, "Details", &e.Details) + delete(rawMsg, key) + case "message": + err = unpopulate(val, "Message", &e.Message) + delete(rawMsg, key) + case "target": + err = unpopulate(val, "Target", &e.Target) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", e, err) + } + } + return nil +} + // MarshalJSON implements the json.Marshaller interface for type ErrorResponse. func (e ErrorResponse) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) @@ -1912,6 +1955,33 @@ func (e *ErrorResponse) UnmarshalJSON(data []byte) error { return nil } +// MarshalJSON implements the json.Marshaller interface for type ErrorResponseAutoGenerated. +func (e ErrorResponseAutoGenerated) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "error", e.Error) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ErrorResponseAutoGenerated. +func (e *ErrorResponseAutoGenerated) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", e, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "error": + err = unpopulate(val, "Error", &e.Error) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", e, err) + } + } + return nil +} + // MarshalJSON implements the json.Marshaller interface for type Errors. func (e Errors) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) @@ -3061,6 +3131,7 @@ func (p ProxyResource) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) populate(objectMap, "id", p.ID) populate(objectMap, "name", p.Name) + populate(objectMap, "systemData", p.SystemData) populate(objectMap, "type", p.Type) return json.Marshal(objectMap) } @@ -3080,6 +3151,9 @@ func (p *ProxyResource) UnmarshalJSON(data []byte) error { case "name": err = unpopulate(val, "Name", &p.Name) delete(rawMsg, key) + case "systemData": + err = unpopulate(val, "SystemData", &p.SystemData) + delete(rawMsg, key) case "type": err = unpopulate(val, "Type", &p.Type) delete(rawMsg, key) @@ -3220,6 +3294,7 @@ func (r Resource) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) populate(objectMap, "id", r.ID) populate(objectMap, "name", r.Name) + populate(objectMap, "systemData", r.SystemData) populate(objectMap, "type", r.Type) return json.Marshal(objectMap) } @@ -3239,6 +3314,9 @@ func (r *Resource) UnmarshalJSON(data []byte) error { case "name": err = unpopulate(val, "Name", &r.Name) delete(rawMsg, key) + case "systemData": + err = unpopulate(val, "SystemData", &r.SystemData) + delete(rawMsg, key) case "type": err = unpopulate(val, "Type", &r.Type) delete(rawMsg, key) @@ -3609,49 +3687,6 @@ func (s *ScriptActionExecutionSummary) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type ScriptActionPersistedGetResponseSpec. -func (s ScriptActionPersistedGetResponseSpec) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "applicationName", s.ApplicationName) - populate(objectMap, "name", s.Name) - populate(objectMap, "parameters", s.Parameters) - populate(objectMap, "roles", s.Roles) - populate(objectMap, "uri", s.URI) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type ScriptActionPersistedGetResponseSpec. -func (s *ScriptActionPersistedGetResponseSpec) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", s, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "applicationName": - err = unpopulate(val, "ApplicationName", &s.ApplicationName) - delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &s.Name) - delete(rawMsg, key) - case "parameters": - err = unpopulate(val, "Parameters", &s.Parameters) - delete(rawMsg, key) - case "roles": - err = unpopulate(val, "Roles", &s.Roles) - delete(rawMsg, key) - case "uri": - err = unpopulate(val, "URI", &s.URI) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", s, err) - } - } - return nil -} - // MarshalJSON implements the json.Marshaller interface for type ScriptActionsList. func (s ScriptActionsList) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) @@ -3912,6 +3947,7 @@ func (t TrackedResource) MarshalJSON() ([]byte, error) { populate(objectMap, "id", t.ID) populate(objectMap, "location", t.Location) populate(objectMap, "name", t.Name) + populate(objectMap, "systemData", t.SystemData) populate(objectMap, "tags", t.Tags) populate(objectMap, "type", t.Type) return json.Marshal(objectMap) @@ -3935,6 +3971,9 @@ func (t *TrackedResource) UnmarshalJSON(data []byte) error { case "name": err = unpopulate(val, "Name", &t.Name) delete(rawMsg, key) + case "systemData": + err = unpopulate(val, "SystemData", &t.SystemData) + delete(rawMsg, key) case "tags": err = unpopulate(val, "Tags", &t.Tags) delete(rawMsg, key) diff --git a/sdk/resourcemanager/hdinsight/armhdinsight/operations_client.go b/sdk/resourcemanager/hdinsight/armhdinsight/operations_client.go index 496b45996768..ea5e4d7b0672 100644 --- a/sdk/resourcemanager/hdinsight/armhdinsight/operations_client.go +++ b/sdk/resourcemanager/hdinsight/armhdinsight/operations_client.go @@ -22,7 +22,7 @@ type OperationsClient struct { // NewOperationsClient creates a new instance of OperationsClient with the specified values. // - credential - used to authorize requests. Usually a credential from azidentity. -// - options - pass nil to accept the default values. +// - options - Contains optional client configuration. Pass nil to accept the default values. func NewOperationsClient(credential azcore.TokenCredential, options *arm.ClientOptions) (*OperationsClient, error) { cl, err := arm.NewClient(moduleName, moduleVersion, credential, options) if err != nil { diff --git a/sdk/resourcemanager/hdinsight/armhdinsight/operations_client_example_test.go b/sdk/resourcemanager/hdinsight/armhdinsight/operations_client_example_test.go index 5a334d038551..1e0adcb0a6b5 100644 --- a/sdk/resourcemanager/hdinsight/armhdinsight/operations_client_example_test.go +++ b/sdk/resourcemanager/hdinsight/armhdinsight/operations_client_example_test.go @@ -1,8 +1,7 @@ // 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_test @@ -14,7 +13,7 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/hdinsight/armhdinsight" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/8a9dbb28e788355a47dc5bad3ea5f8da212b4bf6/specification/hdinsight/resource-manager/Microsoft.HDInsight/preview/2025-01-15-preview/examples/ListHDInsightOperations.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/6312b1c8676b0973f86f078c1177dcb7510158df/specification/hdinsight/resource-manager/Microsoft.HDInsight/HDInsight/preview/2025-01-15-preview/examples/ListHDInsightOperations.json func ExampleOperationsClient_NewListPager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { diff --git a/sdk/resourcemanager/hdinsight/armhdinsight/privateendpointconnections_client.go b/sdk/resourcemanager/hdinsight/armhdinsight/privateendpointconnections_client.go index 73ac98821202..061272229d16 100644 --- a/sdk/resourcemanager/hdinsight/armhdinsight/privateendpointconnections_client.go +++ b/sdk/resourcemanager/hdinsight/armhdinsight/privateendpointconnections_client.go @@ -25,10 +25,9 @@ type PrivateEndpointConnectionsClient struct { } // NewPrivateEndpointConnectionsClient creates a new instance of PrivateEndpointConnectionsClient with the specified values. -// - subscriptionID - The subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID -// forms part of the URI for every service call. +// - subscriptionID - The ID of the target subscription. // - credential - used to authorize requests. Usually a credential from azidentity. -// - options - pass nil to accept the default values. +// - options - Contains optional client configuration. Pass nil to accept the default values. func NewPrivateEndpointConnectionsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*PrivateEndpointConnectionsClient, error) { cl, err := arm.NewClient(moduleName, moduleVersion, credential, options) if err != nil { @@ -45,7 +44,7 @@ func NewPrivateEndpointConnectionsClient(subscriptionID string, credential azcor // If the operation fails it returns an *azcore.ResponseError type. // // Generated from API version 2025-01-15-preview -// - resourceGroupName - The name of the resource group. +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - clusterName - The name of the cluster. // - privateEndpointConnectionName - The name of the private endpoint connection. // - parameters - The private endpoint connection create or update request. @@ -131,7 +130,7 @@ func (client *PrivateEndpointConnectionsClient) createOrUpdateCreateRequest(ctx // If the operation fails it returns an *azcore.ResponseError type. // // Generated from API version 2025-01-15-preview -// - resourceGroupName - The name of the resource group. +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - clusterName - The name of the cluster. // - privateEndpointConnectionName - The name of the private endpoint connection. // - options - PrivateEndpointConnectionsClientBeginDeleteOptions contains the optional parameters for the PrivateEndpointConnectionsClient.BeginDelete @@ -213,7 +212,7 @@ func (client *PrivateEndpointConnectionsClient) deleteCreateRequest(ctx context. // If the operation fails it returns an *azcore.ResponseError type. // // Generated from API version 2025-01-15-preview -// - resourceGroupName - The name of the resource group. +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - clusterName - The name of the cluster. // - privateEndpointConnectionName - The name of the private endpoint connection. // - options - PrivateEndpointConnectionsClientGetOptions contains the optional parameters for the PrivateEndpointConnectionsClient.Get @@ -282,7 +281,7 @@ func (client *PrivateEndpointConnectionsClient) getHandleResponse(resp *http.Res // NewListByClusterPager - Lists the private endpoint connections for a HDInsight cluster. // // Generated from API version 2025-01-15-preview -// - resourceGroupName - The name of the resource group. +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - clusterName - The name of the cluster. // - options - PrivateEndpointConnectionsClientListByClusterOptions contains the optional parameters for the PrivateEndpointConnectionsClient.NewListByClusterPager // method. diff --git a/sdk/resourcemanager/hdinsight/armhdinsight/privateendpointconnections_client_example_test.go b/sdk/resourcemanager/hdinsight/armhdinsight/privateendpointconnections_client_example_test.go index 088d64673405..fc7793f5fb90 100644 --- a/sdk/resourcemanager/hdinsight/armhdinsight/privateendpointconnections_client_example_test.go +++ b/sdk/resourcemanager/hdinsight/armhdinsight/privateendpointconnections_client_example_test.go @@ -1,8 +1,7 @@ // 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_test @@ -15,7 +14,7 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/hdinsight/armhdinsight" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/8a9dbb28e788355a47dc5bad3ea5f8da212b4bf6/specification/hdinsight/resource-manager/Microsoft.HDInsight/preview/2025-01-15-preview/examples/GetAllPrivateEndpointConnectionsInCluster.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/6312b1c8676b0973f86f078c1177dcb7510158df/specification/hdinsight/resource-manager/Microsoft.HDInsight/HDInsight/preview/2025-01-15-preview/examples/GetAllPrivateEndpointConnectionsInCluster.json func ExamplePrivateEndpointConnectionsClient_NewListByClusterPager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -60,8 +59,8 @@ func ExamplePrivateEndpointConnectionsClient_NewListByClusterPager() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/8a9dbb28e788355a47dc5bad3ea5f8da212b4bf6/specification/hdinsight/resource-manager/Microsoft.HDInsight/preview/2025-01-15-preview/examples/ApprovePrivateEndpointConnection.json -func ExamplePrivateEndpointConnectionsClient_BeginCreateOrUpdate() { +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/6312b1c8676b0973f86f078c1177dcb7510158df/specification/hdinsight/resource-manager/Microsoft.HDInsight/HDInsight/preview/2025-01-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) @@ -71,22 +70,10 @@ func ExamplePrivateEndpointConnectionsClient_BeginCreateOrUpdate() { 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) + 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) } - 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. @@ -100,7 +87,7 @@ func ExamplePrivateEndpointConnectionsClient_BeginCreateOrUpdate() { // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg2/providers/Microsoft.Network/privateEndpoints/testprivateep"), // }, // PrivateLinkServiceConnectionState: &armhdinsight.PrivateLinkServiceConnectionState{ - // Description: to.Ptr("update it from pending to approved."), + // Description: to.Ptr(""), // ActionsRequired: to.Ptr("None"), // Status: to.Ptr(armhdinsight.PrivateLinkServiceConnectionStatusApproved), // }, @@ -109,8 +96,8 @@ func ExamplePrivateEndpointConnectionsClient_BeginCreateOrUpdate() { // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/8a9dbb28e788355a47dc5bad3ea5f8da212b4bf6/specification/hdinsight/resource-manager/Microsoft.HDInsight/preview/2025-01-15-preview/examples/GetPrivateEndpointConnection.json -func ExamplePrivateEndpointConnectionsClient_Get() { +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/6312b1c8676b0973f86f078c1177dcb7510158df/specification/hdinsight/resource-manager/Microsoft.HDInsight/HDInsight/preview/2025-01-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) @@ -120,10 +107,22 @@ func ExamplePrivateEndpointConnectionsClient_Get() { 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) + 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. @@ -137,7 +136,7 @@ func ExamplePrivateEndpointConnectionsClient_Get() { // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg2/providers/Microsoft.Network/privateEndpoints/testprivateep"), // }, // PrivateLinkServiceConnectionState: &armhdinsight.PrivateLinkServiceConnectionState{ - // Description: to.Ptr(""), + // Description: to.Ptr("update it from pending to approved."), // ActionsRequired: to.Ptr("None"), // Status: to.Ptr(armhdinsight.PrivateLinkServiceConnectionStatusApproved), // }, @@ -146,7 +145,7 @@ func ExamplePrivateEndpointConnectionsClient_Get() { // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/8a9dbb28e788355a47dc5bad3ea5f8da212b4bf6/specification/hdinsight/resource-manager/Microsoft.HDInsight/preview/2025-01-15-preview/examples/DeletePrivateEndpointConnection.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/6312b1c8676b0973f86f078c1177dcb7510158df/specification/hdinsight/resource-manager/Microsoft.HDInsight/HDInsight/preview/2025-01-15-preview/examples/DeletePrivateEndpointConnection.json func ExamplePrivateEndpointConnectionsClient_BeginDelete() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { diff --git a/sdk/resourcemanager/hdinsight/armhdinsight/privatelinkresources_client.go b/sdk/resourcemanager/hdinsight/armhdinsight/privatelinkresources_client.go index 862cc73e45fb..16aa90f91544 100644 --- a/sdk/resourcemanager/hdinsight/armhdinsight/privatelinkresources_client.go +++ b/sdk/resourcemanager/hdinsight/armhdinsight/privatelinkresources_client.go @@ -25,10 +25,9 @@ type PrivateLinkResourcesClient struct { } // NewPrivateLinkResourcesClient creates a new instance of PrivateLinkResourcesClient with the specified values. -// - subscriptionID - The subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID -// forms part of the URI for every service call. +// - subscriptionID - The ID of the target subscription. // - credential - used to authorize requests. Usually a credential from azidentity. -// - options - pass nil to accept the default values. +// - options - Contains optional client configuration. Pass nil to accept the default values. func NewPrivateLinkResourcesClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*PrivateLinkResourcesClient, error) { cl, err := arm.NewClient(moduleName, moduleVersion, credential, options) if err != nil { @@ -45,7 +44,7 @@ func NewPrivateLinkResourcesClient(subscriptionID string, credential azcore.Toke // If the operation fails it returns an *azcore.ResponseError type. // // Generated from API version 2025-01-15-preview -// - resourceGroupName - The name of the resource group. +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - clusterName - The name of the cluster. // - privateLinkResourceName - The name of the private link resource. // - options - PrivateLinkResourcesClientGetOptions contains the optional parameters for the PrivateLinkResourcesClient.Get @@ -115,7 +114,7 @@ func (client *PrivateLinkResourcesClient) getHandleResponse(resp *http.Response) // If the operation fails it returns an *azcore.ResponseError type. // // Generated from API version 2025-01-15-preview -// - resourceGroupName - The name of the resource group. +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - clusterName - The name of the cluster. // - options - PrivateLinkResourcesClientListByClusterOptions contains the optional parameters for the PrivateLinkResourcesClient.ListByCluster // method. diff --git a/sdk/resourcemanager/hdinsight/armhdinsight/privatelinkresources_client_example_test.go b/sdk/resourcemanager/hdinsight/armhdinsight/privatelinkresources_client_example_test.go index fe248a7699c0..c4cbff0f2824 100644 --- a/sdk/resourcemanager/hdinsight/armhdinsight/privatelinkresources_client_example_test.go +++ b/sdk/resourcemanager/hdinsight/armhdinsight/privatelinkresources_client_example_test.go @@ -1,8 +1,7 @@ // 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_test @@ -14,7 +13,7 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/hdinsight/armhdinsight" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/8a9dbb28e788355a47dc5bad3ea5f8da212b4bf6/specification/hdinsight/resource-manager/Microsoft.HDInsight/preview/2025-01-15-preview/examples/GetAllPrivateLinkResourcesInCluster.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/6312b1c8676b0973f86f078c1177dcb7510158df/specification/hdinsight/resource-manager/Microsoft.HDInsight/HDInsight/preview/2025-01-15-preview/examples/GetAllPrivateLinkResourcesInCluster.json func ExamplePrivateLinkResourcesClient_ListByCluster() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -61,7 +60,7 @@ func ExamplePrivateLinkResourcesClient_ListByCluster() { // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/8a9dbb28e788355a47dc5bad3ea5f8da212b4bf6/specification/hdinsight/resource-manager/Microsoft.HDInsight/preview/2025-01-15-preview/examples/GetPrivateLinkResource.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/6312b1c8676b0973f86f078c1177dcb7510158df/specification/hdinsight/resource-manager/Microsoft.HDInsight/HDInsight/preview/2025-01-15-preview/examples/GetPrivateLinkResource.json func ExamplePrivateLinkResourcesClient_Get() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { diff --git a/sdk/resourcemanager/hdinsight/armhdinsight/responses.go b/sdk/resourcemanager/hdinsight/armhdinsight/responses.go index b0a31ba3e291..4facf30b8660 100644 --- a/sdk/resourcemanager/hdinsight/armhdinsight/responses.go +++ b/sdk/resourcemanager/hdinsight/armhdinsight/responses.go @@ -30,8 +30,7 @@ type ApplicationsClientGetResponse struct { // 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. + // The response of a Application list operation. ApplicationListResult } @@ -71,13 +70,13 @@ type ClustersClientGetResponse struct { // ClustersClientListByResourceGroupResponse contains the response from method ClustersClient.NewListByResourceGroupPager. type ClustersClientListByResourceGroupResponse struct { - // The List Cluster operation response. + // The response of a Cluster list operation. ClusterListResult } // ClustersClientListResponse contains the response from method ClustersClient.NewListPager. type ClustersClientListResponse struct { - // The List Cluster operation response. + // The response of a Cluster list operation. ClusterListResult } @@ -261,7 +260,7 @@ type PrivateEndpointConnectionsClientGetResponse struct { // PrivateEndpointConnectionsClientListByClusterResponse contains the response from method PrivateEndpointConnectionsClient.NewListByClusterPager. type PrivateEndpointConnectionsClientListByClusterResponse struct { - // The list private endpoint connections response. + // The response of a PrivateEndpointConnection list operation. PrivateEndpointConnectionListResult } @@ -319,7 +318,7 @@ type VirtualMachinesClientGetAsyncOperationStatusResponse struct { // VirtualMachinesClientListHostsResponse contains the response from method VirtualMachinesClient.ListHosts. type VirtualMachinesClientListHostsResponse struct { - // Result of the request to list cluster hosts + // Array of HostInfo HostInfoArray []*HostInfo } diff --git a/sdk/resourcemanager/hdinsight/armhdinsight/scriptactions_client.go b/sdk/resourcemanager/hdinsight/armhdinsight/scriptactions_client.go index 0ed972d36c2c..773c69fc5e7c 100644 --- a/sdk/resourcemanager/hdinsight/armhdinsight/scriptactions_client.go +++ b/sdk/resourcemanager/hdinsight/armhdinsight/scriptactions_client.go @@ -25,10 +25,9 @@ type ScriptActionsClient struct { } // NewScriptActionsClient creates a new instance of ScriptActionsClient with the specified values. -// - subscriptionID - The subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID -// forms part of the URI for every service call. +// - subscriptionID - The ID of the target subscription. // - credential - used to authorize requests. Usually a credential from azidentity. -// - options - pass nil to accept the default values. +// - options - Contains optional client configuration. Pass nil to accept the default values. func NewScriptActionsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*ScriptActionsClient, error) { cl, err := arm.NewClient(moduleName, moduleVersion, credential, options) if err != nil { @@ -45,7 +44,7 @@ func NewScriptActionsClient(subscriptionID string, credential azcore.TokenCreden // If the operation fails it returns an *azcore.ResponseError type. // // Generated from API version 2025-01-15-preview -// - resourceGroupName - The name of the resource group. +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - clusterName - The name of the cluster. // - scriptName - The name of the script. // - options - ScriptActionsClientDeleteOptions contains the optional parameters for the ScriptActionsClient.Delete method. @@ -104,7 +103,7 @@ func (client *ScriptActionsClient) deleteCreateRequest(ctx context.Context, reso // If the operation fails it returns an *azcore.ResponseError type. // // Generated from API version 2025-01-15-preview -// - resourceGroupName - The name of the resource group. +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - clusterName - The name of the cluster. // - operationID - The long running operation id. // - options - ScriptActionsClientGetExecutionAsyncOperationStatusOptions contains the optional parameters for the ScriptActionsClient.GetExecutionAsyncOperationStatus @@ -174,7 +173,7 @@ func (client *ScriptActionsClient) getExecutionAsyncOperationStatusHandleRespons // If the operation fails it returns an *azcore.ResponseError type. // // Generated from API version 2025-01-15-preview -// - resourceGroupName - The name of the resource group. +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - clusterName - The name of the cluster. // - scriptExecutionID - The script execution Id // - options - ScriptActionsClientGetExecutionDetailOptions contains the optional parameters for the ScriptActionsClient.GetExecutionDetail @@ -243,7 +242,7 @@ func (client *ScriptActionsClient) getExecutionDetailHandleResponse(resp *http.R // NewListByClusterPager - Lists all the persisted script actions for the specified cluster. // // Generated from API version 2025-01-15-preview -// - resourceGroupName - The name of the resource group. +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - clusterName - The name of the cluster. // - options - ScriptActionsClientListByClusterOptions contains the optional parameters for the ScriptActionsClient.NewListByClusterPager // method. diff --git a/sdk/resourcemanager/hdinsight/armhdinsight/scriptactions_client_example_test.go b/sdk/resourcemanager/hdinsight/armhdinsight/scriptactions_client_example_test.go index 21574bd41a0a..8a49c0704b88 100644 --- a/sdk/resourcemanager/hdinsight/armhdinsight/scriptactions_client_example_test.go +++ b/sdk/resourcemanager/hdinsight/armhdinsight/scriptactions_client_example_test.go @@ -1,8 +1,7 @@ // 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_test @@ -14,8 +13,8 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/hdinsight/armhdinsight" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/8a9dbb28e788355a47dc5bad3ea5f8da212b4bf6/specification/hdinsight/resource-manager/Microsoft.HDInsight/preview/2025-01-15-preview/examples/DeleteScriptAction.json -func ExampleScriptActionsClient_Delete() { +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/6312b1c8676b0973f86f078c1177dcb7510158df/specification/hdinsight/resource-manager/Microsoft.HDInsight/HDInsight/preview/2025-01-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) @@ -25,13 +24,19 @@ func ExampleScriptActionsClient_Delete() { if err != nil { log.Fatalf("failed to create client: %v", err) } - _, err = clientFactory.NewScriptActionsClient().Delete(ctx, "rg1", "cluster1", "scriptName", nil) + 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), + // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/8a9dbb28e788355a47dc5bad3ea5f8da212b4bf6/specification/hdinsight/resource-manager/Microsoft.HDInsight/preview/2025-01-15-preview/examples/GetLinuxHadoopScriptAction.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/6312b1c8676b0973f86f078c1177dcb7510158df/specification/hdinsight/resource-manager/Microsoft.HDInsight/HDInsight/preview/2025-01-15-preview/examples/GetLinuxHadoopScriptAction.json func ExampleScriptActionsClient_NewListByClusterPager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -66,7 +71,24 @@ func ExampleScriptActionsClient_NewListByClusterPager() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/8a9dbb28e788355a47dc5bad3ea5f8da212b4bf6/specification/hdinsight/resource-manager/Microsoft.HDInsight/preview/2025-01-15-preview/examples/GetScriptActionById.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/6312b1c8676b0973f86f078c1177dcb7510158df/specification/hdinsight/resource-manager/Microsoft.HDInsight/HDInsight/preview/2025-01-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/6312b1c8676b0973f86f078c1177dcb7510158df/specification/hdinsight/resource-manager/Microsoft.HDInsight/HDInsight/preview/2025-01-15-preview/examples/GetScriptActionById.json func ExampleScriptActionsClient_GetExecutionDetail() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -101,26 +123,3 @@ func ExampleScriptActionsClient_GetExecutionDetail() { // Status: to.Ptr("ValidationFailed"), // } } - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/8a9dbb28e788355a47dc5bad3ea5f8da212b4bf6/specification/hdinsight/resource-manager/Microsoft.HDInsight/preview/2025-01-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 70f7afa6bd80..be6410605153 100644 --- a/sdk/resourcemanager/hdinsight/armhdinsight/scriptexecutionhistory_client.go +++ b/sdk/resourcemanager/hdinsight/armhdinsight/scriptexecutionhistory_client.go @@ -25,10 +25,9 @@ type ScriptExecutionHistoryClient struct { } // NewScriptExecutionHistoryClient creates a new instance of ScriptExecutionHistoryClient with the specified values. -// - subscriptionID - The subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID -// forms part of the URI for every service call. +// - subscriptionID - The ID of the target subscription. // - credential - used to authorize requests. Usually a credential from azidentity. -// - options - pass nil to accept the default values. +// - options - Contains optional client configuration. Pass nil to accept the default values. func NewScriptExecutionHistoryClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*ScriptExecutionHistoryClient, error) { cl, err := arm.NewClient(moduleName, moduleVersion, credential, options) if err != nil { @@ -44,7 +43,7 @@ func NewScriptExecutionHistoryClient(subscriptionID string, credential azcore.To // NewListByClusterPager - Lists all scripts' execution history for the specified cluster. // // Generated from API version 2025-01-15-preview -// - resourceGroupName - The name of the resource group. +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - clusterName - The name of the cluster. // - options - ScriptExecutionHistoryClientListByClusterOptions contains the optional parameters for the ScriptExecutionHistoryClient.NewListByClusterPager // method. @@ -110,7 +109,7 @@ func (client *ScriptExecutionHistoryClient) listByClusterHandleResponse(resp *ht // If the operation fails it returns an *azcore.ResponseError type. // // Generated from API version 2025-01-15-preview -// - resourceGroupName - The name of the resource group. +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - clusterName - The name of the cluster. // - scriptExecutionID - The script execution Id // - options - ScriptExecutionHistoryClientPromoteOptions contains the optional parameters for the ScriptExecutionHistoryClient.Promote diff --git a/sdk/resourcemanager/hdinsight/armhdinsight/scriptexecutionhistory_client_example_test.go b/sdk/resourcemanager/hdinsight/armhdinsight/scriptexecutionhistory_client_example_test.go index d814bc4091db..388721516bff 100644 --- a/sdk/resourcemanager/hdinsight/armhdinsight/scriptexecutionhistory_client_example_test.go +++ b/sdk/resourcemanager/hdinsight/armhdinsight/scriptexecutionhistory_client_example_test.go @@ -1,8 +1,7 @@ // 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_test @@ -14,7 +13,7 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/hdinsight/armhdinsight" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/8a9dbb28e788355a47dc5bad3ea5f8da212b4bf6/specification/hdinsight/resource-manager/Microsoft.HDInsight/preview/2025-01-15-preview/examples/GetScriptExecutionHistory.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/6312b1c8676b0973f86f078c1177dcb7510158df/specification/hdinsight/resource-manager/Microsoft.HDInsight/HDInsight/preview/2025-01-15-preview/examples/GetScriptExecutionHistory.json func ExampleScriptExecutionHistoryClient_NewListByClusterPager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -72,7 +71,7 @@ func ExampleScriptExecutionHistoryClient_NewListByClusterPager() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/8a9dbb28e788355a47dc5bad3ea5f8da212b4bf6/specification/hdinsight/resource-manager/Microsoft.HDInsight/preview/2025-01-15-preview/examples/PromoteLinuxHadoopScriptAction.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/6312b1c8676b0973f86f078c1177dcb7510158df/specification/hdinsight/resource-manager/Microsoft.HDInsight/HDInsight/preview/2025-01-15-preview/examples/PromoteLinuxHadoopScriptAction.json func ExampleScriptExecutionHistoryClient_Promote() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { diff --git a/sdk/resourcemanager/hdinsight/armhdinsight/version.go b/sdk/resourcemanager/hdinsight/armhdinsight/version.go index f307a6b35256..d586a7ad31ba 100644 --- a/sdk/resourcemanager/hdinsight/armhdinsight/version.go +++ b/sdk/resourcemanager/hdinsight/armhdinsight/version.go @@ -6,5 +6,5 @@ package armhdinsight const ( moduleName = "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/hdinsight/armhdinsight" - moduleVersion = "v1.3.0-beta.3" + moduleVersion = "v1.3.0-beta.4" ) diff --git a/sdk/resourcemanager/hdinsight/armhdinsight/virtualmachines_client.go b/sdk/resourcemanager/hdinsight/armhdinsight/virtualmachines_client.go index 32d1e19bfc9c..a73cf740e10c 100644 --- a/sdk/resourcemanager/hdinsight/armhdinsight/virtualmachines_client.go +++ b/sdk/resourcemanager/hdinsight/armhdinsight/virtualmachines_client.go @@ -25,10 +25,9 @@ type VirtualMachinesClient struct { } // NewVirtualMachinesClient creates a new instance of VirtualMachinesClient with the specified values. -// - subscriptionID - The subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID -// forms part of the URI for every service call. +// - subscriptionID - The ID of the target subscription. // - credential - used to authorize requests. Usually a credential from azidentity. -// - options - pass nil to accept the default values. +// - options - Contains optional client configuration. Pass nil to accept the default values. func NewVirtualMachinesClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*VirtualMachinesClient, error) { cl, err := arm.NewClient(moduleName, moduleVersion, credential, options) if err != nil { @@ -45,7 +44,7 @@ func NewVirtualMachinesClient(subscriptionID string, credential azcore.TokenCred // If the operation fails it returns an *azcore.ResponseError type. // // Generated from API version 2025-01-15-preview -// - resourceGroupName - The name of the resource group. +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - clusterName - The name of the cluster. // - operationID - The long running operation id. // - options - VirtualMachinesClientGetAsyncOperationStatusOptions contains the optional parameters for the VirtualMachinesClient.GetAsyncOperationStatus @@ -115,7 +114,7 @@ func (client *VirtualMachinesClient) getAsyncOperationStatusHandleResponse(resp // If the operation fails it returns an *azcore.ResponseError type. // // Generated from API version 2025-01-15-preview -// - resourceGroupName - The name of the resource group. +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - clusterName - The name of the cluster. // - options - VirtualMachinesClientListHostsOptions contains the optional parameters for the VirtualMachinesClient.ListHosts // method. @@ -180,7 +179,7 @@ func (client *VirtualMachinesClient) listHostsHandleResponse(resp *http.Response // If the operation fails it returns an *azcore.ResponseError type. // // Generated from API version 2025-01-15-preview -// - resourceGroupName - The name of the resource group. +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - clusterName - The name of the cluster. // - hosts - The list of hosts to restart // - options - VirtualMachinesClientBeginRestartHostsOptions contains the optional parameters for the VirtualMachinesClient.BeginRestartHosts diff --git a/sdk/resourcemanager/hdinsight/armhdinsight/virtualmachines_client_example_test.go b/sdk/resourcemanager/hdinsight/armhdinsight/virtualmachines_client_example_test.go index fe2cad69b061..72b52e59dd0c 100644 --- a/sdk/resourcemanager/hdinsight/armhdinsight/virtualmachines_client_example_test.go +++ b/sdk/resourcemanager/hdinsight/armhdinsight/virtualmachines_client_example_test.go @@ -1,8 +1,7 @@ // 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_test @@ -15,7 +14,7 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/hdinsight/armhdinsight" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/8a9dbb28e788355a47dc5bad3ea5f8da212b4bf6/specification/hdinsight/resource-manager/Microsoft.HDInsight/preview/2025-01-15-preview/examples/GetClusterVirtualMachines.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/6312b1c8676b0973f86f078c1177dcb7510158df/specification/hdinsight/resource-manager/Microsoft.HDInsight/HDInsight/preview/2025-01-15-preview/examples/GetClusterVirtualMachines.json func ExampleVirtualMachinesClient_ListHosts() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -63,7 +62,7 @@ func ExampleVirtualMachinesClient_ListHosts() { // }} } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/8a9dbb28e788355a47dc5bad3ea5f8da212b4bf6/specification/hdinsight/resource-manager/Microsoft.HDInsight/preview/2025-01-15-preview/examples/RestartVirtualMachinesOperation.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/6312b1c8676b0973f86f078c1177dcb7510158df/specification/hdinsight/resource-manager/Microsoft.HDInsight/HDInsight/preview/2025-01-15-preview/examples/RestartVirtualMachinesOperation.json func ExampleVirtualMachinesClient_BeginRestartHosts() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -86,7 +85,7 @@ func ExampleVirtualMachinesClient_BeginRestartHosts() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/8a9dbb28e788355a47dc5bad3ea5f8da212b4bf6/specification/hdinsight/resource-manager/Microsoft.HDInsight/preview/2025-01-15-preview/examples/GetRestartHostsAsyncOperationStatus.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/6312b1c8676b0973f86f078c1177dcb7510158df/specification/hdinsight/resource-manager/Microsoft.HDInsight/HDInsight/preview/2025-01-15-preview/examples/GetRestartHostsAsyncOperationStatus.json func ExampleVirtualMachinesClient_GetAsyncOperationStatus() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil {