diff --git a/sdk/databricks/arm-databricks/LICENSE.txt b/sdk/databricks/arm-databricks/LICENSE.txt index a70e8cf66038..2d3163745319 100644 --- a/sdk/databricks/arm-databricks/LICENSE.txt +++ b/sdk/databricks/arm-databricks/LICENSE.txt @@ -1,6 +1,6 @@ The MIT License (MIT) -Copyright (c) 2018 Microsoft +Copyright (c) 2021 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/databricks/arm-databricks/README.md b/sdk/databricks/arm-databricks/README.md index a98459c8bb4d..f244c0785730 100644 --- a/sdk/databricks/arm-databricks/README.md +++ b/sdk/databricks/arm-databricks/README.md @@ -9,27 +9,27 @@ This package contains an isomorphic SDK for DatabricksClient. ### How to Install -``` +```bash npm install @azure/arm-databricks ``` ### How to use -#### nodejs - Authentication, client creation and get workspaces as an example written in TypeScript. +#### nodejs - client creation and get workspaces as an example written in TypeScript. ##### Install @azure/ms-rest-nodeauth -``` -npm install @azure/ms-rest-nodeauth +- Please install minimum version of `"@azure/ms-rest-nodeauth": "^3.0.0"`. +```bash +npm install @azure/ms-rest-nodeauth@"^3.0.0" ``` ##### Sample code -```ts -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"; -import { DatabricksClient, DatabricksModels, DatabricksMappers } from "@azure/arm-databricks"; +While the below sample uses the interactive login, other authentication options can be found in the [README.md file of @azure/ms-rest-nodeauth](https://www.npmjs.com/package/@azure/ms-rest-nodeauth) package +```typescript +const msRestNodeAuth = require("@azure/ms-rest-nodeauth"); +const { DatabricksClient } = require("@azure/arm-databricks"); const subscriptionId = process.env["AZURE_SUBSCRIPTION_ID"]; msRestNodeAuth.interactiveLogin().then((creds) => { @@ -49,7 +49,7 @@ msRestNodeAuth.interactiveLogin().then((creds) => { ##### Install @azure/ms-rest-browserauth -``` +```bash npm install @azure/ms-rest-browserauth ``` @@ -99,5 +99,4 @@ See https://github.com/Azure/ms-rest-browserauth to learn how to authenticate to - [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%2Fsdk%2Fdatabricks%2Farm-databricks%2FREADME.png) +![Impressions](https://azure-sdk-impressions.azurewebsites.net/api/impressions/azure-sdk-for-js/sdk/databricks/arm-databricks/README.png) diff --git a/sdk/databricks/arm-databricks/package.json b/sdk/databricks/arm-databricks/package.json index bbb647556acb..c78d8f8079c5 100644 --- a/sdk/databricks/arm-databricks/package.json +++ b/sdk/databricks/arm-databricks/package.json @@ -4,9 +4,9 @@ "description": "DatabricksClient Library with typescript type definitions for node.js and browser.", "version": "1.1.0", "dependencies": { - "@azure/ms-rest-azure-js": "^1.1.0", - "@azure/ms-rest-js": "^1.1.0", - "tslib": "^1.9.3" + "@azure/ms-rest-azure-js": "^2.0.1", + "@azure/ms-rest-js": "^2.0.4", + "tslib": "^1.10.0" }, "keywords": [ "node", @@ -20,18 +20,19 @@ "module": "./esm/databricksClient.js", "types": "./esm/databricksClient.d.ts", "devDependencies": { - "typescript": "^3.1.1", - "rollup": "^0.66.2", - "rollup-plugin-node-resolve": "^3.4.0", - "uglify-js": "^3.4.9" + "typescript": "^3.5.3", + "rollup": "^1.18.0", + "rollup-plugin-node-resolve": "^5.2.0", + "rollup-plugin-sourcemaps": "^0.4.2", + "uglify-js": "^3.6.0" }, - "homepage": "https://github.com/azure/azure-sdk-for-js/tree/master/sdk/databricks/arm-databricks", + "homepage": "https://github.com/Azure/azure-sdk-for-js/tree/master/sdk/databricks/arm-databricks", "repository": { "type": "git", - "url": "https://github.com/azure/azure-sdk-for-js.git" + "url": "https://github.com/Azure/azure-sdk-for-js.git" }, "bugs": { - "url": "https://github.com/azure/azure-sdk-for-js/issues" + "url": "https://github.com/Azure/azure-sdk-for-js/issues" }, "files": [ "dist/**/*.js", @@ -43,6 +44,7 @@ "esm/**/*.d.ts", "esm/**/*.d.ts.map", "src/**/*.ts", + "README.md", "rollup.config.js", "tsconfig.json" ], diff --git a/sdk/databricks/arm-databricks/rollup.config.js b/sdk/databricks/arm-databricks/rollup.config.js index 10910c284024..8067451a8680 100644 --- a/sdk/databricks/arm-databricks/rollup.config.js +++ b/sdk/databricks/arm-databricks/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/databricksClient.js', - external: ["@azure/ms-rest-js", "@azure/ms-rest-azure-js"], + input: "./esm/databricksClient.js", + external: [ + "@azure/ms-rest-js", + "@azure/ms-rest-azure-js" + ], output: { file: "./dist/arm-databricks.js", format: "umd", @@ -15,17 +21,17 @@ const config = { "@azure/ms-rest-azure-js": "msRestAzure" }, banner: `/* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. * * 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({ mainFields: ['module', 'main'] }), + sourcemaps() ] }; + export default config; diff --git a/sdk/databricks/arm-databricks/src/databricksClient.ts b/sdk/databricks/arm-databricks/src/databricksClient.ts index ef1cc667e629..57c0cfbe1725 100644 --- a/sdk/databricks/arm-databricks/src/databricksClient.ts +++ b/sdk/databricks/arm-databricks/src/databricksClient.ts @@ -1,7 +1,6 @@ /* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. * * Code generated by Microsoft (R) AutoRest Code Generator. * Changes may cause incorrect behavior and will be lost if the code is @@ -18,6 +17,7 @@ import { DatabricksClientContext } from "./databricksClientContext"; class DatabricksClient extends DatabricksClientContext { // Operation groups workspaces: operations.Workspaces; + vNetPeering: operations.VNetPeering; operations: operations.Operations; /** @@ -29,6 +29,7 @@ class DatabricksClient extends DatabricksClientContext { constructor(credentials: msRest.ServiceClientCredentials, subscriptionId: string, options?: Models.DatabricksClientOptions) { super(credentials, subscriptionId, options); this.workspaces = new operations.Workspaces(this); + this.vNetPeering = new operations.VNetPeering(this); this.operations = new operations.Operations(this); } } diff --git a/sdk/databricks/arm-databricks/src/databricksClientContext.ts b/sdk/databricks/arm-databricks/src/databricksClientContext.ts index be3305b83c0f..215e2c8e82ce 100644 --- a/sdk/databricks/arm-databricks/src/databricksClientContext.ts +++ b/sdk/databricks/arm-databricks/src/databricksClientContext.ts @@ -1,7 +1,6 @@ /* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. * * Code generated by Microsoft (R) AutoRest Code Generator. * Changes may cause incorrect behavior and will be lost if the code is @@ -13,7 +12,7 @@ import * as msRest from "@azure/ms-rest-js"; import * as msRestAzure from "@azure/ms-rest-azure-js"; const packageName = "@azure/arm-databricks"; -const packageVersion = "0.1.0"; +const packageVersion = "1.1.0"; export class DatabricksClientContext extends msRestAzure.AzureServiceClient { credentials: msRest.ServiceClientCredentials; diff --git a/sdk/databricks/arm-databricks/src/models/index.ts b/sdk/databricks/arm-databricks/src/models/index.ts index 5b622f068da9..b835802d7883 100644 --- a/sdk/databricks/arm-databricks/src/models/index.ts +++ b/sdk/databricks/arm-databricks/src/models/index.ts @@ -1,11 +1,9 @@ /* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. * * 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. */ import { BaseResource, CloudError, AzureServiceClientOptions } from "@azure/ms-rest-azure-js"; @@ -13,294 +11,563 @@ import * as msRest from "@azure/ms-rest-js"; export { BaseResource, CloudError }; +/** + * The Value. + */ +export interface WorkspaceCustomStringParameter { + /** + * The type of variable that this is. Possible values include: 'Bool', 'Object', 'String' + */ + type?: CustomParameterType; + /** + * The value which should be used for this field. + */ + value: string; +} + +/** + * The value which should be used for this field. + */ +export interface WorkspaceCustomBooleanParameter { + /** + * The type of variable that this is. Possible values include: 'Bool', 'Object', 'String' + */ + type?: CustomParameterType; + /** + * The value which should be used for this field. + */ + value: boolean; +} + +/** + * The object that contains details of encryption used on the workspace. + */ +export interface Encryption { + /** + * The encryption keySource (provider). Possible values (case-insensitive): Default, + * Microsoft.Keyvault. Possible values include: 'Default', 'Microsoft.Keyvault'. Default value: + * 'Default'. + */ + keySource?: KeySource; + /** + * The name of KeyVault key. + */ + keyName?: string; + /** + * The version of KeyVault key. + */ + keyVersion?: string; + /** + * The Uri of KeyVault. + */ + keyVaultUri?: string; +} + +/** + * The object that contains details of encryption used on the workspace. + */ +export interface WorkspaceEncryptionParameter { + /** + * The type of variable that this is. Possible values include: 'Bool', 'Object', 'String' + */ + type?: CustomParameterType; + /** + * The value which should be used for this field. + */ + value?: Encryption; +} + +/** + * Custom Parameters used for Cluster Creation. + */ +export interface WorkspaceCustomParameters { + /** + * The ID of a Azure Machine Learning workspace to link with Databricks workspace + */ + amlWorkspaceId?: WorkspaceCustomStringParameter; + /** + * The ID of a Virtual Network where this Databricks Cluster should be created + */ + customVirtualNetworkId?: WorkspaceCustomStringParameter; + /** + * The name of a Public Subnet within the Virtual Network + */ + customPublicSubnetName?: WorkspaceCustomStringParameter; + /** + * The name of the Private Subnet within the Virtual Network + */ + customPrivateSubnetName?: WorkspaceCustomStringParameter; + /** + * Should the Public IP be Disabled? + */ + enableNoPublicIp?: WorkspaceCustomBooleanParameter; + /** + * Prepare the workspace for encryption. Enables the Managed Identity for managed storage + * account. + */ + prepareEncryption?: WorkspaceCustomBooleanParameter; + /** + * Contains the encryption details for Customer-Managed Key (CMK) enabled workspace. + */ + encryption?: WorkspaceEncryptionParameter; + /** + * A boolean indicating whether or not the DBFS root file system will be enabled with secondary + * layer of encryption with platform managed keys for data at rest. + */ + requireInfrastructureEncryption?: WorkspaceCustomBooleanParameter; + /** + * Name of the default DBFS storage account name. + */ + storageAccountName?: WorkspaceCustomStringParameter; + /** + * Storage account SKU name + */ + storageAccountSkuName?: WorkspaceCustomStringParameter; +} /** - * @interface - * An interface representing WorkspaceProviderAuthorization. * The workspace provider authorization. - * */ export interface WorkspaceProviderAuthorization { /** - * @member {string} principalId The provider's principal identifier. This is - * the identity that the provider will use to call ARM to manage the - * workspace resources. + * The provider's principal identifier. This is the identity that the provider will use to call + * ARM to manage the workspace resources. */ principalId: string; /** - * @member {string} roleDefinitionId The provider's role definition - * identifier. This role will define all the permissions that the provider - * must have on the workspace's container resource group. This role - * definition cannot have permission to delete the resource group. + * The provider's role definition identifier. This role will define all the permissions that the + * provider must have on the workspace's container resource group. This role definition cannot + * have permission to delete the resource group. */ roleDefinitionId: string; } /** - * @interface - * An interface representing Sku. + * Provides details of the entity that created/updated the workspace. + */ +export interface CreatedBy { + /** + * The Object ID that created the workspace. + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly oid?: string; + /** + * The Personal Object ID corresponding to the object ID above + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly puid?: string; + /** + * The application ID of the application that initiated the creation of the workspace. For + * example, Azure Portal. + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly applicationId?: string; +} + +/** + * The Managed Identity details for storage account. + */ +export interface ManagedIdentityConfiguration { + /** + * The objectId of the Managed Identity that is linked to the Managed Storage account. + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly principalId?: string; + /** + * The tenant Id where the Managed Identity is created. + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly tenantId?: string; + /** + * The type of Identity created. It can be either SystemAssigned or UserAssigned. + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly type?: string; +} + +/** * SKU for the resource. - * */ export interface Sku { /** - * @member {string} name The SKU name. + * The SKU name. */ name: string; /** - * @member {string} [tier] The SKU tier. + * The SKU tier. */ tier?: string; } /** - * @interface - * An interface representing Resource. * The core properties of ARM resources - * - * @extends BaseResource */ export interface Resource extends BaseResource { /** - * @member {string} [id] Fully qualified resource Id for the resource. Ex - + * Fully qualified resource Id for the resource. Ex - * /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} - * **NOTE: This property will not be serialized. It can only be populated by - * the server.** + * **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.** + * 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. Ex- - * Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts. - * **NOTE: This property will not be serialized. It can only be populated by - * the server.** + * The type of the resource. Ex- Microsoft.Compute/virtualMachines or + * Microsoft.Storage/storageAccounts. + * **NOTE: This property will not be serialized. It can only be populated by the server.** */ readonly type?: string; } /** - * @interface - * An interface representing TrackedResource. * The resource model definition for a ARM tracked top level resource - * - * @extends Resource */ export interface TrackedResource extends Resource { /** - * @member {{ [propertyName: string]: string }} [tags] Resource tags. + * Resource tags. */ tags?: { [propertyName: string]: string }; /** - * @member {string} location The geo-location where the resource lives + * The geo-location where the resource lives */ location: string; } /** - * @interface - * An interface representing Workspace. * Information about workspace. - * - * @extends TrackedResource */ export interface Workspace extends TrackedResource { /** - * @member {string} managedResourceGroupId The managed resource group Id. + * The managed resource group Id. */ managedResourceGroupId: string; /** - * @member {any} [parameters] Name and value pairs that define the workspace - * parameters. + * The workspace's custom parameters. */ - parameters?: any; + parameters?: WorkspaceCustomParameters; /** - * @member {ProvisioningState} [provisioningState] The workspace provisioning - * state. Possible values include: 'Accepted', 'Running', 'Ready', - * 'Creating', 'Created', 'Deleting', 'Deleted', 'Canceled', 'Failed', - * 'Succeeded', 'Updating' - * **NOTE: This property will not be serialized. It can only be populated by - * the server.** + * The workspace provisioning state. Possible values include: 'Accepted', 'Running', 'Ready', + * 'Creating', 'Created', 'Deleting', 'Deleted', 'Canceled', 'Failed', 'Succeeded', 'Updating' + * **NOTE: This property will not be serialized. It can only be populated by the server.** */ readonly provisioningState?: ProvisioningState; /** - * @member {string} [uiDefinitionUri] The blob URI where the UI definition - * file is located. + * The blob URI where the UI definition file is located. */ uiDefinitionUri?: string; /** - * @member {WorkspaceProviderAuthorization[]} [authorizations] The workspace - * provider authorizations. + * The workspace provider authorizations. */ authorizations?: WorkspaceProviderAuthorization[]; /** - * @member {Sku} [sku] The SKU of the resource. + * Indicates the Object ID, PUID and Application ID of entity that created the workspace. + */ + createdBy?: CreatedBy; + /** + * Indicates the Object ID, PUID and Application ID of entity that last updated the workspace. + */ + updatedBy?: CreatedBy; + /** + * Specifies the date and time when the workspace is created. + */ + createdDateTime?: Date; + /** + * The unique identifier of the databricks workspace in databricks control plane. + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly workspaceId?: string; + /** + * The workspace URL which is of the format 'adb-{workspaceId}.{random}.azuredatabricks.net' + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly workspaceUrl?: string; + /** + * The details of Managed Identity of Storage Account + */ + storageAccountIdentity?: ManagedIdentityConfiguration; + /** + * The SKU of the resource. */ sku?: Sku; } /** - * @interface - * An interface representing WorkspaceUpdate. + * The value which should be used for this field. + */ +export interface WorkspaceCustomObjectParameter { + /** + * The type of variable that this is. Possible values include: 'Bool', 'Object', 'String' + */ + type?: CustomParameterType; + /** + * The value which should be used for this field. + */ + value: any; +} + +/** * An update to a workspace. - * */ export interface WorkspaceUpdate { /** - * @member {{ [propertyName: string]: string }} [tags] Resource tags. + * Resource tags. */ tags?: { [propertyName: string]: string }; } /** - * @interface * An interface representing ErrorDetail. * @summary Error details. - * */ export interface ErrorDetail { /** - * @member {string} code The error's code. + * The error's code. */ code: string; /** - * @member {string} message A human readable error message. + * A human readable error message. */ message: string; /** - * @member {string} [target] Indicates which property in the request is - * responsible for the error. + * Indicates which property in the request is responsible for the error. */ target?: string; } /** - * @interface * An interface representing ErrorInfo. * @summary The code and message for an error. - * */ export interface ErrorInfo { /** - * @member {string} code A machine readable error code. + * A machine readable error code. */ code: string; /** - * @member {string} message A human readable error message. + * A human readable error message. */ message: string; /** - * @member {ErrorDetail[]} [details] error details. + * error details. */ details?: ErrorDetail[]; /** - * @member {string} [innererror] Inner error details if they exist. + * Inner error details if they exist. */ innererror?: string; } /** - * @interface - * An interface representing ErrorResponse. - * @summary Error response. - * * Contains details when the response code indicates an error. - * + * @summary Error response. */ export interface ErrorResponse { /** - * @member {ErrorInfo} error The error details. + * The error details. */ error: ErrorInfo; } /** - * @interface - * An interface representing OperationDisplay. * The object that represents the operation. - * */ export interface OperationDisplay { /** - * @member {string} [provider] Service provider: Microsoft.ResourceProvider + * Service provider: Microsoft.ResourceProvider */ provider?: string; /** - * @member {string} [resource] Resource on which the operation is performed. + * Resource on which the operation is performed. */ resource?: string; /** - * @member {string} [operation] Operation type: Read, write, delete, etc. + * Operation type: Read, write, delete, etc. */ operation?: string; } /** - * @interface - * An interface representing Operation. * REST API operation - * */ export interface Operation { /** - * @member {string} [name] Operation name: {provider}/{resource}/{operation} + * Operation name: {provider}/{resource}/{operation} */ name?: string; /** - * @member {OperationDisplay} [display] The object that represents the - * operation. + * The object that represents the operation. */ display?: OperationDisplay; } /** - * @interface - * An interface representing DatabricksClientOptions. - * @extends AzureServiceClientOptions + * The remote virtual network should be in the same region. See here to learn more + * (https://docs.microsoft.com/en-us/azure/databricks/administration-guide/cloud-configurations/azure/vnet-peering). */ -export interface DatabricksClientOptions extends AzureServiceClientOptions { +export interface VirtualNetworkPeeringPropertiesFormatDatabricksVirtualNetwork { /** - * @member {string} [baseUri] + * The Id of the databricks virtual network. */ - baseUri?: string; + id?: string; } +/** + * AddressSpace contains an array of IP address ranges that can be used by subnets of the virtual + * network. + */ +export interface AddressSpace { + /** + * A list of address blocks reserved for this virtual network in CIDR notation. + */ + addressPrefixes?: string[]; +} + +/** + * The remote virtual network should be in the same region. See here to learn more + * (https://docs.microsoft.com/en-us/azure/databricks/administration-guide/cloud-configurations/azure/vnet-peering). + */ +export interface VirtualNetworkPeeringPropertiesFormatRemoteVirtualNetwork { + /** + * The Id of the remote virtual network. + */ + id?: string; +} + +/** + * Peerings in a VirtualNetwork resource + */ +export interface VirtualNetworkPeering extends BaseResource { + /** + * Whether the VMs in the local virtual network space would be able to access the VMs in remote + * virtual network space. + */ + allowVirtualNetworkAccess?: boolean; + /** + * Whether the forwarded traffic from the VMs in the local virtual network will be + * allowed/disallowed in remote virtual network. + */ + allowForwardedTraffic?: boolean; + /** + * If gateway links can be used in remote virtual networking to link to this virtual network. + */ + allowGatewayTransit?: boolean; + /** + * If remote gateways can be used on this virtual network. If the flag is set to true, and + * allowGatewayTransit on remote peering is also true, virtual network will use gateways of + * remote virtual network for transit. Only one peering can have this flag set to true. This flag + * cannot be set if virtual network already has a gateway. + */ + useRemoteGateways?: boolean; + /** + * The remote virtual network should be in the same region. See here to learn more + * (https://docs.microsoft.com/en-us/azure/databricks/administration-guide/cloud-configurations/azure/vnet-peering). + */ + databricksVirtualNetwork?: VirtualNetworkPeeringPropertiesFormatDatabricksVirtualNetwork; + /** + * The reference to the databricks virtual network address space. + */ + databricksAddressSpace?: AddressSpace; + /** + * The remote virtual network should be in the same region. See here to learn more + * (https://docs.microsoft.com/en-us/azure/databricks/administration-guide/cloud-configurations/azure/vnet-peering). + */ + remoteVirtualNetwork: VirtualNetworkPeeringPropertiesFormatRemoteVirtualNetwork; + /** + * The reference to the remote virtual network address space. + */ + remoteAddressSpace?: AddressSpace; + /** + * The status of the virtual network peering. Possible values include: 'Initiated', 'Connected', + * 'Disconnected' + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly peeringState?: PeeringState; + /** + * The provisioning state of the virtual network peering resource. Possible values include: + * 'Succeeded', 'Updating', 'Deleting', 'Failed' + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly provisioningState?: PeeringProvisioningState; + /** + * Name of the virtual network peering resource + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly name?: string; + /** + * Resource ID. + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly id?: string; + /** + * type of the virtual network peering resource + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly type?: string; +} + +/** + * An interface representing DatabricksClientOptions. + */ +export interface DatabricksClientOptions extends AzureServiceClientOptions { + baseUri?: string; +} /** * @interface - * An interface representing the WorkspaceListResult. * List of workspaces. - * * @extends Array */ export interface WorkspaceListResult extends Array { /** - * @member {string} [nextLink] The URL to use for getting the next set of - * results. + * The URL to use for getting the next set of results. */ nextLink?: string; } /** * @interface - * An interface representing the OperationListResult. - * Result of the request to list Resource Provider operations. It contains a - * list of operations and a URL link to get the next set of results. - * + * Gets all virtual network peerings under a workspace. + * @extends Array + */ +export interface VirtualNetworkPeeringList extends Array { + /** + * URL to get the next set of virtual network peering list results if there are any. + */ + nextLink?: string; +} + +/** + * @interface + * Result of the request to list Resource Provider operations. It contains a list of operations and + * a URL link to get the next set of results. * @extends Array */ export interface OperationListResult extends Array { /** - * @member {string} [nextLink] URL to get the next set of operation list - * results if there are any. + * URL to get the next set of operation list results if there are any. */ nextLink?: string; } +/** + * Defines values for CustomParameterType. + * Possible values include: 'Bool', 'Object', 'String' + * @readonly + * @enum {string} + */ +export type CustomParameterType = 'Bool' | 'Object' | 'String'; + +/** + * Defines values for KeySource. + * Possible values include: 'Default', 'Microsoft.Keyvault' + * @readonly + * @enum {string} + */ +export type KeySource = 'Default' | 'Microsoft.Keyvault'; + /** * Defines values for ProvisioningState. * Possible values include: 'Accepted', 'Running', 'Ready', 'Creating', 'Created', 'Deleting', @@ -310,6 +577,22 @@ export interface OperationListResult extends Array { */ export type ProvisioningState = 'Accepted' | 'Running' | 'Ready' | 'Creating' | 'Created' | 'Deleting' | 'Deleted' | 'Canceled' | 'Failed' | 'Succeeded' | 'Updating'; +/** + * Defines values for PeeringProvisioningState. + * Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' + * @readonly + * @enum {string} + */ +export type PeeringProvisioningState = 'Succeeded' | 'Updating' | 'Deleting' | 'Failed'; + +/** + * Defines values for PeeringState. + * Possible values include: 'Initiated', 'Connected', 'Disconnected' + * @readonly + * @enum {string} + */ +export type PeeringState = 'Initiated' | 'Connected' | 'Disconnected'; + /** * Contains response data for the get operation. */ @@ -322,6 +605,7 @@ export type WorkspacesGetResponse = Workspace & { * The response body as text (string format) */ bodyAsText: string; + /** * The response body as parsed JSON or XML */ @@ -341,6 +625,7 @@ export type WorkspacesCreateOrUpdateResponse = Workspace & { * The response body as text (string format) */ bodyAsText: string; + /** * The response body as parsed JSON or XML */ @@ -360,6 +645,7 @@ export type WorkspacesUpdateResponse = Workspace & { * The response body as text (string format) */ bodyAsText: string; + /** * The response body as parsed JSON or XML */ @@ -379,6 +665,7 @@ export type WorkspacesListByResourceGroupResponse = WorkspaceListResult & { * The response body as text (string format) */ bodyAsText: string; + /** * The response body as parsed JSON or XML */ @@ -398,6 +685,7 @@ export type WorkspacesListBySubscriptionResponse = WorkspaceListResult & { * The response body as text (string format) */ bodyAsText: string; + /** * The response body as parsed JSON or XML */ @@ -417,6 +705,7 @@ export type WorkspacesBeginCreateOrUpdateResponse = Workspace & { * The response body as text (string format) */ bodyAsText: string; + /** * The response body as parsed JSON or XML */ @@ -436,6 +725,7 @@ export type WorkspacesBeginUpdateResponse = Workspace & { * The response body as text (string format) */ bodyAsText: string; + /** * The response body as parsed JSON or XML */ @@ -455,6 +745,7 @@ export type WorkspacesListByResourceGroupNextResponse = WorkspaceListResult & { * The response body as text (string format) */ bodyAsText: string; + /** * The response body as parsed JSON or XML */ @@ -474,6 +765,7 @@ export type WorkspacesListBySubscriptionNextResponse = WorkspaceListResult & { * The response body as text (string format) */ bodyAsText: string; + /** * The response body as parsed JSON or XML */ @@ -481,6 +773,106 @@ export type WorkspacesListBySubscriptionNextResponse = WorkspaceListResult & { }; }; +/** + * Contains response data for the get operation. + */ +export type VNetPeeringGetResponse = VirtualNetworkPeering & { + /** + * 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: VirtualNetworkPeering; + }; +}; + +/** + * Contains response data for the createOrUpdate operation. + */ +export type VNetPeeringCreateOrUpdateResponse = VirtualNetworkPeering & { + /** + * 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: VirtualNetworkPeering; + }; +}; + +/** + * Contains response data for the listByWorkspace operation. + */ +export type VNetPeeringListByWorkspaceResponse = VirtualNetworkPeeringList & { + /** + * 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: VirtualNetworkPeeringList; + }; +}; + +/** + * Contains response data for the beginCreateOrUpdate operation. + */ +export type VNetPeeringBeginCreateOrUpdateResponse = VirtualNetworkPeering & { + /** + * 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: VirtualNetworkPeering; + }; +}; + +/** + * Contains response data for the listByWorkspaceNext operation. + */ +export type VNetPeeringListByWorkspaceNextResponse = VirtualNetworkPeeringList & { + /** + * 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: VirtualNetworkPeeringList; + }; +}; + /** * Contains response data for the list operation. */ @@ -493,6 +885,7 @@ export type OperationsListResponse = OperationListResult & { * The response body as text (string format) */ bodyAsText: string; + /** * The response body as parsed JSON or XML */ @@ -512,6 +905,7 @@ export type OperationsListNextResponse = OperationListResult & { * The response body as text (string format) */ bodyAsText: string; + /** * The response body as parsed JSON or XML */ diff --git a/sdk/databricks/arm-databricks/src/models/mappers.ts b/sdk/databricks/arm-databricks/src/models/mappers.ts index 8d5caa24faef..7cf53474734a 100644 --- a/sdk/databricks/arm-databricks/src/models/mappers.ts +++ b/sdk/databricks/arm-databricks/src/models/mappers.ts @@ -1,11 +1,9 @@ /* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. * * 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. */ import { CloudErrorMapper, BaseResourceMapper } from "@azure/ms-rest-azure-js"; @@ -14,6 +12,190 @@ import * as msRest from "@azure/ms-rest-js"; export const CloudError = CloudErrorMapper; export const BaseResource = BaseResourceMapper; +export const WorkspaceCustomStringParameter: msRest.CompositeMapper = { + serializedName: "WorkspaceCustomStringParameter", + type: { + name: "Composite", + className: "WorkspaceCustomStringParameter", + modelProperties: { + type: { + serializedName: "type", + type: { + name: "String" + } + }, + value: { + required: true, + serializedName: "value", + type: { + name: "String" + } + } + } + } +}; + +export const WorkspaceCustomBooleanParameter: msRest.CompositeMapper = { + serializedName: "WorkspaceCustomBooleanParameter", + type: { + name: "Composite", + className: "WorkspaceCustomBooleanParameter", + modelProperties: { + type: { + serializedName: "type", + type: { + name: "String" + } + }, + value: { + required: true, + serializedName: "value", + type: { + name: "Boolean" + } + } + } + } +}; + +export const Encryption: msRest.CompositeMapper = { + serializedName: "Encryption", + type: { + name: "Composite", + className: "Encryption", + modelProperties: { + keySource: { + serializedName: "keySource", + defaultValue: 'Default', + type: { + name: "String" + } + }, + keyName: { + serializedName: "KeyName", + type: { + name: "String" + } + }, + keyVersion: { + serializedName: "keyversion", + type: { + name: "String" + } + }, + keyVaultUri: { + serializedName: "keyvaulturi", + type: { + name: "String" + } + } + } + } +}; + +export const WorkspaceEncryptionParameter: msRest.CompositeMapper = { + serializedName: "WorkspaceEncryptionParameter", + type: { + name: "Composite", + className: "WorkspaceEncryptionParameter", + modelProperties: { + type: { + serializedName: "type", + type: { + name: "String" + } + }, + value: { + serializedName: "value", + type: { + name: "Composite", + className: "Encryption" + } + } + } + } +}; + +export const WorkspaceCustomParameters: msRest.CompositeMapper = { + serializedName: "WorkspaceCustomParameters", + type: { + name: "Composite", + className: "WorkspaceCustomParameters", + modelProperties: { + amlWorkspaceId: { + serializedName: "amlWorkspaceId", + type: { + name: "Composite", + className: "WorkspaceCustomStringParameter" + } + }, + customVirtualNetworkId: { + serializedName: "customVirtualNetworkId", + type: { + name: "Composite", + className: "WorkspaceCustomStringParameter" + } + }, + customPublicSubnetName: { + serializedName: "customPublicSubnetName", + type: { + name: "Composite", + className: "WorkspaceCustomStringParameter" + } + }, + customPrivateSubnetName: { + serializedName: "customPrivateSubnetName", + type: { + name: "Composite", + className: "WorkspaceCustomStringParameter" + } + }, + enableNoPublicIp: { + serializedName: "enableNoPublicIp", + type: { + name: "Composite", + className: "WorkspaceCustomBooleanParameter" + } + }, + prepareEncryption: { + serializedName: "prepareEncryption", + type: { + name: "Composite", + className: "WorkspaceCustomBooleanParameter" + } + }, + encryption: { + serializedName: "encryption", + type: { + name: "Composite", + className: "WorkspaceEncryptionParameter" + } + }, + requireInfrastructureEncryption: { + serializedName: "requireInfrastructureEncryption", + type: { + name: "Composite", + className: "WorkspaceCustomBooleanParameter" + } + }, + storageAccountName: { + serializedName: "storageAccountName", + type: { + name: "Composite", + className: "WorkspaceCustomStringParameter" + } + }, + storageAccountSkuName: { + serializedName: "storageAccountSkuName", + type: { + name: "Composite", + className: "WorkspaceCustomStringParameter" + } + } + } + } +}; + export const WorkspaceProviderAuthorization: msRest.CompositeMapper = { serializedName: "WorkspaceProviderAuthorization", type: { @@ -38,6 +220,68 @@ export const WorkspaceProviderAuthorization: msRest.CompositeMapper = { } }; +export const CreatedBy: msRest.CompositeMapper = { + serializedName: "CreatedBy", + type: { + name: "Composite", + className: "CreatedBy", + modelProperties: { + oid: { + readOnly: true, + serializedName: "oid", + type: { + name: "Uuid" + } + }, + puid: { + readOnly: true, + serializedName: "puid", + type: { + name: "String" + } + }, + applicationId: { + readOnly: true, + serializedName: "applicationId", + type: { + name: "Uuid" + } + } + } + } +}; + +export const ManagedIdentityConfiguration: msRest.CompositeMapper = { + serializedName: "ManagedIdentityConfiguration", + type: { + name: "Composite", + className: "ManagedIdentityConfiguration", + modelProperties: { + principalId: { + readOnly: true, + serializedName: "principalId", + type: { + name: "Uuid" + } + }, + tenantId: { + readOnly: true, + serializedName: "tenantId", + type: { + name: "Uuid" + } + }, + type: { + readOnly: true, + serializedName: "type", + type: { + name: "String" + } + } + } + } +}; + export const Sku: msRest.CompositeMapper = { serializedName: "Sku", type: { @@ -138,7 +382,8 @@ export const Workspace: msRest.CompositeMapper = { parameters: { serializedName: "properties.parameters", type: { - name: "Object" + name: "Composite", + className: "WorkspaceCustomParameters" } }, provisioningState: { @@ -166,6 +411,47 @@ export const Workspace: msRest.CompositeMapper = { } } }, + createdBy: { + serializedName: "properties.createdBy", + type: { + name: "Composite", + className: "CreatedBy" + } + }, + updatedBy: { + serializedName: "properties.updatedBy", + type: { + name: "Composite", + className: "CreatedBy" + } + }, + createdDateTime: { + serializedName: "properties.createdDateTime", + type: { + name: "DateTime" + } + }, + workspaceId: { + readOnly: true, + serializedName: "properties.workspaceId", + type: { + name: "String" + } + }, + workspaceUrl: { + readOnly: true, + serializedName: "properties.workspaceUrl", + type: { + name: "String" + } + }, + storageAccountIdentity: { + serializedName: "properties.storageAccountIdentity", + type: { + name: "Composite", + className: "ManagedIdentityConfiguration" + } + }, sku: { serializedName: "sku", type: { @@ -177,6 +463,29 @@ export const Workspace: msRest.CompositeMapper = { } }; +export const WorkspaceCustomObjectParameter: msRest.CompositeMapper = { + serializedName: "WorkspaceCustomObjectParameter", + type: { + name: "Composite", + className: "WorkspaceCustomObjectParameter", + modelProperties: { + type: { + serializedName: "type", + type: { + name: "String" + } + }, + value: { + required: true, + serializedName: "value", + type: { + name: "Object" + } + } + } + } +}; + export const WorkspaceUpdate: msRest.CompositeMapper = { serializedName: "WorkspaceUpdate", type: { @@ -339,6 +648,157 @@ export const Operation: msRest.CompositeMapper = { } }; +export const VirtualNetworkPeeringPropertiesFormatDatabricksVirtualNetwork: msRest.CompositeMapper = { + serializedName: "VirtualNetworkPeeringPropertiesFormat_databricksVirtualNetwork", + type: { + name: "Composite", + className: "VirtualNetworkPeeringPropertiesFormatDatabricksVirtualNetwork", + modelProperties: { + id: { + serializedName: "id", + type: { + name: "String" + } + } + } + } +}; + +export const AddressSpace: msRest.CompositeMapper = { + serializedName: "AddressSpace", + type: { + name: "Composite", + className: "AddressSpace", + modelProperties: { + addressPrefixes: { + serializedName: "addressPrefixes", + type: { + name: "Sequence", + element: { + type: { + name: "String" + } + } + } + } + } + } +}; + +export const VirtualNetworkPeeringPropertiesFormatRemoteVirtualNetwork: msRest.CompositeMapper = { + serializedName: "VirtualNetworkPeeringPropertiesFormat_remoteVirtualNetwork", + type: { + name: "Composite", + className: "VirtualNetworkPeeringPropertiesFormatRemoteVirtualNetwork", + modelProperties: { + id: { + serializedName: "id", + type: { + name: "String" + } + } + } + } +}; + +export const VirtualNetworkPeering: msRest.CompositeMapper = { + serializedName: "VirtualNetworkPeering", + type: { + name: "Composite", + className: "VirtualNetworkPeering", + modelProperties: { + allowVirtualNetworkAccess: { + serializedName: "properties.allowVirtualNetworkAccess", + type: { + name: "Boolean" + } + }, + allowForwardedTraffic: { + serializedName: "properties.allowForwardedTraffic", + type: { + name: "Boolean" + } + }, + allowGatewayTransit: { + serializedName: "properties.allowGatewayTransit", + type: { + name: "Boolean" + } + }, + useRemoteGateways: { + serializedName: "properties.useRemoteGateways", + type: { + name: "Boolean" + } + }, + databricksVirtualNetwork: { + serializedName: "properties.databricksVirtualNetwork", + type: { + name: "Composite", + className: "VirtualNetworkPeeringPropertiesFormatDatabricksVirtualNetwork" + } + }, + databricksAddressSpace: { + serializedName: "properties.databricksAddressSpace", + type: { + name: "Composite", + className: "AddressSpace" + } + }, + remoteVirtualNetwork: { + required: true, + serializedName: "properties.remoteVirtualNetwork", + type: { + name: "Composite", + className: "VirtualNetworkPeeringPropertiesFormatRemoteVirtualNetwork" + } + }, + remoteAddressSpace: { + serializedName: "properties.remoteAddressSpace", + type: { + name: "Composite", + className: "AddressSpace" + } + }, + peeringState: { + readOnly: true, + serializedName: "properties.peeringState", + type: { + name: "String" + } + }, + provisioningState: { + readOnly: true, + serializedName: "properties.provisioningState", + type: { + name: "String" + } + }, + name: { + readOnly: true, + serializedName: "name", + type: { + name: "String" + } + }, + id: { + readOnly: true, + serializedName: "id", + type: { + name: "String" + } + }, + type: { + readOnly: true, + serializedName: "type", + type: { + name: "String" + } + } + } + } +}; + export const WorkspaceListResult: msRest.CompositeMapper = { serializedName: "WorkspaceListResult", type: { @@ -367,6 +827,34 @@ export const WorkspaceListResult: msRest.CompositeMapper = { } }; +export const VirtualNetworkPeeringList: msRest.CompositeMapper = { + serializedName: "VirtualNetworkPeeringList", + type: { + name: "Composite", + className: "VirtualNetworkPeeringList", + modelProperties: { + value: { + serializedName: "", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "VirtualNetworkPeering" + } + } + } + }, + nextLink: { + serializedName: "nextLink", + type: { + name: "String" + } + } + } + } +}; + export const OperationListResult: msRest.CompositeMapper = { serializedName: "OperationListResult", type: { diff --git a/sdk/databricks/arm-databricks/src/models/operationsMappers.ts b/sdk/databricks/arm-databricks/src/models/operationsMappers.ts index ca1587789d15..872cb56fb0bd 100644 --- a/sdk/databricks/arm-databricks/src/models/operationsMappers.ts +++ b/sdk/databricks/arm-databricks/src/models/operationsMappers.ts @@ -1,19 +1,16 @@ /* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. * * 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. */ export { - OperationListResult, + ErrorDetail, + ErrorInfo, + ErrorResponse, Operation, OperationDisplay, - ErrorResponse, - ErrorInfo, - ErrorDetail + OperationListResult } from "../models/mappers"; - diff --git a/sdk/databricks/arm-databricks/src/models/parameters.ts b/sdk/databricks/arm-databricks/src/models/parameters.ts index 0ebe5bdcaaa5..7a27d29f8e84 100644 --- a/sdk/databricks/arm-databricks/src/models/parameters.ts +++ b/sdk/databricks/arm-databricks/src/models/parameters.ts @@ -1,7 +1,6 @@ /* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. * * Code generated by Microsoft (R) AutoRest Code Generator. * Changes may cause incorrect behavior and will be lost if the code is @@ -41,6 +40,16 @@ export const nextPageLink: msRest.OperationURLParameter = { }, skipEncoding: true }; +export const peeringName: msRest.OperationURLParameter = { + parameterPath: "peeringName", + mapper: { + required: true, + serializedName: "peeringName", + type: { + name: "String" + } + } +}; export const resourceGroupName: msRest.OperationURLParameter = { parameterPath: "resourceGroupName", mapper: { diff --git a/sdk/databricks/arm-databricks/src/models/vNetPeeringMappers.ts b/sdk/databricks/arm-databricks/src/models/vNetPeeringMappers.ts new file mode 100644 index 000000000000..dd84178b01ee --- /dev/null +++ b/sdk/databricks/arm-databricks/src/models/vNetPeeringMappers.ts @@ -0,0 +1,31 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +export { + AddressSpace, + BaseResource, + CreatedBy, + Encryption, + ErrorDetail, + ErrorInfo, + ErrorResponse, + ManagedIdentityConfiguration, + Resource, + Sku, + TrackedResource, + VirtualNetworkPeering, + VirtualNetworkPeeringList, + VirtualNetworkPeeringPropertiesFormatDatabricksVirtualNetwork, + VirtualNetworkPeeringPropertiesFormatRemoteVirtualNetwork, + Workspace, + WorkspaceCustomBooleanParameter, + WorkspaceCustomParameters, + WorkspaceCustomStringParameter, + WorkspaceEncryptionParameter, + WorkspaceProviderAuthorization +} from "../models/mappers"; diff --git a/sdk/databricks/arm-databricks/src/models/workspacesMappers.ts b/sdk/databricks/arm-databricks/src/models/workspacesMappers.ts index e6f592d4a993..1312177cfb27 100644 --- a/sdk/databricks/arm-databricks/src/models/workspacesMappers.ts +++ b/sdk/databricks/arm-databricks/src/models/workspacesMappers.ts @@ -1,24 +1,32 @@ /* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. * * 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. */ export { - Workspace, - TrackedResource, - Resource, + AddressSpace, BaseResource, - WorkspaceProviderAuthorization, - Sku, - ErrorResponse, - ErrorInfo, + CreatedBy, + Encryption, ErrorDetail, - WorkspaceUpdate, - WorkspaceListResult + ErrorInfo, + ErrorResponse, + ManagedIdentityConfiguration, + Resource, + Sku, + TrackedResource, + VirtualNetworkPeering, + VirtualNetworkPeeringPropertiesFormatDatabricksVirtualNetwork, + VirtualNetworkPeeringPropertiesFormatRemoteVirtualNetwork, + Workspace, + WorkspaceCustomBooleanParameter, + WorkspaceCustomParameters, + WorkspaceCustomStringParameter, + WorkspaceEncryptionParameter, + WorkspaceListResult, + WorkspaceProviderAuthorization, + WorkspaceUpdate } from "../models/mappers"; - diff --git a/sdk/databricks/arm-databricks/src/operations/index.ts b/sdk/databricks/arm-databricks/src/operations/index.ts index 74640cd56b69..08c120b88ba6 100644 --- a/sdk/databricks/arm-databricks/src/operations/index.ts +++ b/sdk/databricks/arm-databricks/src/operations/index.ts @@ -1,7 +1,6 @@ /* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. * * Code generated by Microsoft (R) AutoRest Code Generator. * Changes may cause incorrect behavior and will be lost if the code is @@ -9,4 +8,5 @@ */ export * from "./workspaces"; +export * from "./vNetPeering"; export * from "./operations"; diff --git a/sdk/databricks/arm-databricks/src/operations/operations.ts b/sdk/databricks/arm-databricks/src/operations/operations.ts index 69151b9b3e14..535bd6fa4f43 100644 --- a/sdk/databricks/arm-databricks/src/operations/operations.ts +++ b/sdk/databricks/arm-databricks/src/operations/operations.ts @@ -1,7 +1,6 @@ /* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. * * Code generated by Microsoft (R) AutoRest Code Generator. * Changes may cause incorrect behavior and will be lost if the code is @@ -108,6 +107,9 @@ const listNextOperationSpec: msRest.OperationSpec = { urlParameters: [ Parameters.nextPageLink ], + queryParameters: [ + Parameters.apiVersion + ], headerParameters: [ Parameters.acceptLanguage ], diff --git a/sdk/databricks/arm-databricks/src/operations/vNetPeering.ts b/sdk/databricks/arm-databricks/src/operations/vNetPeering.ts new file mode 100644 index 000000000000..ba2221fbeb84 --- /dev/null +++ b/sdk/databricks/arm-databricks/src/operations/vNetPeering.ts @@ -0,0 +1,333 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * 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/vNetPeeringMappers"; +import * as Parameters from "../models/parameters"; +import { DatabricksClientContext } from "../databricksClientContext"; + +/** Class representing a VNetPeering. */ +export class VNetPeering { + private readonly client: DatabricksClientContext; + + /** + * Create a VNetPeering. + * @param {DatabricksClientContext} client Reference to the service client. + */ + constructor(client: DatabricksClientContext) { + this.client = client; + } + + /** + * Gets the workspace vNet Peering. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param peeringName The name of the workspace vNet peering. + * @param [options] The optional parameters + * @returns Promise + */ + get(resourceGroupName: string, workspaceName: string, peeringName: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param peeringName The name of the workspace vNet peering. + * @param callback The callback + */ + get(resourceGroupName: string, workspaceName: string, peeringName: string, callback: msRest.ServiceCallback): void; + /** + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param peeringName The name of the workspace vNet peering. + * @param options The optional parameters + * @param callback The callback + */ + get(resourceGroupName: string, workspaceName: string, peeringName: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + get(resourceGroupName: string, workspaceName: string, peeringName: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + resourceGroupName, + workspaceName, + peeringName, + options + }, + getOperationSpec, + callback) as Promise; + } + + /** + * Deletes the workspace vNetPeering. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param peeringName The name of the workspace vNet peering. + * @param [options] The optional parameters + * @returns Promise + */ + deleteMethod(resourceGroupName: string, workspaceName: string, peeringName: string, options?: msRest.RequestOptionsBase): Promise { + return this.beginDeleteMethod(resourceGroupName,workspaceName,peeringName,options) + .then(lroPoller => lroPoller.pollUntilFinished()); + } + + /** + * Creates vNet Peering for workspace. + * @param virtualNetworkPeeringParameters Parameters supplied to the create workspace vNet Peering. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param peeringName The name of the workspace vNet peering. + * @param [options] The optional parameters + * @returns Promise + */ + createOrUpdate(virtualNetworkPeeringParameters: Models.VirtualNetworkPeering, resourceGroupName: string, workspaceName: string, peeringName: string, options?: msRest.RequestOptionsBase): Promise { + return this.beginCreateOrUpdate(virtualNetworkPeeringParameters,resourceGroupName,workspaceName,peeringName,options) + .then(lroPoller => lroPoller.pollUntilFinished()) as Promise; + } + + /** + * Lists the workspace vNet Peerings. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param [options] The optional parameters + * @returns Promise + */ + listByWorkspace(resourceGroupName: string, workspaceName: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param callback The callback + */ + listByWorkspace(resourceGroupName: string, workspaceName: string, callback: msRest.ServiceCallback): void; + /** + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param options The optional parameters + * @param callback The callback + */ + listByWorkspace(resourceGroupName: string, workspaceName: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + listByWorkspace(resourceGroupName: string, workspaceName: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + resourceGroupName, + workspaceName, + options + }, + listByWorkspaceOperationSpec, + callback) as Promise; + } + + /** + * Deletes the workspace vNetPeering. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param peeringName The name of the workspace vNet peering. + * @param [options] The optional parameters + * @returns Promise + */ + beginDeleteMethod(resourceGroupName: string, workspaceName: string, peeringName: string, options?: msRest.RequestOptionsBase): Promise { + return this.client.sendLRORequest( + { + resourceGroupName, + workspaceName, + peeringName, + options + }, + beginDeleteMethodOperationSpec, + options); + } + + /** + * Creates vNet Peering for workspace. + * @param virtualNetworkPeeringParameters Parameters supplied to the create workspace vNet Peering. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param peeringName The name of the workspace vNet peering. + * @param [options] The optional parameters + * @returns Promise + */ + beginCreateOrUpdate(virtualNetworkPeeringParameters: Models.VirtualNetworkPeering, resourceGroupName: string, workspaceName: string, peeringName: string, options?: msRest.RequestOptionsBase): Promise { + return this.client.sendLRORequest( + { + virtualNetworkPeeringParameters, + resourceGroupName, + workspaceName, + peeringName, + options + }, + beginCreateOrUpdateOperationSpec, + options); + } + + /** + * Lists the workspace vNet Peerings. + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param [options] The optional parameters + * @returns Promise + */ + listByWorkspaceNext(nextPageLink: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param callback The callback + */ + listByWorkspaceNext(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 + */ + listByWorkspaceNext(nextPageLink: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + listByWorkspaceNext(nextPageLink: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + nextPageLink, + options + }, + listByWorkspaceNextOperationSpec, + callback) as Promise; + } +} + +// Operation Specifications +const serializer = new msRest.Serializer(Mappers); +const getOperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Databricks/workspaces/{workspaceName}/virtualNetworkPeerings/{peeringName}", + urlParameters: [ + Parameters.resourceGroupName, + Parameters.workspaceName, + Parameters.subscriptionId, + Parameters.peeringName + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.VirtualNetworkPeering + }, + 204: {}, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + serializer +}; + +const listByWorkspaceOperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Databricks/workspaces/{workspaceName}/virtualNetworkPeerings", + urlParameters: [ + Parameters.resourceGroupName, + Parameters.workspaceName, + Parameters.subscriptionId + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.VirtualNetworkPeeringList + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + serializer +}; + +const beginDeleteMethodOperationSpec: msRest.OperationSpec = { + httpMethod: "DELETE", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Databricks/workspaces/{workspaceName}/virtualNetworkPeerings/{peeringName}", + urlParameters: [ + Parameters.resourceGroupName, + Parameters.workspaceName, + Parameters.subscriptionId, + Parameters.peeringName + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: {}, + 202: {}, + 204: {}, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + serializer +}; + +const beginCreateOrUpdateOperationSpec: msRest.OperationSpec = { + httpMethod: "PUT", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Databricks/workspaces/{workspaceName}/virtualNetworkPeerings/{peeringName}", + urlParameters: [ + Parameters.resourceGroupName, + Parameters.workspaceName, + Parameters.subscriptionId, + Parameters.peeringName + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + requestBody: { + parameterPath: "virtualNetworkPeeringParameters", + mapper: { + ...Mappers.VirtualNetworkPeering, + required: true + } + }, + responses: { + 200: { + bodyMapper: Mappers.VirtualNetworkPeering + }, + 201: { + bodyMapper: Mappers.VirtualNetworkPeering + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + serializer +}; + +const listByWorkspaceNextOperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + baseUrl: "https://management.azure.com", + path: "{nextLink}", + urlParameters: [ + Parameters.nextPageLink + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.VirtualNetworkPeeringList + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + serializer +}; diff --git a/sdk/databricks/arm-databricks/src/operations/workspaces.ts b/sdk/databricks/arm-databricks/src/operations/workspaces.ts index df498c59fb03..fae29064bbd6 100644 --- a/sdk/databricks/arm-databricks/src/operations/workspaces.ts +++ b/sdk/databricks/arm-databricks/src/operations/workspaces.ts @@ -1,7 +1,6 @@ /* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. * * Code generated by Microsoft (R) AutoRest Code Generator. * Changes may cause incorrect behavior and will be lost if the code is @@ -284,7 +283,6 @@ const getOperationSpec: msRest.OperationSpec = { 200: { bodyMapper: Mappers.Workspace }, - 404: {}, default: { bodyMapper: Mappers.ErrorResponse } @@ -354,6 +352,7 @@ const beginDeleteMethodOperationSpec: msRest.OperationSpec = { Parameters.acceptLanguage ], responses: { + 200: {}, 202: {}, 204: {}, default: { @@ -438,6 +437,9 @@ const listByResourceGroupNextOperationSpec: msRest.OperationSpec = { urlParameters: [ Parameters.nextPageLink ], + queryParameters: [ + Parameters.apiVersion + ], headerParameters: [ Parameters.acceptLanguage ], @@ -459,6 +461,9 @@ const listBySubscriptionNextOperationSpec: msRest.OperationSpec = { urlParameters: [ Parameters.nextPageLink ], + queryParameters: [ + Parameters.apiVersion + ], headerParameters: [ Parameters.acceptLanguage ], diff --git a/sdk/databricks/arm-databricks/tsconfig.json b/sdk/databricks/arm-databricks/tsconfig.json index 87bbf5b5fa49..422b584abd5e 100644 --- a/sdk/databricks/arm-databricks/tsconfig.json +++ b/sdk/databricks/arm-databricks/tsconfig.json @@ -9,7 +9,7 @@ "esModuleInterop": true, "allowSyntheticDefaultImports": true, "forceConsistentCasingInFileNames": true, - "lib": ["es6"], + "lib": ["es6", "dom"], "declaration": true, "outDir": "./esm", "importHelpers": true