diff --git a/sdk/batch/arm-batch/LICENSE.txt b/sdk/batch/arm-batch/LICENSE.txt index a70e8cf66038..b73b4a1293c3 100644 --- a/sdk/batch/arm-batch/LICENSE.txt +++ b/sdk/batch/arm-batch/LICENSE.txt @@ -1,6 +1,6 @@ The MIT License (MIT) -Copyright (c) 2018 Microsoft +Copyright (c) 2019 Microsoft Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/sdk/batch/arm-batch/README.md b/sdk/batch/arm-batch/README.md index f8f35af21f2a..19fb781039fd 100644 --- a/sdk/batch/arm-batch/README.md +++ b/sdk/batch/arm-batch/README.md @@ -9,7 +9,7 @@ This package contains an isomorphic SDK for BatchManagementClient. ### How to Install -``` +```bash npm install @azure/arm-batch ``` @@ -19,13 +19,13 @@ npm install @azure/arm-batch ##### Install @azure/ms-rest-nodeauth -``` +```bash npm install @azure/ms-rest-nodeauth ``` ##### Sample code -```ts +```typescript import * as msRest from "@azure/ms-rest-js"; import * as msRestAzure from "@azure/ms-rest-azure-js"; import * as msRestNodeAuth from "@azure/ms-rest-nodeauth"; @@ -49,7 +49,7 @@ msRestNodeAuth.interactiveLogin().then((creds) => { ##### Install @azure/ms-rest-browserauth -``` +```bash npm install @azure/ms-rest-browserauth ``` @@ -98,6 +98,3 @@ See https://github.com/Azure/ms-rest-browserauth to learn how to authenticate to ## Related projects - [Microsoft Azure SDK for Javascript](https://github.com/Azure/azure-sdk-for-js) - - -![Impressions](https://azure-sdk-impressions.azurewebsites.net/api/impressions/azure-sdk-for-js/sdk/batch/arm-batch/README.png) diff --git a/sdk/batch/arm-batch/lib/batchManagementClient.ts b/sdk/batch/arm-batch/lib/batchManagementClient.ts new file mode 100644 index 000000000000..b921e4ae2937 --- /dev/null +++ b/sdk/batch/arm-batch/lib/batchManagementClient.ts @@ -0,0 +1,55 @@ +/* + * 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. + */ + +import * as msRest from "@azure/ms-rest-js"; +import * as Models from "./models"; +import * as Mappers from "./models/mappers"; +import * as operations from "./operations"; +import { BatchManagementClientContext } from "./batchManagementClientContext"; + + +class BatchManagementClient extends BatchManagementClientContext { + // Operation groups + batchAccount: operations.BatchAccountOperations; + applicationPackage: operations.ApplicationPackageOperations; + application: operations.ApplicationOperations; + location: operations.Location; + operations: operations.Operations; + certificate: operations.CertificateOperations; + pool: operations.PoolOperations; + + /** + * Initializes a new instance of the BatchManagementClient class. + * @param credentials Credentials needed for the client to connect to Azure. + * @param subscriptionId The Azure subscription ID. This is a GUID-formatted string (e.g. + * 00000000-0000-0000-0000-000000000000) + * @param [options] The parameter options + */ + constructor(credentials: msRest.ServiceClientCredentials, subscriptionId: string, options?: Models.BatchManagementClientOptions) { + super(credentials, subscriptionId, options); + this.batchAccount = new operations.BatchAccountOperations(this); + this.applicationPackage = new operations.ApplicationPackageOperations(this); + this.application = new operations.ApplicationOperations(this); + this.location = new operations.Location(this); + this.operations = new operations.Operations(this); + this.certificate = new operations.CertificateOperations(this); + this.pool = new operations.PoolOperations(this); + } +} + +// Operation Specifications + +export { + BatchManagementClient, + BatchManagementClientContext, + Models as BatchManagementModels, + Mappers as BatchManagementMappers +}; +export * from "./operations"; diff --git a/sdk/batch/arm-batch/lib/batchManagementClientContext.ts b/sdk/batch/arm-batch/lib/batchManagementClientContext.ts new file mode 100644 index 000000000000..4fc3db50e532 --- /dev/null +++ b/sdk/batch/arm-batch/lib/batchManagementClientContext.ts @@ -0,0 +1,63 @@ +/* + * 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. + */ + +import * as Models from "./models"; +import * as msRest from "@azure/ms-rest-js"; +import * as msRestAzure from "@azure/ms-rest-azure-js"; + +const packageName = "@azure/arm-batch"; +const packageVersion = "4.0.0"; + +export class BatchManagementClientContext extends msRestAzure.AzureServiceClient { + credentials: msRest.ServiceClientCredentials; + subscriptionId: string; + apiVersion?: string; + + /** + * Initializes a new instance of the BatchManagementClient class. + * @param credentials Credentials needed for the client to connect to Azure. + * @param subscriptionId The Azure subscription ID. This is a GUID-formatted string (e.g. + * 00000000-0000-0000-0000-000000000000) + * @param [options] The parameter options + */ + constructor(credentials: msRest.ServiceClientCredentials, subscriptionId: string, options?: Models.BatchManagementClientOptions) { + if (credentials == undefined) { + throw new Error('\'credentials\' cannot be null.'); + } + if (subscriptionId == undefined) { + throw new Error('\'subscriptionId\' cannot be null.'); + } + + if (!options) { + options = {}; + } + if(!options.userAgent) { + const defaultUserAgent = msRestAzure.getDefaultUserAgentValue(); + options.userAgent = `${packageName}/${packageVersion} ${defaultUserAgent}`; + } + + super(credentials, options); + + this.apiVersion = '2019-04-01'; + this.acceptLanguage = 'en-US'; + this.longRunningOperationRetryTimeout = 30; + this.baseUri = options.baseUri || this.baseUri || "https://management.azure.com"; + this.requestContentType = "application/json; charset=utf-8"; + this.credentials = credentials; + this.subscriptionId = subscriptionId; + + if(options.acceptLanguage !== null && options.acceptLanguage !== undefined) { + this.acceptLanguage = options.acceptLanguage; + } + if(options.longRunningOperationRetryTimeout !== null && options.longRunningOperationRetryTimeout !== undefined) { + this.longRunningOperationRetryTimeout = options.longRunningOperationRetryTimeout; + } + } +} diff --git a/sdk/batch/arm-batch/lib/models/applicationOperationsMappers.ts b/sdk/batch/arm-batch/lib/models/applicationOperationsMappers.ts new file mode 100644 index 000000000000..7d7712089cdf --- /dev/null +++ b/sdk/batch/arm-batch/lib/models/applicationOperationsMappers.ts @@ -0,0 +1,61 @@ +/* + * 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. + */ + +export { + Application, + ProxyResource, + BaseResource, + CloudError, + ListApplicationsResult, + ApplicationPackage, + Resource, + Certificate, + DeleteCertificateError, + CertificateCreateOrUpdateParameters, + Pool, + DeploymentConfiguration, + CloudServiceConfiguration, + VirtualMachineConfiguration, + ImageReference, + WindowsConfiguration, + DataDisk, + ContainerConfiguration, + ContainerRegistry, + ScaleSettings, + FixedScaleSettings, + AutoScaleSettings, + AutoScaleRun, + AutoScaleRunError, + NetworkConfiguration, + PoolEndpointConfiguration, + InboundNatPool, + NetworkSecurityGroupRule, + TaskSchedulingPolicy, + UserAccount, + LinuxUserConfiguration, + WindowsUserConfiguration, + MetadataItem, + StartTask, + ResourceFile, + EnvironmentSetting, + UserIdentity, + AutoUserSpecification, + TaskContainerSettings, + CertificateReference, + ApplicationPackageReference, + ResizeOperationStatus, + ResizeError, + BatchAccount, + KeyVaultReference, + AutoStorageProperties, + AutoStorageBaseProperties, + VirtualMachineFamilyCoreQuota +} from "../models/mappers"; + diff --git a/sdk/batch/arm-batch/lib/models/applicationPackageOperationsMappers.ts b/sdk/batch/arm-batch/lib/models/applicationPackageOperationsMappers.ts new file mode 100644 index 000000000000..c74e4f3a8c75 --- /dev/null +++ b/sdk/batch/arm-batch/lib/models/applicationPackageOperationsMappers.ts @@ -0,0 +1,62 @@ +/* + * 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. + */ + +export { + ActivateApplicationPackageParameters, + ApplicationPackage, + ProxyResource, + BaseResource, + CloudError, + ListApplicationPackagesResult, + Application, + Resource, + Certificate, + DeleteCertificateError, + CertificateCreateOrUpdateParameters, + Pool, + DeploymentConfiguration, + CloudServiceConfiguration, + VirtualMachineConfiguration, + ImageReference, + WindowsConfiguration, + DataDisk, + ContainerConfiguration, + ContainerRegistry, + ScaleSettings, + FixedScaleSettings, + AutoScaleSettings, + AutoScaleRun, + AutoScaleRunError, + NetworkConfiguration, + PoolEndpointConfiguration, + InboundNatPool, + NetworkSecurityGroupRule, + TaskSchedulingPolicy, + UserAccount, + LinuxUserConfiguration, + WindowsUserConfiguration, + MetadataItem, + StartTask, + ResourceFile, + EnvironmentSetting, + UserIdentity, + AutoUserSpecification, + TaskContainerSettings, + CertificateReference, + ApplicationPackageReference, + ResizeOperationStatus, + ResizeError, + BatchAccount, + KeyVaultReference, + AutoStorageProperties, + AutoStorageBaseProperties, + VirtualMachineFamilyCoreQuota +} from "../models/mappers"; + diff --git a/sdk/batch/arm-batch/lib/models/batchAccountOperationsMappers.ts b/sdk/batch/arm-batch/lib/models/batchAccountOperationsMappers.ts new file mode 100644 index 000000000000..cbcae31536ad --- /dev/null +++ b/sdk/batch/arm-batch/lib/models/batchAccountOperationsMappers.ts @@ -0,0 +1,67 @@ +/* + * 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. + */ + +export { + BatchAccountCreateParameters, + AutoStorageBaseProperties, + KeyVaultReference, + BatchAccount, + Resource, + BaseResource, + AutoStorageProperties, + VirtualMachineFamilyCoreQuota, + BatchAccountCreateHeaders, + CloudError, + BatchAccountUpdateParameters, + BatchAccountDeleteHeaders, + BatchAccountListResult, + BatchAccountRegenerateKeyParameters, + BatchAccountKeys, + ProxyResource, + Certificate, + DeleteCertificateError, + CertificateCreateOrUpdateParameters, + Pool, + DeploymentConfiguration, + CloudServiceConfiguration, + VirtualMachineConfiguration, + ImageReference, + WindowsConfiguration, + DataDisk, + ContainerConfiguration, + ContainerRegistry, + ScaleSettings, + FixedScaleSettings, + AutoScaleSettings, + AutoScaleRun, + AutoScaleRunError, + NetworkConfiguration, + PoolEndpointConfiguration, + InboundNatPool, + NetworkSecurityGroupRule, + TaskSchedulingPolicy, + UserAccount, + LinuxUserConfiguration, + WindowsUserConfiguration, + MetadataItem, + StartTask, + ResourceFile, + EnvironmentSetting, + UserIdentity, + AutoUserSpecification, + TaskContainerSettings, + CertificateReference, + ApplicationPackageReference, + ResizeOperationStatus, + ResizeError, + Application, + ApplicationPackage +} from "../models/mappers"; + diff --git a/sdk/batch/arm-batch/lib/models/certificateOperationsMappers.ts b/sdk/batch/arm-batch/lib/models/certificateOperationsMappers.ts new file mode 100644 index 000000000000..30548b4b44f3 --- /dev/null +++ b/sdk/batch/arm-batch/lib/models/certificateOperationsMappers.ts @@ -0,0 +1,66 @@ +/* + * 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. + */ + +export { + ListCertificatesResult, + Certificate, + ProxyResource, + BaseResource, + DeleteCertificateError, + CloudError, + CertificateCreateOrUpdateParameters, + CertificateCreateHeaders, + CertificateUpdateHeaders, + CertificateDeleteHeaders, + CertificateGetHeaders, + CertificateCancelDeletionHeaders, + Application, + ApplicationPackage, + Resource, + Pool, + DeploymentConfiguration, + CloudServiceConfiguration, + VirtualMachineConfiguration, + ImageReference, + WindowsConfiguration, + DataDisk, + ContainerConfiguration, + ContainerRegistry, + ScaleSettings, + FixedScaleSettings, + AutoScaleSettings, + AutoScaleRun, + AutoScaleRunError, + NetworkConfiguration, + PoolEndpointConfiguration, + InboundNatPool, + NetworkSecurityGroupRule, + TaskSchedulingPolicy, + UserAccount, + LinuxUserConfiguration, + WindowsUserConfiguration, + MetadataItem, + StartTask, + ResourceFile, + EnvironmentSetting, + UserIdentity, + AutoUserSpecification, + TaskContainerSettings, + CertificateReference, + ApplicationPackageReference, + ResizeOperationStatus, + ResizeError, + BatchAccount, + KeyVaultReference, + AutoStorageProperties, + AutoStorageBaseProperties, + VirtualMachineFamilyCoreQuota +} from "../models/mappers"; + diff --git a/sdk/batch/arm-batch/lib/models/index.ts b/sdk/batch/arm-batch/lib/models/index.ts new file mode 100644 index 000000000000..8239e26c61ef --- /dev/null +++ b/sdk/batch/arm-batch/lib/models/index.ts @@ -0,0 +1,3451 @@ +/* + * 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. + */ + +import { BaseResource, CloudError, AzureServiceClientOptions } from "@azure/ms-rest-azure-js"; +import * as msRest from "@azure/ms-rest-js"; + +export { BaseResource, CloudError }; + + +/** + * @interface + * An interface representing AutoStorageBaseProperties. + * The properties related to the auto-storage account. + * + */ +export interface AutoStorageBaseProperties { + /** + * @member {string} storageAccountId The resource ID of the storage account + * to be used for auto-storage account. + */ + storageAccountId: string; +} + +/** + * @interface + * An interface representing KeyVaultReference. + * Identifies the Azure key vault associated with a Batch account. + * + */ +export interface KeyVaultReference { + /** + * @member {string} id The resource ID of the Azure key vault associated with + * the Batch account. + */ + id: string; + /** + * @member {string} url The URL of the Azure key vault associated with the + * Batch account. + */ + url: string; +} + +/** + * @interface + * An interface representing BatchAccountCreateParameters. + * Parameters supplied to the Create operation. + * + */ +export interface BatchAccountCreateParameters { + /** + * @member {string} location The region in which to create the account. + */ + location: string; + /** + * @member {{ [propertyName: string]: string }} [tags] The user-specified + * tags associated with the account. + */ + tags?: { [propertyName: string]: string }; + /** + * @member {AutoStorageBaseProperties} [autoStorage] The properties related + * to the auto-storage account. + */ + autoStorage?: AutoStorageBaseProperties; + /** + * @member {PoolAllocationMode} [poolAllocationMode] The allocation mode to + * use for creating pools in the Batch account. The pool allocation mode also + * affects how clients may authenticate to the Batch Service API. If the mode + * is BatchService, clients may authenticate using access keys or Azure + * Active Directory. If the mode is UserSubscription, clients must use Azure + * Active Directory. The default is BatchService. Possible values include: + * 'BatchService', 'UserSubscription' + */ + poolAllocationMode?: PoolAllocationMode; + /** + * @member {KeyVaultReference} [keyVaultReference] A reference to the Azure + * key vault associated with the Batch account. + */ + keyVaultReference?: KeyVaultReference; +} + +/** + * @interface + * An interface representing AutoStorageProperties. + * Contains information about the auto-storage account associated with a Batch + * account. + * + * @extends AutoStorageBaseProperties + */ +export interface AutoStorageProperties extends AutoStorageBaseProperties { + /** + * @member {Date} lastKeySync The UTC time at which storage keys were last + * synchronized with the Batch account. + */ + lastKeySync: Date; +} + +/** + * @interface + * An interface representing VirtualMachineFamilyCoreQuota. + * A VM Family and its associated core quota for the Batch account. + * + */ +export interface VirtualMachineFamilyCoreQuota { + /** + * @member {string} [name] The Virtual Machine family name. + * **NOTE: This property will not be serialized. It can only be populated by + * the server.** + */ + readonly name?: string; + /** + * @member {number} [coreQuota] The core quota for the VM family for the + * Batch account. + * **NOTE: This property will not be serialized. It can only be populated by + * the server.** + */ + readonly coreQuota?: number; +} + +/** + * @interface + * An interface representing Resource. + * A definition of an Azure resource. + * + * @extends BaseResource + */ +export interface Resource extends BaseResource { + /** + * @member {string} [id] The ID of the resource. + * **NOTE: This property will not be serialized. It can only be populated by + * the server.** + */ + readonly id?: string; + /** + * @member {string} [name] The name of the resource. + * **NOTE: This property will not be serialized. It can only be populated by + * the server.** + */ + readonly name?: string; + /** + * @member {string} [type] The type of the resource. + * **NOTE: This property will not be serialized. It can only be populated by + * the server.** + */ + readonly type?: string; + /** + * @member {string} [location] The location of the resource. + * **NOTE: This property will not be serialized. It can only be populated by + * the server.** + */ + readonly location?: string; + /** + * @member {{ [propertyName: string]: string }} [tags] The tags of the + * resource. + * **NOTE: This property will not be serialized. It can only be populated by + * the server.** + */ + readonly tags?: { [propertyName: string]: string }; +} + +/** + * @interface + * An interface representing BatchAccount. + * Contains information about an Azure Batch account. + * + * @extends Resource + */ +export interface BatchAccount extends Resource { + /** + * @member {string} [accountEndpoint] The account endpoint used to interact + * with the Batch service. + * **NOTE: This property will not be serialized. It can only be populated by + * the server.** + */ + readonly accountEndpoint?: string; + /** + * @member {ProvisioningState} [provisioningState] The provisioned state of + * the resource. Possible values include: 'Invalid', 'Creating', 'Deleting', + * 'Succeeded', 'Failed', 'Cancelled' + * **NOTE: This property will not be serialized. It can only be populated by + * the server.** + */ + readonly provisioningState?: ProvisioningState; + /** + * @member {PoolAllocationMode} [poolAllocationMode] The allocation mode to + * use for creating pools in the Batch account. Possible values include: + * 'BatchService', 'UserSubscription' + * **NOTE: This property will not be serialized. It can only be populated by + * the server.** + */ + readonly poolAllocationMode?: PoolAllocationMode; + /** + * @member {KeyVaultReference} [keyVaultReference] A reference to the Azure + * key vault associated with the Batch account. **NOTE: This property will + * not be serialized. It can only be populated by the server.** + */ + readonly keyVaultReference?: KeyVaultReference; + /** + * @member {AutoStorageProperties} [autoStorage] The properties and status of + * any auto-storage account associated with the Batch account. **NOTE: This + * property will not be serialized. It can only be populated by the server.** + */ + readonly autoStorage?: AutoStorageProperties; + /** + * @member {number} [dedicatedCoreQuota] The dedicated core quota for the + * Batch account. For accounts with PoolAllocationMode set to + * UserSubscription, quota is managed on the subscription so this value is + * not returned. + * **NOTE: This property will not be serialized. It can only be populated by + * the server.** + */ + readonly dedicatedCoreQuota?: number; + /** + * @member {number} [lowPriorityCoreQuota] The low-priority core quota for + * the Batch account. For accounts with PoolAllocationMode set to + * UserSubscription, quota is managed on the subscription so this value is + * not returned. + * **NOTE: This property will not be serialized. It can only be populated by + * the server.** + */ + readonly lowPriorityCoreQuota?: number; + /** + * @member {VirtualMachineFamilyCoreQuota[]} [dedicatedCoreQuotaPerVMFamily] + * A list of the dedicated core quota per Virtual Machine family for the + * Batch account. For accounts with PoolAllocationMode set to + * UserSubscription, quota is managed on the subscription so this value is + * not returned. + * **NOTE: This property will not be serialized. It can only be populated by + * the server.** + */ + readonly dedicatedCoreQuotaPerVMFamily?: VirtualMachineFamilyCoreQuota[]; + /** + * @member {boolean} [dedicatedCoreQuotaPerVMFamilyEnforced] A value + * indicating whether the core quota for the Batch Account is enforced per + * Virtual Machine family or not. Batch is transitioning its core quota + * system for dedicated cores to be enforced per Virtual Machine family. + * During this transitional phase, the dedicated core quota per Virtual + * Machine family may not yet be enforced. If this flag is false, dedicated + * core quota is enforced via the old dedicatedCoreQuota property on the + * account and does not consider Virtual Machine family. If this flag is + * true, dedicated core quota is enforced via the + * dedicatedCoreQuotaPerVMFamily property on the account, and the old + * dedicatedCoreQuota does not apply. + * **NOTE: This property will not be serialized. It can only be populated by + * the server.** + */ + readonly dedicatedCoreQuotaPerVMFamilyEnforced?: boolean; + /** + * @member {number} [poolQuota] The pool quota for the Batch account. **NOTE: + * This property will not be serialized. It can only be populated by the + * server.** + */ + readonly poolQuota?: number; + /** + * @member {number} [activeJobAndJobScheduleQuota] The active job and job + * schedule quota for the Batch account. **NOTE: This property will not be + * serialized. It can only be populated by the server.** + */ + readonly activeJobAndJobScheduleQuota?: number; +} + +/** + * @interface + * An interface representing BatchAccountUpdateParameters. + * Parameters for updating an Azure Batch account. + * + */ +export interface BatchAccountUpdateParameters { + /** + * @member {{ [propertyName: string]: string }} [tags] The user-specified + * tags associated with the account. + */ + tags?: { [propertyName: string]: string }; + /** + * @member {AutoStorageBaseProperties} [autoStorage] The properties related + * to the auto-storage account. + */ + autoStorage?: AutoStorageBaseProperties; +} + +/** + * @interface + * An interface representing BatchAccountRegenerateKeyParameters. + * Parameters supplied to the RegenerateKey operation. + * + */ +export interface BatchAccountRegenerateKeyParameters { + /** + * @member {AccountKeyType} keyName The type of account key to regenerate. + * Possible values include: 'Primary', 'Secondary' + */ + keyName: AccountKeyType; +} + +/** + * @interface + * An interface representing BatchAccountKeys. + * A set of Azure Batch account keys. + * + */ +export interface BatchAccountKeys { + /** + * @member {string} [accountName] The Batch account name. + * **NOTE: This property will not be serialized. It can only be populated by + * the server.** + */ + readonly accountName?: string; + /** + * @member {string} [primary] The primary key associated with the account. + * **NOTE: This property will not be serialized. It can only be populated by + * the server.** + */ + readonly primary?: string; + /** + * @member {string} [secondary] The secondary key associated with the + * account. + * **NOTE: This property will not be serialized. It can only be populated by + * the server.** + */ + readonly secondary?: string; +} + +/** + * @interface + * An interface representing ActivateApplicationPackageParameters. + * Parameters for an activating an application package. + * + */ +export interface ActivateApplicationPackageParameters { + /** + * @member {string} format The format of the application package binary file. + */ + format: string; +} + +/** + * @interface + * An interface representing ProxyResource. + * A definition of an Azure resource. + * + * @extends BaseResource + */ +export interface ProxyResource extends BaseResource { + /** + * @member {string} [id] The ID of the resource. + * **NOTE: This property will not be serialized. It can only be populated by + * the server.** + */ + readonly id?: string; + /** + * @member {string} [name] The name of the resource. + * **NOTE: This property will not be serialized. It can only be populated by + * the server.** + */ + readonly name?: string; + /** + * @member {string} [type] The type of the resource. + * **NOTE: This property will not be serialized. It can only be populated by + * the server.** + */ + readonly type?: string; + /** + * @member {string} [etag] The ETag of the resource, used for concurrency + * statements. + * **NOTE: This property will not be serialized. It can only be populated by + * the server.** + */ + readonly etag?: string; +} + +/** + * @interface + * An interface representing Application. + * Contains information about an application in a Batch account. + * + * @extends ProxyResource + */ +export interface Application extends ProxyResource { + /** + * @member {string} [displayName] The display name for the application. + */ + displayName?: string; + /** + * @member {boolean} [allowUpdates] A value indicating whether packages + * within the application may be overwritten using the same version string. + */ + allowUpdates?: boolean; + /** + * @member {string} [defaultVersion] The package to use if a client requests + * the application but does not specify a version. This property can only be + * set to the name of an existing package. + */ + defaultVersion?: string; +} + +/** + * @interface + * An interface representing ApplicationPackage. + * An application package which represents a particular version of an + * application. + * + * @extends ProxyResource + */ +export interface ApplicationPackage extends ProxyResource { + /** + * @member {PackageState} [state] The current state of the application + * package. Possible values include: 'Pending', 'Active' + * **NOTE: This property will not be serialized. It can only be populated by + * the server.** + */ + readonly state?: PackageState; + /** + * @member {string} [format] The format of the application package, if the + * package is active. + * **NOTE: This property will not be serialized. It can only be populated by + * the server.** + */ + readonly format?: string; + /** + * @member {string} [storageUrl] The URL for the application package in Azure + * Storage. + * **NOTE: This property will not be serialized. It can only be populated by + * the server.** + */ + readonly storageUrl?: string; + /** + * @member {Date} [storageUrlExpiry] The UTC time at which the Azure Storage + * URL will expire. + * **NOTE: This property will not be serialized. It can only be populated by + * the server.** + */ + readonly storageUrlExpiry?: Date; + /** + * @member {Date} [lastActivationTime] The time at which the package was last + * activated, if the package is active. + * **NOTE: This property will not be serialized. It can only be populated by + * the server.** + */ + readonly lastActivationTime?: Date; +} + +/** + * @interface + * An interface representing BatchLocationQuota. + * Quotas associated with a Batch region for a particular subscription. + * + */ +export interface BatchLocationQuota { + /** + * @member {number} [accountQuota] The number of Batch accounts that may be + * created under the subscription in the specified region. + * **NOTE: This property will not be serialized. It can only be populated by + * the server.** + */ + readonly accountQuota?: number; +} + +/** + * @interface + * An interface representing CertificateBaseProperties. + */ +export interface CertificateBaseProperties { + /** + * @member {string} [thumbprintAlgorithm] The algorithm of the certificate + * thumbprint. This must match the first portion of the certificate name. + * Currently required to be 'SHA1'. + */ + thumbprintAlgorithm?: string; + /** + * @member {string} [thumbprint] The thumbprint of the certificate. This must + * match the thumbprint from the name. + */ + thumbprint?: string; + /** + * @member {CertificateFormat} [format] The format of the certificate - + * either Pfx or Cer. If omitted, the default is Pfx. Possible values + * include: 'Pfx', 'Cer' + */ + format?: CertificateFormat; +} + +/** + * @interface + * An interface representing DeleteCertificateError. + * An error response from the Batch service. + * + */ +export interface DeleteCertificateError { + /** + * @member {string} code An identifier for the error. Codes are invariant and + * are intended to be consumed programmatically. + */ + code: string; + /** + * @member {string} message A message describing the error, intended to be + * suitable for display in a user interface. + */ + message: string; + /** + * @member {string} [target] The target of the particular error. For example, + * the name of the property in error. + */ + target?: string; + /** + * @member {DeleteCertificateError[]} [details] A list of additional details + * about the error. + */ + details?: DeleteCertificateError[]; +} + +/** + * @interface + * An interface representing Certificate. + * Contains information about a certificate. + * + * @extends ProxyResource + */ +export interface Certificate extends ProxyResource { + /** + * @member {string} [thumbprintAlgorithm] The algorithm of the certificate + * thumbprint. This must match the first portion of the certificate name. + * Currently required to be 'SHA1'. + */ + thumbprintAlgorithm?: string; + /** + * @member {string} [thumbprint] The thumbprint of the certificate. This must + * match the thumbprint from the name. + */ + thumbprint?: string; + /** + * @member {CertificateFormat} [format] The format of the certificate - + * either Pfx or Cer. If omitted, the default is Pfx. Possible values + * include: 'Pfx', 'Cer' + */ + format?: CertificateFormat; + /** + * @member {CertificateProvisioningState} [provisioningState] The provisioned + * state of the resource. Possible values include: 'Succeeded', 'Deleting', + * 'Failed' + * **NOTE: This property will not be serialized. It can only be populated by + * the server.** + */ + readonly provisioningState?: CertificateProvisioningState; + /** + * @member {Date} [provisioningStateTransitionTime] The time at which the + * certificate entered its current state. **NOTE: This property will not be + * serialized. It can only be populated by the server.** + */ + readonly provisioningStateTransitionTime?: Date; + /** + * @member {CertificateProvisioningState} [previousProvisioningState] The + * previous provisioned state of the resource. Possible values include: + * 'Succeeded', 'Deleting', 'Failed' + * **NOTE: This property will not be serialized. It can only be populated by + * the server.** + */ + readonly previousProvisioningState?: CertificateProvisioningState; + /** + * @member {Date} [previousProvisioningStateTransitionTime] The time at which + * the certificate entered its previous state. **NOTE: This property will not + * be serialized. It can only be populated by the server.** + */ + readonly previousProvisioningStateTransitionTime?: Date; + /** + * @member {string} [publicData] The public key of the certificate. + * **NOTE: This property will not be serialized. It can only be populated by + * the server.** + */ + readonly publicData?: string; + /** + * @member {DeleteCertificateError} [deleteCertificateError] The error which + * occurred while deleting the certificate. This is only returned when the + * certificate provisioningState is 'Failed'. + * **NOTE: This property will not be serialized. It can only be populated by + * the server.** + */ + readonly deleteCertificateError?: DeleteCertificateError; +} + +/** + * @interface + * An interface representing CertificateCreateOrUpdateParameters. + * Contains information about a certificate. + * + * @extends ProxyResource + */ +export interface CertificateCreateOrUpdateParameters extends ProxyResource { + /** + * @member {string} [thumbprintAlgorithm] The algorithm of the certificate + * thumbprint. This must match the first portion of the certificate name. + * Currently required to be 'SHA1'. + */ + thumbprintAlgorithm?: string; + /** + * @member {string} [thumbprint] The thumbprint of the certificate. This must + * match the thumbprint from the name. + */ + thumbprint?: string; + /** + * @member {CertificateFormat} [format] The format of the certificate - + * either Pfx or Cer. If omitted, the default is Pfx. Possible values + * include: 'Pfx', 'Cer' + */ + format?: CertificateFormat; + /** + * @member {string} data The base64-encoded contents of the certificate. The + * maximum size is 10KB. + */ + data: string; + /** + * @member {string} [password] The password to access the certificate's + * private key. This is required if the certificate format is pfx and must be + * omitted if the certificate format is cer. + */ + password?: string; +} + +/** + * @interface + * An interface representing CloudServiceConfiguration. + * @summary The configuration for nodes in a pool based on the Azure Cloud + * Services platform. + * + */ +export interface CloudServiceConfiguration { + /** + * @member {string} osFamily The Azure Guest OS family to be installed on the + * virtual machines in the pool. Possible values are: 2 - OS Family 2, + * equivalent to Windows Server 2008 R2 SP1. 3 - OS Family 3, equivalent to + * Windows Server 2012. 4 - OS Family 4, equivalent to Windows Server 2012 + * R2. 5 - OS Family 5, equivalent to Windows Server 2016. 6 - OS Family 6, + * equivalent to Windows Server 2019. For more information, see Azure Guest + * OS Releases + * (https://azure.microsoft.com/documentation/articles/cloud-services-guestos-update-matrix/#releases). + */ + osFamily: string; + /** + * @member {string} [osVersion] The Azure Guest OS version to be installed on + * the virtual machines in the pool. The default value is * which specifies + * the latest operating system version for the specified OS family. + */ + osVersion?: string; +} + +/** + * @interface + * An interface representing ImageReference. + * @summary A reference to an Azure Virtual Machines Marketplace image or the + * Azure Image resource of a custom Virtual Machine. To get the list of all + * imageReferences verified by Azure Batch, see the 'List supported node agent + * SKUs' operation. + * + */ +export interface ImageReference { + /** + * @member {string} [publisher] The publisher of the Azure Virtual Machines + * Marketplace image. For example, Canonical or MicrosoftWindowsServer. + */ + publisher?: string; + /** + * @member {string} [offer] The offer type of the Azure Virtual Machines + * Marketplace image. For example, UbuntuServer or WindowsServer. + */ + offer?: string; + /** + * @member {string} [sku] The SKU of the Azure Virtual Machines Marketplace + * image. For example, 14.04.0-LTS or 2012-R2-Datacenter. + */ + sku?: string; + /** + * @member {string} [version] The version of the Azure Virtual Machines + * Marketplace image. A value of 'latest' can be specified to select the + * latest version of an image. If omitted, the default is 'latest'. + */ + version?: string; + /** + * @member {string} [id] The ARM resource identifier of the virtual machine + * image. Computes nodes of the pool will be created using this custom image. + * This is of the form + * /subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.Compute/images/{imageName}. + * This property is mutually exclusive with other properties. The virtual + * machine image must be in the same region and subscription as the Azure + * Batch account. For information about the firewall settings for Batch node + * agent to communicate with Batch service see + * https://docs.microsoft.com/en-us/azure/batch/batch-api-basics#virtual-network-vnet-and-firewall-configuration + * . + */ + id?: string; +} + +/** + * @interface + * An interface representing WindowsConfiguration. + * @summary Windows operating system settings to apply to the virtual machine. + * + */ +export interface WindowsConfiguration { + /** + * @member {boolean} [enableAutomaticUpdates] Whether automatic updates are + * enabled on the virtual machine. If omitted, the default value is true. + */ + enableAutomaticUpdates?: boolean; +} + +/** + * @interface + * An interface representing DataDisk. + * Data Disk settings which will be used by the data disks associated to + * Compute Nodes in the pool. + * + */ +export interface DataDisk { + /** + * @member {number} lun The logical unit number. The lun is used to uniquely + * identify each data disk. If attaching multiple disks, each should have a + * distinct lun. + */ + lun: number; + /** + * @member {CachingType} [caching] The type of caching to be enabled for the + * data disks. Values are: + * + * none - The caching mode for the disk is not enabled. + * readOnly - The caching mode for the disk is read only. + * readWrite - The caching mode for the disk is read and write. + * + * The default value for caching is none. For information about the caching + * options see: + * https://blogs.msdn.microsoft.com/windowsazurestorage/2012/06/27/exploring-windows-azure-drives-disks-and-images/. + * Possible values include: 'None', 'ReadOnly', 'ReadWrite' + */ + caching?: CachingType; + /** + * @member {number} diskSizeGB The initial disk size in GB when creating new + * data disk. + */ + diskSizeGB: number; + /** + * @member {StorageAccountType} [storageAccountType] The storage account type + * to be used for the data disk. If omitted, the default is "Standard_LRS". + * Values are: + * + * Standard_LRS - The data disk should use standard locally redundant + * storage. + * Premium_LRS - The data disk should use premium locally redundant storage. + * Possible values include: 'Standard_LRS', 'Premium_LRS' + */ + storageAccountType?: StorageAccountType; +} + +/** + * @interface + * An interface representing ContainerRegistry. + * @summary A private container registry. + * + */ +export interface ContainerRegistry { + /** + * @member {string} [registryServer] The registry URL. If omitted, the + * default is "docker.io". + */ + registryServer?: string; + /** + * @member {string} userName The user name to log into the registry server. + */ + userName: string; + /** + * @member {string} password The password to log into the registry server. + */ + password: string; +} + +/** + * @interface + * An interface representing ContainerConfiguration. + * @summary The configuration for container-enabled pools. + * + */ +export interface ContainerConfiguration { + /** + * @member {string[]} [containerImageNames] The collection of container image + * names. 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. + */ + containerImageNames?: string[]; + /** + * @member {ContainerRegistry[]} [containerRegistries] Additional private + * registries from which containers can be pulled. If any images must be + * downloaded from a private registry which requires credentials, then those + * credentials must be provided here. + */ + containerRegistries?: ContainerRegistry[]; +} + +/** + * @interface + * An interface representing VirtualMachineConfiguration. + * @summary The configuration for compute nodes in a pool based on the Azure + * Virtual Machines infrastructure. + * + */ +export interface VirtualMachineConfiguration { + /** + * @member {ImageReference} imageReference A reference to the Azure Virtual + * Machines Marketplace Image or the custom Virtual Machine Image to use. + */ + imageReference: ImageReference; + /** + * @member {string} nodeAgentSkuId The SKU of the Batch node agent to be + * provisioned on compute nodes in the pool. The Batch node agent is a + * program that runs on each node in the pool, and provides the + * command-and-control interface between the node and the Batch service. + * There are different implementations of the node agent, known as SKUs, for + * different operating systems. You must specify a node agent SKU which + * matches the selected image reference. To get the list of supported node + * agent SKUs along with their list of verified image references, see the + * 'List supported node agent SKUs' operation. + */ + nodeAgentSkuId: string; + /** + * @member {WindowsConfiguration} [windowsConfiguration] Windows operating + * system settings on the virtual machine. This property must not be + * specified if the imageReference specifies a Linux OS image. + */ + windowsConfiguration?: WindowsConfiguration; + /** + * @member {DataDisk[]} [dataDisks] The configuration for data disks attached + * to the compute nodes in the pool. This property must be specified if the + * compute nodes in the pool need to have empty data disks attached to them. + */ + dataDisks?: DataDisk[]; + /** + * @member {string} [licenseType] The type of on-premises license to be used + * when deploying the operating system. This only applies to images that + * contain the Windows operating system, and should only be used when you + * hold valid on-premises licenses for the nodes which will be deployed. If + * omitted, no on-premises licensing discount is applied. Values are: + * + * Windows_Server - The on-premises license is for Windows Server. + * Windows_Client - The on-premises license is for Windows Client. + */ + licenseType?: string; + /** + * @member {ContainerConfiguration} [containerConfiguration] The container + * configuration for the pool. If specified, setup is performed on each node + * in the pool to allow tasks to run in containers. All regular tasks and job + * manager tasks run on this pool must specify the containerSettings + * property, and all other tasks may specify it. + */ + containerConfiguration?: ContainerConfiguration; +} + +/** + * @interface + * An interface representing DeploymentConfiguration. + * @summary Deployment configuration properties. + * + */ +export interface DeploymentConfiguration { + /** + * @member {CloudServiceConfiguration} [cloudServiceConfiguration] The cloud + * service configuration for the pool. This property and + * virtualMachineConfiguration are mutually exclusive and one of the + * properties must be specified. This property cannot be specified if the + * Batch account was created with its poolAllocationMode property set to + * 'UserSubscription'. + */ + cloudServiceConfiguration?: CloudServiceConfiguration; + /** + * @member {VirtualMachineConfiguration} [virtualMachineConfiguration] The + * virtual machine configuration for the pool. This property and + * cloudServiceConfiguration are mutually exclusive and one of the properties + * must be specified. + */ + virtualMachineConfiguration?: VirtualMachineConfiguration; +} + +/** + * @interface + * An interface representing FixedScaleSettings. + * @summary Fixed scale settings for the pool. + * + */ +export interface FixedScaleSettings { + /** + * @member {string} [resizeTimeout] The timeout for allocation of compute + * nodes to the pool. The default value is 15 minutes. Timeout values use ISO + * 8601 format. For example, use PT10M for 10 minutes. The minimum value is 5 + * minutes. If you specify a value less than 5 minutes, the Batch service + * rejects the request with an error; if you are calling the REST API + * directly, the HTTP status code is 400 (Bad Request). + */ + resizeTimeout?: string; + /** + * @member {number} [targetDedicatedNodes] The desired number of dedicated + * compute nodes in the pool. At least one of targetDedicatedNodes, + * targetLowPriority nodes must be set. + */ + targetDedicatedNodes?: number; + /** + * @member {number} [targetLowPriorityNodes] The desired number of + * low-priority compute nodes in the pool. At least one of + * targetDedicatedNodes, targetLowPriority nodes must be set. + */ + targetLowPriorityNodes?: number; + /** + * @member {ComputeNodeDeallocationOption} [nodeDeallocationOption] + * Determines what to do with a node and its running task(s) if the pool size + * is decreasing. If omitted, the default value is Requeue. Possible values + * include: 'Requeue', 'Terminate', 'TaskCompletion', 'RetainedData' + */ + nodeDeallocationOption?: ComputeNodeDeallocationOption; +} + +/** + * @interface + * An interface representing AutoScaleSettings. + * @summary AutoScale settings for the pool. + * + */ +export interface AutoScaleSettings { + /** + * @member {string} formula A formula for the desired number of compute nodes + * in the pool. + */ + formula: string; + /** + * @member {string} [evaluationInterval] The time interval at which to + * automatically adjust the pool size according to the autoscale formula. If + * omitted, the default value is 15 minutes (PT15M). + */ + evaluationInterval?: string; +} + +/** + * @interface + * An interface representing ScaleSettings. + * @summary Scale settings for the pool + * + * Defines the desired size of the pool. This can either be 'fixedScale' where + * the requested targetDedicatedNodes is specified, or 'autoScale' which + * defines a formula which is periodically reevaluated. If this property is not + * specified, the pool will have a fixed scale with 0 targetDedicatedNodes. + * + */ +export interface ScaleSettings { + /** + * @member {FixedScaleSettings} [fixedScale] Fixed scale settings for the + * pool. This property and autoScale are mutually exclusive and one of the + * properties must be specified. + */ + fixedScale?: FixedScaleSettings; + /** + * @member {AutoScaleSettings} [autoScale] AutoScale settings for the pool. + * This property and fixedScale are mutually exclusive and one of the + * properties must be specified. + */ + autoScale?: AutoScaleSettings; +} + +/** + * @interface + * An interface representing AutoScaleRunError. + * @summary An error that occurred when autoscaling a pool. + * + */ +export interface AutoScaleRunError { + /** + * @member {string} code An identifier for the error. Codes are invariant and + * are intended to be consumed programmatically. + */ + code: string; + /** + * @member {string} message A message describing the error, intended to be + * suitable for display in a user interface. + */ + message: string; + /** + * @member {AutoScaleRunError[]} [details] Additional details about the + * error. + */ + details?: AutoScaleRunError[]; +} + +/** + * @interface + * An interface representing AutoScaleRun. + * @summary The results and errors from an execution of a pool autoscale + * formula. + * + */ +export interface AutoScaleRun { + /** + * @member {Date} evaluationTime The time at which the autoscale formula was + * last evaluated. + */ + evaluationTime: Date; + /** + * @member {string} [results] The final values of all variables used in the + * evaluation of the autoscale formula. Each variable value is returned in + * the form $variable=value, and variables are separated by semicolons. + */ + results?: string; + /** + * @member {AutoScaleRunError} [error] Details of the error encountered + * evaluating the autoscale formula on the pool, if the evaluation was + * unsuccessful. + */ + error?: AutoScaleRunError; +} + +/** + * @interface + * An interface representing NetworkSecurityGroupRule. + * @summary A network security group rule to apply to an inbound endpoint. + * + */ +export interface NetworkSecurityGroupRule { + /** + * @member {number} priority The priority for this rule. Priorities within a + * pool must be unique and are evaluated in order of priority. The lower the + * number the higher the priority. For example, rules could be specified with + * order numbers of 150, 250, and 350. The rule with the order number of 150 + * takes precedence over the rule that has an order of 250. Allowed + * priorities are 150 to 3500. If any reserved or duplicate values are + * provided the request fails with HTTP status code 400. + */ + priority: number; + /** + * @member {NetworkSecurityGroupRuleAccess} access The action that should be + * taken for a specified IP address, subnet range or tag. Possible values + * include: 'Allow', 'Deny' + */ + access: NetworkSecurityGroupRuleAccess; + /** + * @member {string} sourceAddressPrefix The source address prefix or tag to + * match for the rule. Valid values are a single IP address (i.e. + * 10.10.10.10), IP subnet (i.e. 192.168.1.0/24), default tag, or * (for all + * addresses). If any other values are provided the request fails with HTTP + * status code 400. + */ + sourceAddressPrefix: string; +} + +/** + * @interface + * An interface representing InboundNatPool. + * @summary A inbound NAT pool that can be used to address specific ports on + * compute nodes in a Batch pool externally. + * + */ +export interface InboundNatPool { + /** + * @member {string} name The name of the endpoint. The name must be unique + * within a Batch pool, can contain letters, numbers, underscores, periods, + * and hyphens. Names must start with a letter or number, must end with a + * letter, number, or underscore, and cannot exceed 77 characters. If any + * invalid values are provided the request fails with HTTP status code 400. + */ + name: string; + /** + * @member {InboundEndpointProtocol} protocol The protocol of the endpoint. + * Possible values include: 'TCP', 'UDP' + */ + protocol: InboundEndpointProtocol; + /** + * @member {number} backendPort The port number on the compute node. This + * must be unique within a Batch pool. Acceptable values are between 1 and + * 65535 except for 22, 3389, 29876 and 29877 as these are reserved. If any + * reserved values are provided the request fails with HTTP status code 400. + */ + backendPort: number; + /** + * @member {number} frontendPortRangeStart The first port number in the range + * of external ports that will be used to provide inbound access to the + * backendPort on individual compute nodes. Acceptable values range between 1 + * and 65534 except ports from 50000 to 55000 which are reserved. All ranges + * within a pool must be distinct and cannot overlap. If any reserved or + * overlapping values are provided the request fails with HTTP status code + * 400. + */ + frontendPortRangeStart: number; + /** + * @member {number} frontendPortRangeEnd The last port number in the range of + * external ports that will be used to provide inbound access to the + * backendPort on individual compute nodes. Acceptable values range between 1 + * and 65534 except ports from 50000 to 55000 which are reserved by the Batch + * service. All ranges within a pool must be distinct and cannot overlap. If + * any reserved or overlapping values are provided the request fails with + * HTTP status code 400. + */ + frontendPortRangeEnd: number; + /** + * @member {NetworkSecurityGroupRule[]} [networkSecurityGroupRules] A list of + * network security group rules that will be applied to the endpoint. The + * maximum number of rules that can be specified across all the endpoints on + * a Batch pool is 25. If no network security group rules are specified, a + * default rule will be created to allow inbound access to the specified + * backendPort. If the maximum number of network security group rules is + * exceeded the request fails with HTTP status code 400. + */ + networkSecurityGroupRules?: NetworkSecurityGroupRule[]; +} + +/** + * @interface + * An interface representing PoolEndpointConfiguration. + * @summary The endpoint configuration for a pool. + * + */ +export interface PoolEndpointConfiguration { + /** + * @member {InboundNatPool[]} inboundNatPools A list of inbound NAT pools + * that can be used to address specific ports on an individual compute node + * externally. The maximum number of inbound NAT pools per Batch pool is 5. + * If the maximum number of inbound NAT pools is exceeded the request fails + * with HTTP status code 400. + */ + inboundNatPools: InboundNatPool[]; +} + +/** + * @interface + * An interface representing NetworkConfiguration. + * The network configuration for a pool. + * + */ +export interface NetworkConfiguration { + /** + * @member {string} [subnetId] The ARM resource identifier of the virtual + * network subnet which the compute nodes of the pool will join. This is of + * the form + * /subscriptions/{subscription}/resourceGroups/{group}/providers/{provider}/virtualNetworks/{network}/subnets/{subnet}. + * The virtual network must be in the same region and subscription as the + * Azure Batch account. The specified subnet should have enough free IP + * addresses to accommodate the number of nodes in the pool. If the subnet + * doesn't have enough free IP addresses, the pool will partially allocate + * compute nodes, and a resize error will occur. The 'MicrosoftAzureBatch' + * service principal must have the 'Classic Virtual Machine Contributor' + * Role-Based Access Control (RBAC) role for the specified VNet. The + * specified subnet must allow communication from the Azure Batch service to + * be able to schedule tasks on the compute nodes. This can be verified by + * checking if the specified VNet has any associated Network Security Groups + * (NSG). If communication to the compute nodes in the specified subnet is + * denied by an NSG, then the Batch service will set the state of the compute + * nodes to unusable. For pools created via virtualMachineConfiguration the + * Batch account must have poolAllocationMode userSubscription in order to + * use a VNet. If the specified VNet has any associated Network Security + * Groups (NSG), then a few reserved system ports must be enabled for inbound + * communication. For pools created with a virtual machine configuration, + * enable ports 29876 and 29877, as well as port 22 for Linux and port 3389 + * for Windows. For pools created with a cloud service configuration, enable + * ports 10100, 20100, and 30100. Also enable outbound connections to Azure + * Storage on port 443. For more details see: + * https://docs.microsoft.com/en-us/azure/batch/batch-api-basics#virtual-network-vnet-and-firewall-configuration + */ + subnetId?: string; + /** + * @member {PoolEndpointConfiguration} [endpointConfiguration] The + * configuration for endpoints on compute nodes in the Batch pool. Pool + * endpoint configuration is only supported on pools with the + * virtualMachineConfiguration property. + */ + endpointConfiguration?: PoolEndpointConfiguration; +} + +/** + * @interface + * An interface representing TaskSchedulingPolicy. + * @summary Specifies how tasks should be distributed across compute nodes. + * + */ +export interface TaskSchedulingPolicy { + /** + * @member {ComputeNodeFillType} nodeFillType How tasks should be distributed + * across compute nodes. Possible values include: 'Spread', 'Pack' + */ + nodeFillType: ComputeNodeFillType; +} + +/** + * @interface + * An interface representing LinuxUserConfiguration. + * @summary Properties used to create a user account on a Linux node. + * + */ +export interface LinuxUserConfiguration { + /** + * @member {number} [uid] The user ID of the user account. The uid and gid + * properties must be specified together or not at all. If not specified the + * underlying operating system picks the uid. + */ + uid?: number; + /** + * @member {number} [gid] The group ID for the user account. The uid and gid + * properties must be specified together or not at all. If not specified the + * underlying operating system picks the gid. + */ + gid?: number; + /** + * @member {string} [sshPrivateKey] The SSH private key for the user account. + * The private key must not be password protected. The private key is used to + * automatically configure asymmetric-key based authentication for SSH + * between nodes in a Linux pool when the pool's enableInterNodeCommunication + * property is true (it is ignored if enableInterNodeCommunication is false). + * It does this by placing the key pair into the user's .ssh directory. If + * not specified, password-less SSH is not configured between nodes (no + * modification of the user's .ssh directory is done). + */ + sshPrivateKey?: string; +} + +/** + * @interface + * An interface representing WindowsUserConfiguration. + * @summary Properties used to create a user account on a Windows node. + * + */ +export interface WindowsUserConfiguration { + /** + * @member {LoginMode} [loginMode] Login mode for user. Specifies login mode + * for the user. The default value for VirtualMachineConfiguration pools is + * interactive mode and for CloudServiceConfiguration pools is batch mode. + * Possible values include: 'Batch', 'Interactive' + */ + loginMode?: LoginMode; +} + +/** + * @interface + * An interface representing UserAccount. + * @summary Properties used to create a user on an Azure Batch node. + * + */ +export interface UserAccount { + /** + * @member {string} name The name of the user account. + */ + name: string; + /** + * @member {string} password The password for the user account. + */ + password: string; + /** + * @member {ElevationLevel} [elevationLevel] The elevation level of the user + * account. nonAdmin - The auto user is a standard user without elevated + * access. admin - The auto user is a user with elevated access and operates + * with full Administrator permissions. The default value is nonAdmin. + * Possible values include: 'NonAdmin', 'Admin' + */ + elevationLevel?: ElevationLevel; + /** + * @member {LinuxUserConfiguration} [linuxUserConfiguration] The + * Linux-specific user configuration for the user account. This property is + * ignored if specified on a Windows pool. If not specified, the user is + * created with the default options. + */ + linuxUserConfiguration?: LinuxUserConfiguration; + /** + * @member {WindowsUserConfiguration} [windowsUserConfiguration] The + * Windows-specific user configuration for the user account. This property + * can only be specified if the user is on a Windows pool. If not specified + * and on a Windows pool, the user is created with the default options. + */ + windowsUserConfiguration?: WindowsUserConfiguration; +} + +/** + * @interface + * An interface representing MetadataItem. + * @summary A name-value pair associated with a Batch service resource. + * + * The Batch service does not assign any meaning to this metadata; it is solely + * for the use of user code. + * + */ +export interface MetadataItem { + /** + * @member {string} name The name of the metadata item. + */ + name: string; + /** + * @member {string} value The value of the metadata item. + */ + value: string; +} + +/** + * @interface + * An interface representing ResourceFile. + * @summary A single file or multiple files to be downloaded to a compute node. + * + */ +export interface ResourceFile { + /** + * @member {string} [autoStorageContainerName] The storage container name in + * the auto storage account. The autoStorageContainerName, + * storageContainerUrl and httpUrl properties are mutually exclusive and one + * of them must be specified. + */ + autoStorageContainerName?: string; + /** + * @member {string} [storageContainerUrl] The URL of the blob container + * within Azure Blob Storage. The autoStorageContainerName, + * storageContainerUrl and httpUrl properties are mutually exclusive and one + * of them must be specified. This URL must be readable and listable using + * anonymous access; that is, the Batch service does not present any + * credentials when downloading the blob. There are two ways to get such a + * URL for a blob in Azure storage: include a Shared Access Signature (SAS) + * granting read and list permissions on the blob, or set the ACL for the + * blob or its container to allow public access. + */ + storageContainerUrl?: string; + /** + * @member {string} [httpUrl] The URL of the file to download. The + * autoStorageContainerName, storageContainerUrl and httpUrl properties are + * mutually exclusive and one of them must be specified. If the URL is Azure + * Blob Storage, it must be readable using anonymous access; that is, the + * Batch service does not present any credentials when downloading the blob. + * There are two ways to get such a URL for a blob in Azure storage: include + * a Shared Access Signature (SAS) granting read permissions on the blob, or + * set the ACL for the blob or its container to allow public access. + */ + httpUrl?: string; + /** + * @member {string} [blobPrefix] The blob prefix to use when downloading + * blobs from an Azure Storage container. Only the blobs whose names begin + * with the specified prefix will be downloaded. The property is valid only + * when autoStorageContainerName or storageContainerUrl is used. This prefix + * can be a partial filename or a subdirectory. If a prefix is not specified, + * all the files in the container will be downloaded. + */ + blobPrefix?: string; + /** + * @member {string} [filePath] The location on the compute node to which to + * download the file, relative to the task's working directory. If the + * httpUrl property is specified, the filePath is required and describes the + * path which the file will be downloaded to, including the filename. + * Otherwise, if the autoStorageContainerName or storageContainerUrl property + * is specified, filePath is optional and is the directory to download the + * files to. In the case where filePath is used as a directory, any directory + * structure already associated with the input data will be retained in full + * and appended to the specified filePath directory. The specified relative + * path cannot break out of the task's working directory (for example by + * using '..'). + */ + filePath?: string; + /** + * @member {string} [fileMode] The file permission mode attribute in octal + * format. This property applies only to files being downloaded to Linux + * compute nodes. It will be ignored if it is specified for a resourceFile + * which will be downloaded to a Windows node. If this property is not + * specified for a Linux node, then a default value of 0770 is applied to the + * file. + */ + fileMode?: string; +} + +/** + * @interface + * An interface representing EnvironmentSetting. + * @summary An environment variable to be set on a task process. + * + */ +export interface EnvironmentSetting { + /** + * @member {string} name The name of the environment variable. + */ + name: string; + /** + * @member {string} [value] The value of the environment variable. + */ + value?: string; +} + +/** + * @interface + * An interface representing AutoUserSpecification. + * @summary Specifies the parameters for the auto user that runs a task on the + * Batch service. + * + */ +export interface AutoUserSpecification { + /** + * @member {AutoUserScope} [scope] The scope for the auto user. The default + * value is task. Possible values include: 'Task', 'Pool' + */ + scope?: AutoUserScope; + /** + * @member {ElevationLevel} [elevationLevel] The elevation level of the auto + * user. nonAdmin - The auto user is a standard user without elevated access. + * admin - The auto user is a user with elevated access and operates with + * full Administrator permissions. The default value is nonAdmin. Possible + * values include: 'NonAdmin', 'Admin' + */ + elevationLevel?: ElevationLevel; +} + +/** + * @interface + * An interface representing UserIdentity. + * @summary The definition of the user identity under which the task is run. + * + * Specify either the userName or autoUser property, but not both. + * + */ +export interface UserIdentity { + /** + * @member {string} [userName] The name of the user identity under which the + * task is run. The userName and autoUser properties are mutually exclusive; + * you must specify one but not both. + */ + userName?: string; + /** + * @member {AutoUserSpecification} [autoUser] The auto user under which the + * task is run. The userName and autoUser properties are mutually exclusive; + * you must specify one but not both. + */ + autoUser?: AutoUserSpecification; +} + +/** + * @interface + * An interface representing TaskContainerSettings. + * @summary The container settings for a task. + * + */ +export interface TaskContainerSettings { + /** + * @member {string} [containerRunOptions] Additional options to the container + * create command. These additional options are supplied as arguments to the + * "docker create" command, in addition to those controlled by the Batch + * Service. + */ + containerRunOptions?: string; + /** + * @member {string} imageName The image to use to create the container in + * which the task will run. This is the full image reference, as would be + * specified to "docker pull". If no tag is provided as part of the image + * name, the tag ":latest" is used as a default. + */ + imageName: string; + /** + * @member {ContainerRegistry} [registry] The private registry which contains + * the container image. This setting can be omitted if was already provided + * at pool creation. + */ + registry?: ContainerRegistry; +} + +/** + * @interface + * An interface representing StartTask. + * @summary A task which is run when a compute node joins a pool in the Azure + * Batch service, or when the compute node is rebooted or reimaged. + * + * In some cases the start task may be re-run even though the node was not + * rebooted. Due to this, start tasks should be idempotent and exit gracefully + * if the setup they're performing has already been done. Special care should + * be taken to avoid start tasks which create breakaway process or + * install/launch services from the start task working directory, as this will + * block Batch from being able to re-run the start task. + * + */ +export interface StartTask { + /** + * @member {string} [commandLine] The command line of the start task. The + * command line does not run under a shell, and therefore cannot take + * advantage of shell features such as environment variable expansion. If you + * want to take advantage of such features, you should invoke the shell in + * the command line, for example using "cmd /c MyCommand" in Windows or + * "/bin/sh -c MyCommand" in Linux. Required if any other properties of the + * startTask are specified. + */ + commandLine?: string; + /** + * @member {ResourceFile[]} [resourceFiles] A list of files that the Batch + * service will download to the compute node before running the command line. + */ + resourceFiles?: ResourceFile[]; + /** + * @member {EnvironmentSetting[]} [environmentSettings] A list of environment + * variable settings for the start task. + */ + environmentSettings?: EnvironmentSetting[]; + /** + * @member {UserIdentity} [userIdentity] The user identity under which the + * start task runs. If omitted, the task runs as a non-administrative user + * unique to the task. + */ + userIdentity?: UserIdentity; + /** + * @member {number} [maxTaskRetryCount] The maximum number of times the task + * may be retried. The Batch service retries a task if its exit code is + * nonzero. Note that this value specifically controls the number of retries. + * The Batch service will try the task once, and may then retry up to this + * limit. For example, if the maximum retry count is 3, Batch tries the task + * up to 4 times (one initial try and 3 retries). If the maximum retry count + * is 0, the Batch service does not retry the task. If the maximum retry + * count is -1, the Batch service retries the task without limit. + */ + maxTaskRetryCount?: number; + /** + * @member {boolean} [waitForSuccess] Whether the Batch service should wait + * for the start task to complete successfully (that is, to exit with exit + * code 0) before scheduling any tasks on the compute node. If true and the + * start task fails on a compute node, the Batch service retries the start + * task up to its maximum retry count (maxTaskRetryCount). If the task has + * still not completed successfully after all retries, then the Batch service + * marks the compute node unusable, and will not schedule tasks to it. This + * condition can be detected via the node state and scheduling error detail. + * If false, the Batch service will not wait for the start task to complete. + * In this case, other tasks can start executing on the compute node while + * the start task is still running; and even if the start task fails, new + * tasks will continue to be scheduled on the node. The default is false. + */ + waitForSuccess?: boolean; + /** + * @member {TaskContainerSettings} [containerSettings] The settings for the + * container under which the start task runs. When this is specified, all + * directories recursively below the AZ_BATCH_NODE_ROOT_DIR (the root of + * Azure Batch directories on the node) are mapped into the container, all + * task environment variables are mapped into the container, and the task + * command line is executed in the container. + */ + containerSettings?: TaskContainerSettings; +} + +/** + * @interface + * An interface representing CertificateReference. + * @summary A reference to a certificate to be installed on compute nodes in a + * pool. This must exist inside the same account as the pool. + * + */ +export interface CertificateReference { + /** + * @member {string} id The fully qualified ID of the certificate to install + * on the pool. This must be inside the same batch account as the pool. + */ + id: string; + /** + * @member {CertificateStoreLocation} [storeLocation] The location of the + * certificate store on the compute node into which to install the + * certificate. The default value is currentUser. This property is applicable + * only for pools configured with Windows nodes (that is, created with + * cloudServiceConfiguration, or with virtualMachineConfiguration using a + * Windows image reference). For Linux compute nodes, the certificates are + * stored in a directory inside the task working directory and an environment + * variable AZ_BATCH_CERTIFICATES_DIR is supplied to the task to query for + * this location. For certificates with visibility of 'remoteUser', a 'certs' + * directory is created in the user's home directory (e.g., + * /home/{user-name}/certs) and certificates are placed in that directory. + * Possible values include: 'CurrentUser', 'LocalMachine' + */ + storeLocation?: CertificateStoreLocation; + /** + * @member {string} [storeName] The name of the certificate store on the + * compute node into which to install the certificate. This property is + * applicable only for pools configured with Windows nodes (that is, created + * with cloudServiceConfiguration, or with virtualMachineConfiguration using + * a Windows image reference). Common store names include: My, Root, CA, + * Trust, Disallowed, TrustedPeople, TrustedPublisher, AuthRoot, AddressBook, + * but any custom store name can also be used. The default value is My. + */ + storeName?: string; + /** + * @member {CertificateVisibility[]} [visibility] Which user accounts on the + * compute node should have access to the private data of the certificate. + */ + visibility?: CertificateVisibility[]; +} + +/** + * @interface + * An interface representing ApplicationPackageReference. + * @summary Link to an application package inside the batch account + * + */ +export interface ApplicationPackageReference { + /** + * @member {string} id The ID of the application package to install. This + * must be inside the same batch account as the pool. This can either be a + * reference to a specific version or the default version if one exists. + */ + id: string; + /** + * @member {string} [version] The version of the application to deploy. If + * omitted, the default version is deployed. If this is omitted, and no + * default version is specified for this application, the request fails with + * the error code InvalidApplicationPackageReferences. If you are calling the + * REST API directly, the HTTP status code is 409. + */ + version?: string; +} + +/** + * @interface + * An interface representing ResizeError. + * @summary An error that occurred when resizing a pool. + * + */ +export interface ResizeError { + /** + * @member {string} code An identifier for the error. Codes are invariant and + * are intended to be consumed programmatically. + */ + code: string; + /** + * @member {string} message A message describing the error, intended to be + * suitable for display in a user interface. + */ + message: string; + /** + * @member {ResizeError[]} [details] Additional details about the error. + */ + details?: ResizeError[]; +} + +/** + * @interface + * An interface representing ResizeOperationStatus. + * @summary Details about the current or last completed resize operation. + * + * Describes either the current operation (if the pool AllocationState is + * Resizing) or the previously completed operation (if the AllocationState is + * Steady). + * + */ +export interface ResizeOperationStatus { + /** + * @member {number} [targetDedicatedNodes] The desired number of dedicated + * compute nodes in the pool. + */ + targetDedicatedNodes?: number; + /** + * @member {number} [targetLowPriorityNodes] The desired number of + * low-priority compute nodes in the pool. + */ + targetLowPriorityNodes?: number; + /** + * @member {string} [resizeTimeout] The timeout for allocation of compute + * nodes to the pool or removal of compute nodes from the pool. The default + * value is 15 minutes. The minimum value is 5 minutes. If you specify a + * value less than 5 minutes, the Batch service returns an error; if you are + * calling the REST API directly, the HTTP status code is 400 (Bad Request). + */ + resizeTimeout?: string; + /** + * @member {ComputeNodeDeallocationOption} [nodeDeallocationOption] + * Determines what to do with a node and its running task(s) if the pool size + * is decreasing. The default value is requeue. Possible values include: + * 'Requeue', 'Terminate', 'TaskCompletion', 'RetainedData' + */ + nodeDeallocationOption?: ComputeNodeDeallocationOption; + /** + * @member {Date} [startTime] The time when this resize operation was + * started. + */ + startTime?: Date; + /** + * @member {ResizeError[]} [errors] Details of any errors encountered while + * performing the last resize on the pool. This property is set only if an + * error occurred during the last pool resize, and only when the pool + * allocationState is Steady. + */ + errors?: ResizeError[]; +} + +/** + * @interface + * An interface representing Pool. + * Contains information about a pool. + * + * @extends ProxyResource + */ +export interface Pool extends ProxyResource { + /** + * @member {string} [displayName] The display name for the pool. The display + * name need not be unique and can contain any Unicode characters up to a + * maximum length of 1024. + */ + displayName?: string; + /** + * @member {Date} [lastModified] The last modified time of the pool. This is + * the last time at which the pool level data, such as the + * targetDedicatedNodes or autoScaleSettings, changed. It does not factor in + * node-level changes such as a compute node changing state. + * **NOTE: This property will not be serialized. It can only be populated by + * the server.** + */ + readonly lastModified?: Date; + /** + * @member {Date} [creationTime] The creation time of the pool. **NOTE: This + * property will not be serialized. It can only be populated by the server.** + */ + readonly creationTime?: Date; + /** + * @member {PoolProvisioningState} [provisioningState] The current state of + * the pool. Possible values include: 'Succeeded', 'Deleting' + * **NOTE: This property will not be serialized. It can only be populated by + * the server.** + */ + readonly provisioningState?: PoolProvisioningState; + /** + * @member {Date} [provisioningStateTransitionTime] The time at which the + * pool entered its current state. **NOTE: This property will not be + * serialized. It can only be populated by the server.** + */ + readonly provisioningStateTransitionTime?: Date; + /** + * @member {AllocationState} [allocationState] Whether the pool is resizing. + * Possible values include: 'Steady', 'Resizing', 'Stopping' + * **NOTE: This property will not be serialized. It can only be populated by + * the server.** + */ + readonly allocationState?: AllocationState; + /** + * @member {Date} [allocationStateTransitionTime] The time at which the pool + * entered its current allocation state. **NOTE: This property will not be + * serialized. It can only be populated by the server.** + */ + readonly allocationStateTransitionTime?: Date; + /** + * @member {string} [vmSize] The size of virtual machines in the pool. All + * VMs in a pool are the same size. For information about available sizes of + * virtual machines for Cloud Services pools (pools created with + * cloudServiceConfiguration), see Sizes for Cloud Services + * (http://azure.microsoft.com/documentation/articles/cloud-services-sizes-specs/). + * Batch supports all Cloud Services VM sizes except ExtraSmall. For + * information about available VM sizes for pools using images from the + * Virtual Machines Marketplace (pools created with + * virtualMachineConfiguration) see Sizes for Virtual Machines (Linux) + * (https://azure.microsoft.com/documentation/articles/virtual-machines-linux-sizes/) + * or Sizes for Virtual Machines (Windows) + * (https://azure.microsoft.com/documentation/articles/virtual-machines-windows-sizes/). + * Batch supports all Azure VM sizes except STANDARD_A0 and those with + * premium storage (STANDARD_GS, STANDARD_DS, and STANDARD_DSV2 series). + */ + vmSize?: string; + /** + * @member {DeploymentConfiguration} [deploymentConfiguration] This property + * describes how the pool nodes will be deployed - using Cloud Services or + * Virtual Machines. Using CloudServiceConfiguration specifies that the nodes + * should be creating using Azure Cloud Services (PaaS), while + * VirtualMachineConfiguration uses Azure Virtual Machines (IaaS). + */ + deploymentConfiguration?: DeploymentConfiguration; + /** + * @member {number} [currentDedicatedNodes] The number of compute nodes + * currently in the pool. **NOTE: This property will not be serialized. It + * can only be populated by the server.** + */ + readonly currentDedicatedNodes?: number; + /** + * @member {number} [currentLowPriorityNodes] The number of low priority + * compute nodes currently in the pool. **NOTE: This property will not be + * serialized. It can only be populated by the server.** + */ + readonly currentLowPriorityNodes?: number; + /** + * @member {ScaleSettings} [scaleSettings] Settings which configure the + * number of nodes in the pool. + */ + scaleSettings?: ScaleSettings; + /** + * @member {AutoScaleRun} [autoScaleRun] The results and errors from the last + * execution of the autoscale formula. This property is set only if the pool + * automatically scales, i.e. autoScaleSettings are used. + * **NOTE: This property will not be serialized. It can only be populated by + * the server.** + */ + readonly autoScaleRun?: AutoScaleRun; + /** + * @member {InterNodeCommunicationState} [interNodeCommunication] Whether the + * pool permits direct communication between nodes. This imposes restrictions + * on which nodes can be assigned to the pool. Enabling this value can reduce + * the chance of the requested number of nodes to be allocated in the pool. + * If not specified, this value defaults to 'Disabled'. Possible values + * include: 'Enabled', 'Disabled' + */ + interNodeCommunication?: InterNodeCommunicationState; + /** + * @member {NetworkConfiguration} [networkConfiguration] The network + * configuration for the pool. + */ + networkConfiguration?: NetworkConfiguration; + /** + * @member {number} [maxTasksPerNode] The maximum number of tasks that can + * run concurrently on a single compute node in the pool. The default value + * is 1. The maximum value is the smaller of 4 times the number of cores of + * the vmSize of the pool or 256. + */ + maxTasksPerNode?: number; + /** + * @member {TaskSchedulingPolicy} [taskSchedulingPolicy] How tasks are + * distributed across compute nodes in a pool. If not specified, the default + * is spread. + */ + taskSchedulingPolicy?: TaskSchedulingPolicy; + /** + * @member {UserAccount[]} [userAccounts] The list of user accounts to be + * created on each node in the pool. + */ + userAccounts?: UserAccount[]; + /** + * @member {MetadataItem[]} [metadata] A list of name-value pairs associated + * with the pool as metadata. The Batch service does not assign any meaning + * to metadata; it is solely for the use of user code. + */ + metadata?: MetadataItem[]; + /** + * @member {StartTask} [startTask] A task specified to run on each compute + * node as it joins the pool. In an PATCH (update) operation, this property + * can be set to an empty object to remove the start task from the pool. + */ + startTask?: StartTask; + /** + * @member {CertificateReference[]} [certificates] The list of certificates + * to be installed on each compute node in the pool. For Windows compute + * nodes, the Batch service installs the certificates to the specified + * certificate store and location. For Linux compute nodes, the certificates + * are stored in a directory inside the task working directory and an + * environment variable AZ_BATCH_CERTIFICATES_DIR is supplied to the task to + * query for this location. For certificates with visibility of 'remoteUser', + * a 'certs' directory is created in the user's home directory (e.g., + * /home/{user-name}/certs) and certificates are placed in that directory. + */ + certificates?: CertificateReference[]; + /** + * @member {ApplicationPackageReference[]} [applicationPackages] The list of + * application packages to be installed on each compute node in the pool. + * Changes to application package references affect all new compute nodes + * joining the pool, but do not affect compute nodes that are already in the + * pool until they are rebooted or reimaged. There is a maximum of 10 + * application package references on any given pool. + */ + applicationPackages?: ApplicationPackageReference[]; + /** + * @member {string[]} [applicationLicenses] The list of application licenses + * the Batch service will make available on each compute node in the pool. + * The list of application licenses must be a subset of available Batch + * service application licenses. If a license is requested which is not + * supported, pool creation will fail. + */ + applicationLicenses?: string[]; + /** + * @member {ResizeOperationStatus} [resizeOperationStatus] Contains details + * about the current or last completed resize operation. **NOTE: This + * property will not be serialized. It can only be populated by the server.** + */ + readonly resizeOperationStatus?: ResizeOperationStatus; +} + +/** + * @interface + * An interface representing OperationDisplay. + * @summary The object that describes the operation. + * + */ +export interface OperationDisplay { + /** + * @member {string} [provider] Friendly name of the resource provider. + */ + provider?: string; + /** + * @member {string} [operation] The operation type. For example: read, write, + * delete, or listKeys/action + */ + operation?: string; + /** + * @member {string} [resource] The resource type on which the operation is + * performed. + */ + resource?: string; + /** + * @member {string} [description] The friendly name of the operation. + */ + description?: string; +} + +/** + * @interface + * An interface representing Operation. + * @summary A REST API operation + * + */ +export interface Operation { + /** + * @member {string} [name] The operation name. This is of the format + * {provider}/{resource}/{operation} + */ + name?: string; + /** + * @member {OperationDisplay} [display] The object that describes the + * operation. + */ + display?: OperationDisplay; + /** + * @member {string} [origin] The intended executor of the operation. + */ + origin?: string; + /** + * @member {any} [properties] Properties of the operation. + */ + properties?: any; +} + +/** + * @interface + * An interface representing CheckNameAvailabilityParameters. + * Parameters for a check name availability request. + * + */ +export interface CheckNameAvailabilityParameters { + /** + * @member {string} name The name to check for availability + */ + name: string; +} + +/** + * @interface + * An interface representing CheckNameAvailabilityResult. + * The CheckNameAvailability operation response. + * + */ +export interface CheckNameAvailabilityResult { + /** + * @member {boolean} [nameAvailable] Gets a boolean value that indicates + * whether the name is available for you to use. If true, the name is + * available. If false, the name has already been taken or invalid and cannot + * be used. + * **NOTE: This property will not be serialized. It can only be populated by + * the server.** + */ + readonly nameAvailable?: boolean; + /** + * @member {NameAvailabilityReason} [reason] Gets the reason that a Batch + * account name could not be used. The Reason element is only returned if + * NameAvailable is false. Possible values include: 'Invalid', + * 'AlreadyExists' + * **NOTE: This property will not be serialized. It can only be populated by + * the server.** + */ + readonly reason?: NameAvailabilityReason; + /** + * @member {string} [message] Gets an error message explaining the Reason + * value in more detail. + * **NOTE: This property will not be serialized. It can only be populated by + * the server.** + */ + readonly message?: string; +} + +/** + * @interface + * An interface representing ApplicationPackageListOptionalParams. + * Optional Parameters. + * + * @extends RequestOptionsBase + */ +export interface ApplicationPackageListOptionalParams extends msRest.RequestOptionsBase { + /** + * @member {number} [maxresults] The maximum number of items to return in the + * response. + */ + maxresults?: number; +} + +/** + * @interface + * An interface representing ApplicationCreateOptionalParams. + * Optional Parameters. + * + * @extends RequestOptionsBase + */ +export interface ApplicationCreateOptionalParams extends msRest.RequestOptionsBase { + /** + * @member {Application} [parameters] The parameters for the request. + */ + parameters?: Application; +} + +/** + * @interface + * An interface representing ApplicationListOptionalParams. + * Optional Parameters. + * + * @extends RequestOptionsBase + */ +export interface ApplicationListOptionalParams extends msRest.RequestOptionsBase { + /** + * @member {number} [maxresults] The maximum number of items to return in the + * response. + */ + maxresults?: number; +} + +/** + * @interface + * An interface representing CertificateListByBatchAccountOptionalParams. + * Optional Parameters. + * + * @extends RequestOptionsBase + */ +export interface CertificateListByBatchAccountOptionalParams extends msRest.RequestOptionsBase { + /** + * @member {number} [maxresults] The maximum number of items to return in the + * response. + */ + maxresults?: number; + /** + * @member {string} [select] Comma separated list of properties that should + * be returned. e.g. "properties/provisioningState". Only top level + * properties under properties/ are valid for selection. + */ + select?: string; + /** + * @member {string} [filter] OData filter expression. Valid properties for + * filtering are "properties/provisioningState", + * "properties/provisioningStateTransitionTime", "name". + */ + filter?: string; +} + +/** + * @interface + * An interface representing CertificateCreateOptionalParams. + * Optional Parameters. + * + * @extends RequestOptionsBase + */ +export interface CertificateCreateOptionalParams extends msRest.RequestOptionsBase { + /** + * @member {string} [ifMatch] The entity state (ETag) version of the + * certificate to update. A value of "*" can be used to apply the operation + * only if the certificate already exists. If omitted, this operation will + * always be applied. + */ + ifMatch?: string; + /** + * @member {string} [ifNoneMatch] Set to '*' to allow a new certificate to be + * created, but to prevent updating an existing certificate. Other values + * will be ignored. + */ + ifNoneMatch?: string; +} + +/** + * @interface + * An interface representing CertificateUpdateOptionalParams. + * Optional Parameters. + * + * @extends RequestOptionsBase + */ +export interface CertificateUpdateOptionalParams extends msRest.RequestOptionsBase { + /** + * @member {string} [ifMatch] The entity state (ETag) version of the + * certificate to update. This value can be omitted or set to "*" to apply + * the operation unconditionally. + */ + ifMatch?: string; +} + +/** + * @interface + * An interface representing CertificateBeginCreateOptionalParams. + * Optional Parameters. + * + * @extends RequestOptionsBase + */ +export interface CertificateBeginCreateOptionalParams extends msRest.RequestOptionsBase { + /** + * @member {string} [ifMatch] The entity state (ETag) version of the + * certificate to update. A value of "*" can be used to apply the operation + * only if the certificate already exists. If omitted, this operation will + * always be applied. + */ + ifMatch?: string; + /** + * @member {string} [ifNoneMatch] Set to '*' to allow a new certificate to be + * created, but to prevent updating an existing certificate. Other values + * will be ignored. + */ + ifNoneMatch?: string; +} + +/** + * @interface + * An interface representing PoolListByBatchAccountOptionalParams. + * Optional Parameters. + * + * @extends RequestOptionsBase + */ +export interface PoolListByBatchAccountOptionalParams extends msRest.RequestOptionsBase { + /** + * @member {number} [maxresults] The maximum number of items to return in the + * response. + */ + maxresults?: number; + /** + * @member {string} [select] Comma separated list of properties that should + * be returned. e.g. "properties/provisioningState". Only top level + * properties under properties/ are valid for selection. + */ + select?: string; + /** + * @member {string} [filter] OData filter expression. Valid properties for + * filtering are: + * + * name + * properties/allocationState + * properties/allocationStateTransitionTime + * properties/creationTime + * properties/provisioningState + * properties/provisioningStateTransitionTime + * properties/lastModified + * properties/vmSize + * properties/interNodeCommunication + * properties/scaleSettings/autoScale + * properties/scaleSettings/fixedScale + */ + filter?: string; +} + +/** + * @interface + * An interface representing PoolCreateOptionalParams. + * Optional Parameters. + * + * @extends RequestOptionsBase + */ +export interface PoolCreateOptionalParams extends msRest.RequestOptionsBase { + /** + * @member {string} [ifMatch] The entity state (ETag) version of the pool to + * update. A value of "*" can be used to apply the operation only if the pool + * already exists. If omitted, this operation will always be applied. + */ + ifMatch?: string; + /** + * @member {string} [ifNoneMatch] Set to '*' to allow a new pool to be + * created, but to prevent updating an existing pool. Other values will be + * ignored. + */ + ifNoneMatch?: string; +} + +/** + * @interface + * An interface representing PoolUpdateOptionalParams. + * Optional Parameters. + * + * @extends RequestOptionsBase + */ +export interface PoolUpdateOptionalParams extends msRest.RequestOptionsBase { + /** + * @member {string} [ifMatch] The entity state (ETag) version of the pool to + * update. This value can be omitted or set to "*" to apply the operation + * unconditionally. + */ + ifMatch?: string; +} + +/** + * @interface + * An interface representing PoolBeginCreateOptionalParams. + * Optional Parameters. + * + * @extends RequestOptionsBase + */ +export interface PoolBeginCreateOptionalParams extends msRest.RequestOptionsBase { + /** + * @member {string} [ifMatch] The entity state (ETag) version of the pool to + * update. A value of "*" can be used to apply the operation only if the pool + * already exists. If omitted, this operation will always be applied. + */ + ifMatch?: string; + /** + * @member {string} [ifNoneMatch] Set to '*' to allow a new pool to be + * created, but to prevent updating an existing pool. Other values will be + * ignored. + */ + ifNoneMatch?: string; +} + +/** + * @interface + * An interface representing BatchManagementClientOptions. + * @extends AzureServiceClientOptions + */ +export interface BatchManagementClientOptions extends AzureServiceClientOptions { + /** + * @member {string} [baseUri] + */ + baseUri?: string; +} + +/** + * @interface + * An interface representing BatchAccountCreateHeaders. + * Defines headers for Create operation. + * + */ +export interface BatchAccountCreateHeaders { + /** + * @member {string} [locationHeader] The URL of the resource used to check + * the status of the asynchronous operation. + */ + locationHeader: string; + /** + * @member {number} [retryAfter] Suggested delay to check the status of the + * asynchronous operation. The value is an integer that specifies the delay + * in seconds. + */ + retryAfter: number; +} + +/** + * @interface + * An interface representing BatchAccountDeleteHeaders. + * Defines headers for Delete operation. + * + */ +export interface BatchAccountDeleteHeaders { + /** + * @member {string} [location] The URL of the resource used to check the + * status of the asynchronous operation. + */ + location: string; + /** + * @member {number} [retryAfter] Suggested delay to check the status of the + * asynchronous operation. The value is an integer that specifies the delay + * in seconds. + */ + retryAfter: number; +} + +/** + * @interface + * An interface representing CertificateCreateHeaders. + * Defines headers for Create operation. + * + */ +export interface CertificateCreateHeaders { + /** + * @member {string} [eTag] The ETag HTTP response header. This is an opaque + * string. You can use it to detect whether the resource has changed between + * requests. In particular, you can pass the ETag to one of the If-Match or + * If-None-Match headers. + */ + eTag: string; +} + +/** + * @interface + * An interface representing CertificateUpdateHeaders. + * Defines headers for Update operation. + * + */ +export interface CertificateUpdateHeaders { + /** + * @member {string} [eTag] The ETag HTTP response header. This is an opaque + * string. You can use it to detect whether the resource has changed between + * requests. In particular, you can pass the ETag to one of the If-Match or + * If-None-Match headers. + */ + eTag: string; +} + +/** + * @interface + * An interface representing CertificateDeleteHeaders. + * Defines headers for Delete operation. + * + */ +export interface CertificateDeleteHeaders { + /** + * @member {string} [location] The URL of the resource used to check the + * status of the asynchronous operation. + */ + location: string; + /** + * @member {number} [retryAfter] Suggested delay to check the status of the + * asynchronous operation. The value is an integer that represents the + * seconds. + */ + retryAfter: number; +} + +/** + * @interface + * An interface representing CertificateGetHeaders. + * Defines headers for Get operation. + * + */ +export interface CertificateGetHeaders { + /** + * @member {string} [eTag] The ETag HTTP response header. This is an opaque + * string. You can use it to detect whether the resource has changed between + * requests. In particular, you can pass the ETag to one of the If-Match or + * If-None-Match headers. + */ + eTag: string; +} + +/** + * @interface + * An interface representing CertificateCancelDeletionHeaders. + * Defines headers for CancelDeletion operation. + * + */ +export interface CertificateCancelDeletionHeaders { + /** + * @member {string} [eTag] The ETag HTTP response header. This is an opaque + * string. You can use it to detect whether the resource has changed between + * requests. In particular, you can pass the ETag to one of the If-Match or + * If-None-Match headers. + */ + eTag: string; +} + +/** + * @interface + * An interface representing PoolCreateHeaders. + * Defines headers for Create operation. + * + */ +export interface PoolCreateHeaders { + /** + * @member {string} [eTag] The ETag HTTP response header. This is an opaque + * string. You can use it to detect whether the resource has changed between + * requests. In particular, you can pass the ETag to one of the If-Match or + * If-None-Match headers. + */ + eTag: string; +} + +/** + * @interface + * An interface representing PoolUpdateHeaders. + * Defines headers for Update operation. + * + */ +export interface PoolUpdateHeaders { + /** + * @member {string} [eTag] The ETag HTTP response header. This is an opaque + * string. You can use it to detect whether the resource has changed between + * requests. In particular, you can pass the ETag to one of the If-Match or + * If-None-Match headers. + */ + eTag: string; +} + +/** + * @interface + * An interface representing PoolDeleteHeaders. + * Defines headers for Delete operation. + * + */ +export interface PoolDeleteHeaders { + /** + * @member {string} [location] The URL of the resource used to check the + * status of the asynchronous operation. + */ + location: string; + /** + * @member {number} [retryAfter] Suggested delay to check the status of the + * asynchronous operation. The value is an integer that represents the + * seconds. + */ + retryAfter: number; +} + +/** + * @interface + * An interface representing PoolGetHeaders. + * Defines headers for Get operation. + * + */ +export interface PoolGetHeaders { + /** + * @member {string} [eTag] The ETag HTTP response header. This is an opaque + * string. You can use it to detect whether the resource has changed between + * requests. In particular, you can pass the ETag to one of the If-Match or + * If-None-Match headers. + */ + eTag: string; +} + +/** + * @interface + * An interface representing PoolDisableAutoScaleHeaders. + * Defines headers for DisableAutoScale operation. + * + */ +export interface PoolDisableAutoScaleHeaders { + /** + * @member {string} [eTag] The ETag HTTP response header. This is an opaque + * string. You can use it to detect whether the resource has changed between + * requests. In particular, you can pass the ETag to one of the If-Match or + * If-None-Match headers. + */ + eTag: string; +} + +/** + * @interface + * An interface representing PoolStopResizeHeaders. + * Defines headers for StopResize operation. + * + */ +export interface PoolStopResizeHeaders { + /** + * @member {string} [eTag] The ETag HTTP response header. This is an opaque + * string. You can use it to detect whether the resource has changed between + * requests. In particular, you can pass the ETag to one of the If-Match or + * If-None-Match headers. + */ + eTag: string; +} + + +/** + * @interface + * An interface representing the BatchAccountListResult. + * Values returned by the List operation. + * + * @extends Array + */ +export interface BatchAccountListResult extends Array { + /** + * @member {string} [nextLink] The continuation token. + */ + nextLink?: string; +} + +/** + * @interface + * An interface representing the ListApplicationPackagesResult. + * The result of performing list application packages. + * + * @extends Array + */ +export interface ListApplicationPackagesResult extends Array { + /** + * @member {string} [nextLink] The URL to get the next set of results. + */ + nextLink?: string; +} + +/** + * @interface + * An interface representing the ListApplicationsResult. + * The result of performing list applications. + * + * @extends Array + */ +export interface ListApplicationsResult extends Array { + /** + * @member {string} [nextLink] The URL to get the next set of results. + */ + nextLink?: string; +} + +/** + * @interface + * An interface representing the OperationListResult. + * @summary Result of the request to list REST API operations. It contains a + * list of operations and a URL nextLink to get the next set of results. + * + * @extends Array + */ +export interface OperationListResult extends Array { + /** + * @member {string} [nextLink] + */ + nextLink?: string; +} + +/** + * @interface + * An interface representing the ListCertificatesResult. + * Values returned by the List operation. + * + * @extends Array + */ +export interface ListCertificatesResult extends Array { + /** + * @member {string} [nextLink] The continuation token. + */ + nextLink?: string; +} + +/** + * @interface + * An interface representing the ListPoolsResult. + * Values returned by the List operation. + * + * @extends Array + */ +export interface ListPoolsResult extends Array { + /** + * @member {string} [nextLink] The continuation token. + */ + nextLink?: string; +} + +/** + * Defines values for PoolAllocationMode. + * Possible values include: 'BatchService', 'UserSubscription' + * @readonly + * @enum {string} + */ +export type PoolAllocationMode = 'BatchService' | 'UserSubscription'; + +/** + * Defines values for ProvisioningState. + * Possible values include: 'Invalid', 'Creating', 'Deleting', 'Succeeded', 'Failed', 'Cancelled' + * @readonly + * @enum {string} + */ +export type ProvisioningState = 'Invalid' | 'Creating' | 'Deleting' | 'Succeeded' | 'Failed' | 'Cancelled'; + +/** + * Defines values for AccountKeyType. + * Possible values include: 'Primary', 'Secondary' + * @readonly + * @enum {string} + */ +export type AccountKeyType = 'Primary' | 'Secondary'; + +/** + * Defines values for PackageState. + * Possible values include: 'Pending', 'Active' + * @readonly + * @enum {string} + */ +export type PackageState = 'Pending' | 'Active'; + +/** + * Defines values for CertificateFormat. + * Possible values include: 'Pfx', 'Cer' + * @readonly + * @enum {string} + */ +export type CertificateFormat = 'Pfx' | 'Cer'; + +/** + * Defines values for CertificateProvisioningState. + * Possible values include: 'Succeeded', 'Deleting', 'Failed' + * @readonly + * @enum {string} + */ +export type CertificateProvisioningState = 'Succeeded' | 'Deleting' | 'Failed'; + +/** + * Defines values for PoolProvisioningState. + * Possible values include: 'Succeeded', 'Deleting' + * @readonly + * @enum {string} + */ +export type PoolProvisioningState = 'Succeeded' | 'Deleting'; + +/** + * Defines values for AllocationState. + * Possible values include: 'Steady', 'Resizing', 'Stopping' + * @readonly + * @enum {string} + */ +export type AllocationState = 'Steady' | 'Resizing' | 'Stopping'; + +/** + * Defines values for CachingType. + * Possible values include: 'None', 'ReadOnly', 'ReadWrite' + * @readonly + * @enum {string} + */ +export type CachingType = 'None' | 'ReadOnly' | 'ReadWrite'; + +/** + * Defines values for StorageAccountType. + * Possible values include: 'Standard_LRS', 'Premium_LRS' + * @readonly + * @enum {string} + */ +export type StorageAccountType = 'Standard_LRS' | 'Premium_LRS'; + +/** + * Defines values for ComputeNodeDeallocationOption. + * Possible values include: 'Requeue', 'Terminate', 'TaskCompletion', 'RetainedData' + * @readonly + * @enum {string} + */ +export type ComputeNodeDeallocationOption = 'Requeue' | 'Terminate' | 'TaskCompletion' | 'RetainedData'; + +/** + * Defines values for InterNodeCommunicationState. + * Possible values include: 'Enabled', 'Disabled' + * @readonly + * @enum {string} + */ +export type InterNodeCommunicationState = 'Enabled' | 'Disabled'; + +/** + * Defines values for InboundEndpointProtocol. + * Possible values include: 'TCP', 'UDP' + * @readonly + * @enum {string} + */ +export type InboundEndpointProtocol = 'TCP' | 'UDP'; + +/** + * Defines values for NetworkSecurityGroupRuleAccess. + * Possible values include: 'Allow', 'Deny' + * @readonly + * @enum {string} + */ +export type NetworkSecurityGroupRuleAccess = 'Allow' | 'Deny'; + +/** + * Defines values for ComputeNodeFillType. + * Possible values include: 'Spread', 'Pack' + * @readonly + * @enum {string} + */ +export type ComputeNodeFillType = 'Spread' | 'Pack'; + +/** + * Defines values for ElevationLevel. + * Possible values include: 'NonAdmin', 'Admin' + * @readonly + * @enum {string} + */ +export type ElevationLevel = 'NonAdmin' | 'Admin'; + +/** + * Defines values for LoginMode. + * Possible values include: 'Batch', 'Interactive' + * @readonly + * @enum {string} + */ +export type LoginMode = 'Batch' | 'Interactive'; + +/** + * Defines values for AutoUserScope. + * Possible values include: 'Task', 'Pool' + * @readonly + * @enum {string} + */ +export type AutoUserScope = 'Task' | 'Pool'; + +/** + * Defines values for CertificateStoreLocation. + * Possible values include: 'CurrentUser', 'LocalMachine' + * @readonly + * @enum {string} + */ +export type CertificateStoreLocation = 'CurrentUser' | 'LocalMachine'; + +/** + * Defines values for CertificateVisibility. + * Possible values include: 'StartTask', 'Task', 'RemoteUser' + * @readonly + * @enum {string} + */ +export type CertificateVisibility = 'StartTask' | 'Task' | 'RemoteUser'; + +/** + * Defines values for NameAvailabilityReason. + * Possible values include: 'Invalid', 'AlreadyExists' + * @readonly + * @enum {string} + */ +export type NameAvailabilityReason = 'Invalid' | 'AlreadyExists'; + +/** + * Contains response data for the create operation. + */ +export type BatchAccountCreateResponse = BatchAccount & BatchAccountCreateHeaders & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The parsed HTTP response headers. + */ + parsedHeaders: BatchAccountCreateHeaders; + /** + * The response body as text (string format) + */ + bodyAsText: string; + /** + * The response body as parsed JSON or XML + */ + parsedBody: BatchAccount; + }; +}; + +/** + * Contains response data for the update operation. + */ +export type BatchAccountUpdateResponse = BatchAccount & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + /** + * The response body as parsed JSON or XML + */ + parsedBody: BatchAccount; + }; +}; + +/** + * Contains response data for the deleteMethod operation. + */ +export type BatchAccountDeleteResponse = BatchAccountDeleteHeaders & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The parsed HTTP response headers. + */ + parsedHeaders: BatchAccountDeleteHeaders; + }; +}; + +/** + * Contains response data for the get operation. + */ +export type BatchAccountGetResponse = BatchAccount & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + /** + * The response body as parsed JSON or XML + */ + parsedBody: BatchAccount; + }; +}; + +/** + * Contains response data for the list operation. + */ +export type BatchAccountListResponse = BatchAccountListResult & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + /** + * The response body as parsed JSON or XML + */ + parsedBody: BatchAccountListResult; + }; +}; + +/** + * Contains response data for the listByResourceGroup operation. + */ +export type BatchAccountListByResourceGroupResponse = BatchAccountListResult & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + /** + * The response body as parsed JSON or XML + */ + parsedBody: BatchAccountListResult; + }; +}; + +/** + * Contains response data for the regenerateKey operation. + */ +export type BatchAccountRegenerateKeyResponse = BatchAccountKeys & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + /** + * The response body as parsed JSON or XML + */ + parsedBody: BatchAccountKeys; + }; +}; + +/** + * Contains response data for the getKeys operation. + */ +export type BatchAccountGetKeysResponse = BatchAccountKeys & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + /** + * The response body as parsed JSON or XML + */ + parsedBody: BatchAccountKeys; + }; +}; + +/** + * Contains response data for the listNext operation. + */ +export type BatchAccountListNextResponse = BatchAccountListResult & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + /** + * The response body as parsed JSON or XML + */ + parsedBody: BatchAccountListResult; + }; +}; + +/** + * Contains response data for the listByResourceGroupNext operation. + */ +export type BatchAccountListByResourceGroupNextResponse = BatchAccountListResult & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + /** + * The response body as parsed JSON or XML + */ + parsedBody: BatchAccountListResult; + }; +}; + +/** + * Contains response data for the activate operation. + */ +export type ApplicationPackageActivateResponse = ApplicationPackage & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + /** + * The response body as parsed JSON or XML + */ + parsedBody: ApplicationPackage; + }; +}; + +/** + * Contains response data for the create operation. + */ +export type ApplicationPackageCreateResponse = ApplicationPackage & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + /** + * The response body as parsed JSON or XML + */ + parsedBody: ApplicationPackage; + }; +}; + +/** + * Contains response data for the get operation. + */ +export type ApplicationPackageGetResponse = ApplicationPackage & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + /** + * The response body as parsed JSON or XML + */ + parsedBody: ApplicationPackage; + }; +}; + +/** + * Contains response data for the list operation. + */ +export type ApplicationPackageListResponse = ListApplicationPackagesResult & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + /** + * The response body as parsed JSON or XML + */ + parsedBody: ListApplicationPackagesResult; + }; +}; + +/** + * Contains response data for the listNext operation. + */ +export type ApplicationPackageListNextResponse = ListApplicationPackagesResult & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + /** + * The response body as parsed JSON or XML + */ + parsedBody: ListApplicationPackagesResult; + }; +}; + +/** + * Contains response data for the create operation. + */ +export type ApplicationCreateResponse = Application & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + /** + * The response body as parsed JSON or XML + */ + parsedBody: Application; + }; +}; + +/** + * Contains response data for the get operation. + */ +export type ApplicationGetResponse = Application & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + /** + * The response body as parsed JSON or XML + */ + parsedBody: Application; + }; +}; + +/** + * Contains response data for the update operation. + */ +export type ApplicationUpdateResponse = Application & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + /** + * The response body as parsed JSON or XML + */ + parsedBody: Application; + }; +}; + +/** + * Contains response data for the list operation. + */ +export type ApplicationListResponse = ListApplicationsResult & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + /** + * The response body as parsed JSON or XML + */ + parsedBody: ListApplicationsResult; + }; +}; + +/** + * Contains response data for the listNext operation. + */ +export type ApplicationListNextResponse = ListApplicationsResult & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + /** + * The response body as parsed JSON or XML + */ + parsedBody: ListApplicationsResult; + }; +}; + +/** + * Contains response data for the getQuotas operation. + */ +export type LocationGetQuotasResponse = BatchLocationQuota & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + /** + * The response body as parsed JSON or XML + */ + parsedBody: BatchLocationQuota; + }; +}; + +/** + * Contains response data for the checkNameAvailability operation. + */ +export type LocationCheckNameAvailabilityResponse = CheckNameAvailabilityResult & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + /** + * The response body as parsed JSON or XML + */ + parsedBody: CheckNameAvailabilityResult; + }; +}; + +/** + * Contains response data for the list operation. + */ +export type OperationsListResponse = OperationListResult & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + /** + * The response body as parsed JSON or XML + */ + parsedBody: OperationListResult; + }; +}; + +/** + * Contains response data for the listNext operation. + */ +export type OperationsListNextResponse = OperationListResult & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + /** + * The response body as parsed JSON or XML + */ + parsedBody: OperationListResult; + }; +}; + +/** + * Contains response data for the listByBatchAccount operation. + */ +export type CertificateListByBatchAccountResponse = ListCertificatesResult & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + /** + * The response body as parsed JSON or XML + */ + parsedBody: ListCertificatesResult; + }; +}; + +/** + * Contains response data for the create operation. + */ +export type CertificateCreateResponse = Certificate & CertificateCreateHeaders & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The parsed HTTP response headers. + */ + parsedHeaders: CertificateCreateHeaders; + /** + * The response body as text (string format) + */ + bodyAsText: string; + /** + * The response body as parsed JSON or XML + */ + parsedBody: Certificate; + }; +}; + +/** + * Contains response data for the update operation. + */ +export type CertificateUpdateResponse = Certificate & CertificateUpdateHeaders & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The parsed HTTP response headers. + */ + parsedHeaders: CertificateUpdateHeaders; + /** + * The response body as text (string format) + */ + bodyAsText: string; + /** + * The response body as parsed JSON or XML + */ + parsedBody: Certificate; + }; +}; + +/** + * Contains response data for the deleteMethod operation. + */ +export type CertificateDeleteResponse = CertificateDeleteHeaders & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The parsed HTTP response headers. + */ + parsedHeaders: CertificateDeleteHeaders; + }; +}; + +/** + * Contains response data for the get operation. + */ +export type CertificateGetResponse = Certificate & CertificateGetHeaders & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The parsed HTTP response headers. + */ + parsedHeaders: CertificateGetHeaders; + /** + * The response body as text (string format) + */ + bodyAsText: string; + /** + * The response body as parsed JSON or XML + */ + parsedBody: Certificate; + }; +}; + +/** + * Contains response data for the cancelDeletion operation. + */ +export type CertificateCancelDeletionResponse = Certificate & CertificateCancelDeletionHeaders & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The parsed HTTP response headers. + */ + parsedHeaders: CertificateCancelDeletionHeaders; + /** + * The response body as text (string format) + */ + bodyAsText: string; + /** + * The response body as parsed JSON or XML + */ + parsedBody: Certificate; + }; +}; + +/** + * Contains response data for the listByBatchAccountNext operation. + */ +export type CertificateListByBatchAccountNextResponse = ListCertificatesResult & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + /** + * The response body as parsed JSON or XML + */ + parsedBody: ListCertificatesResult; + }; +}; + +/** + * Contains response data for the listByBatchAccount operation. + */ +export type PoolListByBatchAccountResponse = ListPoolsResult & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + /** + * The response body as parsed JSON or XML + */ + parsedBody: ListPoolsResult; + }; +}; + +/** + * Contains response data for the create operation. + */ +export type PoolCreateResponse = Pool & PoolCreateHeaders & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The parsed HTTP response headers. + */ + parsedHeaders: PoolCreateHeaders; + /** + * The response body as text (string format) + */ + bodyAsText: string; + /** + * The response body as parsed JSON or XML + */ + parsedBody: Pool; + }; +}; + +/** + * Contains response data for the update operation. + */ +export type PoolUpdateResponse = Pool & PoolUpdateHeaders & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The parsed HTTP response headers. + */ + parsedHeaders: PoolUpdateHeaders; + /** + * The response body as text (string format) + */ + bodyAsText: string; + /** + * The response body as parsed JSON or XML + */ + parsedBody: Pool; + }; +}; + +/** + * Contains response data for the deleteMethod operation. + */ +export type PoolDeleteResponse = PoolDeleteHeaders & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The parsed HTTP response headers. + */ + parsedHeaders: PoolDeleteHeaders; + }; +}; + +/** + * Contains response data for the get operation. + */ +export type PoolGetResponse = Pool & PoolGetHeaders & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The parsed HTTP response headers. + */ + parsedHeaders: PoolGetHeaders; + /** + * The response body as text (string format) + */ + bodyAsText: string; + /** + * The response body as parsed JSON or XML + */ + parsedBody: Pool; + }; +}; + +/** + * Contains response data for the disableAutoScale operation. + */ +export type PoolDisableAutoScaleResponse = Pool & PoolDisableAutoScaleHeaders & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The parsed HTTP response headers. + */ + parsedHeaders: PoolDisableAutoScaleHeaders; + /** + * The response body as text (string format) + */ + bodyAsText: string; + /** + * The response body as parsed JSON or XML + */ + parsedBody: Pool; + }; +}; + +/** + * Contains response data for the stopResize operation. + */ +export type PoolStopResizeResponse = Pool & PoolStopResizeHeaders & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The parsed HTTP response headers. + */ + parsedHeaders: PoolStopResizeHeaders; + /** + * The response body as text (string format) + */ + bodyAsText: string; + /** + * The response body as parsed JSON or XML + */ + parsedBody: Pool; + }; +}; + +/** + * Contains response data for the listByBatchAccountNext operation. + */ +export type PoolListByBatchAccountNextResponse = ListPoolsResult & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + /** + * The response body as parsed JSON or XML + */ + parsedBody: ListPoolsResult; + }; +}; diff --git a/sdk/batch/arm-batch/lib/models/locationMappers.ts b/sdk/batch/arm-batch/lib/models/locationMappers.ts new file mode 100644 index 000000000000..97dbbc6cc3db --- /dev/null +++ b/sdk/batch/arm-batch/lib/models/locationMappers.ts @@ -0,0 +1,17 @@ +/* + * 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. + */ + +export { + BatchLocationQuota, + CloudError, + CheckNameAvailabilityParameters, + CheckNameAvailabilityResult +} from "../models/mappers"; + diff --git a/sdk/batch/arm-batch/lib/models/mappers.ts b/sdk/batch/arm-batch/lib/models/mappers.ts new file mode 100644 index 000000000000..d2b2d155d8da --- /dev/null +++ b/sdk/batch/arm-batch/lib/models/mappers.ts @@ -0,0 +1,2600 @@ +/* + * 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. + */ + +import { CloudErrorMapper, BaseResourceMapper } from "@azure/ms-rest-azure-js"; +import * as msRest from "@azure/ms-rest-js"; + +export const CloudError = CloudErrorMapper; +export const BaseResource = BaseResourceMapper; + +export const AutoStorageBaseProperties: msRest.CompositeMapper = { + serializedName: "AutoStorageBaseProperties", + type: { + name: "Composite", + className: "AutoStorageBaseProperties", + modelProperties: { + storageAccountId: { + required: true, + serializedName: "storageAccountId", + type: { + name: "String" + } + } + } + } +}; + +export const KeyVaultReference: msRest.CompositeMapper = { + serializedName: "KeyVaultReference", + type: { + name: "Composite", + className: "KeyVaultReference", + modelProperties: { + id: { + required: true, + serializedName: "id", + type: { + name: "String" + } + }, + url: { + required: true, + serializedName: "url", + type: { + name: "String" + } + } + } + } +}; + +export const BatchAccountCreateParameters: msRest.CompositeMapper = { + serializedName: "BatchAccountCreateParameters", + type: { + name: "Composite", + className: "BatchAccountCreateParameters", + modelProperties: { + location: { + required: true, + serializedName: "location", + type: { + name: "String" + } + }, + tags: { + serializedName: "tags", + type: { + name: "Dictionary", + value: { + type: { + name: "String" + } + } + } + }, + autoStorage: { + serializedName: "properties.autoStorage", + type: { + name: "Composite", + className: "AutoStorageBaseProperties" + } + }, + poolAllocationMode: { + serializedName: "properties.poolAllocationMode", + type: { + name: "Enum", + allowedValues: [ + "BatchService", + "UserSubscription" + ] + } + }, + keyVaultReference: { + serializedName: "properties.keyVaultReference", + type: { + name: "Composite", + className: "KeyVaultReference" + } + } + } + } +}; + +export const AutoStorageProperties: msRest.CompositeMapper = { + serializedName: "AutoStorageProperties", + type: { + name: "Composite", + className: "AutoStorageProperties", + modelProperties: { + ...AutoStorageBaseProperties.type.modelProperties, + lastKeySync: { + required: true, + serializedName: "lastKeySync", + type: { + name: "DateTime" + } + } + } + } +}; + +export const VirtualMachineFamilyCoreQuota: msRest.CompositeMapper = { + serializedName: "VirtualMachineFamilyCoreQuota", + type: { + name: "Composite", + className: "VirtualMachineFamilyCoreQuota", + modelProperties: { + name: { + nullable: false, + readOnly: true, + serializedName: "name", + type: { + name: "String" + } + }, + coreQuota: { + nullable: false, + readOnly: true, + serializedName: "coreQuota", + type: { + name: "Number" + } + } + } + } +}; + +export const Resource: msRest.CompositeMapper = { + serializedName: "Resource", + type: { + name: "Composite", + className: "Resource", + modelProperties: { + id: { + readOnly: true, + serializedName: "id", + type: { + name: "String" + } + }, + name: { + readOnly: true, + serializedName: "name", + type: { + name: "String" + } + }, + type: { + readOnly: true, + serializedName: "type", + type: { + name: "String" + } + }, + location: { + readOnly: true, + serializedName: "location", + type: { + name: "String" + } + }, + tags: { + readOnly: true, + serializedName: "tags", + type: { + name: "Dictionary", + value: { + type: { + name: "String" + } + } + } + } + } + } +}; + +export const BatchAccount: msRest.CompositeMapper = { + serializedName: "BatchAccount", + type: { + name: "Composite", + className: "BatchAccount", + modelProperties: { + ...Resource.type.modelProperties, + accountEndpoint: { + readOnly: true, + serializedName: "properties.accountEndpoint", + type: { + name: "String" + } + }, + provisioningState: { + nullable: false, + readOnly: true, + serializedName: "properties.provisioningState", + type: { + name: "Enum", + allowedValues: [ + "Invalid", + "Creating", + "Deleting", + "Succeeded", + "Failed", + "Cancelled" + ] + } + }, + poolAllocationMode: { + readOnly: true, + serializedName: "properties.poolAllocationMode", + type: { + name: "Enum", + allowedValues: [ + "BatchService", + "UserSubscription" + ] + } + }, + keyVaultReference: { + readOnly: true, + serializedName: "properties.keyVaultReference", + type: { + name: "Composite", + className: "KeyVaultReference" + } + }, + autoStorage: { + readOnly: true, + serializedName: "properties.autoStorage", + type: { + name: "Composite", + className: "AutoStorageProperties" + } + }, + dedicatedCoreQuota: { + nullable: true, + readOnly: true, + serializedName: "properties.dedicatedCoreQuota", + type: { + name: "Number" + } + }, + lowPriorityCoreQuota: { + nullable: true, + readOnly: true, + serializedName: "properties.lowPriorityCoreQuota", + type: { + name: "Number" + } + }, + dedicatedCoreQuotaPerVMFamily: { + nullable: true, + readOnly: true, + serializedName: "properties.dedicatedCoreQuotaPerVMFamily", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "VirtualMachineFamilyCoreQuota" + } + } + } + }, + dedicatedCoreQuotaPerVMFamilyEnforced: { + nullable: false, + readOnly: true, + serializedName: "properties.dedicatedCoreQuotaPerVMFamilyEnforced", + type: { + name: "Boolean" + } + }, + poolQuota: { + nullable: false, + readOnly: true, + serializedName: "properties.poolQuota", + type: { + name: "Number" + } + }, + activeJobAndJobScheduleQuota: { + nullable: false, + readOnly: true, + serializedName: "properties.activeJobAndJobScheduleQuota", + type: { + name: "Number" + } + } + } + } +}; + +export const BatchAccountUpdateParameters: msRest.CompositeMapper = { + serializedName: "BatchAccountUpdateParameters", + type: { + name: "Composite", + className: "BatchAccountUpdateParameters", + modelProperties: { + tags: { + serializedName: "tags", + type: { + name: "Dictionary", + value: { + type: { + name: "String" + } + } + } + }, + autoStorage: { + serializedName: "properties.autoStorage", + type: { + name: "Composite", + className: "AutoStorageBaseProperties" + } + } + } + } +}; + +export const BatchAccountRegenerateKeyParameters: msRest.CompositeMapper = { + serializedName: "BatchAccountRegenerateKeyParameters", + type: { + name: "Composite", + className: "BatchAccountRegenerateKeyParameters", + modelProperties: { + keyName: { + required: true, + serializedName: "keyName", + type: { + name: "Enum", + allowedValues: [ + "Primary", + "Secondary" + ] + } + } + } + } +}; + +export const BatchAccountKeys: msRest.CompositeMapper = { + serializedName: "BatchAccountKeys", + type: { + name: "Composite", + className: "BatchAccountKeys", + modelProperties: { + accountName: { + readOnly: true, + serializedName: "accountName", + type: { + name: "String" + } + }, + primary: { + readOnly: true, + serializedName: "primary", + type: { + name: "String" + } + }, + secondary: { + readOnly: true, + serializedName: "secondary", + type: { + name: "String" + } + } + } + } +}; + +export const ActivateApplicationPackageParameters: msRest.CompositeMapper = { + serializedName: "ActivateApplicationPackageParameters", + type: { + name: "Composite", + className: "ActivateApplicationPackageParameters", + modelProperties: { + format: { + required: true, + serializedName: "format", + type: { + name: "String" + } + } + } + } +}; + +export const ProxyResource: msRest.CompositeMapper = { + serializedName: "ProxyResource", + type: { + name: "Composite", + className: "ProxyResource", + modelProperties: { + id: { + readOnly: true, + serializedName: "id", + type: { + name: "String" + } + }, + name: { + readOnly: true, + serializedName: "name", + type: { + name: "String" + } + }, + type: { + readOnly: true, + serializedName: "type", + type: { + name: "String" + } + }, + etag: { + readOnly: true, + serializedName: "etag", + type: { + name: "String" + } + } + } + } +}; + +export const Application: msRest.CompositeMapper = { + serializedName: "Application", + type: { + name: "Composite", + className: "Application", + modelProperties: { + ...ProxyResource.type.modelProperties, + displayName: { + serializedName: "properties.displayName", + type: { + name: "String" + } + }, + allowUpdates: { + serializedName: "properties.allowUpdates", + type: { + name: "Boolean" + } + }, + defaultVersion: { + serializedName: "properties.defaultVersion", + type: { + name: "String" + } + } + } + } +}; + +export const ApplicationPackage: msRest.CompositeMapper = { + serializedName: "ApplicationPackage", + type: { + name: "Composite", + className: "ApplicationPackage", + modelProperties: { + ...ProxyResource.type.modelProperties, + state: { + readOnly: true, + serializedName: "properties.state", + type: { + name: "Enum", + allowedValues: [ + "Pending", + "Active" + ] + } + }, + format: { + readOnly: true, + serializedName: "properties.format", + type: { + name: "String" + } + }, + storageUrl: { + readOnly: true, + serializedName: "properties.storageUrl", + type: { + name: "String" + } + }, + storageUrlExpiry: { + readOnly: true, + serializedName: "properties.storageUrlExpiry", + type: { + name: "DateTime" + } + }, + lastActivationTime: { + readOnly: true, + serializedName: "properties.lastActivationTime", + type: { + name: "DateTime" + } + } + } + } +}; + +export const BatchLocationQuota: msRest.CompositeMapper = { + serializedName: "BatchLocationQuota", + type: { + name: "Composite", + className: "BatchLocationQuota", + modelProperties: { + accountQuota: { + readOnly: true, + serializedName: "accountQuota", + type: { + name: "Number" + } + } + } + } +}; + +export const CertificateBaseProperties: msRest.CompositeMapper = { + serializedName: "CertificateBaseProperties", + type: { + name: "Composite", + className: "CertificateBaseProperties", + modelProperties: { + thumbprintAlgorithm: { + serializedName: "thumbprintAlgorithm", + type: { + name: "String" + } + }, + thumbprint: { + serializedName: "thumbprint", + type: { + name: "String" + } + }, + format: { + nullable: false, + serializedName: "format", + type: { + name: "Enum", + allowedValues: [ + "Pfx", + "Cer" + ] + } + } + } + } +}; + +export const DeleteCertificateError: msRest.CompositeMapper = { + serializedName: "DeleteCertificateError", + type: { + name: "Composite", + className: "DeleteCertificateError", + modelProperties: { + code: { + required: true, + serializedName: "code", + type: { + name: "String" + } + }, + message: { + required: true, + serializedName: "message", + type: { + name: "String" + } + }, + target: { + serializedName: "target", + type: { + name: "String" + } + }, + details: { + serializedName: "details", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "DeleteCertificateError" + } + } + } + } + } + } +}; + +export const Certificate: msRest.CompositeMapper = { + serializedName: "Certificate", + type: { + name: "Composite", + className: "Certificate", + modelProperties: { + ...ProxyResource.type.modelProperties, + thumbprintAlgorithm: { + serializedName: "properties.thumbprintAlgorithm", + type: { + name: "String" + } + }, + thumbprint: { + serializedName: "properties.thumbprint", + type: { + name: "String" + } + }, + format: { + nullable: false, + serializedName: "properties.format", + type: { + name: "Enum", + allowedValues: [ + "Pfx", + "Cer" + ] + } + }, + provisioningState: { + nullable: false, + readOnly: true, + serializedName: "properties.provisioningState", + type: { + name: "Enum", + allowedValues: [ + "Succeeded", + "Deleting", + "Failed" + ] + } + }, + provisioningStateTransitionTime: { + readOnly: true, + serializedName: "properties.provisioningStateTransitionTime", + type: { + name: "DateTime" + } + }, + previousProvisioningState: { + nullable: false, + readOnly: true, + serializedName: "properties.previousProvisioningState", + type: { + name: "Enum", + allowedValues: [ + "Succeeded", + "Deleting", + "Failed" + ] + } + }, + previousProvisioningStateTransitionTime: { + readOnly: true, + serializedName: "properties.previousProvisioningStateTransitionTime", + type: { + name: "DateTime" + } + }, + publicData: { + readOnly: true, + serializedName: "properties.publicData", + type: { + name: "String" + } + }, + deleteCertificateError: { + readOnly: true, + serializedName: "properties.deleteCertificateError", + type: { + name: "Composite", + className: "DeleteCertificateError" + } + } + } + } +}; + +export const CertificateCreateOrUpdateParameters: msRest.CompositeMapper = { + serializedName: "CertificateCreateOrUpdateParameters", + type: { + name: "Composite", + className: "CertificateCreateOrUpdateParameters", + modelProperties: { + ...ProxyResource.type.modelProperties, + thumbprintAlgorithm: { + serializedName: "properties.thumbprintAlgorithm", + type: { + name: "String" + } + }, + thumbprint: { + serializedName: "properties.thumbprint", + type: { + name: "String" + } + }, + format: { + nullable: false, + serializedName: "properties.format", + type: { + name: "Enum", + allowedValues: [ + "Pfx", + "Cer" + ] + } + }, + data: { + required: true, + serializedName: "properties.data", + type: { + name: "String" + } + }, + password: { + serializedName: "properties.password", + type: { + name: "String" + } + } + } + } +}; + +export const CloudServiceConfiguration: msRest.CompositeMapper = { + serializedName: "CloudServiceConfiguration", + type: { + name: "Composite", + className: "CloudServiceConfiguration", + modelProperties: { + osFamily: { + required: true, + serializedName: "osFamily", + type: { + name: "String" + } + }, + osVersion: { + serializedName: "osVersion", + type: { + name: "String" + } + } + } + } +}; + +export const ImageReference: msRest.CompositeMapper = { + serializedName: "ImageReference", + type: { + name: "Composite", + className: "ImageReference", + modelProperties: { + publisher: { + serializedName: "publisher", + type: { + name: "String" + } + }, + offer: { + serializedName: "offer", + type: { + name: "String" + } + }, + sku: { + serializedName: "sku", + type: { + name: "String" + } + }, + version: { + serializedName: "version", + type: { + name: "String" + } + }, + id: { + serializedName: "id", + type: { + name: "String" + } + } + } + } +}; + +export const WindowsConfiguration: msRest.CompositeMapper = { + serializedName: "WindowsConfiguration", + type: { + name: "Composite", + className: "WindowsConfiguration", + modelProperties: { + enableAutomaticUpdates: { + serializedName: "enableAutomaticUpdates", + type: { + name: "Boolean" + } + } + } + } +}; + +export const DataDisk: msRest.CompositeMapper = { + serializedName: "DataDisk", + type: { + name: "Composite", + className: "DataDisk", + modelProperties: { + lun: { + required: true, + serializedName: "lun", + type: { + name: "Number" + } + }, + caching: { + serializedName: "caching", + type: { + name: "Enum", + allowedValues: [ + "None", + "ReadOnly", + "ReadWrite" + ] + } + }, + diskSizeGB: { + required: true, + serializedName: "diskSizeGB", + type: { + name: "Number" + } + }, + storageAccountType: { + serializedName: "storageAccountType", + type: { + name: "Enum", + allowedValues: [ + "Standard_LRS", + "Premium_LRS" + ] + } + } + } + } +}; + +export const ContainerRegistry: msRest.CompositeMapper = { + serializedName: "ContainerRegistry", + type: { + name: "Composite", + className: "ContainerRegistry", + modelProperties: { + registryServer: { + serializedName: "registryServer", + type: { + name: "String" + } + }, + userName: { + required: true, + serializedName: "username", + type: { + name: "String" + } + }, + password: { + required: true, + serializedName: "password", + type: { + name: "String" + } + } + } + } +}; + +export const ContainerConfiguration: msRest.CompositeMapper = { + serializedName: "ContainerConfiguration", + type: { + name: "Composite", + className: "ContainerConfiguration", + modelProperties: { + type: { + required: true, + isConstant: true, + serializedName: "type", + defaultValue: 'DockerCompatible', + type: { + name: "String" + } + }, + containerImageNames: { + serializedName: "containerImageNames", + type: { + name: "Sequence", + element: { + type: { + name: "String" + } + } + } + }, + containerRegistries: { + serializedName: "containerRegistries", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "ContainerRegistry" + } + } + } + } + } + } +}; + +export const VirtualMachineConfiguration: msRest.CompositeMapper = { + serializedName: "VirtualMachineConfiguration", + type: { + name: "Composite", + className: "VirtualMachineConfiguration", + modelProperties: { + imageReference: { + required: true, + serializedName: "imageReference", + type: { + name: "Composite", + className: "ImageReference" + } + }, + nodeAgentSkuId: { + required: true, + serializedName: "nodeAgentSkuId", + type: { + name: "String" + } + }, + windowsConfiguration: { + serializedName: "windowsConfiguration", + type: { + name: "Composite", + className: "WindowsConfiguration" + } + }, + dataDisks: { + serializedName: "dataDisks", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "DataDisk" + } + } + } + }, + licenseType: { + serializedName: "licenseType", + type: { + name: "String" + } + }, + containerConfiguration: { + serializedName: "containerConfiguration", + type: { + name: "Composite", + className: "ContainerConfiguration" + } + } + } + } +}; + +export const DeploymentConfiguration: msRest.CompositeMapper = { + serializedName: "DeploymentConfiguration", + type: { + name: "Composite", + className: "DeploymentConfiguration", + modelProperties: { + cloudServiceConfiguration: { + serializedName: "cloudServiceConfiguration", + type: { + name: "Composite", + className: "CloudServiceConfiguration" + } + }, + virtualMachineConfiguration: { + serializedName: "virtualMachineConfiguration", + type: { + name: "Composite", + className: "VirtualMachineConfiguration" + } + } + } + } +}; + +export const FixedScaleSettings: msRest.CompositeMapper = { + serializedName: "FixedScaleSettings", + type: { + name: "Composite", + className: "FixedScaleSettings", + modelProperties: { + resizeTimeout: { + serializedName: "resizeTimeout", + type: { + name: "TimeSpan" + } + }, + targetDedicatedNodes: { + serializedName: "targetDedicatedNodes", + type: { + name: "Number" + } + }, + targetLowPriorityNodes: { + serializedName: "targetLowPriorityNodes", + type: { + name: "Number" + } + }, + nodeDeallocationOption: { + serializedName: "nodeDeallocationOption", + type: { + name: "Enum", + allowedValues: [ + "Requeue", + "Terminate", + "TaskCompletion", + "RetainedData" + ] + } + } + } + } +}; + +export const AutoScaleSettings: msRest.CompositeMapper = { + serializedName: "AutoScaleSettings", + type: { + name: "Composite", + className: "AutoScaleSettings", + modelProperties: { + formula: { + required: true, + serializedName: "formula", + type: { + name: "String" + } + }, + evaluationInterval: { + serializedName: "evaluationInterval", + type: { + name: "TimeSpan" + } + } + } + } +}; + +export const ScaleSettings: msRest.CompositeMapper = { + serializedName: "ScaleSettings", + type: { + name: "Composite", + className: "ScaleSettings", + modelProperties: { + fixedScale: { + serializedName: "fixedScale", + type: { + name: "Composite", + className: "FixedScaleSettings" + } + }, + autoScale: { + serializedName: "autoScale", + type: { + name: "Composite", + className: "AutoScaleSettings" + } + } + } + } +}; + +export const AutoScaleRunError: msRest.CompositeMapper = { + serializedName: "AutoScaleRunError", + type: { + name: "Composite", + className: "AutoScaleRunError", + modelProperties: { + code: { + required: true, + serializedName: "code", + type: { + name: "String" + } + }, + message: { + required: true, + serializedName: "message", + type: { + name: "String" + } + }, + details: { + serializedName: "details", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "AutoScaleRunError" + } + } + } + } + } + } +}; + +export const AutoScaleRun: msRest.CompositeMapper = { + serializedName: "AutoScaleRun", + type: { + name: "Composite", + className: "AutoScaleRun", + modelProperties: { + evaluationTime: { + required: true, + serializedName: "evaluationTime", + type: { + name: "DateTime" + } + }, + results: { + serializedName: "results", + type: { + name: "String" + } + }, + error: { + serializedName: "error", + type: { + name: "Composite", + className: "AutoScaleRunError" + } + } + } + } +}; + +export const NetworkSecurityGroupRule: msRest.CompositeMapper = { + serializedName: "NetworkSecurityGroupRule", + type: { + name: "Composite", + className: "NetworkSecurityGroupRule", + modelProperties: { + priority: { + required: true, + serializedName: "priority", + type: { + name: "Number" + } + }, + access: { + required: true, + serializedName: "access", + type: { + name: "Enum", + allowedValues: [ + "Allow", + "Deny" + ] + } + }, + sourceAddressPrefix: { + required: true, + serializedName: "sourceAddressPrefix", + type: { + name: "String" + } + } + } + } +}; + +export const InboundNatPool: msRest.CompositeMapper = { + serializedName: "InboundNatPool", + type: { + name: "Composite", + className: "InboundNatPool", + modelProperties: { + name: { + required: true, + serializedName: "name", + type: { + name: "String" + } + }, + protocol: { + required: true, + serializedName: "protocol", + type: { + name: "Enum", + allowedValues: [ + "TCP", + "UDP" + ] + } + }, + backendPort: { + required: true, + serializedName: "backendPort", + type: { + name: "Number" + } + }, + frontendPortRangeStart: { + required: true, + serializedName: "frontendPortRangeStart", + type: { + name: "Number" + } + }, + frontendPortRangeEnd: { + required: true, + serializedName: "frontendPortRangeEnd", + type: { + name: "Number" + } + }, + networkSecurityGroupRules: { + serializedName: "networkSecurityGroupRules", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "NetworkSecurityGroupRule" + } + } + } + } + } + } +}; + +export const PoolEndpointConfiguration: msRest.CompositeMapper = { + serializedName: "PoolEndpointConfiguration", + type: { + name: "Composite", + className: "PoolEndpointConfiguration", + modelProperties: { + inboundNatPools: { + required: true, + serializedName: "inboundNatPools", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "InboundNatPool" + } + } + } + } + } + } +}; + +export const NetworkConfiguration: msRest.CompositeMapper = { + serializedName: "NetworkConfiguration", + type: { + name: "Composite", + className: "NetworkConfiguration", + modelProperties: { + subnetId: { + serializedName: "subnetId", + type: { + name: "String" + } + }, + endpointConfiguration: { + serializedName: "endpointConfiguration", + type: { + name: "Composite", + className: "PoolEndpointConfiguration" + } + } + } + } +}; + +export const TaskSchedulingPolicy: msRest.CompositeMapper = { + serializedName: "TaskSchedulingPolicy", + type: { + name: "Composite", + className: "TaskSchedulingPolicy", + modelProperties: { + nodeFillType: { + required: true, + serializedName: "nodeFillType", + type: { + name: "Enum", + allowedValues: [ + "Spread", + "Pack" + ] + } + } + } + } +}; + +export const LinuxUserConfiguration: msRest.CompositeMapper = { + serializedName: "LinuxUserConfiguration", + type: { + name: "Composite", + className: "LinuxUserConfiguration", + modelProperties: { + uid: { + serializedName: "uid", + type: { + name: "Number" + } + }, + gid: { + serializedName: "gid", + type: { + name: "Number" + } + }, + sshPrivateKey: { + serializedName: "sshPrivateKey", + type: { + name: "String" + } + } + } + } +}; + +export const WindowsUserConfiguration: msRest.CompositeMapper = { + serializedName: "WindowsUserConfiguration", + type: { + name: "Composite", + className: "WindowsUserConfiguration", + modelProperties: { + loginMode: { + serializedName: "loginMode", + type: { + name: "Enum", + allowedValues: [ + "Batch", + "Interactive" + ] + } + } + } + } +}; + +export const UserAccount: msRest.CompositeMapper = { + serializedName: "UserAccount", + type: { + name: "Composite", + className: "UserAccount", + modelProperties: { + name: { + required: true, + serializedName: "name", + type: { + name: "String" + } + }, + password: { + required: true, + serializedName: "password", + type: { + name: "String" + } + }, + elevationLevel: { + serializedName: "elevationLevel", + type: { + name: "Enum", + allowedValues: [ + "NonAdmin", + "Admin" + ] + } + }, + linuxUserConfiguration: { + serializedName: "linuxUserConfiguration", + type: { + name: "Composite", + className: "LinuxUserConfiguration" + } + }, + windowsUserConfiguration: { + serializedName: "windowsUserConfiguration", + type: { + name: "Composite", + className: "WindowsUserConfiguration" + } + } + } + } +}; + +export const MetadataItem: msRest.CompositeMapper = { + serializedName: "MetadataItem", + type: { + name: "Composite", + className: "MetadataItem", + modelProperties: { + name: { + required: true, + serializedName: "name", + type: { + name: "String" + } + }, + value: { + required: true, + serializedName: "value", + type: { + name: "String" + } + } + } + } +}; + +export const ResourceFile: msRest.CompositeMapper = { + serializedName: "ResourceFile", + type: { + name: "Composite", + className: "ResourceFile", + modelProperties: { + autoStorageContainerName: { + serializedName: "autoStorageContainerName", + type: { + name: "String" + } + }, + storageContainerUrl: { + serializedName: "storageContainerUrl", + type: { + name: "String" + } + }, + httpUrl: { + serializedName: "httpUrl", + type: { + name: "String" + } + }, + blobPrefix: { + serializedName: "blobPrefix", + type: { + name: "String" + } + }, + filePath: { + serializedName: "filePath", + type: { + name: "String" + } + }, + fileMode: { + serializedName: "fileMode", + type: { + name: "String" + } + } + } + } +}; + +export const EnvironmentSetting: msRest.CompositeMapper = { + serializedName: "EnvironmentSetting", + type: { + name: "Composite", + className: "EnvironmentSetting", + modelProperties: { + name: { + required: true, + serializedName: "name", + type: { + name: "String" + } + }, + value: { + serializedName: "value", + type: { + name: "String" + } + } + } + } +}; + +export const AutoUserSpecification: msRest.CompositeMapper = { + serializedName: "AutoUserSpecification", + type: { + name: "Composite", + className: "AutoUserSpecification", + modelProperties: { + scope: { + serializedName: "scope", + type: { + name: "Enum", + allowedValues: [ + "Task", + "Pool" + ] + } + }, + elevationLevel: { + serializedName: "elevationLevel", + type: { + name: "Enum", + allowedValues: [ + "NonAdmin", + "Admin" + ] + } + } + } + } +}; + +export const UserIdentity: msRest.CompositeMapper = { + serializedName: "UserIdentity", + type: { + name: "Composite", + className: "UserIdentity", + modelProperties: { + userName: { + serializedName: "userName", + type: { + name: "String" + } + }, + autoUser: { + serializedName: "autoUser", + type: { + name: "Composite", + className: "AutoUserSpecification" + } + } + } + } +}; + +export const TaskContainerSettings: msRest.CompositeMapper = { + serializedName: "TaskContainerSettings", + type: { + name: "Composite", + className: "TaskContainerSettings", + modelProperties: { + containerRunOptions: { + serializedName: "containerRunOptions", + type: { + name: "String" + } + }, + imageName: { + required: true, + serializedName: "imageName", + type: { + name: "String" + } + }, + registry: { + serializedName: "registry", + type: { + name: "Composite", + className: "ContainerRegistry" + } + } + } + } +}; + +export const StartTask: msRest.CompositeMapper = { + serializedName: "StartTask", + type: { + name: "Composite", + className: "StartTask", + modelProperties: { + commandLine: { + serializedName: "commandLine", + type: { + name: "String" + } + }, + resourceFiles: { + serializedName: "resourceFiles", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "ResourceFile" + } + } + } + }, + environmentSettings: { + serializedName: "environmentSettings", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "EnvironmentSetting" + } + } + } + }, + userIdentity: { + serializedName: "userIdentity", + type: { + name: "Composite", + className: "UserIdentity" + } + }, + maxTaskRetryCount: { + serializedName: "maxTaskRetryCount", + type: { + name: "Number" + } + }, + waitForSuccess: { + serializedName: "waitForSuccess", + type: { + name: "Boolean" + } + }, + containerSettings: { + serializedName: "containerSettings", + type: { + name: "Composite", + className: "TaskContainerSettings" + } + } + } + } +}; + +export const CertificateReference: msRest.CompositeMapper = { + serializedName: "CertificateReference", + type: { + name: "Composite", + className: "CertificateReference", + modelProperties: { + id: { + required: true, + serializedName: "id", + type: { + name: "String" + } + }, + storeLocation: { + serializedName: "storeLocation", + type: { + name: "Enum", + allowedValues: [ + "CurrentUser", + "LocalMachine" + ] + } + }, + storeName: { + serializedName: "storeName", + type: { + name: "String" + } + }, + visibility: { + serializedName: "visibility", + type: { + name: "Sequence", + element: { + type: { + name: "Enum", + allowedValues: [ + "StartTask", + "Task", + "RemoteUser" + ] + } + } + } + } + } + } +}; + +export const ApplicationPackageReference: msRest.CompositeMapper = { + serializedName: "ApplicationPackageReference", + type: { + name: "Composite", + className: "ApplicationPackageReference", + modelProperties: { + id: { + required: true, + serializedName: "id", + type: { + name: "String" + } + }, + version: { + serializedName: "version", + type: { + name: "String" + } + } + } + } +}; + +export const ResizeError: msRest.CompositeMapper = { + serializedName: "ResizeError", + type: { + name: "Composite", + className: "ResizeError", + modelProperties: { + code: { + required: true, + serializedName: "code", + type: { + name: "String" + } + }, + message: { + required: true, + serializedName: "message", + type: { + name: "String" + } + }, + details: { + serializedName: "details", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "ResizeError" + } + } + } + } + } + } +}; + +export const ResizeOperationStatus: msRest.CompositeMapper = { + serializedName: "ResizeOperationStatus", + type: { + name: "Composite", + className: "ResizeOperationStatus", + modelProperties: { + targetDedicatedNodes: { + serializedName: "targetDedicatedNodes", + type: { + name: "Number" + } + }, + targetLowPriorityNodes: { + serializedName: "targetLowPriorityNodes", + type: { + name: "Number" + } + }, + resizeTimeout: { + serializedName: "resizeTimeout", + type: { + name: "TimeSpan" + } + }, + nodeDeallocationOption: { + serializedName: "nodeDeallocationOption", + type: { + name: "Enum", + allowedValues: [ + "Requeue", + "Terminate", + "TaskCompletion", + "RetainedData" + ] + } + }, + startTime: { + serializedName: "startTime", + type: { + name: "DateTime" + } + }, + errors: { + serializedName: "errors", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "ResizeError" + } + } + } + } + } + } +}; + +export const Pool: msRest.CompositeMapper = { + serializedName: "Pool", + type: { + name: "Composite", + className: "Pool", + modelProperties: { + ...ProxyResource.type.modelProperties, + displayName: { + serializedName: "properties.displayName", + type: { + name: "String" + } + }, + lastModified: { + readOnly: true, + serializedName: "properties.lastModified", + type: { + name: "DateTime" + } + }, + creationTime: { + readOnly: true, + serializedName: "properties.creationTime", + type: { + name: "DateTime" + } + }, + provisioningState: { + readOnly: true, + serializedName: "properties.provisioningState", + type: { + name: "Enum", + allowedValues: [ + "Succeeded", + "Deleting" + ] + } + }, + provisioningStateTransitionTime: { + readOnly: true, + serializedName: "properties.provisioningStateTransitionTime", + type: { + name: "DateTime" + } + }, + allocationState: { + readOnly: true, + serializedName: "properties.allocationState", + type: { + name: "Enum", + allowedValues: [ + "Steady", + "Resizing", + "Stopping" + ] + } + }, + allocationStateTransitionTime: { + readOnly: true, + serializedName: "properties.allocationStateTransitionTime", + type: { + name: "DateTime" + } + }, + vmSize: { + serializedName: "properties.vmSize", + type: { + name: "String" + } + }, + deploymentConfiguration: { + serializedName: "properties.deploymentConfiguration", + type: { + name: "Composite", + className: "DeploymentConfiguration" + } + }, + currentDedicatedNodes: { + readOnly: true, + serializedName: "properties.currentDedicatedNodes", + type: { + name: "Number" + } + }, + currentLowPriorityNodes: { + readOnly: true, + serializedName: "properties.currentLowPriorityNodes", + type: { + name: "Number" + } + }, + scaleSettings: { + serializedName: "properties.scaleSettings", + type: { + name: "Composite", + className: "ScaleSettings" + } + }, + autoScaleRun: { + readOnly: true, + serializedName: "properties.autoScaleRun", + type: { + name: "Composite", + className: "AutoScaleRun" + } + }, + interNodeCommunication: { + serializedName: "properties.interNodeCommunication", + type: { + name: "Enum", + allowedValues: [ + "Enabled", + "Disabled" + ] + } + }, + networkConfiguration: { + serializedName: "properties.networkConfiguration", + type: { + name: "Composite", + className: "NetworkConfiguration" + } + }, + maxTasksPerNode: { + serializedName: "properties.maxTasksPerNode", + type: { + name: "Number" + } + }, + taskSchedulingPolicy: { + serializedName: "properties.taskSchedulingPolicy", + type: { + name: "Composite", + className: "TaskSchedulingPolicy" + } + }, + userAccounts: { + serializedName: "properties.userAccounts", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "UserAccount" + } + } + } + }, + metadata: { + serializedName: "properties.metadata", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "MetadataItem" + } + } + } + }, + startTask: { + serializedName: "properties.startTask", + type: { + name: "Composite", + className: "StartTask" + } + }, + certificates: { + serializedName: "properties.certificates", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "CertificateReference" + } + } + } + }, + applicationPackages: { + serializedName: "properties.applicationPackages", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "ApplicationPackageReference" + } + } + } + }, + applicationLicenses: { + serializedName: "properties.applicationLicenses", + type: { + name: "Sequence", + element: { + type: { + name: "String" + } + } + } + }, + resizeOperationStatus: { + readOnly: true, + serializedName: "properties.resizeOperationStatus", + type: { + name: "Composite", + className: "ResizeOperationStatus" + } + } + } + } +}; + +export const OperationDisplay: msRest.CompositeMapper = { + serializedName: "Operation_display", + type: { + name: "Composite", + className: "OperationDisplay", + modelProperties: { + provider: { + serializedName: "provider", + type: { + name: "String" + } + }, + operation: { + serializedName: "operation", + type: { + name: "String" + } + }, + resource: { + serializedName: "resource", + type: { + name: "String" + } + }, + description: { + serializedName: "description", + type: { + name: "String" + } + } + } + } +}; + +export const Operation: msRest.CompositeMapper = { + serializedName: "Operation", + type: { + name: "Composite", + className: "Operation", + modelProperties: { + name: { + serializedName: "name", + type: { + name: "String" + } + }, + display: { + serializedName: "display", + type: { + name: "Composite", + className: "OperationDisplay" + } + }, + origin: { + serializedName: "origin", + type: { + name: "String" + } + }, + properties: { + serializedName: "properties", + type: { + name: "Object" + } + } + } + } +}; + +export const CheckNameAvailabilityParameters: msRest.CompositeMapper = { + serializedName: "CheckNameAvailabilityParameters", + type: { + name: "Composite", + className: "CheckNameAvailabilityParameters", + modelProperties: { + name: { + required: true, + serializedName: "name", + type: { + name: "String" + } + }, + type: { + required: true, + isConstant: true, + serializedName: "type", + defaultValue: 'Microsoft.Batch/batchAccounts', + type: { + name: "String" + } + } + } + } +}; + +export const CheckNameAvailabilityResult: msRest.CompositeMapper = { + serializedName: "CheckNameAvailabilityResult", + type: { + name: "Composite", + className: "CheckNameAvailabilityResult", + modelProperties: { + nameAvailable: { + readOnly: true, + serializedName: "nameAvailable", + type: { + name: "Boolean" + } + }, + reason: { + readOnly: true, + serializedName: "reason", + type: { + name: "Enum", + allowedValues: [ + "Invalid", + "AlreadyExists" + ] + } + }, + message: { + readOnly: true, + serializedName: "message", + type: { + name: "String" + } + } + } + } +}; + +export const BatchAccountCreateHeaders: msRest.CompositeMapper = { + serializedName: "batchaccount-create-headers", + type: { + name: "Composite", + className: "BatchAccountCreateHeaders", + modelProperties: { + locationHeader: { + serializedName: "location", + type: { + name: "String" + } + }, + retryAfter: { + serializedName: "retry-after", + type: { + name: "Number" + } + } + } + } +}; + +export const BatchAccountDeleteHeaders: msRest.CompositeMapper = { + serializedName: "batchaccount-delete-headers", + type: { + name: "Composite", + className: "BatchAccountDeleteHeaders", + modelProperties: { + location: { + serializedName: "location", + type: { + name: "String" + } + }, + retryAfter: { + serializedName: "retry-after", + type: { + name: "Number" + } + } + } + } +}; + +export const CertificateCreateHeaders: msRest.CompositeMapper = { + serializedName: "certificate-create-headers", + type: { + name: "Composite", + className: "CertificateCreateHeaders", + modelProperties: { + eTag: { + serializedName: "etag", + type: { + name: "String" + } + } + } + } +}; + +export const CertificateUpdateHeaders: msRest.CompositeMapper = { + serializedName: "certificate-update-headers", + type: { + name: "Composite", + className: "CertificateUpdateHeaders", + modelProperties: { + eTag: { + serializedName: "etag", + type: { + name: "String" + } + } + } + } +}; + +export const CertificateDeleteHeaders: msRest.CompositeMapper = { + serializedName: "certificate-delete-headers", + type: { + name: "Composite", + className: "CertificateDeleteHeaders", + modelProperties: { + location: { + serializedName: "location", + type: { + name: "String" + } + }, + retryAfter: { + serializedName: "retry-after", + type: { + name: "Number" + } + } + } + } +}; + +export const CertificateGetHeaders: msRest.CompositeMapper = { + serializedName: "certificate-get-headers", + type: { + name: "Composite", + className: "CertificateGetHeaders", + modelProperties: { + eTag: { + serializedName: "etag", + type: { + name: "String" + } + } + } + } +}; + +export const CertificateCancelDeletionHeaders: msRest.CompositeMapper = { + serializedName: "certificate-canceldeletion-headers", + type: { + name: "Composite", + className: "CertificateCancelDeletionHeaders", + modelProperties: { + eTag: { + serializedName: "etag", + type: { + name: "String" + } + } + } + } +}; + +export const PoolCreateHeaders: msRest.CompositeMapper = { + serializedName: "pool-create-headers", + type: { + name: "Composite", + className: "PoolCreateHeaders", + modelProperties: { + eTag: { + serializedName: "etag", + type: { + name: "String" + } + } + } + } +}; + +export const PoolUpdateHeaders: msRest.CompositeMapper = { + serializedName: "pool-update-headers", + type: { + name: "Composite", + className: "PoolUpdateHeaders", + modelProperties: { + eTag: { + serializedName: "etag", + type: { + name: "String" + } + } + } + } +}; + +export const PoolDeleteHeaders: msRest.CompositeMapper = { + serializedName: "pool-delete-headers", + type: { + name: "Composite", + className: "PoolDeleteHeaders", + modelProperties: { + location: { + serializedName: "location", + type: { + name: "String" + } + }, + retryAfter: { + serializedName: "retry-after", + type: { + name: "Number" + } + } + } + } +}; + +export const PoolGetHeaders: msRest.CompositeMapper = { + serializedName: "pool-get-headers", + type: { + name: "Composite", + className: "PoolGetHeaders", + modelProperties: { + eTag: { + serializedName: "etag", + type: { + name: "String" + } + } + } + } +}; + +export const PoolDisableAutoScaleHeaders: msRest.CompositeMapper = { + serializedName: "pool-disableautoscale-headers", + type: { + name: "Composite", + className: "PoolDisableAutoScaleHeaders", + modelProperties: { + eTag: { + serializedName: "etag", + type: { + name: "String" + } + } + } + } +}; + +export const PoolStopResizeHeaders: msRest.CompositeMapper = { + serializedName: "pool-stopresize-headers", + type: { + name: "Composite", + className: "PoolStopResizeHeaders", + modelProperties: { + eTag: { + serializedName: "etag", + type: { + name: "String" + } + } + } + } +}; + +export const BatchAccountListResult: msRest.CompositeMapper = { + serializedName: "BatchAccountListResult", + type: { + name: "Composite", + className: "BatchAccountListResult", + modelProperties: { + value: { + serializedName: "", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "BatchAccount" + } + } + } + }, + nextLink: { + serializedName: "nextLink", + type: { + name: "String" + } + } + } + } +}; + +export const ListApplicationPackagesResult: msRest.CompositeMapper = { + serializedName: "ListApplicationPackagesResult", + type: { + name: "Composite", + className: "ListApplicationPackagesResult", + modelProperties: { + value: { + serializedName: "", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "ApplicationPackage" + } + } + } + }, + nextLink: { + serializedName: "nextLink", + type: { + name: "String" + } + } + } + } +}; + +export const ListApplicationsResult: msRest.CompositeMapper = { + serializedName: "ListApplicationsResult", + type: { + name: "Composite", + className: "ListApplicationsResult", + modelProperties: { + value: { + serializedName: "", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "Application" + } + } + } + }, + nextLink: { + serializedName: "nextLink", + type: { + name: "String" + } + } + } + } +}; + +export const OperationListResult: msRest.CompositeMapper = { + serializedName: "OperationListResult", + type: { + name: "Composite", + className: "OperationListResult", + modelProperties: { + value: { + serializedName: "", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "Operation" + } + } + } + }, + nextLink: { + serializedName: "nextLink", + type: { + name: "String" + } + } + } + } +}; + +export const ListCertificatesResult: msRest.CompositeMapper = { + serializedName: "ListCertificatesResult", + type: { + name: "Composite", + className: "ListCertificatesResult", + modelProperties: { + value: { + serializedName: "", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "Certificate" + } + } + } + }, + nextLink: { + serializedName: "nextLink", + type: { + name: "String" + } + } + } + } +}; + +export const ListPoolsResult: msRest.CompositeMapper = { + serializedName: "ListPoolsResult", + type: { + name: "Composite", + className: "ListPoolsResult", + modelProperties: { + value: { + serializedName: "", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "Pool" + } + } + } + }, + nextLink: { + serializedName: "nextLink", + type: { + name: "String" + } + } + } + } +}; diff --git a/sdk/batch/arm-batch/lib/models/operationsMappers.ts b/sdk/batch/arm-batch/lib/models/operationsMappers.ts new file mode 100644 index 000000000000..2edcc577920e --- /dev/null +++ b/sdk/batch/arm-batch/lib/models/operationsMappers.ts @@ -0,0 +1,17 @@ +/* + * 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. + */ + +export { + OperationListResult, + Operation, + OperationDisplay, + CloudError +} from "../models/mappers"; + diff --git a/sdk/batch/arm-batch/lib/models/parameters.ts b/sdk/batch/arm-batch/lib/models/parameters.ts new file mode 100644 index 000000000000..ca0a27c5f404 --- /dev/null +++ b/sdk/batch/arm-batch/lib/models/parameters.ts @@ -0,0 +1,208 @@ +/* + * 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. + */ + +import * as msRest from "@azure/ms-rest-js"; + +export const acceptLanguage: msRest.OperationParameter = { + parameterPath: "acceptLanguage", + mapper: { + serializedName: "accept-language", + defaultValue: 'en-US', + type: { + name: "String" + } + } +}; +export const accountName: msRest.OperationURLParameter = { + parameterPath: "accountName", + mapper: { + required: true, + serializedName: "accountName", + constraints: { + MaxLength: 24, + MinLength: 3, + Pattern: /^[-\w\._]+$/ + }, + type: { + name: "String" + } + } +}; +export const apiVersion: msRest.OperationQueryParameter = { + parameterPath: "apiVersion", + mapper: { + required: true, + serializedName: "api-version", + type: { + name: "String" + } + } +}; +export const applicationName: msRest.OperationURLParameter = { + parameterPath: "applicationName", + mapper: { + required: true, + serializedName: "applicationName", + constraints: { + MaxLength: 64, + MinLength: 1, + Pattern: /^[a-zA-Z0-9_-]+$/ + }, + type: { + name: "String" + } + } +}; +export const certificateName: msRest.OperationURLParameter = { + parameterPath: "certificateName", + mapper: { + required: true, + serializedName: "certificateName", + constraints: { + MaxLength: 45, + MinLength: 5, + Pattern: /^[\w]+-[\w]+$/ + }, + type: { + name: "String" + } + } +}; +export const filter: msRest.OperationQueryParameter = { + parameterPath: [ + "options", + "filter" + ], + mapper: { + serializedName: "$filter", + type: { + name: "String" + } + } +}; +export const ifMatch: msRest.OperationParameter = { + parameterPath: [ + "options", + "ifMatch" + ], + mapper: { + serializedName: "If-Match", + type: { + name: "String" + } + } +}; +export const ifNoneMatch: msRest.OperationParameter = { + parameterPath: [ + "options", + "ifNoneMatch" + ], + mapper: { + serializedName: "If-None-Match", + type: { + name: "String" + } + } +}; +export const locationName: msRest.OperationURLParameter = { + parameterPath: "locationName", + mapper: { + required: true, + serializedName: "locationName", + type: { + name: "String" + } + } +}; +export const maxresults: msRest.OperationQueryParameter = { + parameterPath: [ + "options", + "maxresults" + ], + mapper: { + serializedName: "maxresults", + type: { + name: "Number" + } + } +}; +export const nextPageLink: msRest.OperationURLParameter = { + parameterPath: "nextPageLink", + mapper: { + required: true, + serializedName: "nextLink", + type: { + name: "String" + } + }, + skipEncoding: true +}; +export const poolName: msRest.OperationURLParameter = { + parameterPath: "poolName", + mapper: { + required: true, + serializedName: "poolName", + constraints: { + MaxLength: 64, + MinLength: 1, + Pattern: /^[a-zA-Z0-9_-]+$/ + }, + type: { + name: "String" + } + } +}; +export const resourceGroupName: msRest.OperationURLParameter = { + parameterPath: "resourceGroupName", + mapper: { + required: true, + serializedName: "resourceGroupName", + type: { + name: "String" + } + } +}; +export const select: msRest.OperationQueryParameter = { + parameterPath: [ + "options", + "select" + ], + mapper: { + serializedName: "$select", + type: { + name: "String" + } + } +}; +export const subscriptionId: msRest.OperationURLParameter = { + parameterPath: "subscriptionId", + mapper: { + required: true, + serializedName: "subscriptionId", + type: { + name: "String" + } + } +}; +export const versionName: msRest.OperationURLParameter = { + parameterPath: "versionName", + mapper: { + required: true, + serializedName: "versionName", + constraints: { + MaxLength: 64, + MinLength: 1, + Pattern: /^[a-zA-Z0-9_-][a-zA-Z0-9_.-]*$/ + }, + type: { + name: "String" + } + } +}; diff --git a/sdk/batch/arm-batch/lib/models/poolOperationsMappers.ts b/sdk/batch/arm-batch/lib/models/poolOperationsMappers.ts new file mode 100644 index 000000000000..49afc6116e56 --- /dev/null +++ b/sdk/batch/arm-batch/lib/models/poolOperationsMappers.ts @@ -0,0 +1,67 @@ +/* + * 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. + */ + +export { + ListPoolsResult, + Pool, + ProxyResource, + BaseResource, + DeploymentConfiguration, + CloudServiceConfiguration, + VirtualMachineConfiguration, + ImageReference, + WindowsConfiguration, + DataDisk, + ContainerConfiguration, + ContainerRegistry, + ScaleSettings, + FixedScaleSettings, + AutoScaleSettings, + AutoScaleRun, + AutoScaleRunError, + NetworkConfiguration, + PoolEndpointConfiguration, + InboundNatPool, + NetworkSecurityGroupRule, + TaskSchedulingPolicy, + UserAccount, + LinuxUserConfiguration, + WindowsUserConfiguration, + MetadataItem, + StartTask, + ResourceFile, + EnvironmentSetting, + UserIdentity, + AutoUserSpecification, + TaskContainerSettings, + CertificateReference, + ApplicationPackageReference, + ResizeOperationStatus, + ResizeError, + CloudError, + PoolCreateHeaders, + PoolUpdateHeaders, + PoolDeleteHeaders, + PoolGetHeaders, + PoolDisableAutoScaleHeaders, + PoolStopResizeHeaders, + Application, + ApplicationPackage, + Resource, + Certificate, + DeleteCertificateError, + CertificateCreateOrUpdateParameters, + BatchAccount, + KeyVaultReference, + AutoStorageProperties, + AutoStorageBaseProperties, + VirtualMachineFamilyCoreQuota +} from "../models/mappers"; + diff --git a/sdk/batch/arm-batch/lib/operations/applicationOperations.ts b/sdk/batch/arm-batch/lib/operations/applicationOperations.ts new file mode 100644 index 000000000000..266b6fd533ce --- /dev/null +++ b/sdk/batch/arm-batch/lib/operations/applicationOperations.ts @@ -0,0 +1,402 @@ +/* + * 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. + */ + +import * as msRest from "@azure/ms-rest-js"; +import * as Models from "../models"; +import * as Mappers from "../models/applicationOperationsMappers"; +import * as Parameters from "../models/parameters"; +import { BatchManagementClientContext } from "../batchManagementClientContext"; + +/** Class representing a ApplicationOperations. */ +export class ApplicationOperations { + private readonly client: BatchManagementClientContext; + + /** + * Create a ApplicationOperations. + * @param {BatchManagementClientContext} client Reference to the service client. + */ + constructor(client: BatchManagementClientContext) { + this.client = client; + } + + /** + * Adds an application to the specified Batch account. + * @param resourceGroupName The name of the resource group that contains the Batch account. + * @param accountName The name of the Batch account. + * @param applicationName The name of the application. This must be unique within the account. + * @param [options] The optional parameters + * @returns Promise + */ + create(resourceGroupName: string, accountName: string, applicationName: string, options?: Models.ApplicationCreateOptionalParams): Promise; + /** + * @param resourceGroupName The name of the resource group that contains the Batch account. + * @param accountName The name of the Batch account. + * @param applicationName The name of the application. This must be unique within the account. + * @param callback The callback + */ + create(resourceGroupName: string, accountName: string, applicationName: string, callback: msRest.ServiceCallback): void; + /** + * @param resourceGroupName The name of the resource group that contains the Batch account. + * @param accountName The name of the Batch account. + * @param applicationName The name of the application. This must be unique within the account. + * @param options The optional parameters + * @param callback The callback + */ + create(resourceGroupName: string, accountName: string, applicationName: string, options: Models.ApplicationCreateOptionalParams, callback: msRest.ServiceCallback): void; + create(resourceGroupName: string, accountName: string, applicationName: string, options?: Models.ApplicationCreateOptionalParams | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + resourceGroupName, + accountName, + applicationName, + options + }, + createOperationSpec, + callback) as Promise; + } + + /** + * Deletes an application. + * @param resourceGroupName The name of the resource group that contains the Batch account. + * @param accountName The name of the Batch account. + * @param applicationName The name of the application. This must be unique within the account. + * @param [options] The optional parameters + * @returns Promise + */ + deleteMethod(resourceGroupName: string, accountName: string, applicationName: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param resourceGroupName The name of the resource group that contains the Batch account. + * @param accountName The name of the Batch account. + * @param applicationName The name of the application. This must be unique within the account. + * @param callback The callback + */ + deleteMethod(resourceGroupName: string, accountName: string, applicationName: string, callback: msRest.ServiceCallback): void; + /** + * @param resourceGroupName The name of the resource group that contains the Batch account. + * @param accountName The name of the Batch account. + * @param applicationName The name of the application. This must be unique within the account. + * @param options The optional parameters + * @param callback The callback + */ + deleteMethod(resourceGroupName: string, accountName: string, applicationName: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + deleteMethod(resourceGroupName: string, accountName: string, applicationName: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + resourceGroupName, + accountName, + applicationName, + options + }, + deleteMethodOperationSpec, + callback); + } + + /** + * Gets information about the specified application. + * @param resourceGroupName The name of the resource group that contains the Batch account. + * @param accountName The name of the Batch account. + * @param applicationName The name of the application. This must be unique within the account. + * @param [options] The optional parameters + * @returns Promise + */ + get(resourceGroupName: string, accountName: string, applicationName: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param resourceGroupName The name of the resource group that contains the Batch account. + * @param accountName The name of the Batch account. + * @param applicationName The name of the application. This must be unique within the account. + * @param callback The callback + */ + get(resourceGroupName: string, accountName: string, applicationName: string, callback: msRest.ServiceCallback): void; + /** + * @param resourceGroupName The name of the resource group that contains the Batch account. + * @param accountName The name of the Batch account. + * @param applicationName The name of the application. This must be unique within the account. + * @param options The optional parameters + * @param callback The callback + */ + get(resourceGroupName: string, accountName: string, applicationName: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + get(resourceGroupName: string, accountName: string, applicationName: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + resourceGroupName, + accountName, + applicationName, + options + }, + getOperationSpec, + callback) as Promise; + } + + /** + * Updates settings for the specified application. + * @param resourceGroupName The name of the resource group that contains the Batch account. + * @param accountName The name of the Batch account. + * @param applicationName The name of the application. This must be unique within the account. + * @param parameters The parameters for the request. + * @param [options] The optional parameters + * @returns Promise + */ + update(resourceGroupName: string, accountName: string, applicationName: string, parameters: Models.Application, options?: msRest.RequestOptionsBase): Promise; + /** + * @param resourceGroupName The name of the resource group that contains the Batch account. + * @param accountName The name of the Batch account. + * @param applicationName The name of the application. This must be unique within the account. + * @param parameters The parameters for the request. + * @param callback The callback + */ + update(resourceGroupName: string, accountName: string, applicationName: string, parameters: Models.Application, callback: msRest.ServiceCallback): void; + /** + * @param resourceGroupName The name of the resource group that contains the Batch account. + * @param accountName The name of the Batch account. + * @param applicationName The name of the application. This must be unique within the account. + * @param parameters The parameters for the request. + * @param options The optional parameters + * @param callback The callback + */ + update(resourceGroupName: string, accountName: string, applicationName: string, parameters: Models.Application, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + update(resourceGroupName: string, accountName: string, applicationName: string, parameters: Models.Application, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + resourceGroupName, + accountName, + applicationName, + parameters, + options + }, + updateOperationSpec, + callback) as Promise; + } + + /** + * Lists all of the applications in the specified account. + * @param resourceGroupName The name of the resource group that contains the Batch account. + * @param accountName The name of the Batch account. + * @param [options] The optional parameters + * @returns Promise + */ + list(resourceGroupName: string, accountName: string, options?: Models.ApplicationListOptionalParams): Promise; + /** + * @param resourceGroupName The name of the resource group that contains the Batch account. + * @param accountName The name of the Batch account. + * @param callback The callback + */ + list(resourceGroupName: string, accountName: string, callback: msRest.ServiceCallback): void; + /** + * @param resourceGroupName The name of the resource group that contains the Batch account. + * @param accountName The name of the Batch account. + * @param options The optional parameters + * @param callback The callback + */ + list(resourceGroupName: string, accountName: string, options: Models.ApplicationListOptionalParams, callback: msRest.ServiceCallback): void; + list(resourceGroupName: string, accountName: string, options?: Models.ApplicationListOptionalParams | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + resourceGroupName, + accountName, + options + }, + listOperationSpec, + callback) as Promise; + } + + /** + * Lists all of the applications in the specified account. + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param [options] The optional parameters + * @returns Promise + */ + listNext(nextPageLink: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param callback The callback + */ + listNext(nextPageLink: string, callback: msRest.ServiceCallback): void; + /** + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param options The optional parameters + * @param callback The callback + */ + listNext(nextPageLink: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + listNext(nextPageLink: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + nextPageLink, + options + }, + listNextOperationSpec, + callback) as Promise; + } +} + +// Operation Specifications +const serializer = new msRest.Serializer(Mappers); +const createOperationSpec: msRest.OperationSpec = { + httpMethod: "PUT", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Batch/batchAccounts/{accountName}/applications/{applicationName}", + urlParameters: [ + Parameters.resourceGroupName, + Parameters.accountName, + Parameters.applicationName, + Parameters.subscriptionId + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + requestBody: { + parameterPath: [ + "options", + "parameters" + ], + mapper: Mappers.Application + }, + responses: { + 200: { + bodyMapper: Mappers.Application + }, + default: { + bodyMapper: Mappers.CloudError + } + }, + serializer +}; + +const deleteMethodOperationSpec: msRest.OperationSpec = { + httpMethod: "DELETE", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Batch/batchAccounts/{accountName}/applications/{applicationName}", + urlParameters: [ + Parameters.resourceGroupName, + Parameters.accountName, + Parameters.applicationName, + Parameters.subscriptionId + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: {}, + 204: {}, + default: { + bodyMapper: Mappers.CloudError + } + }, + serializer +}; + +const getOperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Batch/batchAccounts/{accountName}/applications/{applicationName}", + urlParameters: [ + Parameters.resourceGroupName, + Parameters.accountName, + Parameters.applicationName, + Parameters.subscriptionId + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.Application + }, + default: { + bodyMapper: Mappers.CloudError + } + }, + serializer +}; + +const updateOperationSpec: msRest.OperationSpec = { + httpMethod: "PATCH", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Batch/batchAccounts/{accountName}/applications/{applicationName}", + urlParameters: [ + Parameters.resourceGroupName, + Parameters.accountName, + Parameters.applicationName, + Parameters.subscriptionId + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + requestBody: { + parameterPath: "parameters", + mapper: { + ...Mappers.Application, + required: true + } + }, + responses: { + 200: { + bodyMapper: Mappers.Application + }, + default: { + bodyMapper: Mappers.CloudError + } + }, + serializer +}; + +const listOperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Batch/batchAccounts/{accountName}/applications", + urlParameters: [ + Parameters.resourceGroupName, + Parameters.accountName, + Parameters.subscriptionId + ], + queryParameters: [ + Parameters.maxresults, + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.ListApplicationsResult + }, + default: { + bodyMapper: Mappers.CloudError + } + }, + serializer +}; + +const listNextOperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + baseUrl: "https://management.azure.com", + path: "{nextLink}", + urlParameters: [ + Parameters.nextPageLink + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.ListApplicationsResult + }, + default: { + bodyMapper: Mappers.CloudError + } + }, + serializer +}; diff --git a/sdk/batch/arm-batch/lib/operations/applicationPackageOperations.ts b/sdk/batch/arm-batch/lib/operations/applicationPackageOperations.ts new file mode 100644 index 000000000000..9ec0b70e3c1e --- /dev/null +++ b/sdk/batch/arm-batch/lib/operations/applicationPackageOperations.ts @@ -0,0 +1,429 @@ +/* + * 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. + */ + +import * as msRest from "@azure/ms-rest-js"; +import * as Models from "../models"; +import * as Mappers from "../models/applicationPackageOperationsMappers"; +import * as Parameters from "../models/parameters"; +import { BatchManagementClientContext } from "../batchManagementClientContext"; + +/** Class representing a ApplicationPackageOperations. */ +export class ApplicationPackageOperations { + private readonly client: BatchManagementClientContext; + + /** + * Create a ApplicationPackageOperations. + * @param {BatchManagementClientContext} client Reference to the service client. + */ + constructor(client: BatchManagementClientContext) { + this.client = client; + } + + /** + * Activates the specified application package. + * @param resourceGroupName The name of the resource group that contains the Batch account. + * @param accountName The name of the Batch account. + * @param applicationName The name of the application. This must be unique within the account. + * @param versionName The version of the application. + * @param format The format of the application package binary file. + * @param [options] The optional parameters + * @returns Promise + */ + activate(resourceGroupName: string, accountName: string, applicationName: string, versionName: string, format: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param resourceGroupName The name of the resource group that contains the Batch account. + * @param accountName The name of the Batch account. + * @param applicationName The name of the application. This must be unique within the account. + * @param versionName The version of the application. + * @param format The format of the application package binary file. + * @param callback The callback + */ + activate(resourceGroupName: string, accountName: string, applicationName: string, versionName: string, format: string, callback: msRest.ServiceCallback): void; + /** + * @param resourceGroupName The name of the resource group that contains the Batch account. + * @param accountName The name of the Batch account. + * @param applicationName The name of the application. This must be unique within the account. + * @param versionName The version of the application. + * @param format The format of the application package binary file. + * @param options The optional parameters + * @param callback The callback + */ + activate(resourceGroupName: string, accountName: string, applicationName: string, versionName: string, format: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + activate(resourceGroupName: string, accountName: string, applicationName: string, versionName: string, format: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + resourceGroupName, + accountName, + applicationName, + versionName, + format, + options + }, + activateOperationSpec, + callback) as Promise; + } + + /** + * Creates an application package record. + * @param resourceGroupName The name of the resource group that contains the Batch account. + * @param accountName The name of the Batch account. + * @param applicationName The name of the application. This must be unique within the account. + * @param versionName The version of the application. + * @param [options] The optional parameters + * @returns Promise + */ + create(resourceGroupName: string, accountName: string, applicationName: string, versionName: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param resourceGroupName The name of the resource group that contains the Batch account. + * @param accountName The name of the Batch account. + * @param applicationName The name of the application. This must be unique within the account. + * @param versionName The version of the application. + * @param callback The callback + */ + create(resourceGroupName: string, accountName: string, applicationName: string, versionName: string, callback: msRest.ServiceCallback): void; + /** + * @param resourceGroupName The name of the resource group that contains the Batch account. + * @param accountName The name of the Batch account. + * @param applicationName The name of the application. This must be unique within the account. + * @param versionName The version of the application. + * @param options The optional parameters + * @param callback The callback + */ + create(resourceGroupName: string, accountName: string, applicationName: string, versionName: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + create(resourceGroupName: string, accountName: string, applicationName: string, versionName: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + resourceGroupName, + accountName, + applicationName, + versionName, + options + }, + createOperationSpec, + callback) as Promise; + } + + /** + * Deletes an application package record and its associated binary file. + * @param resourceGroupName The name of the resource group that contains the Batch account. + * @param accountName The name of the Batch account. + * @param applicationName The name of the application. This must be unique within the account. + * @param versionName The version of the application. + * @param [options] The optional parameters + * @returns Promise + */ + deleteMethod(resourceGroupName: string, accountName: string, applicationName: string, versionName: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param resourceGroupName The name of the resource group that contains the Batch account. + * @param accountName The name of the Batch account. + * @param applicationName The name of the application. This must be unique within the account. + * @param versionName The version of the application. + * @param callback The callback + */ + deleteMethod(resourceGroupName: string, accountName: string, applicationName: string, versionName: string, callback: msRest.ServiceCallback): void; + /** + * @param resourceGroupName The name of the resource group that contains the Batch account. + * @param accountName The name of the Batch account. + * @param applicationName The name of the application. This must be unique within the account. + * @param versionName The version of the application. + * @param options The optional parameters + * @param callback The callback + */ + deleteMethod(resourceGroupName: string, accountName: string, applicationName: string, versionName: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + deleteMethod(resourceGroupName: string, accountName: string, applicationName: string, versionName: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + resourceGroupName, + accountName, + applicationName, + versionName, + options + }, + deleteMethodOperationSpec, + callback); + } + + /** + * Gets information about the specified application package. + * @param resourceGroupName The name of the resource group that contains the Batch account. + * @param accountName The name of the Batch account. + * @param applicationName The name of the application. This must be unique within the account. + * @param versionName The version of the application. + * @param [options] The optional parameters + * @returns Promise + */ + get(resourceGroupName: string, accountName: string, applicationName: string, versionName: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param resourceGroupName The name of the resource group that contains the Batch account. + * @param accountName The name of the Batch account. + * @param applicationName The name of the application. This must be unique within the account. + * @param versionName The version of the application. + * @param callback The callback + */ + get(resourceGroupName: string, accountName: string, applicationName: string, versionName: string, callback: msRest.ServiceCallback): void; + /** + * @param resourceGroupName The name of the resource group that contains the Batch account. + * @param accountName The name of the Batch account. + * @param applicationName The name of the application. This must be unique within the account. + * @param versionName The version of the application. + * @param options The optional parameters + * @param callback The callback + */ + get(resourceGroupName: string, accountName: string, applicationName: string, versionName: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + get(resourceGroupName: string, accountName: string, applicationName: string, versionName: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + resourceGroupName, + accountName, + applicationName, + versionName, + options + }, + getOperationSpec, + callback) as Promise; + } + + /** + * Lists all of the application packages in the specified application. + * @param resourceGroupName The name of the resource group that contains the Batch account. + * @param accountName The name of the Batch account. + * @param applicationName The name of the application. This must be unique within the account. + * @param [options] The optional parameters + * @returns Promise + */ + list(resourceGroupName: string, accountName: string, applicationName: string, options?: Models.ApplicationPackageListOptionalParams): Promise; + /** + * @param resourceGroupName The name of the resource group that contains the Batch account. + * @param accountName The name of the Batch account. + * @param applicationName The name of the application. This must be unique within the account. + * @param callback The callback + */ + list(resourceGroupName: string, accountName: string, applicationName: string, callback: msRest.ServiceCallback): void; + /** + * @param resourceGroupName The name of the resource group that contains the Batch account. + * @param accountName The name of the Batch account. + * @param applicationName The name of the application. This must be unique within the account. + * @param options The optional parameters + * @param callback The callback + */ + list(resourceGroupName: string, accountName: string, applicationName: string, options: Models.ApplicationPackageListOptionalParams, callback: msRest.ServiceCallback): void; + list(resourceGroupName: string, accountName: string, applicationName: string, options?: Models.ApplicationPackageListOptionalParams | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + resourceGroupName, + accountName, + applicationName, + options + }, + listOperationSpec, + callback) as Promise; + } + + /** + * Lists all of the application packages in the specified application. + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param [options] The optional parameters + * @returns Promise + */ + listNext(nextPageLink: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param callback The callback + */ + listNext(nextPageLink: string, callback: msRest.ServiceCallback): void; + /** + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param options The optional parameters + * @param callback The callback + */ + listNext(nextPageLink: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + listNext(nextPageLink: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + nextPageLink, + options + }, + listNextOperationSpec, + callback) as Promise; + } +} + +// Operation Specifications +const serializer = new msRest.Serializer(Mappers); +const activateOperationSpec: msRest.OperationSpec = { + httpMethod: "POST", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Batch/batchAccounts/{accountName}/applications/{applicationName}/versions/{versionName}/activate", + urlParameters: [ + Parameters.resourceGroupName, + Parameters.accountName, + Parameters.applicationName, + Parameters.versionName, + Parameters.subscriptionId + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + requestBody: { + parameterPath: { + format: "format" + }, + mapper: { + ...Mappers.ActivateApplicationPackageParameters, + required: true + } + }, + responses: { + 200: { + bodyMapper: Mappers.ApplicationPackage + }, + default: { + bodyMapper: Mappers.CloudError + } + }, + serializer +}; + +const createOperationSpec: msRest.OperationSpec = { + httpMethod: "PUT", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Batch/batchAccounts/{accountName}/applications/{applicationName}/versions/{versionName}", + urlParameters: [ + Parameters.resourceGroupName, + Parameters.accountName, + Parameters.applicationName, + Parameters.versionName, + Parameters.subscriptionId + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + requestBody: { + parameterPath: [ + "options", + "parameters" + ], + mapper: Mappers.ApplicationPackage + }, + responses: { + 200: { + bodyMapper: Mappers.ApplicationPackage + }, + default: { + bodyMapper: Mappers.CloudError + } + }, + serializer +}; + +const deleteMethodOperationSpec: msRest.OperationSpec = { + httpMethod: "DELETE", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Batch/batchAccounts/{accountName}/applications/{applicationName}/versions/{versionName}", + urlParameters: [ + Parameters.resourceGroupName, + Parameters.accountName, + Parameters.applicationName, + Parameters.versionName, + Parameters.subscriptionId + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: {}, + 204: {}, + default: { + bodyMapper: Mappers.CloudError + } + }, + serializer +}; + +const getOperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Batch/batchAccounts/{accountName}/applications/{applicationName}/versions/{versionName}", + urlParameters: [ + Parameters.resourceGroupName, + Parameters.accountName, + Parameters.applicationName, + Parameters.versionName, + Parameters.subscriptionId + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.ApplicationPackage + }, + default: { + bodyMapper: Mappers.CloudError + } + }, + serializer +}; + +const listOperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Batch/batchAccounts/{accountName}/applications/{applicationName}/versions", + urlParameters: [ + Parameters.resourceGroupName, + Parameters.accountName, + Parameters.applicationName, + Parameters.subscriptionId + ], + queryParameters: [ + Parameters.maxresults, + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.ListApplicationPackagesResult + }, + default: { + bodyMapper: Mappers.CloudError + } + }, + serializer +}; + +const listNextOperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + baseUrl: "https://management.azure.com", + path: "{nextLink}", + urlParameters: [ + Parameters.nextPageLink + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.ListApplicationPackagesResult + }, + default: { + bodyMapper: Mappers.CloudError + } + }, + serializer +}; diff --git a/sdk/batch/arm-batch/lib/operations/batchAccountOperations.ts b/sdk/batch/arm-batch/lib/operations/batchAccountOperations.ts new file mode 100644 index 000000000000..ea91ec70b39e --- /dev/null +++ b/sdk/batch/arm-batch/lib/operations/batchAccountOperations.ts @@ -0,0 +1,683 @@ +/* + * 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. + */ + +import * as msRest from "@azure/ms-rest-js"; +import * as msRestAzure from "@azure/ms-rest-azure-js"; +import * as Models from "../models"; +import * as Mappers from "../models/batchAccountOperationsMappers"; +import * as Parameters from "../models/parameters"; +import { BatchManagementClientContext } from "../batchManagementClientContext"; + +/** Class representing a BatchAccountOperations. */ +export class BatchAccountOperations { + private readonly client: BatchManagementClientContext; + + /** + * Create a BatchAccountOperations. + * @param {BatchManagementClientContext} client Reference to the service client. + */ + constructor(client: BatchManagementClientContext) { + this.client = client; + } + + /** + * Creates a new Batch account with the specified parameters. Existing accounts cannot be updated + * with this API and should instead be updated with the Update Batch Account API. + * @param resourceGroupName The name of the resource group that contains the Batch account. + * @param 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 used as part of the DNS name that is used to access the Batch + * service in the region in which the account is created. For example: + * http://accountname.region.batch.azure.com/. + * @param parameters Additional parameters for account creation. + * @param [options] The optional parameters + * @returns Promise + */ + create(resourceGroupName: string, accountName: string, parameters: Models.BatchAccountCreateParameters, options?: msRest.RequestOptionsBase): Promise { + return this.beginCreate(resourceGroupName,accountName,parameters,options) + .then(lroPoller => lroPoller.pollUntilFinished()) as Promise; + } + + /** + * Updates the properties of an existing Batch account. + * @param resourceGroupName The name of the resource group that contains the Batch account. + * @param accountName The name of the Batch account. + * @param parameters Additional parameters for account update. + * @param [options] The optional parameters + * @returns Promise + */ + update(resourceGroupName: string, accountName: string, parameters: Models.BatchAccountUpdateParameters, options?: msRest.RequestOptionsBase): Promise; + /** + * @param resourceGroupName The name of the resource group that contains the Batch account. + * @param accountName The name of the Batch account. + * @param parameters Additional parameters for account update. + * @param callback The callback + */ + update(resourceGroupName: string, accountName: string, parameters: Models.BatchAccountUpdateParameters, callback: msRest.ServiceCallback): void; + /** + * @param resourceGroupName The name of the resource group that contains the Batch account. + * @param accountName The name of the Batch account. + * @param parameters Additional parameters for account update. + * @param options The optional parameters + * @param callback The callback + */ + update(resourceGroupName: string, accountName: string, parameters: Models.BatchAccountUpdateParameters, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + update(resourceGroupName: string, accountName: string, parameters: Models.BatchAccountUpdateParameters, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + resourceGroupName, + accountName, + parameters, + options + }, + updateOperationSpec, + callback) as Promise; + } + + /** + * Deletes the specified Batch account. + * @param resourceGroupName The name of the resource group that contains the Batch account. + * @param accountName The name of the Batch account. + * @param [options] The optional parameters + * @returns Promise + */ + deleteMethod(resourceGroupName: string, accountName: string, options?: msRest.RequestOptionsBase): Promise { + return this.beginDeleteMethod(resourceGroupName,accountName,options) + .then(lroPoller => lroPoller.pollUntilFinished()) as Promise; + } + + /** + * Gets information about the specified Batch account. + * @param resourceGroupName The name of the resource group that contains the Batch account. + * @param accountName The name of the Batch account. + * @param [options] The optional parameters + * @returns Promise + */ + get(resourceGroupName: string, accountName: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param resourceGroupName The name of the resource group that contains the Batch account. + * @param accountName The name of the Batch account. + * @param callback The callback + */ + get(resourceGroupName: string, accountName: string, callback: msRest.ServiceCallback): void; + /** + * @param resourceGroupName The name of the resource group that contains the Batch account. + * @param accountName The name of the Batch account. + * @param options The optional parameters + * @param callback The callback + */ + get(resourceGroupName: string, accountName: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + get(resourceGroupName: string, accountName: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + resourceGroupName, + accountName, + options + }, + getOperationSpec, + callback) as Promise; + } + + /** + * Gets information about the Batch accounts associated with the subscription. + * @param [options] The optional parameters + * @returns Promise + */ + list(options?: msRest.RequestOptionsBase): Promise; + /** + * @param callback The callback + */ + list(callback: msRest.ServiceCallback): void; + /** + * @param options The optional parameters + * @param callback The callback + */ + list(options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + list(options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + options + }, + listOperationSpec, + callback) as Promise; + } + + /** + * Gets information about the Batch accounts associated with the specified resource group. + * @param resourceGroupName The name of the resource group that contains the Batch account. + * @param [options] The optional parameters + * @returns Promise + */ + listByResourceGroup(resourceGroupName: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param resourceGroupName The name of the resource group that contains the Batch account. + * @param callback The callback + */ + listByResourceGroup(resourceGroupName: string, callback: msRest.ServiceCallback): void; + /** + * @param resourceGroupName The name of the resource group that contains the Batch account. + * @param options The optional parameters + * @param callback The callback + */ + listByResourceGroup(resourceGroupName: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + listByResourceGroup(resourceGroupName: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + resourceGroupName, + options + }, + listByResourceGroupOperationSpec, + callback) as Promise; + } + + /** + * Synchronizes access keys for the auto-storage account configured for the specified Batch + * account. + * @param resourceGroupName The name of the resource group that contains the Batch account. + * @param accountName The name of the Batch account. + * @param [options] The optional parameters + * @returns Promise + */ + synchronizeAutoStorageKeys(resourceGroupName: string, accountName: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param resourceGroupName The name of the resource group that contains the Batch account. + * @param accountName The name of the Batch account. + * @param callback The callback + */ + synchronizeAutoStorageKeys(resourceGroupName: string, accountName: string, callback: msRest.ServiceCallback): void; + /** + * @param resourceGroupName The name of the resource group that contains the Batch account. + * @param accountName The name of the Batch account. + * @param options The optional parameters + * @param callback The callback + */ + synchronizeAutoStorageKeys(resourceGroupName: string, accountName: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + synchronizeAutoStorageKeys(resourceGroupName: string, accountName: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + resourceGroupName, + accountName, + options + }, + synchronizeAutoStorageKeysOperationSpec, + callback); + } + + /** + * Regenerates the specified account key for the Batch account. + * @param resourceGroupName The name of the resource group that contains the Batch account. + * @param accountName The name of the Batch account. + * @param keyName The type of account key to regenerate. Possible values include: 'Primary', + * 'Secondary' + * @param [options] The optional parameters + * @returns Promise + */ + regenerateKey(resourceGroupName: string, accountName: string, keyName: Models.AccountKeyType, options?: msRest.RequestOptionsBase): Promise; + /** + * @param resourceGroupName The name of the resource group that contains the Batch account. + * @param accountName The name of the Batch account. + * @param keyName The type of account key to regenerate. Possible values include: 'Primary', + * 'Secondary' + * @param callback The callback + */ + regenerateKey(resourceGroupName: string, accountName: string, keyName: Models.AccountKeyType, callback: msRest.ServiceCallback): void; + /** + * @param resourceGroupName The name of the resource group that contains the Batch account. + * @param accountName The name of the Batch account. + * @param keyName The type of account key to regenerate. Possible values include: 'Primary', + * 'Secondary' + * @param options The optional parameters + * @param callback The callback + */ + regenerateKey(resourceGroupName: string, accountName: string, keyName: Models.AccountKeyType, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + regenerateKey(resourceGroupName: string, accountName: string, keyName: Models.AccountKeyType, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + resourceGroupName, + accountName, + keyName, + options + }, + regenerateKeyOperationSpec, + callback) as Promise; + } + + /** + * This operation applies only to Batch accounts created with a poolAllocationMode of + * 'BatchService'. If the Batch account was created with a poolAllocationMode of + * 'UserSubscription', clients cannot use access to keys to authenticate, and must use Azure Active + * Directory instead. In this case, getting the keys will fail. + * @summary Gets the account keys for the specified Batch account. + * @param resourceGroupName The name of the resource group that contains the Batch account. + * @param accountName The name of the Batch account. + * @param [options] The optional parameters + * @returns Promise + */ + getKeys(resourceGroupName: string, accountName: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param resourceGroupName The name of the resource group that contains the Batch account. + * @param accountName The name of the Batch account. + * @param callback The callback + */ + getKeys(resourceGroupName: string, accountName: string, callback: msRest.ServiceCallback): void; + /** + * @param resourceGroupName The name of the resource group that contains the Batch account. + * @param accountName The name of the Batch account. + * @param options The optional parameters + * @param callback The callback + */ + getKeys(resourceGroupName: string, accountName: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + getKeys(resourceGroupName: string, accountName: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + resourceGroupName, + accountName, + options + }, + getKeysOperationSpec, + callback) as Promise; + } + + /** + * Creates a new Batch account with the specified parameters. Existing accounts cannot be updated + * with this API and should instead be updated with the Update Batch Account API. + * @param resourceGroupName The name of the resource group that contains the Batch account. + * @param 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 used as part of the DNS name that is used to access the Batch + * service in the region in which the account is created. For example: + * http://accountname.region.batch.azure.com/. + * @param parameters Additional parameters for account creation. + * @param [options] The optional parameters + * @returns Promise + */ + beginCreate(resourceGroupName: string, accountName: string, parameters: Models.BatchAccountCreateParameters, options?: msRest.RequestOptionsBase): Promise { + return this.client.sendLRORequest( + { + resourceGroupName, + accountName, + parameters, + options + }, + beginCreateOperationSpec, + options); + } + + /** + * Deletes the specified Batch account. + * @param resourceGroupName The name of the resource group that contains the Batch account. + * @param accountName The name of the Batch account. + * @param [options] The optional parameters + * @returns Promise + */ + beginDeleteMethod(resourceGroupName: string, accountName: string, options?: msRest.RequestOptionsBase): Promise { + return this.client.sendLRORequest( + { + resourceGroupName, + accountName, + options + }, + beginDeleteMethodOperationSpec, + options); + } + + /** + * Gets information about the Batch accounts associated with the subscription. + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param [options] The optional parameters + * @returns Promise + */ + listNext(nextPageLink: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param callback The callback + */ + listNext(nextPageLink: string, callback: msRest.ServiceCallback): void; + /** + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param options The optional parameters + * @param callback The callback + */ + listNext(nextPageLink: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + listNext(nextPageLink: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + nextPageLink, + options + }, + listNextOperationSpec, + callback) as Promise; + } + + /** + * Gets information about the Batch accounts associated with the specified resource group. + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param [options] The optional parameters + * @returns Promise + */ + listByResourceGroupNext(nextPageLink: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param callback The callback + */ + listByResourceGroupNext(nextPageLink: string, callback: msRest.ServiceCallback): void; + /** + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param options The optional parameters + * @param callback The callback + */ + listByResourceGroupNext(nextPageLink: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + listByResourceGroupNext(nextPageLink: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + nextPageLink, + options + }, + listByResourceGroupNextOperationSpec, + callback) as Promise; + } +} + +// Operation Specifications +const serializer = new msRest.Serializer(Mappers); +const updateOperationSpec: msRest.OperationSpec = { + httpMethod: "PATCH", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Batch/batchAccounts/{accountName}", + urlParameters: [ + Parameters.resourceGroupName, + Parameters.accountName, + Parameters.subscriptionId + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + requestBody: { + parameterPath: "parameters", + mapper: { + ...Mappers.BatchAccountUpdateParameters, + required: true + } + }, + responses: { + 200: { + bodyMapper: Mappers.BatchAccount + }, + default: { + bodyMapper: Mappers.CloudError + } + }, + serializer +}; + +const getOperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Batch/batchAccounts/{accountName}", + urlParameters: [ + Parameters.resourceGroupName, + Parameters.accountName, + Parameters.subscriptionId + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.BatchAccount + }, + default: { + bodyMapper: Mappers.CloudError + } + }, + serializer +}; + +const listOperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + path: "subscriptions/{subscriptionId}/providers/Microsoft.Batch/batchAccounts", + urlParameters: [ + Parameters.subscriptionId + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.BatchAccountListResult + }, + default: { + bodyMapper: Mappers.CloudError + } + }, + serializer +}; + +const listByResourceGroupOperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Batch/batchAccounts", + urlParameters: [ + Parameters.resourceGroupName, + Parameters.subscriptionId + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.BatchAccountListResult + }, + default: { + bodyMapper: Mappers.CloudError + } + }, + serializer +}; + +const synchronizeAutoStorageKeysOperationSpec: msRest.OperationSpec = { + httpMethod: "POST", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Batch/batchAccounts/{accountName}/syncAutoStorageKeys", + urlParameters: [ + Parameters.resourceGroupName, + Parameters.accountName, + Parameters.subscriptionId + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 204: {}, + default: { + bodyMapper: Mappers.CloudError + } + }, + serializer +}; + +const regenerateKeyOperationSpec: msRest.OperationSpec = { + httpMethod: "POST", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Batch/batchAccounts/{accountName}/regenerateKeys", + urlParameters: [ + Parameters.resourceGroupName, + Parameters.accountName, + Parameters.subscriptionId + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + requestBody: { + parameterPath: { + keyName: "keyName" + }, + mapper: { + ...Mappers.BatchAccountRegenerateKeyParameters, + required: true + } + }, + responses: { + 200: { + bodyMapper: Mappers.BatchAccountKeys + }, + default: { + bodyMapper: Mappers.CloudError + } + }, + serializer +}; + +const getKeysOperationSpec: msRest.OperationSpec = { + httpMethod: "POST", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Batch/batchAccounts/{accountName}/listKeys", + urlParameters: [ + Parameters.resourceGroupName, + Parameters.accountName, + Parameters.subscriptionId + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.BatchAccountKeys + }, + default: { + bodyMapper: Mappers.CloudError + } + }, + serializer +}; + +const beginCreateOperationSpec: msRest.OperationSpec = { + httpMethod: "PUT", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Batch/batchAccounts/{accountName}", + urlParameters: [ + Parameters.resourceGroupName, + Parameters.accountName, + Parameters.subscriptionId + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + requestBody: { + parameterPath: "parameters", + mapper: { + ...Mappers.BatchAccountCreateParameters, + required: true + } + }, + responses: { + 200: { + bodyMapper: Mappers.BatchAccount, + headersMapper: Mappers.BatchAccountCreateHeaders + }, + 202: { + headersMapper: Mappers.BatchAccountCreateHeaders + }, + default: { + bodyMapper: Mappers.CloudError + } + }, + serializer +}; + +const beginDeleteMethodOperationSpec: msRest.OperationSpec = { + httpMethod: "DELETE", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Batch/batchAccounts/{accountName}", + urlParameters: [ + Parameters.resourceGroupName, + Parameters.accountName, + Parameters.subscriptionId + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + headersMapper: Mappers.BatchAccountDeleteHeaders + }, + 202: { + headersMapper: Mappers.BatchAccountDeleteHeaders + }, + 204: { + headersMapper: Mappers.BatchAccountDeleteHeaders + }, + default: { + bodyMapper: Mappers.CloudError + } + }, + serializer +}; + +const listNextOperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + baseUrl: "https://management.azure.com", + path: "{nextLink}", + urlParameters: [ + Parameters.nextPageLink + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.BatchAccountListResult + }, + default: { + bodyMapper: Mappers.CloudError + } + }, + serializer +}; + +const listByResourceGroupNextOperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + baseUrl: "https://management.azure.com", + path: "{nextLink}", + urlParameters: [ + Parameters.nextPageLink + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.BatchAccountListResult + }, + default: { + bodyMapper: Mappers.CloudError + } + }, + serializer +}; diff --git a/sdk/batch/arm-batch/lib/operations/certificateOperations.ts b/sdk/batch/arm-batch/lib/operations/certificateOperations.ts new file mode 100644 index 000000000000..5b9198143766 --- /dev/null +++ b/sdk/batch/arm-batch/lib/operations/certificateOperations.ts @@ -0,0 +1,510 @@ +/* + * 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. + */ + +import * as msRest from "@azure/ms-rest-js"; +import * as msRestAzure from "@azure/ms-rest-azure-js"; +import * as Models from "../models"; +import * as Mappers from "../models/certificateOperationsMappers"; +import * as Parameters from "../models/parameters"; +import { BatchManagementClientContext } from "../batchManagementClientContext"; + +/** Class representing a CertificateOperations. */ +export class CertificateOperations { + private readonly client: BatchManagementClientContext; + + /** + * Create a CertificateOperations. + * @param {BatchManagementClientContext} client Reference to the service client. + */ + constructor(client: BatchManagementClientContext) { + this.client = client; + } + + /** + * Lists all of the certificates in the specified account. + * @param resourceGroupName The name of the resource group that contains the Batch account. + * @param accountName The name of the Batch account. + * @param [options] The optional parameters + * @returns Promise + */ + listByBatchAccount(resourceGroupName: string, accountName: string, options?: Models.CertificateListByBatchAccountOptionalParams): Promise; + /** + * @param resourceGroupName The name of the resource group that contains the Batch account. + * @param accountName The name of the Batch account. + * @param callback The callback + */ + listByBatchAccount(resourceGroupName: string, accountName: string, callback: msRest.ServiceCallback): void; + /** + * @param resourceGroupName The name of the resource group that contains the Batch account. + * @param accountName The name of the Batch account. + * @param options The optional parameters + * @param callback The callback + */ + listByBatchAccount(resourceGroupName: string, accountName: string, options: Models.CertificateListByBatchAccountOptionalParams, callback: msRest.ServiceCallback): void; + listByBatchAccount(resourceGroupName: string, accountName: string, options?: Models.CertificateListByBatchAccountOptionalParams | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + resourceGroupName, + accountName, + options + }, + listByBatchAccountOperationSpec, + callback) as Promise; + } + + /** + * Creates a new certificate inside the specified account. + * @param resourceGroupName The name of the resource group that contains the Batch account. + * @param accountName The name of the Batch account. + * @param certificateName The identifier for the certificate. This must be made up of algorithm and + * thumbprint separated by a dash, and must match the certificate data in the request. For example + * SHA1-a3d1c5. + * @param parameters Additional parameters for certificate creation. + * @param [options] The optional parameters + * @returns Promise + */ + create(resourceGroupName: string, accountName: string, certificateName: string, parameters: Models.CertificateCreateOrUpdateParameters, options?: Models.CertificateCreateOptionalParams): Promise { + return this.beginCreate(resourceGroupName,accountName,certificateName,parameters,options) + .then(lroPoller => lroPoller.pollUntilFinished()) as Promise; + } + + /** + * Updates the properties of an existing certificate. + * @param resourceGroupName The name of the resource group that contains the Batch account. + * @param accountName The name of the Batch account. + * @param certificateName The identifier for the certificate. This must be made up of algorithm and + * thumbprint separated by a dash, and must match the certificate data in the request. For example + * SHA1-a3d1c5. + * @param parameters Certificate entity to update. + * @param [options] The optional parameters + * @returns Promise + */ + update(resourceGroupName: string, accountName: string, certificateName: string, parameters: Models.CertificateCreateOrUpdateParameters, options?: Models.CertificateUpdateOptionalParams): Promise; + /** + * @param resourceGroupName The name of the resource group that contains the Batch account. + * @param accountName The name of the Batch account. + * @param certificateName The identifier for the certificate. This must be made up of algorithm and + * thumbprint separated by a dash, and must match the certificate data in the request. For example + * SHA1-a3d1c5. + * @param parameters Certificate entity to update. + * @param callback The callback + */ + update(resourceGroupName: string, accountName: string, certificateName: string, parameters: Models.CertificateCreateOrUpdateParameters, callback: msRest.ServiceCallback): void; + /** + * @param resourceGroupName The name of the resource group that contains the Batch account. + * @param accountName The name of the Batch account. + * @param certificateName The identifier for the certificate. This must be made up of algorithm and + * thumbprint separated by a dash, and must match the certificate data in the request. For example + * SHA1-a3d1c5. + * @param parameters Certificate entity to update. + * @param options The optional parameters + * @param callback The callback + */ + update(resourceGroupName: string, accountName: string, certificateName: string, parameters: Models.CertificateCreateOrUpdateParameters, options: Models.CertificateUpdateOptionalParams, callback: msRest.ServiceCallback): void; + update(resourceGroupName: string, accountName: string, certificateName: string, parameters: Models.CertificateCreateOrUpdateParameters, options?: Models.CertificateUpdateOptionalParams | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + resourceGroupName, + accountName, + certificateName, + parameters, + options + }, + updateOperationSpec, + callback) as Promise; + } + + /** + * Deletes the specified certificate. + * @param resourceGroupName The name of the resource group that contains the Batch account. + * @param accountName The name of the Batch account. + * @param certificateName The identifier for the certificate. This must be made up of algorithm and + * thumbprint separated by a dash, and must match the certificate data in the request. For example + * SHA1-a3d1c5. + * @param [options] The optional parameters + * @returns Promise + */ + deleteMethod(resourceGroupName: string, accountName: string, certificateName: string, options?: msRest.RequestOptionsBase): Promise { + return this.beginDeleteMethod(resourceGroupName,accountName,certificateName,options) + .then(lroPoller => lroPoller.pollUntilFinished()) as Promise; + } + + /** + * Gets information about the specified certificate. + * @param resourceGroupName The name of the resource group that contains the Batch account. + * @param accountName The name of the Batch account. + * @param certificateName The identifier for the certificate. This must be made up of algorithm and + * thumbprint separated by a dash, and must match the certificate data in the request. For example + * SHA1-a3d1c5. + * @param [options] The optional parameters + * @returns Promise + */ + get(resourceGroupName: string, accountName: string, certificateName: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param resourceGroupName The name of the resource group that contains the Batch account. + * @param accountName The name of the Batch account. + * @param certificateName The identifier for the certificate. This must be made up of algorithm and + * thumbprint separated by a dash, and must match the certificate data in the request. For example + * SHA1-a3d1c5. + * @param callback The callback + */ + get(resourceGroupName: string, accountName: string, certificateName: string, callback: msRest.ServiceCallback): void; + /** + * @param resourceGroupName The name of the resource group that contains the Batch account. + * @param accountName The name of the Batch account. + * @param certificateName The identifier for the certificate. This must be made up of algorithm and + * thumbprint separated by a dash, and must match the certificate data in the request. For example + * SHA1-a3d1c5. + * @param options The optional parameters + * @param callback The callback + */ + get(resourceGroupName: string, accountName: string, certificateName: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + get(resourceGroupName: string, accountName: string, certificateName: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + resourceGroupName, + accountName, + certificateName, + options + }, + getOperationSpec, + callback) as Promise; + } + + /** + * If you try to delete a certificate that is being used by a pool or compute node, the status of + * the certificate changes to deleteFailed. If you decide that you want to continue using the + * certificate, you can use this operation to set the status of the certificate back to active. If + * you intend to delete the certificate, you do not need to run this operation after the deletion + * failed. You must make sure that the certificate is not being used by any resources, and then you + * can try again to delete the certificate. + * @summary Cancels a failed deletion of a certificate from the specified account. + * @param resourceGroupName The name of the resource group that contains the Batch account. + * @param accountName The name of the Batch account. + * @param certificateName The identifier for the certificate. This must be made up of algorithm and + * thumbprint separated by a dash, and must match the certificate data in the request. For example + * SHA1-a3d1c5. + * @param [options] The optional parameters + * @returns Promise + */ + cancelDeletion(resourceGroupName: string, accountName: string, certificateName: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param resourceGroupName The name of the resource group that contains the Batch account. + * @param accountName The name of the Batch account. + * @param certificateName The identifier for the certificate. This must be made up of algorithm and + * thumbprint separated by a dash, and must match the certificate data in the request. For example + * SHA1-a3d1c5. + * @param callback The callback + */ + cancelDeletion(resourceGroupName: string, accountName: string, certificateName: string, callback: msRest.ServiceCallback): void; + /** + * @param resourceGroupName The name of the resource group that contains the Batch account. + * @param accountName The name of the Batch account. + * @param certificateName The identifier for the certificate. This must be made up of algorithm and + * thumbprint separated by a dash, and must match the certificate data in the request. For example + * SHA1-a3d1c5. + * @param options The optional parameters + * @param callback The callback + */ + cancelDeletion(resourceGroupName: string, accountName: string, certificateName: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + cancelDeletion(resourceGroupName: string, accountName: string, certificateName: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + resourceGroupName, + accountName, + certificateName, + options + }, + cancelDeletionOperationSpec, + callback) as Promise; + } + + /** + * Creates a new certificate inside the specified account. + * @param resourceGroupName The name of the resource group that contains the Batch account. + * @param accountName The name of the Batch account. + * @param certificateName The identifier for the certificate. This must be made up of algorithm and + * thumbprint separated by a dash, and must match the certificate data in the request. For example + * SHA1-a3d1c5. + * @param parameters Additional parameters for certificate creation. + * @param [options] The optional parameters + * @returns Promise + */ + beginCreate(resourceGroupName: string, accountName: string, certificateName: string, parameters: Models.CertificateCreateOrUpdateParameters, options?: Models.CertificateBeginCreateOptionalParams): Promise { + return this.client.sendLRORequest( + { + resourceGroupName, + accountName, + certificateName, + parameters, + options + }, + beginCreateOperationSpec, + options); + } + + /** + * Deletes the specified certificate. + * @param resourceGroupName The name of the resource group that contains the Batch account. + * @param accountName The name of the Batch account. + * @param certificateName The identifier for the certificate. This must be made up of algorithm and + * thumbprint separated by a dash, and must match the certificate data in the request. For example + * SHA1-a3d1c5. + * @param [options] The optional parameters + * @returns Promise + */ + beginDeleteMethod(resourceGroupName: string, accountName: string, certificateName: string, options?: msRest.RequestOptionsBase): Promise { + return this.client.sendLRORequest( + { + resourceGroupName, + accountName, + certificateName, + options + }, + beginDeleteMethodOperationSpec, + options); + } + + /** + * Lists all of the certificates in the specified account. + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param [options] The optional parameters + * @returns Promise + */ + listByBatchAccountNext(nextPageLink: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param callback The callback + */ + listByBatchAccountNext(nextPageLink: string, callback: msRest.ServiceCallback): void; + /** + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param options The optional parameters + * @param callback The callback + */ + listByBatchAccountNext(nextPageLink: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + listByBatchAccountNext(nextPageLink: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + nextPageLink, + options + }, + listByBatchAccountNextOperationSpec, + callback) as Promise; + } +} + +// Operation Specifications +const serializer = new msRest.Serializer(Mappers); +const listByBatchAccountOperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Batch/batchAccounts/{accountName}/certificates", + urlParameters: [ + Parameters.resourceGroupName, + Parameters.accountName, + Parameters.subscriptionId + ], + queryParameters: [ + Parameters.maxresults, + Parameters.select, + Parameters.filter, + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.ListCertificatesResult + }, + default: { + bodyMapper: Mappers.CloudError + } + }, + serializer +}; + +const updateOperationSpec: msRest.OperationSpec = { + httpMethod: "PATCH", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Batch/batchAccounts/{accountName}/certificates/{certificateName}", + urlParameters: [ + Parameters.resourceGroupName, + Parameters.accountName, + Parameters.certificateName, + Parameters.subscriptionId + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.ifMatch, + Parameters.acceptLanguage + ], + requestBody: { + parameterPath: "parameters", + mapper: { + ...Mappers.CertificateCreateOrUpdateParameters, + required: true + } + }, + responses: { + 200: { + bodyMapper: Mappers.Certificate, + headersMapper: Mappers.CertificateUpdateHeaders + }, + default: { + bodyMapper: Mappers.CloudError + } + }, + serializer +}; + +const getOperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Batch/batchAccounts/{accountName}/certificates/{certificateName}", + urlParameters: [ + Parameters.resourceGroupName, + Parameters.accountName, + Parameters.certificateName, + Parameters.subscriptionId + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.Certificate, + headersMapper: Mappers.CertificateGetHeaders + }, + default: { + bodyMapper: Mappers.CloudError + } + }, + serializer +}; + +const cancelDeletionOperationSpec: msRest.OperationSpec = { + httpMethod: "POST", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Batch/batchAccounts/{accountName}/certificates/{certificateName}/cancelDelete", + urlParameters: [ + Parameters.resourceGroupName, + Parameters.accountName, + Parameters.certificateName, + Parameters.subscriptionId + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.Certificate, + headersMapper: Mappers.CertificateCancelDeletionHeaders + }, + default: { + bodyMapper: Mappers.CloudError + } + }, + serializer +}; + +const beginCreateOperationSpec: msRest.OperationSpec = { + httpMethod: "PUT", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Batch/batchAccounts/{accountName}/certificates/{certificateName}", + urlParameters: [ + Parameters.resourceGroupName, + Parameters.accountName, + Parameters.certificateName, + Parameters.subscriptionId + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.ifMatch, + Parameters.ifNoneMatch, + Parameters.acceptLanguage + ], + requestBody: { + parameterPath: "parameters", + mapper: { + ...Mappers.CertificateCreateOrUpdateParameters, + required: true + } + }, + responses: { + 200: { + bodyMapper: Mappers.Certificate, + headersMapper: Mappers.CertificateCreateHeaders + }, + default: { + bodyMapper: Mappers.CloudError + } + }, + serializer +}; + +const beginDeleteMethodOperationSpec: msRest.OperationSpec = { + httpMethod: "DELETE", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Batch/batchAccounts/{accountName}/certificates/{certificateName}", + urlParameters: [ + Parameters.resourceGroupName, + Parameters.accountName, + Parameters.certificateName, + Parameters.subscriptionId + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + headersMapper: Mappers.CertificateDeleteHeaders + }, + 202: { + headersMapper: Mappers.CertificateDeleteHeaders + }, + 204: { + headersMapper: Mappers.CertificateDeleteHeaders + }, + default: { + bodyMapper: Mappers.CloudError + } + }, + serializer +}; + +const listByBatchAccountNextOperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + baseUrl: "https://management.azure.com", + path: "{nextLink}", + urlParameters: [ + Parameters.nextPageLink + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.ListCertificatesResult + }, + default: { + bodyMapper: Mappers.CloudError + } + }, + serializer +}; diff --git a/sdk/batch/arm-batch/lib/operations/index.ts b/sdk/batch/arm-batch/lib/operations/index.ts new file mode 100644 index 000000000000..9af241e11a01 --- /dev/null +++ b/sdk/batch/arm-batch/lib/operations/index.ts @@ -0,0 +1,17 @@ +/* + * 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. + */ + +export * from "./batchAccountOperations"; +export * from "./applicationPackageOperations"; +export * from "./applicationOperations"; +export * from "./location"; +export * from "./operations"; +export * from "./certificateOperations"; +export * from "./poolOperations"; diff --git a/sdk/batch/arm-batch/lib/operations/location.ts b/sdk/batch/arm-batch/lib/operations/location.ts new file mode 100644 index 000000000000..6efd43a3f585 --- /dev/null +++ b/sdk/batch/arm-batch/lib/operations/location.ts @@ -0,0 +1,147 @@ +/* + * 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. + */ + +import * as msRest from "@azure/ms-rest-js"; +import * as Models from "../models"; +import * as Mappers from "../models/locationMappers"; +import * as Parameters from "../models/parameters"; +import { BatchManagementClientContext } from "../batchManagementClientContext"; + +/** Class representing a Location. */ +export class Location { + private readonly client: BatchManagementClientContext; + + /** + * Create a Location. + * @param {BatchManagementClientContext} client Reference to the service client. + */ + constructor(client: BatchManagementClientContext) { + this.client = client; + } + + /** + * Gets the Batch service quotas for the specified subscription at the given location. + * @param locationName The region for which to retrieve Batch service quotas. + * @param [options] The optional parameters + * @returns Promise + */ + getQuotas(locationName: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param locationName The region for which to retrieve Batch service quotas. + * @param callback The callback + */ + getQuotas(locationName: string, callback: msRest.ServiceCallback): void; + /** + * @param locationName The region for which to retrieve Batch service quotas. + * @param options The optional parameters + * @param callback The callback + */ + getQuotas(locationName: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + getQuotas(locationName: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + locationName, + options + }, + getQuotasOperationSpec, + callback) as Promise; + } + + /** + * Checks whether the Batch account name is available in the specified region. + * @param locationName The desired region for the name check. + * @param name The name to check for availability + * @param [options] The optional parameters + * @returns Promise + */ + checkNameAvailability(locationName: string, name: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param locationName The desired region for the name check. + * @param name The name to check for availability + * @param callback The callback + */ + checkNameAvailability(locationName: string, name: string, callback: msRest.ServiceCallback): void; + /** + * @param locationName The desired region for the name check. + * @param name The name to check for availability + * @param options The optional parameters + * @param callback The callback + */ + checkNameAvailability(locationName: string, name: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + checkNameAvailability(locationName: string, name: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + locationName, + name, + options + }, + checkNameAvailabilityOperationSpec, + callback) as Promise; + } +} + +// Operation Specifications +const serializer = new msRest.Serializer(Mappers); +const getQuotasOperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + path: "subscriptions/{subscriptionId}/providers/Microsoft.Batch/locations/{locationName}/quotas", + urlParameters: [ + Parameters.locationName, + Parameters.subscriptionId + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.BatchLocationQuota + }, + default: { + bodyMapper: Mappers.CloudError + } + }, + serializer +}; + +const checkNameAvailabilityOperationSpec: msRest.OperationSpec = { + httpMethod: "POST", + path: "subscriptions/{subscriptionId}/providers/Microsoft.Batch/locations/{locationName}/checkNameAvailability", + urlParameters: [ + Parameters.locationName, + Parameters.subscriptionId + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + requestBody: { + parameterPath: { + name: "name" + }, + mapper: { + ...Mappers.CheckNameAvailabilityParameters, + required: true + } + }, + responses: { + 200: { + bodyMapper: Mappers.CheckNameAvailabilityResult + }, + default: { + bodyMapper: Mappers.CloudError + } + }, + serializer +}; diff --git a/sdk/batch/arm-batch/lib/operations/operations.ts b/sdk/batch/arm-batch/lib/operations/operations.ts new file mode 100644 index 000000000000..b4067f9898f6 --- /dev/null +++ b/sdk/batch/arm-batch/lib/operations/operations.ts @@ -0,0 +1,123 @@ +/* + * 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. + */ + +import * as msRest from "@azure/ms-rest-js"; +import * as Models from "../models"; +import * as Mappers from "../models/operationsMappers"; +import * as Parameters from "../models/parameters"; +import { BatchManagementClientContext } from "../batchManagementClientContext"; + +/** Class representing a Operations. */ +export class Operations { + private readonly client: BatchManagementClientContext; + + /** + * Create a Operations. + * @param {BatchManagementClientContext} client Reference to the service client. + */ + constructor(client: BatchManagementClientContext) { + this.client = client; + } + + /** + * Lists available operations for the Microsoft.Batch provider + * @param [options] The optional parameters + * @returns Promise + */ + list(options?: msRest.RequestOptionsBase): Promise; + /** + * @param callback The callback + */ + list(callback: msRest.ServiceCallback): void; + /** + * @param options The optional parameters + * @param callback The callback + */ + list(options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + list(options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + options + }, + listOperationSpec, + callback) as Promise; + } + + /** + * Lists available operations for the Microsoft.Batch provider + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param [options] The optional parameters + * @returns Promise + */ + listNext(nextPageLink: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param callback The callback + */ + listNext(nextPageLink: string, callback: msRest.ServiceCallback): void; + /** + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param options The optional parameters + * @param callback The callback + */ + listNext(nextPageLink: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + listNext(nextPageLink: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + nextPageLink, + options + }, + listNextOperationSpec, + callback) as Promise; + } +} + +// Operation Specifications +const serializer = new msRest.Serializer(Mappers); +const listOperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + path: "providers/Microsoft.Batch/operations", + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.OperationListResult + }, + default: { + bodyMapper: Mappers.CloudError + } + }, + serializer +}; + +const listNextOperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + baseUrl: "https://management.azure.com", + path: "{nextLink}", + urlParameters: [ + Parameters.nextPageLink + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.OperationListResult + }, + default: { + bodyMapper: Mappers.CloudError + } + }, + serializer +}; diff --git a/sdk/batch/arm-batch/lib/operations/poolOperations.ts b/sdk/batch/arm-batch/lib/operations/poolOperations.ts new file mode 100644 index 000000000000..02c071ab662a --- /dev/null +++ b/sdk/batch/arm-batch/lib/operations/poolOperations.ts @@ -0,0 +1,550 @@ +/* + * 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. + */ + +import * as msRest from "@azure/ms-rest-js"; +import * as msRestAzure from "@azure/ms-rest-azure-js"; +import * as Models from "../models"; +import * as Mappers from "../models/poolOperationsMappers"; +import * as Parameters from "../models/parameters"; +import { BatchManagementClientContext } from "../batchManagementClientContext"; + +/** Class representing a PoolOperations. */ +export class PoolOperations { + private readonly client: BatchManagementClientContext; + + /** + * Create a PoolOperations. + * @param {BatchManagementClientContext} client Reference to the service client. + */ + constructor(client: BatchManagementClientContext) { + this.client = client; + } + + /** + * Lists all of the pools in the specified account. + * @param resourceGroupName The name of the resource group that contains the Batch account. + * @param accountName The name of the Batch account. + * @param [options] The optional parameters + * @returns Promise + */ + listByBatchAccount(resourceGroupName: string, accountName: string, options?: Models.PoolListByBatchAccountOptionalParams): Promise; + /** + * @param resourceGroupName The name of the resource group that contains the Batch account. + * @param accountName The name of the Batch account. + * @param callback The callback + */ + listByBatchAccount(resourceGroupName: string, accountName: string, callback: msRest.ServiceCallback): void; + /** + * @param resourceGroupName The name of the resource group that contains the Batch account. + * @param accountName The name of the Batch account. + * @param options The optional parameters + * @param callback The callback + */ + listByBatchAccount(resourceGroupName: string, accountName: string, options: Models.PoolListByBatchAccountOptionalParams, callback: msRest.ServiceCallback): void; + listByBatchAccount(resourceGroupName: string, accountName: string, options?: Models.PoolListByBatchAccountOptionalParams | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + resourceGroupName, + accountName, + options + }, + listByBatchAccountOperationSpec, + callback) as Promise; + } + + /** + * Creates a new pool inside the specified account. + * @param resourceGroupName The name of the resource group that contains the Batch account. + * @param accountName The name of the Batch account. + * @param poolName The pool name. This must be unique within the account. + * @param parameters Additional parameters for pool creation. + * @param [options] The optional parameters + * @returns Promise + */ + create(resourceGroupName: string, accountName: string, poolName: string, parameters: Models.Pool, options?: Models.PoolCreateOptionalParams): Promise { + return this.beginCreate(resourceGroupName,accountName,poolName,parameters,options) + .then(lroPoller => lroPoller.pollUntilFinished()) as Promise; + } + + /** + * Updates the properties of an existing pool. + * @param resourceGroupName The name of the resource group that contains the Batch account. + * @param accountName The name of the Batch account. + * @param poolName The pool name. This must be unique within the account. + * @param parameters Pool properties that should be updated. Properties that are supplied will be + * updated, any property not supplied will be unchanged. + * @param [options] The optional parameters + * @returns Promise + */ + update(resourceGroupName: string, accountName: string, poolName: string, parameters: Models.Pool, options?: Models.PoolUpdateOptionalParams): Promise; + /** + * @param resourceGroupName The name of the resource group that contains the Batch account. + * @param accountName The name of the Batch account. + * @param poolName The pool name. This must be unique within the account. + * @param parameters Pool properties that should be updated. Properties that are supplied will be + * updated, any property not supplied will be unchanged. + * @param callback The callback + */ + update(resourceGroupName: string, accountName: string, poolName: string, parameters: Models.Pool, callback: msRest.ServiceCallback): void; + /** + * @param resourceGroupName The name of the resource group that contains the Batch account. + * @param accountName The name of the Batch account. + * @param poolName The pool name. This must be unique within the account. + * @param parameters Pool properties that should be updated. Properties that are supplied will be + * updated, any property not supplied will be unchanged. + * @param options The optional parameters + * @param callback The callback + */ + update(resourceGroupName: string, accountName: string, poolName: string, parameters: Models.Pool, options: Models.PoolUpdateOptionalParams, callback: msRest.ServiceCallback): void; + update(resourceGroupName: string, accountName: string, poolName: string, parameters: Models.Pool, options?: Models.PoolUpdateOptionalParams | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + resourceGroupName, + accountName, + poolName, + parameters, + options + }, + updateOperationSpec, + callback) as Promise; + } + + /** + * Deletes the specified pool. + * @param resourceGroupName The name of the resource group that contains the Batch account. + * @param accountName The name of the Batch account. + * @param poolName The pool name. This must be unique within the account. + * @param [options] The optional parameters + * @returns Promise + */ + deleteMethod(resourceGroupName: string, accountName: string, poolName: string, options?: msRest.RequestOptionsBase): Promise { + return this.beginDeleteMethod(resourceGroupName,accountName,poolName,options) + .then(lroPoller => lroPoller.pollUntilFinished()) as Promise; + } + + /** + * Gets information about the specified pool. + * @param resourceGroupName The name of the resource group that contains the Batch account. + * @param accountName The name of the Batch account. + * @param poolName The pool name. This must be unique within the account. + * @param [options] The optional parameters + * @returns Promise + */ + get(resourceGroupName: string, accountName: string, poolName: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param resourceGroupName The name of the resource group that contains the Batch account. + * @param accountName The name of the Batch account. + * @param poolName The pool name. This must be unique within the account. + * @param callback The callback + */ + get(resourceGroupName: string, accountName: string, poolName: string, callback: msRest.ServiceCallback): void; + /** + * @param resourceGroupName The name of the resource group that contains the Batch account. + * @param accountName The name of the Batch account. + * @param poolName The pool name. This must be unique within the account. + * @param options The optional parameters + * @param callback The callback + */ + get(resourceGroupName: string, accountName: string, poolName: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + get(resourceGroupName: string, accountName: string, poolName: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + resourceGroupName, + accountName, + poolName, + options + }, + getOperationSpec, + callback) as Promise; + } + + /** + * Disables automatic scaling for a pool. + * @param resourceGroupName The name of the resource group that contains the Batch account. + * @param accountName The name of the Batch account. + * @param poolName The pool name. This must be unique within the account. + * @param [options] The optional parameters + * @returns Promise + */ + disableAutoScale(resourceGroupName: string, accountName: string, poolName: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param resourceGroupName The name of the resource group that contains the Batch account. + * @param accountName The name of the Batch account. + * @param poolName The pool name. This must be unique within the account. + * @param callback The callback + */ + disableAutoScale(resourceGroupName: string, accountName: string, poolName: string, callback: msRest.ServiceCallback): void; + /** + * @param resourceGroupName The name of the resource group that contains the Batch account. + * @param accountName The name of the Batch account. + * @param poolName The pool name. This must be unique within the account. + * @param options The optional parameters + * @param callback The callback + */ + disableAutoScale(resourceGroupName: string, accountName: string, poolName: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + disableAutoScale(resourceGroupName: string, accountName: string, poolName: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + resourceGroupName, + accountName, + poolName, + options + }, + disableAutoScaleOperationSpec, + callback) as Promise; + } + + /** + * This does not restore the pool to its previous state before the resize operation: it only stops + * any further changes being made, and the pool maintains its current state. After stopping, the + * pool stabilizes at the number of nodes it was at when the stop operation was done. During the + * stop operation, the pool allocation state changes first to stopping and then to steady. A resize + * operation need 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. + * @summary Stops an ongoing resize operation on the pool. + * @param resourceGroupName The name of the resource group that contains the Batch account. + * @param accountName The name of the Batch account. + * @param poolName The pool name. This must be unique within the account. + * @param [options] The optional parameters + * @returns Promise + */ + stopResize(resourceGroupName: string, accountName: string, poolName: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param resourceGroupName The name of the resource group that contains the Batch account. + * @param accountName The name of the Batch account. + * @param poolName The pool name. This must be unique within the account. + * @param callback The callback + */ + stopResize(resourceGroupName: string, accountName: string, poolName: string, callback: msRest.ServiceCallback): void; + /** + * @param resourceGroupName The name of the resource group that contains the Batch account. + * @param accountName The name of the Batch account. + * @param poolName The pool name. This must be unique within the account. + * @param options The optional parameters + * @param callback The callback + */ + stopResize(resourceGroupName: string, accountName: string, poolName: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + stopResize(resourceGroupName: string, accountName: string, poolName: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + resourceGroupName, + accountName, + poolName, + options + }, + stopResizeOperationSpec, + callback) as Promise; + } + + /** + * Creates a new pool inside the specified account. + * @param resourceGroupName The name of the resource group that contains the Batch account. + * @param accountName The name of the Batch account. + * @param poolName The pool name. This must be unique within the account. + * @param parameters Additional parameters for pool creation. + * @param [options] The optional parameters + * @returns Promise + */ + beginCreate(resourceGroupName: string, accountName: string, poolName: string, parameters: Models.Pool, options?: Models.PoolBeginCreateOptionalParams): Promise { + return this.client.sendLRORequest( + { + resourceGroupName, + accountName, + poolName, + parameters, + options + }, + beginCreateOperationSpec, + options); + } + + /** + * Deletes the specified pool. + * @param resourceGroupName The name of the resource group that contains the Batch account. + * @param accountName The name of the Batch account. + * @param poolName The pool name. This must be unique within the account. + * @param [options] The optional parameters + * @returns Promise + */ + beginDeleteMethod(resourceGroupName: string, accountName: string, poolName: string, options?: msRest.RequestOptionsBase): Promise { + return this.client.sendLRORequest( + { + resourceGroupName, + accountName, + poolName, + options + }, + beginDeleteMethodOperationSpec, + options); + } + + /** + * Lists all of the pools in the specified account. + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param [options] The optional parameters + * @returns Promise + */ + listByBatchAccountNext(nextPageLink: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param callback The callback + */ + listByBatchAccountNext(nextPageLink: string, callback: msRest.ServiceCallback): void; + /** + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param options The optional parameters + * @param callback The callback + */ + listByBatchAccountNext(nextPageLink: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + listByBatchAccountNext(nextPageLink: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + nextPageLink, + options + }, + listByBatchAccountNextOperationSpec, + callback) as Promise; + } +} + +// Operation Specifications +const serializer = new msRest.Serializer(Mappers); +const listByBatchAccountOperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Batch/batchAccounts/{accountName}/pools", + urlParameters: [ + Parameters.resourceGroupName, + Parameters.accountName, + Parameters.subscriptionId + ], + queryParameters: [ + Parameters.maxresults, + Parameters.select, + Parameters.filter, + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.ListPoolsResult + }, + default: { + bodyMapper: Mappers.CloudError + } + }, + serializer +}; + +const updateOperationSpec: msRest.OperationSpec = { + httpMethod: "PATCH", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Batch/batchAccounts/{accountName}/pools/{poolName}", + urlParameters: [ + Parameters.resourceGroupName, + Parameters.accountName, + Parameters.poolName, + Parameters.subscriptionId + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.ifMatch, + Parameters.acceptLanguage + ], + requestBody: { + parameterPath: "parameters", + mapper: { + ...Mappers.Pool, + required: true + } + }, + responses: { + 200: { + bodyMapper: Mappers.Pool, + headersMapper: Mappers.PoolUpdateHeaders + }, + default: { + bodyMapper: Mappers.CloudError + } + }, + serializer +}; + +const getOperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Batch/batchAccounts/{accountName}/pools/{poolName}", + urlParameters: [ + Parameters.resourceGroupName, + Parameters.accountName, + Parameters.poolName, + Parameters.subscriptionId + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.Pool, + headersMapper: Mappers.PoolGetHeaders + }, + default: { + bodyMapper: Mappers.CloudError + } + }, + serializer +}; + +const disableAutoScaleOperationSpec: msRest.OperationSpec = { + httpMethod: "POST", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Batch/batchAccounts/{accountName}/pools/{poolName}/disableAutoScale", + urlParameters: [ + Parameters.resourceGroupName, + Parameters.accountName, + Parameters.poolName, + Parameters.subscriptionId + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.Pool, + headersMapper: Mappers.PoolDisableAutoScaleHeaders + }, + default: { + bodyMapper: Mappers.CloudError + } + }, + serializer +}; + +const stopResizeOperationSpec: msRest.OperationSpec = { + httpMethod: "POST", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Batch/batchAccounts/{accountName}/pools/{poolName}/stopResize", + urlParameters: [ + Parameters.resourceGroupName, + Parameters.accountName, + Parameters.poolName, + Parameters.subscriptionId + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.Pool, + headersMapper: Mappers.PoolStopResizeHeaders + }, + default: { + bodyMapper: Mappers.CloudError + } + }, + serializer +}; + +const beginCreateOperationSpec: msRest.OperationSpec = { + httpMethod: "PUT", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Batch/batchAccounts/{accountName}/pools/{poolName}", + urlParameters: [ + Parameters.resourceGroupName, + Parameters.accountName, + Parameters.poolName, + Parameters.subscriptionId + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.ifMatch, + Parameters.ifNoneMatch, + Parameters.acceptLanguage + ], + requestBody: { + parameterPath: "parameters", + mapper: { + ...Mappers.Pool, + required: true + } + }, + responses: { + 200: { + bodyMapper: Mappers.Pool, + headersMapper: Mappers.PoolCreateHeaders + }, + default: { + bodyMapper: Mappers.CloudError + } + }, + serializer +}; + +const beginDeleteMethodOperationSpec: msRest.OperationSpec = { + httpMethod: "DELETE", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Batch/batchAccounts/{accountName}/pools/{poolName}", + urlParameters: [ + Parameters.resourceGroupName, + Parameters.accountName, + Parameters.poolName, + Parameters.subscriptionId + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + headersMapper: Mappers.PoolDeleteHeaders + }, + 202: { + headersMapper: Mappers.PoolDeleteHeaders + }, + 204: { + headersMapper: Mappers.PoolDeleteHeaders + }, + default: { + bodyMapper: Mappers.CloudError + } + }, + serializer +}; + +const listByBatchAccountNextOperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + baseUrl: "https://management.azure.com", + path: "{nextLink}", + urlParameters: [ + Parameters.nextPageLink + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.ListPoolsResult + }, + default: { + bodyMapper: Mappers.CloudError + } + }, + serializer +}; diff --git a/sdk/batch/arm-batch/package.json b/sdk/batch/arm-batch/package.json index b068c5511493..1687f3397712 100644 --- a/sdk/batch/arm-batch/package.json +++ b/sdk/batch/arm-batch/package.json @@ -4,8 +4,8 @@ "description": "BatchManagementClient Library with typescript type definitions for node.js and browser.", "version": "4.0.0", "dependencies": { - "@azure/ms-rest-azure-js": "^1.1.0", - "@azure/ms-rest-js": "^1.1.0", + "@azure/ms-rest-azure-js": "^1.2.0", + "@azure/ms-rest-js": "^1.2.0", "tslib": "^1.9.3" }, "keywords": [ @@ -23,9 +23,10 @@ "typescript": "^3.1.1", "rollup": "^0.66.2", "rollup-plugin-node-resolve": "^3.4.0", + "rollup-plugin-sourcemaps": "^0.4.2", "uglify-js": "^3.4.9" }, - "homepage": "https://github.com/azure/azure-sdk-for-js/tree/master/sdk/batch/arm-batch", + "homepage": "https://github.com/azure/azure-sdk-for-js", "repository": { "type": "git", "url": "https://github.com/azure/azure-sdk-for-js.git" @@ -42,7 +43,7 @@ "esm/**/*.js.map", "esm/**/*.d.ts", "esm/**/*.d.ts.map", - "src/**/*.ts", + "lib/**/*.ts", "rollup.config.js", "tsconfig.json" ], @@ -51,6 +52,5 @@ "minify": "uglifyjs -c -m --comments --source-map \"content='./dist/arm-batch.js.map'\" -o ./dist/arm-batch.min.js ./dist/arm-batch.js", "prepack": "npm install && npm run build" }, - "sideEffects": false, - "authPublish": true + "sideEffects": false } diff --git a/sdk/batch/arm-batch/rollup.config.js b/sdk/batch/arm-batch/rollup.config.js index 75e829947f0f..4f56ed985df8 100644 --- a/sdk/batch/arm-batch/rollup.config.js +++ b/sdk/batch/arm-batch/rollup.config.js @@ -1,10 +1,16 @@ +import rollup from "rollup"; import nodeResolve from "rollup-plugin-node-resolve"; +import sourcemaps from "rollup-plugin-sourcemaps"; + /** - * @type {import('rollup').RollupFileOptions} + * @type {rollup.RollupFileOptions} */ const config = { - input: './esm/batchManagementClient.js', - external: ["@azure/ms-rest-js", "@azure/ms-rest-azure-js"], + input: "./esm/batchManagementClient.js", + external: [ + "@azure/ms-rest-js", + "@azure/ms-rest-azure-js" + ], output: { file: "./dist/arm-batch.js", format: "umd", @@ -16,16 +22,16 @@ const config = { }, banner: `/* * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. + * 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. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. */` }, plugins: [ - nodeResolve({ module: true }) + nodeResolve({ module: true }), + sourcemaps() ] }; + export default config; diff --git a/sdk/batch/arm-batch/tsconfig.json b/sdk/batch/arm-batch/tsconfig.json index 87bbf5b5fa49..51ea90961ce5 100644 --- a/sdk/batch/arm-batch/tsconfig.json +++ b/sdk/batch/arm-batch/tsconfig.json @@ -14,6 +14,6 @@ "outDir": "./esm", "importHelpers": true }, - "include": ["./src/**/*.ts"], + "include": ["./lib/**/*.ts"], "exclude": ["node_modules"] }