From b736f18b57ba5126841d2674ed7e2557abf2f3d9 Mon Sep 17 00:00:00 2001 From: SDKAuto Date: Fri, 26 May 2023 03:41:15 +0000 Subject: [PATCH] CodeGen from PR 24163 in Azure/azure-rest-api-specs Merge 0c486695dace88245e55559efa0a2a93e26228f8 into dc92283b118284e79f4ed3837763e2bb079ffa09 --- .../batch/armbatch/CHANGELOG.md | 12 + .../batch/armbatch/account_client.go | 52 +- .../armbatch/account_client_example_test.go | 835 ------- .../batch/armbatch/application_client.go | 20 +- .../application_client_example_test.go | 188 -- .../armbatch/applicationpackage_client.go | 20 +- .../applicationpackage_client_example_test.go | 179 -- .../batch/armbatch/autorest.md | 6 +- .../batch/armbatch/certificate_client.go | 26 +- .../certificate_client_example_test.go | 417 ---- .../batch/armbatch/constants.go | 20 +- sdk/resourcemanager/batch/armbatch/go.mod | 16 +- sdk/resourcemanager/batch/armbatch/go.sum | 22 +- .../batch/armbatch/location_client.go | 16 +- .../armbatch/location_client_example_test.go | 222 -- sdk/resourcemanager/batch/armbatch/models.go | 19 +- .../batch/armbatch/models_serde.go | 10 +- .../batch/armbatch/operations_client.go | 4 +- .../operations_client_example_test.go | 1252 ----------- .../batch/armbatch/pool_client.go | 30 +- .../armbatch/pool_client_example_test.go | 1952 ----------------- .../privateendpointconnection_client.go | 20 +- ...eendpointconnection_client_example_test.go | 171 -- .../armbatch/privatelinkresource_client.go | 8 +- ...privatelinkresource_client_example_test.go | 90 - 25 files changed, 162 insertions(+), 5445 deletions(-) delete mode 100644 sdk/resourcemanager/batch/armbatch/account_client_example_test.go delete mode 100644 sdk/resourcemanager/batch/armbatch/application_client_example_test.go delete mode 100644 sdk/resourcemanager/batch/armbatch/applicationpackage_client_example_test.go delete mode 100644 sdk/resourcemanager/batch/armbatch/certificate_client_example_test.go delete mode 100644 sdk/resourcemanager/batch/armbatch/location_client_example_test.go delete mode 100644 sdk/resourcemanager/batch/armbatch/operations_client_example_test.go delete mode 100644 sdk/resourcemanager/batch/armbatch/pool_client_example_test.go delete mode 100644 sdk/resourcemanager/batch/armbatch/privateendpointconnection_client_example_test.go delete mode 100644 sdk/resourcemanager/batch/armbatch/privatelinkresource_client_example_test.go diff --git a/sdk/resourcemanager/batch/armbatch/CHANGELOG.md b/sdk/resourcemanager/batch/armbatch/CHANGELOG.md index 54a1ab82aec9..8c115eace8e3 100644 --- a/sdk/resourcemanager/batch/armbatch/CHANGELOG.md +++ b/sdk/resourcemanager/batch/armbatch/CHANGELOG.md @@ -1,5 +1,17 @@ # Release History +## 2.0.0 (2023-05-26) +### Breaking Changes + +- Type of `ContainerConfiguration.Type` has been changed from `*string` to `*ContainerType` + +### Features Added + +- New enum type `ContainerType` with values `ContainerTypeCriCompatible`, `ContainerTypeDockerCompatible` +- New field `EnableAcceleratedNetworking` in struct `NetworkConfiguration` +- New field `EnableAutomaticUpgrade` in struct `VMExtension` + + ## 1.2.1 (2023-04-14) ### Bug Fixes diff --git a/sdk/resourcemanager/batch/armbatch/account_client.go b/sdk/resourcemanager/batch/armbatch/account_client.go index 4f706aa8533a..bc7e0d12a7e2 100644 --- a/sdk/resourcemanager/batch/armbatch/account_client.go +++ b/sdk/resourcemanager/batch/armbatch/account_client.go @@ -48,7 +48,7 @@ func NewAccountClient(subscriptionID string, credential azcore.TokenCredential, // API and should instead be updated with the Update Batch Account API. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-10-01 +// Generated from API version 2023-05-01 // - resourceGroupName - The name of the resource group that contains the Batch account. // - accountName - A name for the Batch account which must be unique within the region. Batch account names must be between // 3 and 24 characters in length and must use only numbers and lowercase letters. This name is @@ -74,7 +74,7 @@ func (client *AccountClient) BeginCreate(ctx context.Context, resourceGroupName // should instead be updated with the Update Batch Account API. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-10-01 +// Generated from API version 2023-05-01 func (client *AccountClient) create(ctx context.Context, resourceGroupName string, accountName string, parameters AccountCreateParameters, options *AccountClientBeginCreateOptions) (*http.Response, error) { req, err := client.createCreateRequest(ctx, resourceGroupName, accountName, parameters, options) if err != nil { @@ -110,7 +110,7 @@ func (client *AccountClient) createCreateRequest(ctx context.Context, resourceGr return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-10-01") + reqQP.Set("api-version", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, parameters) @@ -119,7 +119,7 @@ func (client *AccountClient) createCreateRequest(ctx context.Context, resourceGr // BeginDelete - Deletes the specified Batch account. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-10-01 +// Generated from API version 2023-05-01 // - resourceGroupName - The name of the resource group that contains the Batch account. // - accountName - The name of the Batch account. // - options - AccountClientBeginDeleteOptions contains the optional parameters for the AccountClient.BeginDelete method. @@ -140,7 +140,7 @@ func (client *AccountClient) BeginDelete(ctx context.Context, resourceGroupName // Delete - Deletes the specified Batch account. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-10-01 +// Generated from API version 2023-05-01 func (client *AccountClient) deleteOperation(ctx context.Context, resourceGroupName string, accountName string, options *AccountClientBeginDeleteOptions) (*http.Response, error) { req, err := client.deleteCreateRequest(ctx, resourceGroupName, accountName, options) if err != nil { @@ -176,7 +176,7 @@ func (client *AccountClient) deleteCreateRequest(ctx context.Context, resourceGr return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-10-01") + reqQP.Set("api-version", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -185,7 +185,7 @@ func (client *AccountClient) deleteCreateRequest(ctx context.Context, resourceGr // Get - Gets information about the specified Batch account. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-10-01 +// Generated from API version 2023-05-01 // - resourceGroupName - The name of the resource group that contains the Batch account. // - accountName - The name of the Batch account. // - options - AccountClientGetOptions contains the optional parameters for the AccountClient.Get method. @@ -224,7 +224,7 @@ func (client *AccountClient) getCreateRequest(ctx context.Context, resourceGroup return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-10-01") + reqQP.Set("api-version", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -242,7 +242,7 @@ func (client *AccountClient) getHandleResponse(resp *http.Response) (AccountClie // GetDetector - Gets information about the given detector for a given Batch account. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-10-01 +// Generated from API version 2023-05-01 // - resourceGroupName - The name of the resource group that contains the Batch account. // - accountName - The name of the Batch account. // - detectorID - The name of the detector. @@ -286,7 +286,7 @@ func (client *AccountClient) getDetectorCreateRequest(ctx context.Context, resou return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-10-01") + reqQP.Set("api-version", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -307,7 +307,7 @@ func (client *AccountClient) getDetectorHandleResponse(resp *http.Response) (Acc // will fail. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-10-01 +// Generated from API version 2023-05-01 // - resourceGroupName - The name of the resource group that contains the Batch account. // - accountName - The name of the Batch account. // - options - AccountClientGetKeysOptions contains the optional parameters for the AccountClient.GetKeys method. @@ -346,7 +346,7 @@ func (client *AccountClient) getKeysCreateRequest(ctx context.Context, resourceG return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-10-01") + reqQP.Set("api-version", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -363,7 +363,7 @@ func (client *AccountClient) getKeysHandleResponse(resp *http.Response) (Account // NewListPager - Gets information about the Batch accounts associated with the subscription. // -// Generated from API version 2022-10-01 +// Generated from API version 2023-05-01 // - options - AccountClientListOptions contains the optional parameters for the AccountClient.NewListPager method. func (client *AccountClient) NewListPager(options *AccountClientListOptions) *runtime.Pager[AccountClientListResponse] { return runtime.NewPager(runtime.PagingHandler[AccountClientListResponse]{ @@ -405,7 +405,7 @@ func (client *AccountClient) listCreateRequest(ctx context.Context, options *Acc return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-10-01") + reqQP.Set("api-version", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -422,7 +422,7 @@ func (client *AccountClient) listHandleResponse(resp *http.Response) (AccountCli // NewListByResourceGroupPager - Gets information about the Batch accounts associated with the specified resource group. // -// Generated from API version 2022-10-01 +// Generated from API version 2023-05-01 // - resourceGroupName - The name of the resource group that contains the Batch account. // - options - AccountClientListByResourceGroupOptions contains the optional parameters for the AccountClient.NewListByResourceGroupPager // method. @@ -470,7 +470,7 @@ func (client *AccountClient) listByResourceGroupCreateRequest(ctx context.Contex return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-10-01") + reqQP.Set("api-version", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -487,7 +487,7 @@ func (client *AccountClient) listByResourceGroupHandleResponse(resp *http.Respon // NewListDetectorsPager - Gets information about the detectors available for a given Batch account. // -// Generated from API version 2022-10-01 +// Generated from API version 2023-05-01 // - resourceGroupName - The name of the resource group that contains the Batch account. // - accountName - The name of the Batch account. // - options - AccountClientListDetectorsOptions contains the optional parameters for the AccountClient.NewListDetectorsPager @@ -540,7 +540,7 @@ func (client *AccountClient) listDetectorsCreateRequest(ctx context.Context, res return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-10-01") + reqQP.Set("api-version", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -562,7 +562,7 @@ func (client *AccountClient) listDetectorsHandleResponse(resp *http.Response) (A // Batch to mark the affected nodes as unusable. For more information about // creating a pool inside of a virtual network, see https://docs.microsoft.com/en-us/azure/batch/batch-virtual-network. // -// Generated from API version 2022-10-01 +// Generated from API version 2023-05-01 // - resourceGroupName - The name of the resource group that contains the Batch account. // - accountName - The name of the Batch account. // - options - AccountClientListOutboundNetworkDependenciesEndpointsOptions contains the optional parameters for the AccountClient.NewListOutboundNetworkDependenciesEndpointsPager @@ -615,7 +615,7 @@ func (client *AccountClient) listOutboundNetworkDependenciesEndpointsCreateReque return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-10-01") + reqQP.Set("api-version", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -636,7 +636,7 @@ func (client *AccountClient) listOutboundNetworkDependenciesEndpointsHandleRespo // keys will fail. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-10-01 +// Generated from API version 2023-05-01 // - resourceGroupName - The name of the resource group that contains the Batch account. // - accountName - The name of the Batch account. // - parameters - The type of key to regenerate. @@ -676,7 +676,7 @@ func (client *AccountClient) regenerateKeyCreateRequest(ctx context.Context, res return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-10-01") + reqQP.Set("api-version", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, parameters) @@ -695,7 +695,7 @@ func (client *AccountClient) regenerateKeyHandleResponse(resp *http.Response) (A // only if storage key authentication is being used. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-10-01 +// Generated from API version 2023-05-01 // - resourceGroupName - The name of the resource group that contains the Batch account. // - accountName - The name of the Batch account. // - options - AccountClientSynchronizeAutoStorageKeysOptions contains the optional parameters for the AccountClient.SynchronizeAutoStorageKeys @@ -735,7 +735,7 @@ func (client *AccountClient) synchronizeAutoStorageKeysCreateRequest(ctx context return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-10-01") + reqQP.Set("api-version", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -744,7 +744,7 @@ func (client *AccountClient) synchronizeAutoStorageKeysCreateRequest(ctx context // Update - Updates the properties of an existing Batch account. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-10-01 +// Generated from API version 2023-05-01 // - resourceGroupName - The name of the resource group that contains the Batch account. // - accountName - The name of the Batch account. // - parameters - Additional parameters for account update. @@ -784,7 +784,7 @@ func (client *AccountClient) updateCreateRequest(ctx context.Context, resourceGr return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-10-01") + reqQP.Set("api-version", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, parameters) diff --git a/sdk/resourcemanager/batch/armbatch/account_client_example_test.go b/sdk/resourcemanager/batch/armbatch/account_client_example_test.go deleted file mode 100644 index e472885d4c0e..000000000000 --- a/sdk/resourcemanager/batch/armbatch/account_client_example_test.go +++ /dev/null @@ -1,835 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armbatch_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/batch/armbatch" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ef6f2f06858cdbec7684968e1a54c7610da97dbb/specification/batch/resource-manager/Microsoft.Batch/stable/2022-10-01/examples/BatchAccountCreate_BYOS.json -func ExampleAccountClient_BeginCreate_batchAccountCreateByos() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armbatch.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewAccountClient().BeginCreate(ctx, "default-azurebatch-japaneast", "sampleacct", armbatch.AccountCreateParameters{ - Location: to.Ptr("japaneast"), - Properties: &armbatch.AccountCreateProperties{ - AutoStorage: &armbatch.AutoStorageBaseProperties{ - StorageAccountID: to.Ptr("/subscriptions/subid/resourceGroups/default-azurebatch-japaneast/providers/Microsoft.Storage/storageAccounts/samplestorage"), - }, - KeyVaultReference: &armbatch.KeyVaultReference{ - ID: to.Ptr("/subscriptions/subid/resourceGroups/default-azurebatch-japaneast/providers/Microsoft.KeyVault/vaults/sample"), - URL: to.Ptr("http://sample.vault.azure.net/"), - }, - PoolAllocationMode: to.Ptr(armbatch.PoolAllocationModeUserSubscription), - }, - }, 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.Account = armbatch.Account{ - // Name: to.Ptr("sampleacct"), - // Type: to.Ptr("Microsoft.Batch/batchAccounts"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/default-azurebatch-japaneast/providers/Microsoft.Batch/batchAccounts/sampleacct"), - // Location: to.Ptr("japaneast"), - // Identity: &armbatch.AccountIdentity{ - // Type: to.Ptr(armbatch.ResourceIdentityTypeNone), - // }, - // Properties: &armbatch.AccountProperties{ - // AccountEndpoint: to.Ptr("sampleacct.japaneast.batch.azure.com"), - // ActiveJobAndJobScheduleQuota: to.Ptr[int32](20), - // AutoStorage: &armbatch.AutoStorageProperties{ - // StorageAccountID: to.Ptr("/subscriptions/subid/resourceGroups/default-azurebatch-japaneast/providers/Microsoft.Storage/storageAccounts/samplestorage"), - // LastKeySync: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2016-03-10T23:48:38.9878479Z"); return t}()), - // }, - // DedicatedCoreQuota: to.Ptr[int32](20), - // KeyVaultReference: &armbatch.KeyVaultReference{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/default-azurebatch-japaneast/providers/Microsoft.KeyVault/vaults/sample"), - // URL: to.Ptr("http://sample.vault.azure.net/"), - // }, - // LowPriorityCoreQuota: to.Ptr[int32](20), - // PoolAllocationMode: to.Ptr(armbatch.PoolAllocationModeUserSubscription), - // PoolQuota: to.Ptr[int32](20), - // ProvisioningState: to.Ptr(armbatch.ProvisioningStateSucceeded), - // PublicNetworkAccess: to.Ptr(armbatch.PublicNetworkAccessTypeEnabled), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ef6f2f06858cdbec7684968e1a54c7610da97dbb/specification/batch/resource-manager/Microsoft.Batch/stable/2022-10-01/examples/BatchAccountCreate_Default.json -func ExampleAccountClient_BeginCreate_batchAccountCreateDefault() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armbatch.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewAccountClient().BeginCreate(ctx, "default-azurebatch-japaneast", "sampleacct", armbatch.AccountCreateParameters{ - Location: to.Ptr("japaneast"), - Properties: &armbatch.AccountCreateProperties{ - AutoStorage: &armbatch.AutoStorageBaseProperties{ - StorageAccountID: to.Ptr("/subscriptions/subid/resourceGroups/default-azurebatch-japaneast/providers/Microsoft.Storage/storageAccounts/samplestorage"), - }, - }, - }, 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.Account = armbatch.Account{ - // Name: to.Ptr("sampleacct"), - // Type: to.Ptr("Microsoft.Batch/batchAccounts"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/default-azurebatch-japaneast/providers/Microsoft.Batch/batchAccounts/sampleacct"), - // Location: to.Ptr("japaneast"), - // Identity: &armbatch.AccountIdentity{ - // Type: to.Ptr(armbatch.ResourceIdentityTypeNone), - // }, - // Properties: &armbatch.AccountProperties{ - // AccountEndpoint: to.Ptr("sampleacct.japaneast.batch.azure.com"), - // ActiveJobAndJobScheduleQuota: to.Ptr[int32](20), - // AutoStorage: &armbatch.AutoStorageProperties{ - // StorageAccountID: to.Ptr("/subscriptions/subid/resourceGroups/default-azurebatch-japaneast/providers/Microsoft.Storage/storageAccounts/samplestorage"), - // LastKeySync: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2016-03-10T23:48:38.9878479Z"); return t}()), - // }, - // DedicatedCoreQuota: to.Ptr[int32](20), - // LowPriorityCoreQuota: to.Ptr[int32](20), - // PoolAllocationMode: to.Ptr(armbatch.PoolAllocationModeBatchService), - // PoolQuota: to.Ptr[int32](20), - // ProvisioningState: to.Ptr(armbatch.ProvisioningStateSucceeded), - // PublicNetworkAccess: to.Ptr(armbatch.PublicNetworkAccessTypeEnabled), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ef6f2f06858cdbec7684968e1a54c7610da97dbb/specification/batch/resource-manager/Microsoft.Batch/stable/2022-10-01/examples/BatchAccountCreate_SystemAssignedIdentity.json -func ExampleAccountClient_BeginCreate_batchAccountCreateSystemAssignedIdentity() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armbatch.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewAccountClient().BeginCreate(ctx, "default-azurebatch-japaneast", "sampleacct", armbatch.AccountCreateParameters{ - Identity: &armbatch.AccountIdentity{ - Type: to.Ptr(armbatch.ResourceIdentityTypeSystemAssigned), - }, - Location: to.Ptr("japaneast"), - Properties: &armbatch.AccountCreateProperties{ - AutoStorage: &armbatch.AutoStorageBaseProperties{ - StorageAccountID: to.Ptr("/subscriptions/subid/resourceGroups/default-azurebatch-japaneast/providers/Microsoft.Storage/storageAccounts/samplestorage"), - }, - }, - }, 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.Account = armbatch.Account{ - // Name: to.Ptr("sampleacct"), - // Type: to.Ptr("Microsoft.Batch/batchAccounts"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/default-azurebatch-japaneast/providers/Microsoft.Batch/batchAccounts/sampleacct"), - // Location: to.Ptr("japaneast"), - // Identity: &armbatch.AccountIdentity{ - // Type: to.Ptr(armbatch.ResourceIdentityTypeSystemAssigned), - // PrincipalID: to.Ptr("1a2e532b-9900-414c-8600-cfc6126628d7"), - // TenantID: to.Ptr("f686d426-8d16-42db-81b7-ab578e110ccd"), - // }, - // Properties: &armbatch.AccountProperties{ - // AccountEndpoint: to.Ptr("sampleacct.japaneast.batch.azure.com"), - // ActiveJobAndJobScheduleQuota: to.Ptr[int32](20), - // AutoStorage: &armbatch.AutoStorageProperties{ - // StorageAccountID: to.Ptr("/subscriptions/subid/resourceGroups/default-azurebatch-japaneast/providers/Microsoft.Storage/storageAccounts/samplestorage"), - // LastKeySync: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2016-03-10T23:48:38.9878479Z"); return t}()), - // }, - // DedicatedCoreQuota: to.Ptr[int32](20), - // LowPriorityCoreQuota: to.Ptr[int32](20), - // PoolAllocationMode: to.Ptr(armbatch.PoolAllocationModeBatchService), - // PoolQuota: to.Ptr[int32](20), - // ProvisioningState: to.Ptr(armbatch.ProvisioningStateSucceeded), - // PublicNetworkAccess: to.Ptr(armbatch.PublicNetworkAccessTypeEnabled), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ef6f2f06858cdbec7684968e1a54c7610da97dbb/specification/batch/resource-manager/Microsoft.Batch/stable/2022-10-01/examples/BatchAccountCreate_UserAssignedIdentity.json -func ExampleAccountClient_BeginCreate_batchAccountCreateUserAssignedIdentity() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armbatch.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewAccountClient().BeginCreate(ctx, "default-azurebatch-japaneast", "sampleacct", armbatch.AccountCreateParameters{ - Identity: &armbatch.AccountIdentity{ - Type: to.Ptr(armbatch.ResourceIdentityTypeUserAssigned), - UserAssignedIdentities: map[string]*armbatch.UserAssignedIdentities{ - "/subscriptions/subid/resourceGroups/default-azurebatch-japaneast/providers/Microsoft.ManagedIdentity/userAssignedIdentities/id1": {}, - }, - }, - Location: to.Ptr("japaneast"), - Properties: &armbatch.AccountCreateProperties{ - AutoStorage: &armbatch.AutoStorageBaseProperties{ - StorageAccountID: to.Ptr("/subscriptions/subid/resourceGroups/default-azurebatch-japaneast/providers/Microsoft.Storage/storageAccounts/samplestorage"), - }, - }, - }, 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.Account = armbatch.Account{ - // Name: to.Ptr("sampleacct"), - // Type: to.Ptr("Microsoft.Batch/batchAccounts"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/default-azurebatch-japaneast/providers/Microsoft.Batch/batchAccounts/sampleacct"), - // Location: to.Ptr("japaneast"), - // Identity: &armbatch.AccountIdentity{ - // Type: to.Ptr(armbatch.ResourceIdentityTypeUserAssigned), - // UserAssignedIdentities: map[string]*armbatch.UserAssignedIdentities{ - // "/subscriptions/subid/resourceGroups/default-azurebatch-japaneast/providers/Microsoft.ManagedIdentity/userAssignedIdentities/id1": &armbatch.UserAssignedIdentities{ - // ClientID: to.Ptr("clientId1"), - // PrincipalID: to.Ptr("principalId1"), - // }, - // }, - // }, - // Properties: &armbatch.AccountProperties{ - // AccountEndpoint: to.Ptr("sampleacct.japaneast.batch.azure.com"), - // ActiveJobAndJobScheduleQuota: to.Ptr[int32](20), - // AutoStorage: &armbatch.AutoStorageProperties{ - // StorageAccountID: to.Ptr("/subscriptions/subid/resourceGroups/default-azurebatch-japaneast/providers/Microsoft.Storage/storageAccounts/samplestorage"), - // LastKeySync: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2016-03-10T23:48:38.9878479Z"); return t}()), - // }, - // DedicatedCoreQuota: to.Ptr[int32](20), - // LowPriorityCoreQuota: to.Ptr[int32](20), - // PoolAllocationMode: to.Ptr(armbatch.PoolAllocationModeBatchService), - // PoolQuota: to.Ptr[int32](20), - // ProvisioningState: to.Ptr(armbatch.ProvisioningStateSucceeded), - // PublicNetworkAccess: to.Ptr(armbatch.PublicNetworkAccessTypeEnabled), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ef6f2f06858cdbec7684968e1a54c7610da97dbb/specification/batch/resource-manager/Microsoft.Batch/stable/2022-10-01/examples/PrivateBatchAccountCreate.json -func ExampleAccountClient_BeginCreate_privateBatchAccountCreate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armbatch.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewAccountClient().BeginCreate(ctx, "default-azurebatch-japaneast", "sampleacct", armbatch.AccountCreateParameters{ - Location: to.Ptr("japaneast"), - Properties: &armbatch.AccountCreateProperties{ - AutoStorage: &armbatch.AutoStorageBaseProperties{ - StorageAccountID: to.Ptr("/subscriptions/subid/resourceGroups/default-azurebatch-japaneast/providers/Microsoft.Storage/storageAccounts/samplestorage"), - }, - KeyVaultReference: &armbatch.KeyVaultReference{ - ID: to.Ptr("/subscriptions/subid/resourceGroups/default-azurebatch-japaneast/providers/Microsoft.KeyVault/vaults/sample"), - URL: to.Ptr("http://sample.vault.azure.net/"), - }, - PublicNetworkAccess: to.Ptr(armbatch.PublicNetworkAccessTypeDisabled), - }, - }, 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.Account = armbatch.Account{ - // Name: to.Ptr("sampleacct"), - // Type: to.Ptr("Microsoft.Batch/batchAccounts"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/default-azurebatch-japaneast/providers/Microsoft.Batch/batchAccounts/sampleacct"), - // Location: to.Ptr("japaneast"), - // Identity: &armbatch.AccountIdentity{ - // Type: to.Ptr(armbatch.ResourceIdentityTypeNone), - // }, - // Properties: &armbatch.AccountProperties{ - // AccountEndpoint: to.Ptr("sampleacct.japaneast.batch.azure.com"), - // ActiveJobAndJobScheduleQuota: to.Ptr[int32](20), - // AutoStorage: &armbatch.AutoStorageProperties{ - // StorageAccountID: to.Ptr("/subscriptions/subid/resourceGroups/default-azurebatch-japaneast/providers/Microsoft.Storage/storageAccounts/samplestorage"), - // LastKeySync: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2016-03-10T23:48:38.9878479Z"); return t}()), - // }, - // DedicatedCoreQuota: to.Ptr[int32](20), - // KeyVaultReference: &armbatch.KeyVaultReference{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/default-azurebatch-japaneast/providers/Microsoft.KeyVault/vaults/sample"), - // URL: to.Ptr("http://sample.vault.azure.net/"), - // }, - // LowPriorityCoreQuota: to.Ptr[int32](20), - // PoolAllocationMode: to.Ptr(armbatch.PoolAllocationModeUserSubscription), - // PoolQuota: to.Ptr[int32](20), - // ProvisioningState: to.Ptr(armbatch.ProvisioningStateSucceeded), - // PublicNetworkAccess: to.Ptr(armbatch.PublicNetworkAccessTypeDisabled), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ef6f2f06858cdbec7684968e1a54c7610da97dbb/specification/batch/resource-manager/Microsoft.Batch/stable/2022-10-01/examples/BatchAccountUpdate.json -func ExampleAccountClient_Update() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armbatch.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewAccountClient().Update(ctx, "default-azurebatch-japaneast", "sampleacct", armbatch.AccountUpdateParameters{ - Properties: &armbatch.AccountUpdateProperties{ - AutoStorage: &armbatch.AutoStorageBaseProperties{ - StorageAccountID: to.Ptr("/subscriptions/subid/resourceGroups/default-azurebatch-japaneast/providers/Microsoft.Storage/storageAccounts/samplestorage"), - }, - }, - }, 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.Account = armbatch.Account{ - // Name: to.Ptr("sampleacct"), - // Type: to.Ptr("Microsoft.Batch/batchAccounts"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/default-azurebatch-japaneast/providers/Microsoft.Batch/batchAccounts/sampleacct"), - // Location: to.Ptr("japaneast"), - // Identity: &armbatch.AccountIdentity{ - // Type: to.Ptr(armbatch.ResourceIdentityTypeNone), - // }, - // Properties: &armbatch.AccountProperties{ - // AccountEndpoint: to.Ptr("sampleacct.japaneast.batch.azure.com"), - // ActiveJobAndJobScheduleQuota: to.Ptr[int32](20), - // AutoStorage: &armbatch.AutoStorageProperties{ - // StorageAccountID: to.Ptr("/subscriptions/subid/resourceGroups/default-azurebatch-japaneast/providers/Microsoft.Storage/storageAccounts/samplestorage"), - // LastKeySync: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2016-03-10T23:48:38.9878479Z"); return t}()), - // }, - // DedicatedCoreQuota: to.Ptr[int32](20), - // LowPriorityCoreQuota: to.Ptr[int32](20), - // PoolAllocationMode: to.Ptr(armbatch.PoolAllocationModeBatchService), - // PoolQuota: to.Ptr[int32](20), - // ProvisioningState: to.Ptr(armbatch.ProvisioningStateSucceeded), - // PublicNetworkAccess: to.Ptr(armbatch.PublicNetworkAccessTypeEnabled), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ef6f2f06858cdbec7684968e1a54c7610da97dbb/specification/batch/resource-manager/Microsoft.Batch/stable/2022-10-01/examples/BatchAccountDelete.json -func ExampleAccountClient_BeginDelete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armbatch.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewAccountClient().BeginDelete(ctx, "default-azurebatch-japaneast", "sampleacct", 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/ef6f2f06858cdbec7684968e1a54c7610da97dbb/specification/batch/resource-manager/Microsoft.Batch/stable/2022-10-01/examples/BatchAccountGet.json -func ExampleAccountClient_Get_batchAccountGet() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armbatch.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewAccountClient().Get(ctx, "default-azurebatch-japaneast", "sampleacct", 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.Account = armbatch.Account{ - // Name: to.Ptr("sampleacct"), - // Type: to.Ptr("Microsoft.Batch/batchAccounts"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/default-azurebatch-japaneast/providers/Microsoft.Batch/batchAccounts/sampleacct"), - // Location: to.Ptr("japaneast"), - // Identity: &armbatch.AccountIdentity{ - // Type: to.Ptr(armbatch.ResourceIdentityTypeNone), - // }, - // Properties: &armbatch.AccountProperties{ - // AccountEndpoint: to.Ptr("sampleacct.japaneast.batch.azure.com"), - // ActiveJobAndJobScheduleQuota: to.Ptr[int32](20), - // AutoStorage: &armbatch.AutoStorageProperties{ - // StorageAccountID: to.Ptr("/subscriptions/subid/resourceGroups/default-azurebatch-japaneast/providers/Microsoft.Storage/storageAccounts/samplestorage"), - // LastKeySync: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2016-03-10T23:48:38.9878479Z"); return t}()), - // }, - // DedicatedCoreQuota: to.Ptr[int32](20), - // LowPriorityCoreQuota: to.Ptr[int32](20), - // PoolAllocationMode: to.Ptr(armbatch.PoolAllocationModeBatchService), - // PoolQuota: to.Ptr[int32](20), - // ProvisioningState: to.Ptr(armbatch.ProvisioningStateSucceeded), - // PublicNetworkAccess: to.Ptr(armbatch.PublicNetworkAccessTypeEnabled), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ef6f2f06858cdbec7684968e1a54c7610da97dbb/specification/batch/resource-manager/Microsoft.Batch/stable/2022-10-01/examples/PrivateBatchAccountGet.json -func ExampleAccountClient_Get_privateBatchAccountGet() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armbatch.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewAccountClient().Get(ctx, "default-azurebatch-japaneast", "sampleacct", 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.Account = armbatch.Account{ - // Name: to.Ptr("sampleacct"), - // Type: to.Ptr("Microsoft.Batch/batchAccounts"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/default-azurebatch-japaneast/providers/Microsoft.Batch/batchAccounts/sampleacct"), - // Location: to.Ptr("japaneast"), - // Properties: &armbatch.AccountProperties{ - // AccountEndpoint: to.Ptr("sampleacct.japaneast.batch.azure.com"), - // ActiveJobAndJobScheduleQuota: to.Ptr[int32](20), - // AutoStorage: &armbatch.AutoStorageProperties{ - // StorageAccountID: to.Ptr("/subscriptions/subid/resourceGroups/default-azurebatch-japaneast/providers/Microsoft.Storage/storageAccounts/samplestorage"), - // LastKeySync: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2016-03-10T23:48:38.9878479Z"); return t}()), - // }, - // DedicatedCoreQuota: to.Ptr[int32](20), - // LowPriorityCoreQuota: to.Ptr[int32](20), - // PoolAllocationMode: to.Ptr(armbatch.PoolAllocationModeBatchService), - // PoolQuota: to.Ptr[int32](20), - // PrivateEndpointConnections: []*armbatch.PrivateEndpointConnection{ - // { - // Name: to.Ptr("testprivateEndpointConnection.24d6b4b5-e65c-4330-bbe9-3a290d62f8e0"), - // Type: to.Ptr("Microsoft.Batch/batchAccounts/privateEndpointConnections"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/default-azurebatch-japaneast/providers/Microsoft.Batch/batchAccounts/sampleacct/privateEndpointConnections/testprivateEndpointConnection.24d6b4b5-e65c-4330-bbe9-3a290d62f8e0"), - // Properties: &armbatch.PrivateEndpointConnectionProperties{ - // PrivateEndpoint: &armbatch.PrivateEndpoint{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/default-azurebatch-japaneast/providers/Microsoft.Network/privateEndpoints/testprivateEndpoint"), - // }, - // PrivateLinkServiceConnectionState: &armbatch.PrivateLinkServiceConnectionState{ - // Description: to.Ptr("Approved by xyz.abc@company.com"), - // Status: to.Ptr(armbatch.PrivateLinkServiceConnectionStatusApproved), - // }, - // }, - // }}, - // ProvisioningState: to.Ptr(armbatch.ProvisioningStateSucceeded), - // PublicNetworkAccess: to.Ptr(armbatch.PublicNetworkAccessTypeDisabled), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ef6f2f06858cdbec7684968e1a54c7610da97dbb/specification/batch/resource-manager/Microsoft.Batch/stable/2022-10-01/examples/BatchAccountList.json -func ExampleAccountClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armbatch.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewAccountClient().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.AccountListResult = armbatch.AccountListResult{ - // Value: []*armbatch.Account{ - // { - // Name: to.Ptr("sampleacct"), - // Type: to.Ptr("Microsoft.Batch/batchAccounts"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/default-azurebatch-japaneast/providers/Microsoft.Batch/batchAccounts/sampleacct"), - // Location: to.Ptr("japaneast"), - // Identity: &armbatch.AccountIdentity{ - // Type: to.Ptr(armbatch.ResourceIdentityTypeNone), - // }, - // Properties: &armbatch.AccountProperties{ - // AccountEndpoint: to.Ptr("sampleacct.japaneast.batch.azure.com"), - // ActiveJobAndJobScheduleQuota: to.Ptr[int32](20), - // AutoStorage: &armbatch.AutoStorageProperties{ - // StorageAccountID: to.Ptr("/subscriptions/subid/resourceGroups/default-azurebatch-japaneast/providers/Microsoft.Storage/storageAccounts/samplestorage"), - // LastKeySync: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2016-03-10T23:48:38.9878479Z"); return t}()), - // }, - // DedicatedCoreQuota: to.Ptr[int32](20), - // LowPriorityCoreQuota: to.Ptr[int32](20), - // PoolAllocationMode: to.Ptr(armbatch.PoolAllocationModeBatchService), - // PoolQuota: to.Ptr[int32](20), - // ProvisioningState: to.Ptr(armbatch.ProvisioningStateSucceeded), - // PublicNetworkAccess: to.Ptr(armbatch.PublicNetworkAccessTypeEnabled), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ef6f2f06858cdbec7684968e1a54c7610da97dbb/specification/batch/resource-manager/Microsoft.Batch/stable/2022-10-01/examples/BatchAccountListByResourceGroup.json -func ExampleAccountClient_NewListByResourceGroupPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armbatch.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewAccountClient().NewListByResourceGroupPager("default-azurebatch-japaneast", 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.AccountListResult = armbatch.AccountListResult{ - // Value: []*armbatch.Account{ - // { - // Name: to.Ptr("sampleacct"), - // Type: to.Ptr("Microsoft.Batch/batchAccounts"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/default-azurebatch-japaneast/providers/Microsoft.Batch/batchAccounts/sampleacct"), - // Location: to.Ptr("japaneast"), - // Identity: &armbatch.AccountIdentity{ - // Type: to.Ptr(armbatch.ResourceIdentityTypeNone), - // }, - // Properties: &armbatch.AccountProperties{ - // AccountEndpoint: to.Ptr("sampleacct.japaneast.batch.azure.com"), - // ActiveJobAndJobScheduleQuota: to.Ptr[int32](20), - // AutoStorage: &armbatch.AutoStorageProperties{ - // StorageAccountID: to.Ptr("/subscriptions/subid/resourceGroups/default-azurebatch-japaneast/providers/Microsoft.Storage/storageAccounts/samplestorage"), - // LastKeySync: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2016-03-10T23:48:38.9878479Z"); return t}()), - // }, - // DedicatedCoreQuota: to.Ptr[int32](20), - // LowPriorityCoreQuota: to.Ptr[int32](20), - // PoolAllocationMode: to.Ptr(armbatch.PoolAllocationModeBatchService), - // PoolQuota: to.Ptr[int32](20), - // ProvisioningState: to.Ptr(armbatch.ProvisioningStateSucceeded), - // PublicNetworkAccess: to.Ptr(armbatch.PublicNetworkAccessTypeEnabled), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ef6f2f06858cdbec7684968e1a54c7610da97dbb/specification/batch/resource-manager/Microsoft.Batch/stable/2022-10-01/examples/BatchAccountSynchronizeAutoStorageKeys.json -func ExampleAccountClient_SynchronizeAutoStorageKeys() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armbatch.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = clientFactory.NewAccountClient().SynchronizeAutoStorageKeys(ctx, "default-azurebatch-japaneast", "sampleacct", 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/ef6f2f06858cdbec7684968e1a54c7610da97dbb/specification/batch/resource-manager/Microsoft.Batch/stable/2022-10-01/examples/BatchAccountRegenerateKey.json -func ExampleAccountClient_RegenerateKey() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armbatch.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewAccountClient().RegenerateKey(ctx, "default-azurebatch-japaneast", "sampleacct", armbatch.AccountRegenerateKeyParameters{ - KeyName: to.Ptr(armbatch.AccountKeyTypePrimary), - }, 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.AccountKeys = armbatch.AccountKeys{ - // AccountName: to.Ptr("sampleacct"), - // Primary: to.Ptr("AAAA=="), - // Secondary: to.Ptr("BBBB=="), - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ef6f2f06858cdbec7684968e1a54c7610da97dbb/specification/batch/resource-manager/Microsoft.Batch/stable/2022-10-01/examples/BatchAccountGetKeys.json -func ExampleAccountClient_GetKeys() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armbatch.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewAccountClient().GetKeys(ctx, "default-azurebatch-japaneast", "sampleacct", 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.AccountKeys = armbatch.AccountKeys{ - // AccountName: to.Ptr("sampleacct"), - // Primary: to.Ptr("AAAA=="), - // Secondary: to.Ptr("BBBB=="), - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ef6f2f06858cdbec7684968e1a54c7610da97dbb/specification/batch/resource-manager/Microsoft.Batch/stable/2022-10-01/examples/DetectorList.json -func ExampleAccountClient_NewListDetectorsPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armbatch.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewAccountClient().NewListDetectorsPager("default-azurebatch-japaneast", "sampleacct", 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.DetectorListResult = armbatch.DetectorListResult{ - // Value: []*armbatch.DetectorResponse{ - // { - // Name: to.Ptr("poolsAndNodes"), - // Type: to.Ptr("Microsoft.Batch/batchAccounts/detectors"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/default-azurebatch-japaneast/providers/Microsoft.Batch/batchAccounts/sampleacct/detectors/poolsAndNodes"), - // Properties: &armbatch.DetectorResponseProperties{ - // Value: to.Ptr("ew0KICAibWV0YWRhdGEiOiB7DQogICAgImlkIjogInBvb2xzQW5kTm9kZXMiLA0KICAgICJuYW1lIjogIlBvb2xzIGFuZCBOb2RlcyIsDQogICAgImRlc2NyaXB0aW9uIjogbnVsbCwNCiAgICAiYXV0aG9yIjogIiIsDQogICAgImNhdGVnb3J5IjogbnVsbCwNCiAgICAic3VwcG9ydFRvcGljTGlzdCI6IFsNCiAgICAgIHsNCiAgICAgICAgImlkIjogIjMyNjM1MDc3IiwNCiAgICAgICAgInBlc0lkIjogIjE1NjE0IiwNCiAgICAgICAgInR5cGVJZCI6ICJEaWFnbm9zdGljcy5Nb2RlbHNBbmRVdGlscy5BdHRyaWJ1dGVzLlN1cHBvcnRUb3BpYywgRGlhZ25vc3RpY3MuTW9kZWxzQW5kVXRpbHMsIFZlcnNpb249MS4wLjAuMCwgQ3VsdHVyZT1uZXV0cmFsLCBQdWJsaWNLZXlUb2tlbj1udWxsIg0KICAgICAgfSwNCiAgICAgIHsNCiAgICAgICAgImlkIjogIjMyNjM1MDYxIiwNCiAgICAgICAgInBlc0lkIjogIjE1NjE0IiwNCiAgICAgICAgInR5cGVJZCI6ICJEaWFnbm9zdGljcy5Nb2RlbHNBbmRVdGlscy5BdHRyaWJ1dGVzLlN1cHBvcnRUb3BpYywgRGlhZ25vc3RpY3MuTW9kZWxzQW5kVXRpbHMsIFZlcnNpb249MS4wLjAuMCwgQ3VsdHVyZT1uZXV0cmFsLCBQdWJsaWNLZXlUb2tlbj1udWxsIg0KICAgICAgfSwNCiAgICAgIHsNCiAgICAgICAgImlkIjogIjMyNjM1MDY1IiwNCiAgICAgICAgInBlc0lkIjogIjE1NjE0IiwNCiAgICAgICAgInR5cGVJZCI6ICJEaWFnbm9zdGljcy5Nb2RlbHNBbmRVdGlscy5BdHRyaWJ1dGVzLlN1cHBvcnRUb3BpYywgRGlhZ25vc3RpY3MuTW9kZWxzQW5kVXRpbHMsIFZlcnNpb249MS4wLjAuMCwgQ3VsdHVyZT1uZXV0cmFsLCBQdWJsaWNLZXlUb2tlbj1udWxsIg0KICAgICAgfSwNCiAgICAgIHsNCiAgICAgICAgImlkIjogIjMyNjM1MDY2IiwNCiAgICAgICAgInBlc0lkIjogIjE1NjE0IiwNCiAgICAgICAgInR5cGVJZCI6ICJEaWFnbm9zdGljcy5Nb2RlbHNBbmRVdGlscy5BdHRyaWJ1dGVzLlN1cHBvcnRUb3BpYywgRGlhZ25vc3RpY3MuTW9kZWxzQW5kVXRpbHMsIFZlcnNpb249MS4wLjAuMCwgQ3VsdHVyZT1uZXV0cmFsLCBQdWJsaWNLZXlUb2tlbj1udWxsIg0KICAgICAgfSwNCiAgICAgIHsNCiAgICAgICAgImlkIjogIjMyNjM1MDY5IiwNCiAgICAgICAgInBlc0lkIjogIjE1NjE0IiwNCiAgICAgICAgInR5cGVJZCI6ICJEaWFnbm9zdGljcy5Nb2RlbHNBbmRVdGlscy5BdHRyaWJ1dGVzLlN1cHBvcnRUb3BpYywgRGlhZ25vc3RpY3MuTW9kZWxzQW5kVXRpbHMsIFZlcnNpb249MS4wLjAuMCwgQ3VsdHVyZT1uZXV0cmFsLCBQdWJsaWNLZXlUb2tlbj1udWxsIg0KICAgICAgfSwNCiAgICAgIHsNCiAgICAgICAgImlkIjogIjMyNjM1MDcyIiwNCiAgICAgICAgInBlc0lkIjogIjE1NjE0IiwNCiAgICAgICAgInR5cGVJZCI6ICJEaWFnbm9zdGljcy5Nb2RlbHNBbmRVdGlscy5BdHRyaWJ1dGVzLlN1cHBvcnRUb3BpYywgRGlhZ25vc3RpY3MuTW9kZWxzQW5kVXRpbHMsIFZlcnNpb249MS4wLjAuMCwgQ3VsdHVyZT1uZXV0cmFsLCBQdWJsaWNLZXlUb2tlbj1udWxsIg0KICAgICAgfSwNCiAgICAgIHsNCiAgICAgICAgImlkIjogIjMyNjM1MDc5IiwNCiAgICAgICAgInBlc0lkIjogIjE1NjE0IiwNCiAgICAgICAgInR5cGVJZCI6ICJEaWFnbm9zdGljcy5Nb2RlbHNBbmRVdGlscy5BdHRyaWJ1dGVzLlN1cHBvcnRUb3BpYywgRGlhZ25vc3RpY3MuTW9kZWxzQW5kVXRpbHMsIFZlcnNpb249MS4wLjAuMCwgQ3VsdHVyZT1uZXV0cmFsLCBQdWJsaWNLZXlUb2tlbj1udWxsIg0KICAgICAgfSwNCiAgICAgIHsNCiAgICAgICAgImlkIjogIjMyNjM1MDgyIiwNCiAgICAgICAgInBlc0lkIjogIjE1NjE0IiwNCiAgICAgICAgInR5cGVJZCI6ICJEaWFnbm9zdGljcy5Nb2RlbHNBbmRVdGlscy5BdHRyaWJ1dGVzLlN1cHBvcnRUb3BpYywgRGlhZ25vc3RpY3MuTW9kZWxzQW5kVXRpbHMsIFZlcnNpb249MS4wLjAuMCwgQ3VsdHVyZT1uZXV0cmFsLCBQdWJsaWNLZXlUb2tlbj1udWxsIg0KICAgICAgfSwNCiAgICAgIHsNCiAgICAgICAgImlkIjogIjMyNjM1MDkxIiwNCiAgICAgICAgInBlc0lkIjogIjE1NjE0IiwNCiAgICAgICAgInR5cGVJZCI6ICJEaWFnbm9zdGljcy5Nb2RlbHNBbmRVdGlscy5BdHRyaWJ1dGVzLlN1cHBvcnRUb3BpYywgRGlhZ25vc3RpY3MuTW9kZWxzQW5kVXRpbHMsIFZlcnNpb249MS4wLjAuMCwgQ3VsdHVyZT1uZXV0cmFsLCBQdWJsaWNLZXlUb2tlbj1udWxsIg0KICAgICAgfSwNCiAgICAgIHsNCiAgICAgICAgImlkIjogIjMyNjM1MDkzIiwNCiAgICAgICAgInBlc0lkIjogIjE1NjE0IiwNCiAgICAgICAgInR5cGVJZCI6ICJEaWFnbm9zdGljcy5Nb2RlbHNBbmRVdGlscy5BdHRyaWJ1dGVzLlN1cHBvcnRUb3BpYywgRGlhZ25vc3RpY3MuTW9kZWxzQW5kVXRpbHMsIFZlcnNpb249MS4wLjAuMCwgQ3VsdHVyZT1uZXV0cmFsLCBQdWJsaWNLZXlUb2tlbj1udWxsIg0KICAgICAgfSwNCiAgICAgIHsNCiAgICAgICAgImlkIjogIjMyNjM1MDk0IiwNCiAgICAgICAgInBlc0lkIjogIjE1NjE0IiwNCiAgICAgICAgInR5cGVJZCI6ICJEaWFnbm9zdGljcy5Nb2RlbHNBbmRVdGlscy5BdHRyaWJ1dGVzLlN1cHBvcnRUb3BpYywgRGlhZ25vc3RpY3MuTW9kZWxzQW5kVXRpbHMsIFZlcnNpb249MS4wLjAuMCwgQ3VsdHVyZT1uZXV0cmFsLCBQdWJsaWNLZXlUb2tlbj1udWxsIg0KICAgICAgfQ0KICAgIF0sDQogICAgImFuYWx5c2lzVHlwZXMiOiBudWxsLA0KICAgICJ0eXBlIjogIkFuYWx5c2lzIiwNCiAgICAic2NvcmUiOiAwLjANCiAgfSwNCiAgImRhdGFzZXQiOiBbXSwNCiAgInN0YXR1cyI6IHsNCiAgICAibWVzc2FnZSI6IG51bGwsDQogICAgInN0YXR1c0lkIjogNA0KICB9LA0KICAiZGF0YVByb3ZpZGVyc01ldGFkYXRhIjogbnVsbCwNCiAgInN1Z2dlc3RlZFV0dGVyYW5jZXMiOiBudWxsDQp9"), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ef6f2f06858cdbec7684968e1a54c7610da97dbb/specification/batch/resource-manager/Microsoft.Batch/stable/2022-10-01/examples/DetectorGet.json -func ExampleAccountClient_GetDetector() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armbatch.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewAccountClient().GetDetector(ctx, "default-azurebatch-japaneast", "sampleacct", "poolsAndNodes", 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.DetectorResponse = armbatch.DetectorResponse{ - // Name: to.Ptr("poolsAndNodes"), - // Type: to.Ptr("Microsoft.Batch/batchAccounts/detectors"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/default-azurebatch-japaneast/providers/Microsoft.Batch/batchAccounts/sampleacct/detectors/poolsAndNodes"), - // Properties: &armbatch.DetectorResponseProperties{ - // Value: to.Ptr("ew0KICAibWV0YWRhdGEiOiB7DQogICAgImlkIjogInBvb2xzQW5kTm9kZXMiLA0KICAgICJuYW1lIjogIlBvb2xzIGFuZCBOb2RlcyIsDQogICAgImRlc2NyaXB0aW9uIjogbnVsbCwNCiAgICAiYXV0aG9yIjogIiIsDQogICAgImNhdGVnb3J5IjogbnVsbCwNCiAgICAic3VwcG9ydFRvcGljTGlzdCI6IFsNCiAgICAgIHsNCiAgICAgICAgImlkIjogIjMyNjM1MDc3IiwNCiAgICAgICAgInBlc0lkIjogIjE1NjE0IiwNCiAgICAgICAgInR5cGVJZCI6ICJEaWFnbm9zdGljcy5Nb2RlbHNBbmRVdGlscy5BdHRyaWJ1dGVzLlN1cHBvcnRUb3BpYywgRGlhZ25vc3RpY3MuTW9kZWxzQW5kVXRpbHMsIFZlcnNpb249MS4wLjAuMCwgQ3VsdHVyZT1uZXV0cmFsLCBQdWJsaWNLZXlUb2tlbj1udWxsIg0KICAgICAgfSwNCiAgICAgIHsNCiAgICAgICAgImlkIjogIjMyNjM1MDYxIiwNCiAgICAgICAgInBlc0lkIjogIjE1NjE0IiwNCiAgICAgICAgInR5cGVJZCI6ICJEaWFnbm9zdGljcy5Nb2RlbHNBbmRVdGlscy5BdHRyaWJ1dGVzLlN1cHBvcnRUb3BpYywgRGlhZ25vc3RpY3MuTW9kZWxzQW5kVXRpbHMsIFZlcnNpb249MS4wLjAuMCwgQ3VsdHVyZT1uZXV0cmFsLCBQdWJsaWNLZXlUb2tlbj1udWxsIg0KICAgICAgfSwNCiAgICAgIHsNCiAgICAgICAgImlkIjogIjMyNjM1MDY1IiwNCiAgICAgICAgInBlc0lkIjogIjE1NjE0IiwNCiAgICAgICAgInR5cGVJZCI6ICJEaWFnbm9zdGljcy5Nb2RlbHNBbmRVdGlscy5BdHRyaWJ1dGVzLlN1cHBvcnRUb3BpYywgRGlhZ25vc3RpY3MuTW9kZWxzQW5kVXRpbHMsIFZlcnNpb249MS4wLjAuMCwgQ3VsdHVyZT1uZXV0cmFsLCBQdWJsaWNLZXlUb2tlbj1udWxsIg0KICAgICAgfSwNCiAgICAgIHsNCiAgICAgICAgImlkIjogIjMyNjM1MDY2IiwNCiAgICAgICAgInBlc0lkIjogIjE1NjE0IiwNCiAgICAgICAgInR5cGVJZCI6ICJEaWFnbm9zdGljcy5Nb2RlbHNBbmRVdGlscy5BdHRyaWJ1dGVzLlN1cHBvcnRUb3BpYywgRGlhZ25vc3RpY3MuTW9kZWxzQW5kVXRpbHMsIFZlcnNpb249MS4wLjAuMCwgQ3VsdHVyZT1uZXV0cmFsLCBQdWJsaWNLZXlUb2tlbj1udWxsIg0KICAgICAgfSwNCiAgICAgIHsNCiAgICAgICAgImlkIjogIjMyNjM1MDY5IiwNCiAgICAgICAgInBlc0lkIjogIjE1NjE0IiwNCiAgICAgICAgInR5cGVJZCI6ICJEaWFnbm9zdGljcy5Nb2RlbHNBbmRVdGlscy5BdHRyaWJ1dGVzLlN1cHBvcnRUb3BpYywgRGlhZ25vc3RpY3MuTW9kZWxzQW5kVXRpbHMsIFZlcnNpb249MS4wLjAuMCwgQ3VsdHVyZT1uZXV0cmFsLCBQdWJsaWNLZXlUb2tlbj1udWxsIg0KICAgICAgfSwNCiAgICAgIHsNCiAgICAgICAgImlkIjogIjMyNjM1MDcyIiwNCiAgICAgICAgInBlc0lkIjogIjE1NjE0IiwNCiAgICAgICAgInR5cGVJZCI6ICJEaWFnbm9zdGljcy5Nb2RlbHNBbmRVdGlscy5BdHRyaWJ1dGVzLlN1cHBvcnRUb3BpYywgRGlhZ25vc3RpY3MuTW9kZWxzQW5kVXRpbHMsIFZlcnNpb249MS4wLjAuMCwgQ3VsdHVyZT1uZXV0cmFsLCBQdWJsaWNLZXlUb2tlbj1udWxsIg0KICAgICAgfSwNCiAgICAgIHsNCiAgICAgICAgImlkIjogIjMyNjM1MDc5IiwNCiAgICAgICAgInBlc0lkIjogIjE1NjE0IiwNCiAgICAgICAgInR5cGVJZCI6ICJEaWFnbm9zdGljcy5Nb2RlbHNBbmRVdGlscy5BdHRyaWJ1dGVzLlN1cHBvcnRUb3BpYywgRGlhZ25vc3RpY3MuTW9kZWxzQW5kVXRpbHMsIFZlcnNpb249MS4wLjAuMCwgQ3VsdHVyZT1uZXV0cmFsLCBQdWJsaWNLZXlUb2tlbj1udWxsIg0KICAgICAgfSwNCiAgICAgIHsNCiAgICAgICAgImlkIjogIjMyNjM1MDgyIiwNCiAgICAgICAgInBlc0lkIjogIjE1NjE0IiwNCiAgICAgICAgInR5cGVJZCI6ICJEaWFnbm9zdGljcy5Nb2RlbHNBbmRVdGlscy5BdHRyaWJ1dGVzLlN1cHBvcnRUb3BpYywgRGlhZ25vc3RpY3MuTW9kZWxzQW5kVXRpbHMsIFZlcnNpb249MS4wLjAuMCwgQ3VsdHVyZT1uZXV0cmFsLCBQdWJsaWNLZXlUb2tlbj1udWxsIg0KICAgICAgfSwNCiAgICAgIHsNCiAgICAgICAgImlkIjogIjMyNjM1MDkxIiwNCiAgICAgICAgInBlc0lkIjogIjE1NjE0IiwNCiAgICAgICAgInR5cGVJZCI6ICJEaWFnbm9zdGljcy5Nb2RlbHNBbmRVdGlscy5BdHRyaWJ1dGVzLlN1cHBvcnRUb3BpYywgRGlhZ25vc3RpY3MuTW9kZWxzQW5kVXRpbHMsIFZlcnNpb249MS4wLjAuMCwgQ3VsdHVyZT1uZXV0cmFsLCBQdWJsaWNLZXlUb2tlbj1udWxsIg0KICAgICAgfSwNCiAgICAgIHsNCiAgICAgICAgImlkIjogIjMyNjM1MDkzIiwNCiAgICAgICAgInBlc0lkIjogIjE1NjE0IiwNCiAgICAgICAgInR5cGVJZCI6ICJEaWFnbm9zdGljcy5Nb2RlbHNBbmRVdGlscy5BdHRyaWJ1dGVzLlN1cHBvcnRUb3BpYywgRGlhZ25vc3RpY3MuTW9kZWxzQW5kVXRpbHMsIFZlcnNpb249MS4wLjAuMCwgQ3VsdHVyZT1uZXV0cmFsLCBQdWJsaWNLZXlUb2tlbj1udWxsIg0KICAgICAgfSwNCiAgICAgIHsNCiAgICAgICAgImlkIjogIjMyNjM1MDk0IiwNCiAgICAgICAgInBlc0lkIjogIjE1NjE0IiwNCiAgICAgICAgInR5cGVJZCI6ICJEaWFnbm9zdGljcy5Nb2RlbHNBbmRVdGlscy5BdHRyaWJ1dGVzLlN1cHBvcnRUb3BpYywgRGlhZ25vc3RpY3MuTW9kZWxzQW5kVXRpbHMsIFZlcnNpb249MS4wLjAuMCwgQ3VsdHVyZT1uZXV0cmFsLCBQdWJsaWNLZXlUb2tlbj1udWxsIg0KICAgICAgfQ0KICAgIF0sDQogICAgImFuYWx5c2lzVHlwZXMiOiBudWxsLA0KICAgICJ0eXBlIjogIkFuYWx5c2lzIiwNCiAgICAic2NvcmUiOiAwLjANCiAgfSwNCiAgImRhdGFzZXQiOiBbXSwNCiAgInN0YXR1cyI6IHsNCiAgICAibWVzc2FnZSI6IG51bGwsDQogICAgInN0YXR1c0lkIjogNA0KICB9LA0KICAiZGF0YVByb3ZpZGVyc01ldGFkYXRhIjogbnVsbCwNCiAgInN1Z2dlc3RlZFV0dGVyYW5jZXMiOiBudWxsDQp9"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ef6f2f06858cdbec7684968e1a54c7610da97dbb/specification/batch/resource-manager/Microsoft.Batch/stable/2022-10-01/examples/BatchAccountListOutboundNetworkDependenciesEndpoints.json -func ExampleAccountClient_NewListOutboundNetworkDependenciesEndpointsPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armbatch.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewAccountClient().NewListOutboundNetworkDependenciesEndpointsPager("default-azurebatch-japaneast", "sampleacct", 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.OutboundEnvironmentEndpointCollection = armbatch.OutboundEnvironmentEndpointCollection{ - // Value: []*armbatch.OutboundEnvironmentEndpoint{ - // { - // Category: to.Ptr("Azure Batch"), - // Endpoints: []*armbatch.EndpointDependency{ - // { - // Description: to.Ptr("Applicable to job manager tasks, tasks that use job scoped authentication, or any task that makes calls to Batch."), - // DomainName: to.Ptr("sampleacct.japaneast.batch.azure.com"), - // EndpointDetails: []*armbatch.EndpointDetail{ - // { - // Port: to.Ptr[int32](443), - // }}, - // }, - // { - // Description: to.Ptr("Applicable to all Azure Batch pools."), - // DomainName: to.Ptr("japaneast.service.batch.azure.com"), - // EndpointDetails: []*armbatch.EndpointDetail{ - // { - // Port: to.Ptr[int32](443), - // }}, - // }}, - // }, - // { - // Category: to.Ptr("Azure Storage"), - // Endpoints: []*armbatch.EndpointDependency{ - // { - // Description: to.Ptr("AutoStorage endpoint for this Batch account. Applicable to all Azure Batch pools under this account."), - // DomainName: to.Ptr("autostorageaccountname.blob.core.windows.net"), - // EndpointDetails: []*armbatch.EndpointDetail{ - // { - // Port: to.Ptr[int32](443), - // }}, - // }, - // { - // Description: to.Ptr("Applicable to all Azure Batch pools."), - // DomainName: to.Ptr("*.blob.core.windows.net"), - // EndpointDetails: []*armbatch.EndpointDetail{ - // { - // Port: to.Ptr[int32](443), - // }}, - // }, - // { - // Description: to.Ptr("Applicable to all Azure Batch pools."), - // DomainName: to.Ptr("*.table.core.windows.net"), - // EndpointDetails: []*armbatch.EndpointDetail{ - // { - // Port: to.Ptr[int32](443), - // }}, - // }, - // { - // Description: to.Ptr("Applicable to all Azure Batch pools."), - // DomainName: to.Ptr("*.queue.core.windows.net"), - // EndpointDetails: []*armbatch.EndpointDetail{ - // { - // Port: to.Ptr[int32](443), - // }}, - // }}, - // }, - // { - // Category: to.Ptr("Microsoft Package Repository"), - // Endpoints: []*armbatch.EndpointDependency{ - // { - // Description: to.Ptr("Only applicable to pools containing a Mount Configuration. Learn about Mount Configurations in Batch at https://docs.microsoft.com/azure/batch/virtual-file-mount."), - // DomainName: to.Ptr("packages.microsoft.com"), - // EndpointDetails: []*armbatch.EndpointDetail{ - // { - // Port: to.Ptr[int32](443), - // }}, - // }}, - // }, - // { - // Category: to.Ptr("Azure Key Vault"), - // Endpoints: []*armbatch.EndpointDependency{ - // { - // Description: to.Ptr("Only applicable to pools containing a Disk Encryption Configuration and whose VM size does not support encryption at host. Learn more about disk encryption in Azure Batch at https://docs.microsoft.com/azure/batch/disk-encryption. Learn more about encryption at host and supported VM sizes at https://docs.microsoft.com/azure/virtual-machines/disks-enable-host-based-encryption-portal."), - // DomainName: to.Ptr("*.vault.azure.net"), - // EndpointDetails: []*armbatch.EndpointDetail{ - // { - // Port: to.Ptr[int32](443), - // }}, - // }}, - // }}, - // } - } -} diff --git a/sdk/resourcemanager/batch/armbatch/application_client.go b/sdk/resourcemanager/batch/armbatch/application_client.go index d788e4cbea1a..e9bfb455e6c1 100644 --- a/sdk/resourcemanager/batch/armbatch/application_client.go +++ b/sdk/resourcemanager/batch/armbatch/application_client.go @@ -48,7 +48,7 @@ func NewApplicationClient(subscriptionID string, credential azcore.TokenCredenti // Create - Adds an application to the specified Batch account. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-10-01 +// Generated from API version 2023-05-01 // - resourceGroupName - The name of the resource group that contains the Batch account. // - accountName - The name of the Batch account. // - applicationName - The name of the application. This must be unique within the account. @@ -92,7 +92,7 @@ func (client *ApplicationClient) createCreateRequest(ctx context.Context, resour return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-10-01") + reqQP.Set("api-version", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if options != nil && options.Parameters != nil { @@ -113,7 +113,7 @@ func (client *ApplicationClient) createHandleResponse(resp *http.Response) (Appl // Delete - Deletes an application. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-10-01 +// Generated from API version 2023-05-01 // - resourceGroupName - The name of the resource group that contains the Batch account. // - accountName - The name of the Batch account. // - applicationName - The name of the application. This must be unique within the account. @@ -157,7 +157,7 @@ func (client *ApplicationClient) deleteCreateRequest(ctx context.Context, resour return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-10-01") + reqQP.Set("api-version", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -166,7 +166,7 @@ func (client *ApplicationClient) deleteCreateRequest(ctx context.Context, resour // Get - Gets information about the specified application. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-10-01 +// Generated from API version 2023-05-01 // - resourceGroupName - The name of the resource group that contains the Batch account. // - accountName - The name of the Batch account. // - applicationName - The name of the application. This must be unique within the account. @@ -210,7 +210,7 @@ func (client *ApplicationClient) getCreateRequest(ctx context.Context, resourceG return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-10-01") + reqQP.Set("api-version", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -227,7 +227,7 @@ func (client *ApplicationClient) getHandleResponse(resp *http.Response) (Applica // NewListPager - Lists all of the applications in the specified account. // -// Generated from API version 2022-10-01 +// Generated from API version 2023-05-01 // - resourceGroupName - The name of the resource group that contains the Batch account. // - accountName - The name of the Batch account. // - options - ApplicationClientListOptions contains the optional parameters for the ApplicationClient.NewListPager method. @@ -282,7 +282,7 @@ func (client *ApplicationClient) listCreateRequest(ctx context.Context, resource if options != nil && options.Maxresults != nil { reqQP.Set("maxresults", strconv.FormatInt(int64(*options.Maxresults), 10)) } - reqQP.Set("api-version", "2022-10-01") + reqQP.Set("api-version", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -300,7 +300,7 @@ func (client *ApplicationClient) listHandleResponse(resp *http.Response) (Applic // Update - Updates settings for the specified application. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-10-01 +// Generated from API version 2023-05-01 // - resourceGroupName - The name of the resource group that contains the Batch account. // - accountName - The name of the Batch account. // - applicationName - The name of the application. This must be unique within the account. @@ -345,7 +345,7 @@ func (client *ApplicationClient) updateCreateRequest(ctx context.Context, resour return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-10-01") + reqQP.Set("api-version", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, parameters) diff --git a/sdk/resourcemanager/batch/armbatch/application_client_example_test.go b/sdk/resourcemanager/batch/armbatch/application_client_example_test.go deleted file mode 100644 index 920cf98c32d6..000000000000 --- a/sdk/resourcemanager/batch/armbatch/application_client_example_test.go +++ /dev/null @@ -1,188 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armbatch_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/batch/armbatch" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ef6f2f06858cdbec7684968e1a54c7610da97dbb/specification/batch/resource-manager/Microsoft.Batch/stable/2022-10-01/examples/ApplicationCreate.json -func ExampleApplicationClient_Create() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armbatch.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewApplicationClient().Create(ctx, "default-azurebatch-japaneast", "sampleacct", "app1", &armbatch.ApplicationClientCreateOptions{Parameters: &armbatch.Application{ - Properties: &armbatch.ApplicationProperties{ - AllowUpdates: to.Ptr(false), - DisplayName: to.Ptr("myAppName"), - }, - }, - }) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.Application = armbatch.Application{ - // Name: to.Ptr("app1"), - // Type: to.Ptr("Microsoft.Batch/batchAccounts/applications"), - // Etag: to.Ptr("W/\"0x8D64F8EBB3DC411\""), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/default-azurebatch-japaneast/providers/Microsoft.Batch/batchAccounts/sampleacct/applications/app1"), - // Properties: &armbatch.ApplicationProperties{ - // AllowUpdates: to.Ptr(false), - // DisplayName: to.Ptr("myAppName"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ef6f2f06858cdbec7684968e1a54c7610da97dbb/specification/batch/resource-manager/Microsoft.Batch/stable/2022-10-01/examples/ApplicationDelete.json -func ExampleApplicationClient_Delete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armbatch.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = clientFactory.NewApplicationClient().Delete(ctx, "default-azurebatch-japaneast", "sampleacct", "app1", 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/ef6f2f06858cdbec7684968e1a54c7610da97dbb/specification/batch/resource-manager/Microsoft.Batch/stable/2022-10-01/examples/ApplicationGet.json -func ExampleApplicationClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armbatch.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewApplicationClient().Get(ctx, "default-azurebatch-japaneast", "sampleacct", "app1", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.Application = armbatch.Application{ - // Name: to.Ptr("app1"), - // Type: to.Ptr("Microsoft.Batch/batchAccounts/applications"), - // Etag: to.Ptr("W/\"0x8D64F915BDF7F00\""), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/default-azurebatch-japaneast/providers/Microsoft.Batch/batchAccounts/sampleacct/applications/app1"), - // Properties: &armbatch.ApplicationProperties{ - // AllowUpdates: to.Ptr(true), - // DisplayName: to.Ptr("Sample Application"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ef6f2f06858cdbec7684968e1a54c7610da97dbb/specification/batch/resource-manager/Microsoft.Batch/stable/2022-10-01/examples/ApplicationUpdate.json -func ExampleApplicationClient_Update() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armbatch.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewApplicationClient().Update(ctx, "default-azurebatch-japaneast", "sampleacct", "app1", armbatch.Application{ - Properties: &armbatch.ApplicationProperties{ - AllowUpdates: to.Ptr(true), - DefaultVersion: to.Ptr("2"), - DisplayName: to.Ptr("myAppName"), - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.Application = armbatch.Application{ - // Name: to.Ptr("app1"), - // Type: to.Ptr("Microsoft.Batch/batchAccounts/applications"), - // Etag: to.Ptr("W/\"0x8D64F915BDF7F00\""), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/default-azurebatch-japaneast/providers/Microsoft.Batch/batchAccounts/sampleacct/applications/app1"), - // Properties: &armbatch.ApplicationProperties{ - // AllowUpdates: to.Ptr(true), - // DefaultVersion: to.Ptr("2"), - // DisplayName: to.Ptr("myAppName"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ef6f2f06858cdbec7684968e1a54c7610da97dbb/specification/batch/resource-manager/Microsoft.Batch/stable/2022-10-01/examples/ApplicationList.json -func ExampleApplicationClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armbatch.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewApplicationClient().NewListPager("default-azurebatch-japaneast", "sampleacct", &armbatch.ApplicationClientListOptions{Maxresults: 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.ListApplicationsResult = armbatch.ListApplicationsResult{ - // Value: []*armbatch.Application{ - // { - // Name: to.Ptr("app1"), - // Type: to.Ptr("Microsoft.Batch/batchAccounts/applications"), - // Etag: to.Ptr("W/\"0x8D64F91A9089879\""), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/default-azurebatch-japaneast/providers/Microsoft.Batch/batchAccounts/sampleacct/applications/app1"), - // Properties: &armbatch.ApplicationProperties{ - // AllowUpdates: to.Ptr(false), - // DefaultVersion: to.Ptr("1"), - // }, - // }, - // { - // Name: to.Ptr("app1"), - // Type: to.Ptr("Microsoft.Batch/batchAccounts/applications"), - // Etag: to.Ptr("W/\"0x8D64F91A9089879\""), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/default-azurebatch-japaneast/providers/Microsoft.Batch/batchAccounts/sampleacct/applications/app2"), - // Properties: &armbatch.ApplicationProperties{ - // AllowUpdates: to.Ptr(false), - // DefaultVersion: to.Ptr("2.0"), - // DisplayName: to.Ptr("myAppName"), - // }, - // }}, - // } - } -} diff --git a/sdk/resourcemanager/batch/armbatch/applicationpackage_client.go b/sdk/resourcemanager/batch/armbatch/applicationpackage_client.go index 2e0806d30281..5bec4783ca78 100644 --- a/sdk/resourcemanager/batch/armbatch/applicationpackage_client.go +++ b/sdk/resourcemanager/batch/armbatch/applicationpackage_client.go @@ -50,7 +50,7 @@ func NewApplicationPackageClient(subscriptionID string, credential azcore.TokenC // Tasks. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-10-01 +// Generated from API version 2023-05-01 // - resourceGroupName - The name of the resource group that contains the Batch account. // - accountName - The name of the Batch account. // - applicationName - The name of the application. This must be unique within the account. @@ -101,7 +101,7 @@ func (client *ApplicationPackageClient) activateCreateRequest(ctx context.Contex return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-10-01") + reqQP.Set("api-version", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, parameters) @@ -122,7 +122,7 @@ func (client *ApplicationPackageClient) activateHandleResponse(resp *http.Respon // returned will contain a SAS. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-10-01 +// Generated from API version 2023-05-01 // - resourceGroupName - The name of the resource group that contains the Batch account. // - accountName - The name of the Batch account. // - applicationName - The name of the application. This must be unique within the account. @@ -172,7 +172,7 @@ func (client *ApplicationPackageClient) createCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-10-01") + reqQP.Set("api-version", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if options != nil && options.Parameters != nil { @@ -193,7 +193,7 @@ func (client *ApplicationPackageClient) createHandleResponse(resp *http.Response // Delete - Deletes an application package record and its associated binary file. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-10-01 +// Generated from API version 2023-05-01 // - resourceGroupName - The name of the resource group that contains the Batch account. // - accountName - The name of the Batch account. // - applicationName - The name of the application. This must be unique within the account. @@ -243,7 +243,7 @@ func (client *ApplicationPackageClient) deleteCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-10-01") + reqQP.Set("api-version", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -252,7 +252,7 @@ func (client *ApplicationPackageClient) deleteCreateRequest(ctx context.Context, // Get - Gets information about the specified application package. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-10-01 +// Generated from API version 2023-05-01 // - resourceGroupName - The name of the resource group that contains the Batch account. // - accountName - The name of the Batch account. // - applicationName - The name of the application. This must be unique within the account. @@ -301,7 +301,7 @@ func (client *ApplicationPackageClient) getCreateRequest(ctx context.Context, re return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-10-01") + reqQP.Set("api-version", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -318,7 +318,7 @@ func (client *ApplicationPackageClient) getHandleResponse(resp *http.Response) ( // NewListPager - Lists all of the application packages in the specified application. // -// Generated from API version 2022-10-01 +// Generated from API version 2023-05-01 // - resourceGroupName - The name of the resource group that contains the Batch account. // - accountName - The name of the Batch account. // - applicationName - The name of the application. This must be unique within the account. @@ -379,7 +379,7 @@ func (client *ApplicationPackageClient) listCreateRequest(ctx context.Context, r if options != nil && options.Maxresults != nil { reqQP.Set("maxresults", strconv.FormatInt(int64(*options.Maxresults), 10)) } - reqQP.Set("api-version", "2022-10-01") + reqQP.Set("api-version", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/batch/armbatch/applicationpackage_client_example_test.go b/sdk/resourcemanager/batch/armbatch/applicationpackage_client_example_test.go deleted file mode 100644 index baf480297ff2..000000000000 --- a/sdk/resourcemanager/batch/armbatch/applicationpackage_client_example_test.go +++ /dev/null @@ -1,179 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armbatch_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/batch/armbatch" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ef6f2f06858cdbec7684968e1a54c7610da97dbb/specification/batch/resource-manager/Microsoft.Batch/stable/2022-10-01/examples/ApplicationPackageActivate.json -func ExampleApplicationPackageClient_Activate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armbatch.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewApplicationPackageClient().Activate(ctx, "default-azurebatch-japaneast", "sampleacct", "app1", "1", armbatch.ActivateApplicationPackageParameters{ - Format: to.Ptr("zip"), - }, 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.ApplicationPackage = armbatch.ApplicationPackage{ - // Name: to.Ptr("1"), - // Type: to.Ptr("Microsoft.Batch/batchAccounts/applications/versions"), - // Etag: to.Ptr("W/\"0x8D64FEC83A3B436\""), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/default-azurebatch-japaneast/providers/Microsoft.Batch/batchAccounts/sampleacct/applications/app1/versions/1"), - // Properties: &armbatch.ApplicationPackageProperties{ - // Format: to.Ptr("zip"), - // LastActivationTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-06-27T18:48:09.9330991Z"); return t}()), - // State: to.Ptr(armbatch.PackageStateActive), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ef6f2f06858cdbec7684968e1a54c7610da97dbb/specification/batch/resource-manager/Microsoft.Batch/stable/2022-10-01/examples/ApplicationPackageCreate.json -func ExampleApplicationPackageClient_Create() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armbatch.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewApplicationPackageClient().Create(ctx, "default-azurebatch-japaneast", "sampleacct", "app1", "1", &armbatch.ApplicationPackageClientCreateOptions{Parameters: 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.ApplicationPackage = armbatch.ApplicationPackage{ - // Name: to.Ptr("1"), - // Type: to.Ptr("Microsoft.Batch/batchAccounts/applications/versions"), - // Etag: to.Ptr("W/\"0x8D64FEC83A3B436\""), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/default-azurebatch-japaneast/providers/Microsoft.Batch/batchAccounts/sampleacct/applications/app1/versions/1"), - // Properties: &armbatch.ApplicationPackageProperties{ - // State: to.Ptr(armbatch.PackageStatePending), - // StorageURL: to.Ptr("http://mystorage1.blob.core.windows.net/myapp?mysas"), - // StorageURLExpiry: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-06-27T18:48:09.9330991Z"); return t}()), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ef6f2f06858cdbec7684968e1a54c7610da97dbb/specification/batch/resource-manager/Microsoft.Batch/stable/2022-10-01/examples/ApplicationPackageDelete.json -func ExampleApplicationPackageClient_Delete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armbatch.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = clientFactory.NewApplicationPackageClient().Delete(ctx, "default-azurebatch-japaneast", "sampleacct", "app1", "1", 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/ef6f2f06858cdbec7684968e1a54c7610da97dbb/specification/batch/resource-manager/Microsoft.Batch/stable/2022-10-01/examples/ApplicationPackageGet.json -func ExampleApplicationPackageClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armbatch.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewApplicationPackageClient().Get(ctx, "default-azurebatch-japaneast", "sampleacct", "app1", "1", 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.ApplicationPackage = armbatch.ApplicationPackage{ - // Name: to.Ptr("1"), - // Type: to.Ptr("Microsoft.Batch/batchAccounts/applications/versions"), - // Etag: to.Ptr("W/\"0x8D64FEC83A3B436\""), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/default-azurebatch-japaneast/providers/Microsoft.Batch/batchAccounts/sampleacct/applications/app1/versions/1"), - // Properties: &armbatch.ApplicationPackageProperties{ - // Format: to.Ptr("zip"), - // LastActivationTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-06-27T18:48:09.9330991Z"); return t}()), - // State: to.Ptr(armbatch.PackageStateActive), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ef6f2f06858cdbec7684968e1a54c7610da97dbb/specification/batch/resource-manager/Microsoft.Batch/stable/2022-10-01/examples/ApplicationPackageList.json -func ExampleApplicationPackageClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armbatch.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewApplicationPackageClient().NewListPager("default-azurebatch-japaneast", "sampleacct", "app1", &armbatch.ApplicationPackageClientListOptions{Maxresults: 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.ListApplicationPackagesResult = armbatch.ListApplicationPackagesResult{ - // Value: []*armbatch.ApplicationPackage{ - // { - // Name: to.Ptr("1.0"), - // Type: to.Ptr("Microsoft.Batch/batchAccounts/applications/versions"), - // Etag: to.Ptr("W/\"0x8D64FF0B9F47F67\""), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/default-azurebatch-japaneast/providers/Microsoft.Batch/batchAccounts/sampleacct/applications/app1/versions/1.0"), - // Properties: &armbatch.ApplicationPackageProperties{ - // State: to.Ptr(armbatch.PackageStatePending), - // }, - // }, - // { - // Name: to.Ptr("2.0"), - // Type: to.Ptr("Microsoft.Batch/batchAccounts/applications/versions"), - // Etag: to.Ptr("W/\"0x8D64FF0B9F47F67\""), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/default-azurebatch-japaneast/providers/Microsoft.Batch/batchAccounts/sampleacct/applications/app1/versions/2.0"), - // Properties: &armbatch.ApplicationPackageProperties{ - // Format: to.Ptr("zip"), - // LastActivationTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-06-27T18:48:09.9330991Z"); return t}()), - // State: to.Ptr(armbatch.PackageStateActive), - // }, - // }}, - // } - } -} diff --git a/sdk/resourcemanager/batch/armbatch/autorest.md b/sdk/resourcemanager/batch/armbatch/autorest.md index 2c508d269c95..29adbab00945 100644 --- a/sdk/resourcemanager/batch/armbatch/autorest.md +++ b/sdk/resourcemanager/batch/armbatch/autorest.md @@ -5,8 +5,8 @@ ``` yaml azure-arm: true require: -- https://github.com/Azure/azure-rest-api-specs/blob/ef6f2f06858cdbec7684968e1a54c7610da97dbb/specification/batch/resource-manager/readme.md -- https://github.com/Azure/azure-rest-api-specs/blob/ef6f2f06858cdbec7684968e1a54c7610da97dbb/specification/batch/resource-manager/readme.go.md +- /mnt/vss/_work/1/s/azure-rest-api-specs/specification/batch/resource-manager/readme.md +- /mnt/vss/_work/1/s/azure-rest-api-specs/specification/batch/resource-manager/readme.go.md license-header: MICROSOFT_MIT_NO_VERSION -module-version: 1.2.1 +module-version: 2.0.0 ``` \ No newline at end of file diff --git a/sdk/resourcemanager/batch/armbatch/certificate_client.go b/sdk/resourcemanager/batch/armbatch/certificate_client.go index 315de73bc1b4..a865045ecdb3 100644 --- a/sdk/resourcemanager/batch/armbatch/certificate_client.go +++ b/sdk/resourcemanager/batch/armbatch/certificate_client.go @@ -55,7 +55,7 @@ func NewCertificateClient(subscriptionID string, credential azcore.TokenCredenti // instead. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-10-01 +// Generated from API version 2023-05-01 // - resourceGroupName - The name of the resource group that contains the Batch account. // - accountName - The name of the Batch account. // - certificateName - The identifier for the certificate. This must be made up of algorithm and thumbprint separated by a dash, @@ -101,7 +101,7 @@ func (client *CertificateClient) cancelDeletionCreateRequest(ctx context.Context return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-10-01") + reqQP.Set("api-version", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -124,7 +124,7 @@ func (client *CertificateClient) cancelDeletionHandleResponse(resp *http.Respons // instead. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-10-01 +// Generated from API version 2023-05-01 // - resourceGroupName - The name of the resource group that contains the Batch account. // - accountName - The name of the Batch account. // - certificateName - The identifier for the certificate. This must be made up of algorithm and thumbprint separated by a dash, @@ -170,7 +170,7 @@ func (client *CertificateClient) createCreateRequest(ctx context.Context, resour return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-10-01") + reqQP.Set("api-version", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() if options != nil && options.IfMatch != nil { req.Raw().Header["If-Match"] = []string{*options.IfMatch} @@ -199,7 +199,7 @@ func (client *CertificateClient) createHandleResponse(resp *http.Response) (Cert // instead. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-10-01 +// Generated from API version 2023-05-01 // - resourceGroupName - The name of the resource group that contains the Batch account. // - accountName - The name of the Batch account. // - certificateName - The identifier for the certificate. This must be made up of algorithm and thumbprint separated by a dash, @@ -224,7 +224,7 @@ func (client *CertificateClient) BeginDelete(ctx context.Context, resourceGroupN // instead. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-10-01 +// Generated from API version 2023-05-01 func (client *CertificateClient) deleteOperation(ctx context.Context, resourceGroupName string, accountName string, certificateName string, options *CertificateClientBeginDeleteOptions) (*http.Response, error) { req, err := client.deleteCreateRequest(ctx, resourceGroupName, accountName, certificateName, options) if err != nil { @@ -264,7 +264,7 @@ func (client *CertificateClient) deleteCreateRequest(ctx context.Context, resour return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-10-01") + reqQP.Set("api-version", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -275,7 +275,7 @@ func (client *CertificateClient) deleteCreateRequest(ctx context.Context, resour // instead. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-10-01 +// Generated from API version 2023-05-01 // - resourceGroupName - The name of the resource group that contains the Batch account. // - accountName - The name of the Batch account. // - certificateName - The identifier for the certificate. This must be made up of algorithm and thumbprint separated by a dash, @@ -320,7 +320,7 @@ func (client *CertificateClient) getCreateRequest(ctx context.Context, resourceG return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-10-01") + reqQP.Set("api-version", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -342,7 +342,7 @@ func (client *CertificateClient) getHandleResponse(resp *http.Response) (Certifi // the Azure KeyVault Extension [https://learn.microsoft.com/azure/batch/batch-certificate-migration-guide] // instead. // -// Generated from API version 2022-10-01 +// Generated from API version 2023-05-01 // - resourceGroupName - The name of the resource group that contains the Batch account. // - accountName - The name of the Batch account. // - options - CertificateClientListByBatchAccountOptions contains the optional parameters for the CertificateClient.NewListByBatchAccountPager @@ -404,7 +404,7 @@ func (client *CertificateClient) listByBatchAccountCreateRequest(ctx context.Con if options != nil && options.Filter != nil { reqQP.Set("$filter", *options.Filter) } - reqQP.Set("api-version", "2022-10-01") + reqQP.Set("api-version", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -424,7 +424,7 @@ func (client *CertificateClient) listByBatchAccountHandleResponse(resp *http.Res // instead. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-10-01 +// Generated from API version 2023-05-01 // - resourceGroupName - The name of the resource group that contains the Batch account. // - accountName - The name of the Batch account. // - certificateName - The identifier for the certificate. This must be made up of algorithm and thumbprint separated by a dash, @@ -470,7 +470,7 @@ func (client *CertificateClient) updateCreateRequest(ctx context.Context, resour return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-10-01") + reqQP.Set("api-version", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() if options != nil && options.IfMatch != nil { req.Raw().Header["If-Match"] = []string{*options.IfMatch} diff --git a/sdk/resourcemanager/batch/armbatch/certificate_client_example_test.go b/sdk/resourcemanager/batch/armbatch/certificate_client_example_test.go deleted file mode 100644 index f568c1d924b4..000000000000 --- a/sdk/resourcemanager/batch/armbatch/certificate_client_example_test.go +++ /dev/null @@ -1,417 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armbatch_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/batch/armbatch" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ef6f2f06858cdbec7684968e1a54c7610da97dbb/specification/batch/resource-manager/Microsoft.Batch/stable/2022-10-01/examples/CertificateList.json -func ExampleCertificateClient_NewListByBatchAccountPager_listCertificates() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armbatch.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewCertificateClient().NewListByBatchAccountPager("default-azurebatch-japaneast", "sampleacct", &armbatch.CertificateClientListByBatchAccountOptions{Maxresults: nil, - Select: nil, - Filter: 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.ListCertificatesResult = armbatch.ListCertificatesResult{ - // Value: []*armbatch.Certificate{ - // { - // Name: to.Ptr("sha1-0a0e4f50d51beadeac1d35afc5116098e7902e6e"), - // Type: to.Ptr("Microsoft.Batch/batchAccounts/certificates"), - // Etag: to.Ptr("W/\"0x8D4EDD5118668F7\""), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/default-azurebatch-japaneast/providers/Microsoft.Batch/batchAccounts/samplecct/certificates/sha1-0a0e4f50d51beadeac1d35afc5116098e7902e6e"), - // Properties: &armbatch.CertificateProperties{ - // Format: to.Ptr(armbatch.CertificateFormatPfx), - // Thumbprint: to.Ptr("0a0e4f50d51beadeac1d35afc5116098e7902e6e"), - // ThumbprintAlgorithm: to.Ptr("sha1"), - // ProvisioningState: to.Ptr(armbatch.CertificateProvisioningStateSucceeded), - // ProvisioningStateTransitionTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-07-21T01:47:38.4420202Z"); return t}()), - // PublicData: to.Ptr("MIICrjCCAZagAwI..."), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ef6f2f06858cdbec7684968e1a54c7610da97dbb/specification/batch/resource-manager/Microsoft.Batch/stable/2022-10-01/examples/CertificateListWithFilter.json -func ExampleCertificateClient_NewListByBatchAccountPager_listCertificatesFilterAndSelect() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armbatch.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewCertificateClient().NewListByBatchAccountPager("default-azurebatch-japaneast", "sampleacct", &armbatch.CertificateClientListByBatchAccountOptions{Maxresults: nil, - Select: to.Ptr("properties/format,properties/provisioningState"), - Filter: to.Ptr("properties/provisioningStateTransitionTime gt '2017-05-01' or properties/provisioningState eq 'Failed'"), - }) - 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.ListCertificatesResult = armbatch.ListCertificatesResult{ - // Value: []*armbatch.Certificate{ - // { - // Name: to.Ptr("sha1-0a0e4f50d51beadeac1d35afc5116098e7902e6e"), - // Type: to.Ptr("Microsoft.Batch/batchAccounts/certificates"), - // Etag: to.Ptr("W/\"0x8D4EDD5118668F7\""), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/default-azurebatch-japaneast/providers/Microsoft.Batch/batchAccounts/samplecct/certificates/sha1-0a0e4f50d51beadeac1d35afc5116098e7902e6e"), - // Properties: &armbatch.CertificateProperties{ - // Format: to.Ptr(armbatch.CertificateFormatPfx), - // ProvisioningState: to.Ptr(armbatch.CertificateProvisioningStateSucceeded), - // }, - // }, - // { - // Name: to.Ptr("sha1-aeb228ffb0bf67a793d61dce263ebd16949f15a1"), - // Type: to.Ptr("Microsoft.Batch/batchAccounts/certificates"), - // Etag: to.Ptr("W/\"0x8D4EDD5118572E0\""), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/default-azurebatch-japaneast/providers/Microsoft.Batch/batchAccounts/samplecct/certificates/sha1-aeb228ffb0bf67a793d61dce263ebd16949f15a1"), - // Properties: &armbatch.CertificateProperties{ - // Format: to.Ptr(armbatch.CertificateFormatCer), - // ProvisioningState: to.Ptr(armbatch.CertificateProvisioningStateSucceeded), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ef6f2f06858cdbec7684968e1a54c7610da97dbb/specification/batch/resource-manager/Microsoft.Batch/stable/2022-10-01/examples/CertificateCreate_Full.json -func ExampleCertificateClient_Create_createCertificateFull() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armbatch.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewCertificateClient().Create(ctx, "default-azurebatch-japaneast", "sampleacct", "sha1-0a0e4f50d51beadeac1d35afc5116098e7902e6e", armbatch.CertificateCreateOrUpdateParameters{ - Properties: &armbatch.CertificateCreateOrUpdateProperties{ - Format: to.Ptr(armbatch.CertificateFormatPfx), - Thumbprint: to.Ptr("0a0e4f50d51beadeac1d35afc5116098e7902e6e"), - ThumbprintAlgorithm: to.Ptr("sha1"), - Data: to.Ptr("MIIJsgIBAzCCCW4GCSqGSIb3DQE..."), - Password: to.Ptr(""), - }, - }, &armbatch.CertificateClientCreateOptions{IfMatch: nil, - IfNoneMatch: 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.Certificate = armbatch.Certificate{ - // Name: to.Ptr("sha1-0a0e4f50d51beadeac1d35afc5116098e7902e6e"), - // Type: to.Ptr("Microsoft.Batch/batchAccounts/certificates"), - // Etag: to.Ptr("W/\"0x8D4EDD5118668F7\""), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/default-azurebatch-japaneast/providers/Microsoft.Batch/batchAccounts/samplecct/certificates/sha1-0a0e4f50d51beadeac1d35afc5116098e7902e6e"), - // Properties: &armbatch.CertificateProperties{ - // Format: to.Ptr(armbatch.CertificateFormatPfx), - // Thumbprint: to.Ptr("0a0e4f50d51beadeac1d35afc5116098e7902e6e"), - // ThumbprintAlgorithm: to.Ptr("sha1"), - // ProvisioningState: to.Ptr(armbatch.CertificateProvisioningStateSucceeded), - // ProvisioningStateTransitionTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-07-21T01:47:38.4420202Z"); return t}()), - // PublicData: to.Ptr("MIICrjCCAZagAwI..."), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ef6f2f06858cdbec7684968e1a54c7610da97dbb/specification/batch/resource-manager/Microsoft.Batch/stable/2022-10-01/examples/CertificateCreate_MinimalCer.json -func ExampleCertificateClient_Create_createCertificateMinimalCer() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armbatch.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewCertificateClient().Create(ctx, "default-azurebatch-japaneast", "sampleacct", "sha1-0a0e4f50d51beadeac1d35afc5116098e7902e6e", armbatch.CertificateCreateOrUpdateParameters{ - Properties: &armbatch.CertificateCreateOrUpdateProperties{ - Format: to.Ptr(armbatch.CertificateFormatCer), - Data: to.Ptr("MIICrjCCAZagAwI..."), - }, - }, &armbatch.CertificateClientCreateOptions{IfMatch: nil, - IfNoneMatch: 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.Certificate = armbatch.Certificate{ - // Name: to.Ptr("sha1-0a0e4f50d51beadeac1d35afc5116098e7902e6e"), - // Type: to.Ptr("Microsoft.Batch/batchAccounts/certificates"), - // Etag: to.Ptr("W/\"0x8D4EDD5118668F7\""), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/default-azurebatch-japaneast/providers/Microsoft.Batch/batchAccounts/samplecct/certificates/sha1-0a0e4f50d51beadeac1d35afc5116098e7902e6e"), - // Properties: &armbatch.CertificateProperties{ - // Format: to.Ptr(armbatch.CertificateFormatCer), - // Thumbprint: to.Ptr("0a0e4f50d51beadeac1d35afc5116098e7902e6e"), - // ThumbprintAlgorithm: to.Ptr("sha1"), - // ProvisioningState: to.Ptr(armbatch.CertificateProvisioningStateSucceeded), - // ProvisioningStateTransitionTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-07-21T01:47:38.4420202Z"); return t}()), - // PublicData: to.Ptr("MIICrjCCAZagAwI..."), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ef6f2f06858cdbec7684968e1a54c7610da97dbb/specification/batch/resource-manager/Microsoft.Batch/stable/2022-10-01/examples/CertificateCreate_Minimal.json -func ExampleCertificateClient_Create_createCertificateMinimalPfx() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armbatch.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewCertificateClient().Create(ctx, "default-azurebatch-japaneast", "sampleacct", "sha1-0a0e4f50d51beadeac1d35afc5116098e7902e6e", armbatch.CertificateCreateOrUpdateParameters{ - Properties: &armbatch.CertificateCreateOrUpdateProperties{ - Data: to.Ptr("MIIJsgIBAzCCCW4GCSqGSIb3DQE..."), - Password: to.Ptr(""), - }, - }, &armbatch.CertificateClientCreateOptions{IfMatch: nil, - IfNoneMatch: 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.Certificate = armbatch.Certificate{ - // Name: to.Ptr("sha1-0a0e4f50d51beadeac1d35afc5116098e7902e6e"), - // Type: to.Ptr("Microsoft.Batch/batchAccounts/certificates"), - // Etag: to.Ptr("W/\"0x8D4EDD5118668F7\""), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/default-azurebatch-japaneast/providers/Microsoft.Batch/batchAccounts/samplecct/certificates/sha1-0a0e4f50d51beadeac1d35afc5116098e7902e6e"), - // Properties: &armbatch.CertificateProperties{ - // Format: to.Ptr(armbatch.CertificateFormatPfx), - // Thumbprint: to.Ptr("0a0e4f50d51beadeac1d35afc5116098e7902e6e"), - // ThumbprintAlgorithm: to.Ptr("sha1"), - // ProvisioningState: to.Ptr(armbatch.CertificateProvisioningStateSucceeded), - // ProvisioningStateTransitionTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-07-21T01:47:38.4420202Z"); return t}()), - // PublicData: to.Ptr("MIICrjCCAZagAwI..."), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ef6f2f06858cdbec7684968e1a54c7610da97dbb/specification/batch/resource-manager/Microsoft.Batch/stable/2022-10-01/examples/CertificateUpdate.json -func ExampleCertificateClient_Update() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armbatch.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewCertificateClient().Update(ctx, "default-azurebatch-japaneast", "sampleacct", "sha1-0a0e4f50d51beadeac1d35afc5116098e7902e6e", armbatch.CertificateCreateOrUpdateParameters{ - Properties: &armbatch.CertificateCreateOrUpdateProperties{ - Data: to.Ptr("MIIJsgIBAzCCCW4GCSqGSIb3DQE..."), - Password: to.Ptr(""), - }, - }, &armbatch.CertificateClientUpdateOptions{IfMatch: 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.Certificate = armbatch.Certificate{ - // Name: to.Ptr("sha1-0a0e4f50d51beadeac1d35afc5116098e7902e6e"), - // Type: to.Ptr("Microsoft.Batch/batchAccounts/certificates"), - // Etag: to.Ptr("W/\"0x8D4EDD5118668F7\""), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/default-azurebatch-japaneast/providers/Microsoft.Batch/batchAccounts/samplecct/certificates/sha1-0a0e4f50d51beadeac1d35afc5116098e7902e6e"), - // Properties: &armbatch.CertificateProperties{ - // Format: to.Ptr(armbatch.CertificateFormatPfx), - // Thumbprint: to.Ptr("0a0e4f50d51beadeac1d35afc5116098e7902e6e"), - // ThumbprintAlgorithm: to.Ptr("sha1"), - // ProvisioningState: to.Ptr(armbatch.CertificateProvisioningStateSucceeded), - // ProvisioningStateTransitionTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-07-21T01:47:38.4420202Z"); return t}()), - // PublicData: to.Ptr("MIICrjCCAZagAwI..."), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ef6f2f06858cdbec7684968e1a54c7610da97dbb/specification/batch/resource-manager/Microsoft.Batch/stable/2022-10-01/examples/CertificateDelete.json -func ExampleCertificateClient_BeginDelete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armbatch.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewCertificateClient().BeginDelete(ctx, "default-azurebatch-japaneast", "sampleacct", "sha1-0a0e4f50d51beadeac1d35afc5116098e7902e6e", 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/ef6f2f06858cdbec7684968e1a54c7610da97dbb/specification/batch/resource-manager/Microsoft.Batch/stable/2022-10-01/examples/CertificateGet.json -func ExampleCertificateClient_Get_getCertificate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armbatch.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewCertificateClient().Get(ctx, "default-azurebatch-japaneast", "sampleacct", "sha1-0a0e4f50d51beadeac1d35afc5116098e7902e6e", 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.Certificate = armbatch.Certificate{ - // Name: to.Ptr("sha1-0a0e4f50d51beadeac1d35afc5116098e7902e6e"), - // Type: to.Ptr("Microsoft.Batch/batchAccounts/certificates"), - // Etag: to.Ptr("W/\"0x8D4EDD5118668F7\""), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/default-azurebatch-japaneast/providers/Microsoft.Batch/batchAccounts/samplecct/certificates/sha1-0a0e4f50d51beadeac1d35afc5116098e7902e6e"), - // Properties: &armbatch.CertificateProperties{ - // Format: to.Ptr(armbatch.CertificateFormatPfx), - // Thumbprint: to.Ptr("0a0e4f50d51beadeac1d35afc5116098e7902e6e"), - // ThumbprintAlgorithm: to.Ptr("sha1"), - // ProvisioningState: to.Ptr(armbatch.CertificateProvisioningStateSucceeded), - // ProvisioningStateTransitionTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-07-21T01:47:38.4420202Z"); return t}()), - // PublicData: to.Ptr("MIICrjCCAZagAwI..."), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ef6f2f06858cdbec7684968e1a54c7610da97dbb/specification/batch/resource-manager/Microsoft.Batch/stable/2022-10-01/examples/CertificateGetWithDeletionError.json -func ExampleCertificateClient_Get_getCertificateWithDeletionError() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armbatch.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewCertificateClient().Get(ctx, "default-azurebatch-japaneast", "sampleacct", "sha1-0a0e4f50d51beadeac1d35afc5116098e7902e6e", 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.Certificate = armbatch.Certificate{ - // Name: to.Ptr("sha1-0a0e4f50d51beadeac1d35afc5116098e7902e6e"), - // Type: to.Ptr("Microsoft.Batch/batchAccounts/certificates"), - // Etag: to.Ptr("W/\"0x8D4EDD5118668F7\""), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/default-azurebatch-japaneast/providers/Microsoft.Batch/batchAccounts/samplecct/certificates/sha1-0a0e4f50d51beadeac1d35afc5116098e7902e6e"), - // Properties: &armbatch.CertificateProperties{ - // Format: to.Ptr(armbatch.CertificateFormatPfx), - // Thumbprint: to.Ptr("0a0e4f50d51beadeac1d35afc5116098e7902e6e"), - // ThumbprintAlgorithm: to.Ptr("sha1"), - // DeleteCertificateError: &armbatch.DeleteCertificateError{ - // Code: to.Ptr("NodesReferencingCertificate"), - // Message: to.Ptr("The specified certificate is being used by the below mentioned node(s)\nRequestId:2dc78afc-b15b-42d2-8c85-39cb61a0799e\nTime:2017-08-28T10:22:52.8633406Z"), - // Target: to.Ptr("BatchAccount"), - // Details: []*armbatch.DeleteCertificateError{ - // { - // Code: to.Ptr("Nodes"), - // Message: to.Ptr("node1, node3"), - // }}, - // }, - // PreviousProvisioningState: to.Ptr(armbatch.CertificateProvisioningStateDeleting), - // PreviousProvisioningStateTransitionTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-07-21T00:15:25.5625498Z"); return t}()), - // ProvisioningState: to.Ptr(armbatch.CertificateProvisioningStateSucceeded), - // ProvisioningStateTransitionTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-07-21T01:47:38.4420202Z"); return t}()), - // PublicData: to.Ptr("MIICrjCCAZagAwI..."), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ef6f2f06858cdbec7684968e1a54c7610da97dbb/specification/batch/resource-manager/Microsoft.Batch/stable/2022-10-01/examples/CertificateCancelDeletion.json -func ExampleCertificateClient_CancelDeletion() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armbatch.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewCertificateClient().CancelDeletion(ctx, "default-azurebatch-japaneast", "sampleacct", "sha1-0a0e4f50d51beadeac1d35afc5116098e7902e6e", 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.Certificate = armbatch.Certificate{ - // Name: to.Ptr("sha1-0a0e4f50d51beadeac1d35afc5116098e7902e6e"), - // Type: to.Ptr("Microsoft.Batch/batchAccounts/certificates"), - // Etag: to.Ptr("W/\"0x8D4EDD513C3EDBB\""), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/default-azurebatch-japaneast/providers/Microsoft.Batch/batchAccounts/samplecct/certificates/sha1-0a0e4f50d51beadeac1d35afc5116098e7902e6e"), - // Properties: &armbatch.CertificateProperties{ - // Format: to.Ptr(armbatch.CertificateFormatPfx), - // Thumbprint: to.Ptr("0a0e4f50d51beadeac1d35afc5116098e7902e6e"), - // ThumbprintAlgorithm: to.Ptr("sha1"), - // PreviousProvisioningState: to.Ptr(armbatch.CertificateProvisioningStateFailed), - // PreviousProvisioningStateTransitionTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-07-21T00:22:54.3299195Z"); return t}()), - // ProvisioningState: to.Ptr(armbatch.CertificateProvisioningStateSucceeded), - // ProvisioningStateTransitionTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-07-21T01:47:38.4420202Z"); return t}()), - // PublicData: to.Ptr("MIICrjCCAZagAwI..."), - // }, - // } -} diff --git a/sdk/resourcemanager/batch/armbatch/constants.go b/sdk/resourcemanager/batch/armbatch/constants.go index a0625d6fffc1..e878c0310a6c 100644 --- a/sdk/resourcemanager/batch/armbatch/constants.go +++ b/sdk/resourcemanager/batch/armbatch/constants.go @@ -11,7 +11,7 @@ package armbatch const ( moduleName = "armbatch" - moduleVersion = "v1.2.1" + moduleVersion = "v2.0.0" ) // AccountKeyType - The type of account key to regenerate. @@ -277,6 +277,24 @@ func PossibleComputeNodeFillTypeValues() []ComputeNodeFillType { } } +// ContainerType - The container technology to be used. +type ContainerType string + +const ( + // ContainerTypeDockerCompatible - A Docker compatible container technology will be used to launch the containers. + ContainerTypeDockerCompatible ContainerType = "DockerCompatible" + // ContainerTypeCriCompatible - A CRI based technology will be used to launch the containers. + ContainerTypeCriCompatible ContainerType = "CriCompatible" +) + +// PossibleContainerTypeValues returns the possible values for the ContainerType const type. +func PossibleContainerTypeValues() []ContainerType { + return []ContainerType{ + ContainerTypeDockerCompatible, + ContainerTypeCriCompatible, + } +} + // ContainerWorkingDirectory - A flag to indicate where the container task working directory is. The default is 'taskWorkingDirectory'. type ContainerWorkingDirectory string diff --git a/sdk/resourcemanager/batch/armbatch/go.mod b/sdk/resourcemanager/batch/armbatch/go.mod index 97cd8318ccca..48da660e51b5 100644 --- a/sdk/resourcemanager/batch/armbatch/go.mod +++ b/sdk/resourcemanager/batch/armbatch/go.mod @@ -1,21 +1,13 @@ -module github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/batch/armbatch +module github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/batch/armbatch/v2 go 1.18 -require ( - github.com/Azure/azure-sdk-for-go/sdk/azcore v1.4.0 - github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.2.2 -) +require github.com/Azure/azure-sdk-for-go/sdk/azcore v1.4.0 require ( github.com/Azure/azure-sdk-for-go/sdk/internal v1.2.0 // indirect - github.com/AzureAD/microsoft-authentication-library-for-go v0.9.0 // indirect - github.com/golang-jwt/jwt/v4 v4.5.0 // indirect - github.com/google/uuid v1.3.0 // indirect - github.com/kylelemons/godebug v1.1.0 // indirect - github.com/pkg/browser v0.0.0-20210911075715-681adbf594b8 // indirect - golang.org/x/crypto v0.6.0 // indirect + github.com/davecgh/go-spew v1.1.1 // indirect golang.org/x/net v0.7.0 // indirect - golang.org/x/sys v0.5.0 // indirect golang.org/x/text v0.7.0 // indirect + gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b // indirect ) diff --git a/sdk/resourcemanager/batch/armbatch/go.sum b/sdk/resourcemanager/batch/armbatch/go.sum index 8ba445a8c4da..b6bd7eaad1ba 100644 --- a/sdk/resourcemanager/batch/armbatch/go.sum +++ b/sdk/resourcemanager/batch/armbatch/go.sum @@ -1,31 +1,15 @@ github.com/Azure/azure-sdk-for-go/sdk/azcore v1.4.0 h1:rTnT/Jrcm+figWlYz4Ixzt0SJVR2cMC8lvZcimipiEY= github.com/Azure/azure-sdk-for-go/sdk/azcore v1.4.0/go.mod h1:ON4tFdPTwRcgWEaVDrN3584Ef+b7GgSJaXxe5fW9t4M= -github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.2.2 h1:uqM+VoHjVH6zdlkLF2b6O0ZANcHoj3rO0PoQ3jglUJA= -github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.2.2/go.mod h1:twTKAa1E6hLmSDjLhaCkbTMQKc7p/rNLU40rLxGEOCI= github.com/Azure/azure-sdk-for-go/sdk/internal v1.2.0 h1:leh5DwKv6Ihwi+h60uHtn6UWAxBbZ0q8DwQVMzf61zw= github.com/Azure/azure-sdk-for-go/sdk/internal v1.2.0/go.mod h1:eWRD7oawr1Mu1sLCawqVc0CUiF43ia3qQMxLscsKQ9w= -github.com/AzureAD/microsoft-authentication-library-for-go v0.9.0 h1:UE9n9rkJF62ArLb1F3DEjRt8O3jLwMWdSoypKV4f3MU= -github.com/AzureAD/microsoft-authentication-library-for-go v0.9.0/go.mod h1:kgDmCTgBzIEPFElEF+FK0SdjAor06dRq2Go927dnQ6o= github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= -github.com/dnaeon/go-vcr v1.1.0 h1:ReYa/UBrRyQdant9B4fNHGoCNKw6qh6P0fsdGmZpR7c= -github.com/golang-jwt/jwt/v4 v4.5.0 h1:7cYmW1XlMY7h7ii7UhUyChSgS5wUJEnm9uZVTGqOWzg= -github.com/golang-jwt/jwt/v4 v4.5.0/go.mod h1:m21LjoU+eqJr34lmDMbreY2eSTRJ1cv77w39/MY0Ch0= -github.com/google/uuid v1.3.0 h1:t6JiXgmwXMjEs8VusXIJk2BXHsn+wx8BZdTaoZ5fu7I= -github.com/google/uuid v1.3.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= -github.com/kylelemons/godebug v1.1.0 h1:RPNrshWIDI6G2gRW9EHilWtl7Z6Sb1BR0xunSBf0SNc= -github.com/kylelemons/godebug v1.1.0/go.mod h1:9/0rRGxNHcop5bhtWyNeEfOS8JIWk580+fNqagV/RAw= -github.com/pkg/browser v0.0.0-20210911075715-681adbf594b8 h1:KoWmjvw+nsYOo29YJK9vDA65RGE3NrOnUtO7a+RF9HU= -github.com/pkg/browser v0.0.0-20210911075715-681adbf594b8/go.mod h1:HKlIX3XHQyzLZPlr7++PzdhaXEj94dEiJgZDTsxEqUI= +github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/stretchr/testify v1.7.0 h1:nwc3DEeHmmLAfoZucVR881uASk0Mfjw8xYJ99tb5CcY= -golang.org/x/crypto v0.6.0 h1:qfktjS5LUO+fFKeJXZ+ikTRijMmljikvG68fpMMruSc= -golang.org/x/crypto v0.6.0/go.mod h1:OFC/31mSvZgRz0V1QTNCzfAI1aIRzbiufJtkMIlEp58= golang.org/x/net v0.7.0 h1:rJrUqqhjsgNp7KqAIc25s9pZnjU7TUcSY7HcVZjdn1g= golang.org/x/net v0.7.0/go.mod h1:2Tu9+aMcznHK/AK1HMvgo6xiTLG5rD5rZLDS+rp2Bjs= -golang.org/x/sys v0.0.0-20210616045830-e2b7044e8c71/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.5.0 h1:MUK/U/4lj1t1oPg0HfuXDN/Z1wv31ZJ/YcPiGccS4DU= -golang.org/x/sys v0.5.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/text v0.7.0 h1:4BRB4x83lYWy72KwLD/qYDuTu7q9PjSagHvijDw7cLo= golang.org/x/text v0.7.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= -gopkg.in/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY= +gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b h1:h8qDotaEPuJATrMmW04NCwg7v22aHH28wwpauUhK9Oo= +gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= diff --git a/sdk/resourcemanager/batch/armbatch/location_client.go b/sdk/resourcemanager/batch/armbatch/location_client.go index 17dda227e31c..2fc944f517ff 100644 --- a/sdk/resourcemanager/batch/armbatch/location_client.go +++ b/sdk/resourcemanager/batch/armbatch/location_client.go @@ -48,7 +48,7 @@ func NewLocationClient(subscriptionID string, credential azcore.TokenCredential, // CheckNameAvailability - Checks whether the Batch account name is available in the specified region. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-10-01 +// Generated from API version 2023-05-01 // - locationName - The desired region for the name check. // - parameters - Properties needed to check the availability of a name. // - options - LocationClientCheckNameAvailabilityOptions contains the optional parameters for the LocationClient.CheckNameAvailability @@ -84,7 +84,7 @@ func (client *LocationClient) checkNameAvailabilityCreateRequest(ctx context.Con return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-10-01") + reqQP.Set("api-version", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, parameters) @@ -102,7 +102,7 @@ func (client *LocationClient) checkNameAvailabilityHandleResponse(resp *http.Res // GetQuotas - Gets the Batch service quotas for the specified subscription at the given location. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-10-01 +// Generated from API version 2023-05-01 // - locationName - The region for which to retrieve Batch service quotas. // - options - LocationClientGetQuotasOptions contains the optional parameters for the LocationClient.GetQuotas method. func (client *LocationClient) GetQuotas(ctx context.Context, locationName string, options *LocationClientGetQuotasOptions) (LocationClientGetQuotasResponse, error) { @@ -136,7 +136,7 @@ func (client *LocationClient) getQuotasCreateRequest(ctx context.Context, locati return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-10-01") + reqQP.Set("api-version", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -154,7 +154,7 @@ func (client *LocationClient) getQuotasHandleResponse(resp *http.Response) (Loca // NewListSupportedCloudServiceSKUsPager - Gets the list of Batch supported Cloud Service VM sizes available at the given // location. // -// Generated from API version 2022-10-01 +// Generated from API version 2023-05-01 // - locationName - The region for which to retrieve Batch service supported SKUs. // - options - LocationClientListSupportedCloudServiceSKUsOptions contains the optional parameters for the LocationClient.NewListSupportedCloudServiceSKUsPager // method. @@ -208,7 +208,7 @@ func (client *LocationClient) listSupportedCloudServiceSKUsCreateRequest(ctx con if options != nil && options.Filter != nil { reqQP.Set("$filter", *options.Filter) } - reqQP.Set("api-version", "2022-10-01") + reqQP.Set("api-version", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -226,7 +226,7 @@ func (client *LocationClient) listSupportedCloudServiceSKUsHandleResponse(resp * // NewListSupportedVirtualMachineSKUsPager - Gets the list of Batch supported Virtual Machine VM sizes available at the given // location. // -// Generated from API version 2022-10-01 +// Generated from API version 2023-05-01 // - locationName - The region for which to retrieve Batch service supported SKUs. // - options - LocationClientListSupportedVirtualMachineSKUsOptions contains the optional parameters for the LocationClient.NewListSupportedVirtualMachineSKUsPager // method. @@ -280,7 +280,7 @@ func (client *LocationClient) listSupportedVirtualMachineSKUsCreateRequest(ctx c if options != nil && options.Filter != nil { reqQP.Set("$filter", *options.Filter) } - reqQP.Set("api-version", "2022-10-01") + reqQP.Set("api-version", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/batch/armbatch/location_client_example_test.go b/sdk/resourcemanager/batch/armbatch/location_client_example_test.go deleted file mode 100644 index 1aad616aff04..000000000000 --- a/sdk/resourcemanager/batch/armbatch/location_client_example_test.go +++ /dev/null @@ -1,222 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armbatch_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/batch/armbatch" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ef6f2f06858cdbec7684968e1a54c7610da97dbb/specification/batch/resource-manager/Microsoft.Batch/stable/2022-10-01/examples/LocationGetQuotas.json -func ExampleLocationClient_GetQuotas() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armbatch.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewLocationClient().GetQuotas(ctx, "japaneast", 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.LocationQuota = armbatch.LocationQuota{ - // AccountQuota: to.Ptr[int32](1), - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ef6f2f06858cdbec7684968e1a54c7610da97dbb/specification/batch/resource-manager/Microsoft.Batch/stable/2022-10-01/examples/LocationListVirtualMachineSkus.json -func ExampleLocationClient_NewListSupportedVirtualMachineSKUsPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armbatch.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewLocationClient().NewListSupportedVirtualMachineSKUsPager("japaneast", &armbatch.LocationClientListSupportedVirtualMachineSKUsOptions{Maxresults: nil, - Filter: 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.SupportedSKUsResult = armbatch.SupportedSKUsResult{ - // Value: []*armbatch.SupportedSKU{ - // { - // Name: to.Ptr("Standard_D1_v2"), - // Capabilities: []*armbatch.SKUCapability{ - // { - // Name: to.Ptr("MaxResourceVolumeMB"), - // Value: to.Ptr("20480"), - // }, - // { - // Name: to.Ptr("vCPUs"), - // Value: to.Ptr("1"), - // }, - // { - // Name: to.Ptr("HyperVGenerations"), - // Value: to.Ptr("V1"), - // }, - // { - // Name: to.Ptr("MemoryGB"), - // Value: to.Ptr("0.75"), - // }, - // { - // Name: to.Ptr("LowPriorityCapable"), - // Value: to.Ptr("False"), - // }, - // { - // Name: to.Ptr("vCPUsAvailable"), - // Value: to.Ptr("1"), - // }, - // { - // Name: to.Ptr("EphemeralOSDiskSupported"), - // Value: to.Ptr("False"), - // }}, - // FamilyName: to.Ptr("standardDFamily"), - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ef6f2f06858cdbec7684968e1a54c7610da97dbb/specification/batch/resource-manager/Microsoft.Batch/stable/2022-10-01/examples/LocationListCloudServiceSkus.json -func ExampleLocationClient_NewListSupportedCloudServiceSKUsPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armbatch.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewLocationClient().NewListSupportedCloudServiceSKUsPager("japaneast", &armbatch.LocationClientListSupportedCloudServiceSKUsOptions{Maxresults: nil, - Filter: 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.SupportedSKUsResult = armbatch.SupportedSKUsResult{ - // Value: []*armbatch.SupportedSKU{ - // { - // Name: to.Ptr("Small"), - // Capabilities: []*armbatch.SKUCapability{ - // { - // Name: to.Ptr("MaxResourceVolumeMB"), - // Value: to.Ptr("20480"), - // }, - // { - // Name: to.Ptr("vCPUs"), - // Value: to.Ptr("1"), - // }, - // { - // Name: to.Ptr("HyperVGenerations"), - // Value: to.Ptr("V1"), - // }, - // { - // Name: to.Ptr("MemoryGB"), - // Value: to.Ptr("0.75"), - // }, - // { - // Name: to.Ptr("LowPriorityCapable"), - // Value: to.Ptr("False"), - // }, - // { - // Name: to.Ptr("vCPUsAvailable"), - // Value: to.Ptr("1"), - // }, - // { - // Name: to.Ptr("EphemeralOSDiskSupported"), - // Value: to.Ptr("False"), - // }}, - // FamilyName: to.Ptr("standardA0_A7Family"), - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ef6f2f06858cdbec7684968e1a54c7610da97dbb/specification/batch/resource-manager/Microsoft.Batch/stable/2022-10-01/examples/LocationCheckNameAvailability_AlreadyExists.json -func ExampleLocationClient_CheckNameAvailability_locationCheckNameAvailabilityAlreadyExists() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armbatch.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewLocationClient().CheckNameAvailability(ctx, "japaneast", armbatch.CheckNameAvailabilityParameters{ - Name: to.Ptr("existingaccountname"), - Type: to.Ptr("Microsoft.Batch/batchAccounts"), - }, 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.CheckNameAvailabilityResult = armbatch.CheckNameAvailabilityResult{ - // Message: to.Ptr("An account named 'existingaccountname' is already in use."), - // NameAvailable: to.Ptr(false), - // Reason: to.Ptr(armbatch.NameAvailabilityReasonAlreadyExists), - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ef6f2f06858cdbec7684968e1a54c7610da97dbb/specification/batch/resource-manager/Microsoft.Batch/stable/2022-10-01/examples/LocationCheckNameAvailability_Available.json -func ExampleLocationClient_CheckNameAvailability_locationCheckNameAvailabilityAvailable() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armbatch.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewLocationClient().CheckNameAvailability(ctx, "japaneast", armbatch.CheckNameAvailabilityParameters{ - Name: to.Ptr("newaccountname"), - Type: to.Ptr("Microsoft.Batch/batchAccounts"), - }, 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.CheckNameAvailabilityResult = armbatch.CheckNameAvailabilityResult{ - // NameAvailable: to.Ptr(true), - // } -} diff --git a/sdk/resourcemanager/batch/armbatch/models.go b/sdk/resourcemanager/batch/armbatch/models.go index 4f989fde4cf4..c820a457fb4e 100644 --- a/sdk/resourcemanager/batch/armbatch/models.go +++ b/sdk/resourcemanager/batch/armbatch/models.go @@ -774,9 +774,8 @@ type ComputeNodeIdentityReference struct { // ContainerConfiguration - The configuration for container-enabled pools. type ContainerConfiguration struct { - // CONSTANT; The container technology to be used. - // Field has constant value "DockerCompatible", any specified value is ignored. - Type *string + // REQUIRED; The container technology to be used. + Type *ContainerType // This is the full image reference, as would be specified to "docker pull". An image will be sourced from the default Docker // registry unless the image is fully qualified with an alternative registry. @@ -1030,8 +1029,9 @@ type InboundNatPool struct { // KeyVaultProperties - KeyVault configuration when using an encryption KeySource of Microsoft.KeyVault. type KeyVaultProperties struct { - // Full path to the versioned secret. Example https://mykeyvault.vault.azure.net/keys/testkey/6e34a81fef704045975661e297a4c053. - // To be usable the following prerequisites must be met: + // Full path to the secret with or without version. Example https://mykeyvault.vault.azure.net/keys/testkey/6e34a81fef704045975661e297a4c053. + // or https://mykeyvault.vault.azure.net/keys/testkey. To be + // usable the following prerequisites must be met: // The Batch Account has a System Assigned identity The account identity has been granted Key/Get, Key/Unwrap and Key/Wrap // permissions The KeyVault has soft-delete and purge protection enabled KeyIdentifier *string @@ -1195,6 +1195,11 @@ type NetworkConfiguration struct { // The scope of dynamic vnet assignment. DynamicVNetAssignmentScope *DynamicVNetAssignmentScope + // Accelerated networking enables single root I/O virtualization (SR-IOV) to a VM, which may lead to improved networking performance. + // For more details, see: + // https://learn.microsoft.com/azure/virtual-network/accelerated-networking-overview. + EnableAcceleratedNetworking *bool + // Pool endpoint configuration is only supported on pools with the virtualMachineConfiguration property. EndpointConfiguration *PoolEndpointConfiguration @@ -1938,6 +1943,10 @@ type VMExtension struct { // with this property set to true. AutoUpgradeMinorVersion *bool + // Indicates whether the extension should be automatically upgraded by the platform if there is a newer version of the extension + // available. + EnableAutomaticUpgrade *bool + // The extension can contain either protectedSettings or protectedSettingsFromKeyVault or no protected settings at all. ProtectedSettings any diff --git a/sdk/resourcemanager/batch/armbatch/models_serde.go b/sdk/resourcemanager/batch/armbatch/models_serde.go index 7926e00e5bbd..76a858b91dfd 100644 --- a/sdk/resourcemanager/batch/armbatch/models_serde.go +++ b/sdk/resourcemanager/batch/armbatch/models_serde.go @@ -1414,7 +1414,7 @@ func (c ContainerConfiguration) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) populate(objectMap, "containerImageNames", c.ContainerImageNames) populate(objectMap, "containerRegistries", c.ContainerRegistries) - objectMap["type"] = "DockerCompatible" + populate(objectMap, "type", c.Type) return json.Marshal(objectMap) } @@ -2477,6 +2477,7 @@ func (n *NFSMountConfiguration) UnmarshalJSON(data []byte) error { func (n NetworkConfiguration) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) populate(objectMap, "dynamicVnetAssignmentScope", n.DynamicVNetAssignmentScope) + populate(objectMap, "enableAcceleratedNetworking", n.EnableAcceleratedNetworking) populate(objectMap, "endpointConfiguration", n.EndpointConfiguration) populate(objectMap, "publicIPAddressConfiguration", n.PublicIPAddressConfiguration) populate(objectMap, "subnetId", n.SubnetID) @@ -2495,6 +2496,9 @@ func (n *NetworkConfiguration) UnmarshalJSON(data []byte) error { case "dynamicVnetAssignmentScope": err = unpopulate(val, "DynamicVNetAssignmentScope", &n.DynamicVNetAssignmentScope) delete(rawMsg, key) + case "enableAcceleratedNetworking": + err = unpopulate(val, "EnableAcceleratedNetworking", &n.EnableAcceleratedNetworking) + delete(rawMsg, key) case "endpointConfiguration": err = unpopulate(val, "EndpointConfiguration", &n.EndpointConfiguration) delete(rawMsg, key) @@ -3869,6 +3873,7 @@ func (u *UserIdentity) UnmarshalJSON(data []byte) error { func (v VMExtension) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) populate(objectMap, "autoUpgradeMinorVersion", v.AutoUpgradeMinorVersion) + populate(objectMap, "enableAutomaticUpgrade", v.EnableAutomaticUpgrade) populate(objectMap, "name", v.Name) populateAny(objectMap, "protectedSettings", v.ProtectedSettings) populate(objectMap, "provisionAfterExtensions", v.ProvisionAfterExtensions) @@ -3891,6 +3896,9 @@ func (v *VMExtension) UnmarshalJSON(data []byte) error { case "autoUpgradeMinorVersion": err = unpopulate(val, "AutoUpgradeMinorVersion", &v.AutoUpgradeMinorVersion) delete(rawMsg, key) + case "enableAutomaticUpgrade": + err = unpopulate(val, "EnableAutomaticUpgrade", &v.EnableAutomaticUpgrade) + delete(rawMsg, key) case "name": err = unpopulate(val, "Name", &v.Name) delete(rawMsg, key) diff --git a/sdk/resourcemanager/batch/armbatch/operations_client.go b/sdk/resourcemanager/batch/armbatch/operations_client.go index 1b4ed7709882..316c4ce61de8 100644 --- a/sdk/resourcemanager/batch/armbatch/operations_client.go +++ b/sdk/resourcemanager/batch/armbatch/operations_client.go @@ -40,7 +40,7 @@ func NewOperationsClient(credential azcore.TokenCredential, options *arm.ClientO // NewListPager - Lists available operations for the Microsoft.Batch provider // -// Generated from API version 2022-10-01 +// Generated from API version 2023-05-01 // - options - OperationsClientListOptions contains the optional parameters for the OperationsClient.NewListPager method. func (client *OperationsClient) NewListPager(options *OperationsClientListOptions) *runtime.Pager[OperationsClientListResponse] { return runtime.NewPager(runtime.PagingHandler[OperationsClientListResponse]{ @@ -78,7 +78,7 @@ func (client *OperationsClient) listCreateRequest(ctx context.Context, options * return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-10-01") + reqQP.Set("api-version", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/batch/armbatch/operations_client_example_test.go b/sdk/resourcemanager/batch/armbatch/operations_client_example_test.go deleted file mode 100644 index 70b76321fc8e..000000000000 --- a/sdk/resourcemanager/batch/armbatch/operations_client_example_test.go +++ /dev/null @@ -1,1252 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armbatch_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/batch/armbatch" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ef6f2f06858cdbec7684968e1a54c7610da97dbb/specification/batch/resource-manager/Microsoft.Batch/stable/2022-10-01/examples/OperationsList.json -func ExampleOperationsClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armbatch.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewOperationsClient().NewListPager(nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.OperationListResult = armbatch.OperationListResult{ - // Value: []*armbatch.Operation{ - // { - // Name: to.Ptr("Microsoft.Batch/batchAccounts/providers/Microsoft.Insights/diagnosticSettings/read"), - // Display: &armbatch.OperationDisplay{ - // Description: to.Ptr("Gets the diagnostic setting for the resource"), - // Operation: to.Ptr("Read diagnostic setting"), - // Provider: to.Ptr("Microsoft Batch"), - // Resource: to.Ptr("Batch Accounts"), - // }, - // IsDataAction: to.Ptr(false), - // Origin: to.Ptr("system"), - // }, - // { - // Name: to.Ptr("Microsoft.Batch/batchAccounts/providers/Microsoft.Insights/diagnosticSettings/write"), - // Display: &armbatch.OperationDisplay{ - // Description: to.Ptr("Creates or updates the diagnostic setting for the resource"), - // Operation: to.Ptr("Write diagnostic setting"), - // Provider: to.Ptr("Microsoft Batch"), - // Resource: to.Ptr("Batch Accounts"), - // }, - // IsDataAction: to.Ptr(false), - // Origin: to.Ptr("system"), - // }, - // { - // Name: to.Ptr("Microsoft.Batch/batchAccounts/providers/Microsoft.Insights/logDefinitions/read"), - // Display: &armbatch.OperationDisplay{ - // Description: to.Ptr("Gets the available logs for the Batch service"), - // Operation: to.Ptr("Read Batch service log definitions"), - // Provider: to.Ptr("Microsoft Batch"), - // Resource: to.Ptr("Batch Account Log Definitions"), - // }, - // IsDataAction: to.Ptr(false), - // Origin: to.Ptr("system"), - // Properties: map[string]any{ - // "serviceSpecification":map[string]any{ - // "logSpecifications":[]any{ - // map[string]any{ - // "name": "ServiceLog", - // "blobDuration": "PT1H", - // "displayName": "Service Logs", - // }, - // }, - // }, - // }, - // }, - // { - // Name: to.Ptr("Microsoft.Batch/batchAccounts/providers/Microsoft.Insights/metricDefinitions/read"), - // Display: &armbatch.OperationDisplay{ - // Description: to.Ptr("Gets the available metrics for the Batch service"), - // Operation: to.Ptr("Read Batch service metric definitions"), - // Provider: to.Ptr("Microsoft Batch"), - // Resource: to.Ptr("Batch Account Metric Definitions"), - // }, - // IsDataAction: to.Ptr(false), - // Origin: to.Ptr("system"), - // Properties: map[string]any{ - // "serviceSpecification":map[string]any{ - // "metricSpecifications":[]any{ - // map[string]any{ - // "name": "CoreCount", - // "aggregationType": "Total", - // "availabilities":[]any{ - // map[string]any{ - // "blobDuration": "PT1H", - // "timeGrain": "PT1M", - // }, - // }, - // "displayDescription": "Total number of dedicated cores in the batch account", - // "displayName": "Dedicated Core Count", - // "enableRegionalMdmAccount": false, - // "fillGapWithZero": false, - // "lockAggregationType": "Total", - // "supportsInstanceLevelAggregation": false, - // "unit": "Count", - // }, - // map[string]any{ - // "name": "TotalNodeCount", - // "aggregationType": "Total", - // "availabilities":[]any{ - // map[string]any{ - // "blobDuration": "PT1H", - // "timeGrain": "PT1M", - // }, - // }, - // "displayDescription": "Total number of dedicated nodes in the batch account", - // "displayName": "Dedicated Node Count", - // "enableRegionalMdmAccount": false, - // "fillGapWithZero": false, - // "lockAggregationType": "Total", - // "supportsInstanceLevelAggregation": false, - // "unit": "Count", - // }, - // map[string]any{ - // "name": "LowPriorityCoreCount", - // "aggregationType": "Total", - // "availabilities":[]any{ - // map[string]any{ - // "blobDuration": "PT1H", - // "timeGrain": "PT1M", - // }, - // }, - // "displayDescription": "Total number of low-priority cores in the batch account", - // "displayName": "LowPriority Core Count", - // "enableRegionalMdmAccount": false, - // "fillGapWithZero": false, - // "lockAggregationType": "Total", - // "supportsInstanceLevelAggregation": false, - // "unit": "Count", - // }, - // map[string]any{ - // "name": "TotalLowPriorityNodeCount", - // "aggregationType": "Total", - // "availabilities":[]any{ - // map[string]any{ - // "blobDuration": "PT1H", - // "timeGrain": "PT1M", - // }, - // }, - // "displayDescription": "Total number of low-priority nodes in the batch account", - // "displayName": "Low-Priority Node Count", - // "enableRegionalMdmAccount": false, - // "fillGapWithZero": false, - // "lockAggregationType": "Total", - // "supportsInstanceLevelAggregation": false, - // "unit": "Count", - // }, - // map[string]any{ - // "name": "CreatingNodeCount", - // "aggregationType": "Total", - // "availabilities":[]any{ - // map[string]any{ - // "blobDuration": "PT1H", - // "timeGrain": "PT1M", - // }, - // }, - // "displayDescription": "Number of nodes being created", - // "displayName": "Creating Node Count", - // "enableRegionalMdmAccount": false, - // "fillGapWithZero": false, - // "lockAggregationType": "Total", - // "supportsInstanceLevelAggregation": false, - // "unit": "Count", - // }, - // map[string]any{ - // "name": "StartingNodeCount", - // "aggregationType": "Total", - // "availabilities":[]any{ - // map[string]any{ - // "blobDuration": "PT1H", - // "timeGrain": "PT1M", - // }, - // }, - // "displayDescription": "Number of nodes starting", - // "displayName": "Starting Node Count", - // "enableRegionalMdmAccount": false, - // "fillGapWithZero": false, - // "lockAggregationType": "Total", - // "supportsInstanceLevelAggregation": false, - // "unit": "Count", - // }, - // map[string]any{ - // "name": "WaitingForStartTaskNodeCount", - // "aggregationType": "Total", - // "availabilities":[]any{ - // map[string]any{ - // "blobDuration": "PT1H", - // "timeGrain": "PT1M", - // }, - // }, - // "displayDescription": "Number of nodes waiting for the Start Task to complete", - // "displayName": "Waiting For Start Task Node Count", - // "enableRegionalMdmAccount": false, - // "fillGapWithZero": false, - // "lockAggregationType": "Total", - // "supportsInstanceLevelAggregation": false, - // "unit": "Count", - // }, - // map[string]any{ - // "name": "StartTaskFailedNodeCount", - // "aggregationType": "Total", - // "availabilities":[]any{ - // map[string]any{ - // "blobDuration": "PT1H", - // "timeGrain": "PT1M", - // }, - // }, - // "displayDescription": "Number of nodes where the Start Task has failed", - // "displayName": "Start Task Failed Node Count", - // "enableRegionalMdmAccount": false, - // "fillGapWithZero": false, - // "lockAggregationType": "Total", - // "supportsInstanceLevelAggregation": false, - // "unit": "Count", - // }, - // map[string]any{ - // "name": "IdleNodeCount", - // "aggregationType": "Total", - // "availabilities":[]any{ - // map[string]any{ - // "blobDuration": "PT1H", - // "timeGrain": "PT1M", - // }, - // }, - // "displayDescription": "Number of idle nodes", - // "displayName": "Idle Node Count", - // "enableRegionalMdmAccount": false, - // "fillGapWithZero": false, - // "lockAggregationType": "Total", - // "supportsInstanceLevelAggregation": false, - // "unit": "Count", - // }, - // map[string]any{ - // "name": "OfflineNodeCount", - // "aggregationType": "Total", - // "availabilities":[]any{ - // map[string]any{ - // "blobDuration": "PT1H", - // "timeGrain": "PT1M", - // }, - // }, - // "displayDescription": "Number of offline nodes", - // "displayName": "Offline Node Count", - // "enableRegionalMdmAccount": false, - // "fillGapWithZero": false, - // "lockAggregationType": "Total", - // "supportsInstanceLevelAggregation": false, - // "unit": "Count", - // }, - // map[string]any{ - // "name": "RebootingNodeCount", - // "aggregationType": "Total", - // "availabilities":[]any{ - // map[string]any{ - // "blobDuration": "PT1H", - // "timeGrain": "PT1M", - // }, - // }, - // "displayDescription": "Number of rebooting nodes", - // "displayName": "Rebooting Node Count", - // "enableRegionalMdmAccount": false, - // "fillGapWithZero": false, - // "lockAggregationType": "Total", - // "supportsInstanceLevelAggregation": false, - // "unit": "Count", - // }, - // map[string]any{ - // "name": "ReimagingNodeCount", - // "aggregationType": "Total", - // "availabilities":[]any{ - // map[string]any{ - // "blobDuration": "PT1H", - // "timeGrain": "PT1M", - // }, - // }, - // "displayDescription": "Number of reimaging nodes", - // "displayName": "Reimaging Node Count", - // "enableRegionalMdmAccount": false, - // "fillGapWithZero": false, - // "lockAggregationType": "Total", - // "supportsInstanceLevelAggregation": false, - // "unit": "Count", - // }, - // map[string]any{ - // "name": "RunningNodeCount", - // "aggregationType": "Total", - // "availabilities":[]any{ - // map[string]any{ - // "blobDuration": "PT1H", - // "timeGrain": "PT1M", - // }, - // }, - // "displayDescription": "Number of running nodes", - // "displayName": "Running Node Count", - // "enableRegionalMdmAccount": false, - // "fillGapWithZero": false, - // "lockAggregationType": "Total", - // "supportsInstanceLevelAggregation": false, - // "unit": "Count", - // }, - // map[string]any{ - // "name": "LeavingPoolNodeCount", - // "aggregationType": "Total", - // "availabilities":[]any{ - // map[string]any{ - // "blobDuration": "PT1H", - // "timeGrain": "PT1M", - // }, - // }, - // "displayDescription": "Number of nodes leaving the Pool", - // "displayName": "Leaving Pool Node Count", - // "enableRegionalMdmAccount": false, - // "fillGapWithZero": false, - // "lockAggregationType": "Total", - // "supportsInstanceLevelAggregation": false, - // "unit": "Count", - // }, - // map[string]any{ - // "name": "UnusableNodeCount", - // "aggregationType": "Total", - // "availabilities":[]any{ - // map[string]any{ - // "blobDuration": "PT1H", - // "timeGrain": "PT1M", - // }, - // }, - // "displayDescription": "Number of unusable nodes", - // "displayName": "Unusable Node Count", - // "enableRegionalMdmAccount": false, - // "fillGapWithZero": false, - // "lockAggregationType": "Total", - // "supportsInstanceLevelAggregation": false, - // "unit": "Count", - // }, - // map[string]any{ - // "name": "PreemptedNodeCount", - // "aggregationType": "Total", - // "availabilities":[]any{ - // map[string]any{ - // "blobDuration": "PT1H", - // "timeGrain": "PT1M", - // }, - // }, - // "displayDescription": "Number of preempted nodes", - // "displayName": "Preempted Node Count", - // "enableRegionalMdmAccount": false, - // "fillGapWithZero": false, - // "lockAggregationType": "Total", - // "supportsInstanceLevelAggregation": false, - // "unit": "Count", - // }, - // map[string]any{ - // "name": "TaskStartEvent", - // "aggregationType": "Total", - // "availabilities":[]any{ - // map[string]any{ - // "blobDuration": "PT1H", - // "timeGrain": "PT1M", - // }, - // }, - // "dimensions":[]any{ - // map[string]any{ - // "name": "poolId", - // "displayName": "Pool ID", - // "toBeExportedForShoebox": true, - // }, - // map[string]any{ - // "name": "jobId", - // "displayName": "Job ID", - // "toBeExportedForShoebox": true, - // }, - // }, - // "displayDescription": "Total number of tasks that have started", - // "displayName": "Task Start Events", - // "enableRegionalMdmAccount": false, - // "fillGapWithZero": false, - // "supportsInstanceLevelAggregation": false, - // "unit": "Count", - // }, - // map[string]any{ - // "name": "TaskCompleteEvent", - // "aggregationType": "Total", - // "availabilities":[]any{ - // map[string]any{ - // "blobDuration": "PT1H", - // "timeGrain": "PT1M", - // }, - // }, - // "dimensions":[]any{ - // map[string]any{ - // "name": "poolId", - // "displayName": "Pool ID", - // "toBeExportedForShoebox": true, - // }, - // map[string]any{ - // "name": "jobId", - // "displayName": "Job ID", - // "toBeExportedForShoebox": true, - // }, - // }, - // "displayDescription": "Total number of tasks that have completed", - // "displayName": "Task Complete Events", - // "enableRegionalMdmAccount": false, - // "fillGapWithZero": false, - // "supportsInstanceLevelAggregation": false, - // "unit": "Count", - // }, - // map[string]any{ - // "name": "TaskFailEvent", - // "aggregationType": "Total", - // "availabilities":[]any{ - // map[string]any{ - // "blobDuration": "PT1H", - // "timeGrain": "PT1M", - // }, - // }, - // "dimensions":[]any{ - // map[string]any{ - // "name": "poolId", - // "displayName": "Pool ID", - // "toBeExportedForShoebox": true, - // }, - // map[string]any{ - // "name": "jobId", - // "displayName": "Job ID", - // "toBeExportedForShoebox": true, - // }, - // }, - // "displayDescription": "Total number of tasks that have completed in a failed state", - // "displayName": "Task Fail Events", - // "enableRegionalMdmAccount": false, - // "fillGapWithZero": false, - // "supportsInstanceLevelAggregation": false, - // "unit": "Count", - // }, - // map[string]any{ - // "name": "PoolCreateEvent", - // "aggregationType": "Total", - // "availabilities":[]any{ - // map[string]any{ - // "blobDuration": "PT1H", - // "timeGrain": "PT1M", - // }, - // }, - // "dimensions":[]any{ - // map[string]any{ - // "name": "poolId", - // "displayName": "Pool ID", - // "toBeExportedForShoebox": true, - // }, - // }, - // "displayDescription": "Total number of pools that have been created", - // "displayName": "Pool Create Events", - // "enableRegionalMdmAccount": false, - // "fillGapWithZero": false, - // "supportsInstanceLevelAggregation": false, - // "unit": "Count", - // }, - // map[string]any{ - // "name": "PoolResizeStartEvent", - // "aggregationType": "Total", - // "availabilities":[]any{ - // map[string]any{ - // "blobDuration": "PT1H", - // "timeGrain": "PT1M", - // }, - // }, - // "dimensions":[]any{ - // map[string]any{ - // "name": "poolId", - // "displayName": "Pool ID", - // "toBeExportedForShoebox": true, - // }, - // }, - // "displayDescription": "Total number of pool resizes that have started", - // "displayName": "Pool Resize Start Events", - // "enableRegionalMdmAccount": false, - // "fillGapWithZero": false, - // "supportsInstanceLevelAggregation": false, - // "unit": "Count", - // }, - // map[string]any{ - // "name": "PoolResizeCompleteEvent", - // "aggregationType": "Total", - // "availabilities":[]any{ - // map[string]any{ - // "blobDuration": "PT1H", - // "timeGrain": "PT1M", - // }, - // }, - // "dimensions":[]any{ - // map[string]any{ - // "name": "poolId", - // "displayName": "Pool ID", - // "toBeExportedForShoebox": true, - // }, - // }, - // "displayDescription": "Total number of pool resizes that have completed", - // "displayName": "Pool Resize Complete Events", - // "enableRegionalMdmAccount": false, - // "fillGapWithZero": false, - // "supportsInstanceLevelAggregation": false, - // "unit": "Count", - // }, - // map[string]any{ - // "name": "PoolDeleteStartEvent", - // "aggregationType": "Total", - // "availabilities":[]any{ - // map[string]any{ - // "blobDuration": "PT1H", - // "timeGrain": "PT1M", - // }, - // }, - // "dimensions":[]any{ - // map[string]any{ - // "name": "poolId", - // "displayName": "Pool ID", - // "toBeExportedForShoebox": true, - // }, - // }, - // "displayDescription": "Total number of pool deletes that have started", - // "displayName": "Pool Delete Start Events", - // "enableRegionalMdmAccount": false, - // "fillGapWithZero": false, - // "supportsInstanceLevelAggregation": false, - // "unit": "Count", - // }, - // map[string]any{ - // "name": "PoolDeleteCompleteEvent", - // "aggregationType": "Total", - // "availabilities":[]any{ - // map[string]any{ - // "blobDuration": "PT1H", - // "timeGrain": "PT1M", - // }, - // }, - // "dimensions":[]any{ - // map[string]any{ - // "name": "poolId", - // "displayName": "Pool ID", - // "toBeExportedForShoebox": true, - // }, - // }, - // "displayDescription": "Total number of pool deletes that have completed", - // "displayName": "Pool Delete Complete Events", - // "enableRegionalMdmAccount": false, - // "fillGapWithZero": false, - // "supportsInstanceLevelAggregation": false, - // "unit": "Count", - // }, - // map[string]any{ - // "name": "JobDeleteCompleteEvent", - // "aggregationType": "Total", - // "availabilities":[]any{ - // map[string]any{ - // "blobDuration": "PT1H", - // "timeGrain": "PT1M", - // }, - // }, - // "dimensions":[]any{ - // map[string]any{ - // "name": "jobId", - // "displayName": "Job ID", - // "toBeExportedForShoebox": true, - // }, - // }, - // "displayDescription": "Total number of jobs that have been successfully deleted.", - // "displayName": "Job Delete Complete Events", - // "enableRegionalMdmAccount": false, - // "fillGapWithZero": false, - // "supportsInstanceLevelAggregation": false, - // "unit": "Count", - // }, - // map[string]any{ - // "name": "JobDeleteStartEvent", - // "aggregationType": "Total", - // "availabilities":[]any{ - // map[string]any{ - // "blobDuration": "PT1H", - // "timeGrain": "PT1M", - // }, - // }, - // "dimensions":[]any{ - // map[string]any{ - // "name": "jobId", - // "displayName": "Job ID", - // "toBeExportedForShoebox": true, - // }, - // }, - // "displayDescription": "Total number of jobs that have been requested to be deleted.", - // "displayName": "Job Delete Start Events", - // "enableRegionalMdmAccount": false, - // "fillGapWithZero": false, - // "supportsInstanceLevelAggregation": false, - // "unit": "Count", - // }, - // map[string]any{ - // "name": "JobDisableCompleteEvent", - // "aggregationType": "Total", - // "availabilities":[]any{ - // map[string]any{ - // "blobDuration": "PT1H", - // "timeGrain": "PT1M", - // }, - // }, - // "dimensions":[]any{ - // map[string]any{ - // "name": "jobId", - // "displayName": "Job ID", - // "toBeExportedForShoebox": true, - // }, - // }, - // "displayDescription": "Total number of jobs that have been successfully disabled.", - // "displayName": "Job Disable Complete Events", - // "enableRegionalMdmAccount": false, - // "fillGapWithZero": false, - // "supportsInstanceLevelAggregation": false, - // "unit": "Count", - // }, - // map[string]any{ - // "name": "JobDisableStartEvent", - // "aggregationType": "Total", - // "availabilities":[]any{ - // map[string]any{ - // "blobDuration": "PT1H", - // "timeGrain": "PT1M", - // }, - // }, - // "dimensions":[]any{ - // map[string]any{ - // "name": "jobId", - // "displayName": "Job ID", - // "toBeExportedForShoebox": true, - // }, - // }, - // "displayDescription": "Total number of jobs that have been requested to be disabled.", - // "displayName": "Job Disable Start Events", - // "enableRegionalMdmAccount": false, - // "fillGapWithZero": false, - // "supportsInstanceLevelAggregation": false, - // "unit": "Count", - // }, - // map[string]any{ - // "name": "JobStartEvent", - // "aggregationType": "Total", - // "availabilities":[]any{ - // map[string]any{ - // "blobDuration": "PT1H", - // "timeGrain": "PT1M", - // }, - // }, - // "dimensions":[]any{ - // map[string]any{ - // "name": "jobId", - // "displayName": "Job ID", - // "toBeExportedForShoebox": true, - // }, - // }, - // "displayDescription": "Total number of jobs that have been successfully started.", - // "displayName": "Job Start Events", - // "enableRegionalMdmAccount": false, - // "fillGapWithZero": false, - // "supportsInstanceLevelAggregation": false, - // "unit": "Count", - // }, - // map[string]any{ - // "name": "JobTerminateCompleteEvent", - // "aggregationType": "Total", - // "availabilities":[]any{ - // map[string]any{ - // "blobDuration": "PT1H", - // "timeGrain": "PT1M", - // }, - // }, - // "dimensions":[]any{ - // map[string]any{ - // "name": "jobId", - // "displayName": "Job ID", - // "toBeExportedForShoebox": true, - // }, - // }, - // "displayDescription": "Total number of jobs that have been successfully terminated.", - // "displayName": "Job Terminate Complete Events", - // "enableRegionalMdmAccount": false, - // "fillGapWithZero": false, - // "supportsInstanceLevelAggregation": false, - // "unit": "Count", - // }, - // map[string]any{ - // "name": "JobTerminateStartEvent", - // "aggregationType": "Total", - // "availabilities":[]any{ - // map[string]any{ - // "blobDuration": "PT1H", - // "timeGrain": "PT1M", - // }, - // }, - // "dimensions":[]any{ - // map[string]any{ - // "name": "jobId", - // "displayName": "Job ID", - // "toBeExportedForShoebox": true, - // }, - // }, - // "displayDescription": "Total number of jobs that have been requested to be terminated.", - // "displayName": "Job Terminate Start Events", - // "enableRegionalMdmAccount": false, - // "fillGapWithZero": false, - // "supportsInstanceLevelAggregation": false, - // "unit": "Count", - // }, - // }, - // }, - // }, - // }, - // { - // Name: to.Ptr("Microsoft.Batch/batchAccounts/jobs/read"), - // Display: &armbatch.OperationDisplay{ - // Description: to.Ptr("Lists jobs on a Batch account or gets the properties of a job"), - // Operation: to.Ptr("List or Get Jobs"), - // Provider: to.Ptr("Microsoft Batch"), - // Resource: to.Ptr("Jobs"), - // }, - // IsDataAction: to.Ptr(true), - // }, - // { - // Name: to.Ptr("Microsoft.Batch/batchAccounts/jobs/write"), - // Display: &armbatch.OperationDisplay{ - // Description: to.Ptr("Creates a new job on a Batch account or updates an existing job"), - // Operation: to.Ptr("Create or Update Job"), - // Provider: to.Ptr("Microsoft Batch"), - // Resource: to.Ptr("Jobs"), - // }, - // IsDataAction: to.Ptr(true), - // }, - // { - // Name: to.Ptr("Microsoft.Batch/batchAccounts/jobs/delete"), - // Display: &armbatch.OperationDisplay{ - // Description: to.Ptr("Deletes a job from a Batch account"), - // Operation: to.Ptr("Delete Job"), - // Provider: to.Ptr("Microsoft Batch"), - // Resource: to.Ptr("Jobs"), - // }, - // IsDataAction: to.Ptr(true), - // }, - // { - // Name: to.Ptr("Microsoft.Batch/batchAccounts/jobSchedules/read"), - // Display: &armbatch.OperationDisplay{ - // Description: to.Ptr("Lists job schedules on a Batch account or gets the properties of a job schedule"), - // Operation: to.Ptr("List or Get Job Schedules"), - // Provider: to.Ptr("Microsoft Batch"), - // Resource: to.Ptr("Job Schedules"), - // }, - // IsDataAction: to.Ptr(true), - // }, - // { - // Name: to.Ptr("Microsoft.Batch/batchAccounts/jobSchedules/write"), - // Display: &armbatch.OperationDisplay{ - // Description: to.Ptr("Creates a new job schedule on a Batch account or updates an existing job schedule"), - // Operation: to.Ptr("Create or Update Job Schedule"), - // Provider: to.Ptr("Microsoft Batch"), - // Resource: to.Ptr("Job Schedules"), - // }, - // IsDataAction: to.Ptr(true), - // }, - // { - // Name: to.Ptr("Microsoft.Batch/batchAccounts/jobSchedules/delete"), - // Display: &armbatch.OperationDisplay{ - // Description: to.Ptr("Deletes a job schedule from a Batch account"), - // Operation: to.Ptr("Delete Job Schedule"), - // Provider: to.Ptr("Microsoft Batch"), - // Resource: to.Ptr("Job Schedules"), - // }, - // IsDataAction: to.Ptr(true), - // }, - // { - // Name: to.Ptr("Microsoft.Batch/operations/read"), - // Display: &armbatch.OperationDisplay{ - // Description: to.Ptr("Lists operations available on Microsoft.Batch resource provider"), - // Operation: to.Ptr("List Available Batch Operations"), - // Provider: to.Ptr("Microsoft Batch"), - // Resource: to.Ptr("Available Batch Operations"), - // }, - // IsDataAction: to.Ptr(false), - // }, - // { - // Name: to.Ptr("Microsoft.Batch/batchAccounts/read"), - // Display: &armbatch.OperationDisplay{ - // Description: to.Ptr("Lists Batch accounts or gets the properties of a Batch account"), - // Operation: to.Ptr("List or Get Batch Accounts"), - // Provider: to.Ptr("Microsoft Batch"), - // Resource: to.Ptr("Batch Accounts"), - // }, - // IsDataAction: to.Ptr(false), - // Origin: to.Ptr("user,system"), - // }, - // { - // Name: to.Ptr("Microsoft.Batch/batchAccounts/write"), - // Display: &armbatch.OperationDisplay{ - // Description: to.Ptr("Creates a new Batch account or updates an existing Batch account"), - // Operation: to.Ptr("Create or Update Batch Account"), - // Provider: to.Ptr("Microsoft Batch"), - // Resource: to.Ptr("Batch Accounts"), - // }, - // IsDataAction: to.Ptr(false), - // Origin: to.Ptr("user,system"), - // }, - // { - // Name: to.Ptr("Microsoft.Batch/batchAccounts/delete"), - // Display: &armbatch.OperationDisplay{ - // Description: to.Ptr("Deletes a Batch account"), - // Operation: to.Ptr("Delete Batch Account"), - // Provider: to.Ptr("Microsoft Batch"), - // Resource: to.Ptr("Batch Accounts"), - // }, - // IsDataAction: to.Ptr(false), - // Origin: to.Ptr("user,system"), - // }, - // { - // Name: to.Ptr("Microsoft.Batch/batchAccounts/listkeys/action"), - // Display: &armbatch.OperationDisplay{ - // Description: to.Ptr("Lists access keys for a Batch account"), - // Operation: to.Ptr("List Batch Account Keys"), - // Provider: to.Ptr("Microsoft Batch"), - // Resource: to.Ptr("Batch Accounts"), - // }, - // IsDataAction: to.Ptr(false), - // Origin: to.Ptr("user,system"), - // }, - // { - // Name: to.Ptr("Microsoft.Batch/batchAccounts/regeneratekeys/action"), - // Display: &armbatch.OperationDisplay{ - // Description: to.Ptr("Regenerates access keys for a Batch account"), - // Operation: to.Ptr("Regenerate Batch Account Keys"), - // Provider: to.Ptr("Microsoft Batch"), - // Resource: to.Ptr("Batch Accounts"), - // }, - // IsDataAction: to.Ptr(false), - // Origin: to.Ptr("user,system"), - // }, - // { - // Name: to.Ptr("Microsoft.Batch/locations/quotas/read"), - // Display: &armbatch.OperationDisplay{ - // Description: to.Ptr("Gets Batch quotas of the specified subscription at the specified Azure region"), - // Operation: to.Ptr("Get Batch Quotas"), - // Provider: to.Ptr("Microsoft Batch"), - // Resource: to.Ptr("Batch Quotas"), - // }, - // IsDataAction: to.Ptr(false), - // Origin: to.Ptr("user,system"), - // }, - // { - // Name: to.Ptr("Microsoft.Batch/locations/checkNameAvailability/action"), - // Display: &armbatch.OperationDisplay{ - // Description: to.Ptr("Checks that the account name is valid and not in use."), - // Operation: to.Ptr("Check Name Availability"), - // Provider: to.Ptr("Microsoft Batch"), - // Resource: to.Ptr("Name Availability"), - // }, - // IsDataAction: to.Ptr(false), - // Origin: to.Ptr("user,system"), - // }, - // { - // Name: to.Ptr("Microsoft.Batch/batchAccounts/operationResults/read"), - // Display: &armbatch.OperationDisplay{ - // Description: to.Ptr("Gets the results of a long running Batch account operation"), - // Operation: to.Ptr("Get Batch account operation results"), - // Provider: to.Ptr("Microsoft Batch"), - // Resource: to.Ptr("Batch Resource Provider"), - // }, - // IsDataAction: to.Ptr(false), - // }, - // { - // Name: to.Ptr("Microsoft.Batch/locations/accountOperationResults/read"), - // Display: &armbatch.OperationDisplay{ - // Description: to.Ptr("Gets the results of a long running Batch account operation"), - // Operation: to.Ptr("Get Batch account operation results"), - // Provider: to.Ptr("Microsoft Batch"), - // Resource: to.Ptr("Batch Resource Provider"), - // }, - // IsDataAction: to.Ptr(false), - // }, - // { - // Name: to.Ptr("Microsoft.Batch/register/action"), - // Display: &armbatch.OperationDisplay{ - // Description: to.Ptr("Registers the subscription for the Batch Resource Provider and enables the creation of Batch accounts"), - // Operation: to.Ptr("Register the Batch Resource Provider"), - // Provider: to.Ptr("Microsoft Batch"), - // Resource: to.Ptr("Batch Resource Provider"), - // }, - // IsDataAction: to.Ptr(false), - // Origin: to.Ptr("user,system"), - // }, - // { - // Name: to.Ptr("Microsoft.Batch/unregister/action"), - // Display: &armbatch.OperationDisplay{ - // Description: to.Ptr("Unregisters the subscription for the Batch Resource Provider preventing the creation of Batch accounts"), - // Operation: to.Ptr("Unregister the Batch Resource Provider"), - // Provider: to.Ptr("Microsoft Batch"), - // Resource: to.Ptr("Batch Resource Provider"), - // }, - // IsDataAction: to.Ptr(false), - // Origin: to.Ptr("user,system"), - // }, - // { - // Name: to.Ptr("Microsoft.Batch/batchAccounts/syncAutoStorageKeys/action"), - // Display: &armbatch.OperationDisplay{ - // Description: to.Ptr("Synchronizes access keys for the auto storage account configured for a Batch account"), - // Operation: to.Ptr("Synchronize Auto Storage Account Keys"), - // Provider: to.Ptr("Microsoft Batch"), - // Resource: to.Ptr("Batch Accounts"), - // }, - // IsDataAction: to.Ptr(false), - // Origin: to.Ptr("user,system"), - // }, - // { - // Name: to.Ptr("Microsoft.Batch/batchAccounts/applications/read"), - // Display: &armbatch.OperationDisplay{ - // Description: to.Ptr("Lists applications or gets the properties of an application"), - // Operation: to.Ptr("List or Get Applications"), - // Provider: to.Ptr("Microsoft Batch"), - // Resource: to.Ptr("Applications"), - // }, - // IsDataAction: to.Ptr(false), - // Origin: to.Ptr("user,system"), - // }, - // { - // Name: to.Ptr("Microsoft.Batch/batchAccounts/applications/write"), - // Display: &armbatch.OperationDisplay{ - // Description: to.Ptr("Creates a new application or updates an existing application"), - // Operation: to.Ptr("Create or Update Application"), - // Provider: to.Ptr("Microsoft Batch"), - // Resource: to.Ptr("Applications"), - // }, - // IsDataAction: to.Ptr(false), - // Origin: to.Ptr("user,system"), - // }, - // { - // Name: to.Ptr("Microsoft.Batch/batchAccounts/applications/delete"), - // Display: &armbatch.OperationDisplay{ - // Description: to.Ptr("Deletes an application"), - // Operation: to.Ptr("Delete Application"), - // Provider: to.Ptr("Microsoft Batch"), - // Resource: to.Ptr("Applications"), - // }, - // IsDataAction: to.Ptr(false), - // Origin: to.Ptr("user,system"), - // }, - // { - // Name: to.Ptr("Microsoft.Batch/batchAccounts/applications/versions/read"), - // Display: &armbatch.OperationDisplay{ - // Description: to.Ptr("Gets the properties of an application package"), - // Operation: to.Ptr("Get Application Package"), - // Provider: to.Ptr("Microsoft Batch"), - // Resource: to.Ptr("Application Packages"), - // }, - // IsDataAction: to.Ptr(false), - // Origin: to.Ptr("user,system"), - // }, - // { - // Name: to.Ptr("Microsoft.Batch/batchAccounts/applications/versions/write"), - // Display: &armbatch.OperationDisplay{ - // Description: to.Ptr("Creates a new application package or updates an existing application package"), - // Operation: to.Ptr("Create or Update Application Package"), - // Provider: to.Ptr("Microsoft Batch"), - // Resource: to.Ptr("Application Packages"), - // }, - // IsDataAction: to.Ptr(false), - // Origin: to.Ptr("user,system"), - // }, - // { - // Name: to.Ptr("Microsoft.Batch/batchAccounts/applications/versions/delete"), - // Display: &armbatch.OperationDisplay{ - // Description: to.Ptr("Deletes an application package"), - // Operation: to.Ptr("Delete Application Package"), - // Provider: to.Ptr("Microsoft Batch"), - // Resource: to.Ptr("Application Packages"), - // }, - // IsDataAction: to.Ptr(false), - // Origin: to.Ptr("user,system"), - // }, - // { - // Name: to.Ptr("Microsoft.Batch/batchAccounts/applications/versions/activate/action"), - // Display: &armbatch.OperationDisplay{ - // Description: to.Ptr("Activates an application package"), - // Operation: to.Ptr("Activate Application Package"), - // Provider: to.Ptr("Microsoft Batch"), - // Resource: to.Ptr("Application Packages"), - // }, - // IsDataAction: to.Ptr(false), - // Origin: to.Ptr("user,system"), - // }, - // { - // Name: to.Ptr("Microsoft.Batch/batchAccounts/certificates/read"), - // Display: &armbatch.OperationDisplay{ - // Description: to.Ptr("Lists certificates on a Batch account or gets the properties of a certificate"), - // Operation: to.Ptr("List or Get Certificates"), - // Provider: to.Ptr("Microsoft Batch"), - // Resource: to.Ptr("Certificates"), - // }, - // IsDataAction: to.Ptr(false), - // }, - // { - // Name: to.Ptr("Microsoft.Batch/batchAccounts/certificates/write"), - // Display: &armbatch.OperationDisplay{ - // Description: to.Ptr("Creates a new certificate on a Batch account or updates an existing certificate"), - // Operation: to.Ptr("Create or Update Certificate"), - // Provider: to.Ptr("Microsoft Batch"), - // Resource: to.Ptr("Certificates"), - // }, - // IsDataAction: to.Ptr(false), - // }, - // { - // Name: to.Ptr("Microsoft.Batch/batchAccounts/certificates/delete"), - // Display: &armbatch.OperationDisplay{ - // Description: to.Ptr("Deletes a certificate from a Batch account"), - // Operation: to.Ptr("Delete Certificate"), - // Provider: to.Ptr("Microsoft Batch"), - // Resource: to.Ptr("Certificates"), - // }, - // IsDataAction: to.Ptr(false), - // }, - // { - // Name: to.Ptr("Microsoft.Batch/batchAccounts/certificates/cancelDelete/action"), - // Display: &armbatch.OperationDisplay{ - // Description: to.Ptr("Cancels the failed deletion of a certificate on a Batch account"), - // Operation: to.Ptr("Cancel Delete Certificate"), - // Provider: to.Ptr("Microsoft Batch"), - // Resource: to.Ptr("Certificates"), - // }, - // IsDataAction: to.Ptr(false), - // }, - // { - // Name: to.Ptr("Microsoft.Batch/batchAccounts/certificateOperationResults/read"), - // Display: &armbatch.OperationDisplay{ - // Description: to.Ptr("Gets the results of a long running certificate operation on a Batch account"), - // Operation: to.Ptr("Get Certificate Operation Results"), - // Provider: to.Ptr("Microsoft Batch"), - // Resource: to.Ptr("Certificates"), - // }, - // IsDataAction: to.Ptr(false), - // }, - // { - // Name: to.Ptr("Microsoft.Batch/batchAccounts/pools/read"), - // Display: &armbatch.OperationDisplay{ - // Description: to.Ptr("Lists pools on a Batch account or gets the properties of a pool"), - // Operation: to.Ptr("List or Get Pools"), - // Provider: to.Ptr("Microsoft Batch"), - // Resource: to.Ptr("Pools"), - // }, - // IsDataAction: to.Ptr(false), - // }, - // { - // Name: to.Ptr("Microsoft.Batch/batchAccounts/pools/write"), - // Display: &armbatch.OperationDisplay{ - // Description: to.Ptr("Creates a new pool on a Batch account or updates an existing pool"), - // Operation: to.Ptr("Create or Update Pool"), - // Provider: to.Ptr("Microsoft Batch"), - // Resource: to.Ptr("Pools"), - // }, - // IsDataAction: to.Ptr(false), - // }, - // { - // Name: to.Ptr("Microsoft.Batch/batchAccounts/pools/delete"), - // Display: &armbatch.OperationDisplay{ - // Description: to.Ptr("Deletes a pool from a Batch account"), - // Operation: to.Ptr("Delete Pool"), - // Provider: to.Ptr("Microsoft Batch"), - // Resource: to.Ptr("Pools"), - // }, - // IsDataAction: to.Ptr(false), - // }, - // { - // Name: to.Ptr("Microsoft.Batch/batchAccounts/pools/stopResize/action"), - // Display: &armbatch.OperationDisplay{ - // Description: to.Ptr("Stops an ongoing resize operation on a Batch account pool"), - // Operation: to.Ptr("Stop Pool Resize"), - // Provider: to.Ptr("Microsoft Batch"), - // Resource: to.Ptr("Pools"), - // }, - // IsDataAction: to.Ptr(false), - // }, - // { - // Name: to.Ptr("Microsoft.Batch/batchAccounts/pools/disableAutoscale/action"), - // Display: &armbatch.OperationDisplay{ - // Description: to.Ptr("Disables automatic scaling for a Batch account pool"), - // Operation: to.Ptr("Disable Pool AutoScale"), - // Provider: to.Ptr("Microsoft Batch"), - // Resource: to.Ptr("Pools"), - // }, - // IsDataAction: to.Ptr(false), - // }, - // { - // Name: to.Ptr("Microsoft.Batch/batchAccounts/poolOperationResults/read"), - // Display: &armbatch.OperationDisplay{ - // Description: to.Ptr("Gets the results of a long running pool operation on a Batch account"), - // Operation: to.Ptr("Get Pool Operation Results"), - // Provider: to.Ptr("Microsoft Batch"), - // Resource: to.Ptr("Pools"), - // }, - // IsDataAction: to.Ptr(false), - // }, - // { - // Name: to.Ptr("Microsoft.Batch/locations/virtualMachineSkus/read"), - // Display: &armbatch.OperationDisplay{ - // Description: to.Ptr("Lists available Batch supported Virtual Machine VM sizes at the given location"), - // Operation: to.Ptr("List Supported Batch Virtual Machine VM"), - // Provider: to.Ptr("Microsoft Batch"), - // Resource: to.Ptr("Batch Supported Skus"), - // }, - // IsDataAction: to.Ptr(false), - // }, - // { - // Name: to.Ptr("Microsoft.Batch/locations/cloudServiceSkus/read"), - // Display: &armbatch.OperationDisplay{ - // Description: to.Ptr("Lists available Batch supported Cloud Service VM sizes at the given location"), - // Operation: to.Ptr("List Supported Batch Cloud Service VM"), - // Provider: to.Ptr("Microsoft Batch"), - // Resource: to.Ptr("Batch Supported Skus"), - // }, - // IsDataAction: to.Ptr(false), - // }, - // { - // Name: to.Ptr("Microsoft.Batch/batchAccounts/privateLinkResources/read"), - // Display: &armbatch.OperationDisplay{ - // Description: to.Ptr("Gets the properties of a Private link resource or Lists Private link resources on a Batch account"), - // Operation: to.Ptr("Get or List Private link resources"), - // Provider: to.Ptr("Microsoft Batch"), - // Resource: to.Ptr("PrivateLinkResources"), - // }, - // IsDataAction: to.Ptr(false), - // }, - // { - // Name: to.Ptr("Microsoft.Batch/batchAccounts/privateEndpointConnections/write"), - // Display: &armbatch.OperationDisplay{ - // Description: to.Ptr("Update an existing Private endpoint connection on a Batch account"), - // Operation: to.Ptr("Update Private endpoint connection"), - // Provider: to.Ptr("Microsoft Batch"), - // Resource: to.Ptr("PrivateEndpointConnections"), - // }, - // IsDataAction: to.Ptr(false), - // }, - // { - // Name: to.Ptr("Microsoft.Batch/batchAccounts/privateEndpointConnections/read"), - // Display: &armbatch.OperationDisplay{ - // Description: to.Ptr("Gets Private endpoint connection or Lists Private endpoint connections on a Batch account"), - // Operation: to.Ptr("Get or List Private endpoint connection"), - // Provider: to.Ptr("Microsoft Batch"), - // Resource: to.Ptr("PrivateEndpointConnections"), - // }, - // IsDataAction: to.Ptr(false), - // }, - // { - // Name: to.Ptr("Microsoft.Batch/batchAccounts/privateEndpointConnectionResults/read"), - // Display: &armbatch.OperationDisplay{ - // Description: to.Ptr("Gets the results of a long running Batch account private endpoint connection operation"), - // Operation: to.Ptr("Get Batch account private endpoint connection operation results"), - // Provider: to.Ptr("Microsoft Batch"), - // Resource: to.Ptr("PrivateEndpointConnections"), - // }, - // IsDataAction: to.Ptr(false), - // }, - // { - // Name: to.Ptr("Microsoft.Batch/batchAccounts/privateEndpointConnectionProxies/validate/action"), - // Display: &armbatch.OperationDisplay{ - // Description: to.Ptr("Validates a Private endpoint connection proxy on a Batch account"), - // Operation: to.Ptr("Validates a Private endpoint connection proxy"), - // Provider: to.Ptr("Microsoft Batch"), - // Resource: to.Ptr("PrivateEndpointConnectionProxies"), - // }, - // IsDataAction: to.Ptr(false), - // Origin: to.Ptr("system"), - // }, - // { - // Name: to.Ptr("Microsoft.Batch/batchAccounts/privateEndpointConnectionProxies/write"), - // Display: &armbatch.OperationDisplay{ - // Description: to.Ptr("Create a new Private endpoint connection proxy on a Batch account"), - // Operation: to.Ptr("Create or Update Private endpoint connection proxy"), - // Provider: to.Ptr("Microsoft Batch"), - // Resource: to.Ptr("PrivateEndpointConnectionProxies"), - // }, - // IsDataAction: to.Ptr(false), - // Origin: to.Ptr("system"), - // }, - // { - // Name: to.Ptr("Microsoft.Batch/batchAccounts/privateEndpointConnectionProxies/read"), - // Display: &armbatch.OperationDisplay{ - // Description: to.Ptr("Gets Private endpoint connection proxy on a Batch account"), - // Operation: to.Ptr("Get Private endpoint connection proxy"), - // Provider: to.Ptr("Microsoft Batch"), - // Resource: to.Ptr("PrivateEndpointConnectionProxies"), - // }, - // IsDataAction: to.Ptr(false), - // Origin: to.Ptr("system"), - // }, - // { - // Name: to.Ptr("Microsoft.Batch/batchAccounts/privateEndpointConnectionProxies/delete"), - // Display: &armbatch.OperationDisplay{ - // Description: to.Ptr("Delete a Private endpoint connection proxy on a Batch account"), - // Operation: to.Ptr("Delete Private endpoint connection proxy"), - // Provider: to.Ptr("Microsoft Batch"), - // Resource: to.Ptr("PrivateEndpointConnectionProxies"), - // }, - // IsDataAction: to.Ptr(false), - // Origin: to.Ptr("system"), - // }, - // { - // Name: to.Ptr("Microsoft.Batch/batchAccounts/privateEndpointConnectionProxyResults/read"), - // Display: &armbatch.OperationDisplay{ - // Description: to.Ptr("Gets the results of a long running Batch account private endpoint connection proxy operation"), - // Operation: to.Ptr("Get Batch account private endpoint connection proxy operation results"), - // Provider: to.Ptr("Microsoft Batch"), - // Resource: to.Ptr("PrivateEndpointConnectionProxies"), - // }, - // IsDataAction: to.Ptr(false), - // Origin: to.Ptr("system"), - // }, - // { - // Name: to.Ptr("Microsoft.Batch/batchAccounts/outboundNetworkDependenciesEndpoints/read"), - // Display: &armbatch.OperationDisplay{ - // Description: to.Ptr("Lists the outbound network dependency endpoints for a Batch account"), - // Operation: to.Ptr("List Outbound Network Dependency Endpoints"), - // Provider: to.Ptr("Microsoft Batch"), - // Resource: to.Ptr("Outbound Network Dependencies Endpoints"), - // }, - // IsDataAction: to.Ptr(false), - // Origin: to.Ptr("user,system"), - // }}, - // } - } -} diff --git a/sdk/resourcemanager/batch/armbatch/pool_client.go b/sdk/resourcemanager/batch/armbatch/pool_client.go index c91dc56a851b..a238cd98026a 100644 --- a/sdk/resourcemanager/batch/armbatch/pool_client.go +++ b/sdk/resourcemanager/batch/armbatch/pool_client.go @@ -48,7 +48,7 @@ func NewPoolClient(subscriptionID string, credential azcore.TokenCredential, opt // Create - Creates a new pool inside the specified account. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-10-01 +// Generated from API version 2023-05-01 // - resourceGroupName - The name of the resource group that contains the Batch account. // - accountName - The name of the Batch account. // - poolName - The pool name. This must be unique within the account. @@ -93,7 +93,7 @@ func (client *PoolClient) createCreateRequest(ctx context.Context, resourceGroup return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-10-01") + reqQP.Set("api-version", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() if options != nil && options.IfMatch != nil { req.Raw().Header["If-Match"] = []string{*options.IfMatch} @@ -120,7 +120,7 @@ func (client *PoolClient) createHandleResponse(resp *http.Response) (PoolClientC // BeginDelete - Deletes the specified pool. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-10-01 +// Generated from API version 2023-05-01 // - resourceGroupName - The name of the resource group that contains the Batch account. // - accountName - The name of the Batch account. // - poolName - The pool name. This must be unique within the account. @@ -142,7 +142,7 @@ func (client *PoolClient) BeginDelete(ctx context.Context, resourceGroupName str // Delete - Deletes the specified pool. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-10-01 +// Generated from API version 2023-05-01 func (client *PoolClient) deleteOperation(ctx context.Context, resourceGroupName string, accountName string, poolName string, options *PoolClientBeginDeleteOptions) (*http.Response, error) { req, err := client.deleteCreateRequest(ctx, resourceGroupName, accountName, poolName, options) if err != nil { @@ -182,7 +182,7 @@ func (client *PoolClient) deleteCreateRequest(ctx context.Context, resourceGroup return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-10-01") + reqQP.Set("api-version", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -191,7 +191,7 @@ func (client *PoolClient) deleteCreateRequest(ctx context.Context, resourceGroup // DisableAutoScale - Disables automatic scaling for a pool. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-10-01 +// Generated from API version 2023-05-01 // - resourceGroupName - The name of the resource group that contains the Batch account. // - accountName - The name of the Batch account. // - poolName - The pool name. This must be unique within the account. @@ -235,7 +235,7 @@ func (client *PoolClient) disableAutoScaleCreateRequest(ctx context.Context, res return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-10-01") + reqQP.Set("api-version", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -256,7 +256,7 @@ func (client *PoolClient) disableAutoScaleHandleResponse(resp *http.Response) (P // Get - Gets information about the specified pool. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-10-01 +// Generated from API version 2023-05-01 // - resourceGroupName - The name of the resource group that contains the Batch account. // - accountName - The name of the Batch account. // - poolName - The pool name. This must be unique within the account. @@ -300,7 +300,7 @@ func (client *PoolClient) getCreateRequest(ctx context.Context, resourceGroupNam return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-10-01") + reqQP.Set("api-version", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -320,7 +320,7 @@ func (client *PoolClient) getHandleResponse(resp *http.Response) (PoolClientGetR // NewListByBatchAccountPager - Lists all of the pools in the specified account. // -// Generated from API version 2022-10-01 +// Generated from API version 2023-05-01 // - resourceGroupName - The name of the resource group that contains the Batch account. // - accountName - The name of the Batch account. // - options - PoolClientListByBatchAccountOptions contains the optional parameters for the PoolClient.NewListByBatchAccountPager @@ -382,7 +382,7 @@ func (client *PoolClient) listByBatchAccountCreateRequest(ctx context.Context, r if options != nil && options.Filter != nil { reqQP.Set("$filter", *options.Filter) } - reqQP.Set("api-version", "2022-10-01") + reqQP.Set("api-version", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -404,7 +404,7 @@ func (client *PoolClient) listByBatchAccountHandleResponse(resp *http.Response) // not be an explicit resize pool request; this API can also be used to halt the initial sizing of the pool when it is created. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-10-01 +// Generated from API version 2023-05-01 // - resourceGroupName - The name of the resource group that contains the Batch account. // - accountName - The name of the Batch account. // - poolName - The pool name. This must be unique within the account. @@ -448,7 +448,7 @@ func (client *PoolClient) stopResizeCreateRequest(ctx context.Context, resourceG return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-10-01") + reqQP.Set("api-version", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -469,7 +469,7 @@ func (client *PoolClient) stopResizeHandleResponse(resp *http.Response) (PoolCli // Update - Updates the properties of an existing pool. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-10-01 +// Generated from API version 2023-05-01 // - resourceGroupName - The name of the resource group that contains the Batch account. // - accountName - The name of the Batch account. // - poolName - The pool name. This must be unique within the account. @@ -515,7 +515,7 @@ func (client *PoolClient) updateCreateRequest(ctx context.Context, resourceGroup return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-10-01") + reqQP.Set("api-version", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() if options != nil && options.IfMatch != nil { req.Raw().Header["If-Match"] = []string{*options.IfMatch} diff --git a/sdk/resourcemanager/batch/armbatch/pool_client_example_test.go b/sdk/resourcemanager/batch/armbatch/pool_client_example_test.go deleted file mode 100644 index f6ba6b29a450..000000000000 --- a/sdk/resourcemanager/batch/armbatch/pool_client_example_test.go +++ /dev/null @@ -1,1952 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armbatch_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/batch/armbatch" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ef6f2f06858cdbec7684968e1a54c7610da97dbb/specification/batch/resource-manager/Microsoft.Batch/stable/2022-10-01/examples/PoolList.json -func ExamplePoolClient_NewListByBatchAccountPager_listPool() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armbatch.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewPoolClient().NewListByBatchAccountPager("default-azurebatch-japaneast", "sampleacct", &armbatch.PoolClientListByBatchAccountOptions{Maxresults: nil, - Select: nil, - Filter: 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.ListPoolsResult = armbatch.ListPoolsResult{ - // Value: []*armbatch.Pool{ - // { - // Name: to.Ptr("testpool"), - // Type: to.Ptr("Microsoft.Batch/batchAccounts/pools"), - // Etag: to.Ptr("W/\"0x8D4EDFEBFADF4AB\""), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/default-azurebatch-japaneast/providers/Microsoft.Batch/batchAccounts/sampleacct/pools/testpool"), - // Properties: &armbatch.PoolProperties{ - // AllocationState: to.Ptr(armbatch.AllocationStateSteady), - // AllocationStateTransitionTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-08-28T10:22:55.9407275Z"); return t}()), - // ApplicationLicenses: []*string{ - // to.Ptr("app-license0"), - // to.Ptr("app-license1")}, - // ApplicationPackages: []*armbatch.ApplicationPackageReference{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/default-azurebatch-japaneast/providers/Microsoft.Batch/batchAccounts/sampleacct/pools/testpool/applications/app_1234"), - // Version: to.Ptr("asdf"), - // }}, - // Certificates: []*armbatch.CertificateReference{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/default-azurebatch-japaneast/providers/Microsoft.Batch/batchAccounts/sampleacct/pools/testpool/certificates/sha1-1234567"), - // StoreLocation: to.Ptr(armbatch.CertificateStoreLocationLocalMachine), - // StoreName: to.Ptr("MY"), - // Visibility: []*armbatch.CertificateVisibility{ - // to.Ptr(armbatch.CertificateVisibilityRemoteUser)}, - // }}, - // CreationTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-08-28T10:22:55.9407275Z"); return t}()), - // CurrentDedicatedNodes: to.Ptr[int32](0), - // CurrentLowPriorityNodes: to.Ptr[int32](0), - // DeploymentConfiguration: &armbatch.DeploymentConfiguration{ - // CloudServiceConfiguration: &armbatch.CloudServiceConfiguration{ - // OSFamily: to.Ptr("4"), - // OSVersion: to.Ptr("WA-GUEST-OS-4.45_201708-01"), - // }, - // }, - // InterNodeCommunication: to.Ptr(armbatch.InterNodeCommunicationStateEnabled), - // LastModified: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-08-28T10:22:55.9407275Z"); return t}()), - // Metadata: []*armbatch.MetadataItem{ - // { - // Name: to.Ptr("metadata-1"), - // Value: to.Ptr("value-1"), - // }, - // { - // Name: to.Ptr("metadata-2"), - // Value: to.Ptr("value-2"), - // }}, - // NetworkConfiguration: &armbatch.NetworkConfiguration{ - // EndpointConfiguration: &armbatch.PoolEndpointConfiguration{ - // InboundNatPools: []*armbatch.InboundNatPool{ - // { - // Name: to.Ptr("testnat"), - // BackendPort: to.Ptr[int32](12001), - // FrontendPortRangeEnd: to.Ptr[int32](15100), - // FrontendPortRangeStart: to.Ptr[int32](15000), - // NetworkSecurityGroupRules: []*armbatch.NetworkSecurityGroupRule{ - // { - // Access: to.Ptr(armbatch.NetworkSecurityGroupRuleAccessAllow), - // Priority: to.Ptr[int32](150), - // SourceAddressPrefix: to.Ptr("192.100.12.45"), - // SourcePortRanges: []*string{ - // to.Ptr("*")}, - // }, - // { - // Access: to.Ptr(armbatch.NetworkSecurityGroupRuleAccessDeny), - // Priority: to.Ptr[int32](3500), - // SourceAddressPrefix: to.Ptr("*"), - // SourcePortRanges: []*string{ - // to.Ptr("*")}, - // }}, - // Protocol: to.Ptr(armbatch.InboundEndpointProtocolTCP), - // }}, - // }, - // SubnetID: to.Ptr("/subscriptions/subid/resourceGroups/rg1234/providers/Microsoft.Network/virtualNetworks/network1234/subnets/subnet123"), - // }, - // ProvisioningState: to.Ptr(armbatch.PoolProvisioningStateSucceeded), - // ProvisioningStateTransitionTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-08-28T10:22:55.9407275Z"); return t}()), - // ResizeOperationStatus: &armbatch.ResizeOperationStatus{ - // Errors: []*armbatch.ResizeError{ - // { - // Code: to.Ptr("AllocationTimedout"), - // Message: to.Ptr("Desired number of dedicated nodes could not be allocated as the resize timeout was reached"), - // }}, - // NodeDeallocationOption: to.Ptr(armbatch.ComputeNodeDeallocationOptionTaskCompletion), - // ResizeTimeout: to.Ptr("PT8M"), - // StartTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-08-28T10:22:55.9407275Z"); return t}()), - // TargetDedicatedNodes: to.Ptr[int32](6), - // TargetLowPriorityNodes: to.Ptr[int32](28), - // }, - // ScaleSettings: &armbatch.ScaleSettings{ - // FixedScale: &armbatch.FixedScaleSettings{ - // ResizeTimeout: to.Ptr("PT8M"), - // TargetDedicatedNodes: to.Ptr[int32](6), - // TargetLowPriorityNodes: to.Ptr[int32](28), - // }, - // }, - // StartTask: &armbatch.StartTask{ - // CommandLine: to.Ptr("cmd /c SET"), - // EnvironmentSettings: []*armbatch.EnvironmentSetting{ - // { - // Name: to.Ptr("MYSET"), - // Value: to.Ptr("1234"), - // }}, - // MaxTaskRetryCount: to.Ptr[int32](6), - // ResourceFiles: []*armbatch.ResourceFile{ - // { - // FileMode: to.Ptr("777"), - // FilePath: to.Ptr("c:\\temp\\gohere"), - // HTTPURL: to.Ptr("https://testaccount.blob.core.windows.net/example-blob-file"), - // }}, - // UserIdentity: &armbatch.UserIdentity{ - // AutoUser: &armbatch.AutoUserSpecification{ - // ElevationLevel: to.Ptr(armbatch.ElevationLevelAdmin), - // Scope: to.Ptr(armbatch.AutoUserScopePool), - // }, - // }, - // WaitForSuccess: to.Ptr(true), - // }, - // TaskSchedulingPolicy: &armbatch.TaskSchedulingPolicy{ - // NodeFillType: to.Ptr(armbatch.ComputeNodeFillTypePack), - // }, - // TaskSlotsPerNode: to.Ptr[int32](13), - // UserAccounts: []*armbatch.UserAccount{ - // { - // Name: to.Ptr("username1"), - // ElevationLevel: to.Ptr(armbatch.ElevationLevelAdmin), - // LinuxUserConfiguration: &armbatch.LinuxUserConfiguration{ - // Gid: to.Ptr[int32](4567), - // UID: to.Ptr[int32](1234), - // }, - // }}, - // VMSize: to.Ptr("STANDARD_D4"), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ef6f2f06858cdbec7684968e1a54c7610da97dbb/specification/batch/resource-manager/Microsoft.Batch/stable/2022-10-01/examples/PoolListWithFilter.json -func ExamplePoolClient_NewListByBatchAccountPager_listPoolWithFilter() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armbatch.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewPoolClient().NewListByBatchAccountPager("default-azurebatch-japaneast", "sampleacct", &armbatch.PoolClientListByBatchAccountOptions{Maxresults: nil, - Select: to.Ptr("properties/allocationState,properties/provisioningStateTransitionTime,properties/currentDedicatedNodes,properties/currentLowPriorityNodes"), - Filter: to.Ptr("startswith(name, 'po') or (properties/allocationState eq 'Steady' and properties/provisioningStateTransitionTime lt datetime'2017-02-02')"), - }) - 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.ListPoolsResult = armbatch.ListPoolsResult{ - // Value: []*armbatch.Pool{ - // { - // Name: to.Ptr("testpool"), - // Type: to.Ptr("Microsoft.Batch/batchAccounts/pools"), - // Etag: to.Ptr("W/\"0x8D4EDFEBFADF4AB\""), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/default-azurebatch-japaneast/providers/Microsoft.Batch/batchAccounts/sampleacct/pools/testpool"), - // Properties: &armbatch.PoolProperties{ - // AllocationState: to.Ptr(armbatch.AllocationStateSteady), - // CurrentDedicatedNodes: to.Ptr[int32](0), - // CurrentLowPriorityNodes: to.Ptr[int32](2), - // ProvisioningStateTransitionTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-08-28T10:22:55.9407275Z"); return t}()), - // }, - // }, - // { - // Name: to.Ptr("pooltest"), - // Type: to.Ptr("Microsoft.Batch/batchAccounts/pools"), - // Etag: to.Ptr("W/\"0x8D4EDFEBFADF4AB\""), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/default-azurebatch-japaneast/providers/Microsoft.Batch/batchAccounts/sampleacct/pools/pooltest"), - // Properties: &armbatch.PoolProperties{ - // AllocationState: to.Ptr(armbatch.AllocationStateResizing), - // CurrentDedicatedNodes: to.Ptr[int32](4), - // CurrentLowPriorityNodes: to.Ptr[int32](0), - // ProvisioningStateTransitionTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-08-26T10:22:55.9407275Z"); return t}()), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ef6f2f06858cdbec7684968e1a54c7610da97dbb/specification/batch/resource-manager/Microsoft.Batch/stable/2022-10-01/examples/PoolCreate_SharedImageGallery.json -func ExamplePoolClient_Create_createPoolCustomImage() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armbatch.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewPoolClient().Create(ctx, "default-azurebatch-japaneast", "sampleacct", "testpool", armbatch.Pool{ - Properties: &armbatch.PoolProperties{ - DeploymentConfiguration: &armbatch.DeploymentConfiguration{ - VirtualMachineConfiguration: &armbatch.VirtualMachineConfiguration{ - ImageReference: &armbatch.ImageReference{ - ID: to.Ptr("/subscriptions/subid/resourceGroups/networking-group/providers/Microsoft.Compute/galleries/testgallery/images/testimagedef/versions/0.0.1"), - }, - NodeAgentSKUID: to.Ptr("batch.node.ubuntu 18.04"), - }, - }, - VMSize: to.Ptr("STANDARD_D4"), - }, - }, &armbatch.PoolClientCreateOptions{IfMatch: nil, - IfNoneMatch: 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.Pool = armbatch.Pool{ - // Name: to.Ptr("testpool"), - // Type: to.Ptr("Microsoft.Batch/batchAccounts/pools"), - // Etag: to.Ptr("W/\"0x8D4EDFEBFADF4AB\""), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/default-azurebatch-japaneast/providers/Microsoft.Batch/batchAccounts/sampleacct/pools/testpool"), - // Properties: &armbatch.PoolProperties{ - // AllocationState: to.Ptr(armbatch.AllocationStateSteady), - // AllocationStateTransitionTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-08-28T10:22:55.9407275Z"); return t}()), - // CreationTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-08-28T10:22:55.9407275Z"); return t}()), - // CurrentDedicatedNodes: to.Ptr[int32](0), - // CurrentLowPriorityNodes: to.Ptr[int32](0), - // DeploymentConfiguration: &armbatch.DeploymentConfiguration{ - // VirtualMachineConfiguration: &armbatch.VirtualMachineConfiguration{ - // ImageReference: &armbatch.ImageReference{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/networking-group/providers/Microsoft.Compute/galleries/testgallery/images/testimagedef/versions/0.0.1"), - // }, - // NodeAgentSKUID: to.Ptr("batch.node.ubuntu 18.04"), - // }, - // }, - // InterNodeCommunication: to.Ptr(armbatch.InterNodeCommunicationStateDisabled), - // LastModified: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-08-28T10:22:55.9407275Z"); return t}()), - // ProvisioningState: to.Ptr(armbatch.PoolProvisioningStateSucceeded), - // ProvisioningStateTransitionTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-08-28T10:22:55.9407275Z"); return t}()), - // ScaleSettings: &armbatch.ScaleSettings{ - // FixedScale: &armbatch.FixedScaleSettings{ - // TargetDedicatedNodes: to.Ptr[int32](0), - // TargetLowPriorityNodes: to.Ptr[int32](0), - // }, - // }, - // TaskSchedulingPolicy: &armbatch.TaskSchedulingPolicy{ - // NodeFillType: to.Ptr(armbatch.ComputeNodeFillTypeSpread), - // }, - // TaskSlotsPerNode: to.Ptr[int32](1), - // VMSize: to.Ptr("STANDARD_D4"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ef6f2f06858cdbec7684968e1a54c7610da97dbb/specification/batch/resource-manager/Microsoft.Batch/stable/2022-10-01/examples/PoolCreate_CloudServiceConfiguration.json -func ExamplePoolClient_Create_createPoolFullCloudServiceConfiguration() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armbatch.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewPoolClient().Create(ctx, "default-azurebatch-japaneast", "sampleacct", "testpool", armbatch.Pool{ - Properties: &armbatch.PoolProperties{ - ApplicationLicenses: []*string{ - to.Ptr("app-license0"), - to.Ptr("app-license1")}, - ApplicationPackages: []*armbatch.ApplicationPackageReference{ - { - ID: to.Ptr("/subscriptions/subid/resourceGroups/default-azurebatch-japaneast/providers/Microsoft.Batch/batchAccounts/sampleacct/pools/testpool/applications/app_1234"), - Version: to.Ptr("asdf"), - }}, - Certificates: []*armbatch.CertificateReference{ - { - ID: to.Ptr("/subscriptions/subid/resourceGroups/default-azurebatch-japaneast/providers/Microsoft.Batch/batchAccounts/sampleacct/pools/testpool/certificates/sha1-1234567"), - StoreLocation: to.Ptr(armbatch.CertificateStoreLocationLocalMachine), - StoreName: to.Ptr("MY"), - Visibility: []*armbatch.CertificateVisibility{ - to.Ptr(armbatch.CertificateVisibilityRemoteUser)}, - }}, - DeploymentConfiguration: &armbatch.DeploymentConfiguration{ - CloudServiceConfiguration: &armbatch.CloudServiceConfiguration{ - OSFamily: to.Ptr("4"), - OSVersion: to.Ptr("WA-GUEST-OS-4.45_201708-01"), - }, - }, - DisplayName: to.Ptr("my-pool-name"), - InterNodeCommunication: to.Ptr(armbatch.InterNodeCommunicationStateEnabled), - Metadata: []*armbatch.MetadataItem{ - { - Name: to.Ptr("metadata-1"), - Value: to.Ptr("value-1"), - }, - { - Name: to.Ptr("metadata-2"), - Value: to.Ptr("value-2"), - }}, - NetworkConfiguration: &armbatch.NetworkConfiguration{ - PublicIPAddressConfiguration: &armbatch.PublicIPAddressConfiguration{ - IPAddressIDs: []*string{ - to.Ptr("/subscriptions/subid1/resourceGroups/rg13/providers/Microsoft.Network/publicIPAddresses/ip135"), - to.Ptr("/subscriptions/subid2/resourceGroups/rg24/providers/Microsoft.Network/publicIPAddresses/ip268")}, - Provision: to.Ptr(armbatch.IPAddressProvisioningTypeUserManaged), - }, - SubnetID: to.Ptr("/subscriptions/subid/resourceGroups/rg1234/providers/Microsoft.Network/virtualNetworks/network1234/subnets/subnet123"), - }, - ScaleSettings: &armbatch.ScaleSettings{ - FixedScale: &armbatch.FixedScaleSettings{ - NodeDeallocationOption: to.Ptr(armbatch.ComputeNodeDeallocationOptionTaskCompletion), - ResizeTimeout: to.Ptr("PT8M"), - TargetDedicatedNodes: to.Ptr[int32](6), - TargetLowPriorityNodes: to.Ptr[int32](28), - }, - }, - StartTask: &armbatch.StartTask{ - CommandLine: to.Ptr("cmd /c SET"), - EnvironmentSettings: []*armbatch.EnvironmentSetting{ - { - Name: to.Ptr("MYSET"), - Value: to.Ptr("1234"), - }}, - MaxTaskRetryCount: to.Ptr[int32](6), - ResourceFiles: []*armbatch.ResourceFile{ - { - FileMode: to.Ptr("777"), - FilePath: to.Ptr("c:\\temp\\gohere"), - HTTPURL: to.Ptr("https://testaccount.blob.core.windows.net/example-blob-file"), - }}, - UserIdentity: &armbatch.UserIdentity{ - AutoUser: &armbatch.AutoUserSpecification{ - ElevationLevel: to.Ptr(armbatch.ElevationLevelAdmin), - Scope: to.Ptr(armbatch.AutoUserScopePool), - }, - }, - WaitForSuccess: to.Ptr(true), - }, - TaskSchedulingPolicy: &armbatch.TaskSchedulingPolicy{ - NodeFillType: to.Ptr(armbatch.ComputeNodeFillTypePack), - }, - TaskSlotsPerNode: to.Ptr[int32](13), - UserAccounts: []*armbatch.UserAccount{ - { - Name: to.Ptr("username1"), - ElevationLevel: to.Ptr(armbatch.ElevationLevelAdmin), - LinuxUserConfiguration: &armbatch.LinuxUserConfiguration{ - Gid: to.Ptr[int32](4567), - SSHPrivateKey: to.Ptr("sshprivatekeyvalue"), - UID: to.Ptr[int32](1234), - }, - Password: to.Ptr(""), - }}, - VMSize: to.Ptr("STANDARD_D4"), - }, - }, &armbatch.PoolClientCreateOptions{IfMatch: nil, - IfNoneMatch: 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.Pool = armbatch.Pool{ - // Name: to.Ptr("testpool"), - // Type: to.Ptr("Microsoft.Batch/batchAccounts/pools"), - // Etag: to.Ptr("W/\"0x8D4EDFEBFADF4AB\""), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/default-azurebatch-japaneast/providers/Microsoft.Batch/batchAccounts/sampleacct/pools/testpool"), - // Properties: &armbatch.PoolProperties{ - // AllocationState: to.Ptr(armbatch.AllocationStateResizing), - // AllocationStateTransitionTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-08-28T10:22:55.9407275Z"); return t}()), - // ApplicationLicenses: []*string{ - // to.Ptr("app-license0"), - // to.Ptr("app-license1")}, - // ApplicationPackages: []*armbatch.ApplicationPackageReference{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/default-azurebatch-japaneast/providers/Microsoft.Batch/batchAccounts/sampleacct/pools/testpool/applications/app_1234"), - // Version: to.Ptr("asdf"), - // }}, - // Certificates: []*armbatch.CertificateReference{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/default-azurebatch-japaneast/providers/Microsoft.Batch/batchAccounts/sampleacct/pools/testpool/certificates/sha1-1234567"), - // StoreLocation: to.Ptr(armbatch.CertificateStoreLocationLocalMachine), - // StoreName: to.Ptr("MY"), - // Visibility: []*armbatch.CertificateVisibility{ - // to.Ptr(armbatch.CertificateVisibilityRemoteUser)}, - // }}, - // CreationTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-08-28T10:22:55.9407275Z"); return t}()), - // CurrentDedicatedNodes: to.Ptr[int32](0), - // CurrentLowPriorityNodes: to.Ptr[int32](0), - // DeploymentConfiguration: &armbatch.DeploymentConfiguration{ - // CloudServiceConfiguration: &armbatch.CloudServiceConfiguration{ - // OSFamily: to.Ptr("4"), - // OSVersion: to.Ptr("WA-GUEST-OS-4.45_201708-01"), - // }, - // }, - // InterNodeCommunication: to.Ptr(armbatch.InterNodeCommunicationStateEnabled), - // LastModified: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-08-28T10:22:55.9407275Z"); return t}()), - // Metadata: []*armbatch.MetadataItem{ - // { - // Name: to.Ptr("metadata-1"), - // Value: to.Ptr("value-1"), - // }, - // { - // Name: to.Ptr("metadata-2"), - // Value: to.Ptr("value-2"), - // }}, - // NetworkConfiguration: &armbatch.NetworkConfiguration{ - // PublicIPAddressConfiguration: &armbatch.PublicIPAddressConfiguration{ - // IPAddressIDs: []*string{ - // to.Ptr("/subscriptions/subid1/resourceGroups/rg13/providers/Microsoft.Network/publicIPAddresses/ip135"), - // to.Ptr("/subscriptions/subid2/resourceGroups/rg24/providers/Microsoft.Network/publicIPAddresses/ip268")}, - // Provision: to.Ptr(armbatch.IPAddressProvisioningTypeUserManaged), - // }, - // SubnetID: to.Ptr("/subscriptions/subid/resourceGroups/rg1234/providers/Microsoft.Network/virtualNetworks/network1234/subnets/subnet123"), - // }, - // ProvisioningState: to.Ptr(armbatch.PoolProvisioningStateSucceeded), - // ProvisioningStateTransitionTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-08-28T10:22:55.9407275Z"); return t}()), - // ScaleSettings: &armbatch.ScaleSettings{ - // FixedScale: &armbatch.FixedScaleSettings{ - // NodeDeallocationOption: to.Ptr(armbatch.ComputeNodeDeallocationOptionTaskCompletion), - // ResizeTimeout: to.Ptr("PT8M"), - // TargetDedicatedNodes: to.Ptr[int32](6), - // TargetLowPriorityNodes: to.Ptr[int32](28), - // }, - // }, - // StartTask: &armbatch.StartTask{ - // CommandLine: to.Ptr("cmd /c SET"), - // EnvironmentSettings: []*armbatch.EnvironmentSetting{ - // { - // Name: to.Ptr("MYSET"), - // Value: to.Ptr("1234"), - // }}, - // MaxTaskRetryCount: to.Ptr[int32](6), - // ResourceFiles: []*armbatch.ResourceFile{ - // { - // FileMode: to.Ptr("777"), - // FilePath: to.Ptr("c:\\temp\\gohere"), - // HTTPURL: to.Ptr("https://testaccount.blob.core.windows.net/example-blob-file"), - // }}, - // UserIdentity: &armbatch.UserIdentity{ - // AutoUser: &armbatch.AutoUserSpecification{ - // ElevationLevel: to.Ptr(armbatch.ElevationLevelAdmin), - // Scope: to.Ptr(armbatch.AutoUserScopePool), - // }, - // }, - // WaitForSuccess: to.Ptr(true), - // }, - // TaskSchedulingPolicy: &armbatch.TaskSchedulingPolicy{ - // NodeFillType: to.Ptr(armbatch.ComputeNodeFillTypePack), - // }, - // TaskSlotsPerNode: to.Ptr[int32](13), - // UserAccounts: []*armbatch.UserAccount{ - // { - // Name: to.Ptr("username1"), - // ElevationLevel: to.Ptr(armbatch.ElevationLevelAdmin), - // LinuxUserConfiguration: &armbatch.LinuxUserConfiguration{ - // Gid: to.Ptr[int32](4567), - // UID: to.Ptr[int32](1234), - // }, - // }}, - // VMSize: to.Ptr("STANDARD_D4"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ef6f2f06858cdbec7684968e1a54c7610da97dbb/specification/batch/resource-manager/Microsoft.Batch/stable/2022-10-01/examples/PoolCreate_VirtualMachineConfiguration.json -func ExamplePoolClient_Create_createPoolFullVirtualMachineConfiguration() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armbatch.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewPoolClient().Create(ctx, "default-azurebatch-japaneast", "sampleacct", "testpool", armbatch.Pool{ - Properties: &armbatch.PoolProperties{ - DeploymentConfiguration: &armbatch.DeploymentConfiguration{ - VirtualMachineConfiguration: &armbatch.VirtualMachineConfiguration{ - DataDisks: []*armbatch.DataDisk{ - { - Caching: to.Ptr(armbatch.CachingTypeReadWrite), - DiskSizeGB: to.Ptr[int32](30), - Lun: to.Ptr[int32](0), - StorageAccountType: to.Ptr(armbatch.StorageAccountTypePremiumLRS), - }, - { - Caching: to.Ptr(armbatch.CachingTypeNone), - DiskSizeGB: to.Ptr[int32](200), - Lun: to.Ptr[int32](1), - StorageAccountType: to.Ptr(armbatch.StorageAccountTypeStandardLRS), - }}, - DiskEncryptionConfiguration: &armbatch.DiskEncryptionConfiguration{ - Targets: []*armbatch.DiskEncryptionTarget{ - to.Ptr(armbatch.DiskEncryptionTargetOsDisk), - to.Ptr(armbatch.DiskEncryptionTargetTemporaryDisk)}, - }, - ImageReference: &armbatch.ImageReference{ - Offer: to.Ptr("WindowsServer"), - Publisher: to.Ptr("MicrosoftWindowsServer"), - SKU: to.Ptr("2016-Datacenter-SmallDisk"), - Version: to.Ptr("latest"), - }, - LicenseType: to.Ptr("Windows_Server"), - NodeAgentSKUID: to.Ptr("batch.node.windows amd64"), - NodePlacementConfiguration: &armbatch.NodePlacementConfiguration{ - Policy: to.Ptr(armbatch.NodePlacementPolicyTypeZonal), - }, - OSDisk: &armbatch.OSDisk{ - EphemeralOSDiskSettings: &armbatch.DiffDiskSettings{ - Placement: to.Ptr("CacheDisk"), - }, - }, - WindowsConfiguration: &armbatch.WindowsConfiguration{ - EnableAutomaticUpdates: to.Ptr(false), - }, - }, - }, - NetworkConfiguration: &armbatch.NetworkConfiguration{ - EndpointConfiguration: &armbatch.PoolEndpointConfiguration{ - InboundNatPools: []*armbatch.InboundNatPool{ - { - Name: to.Ptr("testnat"), - BackendPort: to.Ptr[int32](12001), - FrontendPortRangeEnd: to.Ptr[int32](15100), - FrontendPortRangeStart: to.Ptr[int32](15000), - NetworkSecurityGroupRules: []*armbatch.NetworkSecurityGroupRule{ - { - Access: to.Ptr(armbatch.NetworkSecurityGroupRuleAccessAllow), - Priority: to.Ptr[int32](150), - SourceAddressPrefix: to.Ptr("192.100.12.45"), - SourcePortRanges: []*string{ - to.Ptr("1"), - to.Ptr("2")}, - }, - { - Access: to.Ptr(armbatch.NetworkSecurityGroupRuleAccessDeny), - Priority: to.Ptr[int32](3500), - SourceAddressPrefix: to.Ptr("*"), - SourcePortRanges: []*string{ - to.Ptr("*")}, - }}, - Protocol: to.Ptr(armbatch.InboundEndpointProtocolTCP), - }}, - }, - }, - ScaleSettings: &armbatch.ScaleSettings{ - AutoScale: &armbatch.AutoScaleSettings{ - EvaluationInterval: to.Ptr("PT5M"), - Formula: to.Ptr("$TargetDedicatedNodes=1"), - }, - }, - VMSize: to.Ptr("STANDARD_D4"), - }, - }, &armbatch.PoolClientCreateOptions{IfMatch: nil, - IfNoneMatch: 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.Pool = armbatch.Pool{ - // Name: to.Ptr("testpool"), - // Type: to.Ptr("Microsoft.Batch/batchAccounts/pools"), - // Etag: to.Ptr("W/\"0x8D4EDFEBFADF4AB\""), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/default-azurebatch-japaneast/providers/Microsoft.Batch/batchAccounts/sampleacct/pools/testpool"), - // Properties: &armbatch.PoolProperties{ - // AllocationState: to.Ptr(armbatch.AllocationStateResizing), - // AllocationStateTransitionTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-08-28T10:22:55.9407275Z"); return t}()), - // CreationTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-08-28T10:22:55.9407275Z"); return t}()), - // CurrentDedicatedNodes: to.Ptr[int32](0), - // CurrentLowPriorityNodes: to.Ptr[int32](0), - // DeploymentConfiguration: &armbatch.DeploymentConfiguration{ - // VirtualMachineConfiguration: &armbatch.VirtualMachineConfiguration{ - // DataDisks: []*armbatch.DataDisk{ - // { - // Caching: to.Ptr(armbatch.CachingTypeReadWrite), - // DiskSizeGB: to.Ptr[int32](30), - // Lun: to.Ptr[int32](0), - // StorageAccountType: to.Ptr(armbatch.StorageAccountTypePremiumLRS), - // }, - // { - // Caching: to.Ptr(armbatch.CachingTypeNone), - // DiskSizeGB: to.Ptr[int32](200), - // Lun: to.Ptr[int32](1), - // StorageAccountType: to.Ptr(armbatch.StorageAccountTypeStandardLRS), - // }}, - // DiskEncryptionConfiguration: &armbatch.DiskEncryptionConfiguration{ - // Targets: []*armbatch.DiskEncryptionTarget{ - // to.Ptr(armbatch.DiskEncryptionTargetOsDisk), - // to.Ptr(armbatch.DiskEncryptionTargetTemporaryDisk)}, - // }, - // ImageReference: &armbatch.ImageReference{ - // Offer: to.Ptr("WindowsServer"), - // Publisher: to.Ptr("MicrosoftWindowsServer"), - // SKU: to.Ptr("2016-Datacenter-SmallDisk"), - // Version: to.Ptr("latest"), - // }, - // LicenseType: to.Ptr("Windows_Server"), - // NodeAgentSKUID: to.Ptr("batch.node.windows amd64"), - // NodePlacementConfiguration: &armbatch.NodePlacementConfiguration{ - // Policy: to.Ptr(armbatch.NodePlacementPolicyTypeZonal), - // }, - // WindowsConfiguration: &armbatch.WindowsConfiguration{ - // EnableAutomaticUpdates: to.Ptr(false), - // }, - // }, - // }, - // InterNodeCommunication: to.Ptr(armbatch.InterNodeCommunicationStateDisabled), - // LastModified: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-08-28T10:22:55.9407275Z"); return t}()), - // NetworkConfiguration: &armbatch.NetworkConfiguration{ - // EndpointConfiguration: &armbatch.PoolEndpointConfiguration{ - // InboundNatPools: []*armbatch.InboundNatPool{ - // { - // Name: to.Ptr("testnat"), - // BackendPort: to.Ptr[int32](12001), - // FrontendPortRangeEnd: to.Ptr[int32](15100), - // FrontendPortRangeStart: to.Ptr[int32](15000), - // NetworkSecurityGroupRules: []*armbatch.NetworkSecurityGroupRule{ - // { - // Access: to.Ptr(armbatch.NetworkSecurityGroupRuleAccessAllow), - // Priority: to.Ptr[int32](150), - // SourceAddressPrefix: to.Ptr("192.100.12.45"), - // SourcePortRanges: []*string{ - // to.Ptr("1"), - // to.Ptr("2")}, - // }, - // { - // Access: to.Ptr(armbatch.NetworkSecurityGroupRuleAccessDeny), - // Priority: to.Ptr[int32](3500), - // SourceAddressPrefix: to.Ptr("*"), - // SourcePortRanges: []*string{ - // to.Ptr("*")}, - // }}, - // Protocol: to.Ptr(armbatch.InboundEndpointProtocolTCP), - // }}, - // }, - // }, - // ProvisioningState: to.Ptr(armbatch.PoolProvisioningStateSucceeded), - // ProvisioningStateTransitionTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-08-28T10:22:55.9407275Z"); return t}()), - // ScaleSettings: &armbatch.ScaleSettings{ - // AutoScale: &armbatch.AutoScaleSettings{ - // EvaluationInterval: to.Ptr("PT5M"), - // Formula: to.Ptr("$TargetDedicatedNodes=1"), - // }, - // }, - // TaskSchedulingPolicy: &armbatch.TaskSchedulingPolicy{ - // NodeFillType: to.Ptr(armbatch.ComputeNodeFillTypeSpread), - // }, - // TaskSlotsPerNode: to.Ptr[int32](1), - // VMSize: to.Ptr("STANDARD_D4"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ef6f2f06858cdbec7684968e1a54c7610da97dbb/specification/batch/resource-manager/Microsoft.Batch/stable/2022-10-01/examples/PoolCreate_MinimalCloudServiceConfiguration.json -func ExamplePoolClient_Create_createPoolMinimalCloudServiceConfiguration() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armbatch.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewPoolClient().Create(ctx, "default-azurebatch-japaneast", "sampleacct", "testpool", armbatch.Pool{ - Properties: &armbatch.PoolProperties{ - DeploymentConfiguration: &armbatch.DeploymentConfiguration{ - CloudServiceConfiguration: &armbatch.CloudServiceConfiguration{ - OSFamily: to.Ptr("5"), - }, - }, - ScaleSettings: &armbatch.ScaleSettings{ - FixedScale: &armbatch.FixedScaleSettings{ - TargetDedicatedNodes: to.Ptr[int32](3), - }, - }, - VMSize: to.Ptr("STANDARD_D4"), - }, - }, &armbatch.PoolClientCreateOptions{IfMatch: nil, - IfNoneMatch: 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.Pool = armbatch.Pool{ - // Name: to.Ptr("testpool"), - // Type: to.Ptr("Microsoft.Batch/batchAccounts/pools"), - // Etag: to.Ptr("W/\"0x8D4EDFEBFADF4AB\""), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/default-azurebatch-japaneast/providers/Microsoft.Batch/batchAccounts/sampleacct/pools/testpool"), - // Properties: &armbatch.PoolProperties{ - // AllocationState: to.Ptr(armbatch.AllocationStateResizing), - // AllocationStateTransitionTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-08-28T10:22:55.9407275Z"); return t}()), - // CreationTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-08-28T10:22:55.9407275Z"); return t}()), - // CurrentDedicatedNodes: to.Ptr[int32](0), - // CurrentLowPriorityNodes: to.Ptr[int32](0), - // DeploymentConfiguration: &armbatch.DeploymentConfiguration{ - // CloudServiceConfiguration: &armbatch.CloudServiceConfiguration{ - // OSFamily: to.Ptr("5"), - // OSVersion: to.Ptr("*"), - // }, - // }, - // InterNodeCommunication: to.Ptr(armbatch.InterNodeCommunicationStateDisabled), - // LastModified: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-08-28T10:22:55.9407275Z"); return t}()), - // ProvisioningState: to.Ptr(armbatch.PoolProvisioningStateSucceeded), - // ProvisioningStateTransitionTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-08-28T10:22:55.9407275Z"); return t}()), - // ResizeOperationStatus: &armbatch.ResizeOperationStatus{ - // NodeDeallocationOption: to.Ptr(armbatch.ComputeNodeDeallocationOptionRequeue), - // ResizeTimeout: to.Ptr("PT15M"), - // StartTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-08-28T10:22:55.9407275Z"); return t}()), - // TargetDedicatedNodes: to.Ptr[int32](3), - // }, - // ScaleSettings: &armbatch.ScaleSettings{ - // FixedScale: &armbatch.FixedScaleSettings{ - // ResizeTimeout: to.Ptr("PT15M"), - // TargetDedicatedNodes: to.Ptr[int32](3), - // TargetLowPriorityNodes: to.Ptr[int32](0), - // }, - // }, - // TaskSchedulingPolicy: &armbatch.TaskSchedulingPolicy{ - // NodeFillType: to.Ptr(armbatch.ComputeNodeFillTypeSpread), - // }, - // TaskSlotsPerNode: to.Ptr[int32](1), - // VMSize: to.Ptr("STANDARD_D4"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ef6f2f06858cdbec7684968e1a54c7610da97dbb/specification/batch/resource-manager/Microsoft.Batch/stable/2022-10-01/examples/PoolCreate_MinimalVirtualMachineConfiguration.json -func ExamplePoolClient_Create_createPoolMinimalVirtualMachineConfiguration() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armbatch.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewPoolClient().Create(ctx, "default-azurebatch-japaneast", "sampleacct", "testpool", armbatch.Pool{ - Properties: &armbatch.PoolProperties{ - DeploymentConfiguration: &armbatch.DeploymentConfiguration{ - VirtualMachineConfiguration: &armbatch.VirtualMachineConfiguration{ - ImageReference: &armbatch.ImageReference{ - Offer: to.Ptr("UbuntuServer"), - Publisher: to.Ptr("Canonical"), - SKU: to.Ptr("18.04-LTS"), - Version: to.Ptr("latest"), - }, - NodeAgentSKUID: to.Ptr("batch.node.ubuntu 18.04"), - }, - }, - ScaleSettings: &armbatch.ScaleSettings{ - AutoScale: &armbatch.AutoScaleSettings{ - EvaluationInterval: to.Ptr("PT5M"), - Formula: to.Ptr("$TargetDedicatedNodes=1"), - }, - }, - VMSize: to.Ptr("STANDARD_D4"), - }, - }, &armbatch.PoolClientCreateOptions{IfMatch: nil, - IfNoneMatch: 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.Pool = armbatch.Pool{ - // Name: to.Ptr("testpool"), - // Type: to.Ptr("Microsoft.Batch/batchAccounts/pools"), - // Etag: to.Ptr("W/\"0x8D4EDFEBFADF4AB\""), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/default-azurebatch-japaneast/providers/Microsoft.Batch/batchAccounts/sampleacct/pools/testpool"), - // Properties: &armbatch.PoolProperties{ - // AllocationState: to.Ptr(armbatch.AllocationStateResizing), - // AllocationStateTransitionTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-08-28T10:22:55.9407275Z"); return t}()), - // CreationTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-08-28T10:22:55.9407275Z"); return t}()), - // CurrentDedicatedNodes: to.Ptr[int32](0), - // CurrentLowPriorityNodes: to.Ptr[int32](0), - // DeploymentConfiguration: &armbatch.DeploymentConfiguration{ - // VirtualMachineConfiguration: &armbatch.VirtualMachineConfiguration{ - // ImageReference: &armbatch.ImageReference{ - // Offer: to.Ptr("UbuntuServer"), - // Publisher: to.Ptr("Canonical"), - // SKU: to.Ptr("18.04-LTS"), - // Version: to.Ptr("latest"), - // }, - // NodeAgentSKUID: to.Ptr("batch.node.ubuntu 18.04"), - // }, - // }, - // InterNodeCommunication: to.Ptr(armbatch.InterNodeCommunicationStateDisabled), - // LastModified: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-08-28T10:22:55.9407275Z"); return t}()), - // ProvisioningState: to.Ptr(armbatch.PoolProvisioningStateSucceeded), - // ProvisioningStateTransitionTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-08-28T10:22:55.9407275Z"); return t}()), - // ScaleSettings: &armbatch.ScaleSettings{ - // AutoScale: &armbatch.AutoScaleSettings{ - // EvaluationInterval: to.Ptr("PT5M"), - // Formula: to.Ptr("$TargetDedicatedNodes=1"), - // }, - // }, - // TaskSchedulingPolicy: &armbatch.TaskSchedulingPolicy{ - // NodeFillType: to.Ptr(armbatch.ComputeNodeFillTypeSpread), - // }, - // TaskSlotsPerNode: to.Ptr[int32](1), - // VMSize: to.Ptr("STANDARD_D4"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ef6f2f06858cdbec7684968e1a54c7610da97dbb/specification/batch/resource-manager/Microsoft.Batch/stable/2022-10-01/examples/PoolCreate_NoPublicIPAddresses.json -func ExamplePoolClient_Create_createPoolNoPublicIp() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armbatch.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewPoolClient().Create(ctx, "default-azurebatch-japaneast", "sampleacct", "testpool", armbatch.Pool{ - Properties: &armbatch.PoolProperties{ - DeploymentConfiguration: &armbatch.DeploymentConfiguration{ - VirtualMachineConfiguration: &armbatch.VirtualMachineConfiguration{ - ImageReference: &armbatch.ImageReference{ - ID: to.Ptr("/subscriptions/subid/resourceGroups/networking-group/providers/Microsoft.Compute/galleries/testgallery/images/testimagedef/versions/0.0.1"), - }, - NodeAgentSKUID: to.Ptr("batch.node.ubuntu 18.04"), - }, - }, - NetworkConfiguration: &armbatch.NetworkConfiguration{ - PublicIPAddressConfiguration: &armbatch.PublicIPAddressConfiguration{ - Provision: to.Ptr(armbatch.IPAddressProvisioningTypeNoPublicIPAddresses), - }, - SubnetID: to.Ptr("/subscriptions/subid/resourceGroups/rg1234/providers/Microsoft.Network/virtualNetworks/network1234/subnets/subnet123"), - }, - VMSize: to.Ptr("STANDARD_D4"), - }, - }, &armbatch.PoolClientCreateOptions{IfMatch: nil, - IfNoneMatch: 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.Pool = armbatch.Pool{ - // Name: to.Ptr("testpool"), - // Type: to.Ptr("Microsoft.Batch/batchAccounts/pools"), - // Etag: to.Ptr("W/\"0x8D4EDFEBFADF4AB\""), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/default-azurebatch-japaneast/providers/Microsoft.Batch/batchAccounts/sampleacct/pools/testpool"), - // Properties: &armbatch.PoolProperties{ - // AllocationState: to.Ptr(armbatch.AllocationStateSteady), - // AllocationStateTransitionTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-08-28T10:22:55.9407275Z"); return t}()), - // CreationTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-08-28T10:22:55.9407275Z"); return t}()), - // CurrentDedicatedNodes: to.Ptr[int32](0), - // CurrentLowPriorityNodes: to.Ptr[int32](0), - // DeploymentConfiguration: &armbatch.DeploymentConfiguration{ - // VirtualMachineConfiguration: &armbatch.VirtualMachineConfiguration{ - // ImageReference: &armbatch.ImageReference{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/networking-group/providers/Microsoft.Compute/galleries/testgallery/images/testimagedef/versions/0.0.1"), - // }, - // NodeAgentSKUID: to.Ptr("batch.node.ubuntu 18.04"), - // }, - // }, - // InterNodeCommunication: to.Ptr(armbatch.InterNodeCommunicationStateDisabled), - // LastModified: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-08-28T10:22:55.9407275Z"); return t}()), - // NetworkConfiguration: &armbatch.NetworkConfiguration{ - // PublicIPAddressConfiguration: &armbatch.PublicIPAddressConfiguration{ - // Provision: to.Ptr(armbatch.IPAddressProvisioningTypeNoPublicIPAddresses), - // }, - // SubnetID: to.Ptr("/subscriptions/subid/resourceGroups/rg1234/providers/Microsoft.Network/virtualNetworks/network1234/subnets/subnet123"), - // }, - // ProvisioningState: to.Ptr(armbatch.PoolProvisioningStateSucceeded), - // ProvisioningStateTransitionTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-08-28T10:22:55.9407275Z"); return t}()), - // ScaleSettings: &armbatch.ScaleSettings{ - // FixedScale: &armbatch.FixedScaleSettings{ - // TargetDedicatedNodes: to.Ptr[int32](0), - // TargetLowPriorityNodes: to.Ptr[int32](0), - // }, - // }, - // TaskSchedulingPolicy: &armbatch.TaskSchedulingPolicy{ - // NodeFillType: to.Ptr(armbatch.ComputeNodeFillTypeSpread), - // }, - // TaskSlotsPerNode: to.Ptr[int32](1), - // VMSize: to.Ptr("STANDARD_D4"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ef6f2f06858cdbec7684968e1a54c7610da97dbb/specification/batch/resource-manager/Microsoft.Batch/stable/2022-10-01/examples/PoolCreate_PublicIPs.json -func ExamplePoolClient_Create_createPoolPublicIPs() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armbatch.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewPoolClient().Create(ctx, "default-azurebatch-japaneast", "sampleacct", "testpool", armbatch.Pool{ - Properties: &armbatch.PoolProperties{ - DeploymentConfiguration: &armbatch.DeploymentConfiguration{ - VirtualMachineConfiguration: &armbatch.VirtualMachineConfiguration{ - ImageReference: &armbatch.ImageReference{ - ID: to.Ptr("/subscriptions/subid/resourceGroups/networking-group/providers/Microsoft.Compute/galleries/testgallery/images/testimagedef/versions/0.0.1"), - }, - NodeAgentSKUID: to.Ptr("batch.node.ubuntu 18.04"), - }, - }, - NetworkConfiguration: &armbatch.NetworkConfiguration{ - PublicIPAddressConfiguration: &armbatch.PublicIPAddressConfiguration{ - IPAddressIDs: []*string{ - to.Ptr("/subscriptions/subid1/resourceGroups/rg13/providers/Microsoft.Network/publicIPAddresses/ip135")}, - Provision: to.Ptr(armbatch.IPAddressProvisioningTypeUserManaged), - }, - SubnetID: to.Ptr("/subscriptions/subid/resourceGroups/rg1234/providers/Microsoft.Network/virtualNetworks/network1234/subnets/subnet123"), - }, - VMSize: to.Ptr("STANDARD_D4"), - }, - }, &armbatch.PoolClientCreateOptions{IfMatch: nil, - IfNoneMatch: 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.Pool = armbatch.Pool{ - // Name: to.Ptr("testpool"), - // Type: to.Ptr("Microsoft.Batch/batchAccounts/pools"), - // Etag: to.Ptr("W/\"0x8D4EDFEBFADF4AB\""), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/default-azurebatch-japaneast/providers/Microsoft.Batch/batchAccounts/sampleacct/pools/testpool"), - // Properties: &armbatch.PoolProperties{ - // AllocationState: to.Ptr(armbatch.AllocationStateSteady), - // AllocationStateTransitionTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-08-28T10:22:55.9407275Z"); return t}()), - // CreationTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-08-28T10:22:55.9407275Z"); return t}()), - // CurrentDedicatedNodes: to.Ptr[int32](0), - // CurrentLowPriorityNodes: to.Ptr[int32](0), - // DeploymentConfiguration: &armbatch.DeploymentConfiguration{ - // VirtualMachineConfiguration: &armbatch.VirtualMachineConfiguration{ - // ImageReference: &armbatch.ImageReference{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/networking-group/providers/Microsoft.Compute/galleries/testgallery/images/testimagedef/versions/0.0.1"), - // }, - // NodeAgentSKUID: to.Ptr("batch.node.ubuntu 18.04"), - // }, - // }, - // InterNodeCommunication: to.Ptr(armbatch.InterNodeCommunicationStateDisabled), - // LastModified: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-08-28T10:22:55.9407275Z"); return t}()), - // NetworkConfiguration: &armbatch.NetworkConfiguration{ - // PublicIPAddressConfiguration: &armbatch.PublicIPAddressConfiguration{ - // IPAddressIDs: []*string{ - // to.Ptr("/subscriptions/subid1/resourceGroups/rg13/providers/Microsoft.Network/publicIPAddresses/ip135")}, - // Provision: to.Ptr(armbatch.IPAddressProvisioningTypeUserManaged), - // }, - // SubnetID: to.Ptr("/subscriptions/subid/resourceGroups/rg1234/providers/Microsoft.Network/virtualNetworks/network1234/subnets/subnet123"), - // }, - // ProvisioningState: to.Ptr(armbatch.PoolProvisioningStateSucceeded), - // ProvisioningStateTransitionTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-08-28T10:22:55.9407275Z"); return t}()), - // ScaleSettings: &armbatch.ScaleSettings{ - // FixedScale: &armbatch.FixedScaleSettings{ - // TargetDedicatedNodes: to.Ptr[int32](0), - // TargetLowPriorityNodes: to.Ptr[int32](0), - // }, - // }, - // TaskSchedulingPolicy: &armbatch.TaskSchedulingPolicy{ - // NodeFillType: to.Ptr(armbatch.ComputeNodeFillTypeSpread), - // }, - // TaskSlotsPerNode: to.Ptr[int32](1), - // VMSize: to.Ptr("STANDARD_D4"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ef6f2f06858cdbec7684968e1a54c7610da97dbb/specification/batch/resource-manager/Microsoft.Batch/stable/2022-10-01/examples/PoolCreate_UserAssignedIdentities.json -func ExamplePoolClient_Create_createPoolUserAssignedIdentities() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armbatch.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewPoolClient().Create(ctx, "default-azurebatch-japaneast", "sampleacct", "testpool", armbatch.Pool{ - Identity: &armbatch.PoolIdentity{ - Type: to.Ptr(armbatch.PoolIdentityTypeUserAssigned), - UserAssignedIdentities: map[string]*armbatch.UserAssignedIdentities{ - "/subscriptions/subid/resourceGroups/default-azurebatch-japaneast/providers/Microsoft.ManagedIdentity/userAssignedIdentities/id1": {}, - "/subscriptions/subid/resourceGroups/default-azurebatch-japaneast/providers/Microsoft.ManagedIdentity/userAssignedIdentities/id2": {}, - }, - }, - Properties: &armbatch.PoolProperties{ - DeploymentConfiguration: &armbatch.DeploymentConfiguration{ - VirtualMachineConfiguration: &armbatch.VirtualMachineConfiguration{ - ImageReference: &armbatch.ImageReference{ - Offer: to.Ptr("UbuntuServer"), - Publisher: to.Ptr("Canonical"), - SKU: to.Ptr("18.04-LTS"), - Version: to.Ptr("latest"), - }, - NodeAgentSKUID: to.Ptr("batch.node.ubuntu 18.04"), - }, - }, - ScaleSettings: &armbatch.ScaleSettings{ - AutoScale: &armbatch.AutoScaleSettings{ - EvaluationInterval: to.Ptr("PT5M"), - Formula: to.Ptr("$TargetDedicatedNodes=1"), - }, - }, - VMSize: to.Ptr("STANDARD_D4"), - }, - }, &armbatch.PoolClientCreateOptions{IfMatch: nil, - IfNoneMatch: 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.Pool = armbatch.Pool{ - // Name: to.Ptr("testpool"), - // Type: to.Ptr("Microsoft.Batch/batchAccounts/pools"), - // Etag: to.Ptr("W/\"0x8D4EDFEBFADF4AB\""), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/default-azurebatch-japaneast/providers/Microsoft.Batch/batchAccounts/sampleacct/pools/testpool"), - // Identity: &armbatch.PoolIdentity{ - // Type: to.Ptr(armbatch.PoolIdentityTypeUserAssigned), - // UserAssignedIdentities: map[string]*armbatch.UserAssignedIdentities{ - // "/subscriptions/subid/resourceGroups/default-azurebatch-japaneast/providers/Microsoft.ManagedIdentity/userAssignedIdentities/id1": &armbatch.UserAssignedIdentities{ - // ClientID: to.Ptr("clientId1"), - // PrincipalID: to.Ptr("principalId1"), - // }, - // "/subscriptions/subid/resourceGroups/default-azurebatch-japaneast/providers/Microsoft.ManagedIdentity/userAssignedIdentities/id2": &armbatch.UserAssignedIdentities{ - // ClientID: to.Ptr("clientId2"), - // PrincipalID: to.Ptr("principalId2"), - // }, - // }, - // }, - // Properties: &armbatch.PoolProperties{ - // AllocationState: to.Ptr(armbatch.AllocationStateResizing), - // AllocationStateTransitionTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-10-01T10:22:55.9407275Z"); return t}()), - // CreationTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-10-01T10:22:55.9407275Z"); return t}()), - // CurrentDedicatedNodes: to.Ptr[int32](0), - // CurrentLowPriorityNodes: to.Ptr[int32](0), - // DeploymentConfiguration: &armbatch.DeploymentConfiguration{ - // VirtualMachineConfiguration: &armbatch.VirtualMachineConfiguration{ - // ImageReference: &armbatch.ImageReference{ - // Offer: to.Ptr("UbuntuServer"), - // Publisher: to.Ptr("Canonical"), - // SKU: to.Ptr("18.04-LTS"), - // Version: to.Ptr("latest"), - // }, - // NodeAgentSKUID: to.Ptr("batch.node.ubuntu 18.04"), - // }, - // }, - // InterNodeCommunication: to.Ptr(armbatch.InterNodeCommunicationStateDisabled), - // LastModified: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-10-01T10:22:55.9407275Z"); return t}()), - // ProvisioningState: to.Ptr(armbatch.PoolProvisioningStateSucceeded), - // ProvisioningStateTransitionTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-10-01T10:22:55.9407275Z"); return t}()), - // ScaleSettings: &armbatch.ScaleSettings{ - // AutoScale: &armbatch.AutoScaleSettings{ - // EvaluationInterval: to.Ptr("PT5M"), - // Formula: to.Ptr("$TargetDedicatedNodes=1"), - // }, - // }, - // TaskSchedulingPolicy: &armbatch.TaskSchedulingPolicy{ - // NodeFillType: to.Ptr(armbatch.ComputeNodeFillTypeSpread), - // }, - // TaskSlotsPerNode: to.Ptr[int32](1), - // VMSize: to.Ptr("STANDARD_D4"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ef6f2f06858cdbec7684968e1a54c7610da97dbb/specification/batch/resource-manager/Microsoft.Batch/stable/2022-10-01/examples/PoolCreate_VirtualMachineConfiguration_Extensions.json -func ExamplePoolClient_Create_createPoolVirtualMachineConfigurationExtensions() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armbatch.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewPoolClient().Create(ctx, "default-azurebatch-japaneast", "sampleacct", "testpool", armbatch.Pool{ - Properties: &armbatch.PoolProperties{ - DeploymentConfiguration: &armbatch.DeploymentConfiguration{ - VirtualMachineConfiguration: &armbatch.VirtualMachineConfiguration{ - ImageReference: &armbatch.ImageReference{ - Offer: to.Ptr("0001-com-ubuntu-server-focal"), - Publisher: to.Ptr("Canonical"), - SKU: to.Ptr("20_04-lts"), - }, - NodeAgentSKUID: to.Ptr("batch.node.ubuntu 20.04"), - Extensions: []*armbatch.VMExtension{ - { - Name: to.Ptr("batchextension1"), - Type: to.Ptr("SecurityMonitoringForLinux"), - AutoUpgradeMinorVersion: to.Ptr(true), - ProtectedSettings: map[string]any{ - "protectedSettingsKey": "protectedSettingsValue", - }, - Publisher: to.Ptr("Microsoft.Azure.Security.Monitoring"), - Settings: map[string]any{ - "settingsKey": "settingsValue", - }, - TypeHandlerVersion: to.Ptr("1.0"), - }}, - }, - }, - ScaleSettings: &armbatch.ScaleSettings{ - AutoScale: &armbatch.AutoScaleSettings{ - EvaluationInterval: to.Ptr("PT5M"), - Formula: to.Ptr("$TargetDedicatedNodes=1"), - }, - }, - TargetNodeCommunicationMode: to.Ptr(armbatch.NodeCommunicationModeDefault), - VMSize: to.Ptr("STANDARD_D4"), - }, - }, &armbatch.PoolClientCreateOptions{IfMatch: nil, - IfNoneMatch: 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.Pool = armbatch.Pool{ - // Name: to.Ptr("testpool"), - // Type: to.Ptr("Microsoft.Batch/batchAccounts/pools"), - // Etag: to.Ptr("W/\"0x8D4EDFEBFADF4AB\""), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/default-azurebatch-japaneast/providers/Microsoft.Batch/batchAccounts/sampleacct/pools/testpool"), - // Properties: &armbatch.PoolProperties{ - // AllocationState: to.Ptr(armbatch.AllocationStateResizing), - // AllocationStateTransitionTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-08-28T10:22:55.9407275Z"); return t}()), - // CreationTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-08-28T10:22:55.9407275Z"); return t}()), - // CurrentDedicatedNodes: to.Ptr[int32](0), - // CurrentLowPriorityNodes: to.Ptr[int32](0), - // DeploymentConfiguration: &armbatch.DeploymentConfiguration{ - // VirtualMachineConfiguration: &armbatch.VirtualMachineConfiguration{ - // ImageReference: &armbatch.ImageReference{ - // Offer: to.Ptr("0001-com-ubuntu-server-focal"), - // Publisher: to.Ptr("Canonical"), - // SKU: to.Ptr("20_04-lts"), - // }, - // NodeAgentSKUID: to.Ptr("batch.node.ubuntu 20.04"), - // Extensions: []*armbatch.VMExtension{ - // { - // Name: to.Ptr("batchextension1"), - // Type: to.Ptr("SecurityMonitoringForLinux"), - // AutoUpgradeMinorVersion: to.Ptr(true), - // Publisher: to.Ptr("Microsoft.Azure.Security.Monitoring"), - // Settings: map[string]any{ - // "settingsKey": "settingsValue", - // }, - // TypeHandlerVersion: to.Ptr("1.0"), - // }}, - // }, - // }, - // InterNodeCommunication: to.Ptr(armbatch.InterNodeCommunicationStateDisabled), - // LastModified: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-08-28T10:22:55.9407275Z"); return t}()), - // ProvisioningState: to.Ptr(armbatch.PoolProvisioningStateSucceeded), - // ProvisioningStateTransitionTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-08-28T10:22:55.9407275Z"); return t}()), - // ScaleSettings: &armbatch.ScaleSettings{ - // AutoScale: &armbatch.AutoScaleSettings{ - // EvaluationInterval: to.Ptr("PT5M"), - // Formula: to.Ptr("$TargetDedicatedNodes=1"), - // }, - // }, - // TargetNodeCommunicationMode: to.Ptr(armbatch.NodeCommunicationModeDefault), - // TaskSchedulingPolicy: &armbatch.TaskSchedulingPolicy{ - // NodeFillType: to.Ptr(armbatch.ComputeNodeFillTypeSpread), - // }, - // TaskSlotsPerNode: to.Ptr[int32](1), - // VMSize: to.Ptr("STANDARD_D4"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ef6f2f06858cdbec7684968e1a54c7610da97dbb/specification/batch/resource-manager/Microsoft.Batch/stable/2022-10-01/examples/PoolUpdate_EnableAutoScale.json -func ExamplePoolClient_Update_updatePoolEnableAutoscale() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armbatch.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewPoolClient().Update(ctx, "default-azurebatch-japaneast", "sampleacct", "testpool", armbatch.Pool{ - Properties: &armbatch.PoolProperties{ - ScaleSettings: &armbatch.ScaleSettings{ - AutoScale: &armbatch.AutoScaleSettings{ - Formula: to.Ptr("$TargetDedicatedNodes=34"), - }, - }, - }, - }, &armbatch.PoolClientUpdateOptions{IfMatch: 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.Pool = armbatch.Pool{ - // Name: to.Ptr("testpool"), - // Type: to.Ptr("Microsoft.Batch/batchAccounts/pools"), - // Etag: to.Ptr("W/\"0x8D4EDFEBFADF4AB\""), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/default-azurebatch-japaneast/providers/Microsoft.Batch/batchAccounts/sampleacct/pools/testpool"), - // Properties: &armbatch.PoolProperties{ - // AllocationState: to.Ptr(armbatch.AllocationStateResizing), - // AllocationStateTransitionTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-08-29T10:22:55.9407275Z"); return t}()), - // AutoScaleRun: &armbatch.AutoScaleRun{ - // EvaluationTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-08-29T10:22:55.9407275Z"); return t}()), - // Results: to.Ptr("$TargetDedicatedNodes=34;NodeDeallocationOption=requeue"), - // }, - // CreationTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-08-28T10:22:55.9407275Z"); return t}()), - // CurrentDedicatedNodes: to.Ptr[int32](12), - // CurrentLowPriorityNodes: to.Ptr[int32](0), - // DeploymentConfiguration: &armbatch.DeploymentConfiguration{ - // CloudServiceConfiguration: &armbatch.CloudServiceConfiguration{ - // OSFamily: to.Ptr("5"), - // OSVersion: to.Ptr("*"), - // }, - // }, - // InterNodeCommunication: to.Ptr(armbatch.InterNodeCommunicationStateDisabled), - // LastModified: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-08-29T10:22:55.9407275Z"); return t}()), - // ProvisioningState: to.Ptr(armbatch.PoolProvisioningStateSucceeded), - // ProvisioningStateTransitionTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-08-28T10:22:55.9407275Z"); return t}()), - // ResizeOperationStatus: &armbatch.ResizeOperationStatus{ - // NodeDeallocationOption: to.Ptr(armbatch.ComputeNodeDeallocationOptionRequeue), - // ResizeTimeout: to.Ptr("PT15M"), - // StartTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-08-29T10:22:55.9407275Z"); return t}()), - // TargetDedicatedNodes: to.Ptr[int32](34), - // }, - // ScaleSettings: &armbatch.ScaleSettings{ - // AutoScale: &armbatch.AutoScaleSettings{ - // EvaluationInterval: to.Ptr("PT15M"), - // Formula: to.Ptr("$TargetDedicated=34"), - // }, - // }, - // TaskSchedulingPolicy: &armbatch.TaskSchedulingPolicy{ - // NodeFillType: to.Ptr(armbatch.ComputeNodeFillTypeSpread), - // }, - // TaskSlotsPerNode: to.Ptr[int32](1), - // VMSize: to.Ptr("STANDARD_D4"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ef6f2f06858cdbec7684968e1a54c7610da97dbb/specification/batch/resource-manager/Microsoft.Batch/stable/2022-10-01/examples/PoolUpdate_OtherProperties.json -func ExamplePoolClient_Update_updatePoolOtherProperties() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armbatch.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewPoolClient().Update(ctx, "default-azurebatch-japaneast", "sampleacct", "testpool", armbatch.Pool{ - Properties: &armbatch.PoolProperties{ - ApplicationPackages: []*armbatch.ApplicationPackageReference{ - { - ID: to.Ptr("/subscriptions/subid/resourceGroups/default-azurebatch-japaneast/providers/Microsoft.Batch/batchAccounts/sampleacct/pools/testpool/applications/app_1234"), - }, - { - ID: to.Ptr("/subscriptions/subid/resourceGroups/default-azurebatch-japaneast/providers/Microsoft.Batch/batchAccounts/sampleacct/pools/testpool/applications/app_5678"), - Version: to.Ptr("1.0"), - }}, - Certificates: []*armbatch.CertificateReference{ - { - ID: to.Ptr("/subscriptions/subid/resourceGroups/default-azurebatch-japaneast/providers/Microsoft.Batch/batchAccounts/sampleacct/pools/testpool/certificates/sha1-1234567"), - StoreLocation: to.Ptr(armbatch.CertificateStoreLocationLocalMachine), - StoreName: to.Ptr("MY"), - }}, - Metadata: []*armbatch.MetadataItem{ - { - Name: to.Ptr("key1"), - Value: to.Ptr("value1"), - }}, - TargetNodeCommunicationMode: to.Ptr(armbatch.NodeCommunicationModeSimplified), - }, - }, &armbatch.PoolClientUpdateOptions{IfMatch: 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.Pool = armbatch.Pool{ - // Name: to.Ptr("testpool"), - // Type: to.Ptr("Microsoft.Batch/batchAccounts/pools"), - // Etag: to.Ptr("W/\"0x8D4EDFEBFADF4AB\""), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/default-azurebatch-japaneast/providers/Microsoft.Batch/batchAccounts/sampleacct/pools/testpool"), - // Properties: &armbatch.PoolProperties{ - // AllocationState: to.Ptr(armbatch.AllocationStateResizing), - // AllocationStateTransitionTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-08-29T10:22:55.9407275Z"); return t}()), - // ApplicationPackages: []*armbatch.ApplicationPackageReference{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/default-azurebatch-japaneast/providers/Microsoft.Batch/batchAccounts/sampleacct/pools/testpool/applications/app_1234"), - // }, - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/default-azurebatch-japaneast/providers/Microsoft.Batch/batchAccounts/sampleacct/pools/testpool/applications/app_5678"), - // Version: to.Ptr("1.0"), - // }}, - // AutoScaleRun: &armbatch.AutoScaleRun{ - // EvaluationTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-08-29T10:22:55.9407275Z"); return t}()), - // Results: to.Ptr("$TargetDedicatedNodes=34;NodeDeallocationOption=requeue"), - // }, - // Certificates: []*armbatch.CertificateReference{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/default-azurebatch-japaneast/providers/Microsoft.Batch/batchAccounts/sampleacct/pools/testpool/certificates/sha1-1234567"), - // StoreLocation: to.Ptr(armbatch.CertificateStoreLocationLocalMachine), - // StoreName: to.Ptr("MY"), - // Visibility: []*armbatch.CertificateVisibility{ - // to.Ptr(armbatch.CertificateVisibilityStartTask), - // to.Ptr(armbatch.CertificateVisibilityTask), - // to.Ptr(armbatch.CertificateVisibilityRemoteUser)}, - // }}, - // CreationTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-08-28T10:22:55.9407275Z"); return t}()), - // CurrentDedicatedNodes: to.Ptr[int32](12), - // CurrentLowPriorityNodes: to.Ptr[int32](0), - // DeploymentConfiguration: &armbatch.DeploymentConfiguration{ - // CloudServiceConfiguration: &armbatch.CloudServiceConfiguration{ - // OSFamily: to.Ptr("5"), - // OSVersion: to.Ptr("*"), - // }, - // }, - // InterNodeCommunication: to.Ptr(armbatch.InterNodeCommunicationStateDisabled), - // LastModified: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-08-29T10:22:55.9407275Z"); return t}()), - // Metadata: []*armbatch.MetadataItem{ - // { - // Name: to.Ptr("key1"), - // Value: to.Ptr("value1"), - // }}, - // ProvisioningState: to.Ptr(armbatch.PoolProvisioningStateSucceeded), - // ProvisioningStateTransitionTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-08-28T10:22:55.9407275Z"); return t}()), - // ResizeOperationStatus: &armbatch.ResizeOperationStatus{ - // NodeDeallocationOption: to.Ptr(armbatch.ComputeNodeDeallocationOptionTaskCompletion), - // ResizeTimeout: to.Ptr("PT8M"), - // StartTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-08-29T10:22:55.9407275Z"); return t}()), - // TargetDedicatedNodes: to.Ptr[int32](8), - // }, - // ScaleSettings: &armbatch.ScaleSettings{ - // FixedScale: &armbatch.FixedScaleSettings{ - // NodeDeallocationOption: to.Ptr(armbatch.ComputeNodeDeallocationOptionTaskCompletion), - // ResizeTimeout: to.Ptr("PT8M"), - // TargetDedicatedNodes: to.Ptr[int32](1), - // TargetLowPriorityNodes: to.Ptr[int32](0), - // }, - // }, - // TargetNodeCommunicationMode: to.Ptr(armbatch.NodeCommunicationModeSimplified), - // TaskSchedulingPolicy: &armbatch.TaskSchedulingPolicy{ - // NodeFillType: to.Ptr(armbatch.ComputeNodeFillTypeSpread), - // }, - // TaskSlotsPerNode: to.Ptr[int32](1), - // VMSize: to.Ptr("STANDARD_D4"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ef6f2f06858cdbec7684968e1a54c7610da97dbb/specification/batch/resource-manager/Microsoft.Batch/stable/2022-10-01/examples/PoolUpdate_RemoveStartTask.json -func ExamplePoolClient_Update_updatePoolRemoveStartTask() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armbatch.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewPoolClient().Update(ctx, "default-azurebatch-japaneast", "sampleacct", "testpool", armbatch.Pool{ - Properties: &armbatch.PoolProperties{ - StartTask: &armbatch.StartTask{}, - }, - }, &armbatch.PoolClientUpdateOptions{IfMatch: 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.Pool = armbatch.Pool{ - // Name: to.Ptr("testpool"), - // Type: to.Ptr("Microsoft.Batch/batchAccounts/pools"), - // Etag: to.Ptr("W/\"0x8D4EDFEBFADF4AB\""), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/default-azurebatch-japaneast/providers/Microsoft.Batch/batchAccounts/sampleacct/pools/testpool"), - // Properties: &armbatch.PoolProperties{ - // AllocationState: to.Ptr(armbatch.AllocationStateResizing), - // AllocationStateTransitionTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-08-29T10:22:55.9407275Z"); return t}()), - // AutoScaleRun: &armbatch.AutoScaleRun{ - // EvaluationTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-08-29T10:22:55.9407275Z"); return t}()), - // Results: to.Ptr("$TargetDedicatedNodes=34;NodeDeallocationOption=requeue"), - // }, - // CreationTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-08-28T10:22:55.9407275Z"); return t}()), - // CurrentDedicatedNodes: to.Ptr[int32](12), - // CurrentLowPriorityNodes: to.Ptr[int32](0), - // DeploymentConfiguration: &armbatch.DeploymentConfiguration{ - // CloudServiceConfiguration: &armbatch.CloudServiceConfiguration{ - // OSFamily: to.Ptr("5"), - // OSVersion: to.Ptr("*"), - // }, - // }, - // InterNodeCommunication: to.Ptr(armbatch.InterNodeCommunicationStateDisabled), - // LastModified: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-08-29T10:22:55.9407275Z"); return t}()), - // ProvisioningState: to.Ptr(armbatch.PoolProvisioningStateSucceeded), - // ProvisioningStateTransitionTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-08-28T10:22:55.9407275Z"); return t}()), - // ResizeOperationStatus: &armbatch.ResizeOperationStatus{ - // NodeDeallocationOption: to.Ptr(armbatch.ComputeNodeDeallocationOptionRequeue), - // ResizeTimeout: to.Ptr("PT15M"), - // StartTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-08-29T10:22:55.9407275Z"); return t}()), - // TargetDedicatedNodes: to.Ptr[int32](34), - // }, - // ScaleSettings: &armbatch.ScaleSettings{ - // AutoScale: &armbatch.AutoScaleSettings{ - // EvaluationInterval: to.Ptr("PT15M"), - // Formula: to.Ptr("$TargetDedicated=34"), - // }, - // }, - // TaskSchedulingPolicy: &armbatch.TaskSchedulingPolicy{ - // NodeFillType: to.Ptr(armbatch.ComputeNodeFillTypeSpread), - // }, - // TaskSlotsPerNode: to.Ptr[int32](1), - // VMSize: to.Ptr("STANDARD_D4"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ef6f2f06858cdbec7684968e1a54c7610da97dbb/specification/batch/resource-manager/Microsoft.Batch/stable/2022-10-01/examples/PoolUpdate_ResizePool.json -func ExamplePoolClient_Update_updatePoolResizePool() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armbatch.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewPoolClient().Update(ctx, "default-azurebatch-japaneast", "sampleacct", "testpool", armbatch.Pool{ - Properties: &armbatch.PoolProperties{ - ScaleSettings: &armbatch.ScaleSettings{ - FixedScale: &armbatch.FixedScaleSettings{ - NodeDeallocationOption: to.Ptr(armbatch.ComputeNodeDeallocationOptionTaskCompletion), - ResizeTimeout: to.Ptr("PT8M"), - TargetDedicatedNodes: to.Ptr[int32](5), - TargetLowPriorityNodes: to.Ptr[int32](0), - }, - }, - }, - }, &armbatch.PoolClientUpdateOptions{IfMatch: 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.Pool = armbatch.Pool{ - // Name: to.Ptr("testpool"), - // Type: to.Ptr("Microsoft.Batch/batchAccounts/pools"), - // Etag: to.Ptr("W/\"0x8D4EDFEBFADF4AB\""), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/default-azurebatch-japaneast/providers/Microsoft.Batch/batchAccounts/sampleacct/pools/testpool"), - // Properties: &armbatch.PoolProperties{ - // AllocationState: to.Ptr(armbatch.AllocationStateResizing), - // AllocationStateTransitionTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-08-29T10:22:55.9407275Z"); return t}()), - // AutoScaleRun: &armbatch.AutoScaleRun{ - // EvaluationTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-08-29T10:22:55.9407275Z"); return t}()), - // Results: to.Ptr("$TargetDedicatedNodes=34;NodeDeallocationOption=requeue"), - // }, - // CreationTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-08-28T10:22:55.9407275Z"); return t}()), - // CurrentDedicatedNodes: to.Ptr[int32](12), - // CurrentLowPriorityNodes: to.Ptr[int32](0), - // DeploymentConfiguration: &armbatch.DeploymentConfiguration{ - // CloudServiceConfiguration: &armbatch.CloudServiceConfiguration{ - // OSFamily: to.Ptr("5"), - // OSVersion: to.Ptr("*"), - // }, - // }, - // InterNodeCommunication: to.Ptr(armbatch.InterNodeCommunicationStateDisabled), - // LastModified: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-08-29T10:22:55.9407275Z"); return t}()), - // ProvisioningState: to.Ptr(armbatch.PoolProvisioningStateSucceeded), - // ProvisioningStateTransitionTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-08-28T10:22:55.9407275Z"); return t}()), - // ResizeOperationStatus: &armbatch.ResizeOperationStatus{ - // NodeDeallocationOption: to.Ptr(armbatch.ComputeNodeDeallocationOptionTaskCompletion), - // ResizeTimeout: to.Ptr("PT8M"), - // StartTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-08-29T10:22:55.9407275Z"); return t}()), - // TargetDedicatedNodes: to.Ptr[int32](8), - // }, - // ScaleSettings: &armbatch.ScaleSettings{ - // FixedScale: &armbatch.FixedScaleSettings{ - // NodeDeallocationOption: to.Ptr(armbatch.ComputeNodeDeallocationOptionTaskCompletion), - // ResizeTimeout: to.Ptr("PT8M"), - // TargetDedicatedNodes: to.Ptr[int32](1), - // TargetLowPriorityNodes: to.Ptr[int32](0), - // }, - // }, - // TaskSchedulingPolicy: &armbatch.TaskSchedulingPolicy{ - // NodeFillType: to.Ptr(armbatch.ComputeNodeFillTypeSpread), - // }, - // TaskSlotsPerNode: to.Ptr[int32](1), - // VMSize: to.Ptr("STANDARD_D4"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ef6f2f06858cdbec7684968e1a54c7610da97dbb/specification/batch/resource-manager/Microsoft.Batch/stable/2022-10-01/examples/PoolDelete.json -func ExamplePoolClient_BeginDelete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armbatch.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewPoolClient().BeginDelete(ctx, "default-azurebatch-japaneast", "sampleacct", "testpool", 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/ef6f2f06858cdbec7684968e1a54c7610da97dbb/specification/batch/resource-manager/Microsoft.Batch/stable/2022-10-01/examples/PoolGet.json -func ExamplePoolClient_Get_getPool() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armbatch.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewPoolClient().Get(ctx, "default-azurebatch-japaneast", "sampleacct", "testpool", 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.Pool = armbatch.Pool{ - // Name: to.Ptr("testpool"), - // Type: to.Ptr("Microsoft.Batch/batchAccounts/pools"), - // Etag: to.Ptr("W/\"0x8D4EDFEBFADF4AB\""), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/default-azurebatch-japaneast/providers/Microsoft.Batch/batchAccounts/sampleacct/pools/testpool"), - // Properties: &armbatch.PoolProperties{ - // AllocationState: to.Ptr(armbatch.AllocationStateResizing), - // AllocationStateTransitionTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-08-28T10:22:55.9407275Z"); return t}()), - // ApplicationLicenses: []*string{ - // to.Ptr("app-license0"), - // to.Ptr("app-license1")}, - // ApplicationPackages: []*armbatch.ApplicationPackageReference{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/default-azurebatch-japaneast/providers/Microsoft.Batch/batchAccounts/sampleacct/pools/testpool/applications/app_1234"), - // Version: to.Ptr("asdf"), - // }}, - // Certificates: []*armbatch.CertificateReference{ - // { - // ID: to.Ptr("/subscriptions/subid/resourceGroups/default-azurebatch-japaneast/providers/Microsoft.Batch/batchAccounts/sampleacct/pools/testpool/certificates/sha1-1234567"), - // StoreLocation: to.Ptr(armbatch.CertificateStoreLocationLocalMachine), - // StoreName: to.Ptr("MY"), - // Visibility: []*armbatch.CertificateVisibility{ - // to.Ptr(armbatch.CertificateVisibilityRemoteUser)}, - // }}, - // CreationTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-08-28T10:22:55.9407275Z"); return t}()), - // CurrentDedicatedNodes: to.Ptr[int32](0), - // CurrentLowPriorityNodes: to.Ptr[int32](0), - // DeploymentConfiguration: &armbatch.DeploymentConfiguration{ - // CloudServiceConfiguration: &armbatch.CloudServiceConfiguration{ - // OSFamily: to.Ptr("4"), - // OSVersion: to.Ptr("WA-GUEST-OS-4.45_201708-01"), - // }, - // }, - // InterNodeCommunication: to.Ptr(armbatch.InterNodeCommunicationStateEnabled), - // LastModified: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-08-28T10:22:55.9407275Z"); return t}()), - // Metadata: []*armbatch.MetadataItem{ - // { - // Name: to.Ptr("metadata-1"), - // Value: to.Ptr("value-1"), - // }, - // { - // Name: to.Ptr("metadata-2"), - // Value: to.Ptr("value-2"), - // }}, - // NetworkConfiguration: &armbatch.NetworkConfiguration{ - // EndpointConfiguration: &armbatch.PoolEndpointConfiguration{ - // InboundNatPools: []*armbatch.InboundNatPool{ - // { - // Name: to.Ptr("testnat"), - // BackendPort: to.Ptr[int32](12001), - // FrontendPortRangeEnd: to.Ptr[int32](15100), - // FrontendPortRangeStart: to.Ptr[int32](15000), - // NetworkSecurityGroupRules: []*armbatch.NetworkSecurityGroupRule{ - // { - // Access: to.Ptr(armbatch.NetworkSecurityGroupRuleAccessAllow), - // Priority: to.Ptr[int32](150), - // SourceAddressPrefix: to.Ptr("192.100.12.45"), - // SourcePortRanges: []*string{ - // to.Ptr("123"), - // to.Ptr("22")}, - // }, - // { - // Access: to.Ptr(armbatch.NetworkSecurityGroupRuleAccessDeny), - // Priority: to.Ptr[int32](3500), - // SourceAddressPrefix: to.Ptr("*"), - // SourcePortRanges: []*string{ - // to.Ptr("*")}, - // }}, - // Protocol: to.Ptr(armbatch.InboundEndpointProtocolTCP), - // }}, - // }, - // SubnetID: to.Ptr("/subscriptions/subid/resourceGroups/rg1234/providers/Microsoft.Network/virtualNetworks/network1234/subnets/subnet123"), - // }, - // ProvisioningState: to.Ptr(armbatch.PoolProvisioningStateSucceeded), - // ProvisioningStateTransitionTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-08-28T10:22:55.9407275Z"); return t}()), - // ResizeOperationStatus: &armbatch.ResizeOperationStatus{ - // NodeDeallocationOption: to.Ptr(armbatch.ComputeNodeDeallocationOptionTaskCompletion), - // ResizeTimeout: to.Ptr("PT8M"), - // StartTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-08-28T10:22:55.9407275Z"); return t}()), - // TargetDedicatedNodes: to.Ptr[int32](6), - // TargetLowPriorityNodes: to.Ptr[int32](28), - // }, - // ScaleSettings: &armbatch.ScaleSettings{ - // FixedScale: &armbatch.FixedScaleSettings{ - // ResizeTimeout: to.Ptr("PT8M"), - // TargetDedicatedNodes: to.Ptr[int32](6), - // TargetLowPriorityNodes: to.Ptr[int32](28), - // }, - // }, - // StartTask: &armbatch.StartTask{ - // CommandLine: to.Ptr("cmd /c SET"), - // EnvironmentSettings: []*armbatch.EnvironmentSetting{ - // { - // Name: to.Ptr("MYSET"), - // Value: to.Ptr("1234"), - // }}, - // MaxTaskRetryCount: to.Ptr[int32](6), - // ResourceFiles: []*armbatch.ResourceFile{ - // { - // FileMode: to.Ptr("777"), - // FilePath: to.Ptr("c:\\temp\\gohere"), - // HTTPURL: to.Ptr("https://testaccount.blob.core.windows.net/example-blob-file"), - // }}, - // UserIdentity: &armbatch.UserIdentity{ - // AutoUser: &armbatch.AutoUserSpecification{ - // ElevationLevel: to.Ptr(armbatch.ElevationLevelAdmin), - // Scope: to.Ptr(armbatch.AutoUserScopePool), - // }, - // }, - // WaitForSuccess: to.Ptr(true), - // }, - // TaskSchedulingPolicy: &armbatch.TaskSchedulingPolicy{ - // NodeFillType: to.Ptr(armbatch.ComputeNodeFillTypePack), - // }, - // TaskSlotsPerNode: to.Ptr[int32](13), - // UserAccounts: []*armbatch.UserAccount{ - // { - // Name: to.Ptr("username1"), - // ElevationLevel: to.Ptr(armbatch.ElevationLevelAdmin), - // LinuxUserConfiguration: &armbatch.LinuxUserConfiguration{ - // Gid: to.Ptr[int32](4567), - // UID: to.Ptr[int32](1234), - // }, - // }}, - // VMSize: to.Ptr("STANDARD_D4"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ef6f2f06858cdbec7684968e1a54c7610da97dbb/specification/batch/resource-manager/Microsoft.Batch/stable/2022-10-01/examples/PoolGet_VirtualMachineConfiguration_Extensions.json -func ExamplePoolClient_Get_getPoolVirtualMachineConfigurationExtensions() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armbatch.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewPoolClient().Get(ctx, "default-azurebatch-japaneast", "sampleacct", "testpool", 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.Pool = armbatch.Pool{ - // Name: to.Ptr("testpool"), - // Type: to.Ptr("Microsoft.Batch/batchAccounts/pools"), - // Etag: to.Ptr("W/\"0x8D4EDFEBFADF4AB\""), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/default-azurebatch-japaneast/providers/Microsoft.Batch/batchAccounts/sampleacct/pools/testpool"), - // Properties: &armbatch.PoolProperties{ - // AllocationState: to.Ptr(armbatch.AllocationStateResizing), - // AllocationStateTransitionTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-08-28T10:22:55.9407275Z"); return t}()), - // CreationTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-08-28T10:22:55.9407275Z"); return t}()), - // CurrentDedicatedNodes: to.Ptr[int32](0), - // CurrentLowPriorityNodes: to.Ptr[int32](0), - // CurrentNodeCommunicationMode: to.Ptr(armbatch.NodeCommunicationModeClassic), - // DeploymentConfiguration: &armbatch.DeploymentConfiguration{ - // VirtualMachineConfiguration: &armbatch.VirtualMachineConfiguration{ - // ImageReference: &armbatch.ImageReference{ - // Offer: to.Ptr("0001-com-ubuntu-server-focal"), - // Publisher: to.Ptr("Canonical"), - // SKU: to.Ptr("20_04-lts"), - // }, - // NodeAgentSKUID: to.Ptr("batch.node.ubuntu 20.04"), - // Extensions: []*armbatch.VMExtension{ - // { - // Name: to.Ptr("batchextension1"), - // Type: to.Ptr("SecurityMonitoringForLinux"), - // AutoUpgradeMinorVersion: to.Ptr(true), - // Publisher: to.Ptr("Microsoft.Azure.Security.Monitoring"), - // Settings: map[string]any{ - // "settingsKey": "settingsValue", - // }, - // TypeHandlerVersion: to.Ptr("1.0"), - // }}, - // }, - // }, - // InterNodeCommunication: to.Ptr(armbatch.InterNodeCommunicationStateEnabled), - // LastModified: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-08-28T10:22:55.9407275Z"); return t}()), - // ProvisioningState: to.Ptr(armbatch.PoolProvisioningStateSucceeded), - // ProvisioningStateTransitionTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-08-28T10:22:55.9407275Z"); return t}()), - // ResizeOperationStatus: &armbatch.ResizeOperationStatus{ - // NodeDeallocationOption: to.Ptr(armbatch.ComputeNodeDeallocationOptionTaskCompletion), - // ResizeTimeout: to.Ptr("PT8M"), - // StartTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-08-28T10:22:55.9407275Z"); return t}()), - // TargetDedicatedNodes: to.Ptr[int32](6), - // TargetLowPriorityNodes: to.Ptr[int32](28), - // }, - // ScaleSettings: &armbatch.ScaleSettings{ - // FixedScale: &armbatch.FixedScaleSettings{ - // ResizeTimeout: to.Ptr("PT8M"), - // TargetDedicatedNodes: to.Ptr[int32](6), - // TargetLowPriorityNodes: to.Ptr[int32](28), - // }, - // }, - // TargetNodeCommunicationMode: to.Ptr(armbatch.NodeCommunicationModeDefault), - // TaskSchedulingPolicy: &armbatch.TaskSchedulingPolicy{ - // NodeFillType: to.Ptr(armbatch.ComputeNodeFillTypePack), - // }, - // TaskSlotsPerNode: to.Ptr[int32](13), - // VMSize: to.Ptr("STANDARD_D4"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ef6f2f06858cdbec7684968e1a54c7610da97dbb/specification/batch/resource-manager/Microsoft.Batch/stable/2022-10-01/examples/PoolDisableAutoScale.json -func ExamplePoolClient_DisableAutoScale() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armbatch.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewPoolClient().DisableAutoScale(ctx, "default-azurebatch-japaneast", "sampleacct", "testpool", 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.Pool = armbatch.Pool{ - // Name: to.Ptr("testpool"), - // Type: to.Ptr("Microsoft.Batch/batchAccounts/pools"), - // Etag: to.Ptr("W/\"0x8D4EDFEBFADF4AB\""), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/default-azurebatch-japaneast/providers/Microsoft.Batch/batchAccounts/sampleacct/pools/testpool"), - // Properties: &armbatch.PoolProperties{ - // AllocationState: to.Ptr(armbatch.AllocationStateResizing), - // AllocationStateTransitionTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-08-28T10:22:55.9407275Z"); return t}()), - // CreationTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-08-28T10:22:55.9407275Z"); return t}()), - // CurrentDedicatedNodes: to.Ptr[int32](0), - // CurrentLowPriorityNodes: to.Ptr[int32](0), - // DeploymentConfiguration: &armbatch.DeploymentConfiguration{ - // VirtualMachineConfiguration: &armbatch.VirtualMachineConfiguration{ - // ImageReference: &armbatch.ImageReference{ - // Offer: to.Ptr("UbuntuServer"), - // Publisher: to.Ptr("Canonical"), - // SKU: to.Ptr("18.04-LTS"), - // Version: to.Ptr("latest"), - // }, - // NodeAgentSKUID: to.Ptr("batch.node.ubuntu 18.04"), - // }, - // }, - // InterNodeCommunication: to.Ptr(armbatch.InterNodeCommunicationStateDisabled), - // LastModified: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-08-28T10:22:55.9407275Z"); return t}()), - // ProvisioningState: to.Ptr(armbatch.PoolProvisioningStateSucceeded), - // ProvisioningStateTransitionTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-08-28T10:22:55.9407275Z"); return t}()), - // ScaleSettings: &armbatch.ScaleSettings{ - // FixedScale: &armbatch.FixedScaleSettings{ - // ResizeTimeout: to.Ptr("PT15M"), - // TargetDedicatedNodes: to.Ptr[int32](3), - // TargetLowPriorityNodes: to.Ptr[int32](0), - // }, - // }, - // TaskSchedulingPolicy: &armbatch.TaskSchedulingPolicy{ - // NodeFillType: to.Ptr(armbatch.ComputeNodeFillTypeSpread), - // }, - // TaskSlotsPerNode: to.Ptr[int32](1), - // VMSize: to.Ptr("STANDARD_D4"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ef6f2f06858cdbec7684968e1a54c7610da97dbb/specification/batch/resource-manager/Microsoft.Batch/stable/2022-10-01/examples/PoolStopResize.json -func ExamplePoolClient_StopResize() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armbatch.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewPoolClient().StopResize(ctx, "default-azurebatch-japaneast", "sampleacct", "testpool", 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.Pool = armbatch.Pool{ - // Name: to.Ptr("testpool"), - // Type: to.Ptr("Microsoft.Batch/batchAccounts/pools"), - // Etag: to.Ptr("W/\"0x8D4EDFEBFADF4AB\""), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/default-azurebatch-japaneast/providers/Microsoft.Batch/batchAccounts/sampleacct/pools/testpool"), - // Properties: &armbatch.PoolProperties{ - // AllocationState: to.Ptr(armbatch.AllocationStateSteady), - // AllocationStateTransitionTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-08-28T10:22:55.9407275Z"); return t}()), - // CreationTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-08-28T10:22:55.9407275Z"); return t}()), - // CurrentDedicatedNodes: to.Ptr[int32](0), - // CurrentLowPriorityNodes: to.Ptr[int32](0), - // DeploymentConfiguration: &armbatch.DeploymentConfiguration{ - // VirtualMachineConfiguration: &armbatch.VirtualMachineConfiguration{ - // ImageReference: &armbatch.ImageReference{ - // Offer: to.Ptr("UbuntuServer"), - // Publisher: to.Ptr("Canonical"), - // SKU: to.Ptr("18.04-LTS"), - // Version: to.Ptr("latest"), - // }, - // NodeAgentSKUID: to.Ptr("batch.node.ubuntu 18.04"), - // }, - // }, - // InterNodeCommunication: to.Ptr(armbatch.InterNodeCommunicationStateDisabled), - // LastModified: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-08-28T10:22:55.9407275Z"); return t}()), - // ProvisioningState: to.Ptr(armbatch.PoolProvisioningStateSucceeded), - // ProvisioningStateTransitionTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-08-28T10:22:55.9407275Z"); return t}()), - // ResizeOperationStatus: &armbatch.ResizeOperationStatus{ - // NodeDeallocationOption: to.Ptr(armbatch.ComputeNodeDeallocationOptionRequeue), - // ResizeTimeout: to.Ptr("PT10M"), - // StartTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-08-28T10:22:55.9407275Z"); return t}()), - // TargetDedicatedNodes: to.Ptr[int32](1), - // }, - // ScaleSettings: &armbatch.ScaleSettings{ - // FixedScale: &armbatch.FixedScaleSettings{ - // ResizeTimeout: to.Ptr("PT15M"), - // TargetDedicatedNodes: to.Ptr[int32](3), - // TargetLowPriorityNodes: to.Ptr[int32](0), - // }, - // }, - // TaskSchedulingPolicy: &armbatch.TaskSchedulingPolicy{ - // NodeFillType: to.Ptr(armbatch.ComputeNodeFillTypeSpread), - // }, - // TaskSlotsPerNode: to.Ptr[int32](1), - // VMSize: to.Ptr("STANDARD_D4"), - // }, - // } -} diff --git a/sdk/resourcemanager/batch/armbatch/privateendpointconnection_client.go b/sdk/resourcemanager/batch/armbatch/privateendpointconnection_client.go index 86dc82f761cd..7ac7b4123fac 100644 --- a/sdk/resourcemanager/batch/armbatch/privateendpointconnection_client.go +++ b/sdk/resourcemanager/batch/armbatch/privateendpointconnection_client.go @@ -48,7 +48,7 @@ func NewPrivateEndpointConnectionClient(subscriptionID string, credential azcore // BeginDelete - Deletes the specified private endpoint connection. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-10-01 +// Generated from API version 2023-05-01 // - resourceGroupName - The name of the resource group that contains the Batch account. // - accountName - The name of the Batch account. // - privateEndpointConnectionName - The private endpoint connection name. This must be unique within the account. @@ -71,7 +71,7 @@ func (client *PrivateEndpointConnectionClient) BeginDelete(ctx context.Context, // Delete - Deletes the specified private endpoint connection. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-10-01 +// Generated from API version 2023-05-01 func (client *PrivateEndpointConnectionClient) deleteOperation(ctx context.Context, resourceGroupName string, accountName string, privateEndpointConnectionName string, options *PrivateEndpointConnectionClientBeginDeleteOptions) (*http.Response, error) { req, err := client.deleteCreateRequest(ctx, resourceGroupName, accountName, privateEndpointConnectionName, options) if err != nil { @@ -111,7 +111,7 @@ func (client *PrivateEndpointConnectionClient) deleteCreateRequest(ctx context.C return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-10-01") + reqQP.Set("api-version", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -120,7 +120,7 @@ func (client *PrivateEndpointConnectionClient) deleteCreateRequest(ctx context.C // Get - Gets information about the specified private endpoint connection. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-10-01 +// Generated from API version 2023-05-01 // - resourceGroupName - The name of the resource group that contains the Batch account. // - accountName - The name of the Batch account. // - privateEndpointConnectionName - The private endpoint connection name. This must be unique within the account. @@ -165,7 +165,7 @@ func (client *PrivateEndpointConnectionClient) getCreateRequest(ctx context.Cont return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-10-01") + reqQP.Set("api-version", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -182,7 +182,7 @@ func (client *PrivateEndpointConnectionClient) getHandleResponse(resp *http.Resp // NewListByBatchAccountPager - Lists all of the private endpoint connections in the specified account. // -// Generated from API version 2022-10-01 +// Generated from API version 2023-05-01 // - resourceGroupName - The name of the resource group that contains the Batch account. // - accountName - The name of the Batch account. // - options - PrivateEndpointConnectionClientListByBatchAccountOptions contains the optional parameters for the PrivateEndpointConnectionClient.NewListByBatchAccountPager @@ -235,7 +235,7 @@ func (client *PrivateEndpointConnectionClient) listByBatchAccountCreateRequest(c return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-10-01") + reqQP.Set("api-version", "2023-05-01") if options != nil && options.Maxresults != nil { reqQP.Set("maxresults", strconv.FormatInt(int64(*options.Maxresults), 10)) } @@ -256,7 +256,7 @@ func (client *PrivateEndpointConnectionClient) listByBatchAccountHandleResponse( // BeginUpdate - Updates the properties of an existing private endpoint connection. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-10-01 +// Generated from API version 2023-05-01 // - resourceGroupName - The name of the resource group that contains the Batch account. // - accountName - The name of the Batch account. // - privateEndpointConnectionName - The private endpoint connection name. This must be unique within the account. @@ -281,7 +281,7 @@ func (client *PrivateEndpointConnectionClient) BeginUpdate(ctx context.Context, // Update - Updates the properties of an existing private endpoint connection. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-10-01 +// Generated from API version 2023-05-01 func (client *PrivateEndpointConnectionClient) update(ctx context.Context, resourceGroupName string, accountName string, privateEndpointConnectionName string, parameters PrivateEndpointConnection, options *PrivateEndpointConnectionClientBeginUpdateOptions) (*http.Response, error) { req, err := client.updateCreateRequest(ctx, resourceGroupName, accountName, privateEndpointConnectionName, parameters, options) if err != nil { @@ -321,7 +321,7 @@ func (client *PrivateEndpointConnectionClient) updateCreateRequest(ctx context.C return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-10-01") + reqQP.Set("api-version", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() if options != nil && options.IfMatch != nil { req.Raw().Header["If-Match"] = []string{*options.IfMatch} diff --git a/sdk/resourcemanager/batch/armbatch/privateendpointconnection_client_example_test.go b/sdk/resourcemanager/batch/armbatch/privateendpointconnection_client_example_test.go deleted file mode 100644 index 2543a4c11144..000000000000 --- a/sdk/resourcemanager/batch/armbatch/privateendpointconnection_client_example_test.go +++ /dev/null @@ -1,171 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armbatch_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/batch/armbatch" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ef6f2f06858cdbec7684968e1a54c7610da97dbb/specification/batch/resource-manager/Microsoft.Batch/stable/2022-10-01/examples/PrivateEndpointConnectionsList.json -func ExamplePrivateEndpointConnectionClient_NewListByBatchAccountPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armbatch.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewPrivateEndpointConnectionClient().NewListByBatchAccountPager("default-azurebatch-japaneast", "sampleacct", &armbatch.PrivateEndpointConnectionClientListByBatchAccountOptions{Maxresults: 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.ListPrivateEndpointConnectionsResult = armbatch.ListPrivateEndpointConnectionsResult{ - // Value: []*armbatch.PrivateEndpointConnection{ - // { - // Name: to.Ptr("testprivateEndpointConnection"), - // Type: to.Ptr("Microsoft.Batch/batchAccounts/privateEndpointConnections"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/default-azurebatch-japaneast/providers/Microsoft.Batch/batchAccounts/sampleacct/privateEndpointConnections/testprivateEndpointConnection"), - // Properties: &armbatch.PrivateEndpointConnectionProperties{ - // GroupIDs: []*string{ - // to.Ptr("batchAccount")}, - // PrivateEndpoint: &armbatch.PrivateEndpoint{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/default-azurebatch-japaneast/providers/Microsoft.Network/privateEndpoints/testprivateEndpoint"), - // }, - // PrivateLinkServiceConnectionState: &armbatch.PrivateLinkServiceConnectionState{ - // Description: to.Ptr("Approved by xyz.abc@company.com"), - // Status: to.Ptr(armbatch.PrivateLinkServiceConnectionStatusApproved), - // }, - // ProvisioningState: to.Ptr(armbatch.PrivateEndpointConnectionProvisioningStateSucceeded), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ef6f2f06858cdbec7684968e1a54c7610da97dbb/specification/batch/resource-manager/Microsoft.Batch/stable/2022-10-01/examples/PrivateEndpointConnectionGet.json -func ExamplePrivateEndpointConnectionClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armbatch.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewPrivateEndpointConnectionClient().Get(ctx, "default-azurebatch-japaneast", "sampleacct", "testprivateEndpointConnection5testprivateEndpointConnection5.24d6b4b5-e65c-4330-bbe9-3a290d62f8e0", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.PrivateEndpointConnection = armbatch.PrivateEndpointConnection{ - // Name: to.Ptr("testprivateEndpointConnection5testprivateEndpointConnection5.24d6b4b5-e65c-4330-bbe9-3a290d62f8e0"), - // Type: to.Ptr("Microsoft.Batch/batchAccounts/privateEndpointConnections"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/default-azurebatch-japaneast/providers/Microsoft.Batch/batchAccounts/sampleacct/privateEndpointConnections/testprivateEndpointConnection5testprivateEndpointConnection5.24d6b4b5-e65c-4330-bbe9-3a290d62f8e0"), - // Properties: &armbatch.PrivateEndpointConnectionProperties{ - // GroupIDs: []*string{ - // to.Ptr("batchAccount")}, - // PrivateEndpoint: &armbatch.PrivateEndpoint{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/default-azurebatch-japaneast/providers/Microsoft.Network/privateEndpoints/testprivateEndpoint"), - // }, - // PrivateLinkServiceConnectionState: &armbatch.PrivateLinkServiceConnectionState{ - // Description: to.Ptr("Approved by xyz.abc@company.com"), - // Status: to.Ptr(armbatch.PrivateLinkServiceConnectionStatusApproved), - // }, - // ProvisioningState: to.Ptr(armbatch.PrivateEndpointConnectionProvisioningStateSucceeded), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ef6f2f06858cdbec7684968e1a54c7610da97dbb/specification/batch/resource-manager/Microsoft.Batch/stable/2022-10-01/examples/PrivateEndpointConnectionUpdate.json -func ExamplePrivateEndpointConnectionClient_BeginUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armbatch.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewPrivateEndpointConnectionClient().BeginUpdate(ctx, "default-azurebatch-japaneast", "sampleacct", "testprivateEndpointConnection5.24d6b4b5-e65c-4330-bbe9-3a290d62f8e0", armbatch.PrivateEndpointConnection{ - Properties: &armbatch.PrivateEndpointConnectionProperties{ - PrivateLinkServiceConnectionState: &armbatch.PrivateLinkServiceConnectionState{ - Description: to.Ptr("Approved by xyz.abc@company.com"), - Status: to.Ptr(armbatch.PrivateLinkServiceConnectionStatusApproved), - }, - }, - }, &armbatch.PrivateEndpointConnectionClientBeginUpdateOptions{IfMatch: nil}) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.PrivateEndpointConnection = armbatch.PrivateEndpointConnection{ - // Name: to.Ptr("testprivateEndpointConnection5.24d6b4b5-e65c-4330-bbe9-3a290d62f8e0"), - // Type: to.Ptr("Microsoft.Batch/batchAccounts/privateEndpointConnections"), - // Etag: to.Ptr("W/\"0x8D4EDFEBFADF4AB\""), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/default-azurebatch-japaneast/providers/Microsoft.Batch/batchAccounts/sampleacct/privateEndpointConnections/testprivateEndpointConnection5.24d6b4b5-e65c-4330-bbe9-3a290d62f8e0"), - // Properties: &armbatch.PrivateEndpointConnectionProperties{ - // GroupIDs: []*string{ - // to.Ptr("batchAccount")}, - // PrivateEndpoint: &armbatch.PrivateEndpoint{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/default-azurebatch-japaneast/providers/Microsoft.Network/privateEndpoints/testprivateEndpoint"), - // }, - // PrivateLinkServiceConnectionState: &armbatch.PrivateLinkServiceConnectionState{ - // Description: to.Ptr("Approved by xyz.abc@company.com"), - // Status: to.Ptr(armbatch.PrivateLinkServiceConnectionStatusApproved), - // }, - // ProvisioningState: to.Ptr(armbatch.PrivateEndpointConnectionProvisioningStateSucceeded), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ef6f2f06858cdbec7684968e1a54c7610da97dbb/specification/batch/resource-manager/Microsoft.Batch/stable/2022-10-01/examples/PrivateEndpointConnectionDelete.json -func ExamplePrivateEndpointConnectionClient_BeginDelete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armbatch.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewPrivateEndpointConnectionClient().BeginDelete(ctx, "default-azurebatch-japaneast", "sampleacct", "testprivateEndpointConnection5testprivateEndpointConnection5.24d6b4b5-e65c-4330-bbe9-3a290d62f8e0", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} diff --git a/sdk/resourcemanager/batch/armbatch/privatelinkresource_client.go b/sdk/resourcemanager/batch/armbatch/privatelinkresource_client.go index ae6cb1f6a99a..7f319fce521e 100644 --- a/sdk/resourcemanager/batch/armbatch/privatelinkresource_client.go +++ b/sdk/resourcemanager/batch/armbatch/privatelinkresource_client.go @@ -48,7 +48,7 @@ func NewPrivateLinkResourceClient(subscriptionID string, credential azcore.Token // Get - Gets information about the specified private link resource. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-10-01 +// Generated from API version 2023-05-01 // - resourceGroupName - The name of the resource group that contains the Batch account. // - accountName - The name of the Batch account. // - privateLinkResourceName - The private link resource name. This must be unique within the account. @@ -92,7 +92,7 @@ func (client *PrivateLinkResourceClient) getCreateRequest(ctx context.Context, r return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-10-01") + reqQP.Set("api-version", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -109,7 +109,7 @@ func (client *PrivateLinkResourceClient) getHandleResponse(resp *http.Response) // NewListByBatchAccountPager - Lists all of the private link resources in the specified account. // -// Generated from API version 2022-10-01 +// Generated from API version 2023-05-01 // - resourceGroupName - The name of the resource group that contains the Batch account. // - accountName - The name of the Batch account. // - options - PrivateLinkResourceClientListByBatchAccountOptions contains the optional parameters for the PrivateLinkResourceClient.NewListByBatchAccountPager @@ -162,7 +162,7 @@ func (client *PrivateLinkResourceClient) listByBatchAccountCreateRequest(ctx con return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-10-01") + reqQP.Set("api-version", "2023-05-01") if options != nil && options.Maxresults != nil { reqQP.Set("maxresults", strconv.FormatInt(int64(*options.Maxresults), 10)) } diff --git a/sdk/resourcemanager/batch/armbatch/privatelinkresource_client_example_test.go b/sdk/resourcemanager/batch/armbatch/privatelinkresource_client_example_test.go deleted file mode 100644 index 6e8b65291449..000000000000 --- a/sdk/resourcemanager/batch/armbatch/privatelinkresource_client_example_test.go +++ /dev/null @@ -1,90 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armbatch_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/batch/armbatch" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ef6f2f06858cdbec7684968e1a54c7610da97dbb/specification/batch/resource-manager/Microsoft.Batch/stable/2022-10-01/examples/PrivateLinkResourcesList.json -func ExamplePrivateLinkResourceClient_NewListByBatchAccountPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armbatch.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewPrivateLinkResourceClient().NewListByBatchAccountPager("default-azurebatch-japaneast", "sampleacct", &armbatch.PrivateLinkResourceClientListByBatchAccountOptions{Maxresults: 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.ListPrivateLinkResourcesResult = armbatch.ListPrivateLinkResourcesResult{ - // Value: []*armbatch.PrivateLinkResource{ - // { - // Name: to.Ptr("batchAccount"), - // Type: to.Ptr("Microsoft.Batch/batchAccounts/privateLinkResources"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/default-azurebatch-japaneast/providers/Microsoft.Batch/batchAccounts/sampleacct/privateLinkResources/batchAccount"), - // Properties: &armbatch.PrivateLinkResourceProperties{ - // GroupID: to.Ptr("batchAccount"), - // RequiredMembers: []*string{ - // to.Ptr("batchAccount")}, - // RequiredZoneNames: []*string{ - // to.Ptr("privatelink.japaneast.batch.azure.com")}, - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ef6f2f06858cdbec7684968e1a54c7610da97dbb/specification/batch/resource-manager/Microsoft.Batch/stable/2022-10-01/examples/PrivateLinkResourceGet.json -func ExamplePrivateLinkResourceClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armbatch.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewPrivateLinkResourceClient().Get(ctx, "default-azurebatch-japaneast", "sampleacct", "batchAccount", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.PrivateLinkResource = armbatch.PrivateLinkResource{ - // Name: to.Ptr("sampleacct"), - // Type: to.Ptr("Microsoft.Batch/batchAccounts/privateLinkResources"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/default-azurebatch-japaneast/providers/Microsoft.Batch/batchAccounts/sampleacct/privateLinkResources/batchAccount"), - // Properties: &armbatch.PrivateLinkResourceProperties{ - // GroupID: to.Ptr("batchAccount"), - // RequiredMembers: []*string{ - // to.Ptr("batchAccount")}, - // RequiredZoneNames: []*string{ - // to.Ptr("privatelink.japaneast.batch.azure.com")}, - // }, - // } -}