diff --git a/common/config/rush/pnpm-lock.yaml b/common/config/rush/pnpm-lock.yaml index eab8c36cbaad..26e4636366c1 100644 --- a/common/config/rush/pnpm-lock.yaml +++ b/common/config/rush/pnpm-lock.yaml @@ -3949,7 +3949,7 @@ packages: dependencies: semver: 7.3.7 shelljs: 0.8.5 - typescript: 4.9.0-dev.20220912 + typescript: 4.9.0-dev.20220913 dev: false /ecdsa-sig-formatter/1.0.11: @@ -8881,8 +8881,8 @@ packages: hasBin: true dev: false - /typescript/4.9.0-dev.20220912: - resolution: {integrity: sha512-B1WnNBtZgqkG48/Z1v4VQWxZSjJl+iJdgafU/8mLFOZyinS5Jejz04TucADMOTufHaIc4USMcYALrAg03Twg1A==} + /typescript/4.9.0-dev.20220913: + resolution: {integrity: sha512-v/DpPFVU1aThfbgdqGaTFD97b+aDqHqkAnQGb6VVsuxiO4/84aIzXp/Xsc7P6sz7+7RiWJqogy2O3Qg3DtD/Fg==} engines: {node: '>=4.2.0'} hasBin: true dev: false @@ -11372,7 +11372,7 @@ packages: dev: false file:projects/arm-databricks.tgz: - resolution: {integrity: sha512-h3zq/sCJRXnGBLsTiP+Me4BINa/BL2rX1qhMr6y+aXFb0qFZC0RVRsuw56wSMuYOHYcYzibzIArY4udAUJuoMw==, tarball: file:projects/arm-databricks.tgz} + resolution: {integrity: sha512-4egvkYGC+6WZ+vATYMXjHFSCX2yGTAkOixaiTKK2bu/3J13aTO+gDow/otgYXw0HH2j1Zizylbkb2wYl5wUyvw==, tarball: file:projects/arm-databricks.tgz} name: '@rush-temp/arm-databricks' version: 0.0.0 dependencies: @@ -11383,6 +11383,8 @@ packages: '@rollup/plugin-json': 4.1.0_rollup@2.79.0 '@rollup/plugin-multi-entry': 4.1.0_rollup@2.79.0 '@rollup/plugin-node-resolve': 13.3.0_rollup@2.79.0 + '@types/chai': 4.3.3 + chai: 4.3.6 cross-env: 7.0.3 mkdirp: 1.0.4 mocha: 7.2.0 @@ -11394,7 +11396,6 @@ packages: uglify-js: 3.17.0 transitivePeerDependencies: - '@types/node' - - encoding - supports-color dev: false diff --git a/sdk/databricks/arm-databricks/CHANGELOG.md b/sdk/databricks/arm-databricks/CHANGELOG.md index 25c9cf1cf219..a1d97d4e97aa 100644 --- a/sdk/databricks/arm-databricks/CHANGELOG.md +++ b/sdk/databricks/arm-databricks/CHANGELOG.md @@ -1,18 +1,8 @@ # Release History + +## 3.0.0-beta.4 (2022-09-13) -## 3.0.0-beta.4 (Unreleased) - -### Features Added - -### Breaking Changes - -### Bugs Fixed - -### Other Changes - -## 3.0.0-beta.3 (2022-04-15) - -The package of @azure/arm-databricks is using our next generation design principles since version 3.0.0-beta.3, which contains breaking changes. +The package of @azure/arm-databricks is using our next generation design principles since version 3.0.0-beta.4, which contains breaking changes. To understand the detail of the change, please refer to [Changelog](https://aka.ms/js-track2-changelog). diff --git a/sdk/databricks/arm-databricks/_meta.json b/sdk/databricks/arm-databricks/_meta.json index ae4d23091702..367fa94cd640 100644 --- a/sdk/databricks/arm-databricks/_meta.json +++ b/sdk/databricks/arm-databricks/_meta.json @@ -1,8 +1,8 @@ { - "commit": "7086ee861c3a6196bb98f8b327af11d03e545a05", - "readme": "specification\\databricks\\resource-manager\\readme.md", - "autorest_command": "autorest --version=3.7.3 --typescript --modelerfour.lenient-model-deduplication --head-as-boolean=true --license-header=MICROSOFT_MIT_NO_VERSION --generate-test --typescript-sdks-folder=D:\\work\\azure-sdk-for-js ..\\azure-rest-api-specs\\specification\\databricks\\resource-manager\\readme.md --use=@autorest/typescript@6.0.0-alpha.19.20220408.1 --generate-sample=true", + "commit": "d1699bdcb33f787cf0727482d4f5d74d011201ee", + "readme": "specification/databricks/resource-manager/readme.md", + "autorest_command": "autorest --version=3.8.4 --typescript --modelerfour.lenient-model-deduplication --azure-arm --head-as-boolean=true --license-header=MICROSOFT_MIT_NO_VERSION --generate-test --typescript-sdks-folder=/mnt/vss/_work/1/s/azure-sdk-for-js ../azure-rest-api-specs/specification/databricks/resource-manager/readme.md --use=@autorest/typescript@6.0.0-rc.1", "repository_url": "https://github.com/Azure/azure-rest-api-specs.git", - "release_tool": "@azure-tools/js-sdk-release-tools@2.2.6", - "use": "@autorest/typescript@6.0.0-alpha.19.20220408.1" + "release_tool": "@azure-tools/js-sdk-release-tools@2.4.2", + "use": "@autorest/typescript@6.0.0-rc.1" } \ No newline at end of file diff --git a/sdk/databricks/arm-databricks/package.json b/sdk/databricks/arm-databricks/package.json index 7a31d46b2b09..4ed01a3eebb6 100644 --- a/sdk/databricks/arm-databricks/package.json +++ b/sdk/databricks/arm-databricks/package.json @@ -40,9 +40,13 @@ "uglify-js": "^3.4.9", "rimraf": "^3.0.0", "@azure/identity": "^2.0.1", - "@azure-tools/test-recorder": "^1.0.0", + "@azure-tools/test-recorder": "^2.0.0", + "@azure-tools/test-credential": "^1.0.0", "mocha": "^7.1.1", - "cross-env": "^7.0.2" + "@types/chai": "^4.2.8", + "chai": "^4.2.0", + "cross-env": "^7.0.2", + "@azure/dev-tool": "^1.0.0" }, "homepage": "https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/databricks/arm-databricks", "repository": { @@ -93,9 +97,8 @@ "unit-test:node": "cross-env TEST_MODE=playback npm run integration-test:node", "unit-test:browser": "echo skipped", "integration-test": "npm run integration-test:node && npm run integration-test:browser", - "integration-test:node": "mocha -r esm --require ts-node/register --timeout 1200000 --full-trace test/*.ts --reporter ../../../common/tools/mocha-multi-reporter.js", - "integration-test:browser": "echo skipped", - "docs": "echo skipped" + "integration-test:node": "dev-tool run test:node-ts-input -- --timeout 1200000 'test/*.ts'", + "integration-test:browser": "echo skipped" }, "sideEffects": false, "//metadata": { @@ -106,13 +109,5 @@ } ] }, - "autoPublish": true, - "//sampleConfiguration": { - "productName": "", - "productSlugs": [ - "azure" - ], - "disableDocsMs": true, - "apiRefLink": "https://docs.microsoft.com/javascript/api/@azure/arm-databricks?view=azure-node-preview" - } -} + "autoPublish": true +} \ No newline at end of file diff --git a/sdk/databricks/arm-databricks/review/arm-databricks.api.md b/sdk/databricks/arm-databricks/review/arm-databricks.api.md index fb066ad491ce..d091974ffb40 100644 --- a/sdk/databricks/arm-databricks/review/arm-databricks.api.md +++ b/sdk/databricks/arm-databricks/review/arm-databricks.api.md @@ -10,6 +10,103 @@ import { PagedAsyncIterableIterator } from '@azure/core-paging'; import { PollerLike } from '@azure/core-lro'; import { PollOperationState } from '@azure/core-lro'; +// @public +export interface AccessConnector extends TrackedResource { + identity?: IdentityData; + properties?: AccessConnectorProperties; +} + +// @public +export interface AccessConnectorListResult { + nextLink?: string; + value?: AccessConnector[]; +} + +// @public (undocumented) +export interface AccessConnectorProperties { + readonly provisioningState?: ProvisioningState; +} + +// @public +export interface AccessConnectors { + beginCreateOrUpdate(resourceGroupName: string, connectorName: string, parameters: AccessConnector, options?: AccessConnectorsCreateOrUpdateOptionalParams): Promise, AccessConnectorsCreateOrUpdateResponse>>; + beginCreateOrUpdateAndWait(resourceGroupName: string, connectorName: string, parameters: AccessConnector, options?: AccessConnectorsCreateOrUpdateOptionalParams): Promise; + beginDelete(resourceGroupName: string, connectorName: string, options?: AccessConnectorsDeleteOptionalParams): Promise, void>>; + beginDeleteAndWait(resourceGroupName: string, connectorName: string, options?: AccessConnectorsDeleteOptionalParams): Promise; + beginUpdate(resourceGroupName: string, connectorName: string, parameters: AccessConnectorUpdate, options?: AccessConnectorsUpdateOptionalParams): Promise, AccessConnectorsUpdateResponse>>; + beginUpdateAndWait(resourceGroupName: string, connectorName: string, parameters: AccessConnectorUpdate, options?: AccessConnectorsUpdateOptionalParams): Promise; + get(resourceGroupName: string, connectorName: string, options?: AccessConnectorsGetOptionalParams): Promise; + listByResourceGroup(resourceGroupName: string, options?: AccessConnectorsListByResourceGroupOptionalParams): PagedAsyncIterableIterator; + listBySubscription(options?: AccessConnectorsListBySubscriptionOptionalParams): PagedAsyncIterableIterator; +} + +// @public +export interface AccessConnectorsCreateOrUpdateOptionalParams extends coreClient.OperationOptions { + resumeFrom?: string; + updateIntervalInMs?: number; +} + +// @public +export type AccessConnectorsCreateOrUpdateResponse = AccessConnector; + +// @public +export interface AccessConnectorsDeleteOptionalParams extends coreClient.OperationOptions { + resumeFrom?: string; + updateIntervalInMs?: number; +} + +// @public +export interface AccessConnectorsGetOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type AccessConnectorsGetResponse = AccessConnector; + +// @public +export interface AccessConnectorsListByResourceGroupNextOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type AccessConnectorsListByResourceGroupNextResponse = AccessConnectorListResult; + +// @public +export interface AccessConnectorsListByResourceGroupOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type AccessConnectorsListByResourceGroupResponse = AccessConnectorListResult; + +// @public +export interface AccessConnectorsListBySubscriptionNextOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type AccessConnectorsListBySubscriptionNextResponse = AccessConnectorListResult; + +// @public +export interface AccessConnectorsListBySubscriptionOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type AccessConnectorsListBySubscriptionResponse = AccessConnectorListResult; + +// @public +export interface AccessConnectorsUpdateOptionalParams extends coreClient.OperationOptions { + resumeFrom?: string; + updateIntervalInMs?: number; +} + +// @public +export type AccessConnectorsUpdateResponse = AccessConnector; + +// @public +export interface AccessConnectorUpdate { + identity?: IdentityData; + tags?: { + [propertyName: string]: string; + }; +} + // @public export interface AddressSpace { addressPrefixes?: string[]; @@ -21,6 +118,8 @@ export class AzureDatabricksManagementClient extends coreClient.ServiceClient { $host: string; constructor(credentials: coreAuth.TokenCredential, subscriptionId: string, options?: AzureDatabricksManagementClientOptionalParams); // (undocumented) + accessConnectors: AccessConnectors; + // (undocumented) apiVersion: string; // (undocumented) operations: Operations; @@ -122,9 +221,9 @@ export interface ErrorResponse { } // @public -export type GroupIdInformation = Resource & { +export interface GroupIdInformation extends Resource { properties: GroupIdInformationProperties; -}; +} // @public export interface GroupIdInformationProperties { @@ -133,134 +232,108 @@ export interface GroupIdInformationProperties { requiredZoneNames?: string[]; } +// @public +export interface IdentityData { + readonly principalId?: string; + readonly tenantId?: string; + type: IdentityType; +} + +// @public +export type IdentityType = string; + // @public export type KeySource = string; // @public export enum KnownCreatedByType { - // (undocumented) Application = "Application", - // (undocumented) Key = "Key", - // (undocumented) ManagedIdentity = "ManagedIdentity", - // (undocumented) User = "User" } // @public export enum KnownCustomParameterType { - // (undocumented) Bool = "Bool", - // (undocumented) Object = "Object", - // (undocumented) String = "String" } // @public export enum KnownEncryptionKeySource { - // (undocumented) MicrosoftKeyvault = "Microsoft.Keyvault" } +// @public +export enum KnownIdentityType { + None = "None", + SystemAssigned = "SystemAssigned" +} + // @public export enum KnownKeySource { - // (undocumented) Default = "Default", - // (undocumented) MicrosoftKeyvault = "Microsoft.Keyvault" } // @public export enum KnownPeeringProvisioningState { - // (undocumented) Deleting = "Deleting", - // (undocumented) Failed = "Failed", - // (undocumented) Succeeded = "Succeeded", - // (undocumented) Updating = "Updating" } // @public export enum KnownPeeringState { - // (undocumented) Connected = "Connected", - // (undocumented) Disconnected = "Disconnected", - // (undocumented) Initiated = "Initiated" } // @public export enum KnownPrivateEndpointConnectionProvisioningState { - // (undocumented) Creating = "Creating", - // (undocumented) Deleting = "Deleting", - // (undocumented) Failed = "Failed", - // (undocumented) Succeeded = "Succeeded", - // (undocumented) Updating = "Updating" } // @public export enum KnownPrivateLinkServiceConnectionStatus { - // (undocumented) Approved = "Approved", - // (undocumented) Disconnected = "Disconnected", - // (undocumented) Pending = "Pending", - // (undocumented) Rejected = "Rejected" } // @public export enum KnownProvisioningState { - // (undocumented) Accepted = "Accepted", - // (undocumented) Canceled = "Canceled", - // (undocumented) Created = "Created", - // (undocumented) Creating = "Creating", - // (undocumented) Deleted = "Deleted", - // (undocumented) Deleting = "Deleting", - // (undocumented) Failed = "Failed", - // (undocumented) Ready = "Ready", - // (undocumented) Running = "Running", - // (undocumented) Succeeded = "Succeeded", - // (undocumented) Updating = "Updating" } // @public export enum KnownPublicNetworkAccess { - // (undocumented) Disabled = "Disabled", - // (undocumented) Enabled = "Enabled" } // @public export enum KnownRequiredNsgRules { - // (undocumented) AllRules = "AllRules", - // (undocumented) NoAzureDatabricksRules = "NoAzureDatabricksRules", - // (undocumented) NoAzureServiceRules = "NoAzureServiceRules" } @@ -484,12 +557,12 @@ export interface SystemData { } // @public -export type TrackedResource = Resource & { +export interface TrackedResource extends Resource { + location: string; tags?: { [propertyName: string]: string; }; - location: string; -}; +} // @public export interface VirtualNetworkPeering { @@ -571,25 +644,25 @@ export interface VNetPeeringListByWorkspaceOptionalParams extends coreClient.Ope export type VNetPeeringListByWorkspaceResponse = VirtualNetworkPeeringList; // @public -export type Workspace = TrackedResource & { - sku?: Sku; - readonly systemData?: SystemData; - managedResourceGroupId: string; - parameters?: WorkspaceCustomParameters; - readonly provisioningState?: ProvisioningState; - uiDefinitionUri?: string; +export interface Workspace extends TrackedResource { authorizations?: WorkspaceProviderAuthorization[]; createdBy?: CreatedBy; - updatedBy?: CreatedBy; readonly createdDateTime?: Date; - readonly workspaceId?: string; - readonly workspaceUrl?: string; - storageAccountIdentity?: ManagedIdentityConfiguration; encryption?: WorkspacePropertiesEncryption; + managedResourceGroupId: string; + parameters?: WorkspaceCustomParameters; readonly privateEndpointConnections?: PrivateEndpointConnection[]; + readonly provisioningState?: ProvisioningState; publicNetworkAccess?: PublicNetworkAccess; requiredNsgRules?: RequiredNsgRules; -}; + sku?: Sku; + storageAccountIdentity?: ManagedIdentityConfiguration; + readonly systemData?: SystemData; + uiDefinitionUri?: string; + updatedBy?: CreatedBy; + readonly workspaceId?: string; + readonly workspaceUrl?: string; +} // @public export interface WorkspaceCustomBooleanParameter { diff --git a/sdk/databricks/arm-databricks/src/azureDatabricksManagementClient.ts b/sdk/databricks/arm-databricks/src/azureDatabricksManagementClient.ts index 004d75d3b20a..9e2638eeba6d 100644 --- a/sdk/databricks/arm-databricks/src/azureDatabricksManagementClient.ts +++ b/sdk/databricks/arm-databricks/src/azureDatabricksManagementClient.ts @@ -8,6 +8,11 @@ import * as coreClient from "@azure/core-client"; import * as coreRestPipeline from "@azure/core-rest-pipeline"; +import { + PipelineRequest, + PipelineResponse, + SendRequest +} from "@azure/core-rest-pipeline"; import * as coreAuth from "@azure/core-auth"; import { WorkspacesImpl, @@ -15,7 +20,8 @@ import { PrivateLinkResourcesImpl, PrivateEndpointConnectionsImpl, OutboundNetworkDependenciesEndpointsImpl, - VNetPeeringImpl + VNetPeeringImpl, + AccessConnectorsImpl } from "./operations"; import { Workspaces, @@ -23,7 +29,8 @@ import { PrivateLinkResources, PrivateEndpointConnections, OutboundNetworkDependenciesEndpoints, - VNetPeering + VNetPeering, + AccessConnectors } from "./operationsInterfaces"; import { AzureDatabricksManagementClientOptionalParams } from "./models"; @@ -106,7 +113,7 @@ export class AzureDatabricksManagementClient extends coreClient.ServiceClient { // Assigning values to Constant parameters this.$host = options.$host || "https://management.azure.com"; - this.apiVersion = options.apiVersion || "2021-04-01-preview"; + this.apiVersion = options.apiVersion || "2022-04-01-preview"; this.workspaces = new WorkspacesImpl(this); this.operations = new OperationsImpl(this); this.privateLinkResources = new PrivateLinkResourcesImpl(this); @@ -115,6 +122,36 @@ export class AzureDatabricksManagementClient extends coreClient.ServiceClient { this ); this.vNetPeering = new VNetPeeringImpl(this); + this.accessConnectors = new AccessConnectorsImpl(this); + this.addCustomApiVersionPolicy(options.apiVersion); + } + + /** A function that adds a policy that sets the api-version (or equivalent) to reflect the library version. */ + private addCustomApiVersionPolicy(apiVersion?: string) { + if (!apiVersion) { + return; + } + const apiVersionPolicy = { + name: "CustomApiVersionPolicy", + async sendRequest( + request: PipelineRequest, + next: SendRequest + ): Promise { + const param = request.url.split("?"); + if (param.length > 1) { + const newParams = param[1].split("&").map((item) => { + if (item.indexOf("api-version") > -1) { + return "api-version=" + apiVersion; + } else { + return item; + } + }); + request.url = param[0] + "?" + newParams.join("&"); + } + return next(request); + } + }; + this.pipeline.addPolicy(apiVersionPolicy); } workspaces: Workspaces; @@ -123,4 +160,5 @@ export class AzureDatabricksManagementClient extends coreClient.ServiceClient { privateEndpointConnections: PrivateEndpointConnections; outboundNetworkDependenciesEndpoints: OutboundNetworkDependenciesEndpoints; vNetPeering: VNetPeering; + accessConnectors: AccessConnectors; } diff --git a/sdk/databricks/arm-databricks/src/models/index.ts b/sdk/databricks/arm-databricks/src/models/index.ts index 0278a129725c..aff086297464 100644 --- a/sdk/databricks/arm-databricks/src/models/index.ts +++ b/sdk/databricks/arm-databricks/src/models/index.ts @@ -468,22 +468,62 @@ export interface VirtualNetworkPeeringList { nextLink?: string; } +/** Identity for the resource. */ +export interface IdentityData { + /** + * The principal ID of resource identity. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly principalId?: string; + /** + * The tenant ID of resource. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly tenantId?: string; + /** The identity type. */ + type: IdentityType; +} + +export interface AccessConnectorProperties { + /** + * Provisioning status of the accessConnector. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly provisioningState?: ProvisioningState; +} + +/** An update to an azure databricks accessConnector. */ +export interface AccessConnectorUpdate { + /** Resource tags. */ + tags?: { [propertyName: string]: string }; + /** The identity of the resource. */ + identity?: IdentityData; +} + +/** List of azure databricks accessConnector. */ +export interface AccessConnectorListResult { + /** The array of azure databricks accessConnector. */ + value?: AccessConnector[]; + /** The URL to use for getting the next set of results. */ + nextLink?: string; +} + /** The resource model definition for a ARM tracked top level resource */ -export type TrackedResource = Resource & { +export interface TrackedResource extends Resource { /** Resource tags. */ tags?: { [propertyName: string]: string }; /** The geo-location where the resource lives */ location: string; -}; +} /** The group information for creating a private endpoint on a workspace */ -export type GroupIdInformation = Resource & { +export interface GroupIdInformation extends Resource { /** The group id properties. */ properties: GroupIdInformationProperties; -}; +} /** Information about workspace. */ -export type Workspace = TrackedResource & { +export interface Workspace extends TrackedResource { /** The SKU of the resource. */ sku?: Sku; /** @@ -536,12 +576,23 @@ export type Workspace = TrackedResource & { publicNetworkAccess?: PublicNetworkAccess; /** Gets or sets a value indicating whether data plane (clusters) to control plane communication happen over private endpoint. Supported values are 'AllRules' and 'NoAzureDatabricksRules'. 'NoAzureServiceRules' value is for internal use only. */ requiredNsgRules?: RequiredNsgRules; -}; +} + +/** Information about azure databricks accessConnector. */ +export interface AccessConnector extends TrackedResource { + /** Identity for the resource. */ + identity?: IdentityData; + /** Azure Databricks accessConnector properties */ + properties?: AccessConnectorProperties; +} /** Known values of {@link CustomParameterType} that the service accepts. */ export enum KnownCustomParameterType { + /** Bool */ Bool = "Bool", + /** Object */ Object = "Object", + /** String */ String = "String" } @@ -558,7 +609,9 @@ export type CustomParameterType = string; /** Known values of {@link KeySource} that the service accepts. */ export enum KnownKeySource { + /** Default */ Default = "Default", + /** MicrosoftKeyvault */ MicrosoftKeyvault = "Microsoft.Keyvault" } @@ -574,16 +627,27 @@ export type KeySource = string; /** Known values of {@link ProvisioningState} that the service accepts. */ export enum KnownProvisioningState { + /** Accepted */ Accepted = "Accepted", + /** Running */ Running = "Running", + /** Ready */ Ready = "Ready", + /** Creating */ Creating = "Creating", + /** Created */ Created = "Created", + /** Deleting */ Deleting = "Deleting", + /** Deleted */ Deleted = "Deleted", + /** Canceled */ Canceled = "Canceled", + /** Failed */ Failed = "Failed", + /** Succeeded */ Succeeded = "Succeeded", + /** Updating */ Updating = "Updating" } @@ -608,6 +672,7 @@ export type ProvisioningState = string; /** Known values of {@link EncryptionKeySource} that the service accepts. */ export enum KnownEncryptionKeySource { + /** MicrosoftKeyvault */ MicrosoftKeyvault = "Microsoft.Keyvault" } @@ -622,9 +687,13 @@ export type EncryptionKeySource = string; /** Known values of {@link PrivateLinkServiceConnectionStatus} that the service accepts. */ export enum KnownPrivateLinkServiceConnectionStatus { + /** Pending */ Pending = "Pending", + /** Approved */ Approved = "Approved", + /** Rejected */ Rejected = "Rejected", + /** Disconnected */ Disconnected = "Disconnected" } @@ -642,10 +711,15 @@ export type PrivateLinkServiceConnectionStatus = string; /** Known values of {@link PrivateEndpointConnectionProvisioningState} that the service accepts. */ export enum KnownPrivateEndpointConnectionProvisioningState { + /** Succeeded */ Succeeded = "Succeeded", + /** Creating */ Creating = "Creating", + /** Updating */ Updating = "Updating", + /** Deleting */ Deleting = "Deleting", + /** Failed */ Failed = "Failed" } @@ -664,7 +738,9 @@ export type PrivateEndpointConnectionProvisioningState = string; /** Known values of {@link PublicNetworkAccess} that the service accepts. */ export enum KnownPublicNetworkAccess { + /** Enabled */ Enabled = "Enabled", + /** Disabled */ Disabled = "Disabled" } @@ -680,8 +756,11 @@ export type PublicNetworkAccess = string; /** Known values of {@link RequiredNsgRules} that the service accepts. */ export enum KnownRequiredNsgRules { + /** AllRules */ AllRules = "AllRules", + /** NoAzureDatabricksRules */ NoAzureDatabricksRules = "NoAzureDatabricksRules", + /** NoAzureServiceRules */ NoAzureServiceRules = "NoAzureServiceRules" } @@ -698,9 +777,13 @@ export type RequiredNsgRules = string; /** Known values of {@link CreatedByType} that the service accepts. */ export enum KnownCreatedByType { + /** User */ User = "User", + /** Application */ Application = "Application", + /** ManagedIdentity */ ManagedIdentity = "ManagedIdentity", + /** Key */ Key = "Key" } @@ -718,8 +801,11 @@ export type CreatedByType = string; /** Known values of {@link PeeringState} that the service accepts. */ export enum KnownPeeringState { + /** Initiated */ Initiated = "Initiated", + /** Connected */ Connected = "Connected", + /** Disconnected */ Disconnected = "Disconnected" } @@ -736,9 +822,13 @@ export type PeeringState = string; /** Known values of {@link PeeringProvisioningState} that the service accepts. */ export enum KnownPeeringProvisioningState { + /** Succeeded */ Succeeded = "Succeeded", + /** Updating */ Updating = "Updating", + /** Deleting */ Deleting = "Deleting", + /** Failed */ Failed = "Failed" } @@ -754,6 +844,24 @@ export enum KnownPeeringProvisioningState { */ export type PeeringProvisioningState = string; +/** Known values of {@link IdentityType} that the service accepts. */ +export enum KnownIdentityType { + /** None */ + None = "None", + /** SystemAssigned */ + SystemAssigned = "SystemAssigned" +} + +/** + * Defines values for IdentityType. \ + * {@link KnownIdentityType} can be used interchangeably with IdentityType, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **None** \ + * **SystemAssigned** + */ +export type IdentityType = string; + /** Optional parameters. */ export interface WorkspacesGetOptionalParams extends coreClient.OperationOptions {} @@ -948,6 +1056,74 @@ export interface VNetPeeringListByWorkspaceNextOptionalParams /** Contains response data for the listByWorkspaceNext operation. */ export type VNetPeeringListByWorkspaceNextResponse = VirtualNetworkPeeringList; +/** Optional parameters. */ +export interface AccessConnectorsGetOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the get operation. */ +export type AccessConnectorsGetResponse = AccessConnector; + +/** Optional parameters. */ +export interface AccessConnectorsDeleteOptionalParams + extends coreClient.OperationOptions { + /** Delay to wait until next poll, in milliseconds. */ + updateIntervalInMs?: number; + /** A serialized poller which can be used to resume an existing paused Long-Running-Operation. */ + resumeFrom?: string; +} + +/** Optional parameters. */ +export interface AccessConnectorsCreateOrUpdateOptionalParams + extends coreClient.OperationOptions { + /** Delay to wait until next poll, in milliseconds. */ + updateIntervalInMs?: number; + /** A serialized poller which can be used to resume an existing paused Long-Running-Operation. */ + resumeFrom?: string; +} + +/** Contains response data for the createOrUpdate operation. */ +export type AccessConnectorsCreateOrUpdateResponse = AccessConnector; + +/** Optional parameters. */ +export interface AccessConnectorsUpdateOptionalParams + extends coreClient.OperationOptions { + /** Delay to wait until next poll, in milliseconds. */ + updateIntervalInMs?: number; + /** A serialized poller which can be used to resume an existing paused Long-Running-Operation. */ + resumeFrom?: string; +} + +/** Contains response data for the update operation. */ +export type AccessConnectorsUpdateResponse = AccessConnector; + +/** Optional parameters. */ +export interface AccessConnectorsListByResourceGroupOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the listByResourceGroup operation. */ +export type AccessConnectorsListByResourceGroupResponse = AccessConnectorListResult; + +/** Optional parameters. */ +export interface AccessConnectorsListBySubscriptionOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the listBySubscription operation. */ +export type AccessConnectorsListBySubscriptionResponse = AccessConnectorListResult; + +/** Optional parameters. */ +export interface AccessConnectorsListByResourceGroupNextOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the listByResourceGroupNext operation. */ +export type AccessConnectorsListByResourceGroupNextResponse = AccessConnectorListResult; + +/** Optional parameters. */ +export interface AccessConnectorsListBySubscriptionNextOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the listBySubscriptionNext operation. */ +export type AccessConnectorsListBySubscriptionNextResponse = AccessConnectorListResult; + /** Optional parameters. */ export interface AzureDatabricksManagementClientOptionalParams extends coreClient.ServiceClientOptions { diff --git a/sdk/databricks/arm-databricks/src/models/mappers.ts b/sdk/databricks/arm-databricks/src/models/mappers.ts index 186be95c018b..045e9a23ebae 100644 --- a/sdk/databricks/arm-databricks/src/models/mappers.ts +++ b/sdk/databricks/arm-databricks/src/models/mappers.ts @@ -1189,6 +1189,102 @@ export const VirtualNetworkPeeringList: coreClient.CompositeMapper = { } }; +export const IdentityData: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "IdentityData", + modelProperties: { + principalId: { + serializedName: "principalId", + readOnly: true, + type: { + name: "Uuid" + } + }, + tenantId: { + serializedName: "tenantId", + readOnly: true, + type: { + name: "Uuid" + } + }, + type: { + serializedName: "type", + required: true, + type: { + name: "String" + } + } + } + } +}; + +export const AccessConnectorProperties: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "AccessConnectorProperties", + modelProperties: { + provisioningState: { + serializedName: "provisioningState", + readOnly: true, + type: { + name: "String" + } + } + } + } +}; + +export const AccessConnectorUpdate: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "AccessConnectorUpdate", + modelProperties: { + tags: { + serializedName: "tags", + type: { + name: "Dictionary", + value: { type: { name: "String" } } + } + }, + identity: { + serializedName: "identity", + type: { + name: "Composite", + className: "IdentityData" + } + } + } + } +}; + +export const AccessConnectorListResult: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "AccessConnectorListResult", + modelProperties: { + value: { + serializedName: "value", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "AccessConnector" + } + } + } + }, + nextLink: { + serializedName: "nextLink", + type: { + name: "String" + } + } + } + } +}; + export const TrackedResource: coreClient.CompositeMapper = { type: { name: "Composite", @@ -1366,3 +1462,27 @@ export const Workspace: coreClient.CompositeMapper = { } } }; + +export const AccessConnector: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "AccessConnector", + modelProperties: { + ...TrackedResource.type.modelProperties, + identity: { + serializedName: "identity", + type: { + name: "Composite", + className: "IdentityData" + } + }, + properties: { + serializedName: "properties", + type: { + name: "Composite", + className: "AccessConnectorProperties" + } + } + } + } +}; diff --git a/sdk/databricks/arm-databricks/src/models/parameters.ts b/sdk/databricks/arm-databricks/src/models/parameters.ts index 9e56f666683b..1acbaea2ea81 100644 --- a/sdk/databricks/arm-databricks/src/models/parameters.ts +++ b/sdk/databricks/arm-databricks/src/models/parameters.ts @@ -15,7 +15,9 @@ import { Workspace as WorkspaceMapper, WorkspaceUpdate as WorkspaceUpdateMapper, PrivateEndpointConnection as PrivateEndpointConnectionMapper, - VirtualNetworkPeering as VirtualNetworkPeeringMapper + VirtualNetworkPeering as VirtualNetworkPeeringMapper, + AccessConnector as AccessConnectorMapper, + AccessConnectorUpdate as AccessConnectorUpdateMapper } from "../models/mappers"; export const accept: OperationParameter = { @@ -76,7 +78,7 @@ export const workspaceName: OperationURLParameter = { export const apiVersion: OperationQueryParameter = { parameterPath: "apiVersion", mapper: { - defaultValue: "2021-04-01-preview", + defaultValue: "2022-04-01-preview", isConstant: true, serializedName: "api-version", type: { @@ -172,3 +174,28 @@ export const virtualNetworkPeeringParameters: OperationParameter = { parameterPath: "virtualNetworkPeeringParameters", mapper: VirtualNetworkPeeringMapper }; + +export const connectorName: OperationURLParameter = { + parameterPath: "connectorName", + mapper: { + constraints: { + MaxLength: 64, + MinLength: 3 + }, + serializedName: "connectorName", + required: true, + type: { + name: "String" + } + } +}; + +export const parameters2: OperationParameter = { + parameterPath: "parameters", + mapper: AccessConnectorMapper +}; + +export const parameters3: OperationParameter = { + parameterPath: "parameters", + mapper: AccessConnectorUpdateMapper +}; diff --git a/sdk/databricks/arm-databricks/src/operations/accessConnectors.ts b/sdk/databricks/arm-databricks/src/operations/accessConnectors.ts new file mode 100644 index 000000000000..ed1f66680f5b --- /dev/null +++ b/sdk/databricks/arm-databricks/src/operations/accessConnectors.ts @@ -0,0 +1,680 @@ +/* + * 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 { PagedAsyncIterableIterator } from "@azure/core-paging"; +import { AccessConnectors } from "../operationsInterfaces"; +import * as coreClient from "@azure/core-client"; +import * as Mappers from "../models/mappers"; +import * as Parameters from "../models/parameters"; +import { AzureDatabricksManagementClient } from "../azureDatabricksManagementClient"; +import { PollerLike, PollOperationState, LroEngine } from "@azure/core-lro"; +import { LroImpl } from "../lroImpl"; +import { + AccessConnector, + AccessConnectorsListByResourceGroupNextOptionalParams, + AccessConnectorsListByResourceGroupOptionalParams, + AccessConnectorsListBySubscriptionNextOptionalParams, + AccessConnectorsListBySubscriptionOptionalParams, + AccessConnectorsGetOptionalParams, + AccessConnectorsGetResponse, + AccessConnectorsDeleteOptionalParams, + AccessConnectorsCreateOrUpdateOptionalParams, + AccessConnectorsCreateOrUpdateResponse, + AccessConnectorUpdate, + AccessConnectorsUpdateOptionalParams, + AccessConnectorsUpdateResponse, + AccessConnectorsListByResourceGroupResponse, + AccessConnectorsListBySubscriptionResponse, + AccessConnectorsListByResourceGroupNextResponse, + AccessConnectorsListBySubscriptionNextResponse +} from "../models"; + +/// +/** Class containing AccessConnectors operations. */ +export class AccessConnectorsImpl implements AccessConnectors { + private readonly client: AzureDatabricksManagementClient; + + /** + * Initialize a new instance of the class AccessConnectors class. + * @param client Reference to the service client + */ + constructor(client: AzureDatabricksManagementClient) { + this.client = client; + } + + /** + * Gets all the azure databricks accessConnectors within a resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param options The options parameters. + */ + public listByResourceGroup( + resourceGroupName: string, + options?: AccessConnectorsListByResourceGroupOptionalParams + ): PagedAsyncIterableIterator { + const iter = this.listByResourceGroupPagingAll(resourceGroupName, options); + return { + next() { + return iter.next(); + }, + [Symbol.asyncIterator]() { + return this; + }, + byPage: () => { + return this.listByResourceGroupPagingPage(resourceGroupName, options); + } + }; + } + + private async *listByResourceGroupPagingPage( + resourceGroupName: string, + options?: AccessConnectorsListByResourceGroupOptionalParams + ): AsyncIterableIterator { + let result = await this._listByResourceGroup(resourceGroupName, options); + yield result.value || []; + let continuationToken = result.nextLink; + while (continuationToken) { + result = await this._listByResourceGroupNext( + resourceGroupName, + continuationToken, + options + ); + continuationToken = result.nextLink; + yield result.value || []; + } + } + + private async *listByResourceGroupPagingAll( + resourceGroupName: string, + options?: AccessConnectorsListByResourceGroupOptionalParams + ): AsyncIterableIterator { + for await (const page of this.listByResourceGroupPagingPage( + resourceGroupName, + options + )) { + yield* page; + } + } + + /** + * Gets all the azure databricks accessConnectors within a subscription. + * @param options The options parameters. + */ + public listBySubscription( + options?: AccessConnectorsListBySubscriptionOptionalParams + ): PagedAsyncIterableIterator { + const iter = this.listBySubscriptionPagingAll(options); + return { + next() { + return iter.next(); + }, + [Symbol.asyncIterator]() { + return this; + }, + byPage: () => { + return this.listBySubscriptionPagingPage(options); + } + }; + } + + private async *listBySubscriptionPagingPage( + options?: AccessConnectorsListBySubscriptionOptionalParams + ): AsyncIterableIterator { + let result = await this._listBySubscription(options); + yield result.value || []; + let continuationToken = result.nextLink; + while (continuationToken) { + result = await this._listBySubscriptionNext(continuationToken, options); + continuationToken = result.nextLink; + yield result.value || []; + } + } + + private async *listBySubscriptionPagingAll( + options?: AccessConnectorsListBySubscriptionOptionalParams + ): AsyncIterableIterator { + for await (const page of this.listBySubscriptionPagingPage(options)) { + yield* page; + } + } + + /** + * Gets an azure databricks accessConnector. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param connectorName The name of the azure databricks accessConnector. + * @param options The options parameters. + */ + get( + resourceGroupName: string, + connectorName: string, + options?: AccessConnectorsGetOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, connectorName, options }, + getOperationSpec + ); + } + + /** + * Deletes the azure databricks accessConnector. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param connectorName The name of the azure databricks accessConnector. + * @param options The options parameters. + */ + async beginDelete( + resourceGroupName: string, + connectorName: string, + options?: AccessConnectorsDeleteOptionalParams + ): Promise, void>> { + const directSendOperation = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec + ): Promise => { + return this.client.sendOperationRequest(args, spec); + }; + const sendOperation = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec + ) => { + let currentRawResponse: + | coreClient.FullOperationResponse + | undefined = undefined; + const providedCallback = args.options?.onResponse; + const callback: coreClient.RawResponseCallback = ( + rawResponse: coreClient.FullOperationResponse, + flatResponse: unknown + ) => { + currentRawResponse = rawResponse; + providedCallback?.(rawResponse, flatResponse); + }; + const updatedArgs = { + ...args, + options: { + ...args.options, + onResponse: callback + } + }; + const flatResponse = await directSendOperation(updatedArgs, spec); + return { + flatResponse, + rawResponse: { + statusCode: currentRawResponse!.status, + body: currentRawResponse!.parsedBody, + headers: currentRawResponse!.headers.toJSON() + } + }; + }; + + const lro = new LroImpl( + sendOperation, + { resourceGroupName, connectorName, options }, + deleteOperationSpec + ); + const poller = new LroEngine(lro, { + resumeFrom: options?.resumeFrom, + intervalInMs: options?.updateIntervalInMs + }); + await poller.poll(); + return poller; + } + + /** + * Deletes the azure databricks accessConnector. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param connectorName The name of the azure databricks accessConnector. + * @param options The options parameters. + */ + async beginDeleteAndWait( + resourceGroupName: string, + connectorName: string, + options?: AccessConnectorsDeleteOptionalParams + ): Promise { + const poller = await this.beginDelete( + resourceGroupName, + connectorName, + options + ); + return poller.pollUntilDone(); + } + + /** + * Creates or updates azure databricks accessConnector. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param connectorName The name of the azure databricks accessConnector. + * @param parameters Parameters supplied to the create or update an azure databricks accessConnector. + * @param options The options parameters. + */ + async beginCreateOrUpdate( + resourceGroupName: string, + connectorName: string, + parameters: AccessConnector, + options?: AccessConnectorsCreateOrUpdateOptionalParams + ): Promise< + PollerLike< + PollOperationState, + AccessConnectorsCreateOrUpdateResponse + > + > { + const directSendOperation = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec + ): Promise => { + return this.client.sendOperationRequest(args, spec); + }; + const sendOperation = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec + ) => { + let currentRawResponse: + | coreClient.FullOperationResponse + | undefined = undefined; + const providedCallback = args.options?.onResponse; + const callback: coreClient.RawResponseCallback = ( + rawResponse: coreClient.FullOperationResponse, + flatResponse: unknown + ) => { + currentRawResponse = rawResponse; + providedCallback?.(rawResponse, flatResponse); + }; + const updatedArgs = { + ...args, + options: { + ...args.options, + onResponse: callback + } + }; + const flatResponse = await directSendOperation(updatedArgs, spec); + return { + flatResponse, + rawResponse: { + statusCode: currentRawResponse!.status, + body: currentRawResponse!.parsedBody, + headers: currentRawResponse!.headers.toJSON() + } + }; + }; + + const lro = new LroImpl( + sendOperation, + { resourceGroupName, connectorName, parameters, options }, + createOrUpdateOperationSpec + ); + const poller = new LroEngine(lro, { + resumeFrom: options?.resumeFrom, + intervalInMs: options?.updateIntervalInMs + }); + await poller.poll(); + return poller; + } + + /** + * Creates or updates azure databricks accessConnector. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param connectorName The name of the azure databricks accessConnector. + * @param parameters Parameters supplied to the create or update an azure databricks accessConnector. + * @param options The options parameters. + */ + async beginCreateOrUpdateAndWait( + resourceGroupName: string, + connectorName: string, + parameters: AccessConnector, + options?: AccessConnectorsCreateOrUpdateOptionalParams + ): Promise { + const poller = await this.beginCreateOrUpdate( + resourceGroupName, + connectorName, + parameters, + options + ); + return poller.pollUntilDone(); + } + + /** + * Updates an azure databricks accessConnector. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param connectorName The name of the azure databricks accessConnector. + * @param parameters The update to the azure databricks accessConnector. + * @param options The options parameters. + */ + async beginUpdate( + resourceGroupName: string, + connectorName: string, + parameters: AccessConnectorUpdate, + options?: AccessConnectorsUpdateOptionalParams + ): Promise< + PollerLike< + PollOperationState, + AccessConnectorsUpdateResponse + > + > { + const directSendOperation = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec + ): Promise => { + return this.client.sendOperationRequest(args, spec); + }; + const sendOperation = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec + ) => { + let currentRawResponse: + | coreClient.FullOperationResponse + | undefined = undefined; + const providedCallback = args.options?.onResponse; + const callback: coreClient.RawResponseCallback = ( + rawResponse: coreClient.FullOperationResponse, + flatResponse: unknown + ) => { + currentRawResponse = rawResponse; + providedCallback?.(rawResponse, flatResponse); + }; + const updatedArgs = { + ...args, + options: { + ...args.options, + onResponse: callback + } + }; + const flatResponse = await directSendOperation(updatedArgs, spec); + return { + flatResponse, + rawResponse: { + statusCode: currentRawResponse!.status, + body: currentRawResponse!.parsedBody, + headers: currentRawResponse!.headers.toJSON() + } + }; + }; + + const lro = new LroImpl( + sendOperation, + { resourceGroupName, connectorName, parameters, options }, + updateOperationSpec + ); + const poller = new LroEngine(lro, { + resumeFrom: options?.resumeFrom, + intervalInMs: options?.updateIntervalInMs + }); + await poller.poll(); + return poller; + } + + /** + * Updates an azure databricks accessConnector. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param connectorName The name of the azure databricks accessConnector. + * @param parameters The update to the azure databricks accessConnector. + * @param options The options parameters. + */ + async beginUpdateAndWait( + resourceGroupName: string, + connectorName: string, + parameters: AccessConnectorUpdate, + options?: AccessConnectorsUpdateOptionalParams + ): Promise { + const poller = await this.beginUpdate( + resourceGroupName, + connectorName, + parameters, + options + ); + return poller.pollUntilDone(); + } + + /** + * Gets all the azure databricks accessConnectors within a resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param options The options parameters. + */ + private _listByResourceGroup( + resourceGroupName: string, + options?: AccessConnectorsListByResourceGroupOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, options }, + listByResourceGroupOperationSpec + ); + } + + /** + * Gets all the azure databricks accessConnectors within a subscription. + * @param options The options parameters. + */ + private _listBySubscription( + options?: AccessConnectorsListBySubscriptionOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { options }, + listBySubscriptionOperationSpec + ); + } + + /** + * ListByResourceGroupNext + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param nextLink The nextLink from the previous successful call to the ListByResourceGroup method. + * @param options The options parameters. + */ + private _listByResourceGroupNext( + resourceGroupName: string, + nextLink: string, + options?: AccessConnectorsListByResourceGroupNextOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, nextLink, options }, + listByResourceGroupNextOperationSpec + ); + } + + /** + * ListBySubscriptionNext + * @param nextLink The nextLink from the previous successful call to the ListBySubscription method. + * @param options The options parameters. + */ + private _listBySubscriptionNext( + nextLink: string, + options?: AccessConnectorsListBySubscriptionNextOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { nextLink, options }, + listBySubscriptionNextOperationSpec + ); + } +} +// Operation Specifications +const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); + +const getOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Databricks/accessConnectors/{connectorName}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.AccessConnector + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.resourceGroupName, + Parameters.subscriptionId, + Parameters.connectorName + ], + headerParameters: [Parameters.accept], + serializer +}; +const deleteOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Databricks/accessConnectors/{connectorName}", + httpMethod: "DELETE", + responses: { + 200: {}, + 201: {}, + 202: {}, + 204: {}, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.resourceGroupName, + Parameters.subscriptionId, + Parameters.connectorName + ], + headerParameters: [Parameters.accept], + serializer +}; +const createOrUpdateOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Databricks/accessConnectors/{connectorName}", + httpMethod: "PUT", + responses: { + 200: { + bodyMapper: Mappers.AccessConnector + }, + 201: { + bodyMapper: Mappers.AccessConnector + }, + 202: { + bodyMapper: Mappers.AccessConnector + }, + 204: { + bodyMapper: Mappers.AccessConnector + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + requestBody: Parameters.parameters2, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.resourceGroupName, + Parameters.subscriptionId, + Parameters.connectorName + ], + headerParameters: [Parameters.accept, Parameters.contentType], + mediaType: "json", + serializer +}; +const updateOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Databricks/accessConnectors/{connectorName}", + httpMethod: "PATCH", + responses: { + 200: { + bodyMapper: Mappers.AccessConnector + }, + 201: { + bodyMapper: Mappers.AccessConnector + }, + 202: { + bodyMapper: Mappers.AccessConnector + }, + 204: { + bodyMapper: Mappers.AccessConnector + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + requestBody: Parameters.parameters3, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.resourceGroupName, + Parameters.subscriptionId, + Parameters.connectorName + ], + headerParameters: [Parameters.accept, Parameters.contentType], + mediaType: "json", + serializer +}; +const listByResourceGroupOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Databricks/accessConnectors", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.AccessConnectorListResult + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.resourceGroupName, + Parameters.subscriptionId + ], + headerParameters: [Parameters.accept], + serializer +}; +const listBySubscriptionOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/providers/Microsoft.Databricks/accessConnectors", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.AccessConnectorListResult + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [Parameters.$host, Parameters.subscriptionId], + headerParameters: [Parameters.accept], + serializer +}; +const listByResourceGroupNextOperationSpec: coreClient.OperationSpec = { + path: "{nextLink}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.AccessConnectorListResult + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.resourceGroupName, + Parameters.subscriptionId, + Parameters.nextLink + ], + headerParameters: [Parameters.accept], + serializer +}; +const listBySubscriptionNextOperationSpec: coreClient.OperationSpec = { + path: "{nextLink}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.AccessConnectorListResult + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.nextLink + ], + headerParameters: [Parameters.accept], + serializer +}; diff --git a/sdk/databricks/arm-databricks/src/operations/index.ts b/sdk/databricks/arm-databricks/src/operations/index.ts index db44b556610d..e39d4223a898 100644 --- a/sdk/databricks/arm-databricks/src/operations/index.ts +++ b/sdk/databricks/arm-databricks/src/operations/index.ts @@ -12,3 +12,4 @@ export * from "./privateLinkResources"; export * from "./privateEndpointConnections"; export * from "./outboundNetworkDependenciesEndpoints"; export * from "./vNetPeering"; +export * from "./accessConnectors"; diff --git a/sdk/databricks/arm-databricks/src/operations/outboundNetworkDependenciesEndpoints.ts b/sdk/databricks/arm-databricks/src/operations/outboundNetworkDependenciesEndpoints.ts index 3a67adec5252..faf8632b51a7 100644 --- a/sdk/databricks/arm-databricks/src/operations/outboundNetworkDependenciesEndpoints.ts +++ b/sdk/databricks/arm-databricks/src/operations/outboundNetworkDependenciesEndpoints.ts @@ -32,7 +32,7 @@ export class OutboundNetworkDependenciesEndpointsImpl /** * Gets the list of endpoints that VNET Injected Workspace calls Azure Databricks Control Plane. You * must configure outbound access with these endpoints. For more information, see - * https://docs.microsoft.com/azure/databricks/administration-guide/cloud-configurations/azure/udr + * https://docs.microsoft.com/en-us/azure/databricks/administration-guide/cloud-configurations/azure/udr * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The name of the workspace. * @param options The options parameters. diff --git a/sdk/databricks/arm-databricks/src/operationsInterfaces/accessConnectors.ts b/sdk/databricks/arm-databricks/src/operationsInterfaces/accessConnectors.ts new file mode 100644 index 000000000000..06c1f2ad8e3b --- /dev/null +++ b/sdk/databricks/arm-databricks/src/operationsInterfaces/accessConnectors.ts @@ -0,0 +1,139 @@ +/* + * 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 { PagedAsyncIterableIterator } from "@azure/core-paging"; +import { PollerLike, PollOperationState } from "@azure/core-lro"; +import { + AccessConnector, + AccessConnectorsListByResourceGroupOptionalParams, + AccessConnectorsListBySubscriptionOptionalParams, + AccessConnectorsGetOptionalParams, + AccessConnectorsGetResponse, + AccessConnectorsDeleteOptionalParams, + AccessConnectorsCreateOrUpdateOptionalParams, + AccessConnectorsCreateOrUpdateResponse, + AccessConnectorUpdate, + AccessConnectorsUpdateOptionalParams, + AccessConnectorsUpdateResponse +} from "../models"; + +/// +/** Interface representing a AccessConnectors. */ +export interface AccessConnectors { + /** + * Gets all the azure databricks accessConnectors within a resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param options The options parameters. + */ + listByResourceGroup( + resourceGroupName: string, + options?: AccessConnectorsListByResourceGroupOptionalParams + ): PagedAsyncIterableIterator; + /** + * Gets all the azure databricks accessConnectors within a subscription. + * @param options The options parameters. + */ + listBySubscription( + options?: AccessConnectorsListBySubscriptionOptionalParams + ): PagedAsyncIterableIterator; + /** + * Gets an azure databricks accessConnector. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param connectorName The name of the azure databricks accessConnector. + * @param options The options parameters. + */ + get( + resourceGroupName: string, + connectorName: string, + options?: AccessConnectorsGetOptionalParams + ): Promise; + /** + * Deletes the azure databricks accessConnector. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param connectorName The name of the azure databricks accessConnector. + * @param options The options parameters. + */ + beginDelete( + resourceGroupName: string, + connectorName: string, + options?: AccessConnectorsDeleteOptionalParams + ): Promise, void>>; + /** + * Deletes the azure databricks accessConnector. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param connectorName The name of the azure databricks accessConnector. + * @param options The options parameters. + */ + beginDeleteAndWait( + resourceGroupName: string, + connectorName: string, + options?: AccessConnectorsDeleteOptionalParams + ): Promise; + /** + * Creates or updates azure databricks accessConnector. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param connectorName The name of the azure databricks accessConnector. + * @param parameters Parameters supplied to the create or update an azure databricks accessConnector. + * @param options The options parameters. + */ + beginCreateOrUpdate( + resourceGroupName: string, + connectorName: string, + parameters: AccessConnector, + options?: AccessConnectorsCreateOrUpdateOptionalParams + ): Promise< + PollerLike< + PollOperationState, + AccessConnectorsCreateOrUpdateResponse + > + >; + /** + * Creates or updates azure databricks accessConnector. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param connectorName The name of the azure databricks accessConnector. + * @param parameters Parameters supplied to the create or update an azure databricks accessConnector. + * @param options The options parameters. + */ + beginCreateOrUpdateAndWait( + resourceGroupName: string, + connectorName: string, + parameters: AccessConnector, + options?: AccessConnectorsCreateOrUpdateOptionalParams + ): Promise; + /** + * Updates an azure databricks accessConnector. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param connectorName The name of the azure databricks accessConnector. + * @param parameters The update to the azure databricks accessConnector. + * @param options The options parameters. + */ + beginUpdate( + resourceGroupName: string, + connectorName: string, + parameters: AccessConnectorUpdate, + options?: AccessConnectorsUpdateOptionalParams + ): Promise< + PollerLike< + PollOperationState, + AccessConnectorsUpdateResponse + > + >; + /** + * Updates an azure databricks accessConnector. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param connectorName The name of the azure databricks accessConnector. + * @param parameters The update to the azure databricks accessConnector. + * @param options The options parameters. + */ + beginUpdateAndWait( + resourceGroupName: string, + connectorName: string, + parameters: AccessConnectorUpdate, + options?: AccessConnectorsUpdateOptionalParams + ): Promise; +} diff --git a/sdk/databricks/arm-databricks/src/operationsInterfaces/index.ts b/sdk/databricks/arm-databricks/src/operationsInterfaces/index.ts index db44b556610d..e39d4223a898 100644 --- a/sdk/databricks/arm-databricks/src/operationsInterfaces/index.ts +++ b/sdk/databricks/arm-databricks/src/operationsInterfaces/index.ts @@ -12,3 +12,4 @@ export * from "./privateLinkResources"; export * from "./privateEndpointConnections"; export * from "./outboundNetworkDependenciesEndpoints"; export * from "./vNetPeering"; +export * from "./accessConnectors"; diff --git a/sdk/databricks/arm-databricks/src/operationsInterfaces/outboundNetworkDependenciesEndpoints.ts b/sdk/databricks/arm-databricks/src/operationsInterfaces/outboundNetworkDependenciesEndpoints.ts index feb11cc09dd1..32959f9fb472 100644 --- a/sdk/databricks/arm-databricks/src/operationsInterfaces/outboundNetworkDependenciesEndpoints.ts +++ b/sdk/databricks/arm-databricks/src/operationsInterfaces/outboundNetworkDependenciesEndpoints.ts @@ -16,7 +16,7 @@ export interface OutboundNetworkDependenciesEndpoints { /** * Gets the list of endpoints that VNET Injected Workspace calls Azure Databricks Control Plane. You * must configure outbound access with these endpoints. For more information, see - * https://docs.microsoft.com/azure/databricks/administration-guide/cloud-configurations/azure/udr + * https://docs.microsoft.com/en-us/azure/databricks/administration-guide/cloud-configurations/azure/udr * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The name of the workspace. * @param options The options parameters. diff --git a/sdk/databricks/arm-databricks/test/sampleTest.ts b/sdk/databricks/arm-databricks/test/sampleTest.ts new file mode 100644 index 000000000000..25aeb3ebcc36 --- /dev/null +++ b/sdk/databricks/arm-databricks/test/sampleTest.ts @@ -0,0 +1,43 @@ +/* + * 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 { + Recorder, + RecorderStartOptions, + env +} from "@azure-tools/test-recorder"; +import { assert } from "chai"; +import { Context } from "mocha"; + +const replaceableVariables: Record = { + AZURE_CLIENT_ID: "azure_client_id", + AZURE_CLIENT_SECRET: "azure_client_secret", + AZURE_TENANT_ID: "88888888-8888-8888-8888-888888888888", + SUBSCRIPTION_ID: "azure_subscription_id" +}; + +const recorderOptions: RecorderStartOptions = { + envSetupForPlayback: replaceableVariables +}; + +describe("My test", () => { + let recorder: Recorder; + + beforeEach(async function(this: Context) { + recorder = new Recorder(this.currentTest); + await recorder.start(recorderOptions); + }); + + afterEach(async function() { + await recorder.stop(); + }); + + it("sample test", async function() { + console.log("Hi, I'm a test!"); + }); +}); diff --git a/sdk/databricks/arm-databricks/tsconfig.json b/sdk/databricks/arm-databricks/tsconfig.json index 5fd6e776dd67..3e6ae96443f3 100644 --- a/sdk/databricks/arm-databricks/tsconfig.json +++ b/sdk/databricks/arm-databricks/tsconfig.json @@ -15,17 +15,11 @@ ], "declaration": true, "outDir": "./dist-esm", - "importHelpers": true, - "paths": { - "@azure/arm-databricks": [ - "./src/index" - ] - } + "importHelpers": true }, "include": [ "./src/**/*.ts", - "./test/**/*.ts", - "samples-dev/**/*.ts" + "./test/**/*.ts" ], "exclude": [ "node_modules"