diff --git a/sdk/databricks/arm-databricks/CHANGELOG.md b/sdk/databricks/arm-databricks/CHANGELOG.md index f57b684cf455..b7c9085c6c33 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.5 (2022-12-06) -## 3.0.0-beta.5 (Unreleased) - -### Features Added - -### Breaking Changes - -### Bugs Fixed - -### Other Changes - -## 3.0.0-beta.4 (2022-11-21) - -The package of @azure/arm-databricks is using our next generation design principles since version 3.0.0-beta.4, which contains breaking changes. +The package of @azure/arm-databricks is using our next generation design principles since version 3.0.0-beta.5, 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 256965ff8e3c..e4fae70c92af 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.8.4 --typescript --modelerfour.lenient-model-deduplication --azure-arm --head-as-boolean=true --license-header=MICROSOFT_MIT_NO_VERSION --generate-test --typescript-sdks-folder=D:\\Git\\azure-sdk-for-js ..\\azure-rest-api-specs\\specification\\databricks\\resource-manager\\readme.md --use=@autorest/typescript@6.0.0-rc.3.20221108.1 --generate-sample=true", + "commit": "74abc2bdcf26359e02418b1fe391471627228e33", + "readme": "specification/databricks/resource-manager/readme.md", + "autorest_command": "autorest --version=3.9.3 --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.4", "repository_url": "https://github.com/Azure/azure-rest-api-specs.git", - "release_tool": "@azure-tools/js-sdk-release-tools@2.4.2", - "use": "@autorest/typescript@6.0.0-rc.3.20221108.1" + "release_tool": "@azure-tools/js-sdk-release-tools@2.5.2", + "use": "@autorest/typescript@6.0.0-rc.4" } \ No newline at end of file diff --git a/sdk/databricks/arm-databricks/package.json b/sdk/databricks/arm-databricks/package.json index 0216cfd2bde2..daa112e7188d 100644 --- a/sdk/databricks/arm-databricks/package.json +++ b/sdk/databricks/arm-databricks/package.json @@ -110,13 +110,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 82f28d800504..20d2951ef0a4 100644 --- a/sdk/databricks/arm-databricks/review/arm-databricks.api.md +++ b/sdk/databricks/arm-databricks/review/arm-databricks.api.md @@ -10,6 +10,104 @@ 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?: ManagedServiceIdentity; + properties?: AccessConnectorProperties; + readonly systemData?: SystemData; +} + +// @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?: ManagedServiceIdentity; + tags?: { + [propertyName: string]: string; + }; +} + // @public export interface AddressSpace { addressPrefixes?: string[]; @@ -21,7 +119,7 @@ export class AzureDatabricksManagementClient extends coreClient.ServiceClient { $host: string; constructor(credentials: coreAuth.TokenCredential, subscriptionId: string, options?: AzureDatabricksManagementClientOptionalParams); // (undocumented) - apiVersion: string; + accessConnectors: AccessConnectors; // (undocumented) operations: Operations; // (undocumented) @@ -41,7 +139,6 @@ export class AzureDatabricksManagementClient extends coreClient.ServiceClient { // @public export interface AzureDatabricksManagementClientOptionalParams extends coreClient.ServiceClientOptions { $host?: string; - apiVersion?: string; endpoint?: string; } @@ -68,6 +165,7 @@ export interface Encryption { // @public export interface EncryptionEntitiesDefinition { + managedDisk?: ManagedDiskEncryption; managedServices?: EncryptionV2; } @@ -165,6 +263,14 @@ export enum KnownKeySource { MicrosoftKeyvault = "Microsoft.Keyvault" } +// @public +export enum KnownManagedServiceIdentityType { + None = "None", + SystemAssigned = "SystemAssigned", + SystemAssignedUserAssigned = "SystemAssigned,UserAssigned", + UserAssigned = "UserAssigned" +} + // @public export enum KnownPeeringProvisioningState { Deleting = "Deleting", @@ -225,6 +331,20 @@ export enum KnownRequiredNsgRules { NoAzureServiceRules = "NoAzureServiceRules" } +// @public +export interface ManagedDiskEncryption { + keySource: EncryptionKeySource; + keyVaultProperties: ManagedDiskEncryptionKeyVaultProperties; + rotationToLatestKeyVersionEnabled?: boolean; +} + +// @public +export interface ManagedDiskEncryptionKeyVaultProperties { + keyName: string; + keyVaultUri: string; + keyVersion: string; +} + // @public export interface ManagedIdentityConfiguration { readonly principalId?: string; @@ -232,6 +352,19 @@ export interface ManagedIdentityConfiguration { readonly type?: string; } +// @public +export interface ManagedServiceIdentity { + readonly principalId?: string; + readonly tenantId?: string; + type: ManagedServiceIdentityType; + userAssignedIdentities?: { + [propertyName: string]: UserAssignedIdentity; + }; +} + +// @public +export type ManagedServiceIdentityType = string; + // @public export interface Operation { display?: OperationDisplay; @@ -452,6 +585,12 @@ export interface TrackedResource extends Resource { }; } +// @public +export interface UserAssignedIdentity { + readonly clientId?: string; + readonly principalId?: string; +} + // @public export interface VirtualNetworkPeering { allowForwardedTraffic?: boolean; @@ -536,7 +675,9 @@ export interface Workspace extends TrackedResource { authorizations?: WorkspaceProviderAuthorization[]; createdBy?: CreatedBy; readonly createdDateTime?: Date; + diskEncryptionSetId?: string; encryption?: WorkspacePropertiesEncryption; + managedDiskIdentity?: ManagedIdentityConfiguration; managedResourceGroupId: string; parameters?: WorkspaceCustomParameters; readonly privateEndpointConnections?: PrivateEndpointConnection[]; diff --git a/sdk/databricks/arm-databricks/src/azureDatabricksManagementClient.ts b/sdk/databricks/arm-databricks/src/azureDatabricksManagementClient.ts index b03fee4d4c20..107c61910de9 100644 --- a/sdk/databricks/arm-databricks/src/azureDatabricksManagementClient.ts +++ b/sdk/databricks/arm-databricks/src/azureDatabricksManagementClient.ts @@ -8,13 +8,9 @@ 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 { + AccessConnectorsImpl, WorkspacesImpl, OperationsImpl, PrivateLinkResourcesImpl, @@ -23,6 +19,7 @@ import { VNetPeeringImpl } from "./operations"; import { + AccessConnectors, Workspaces, Operations, PrivateLinkResources, @@ -34,7 +31,6 @@ import { AzureDatabricksManagementClientOptionalParams } from "./models"; export class AzureDatabricksManagementClient extends coreClient.ServiceClient { $host: string; - apiVersion: string; subscriptionId: string; /** @@ -117,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.accessConnectors = new AccessConnectorsImpl(this); this.workspaces = new WorkspacesImpl(this); this.operations = new OperationsImpl(this); this.privateLinkResources = new PrivateLinkResourcesImpl(this); @@ -126,37 +122,9 @@ export class AzureDatabricksManagementClient extends coreClient.ServiceClient { this ); this.vNetPeering = new VNetPeeringImpl(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); } + accessConnectors: AccessConnectors; workspaces: Workspaces; operations: Operations; privateLinkResources: PrivateLinkResources; diff --git a/sdk/databricks/arm-databricks/src/models/index.ts b/sdk/databricks/arm-databricks/src/models/index.ts index dfbada108ac3..8ac768e5a31f 100644 --- a/sdk/databricks/arm-databricks/src/models/index.ts +++ b/sdk/databricks/arm-databricks/src/models/index.ts @@ -8,6 +8,125 @@ import * as coreClient from "@azure/core-client"; +/** Managed service identity (system assigned and/or user assigned identities) */ +export interface ManagedServiceIdentity { + /** + * The service principal ID of the system assigned identity. This property will only be provided for a system assigned identity. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly principalId?: string; + /** + * The tenant ID of the system assigned identity. This property will only be provided for a system assigned identity. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly tenantId?: string; + /** Type of managed service identity (where both SystemAssigned and UserAssigned types are allowed). */ + type: ManagedServiceIdentityType; + /** The set of user assigned identities associated with the resource. The userAssignedIdentities dictionary keys will be ARM resource ids in the form: '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}. The dictionary values can be empty objects ({}) in requests. */ + userAssignedIdentities?: { [propertyName: string]: UserAssignedIdentity }; +} + +/** User assigned identity properties */ +export interface UserAssignedIdentity { + /** + * The principal ID of the assigned identity. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly principalId?: string; + /** + * The client ID of the assigned identity. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly clientId?: string; +} + +/** Metadata pertaining to creation and last modification of the resource. */ +export interface SystemData { + /** The identity that created the resource. */ + createdBy?: string; + /** The type of identity that created the resource. */ + createdByType?: CreatedByType; + /** The timestamp of resource creation (UTC). */ + createdAt?: Date; + /** The identity that last modified the resource. */ + lastModifiedBy?: string; + /** The type of identity that last modified the resource. */ + lastModifiedByType?: CreatedByType; + /** The timestamp of resource last modification (UTC) */ + lastModifiedAt?: Date; +} + +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; +} + +/** The core properties of ARM resources */ +export interface Resource { + /** + * 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. + */ + readonly id?: string; + /** + * The name of the resource + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly name?: string; + /** + * 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; +} + +/** Contains details when the response code indicates an error. */ +export interface ErrorResponse { + /** The error details. */ + error: ErrorInfo; +} + +/** The code and message for an error. */ +export interface ErrorInfo { + /** A machine readable error code. */ + code: string; + /** A human readable error message. */ + message: string; + /** error details. */ + details?: ErrorDetail[]; + /** Inner error details if they exist. */ + innererror?: string; +} + +/** Error details. */ +export interface ErrorDetail { + /** The error's code. */ + code: string; + /** A human readable error message. */ + message: string; + /** Indicates which property in the request is responsible for the error. */ + target?: string; +} + +/** An update to an azure databricks accessConnector. */ +export interface AccessConnectorUpdate { + /** Resource tags. */ + tags?: { [propertyName: string]: string }; + /** Managed service identity (system assigned and/or user assigned identities) */ + identity?: ManagedServiceIdentity; +} + +/** 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; +} + /** Custom Parameters used for Cluster Creation. */ export interface WorkspaceCustomParameters { /** The ID of a Azure Machine Learning workspace to link with Databricks workspace */ @@ -159,6 +278,8 @@ export interface WorkspacePropertiesEncryption { export interface EncryptionEntitiesDefinition { /** Encryption properties for the databricks managed services. */ managedServices?: EncryptionV2; + /** Encryption properties for the databricks managed disks. */ + managedDisk?: ManagedDiskEncryption; } /** The object that contains details of encryption used on the workspace. */ @@ -179,6 +300,26 @@ export interface EncryptionV2KeyVaultProperties { keyVersion: string; } +/** The object that contains details of encryption used on the workspace. */ +export interface ManagedDiskEncryption { + /** The encryption keySource (provider). Possible values (case-insensitive): Microsoft.Keyvault */ + keySource: EncryptionKeySource; + /** Key Vault input properties for encryption. */ + keyVaultProperties: ManagedDiskEncryptionKeyVaultProperties; + /** Indicate whether the latest key version should be automatically used for Managed Disk Encryption. */ + rotationToLatestKeyVersionEnabled?: boolean; +} + +/** Key Vault input properties for encryption. */ +export interface ManagedDiskEncryptionKeyVaultProperties { + /** The URI of KeyVault. */ + keyVaultUri: string; + /** The name of KeyVault key. */ + keyName: string; + /** The version of KeyVault key. */ + keyVersion: string; +} + /** The private endpoint connection of a workspace */ export interface PrivateEndpointConnection { /** @@ -240,69 +381,6 @@ export interface Sku { tier?: string; } -/** Metadata pertaining to creation and last modification of the resource. */ -export interface SystemData { - /** The identity that created the resource. */ - createdBy?: string; - /** The type of identity that created the resource. */ - createdByType?: CreatedByType; - /** The timestamp of resource creation (UTC). */ - createdAt?: Date; - /** The identity that last modified the resource. */ - lastModifiedBy?: string; - /** The type of identity that last modified the resource. */ - lastModifiedByType?: CreatedByType; - /** The timestamp of resource last modification (UTC) */ - lastModifiedAt?: Date; -} - -/** The core properties of ARM resources */ -export interface Resource { - /** - * 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. - */ - readonly id?: string; - /** - * The name of the resource - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly name?: string; - /** - * 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; -} - -/** Contains details when the response code indicates an error. */ -export interface ErrorResponse { - /** The error details. */ - error: ErrorInfo; -} - -/** The code and message for an error. */ -export interface ErrorInfo { - /** A machine readable error code. */ - code: string; - /** A human readable error message. */ - message: string; - /** error details. */ - details?: ErrorDetail[]; - /** Inner error details if they exist. */ - innererror?: string; -} - -/** Error details. */ -export interface ErrorDetail { - /** The error's code. */ - code: string; - /** A human readable error message. */ - message: string; - /** Indicates which property in the request is responsible for the error. */ - target?: string; -} - /** An update to a workspace. */ export interface WorkspaceUpdate { /** Resource tags. */ @@ -482,6 +560,19 @@ export interface GroupIdInformation extends Resource { properties: GroupIdInformationProperties; } +/** Information about azure databricks accessConnector. */ +export interface AccessConnector extends TrackedResource { + /** Managed service identity (system assigned and/or user assigned identities) */ + identity?: ManagedServiceIdentity; + /** + * The system metadata relating to this resource + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly systemData?: SystemData; + /** Azure Databricks accessConnector properties */ + properties?: AccessConnectorProperties; +} + /** Information about workspace. */ export interface Workspace extends TrackedResource { /** The SKU of the resource. */ @@ -525,6 +616,10 @@ export interface Workspace extends TrackedResource { readonly workspaceUrl?: string; /** The details of Managed Identity of Storage Account */ storageAccountIdentity?: ManagedIdentityConfiguration; + /** The details of Managed Identity of Disk Encryption Set used for Managed Disk Encryption */ + managedDiskIdentity?: ManagedIdentityConfiguration; + /** The resource Id of the managed disk encryption set. */ + diskEncryptionSetId?: string; /** Encryption properties for databricks workspace */ encryption?: WorkspacePropertiesEncryption; /** @@ -538,44 +633,53 @@ export interface Workspace extends TrackedResource { requiredNsgRules?: RequiredNsgRules; } -/** Known values of {@link CustomParameterType} that the service accepts. */ -export enum KnownCustomParameterType { - /** Bool */ - Bool = "Bool", - /** Object */ - Object = "Object", - /** String */ - String = "String" +/** Known values of {@link ManagedServiceIdentityType} that the service accepts. */ +export enum KnownManagedServiceIdentityType { + /** None */ + None = "None", + /** SystemAssigned */ + SystemAssigned = "SystemAssigned", + /** UserAssigned */ + UserAssigned = "UserAssigned", + /** SystemAssignedUserAssigned */ + SystemAssignedUserAssigned = "SystemAssigned,UserAssigned" } /** - * Defines values for CustomParameterType. \ - * {@link KnownCustomParameterType} can be used interchangeably with CustomParameterType, + * Defines values for ManagedServiceIdentityType. \ + * {@link KnownManagedServiceIdentityType} can be used interchangeably with ManagedServiceIdentityType, * this enum contains the known values that the service supports. * ### Known values supported by the service - * **Bool** \ - * **Object** \ - * **String** + * **None** \ + * **SystemAssigned** \ + * **UserAssigned** \ + * **SystemAssigned,UserAssigned** */ -export type CustomParameterType = string; +export type ManagedServiceIdentityType = string; -/** Known values of {@link KeySource} that the service accepts. */ -export enum KnownKeySource { - /** Default */ - Default = "Default", - /** MicrosoftKeyvault */ - MicrosoftKeyvault = "Microsoft.Keyvault" +/** Known values of {@link CreatedByType} that the service accepts. */ +export enum KnownCreatedByType { + /** User */ + User = "User", + /** Application */ + Application = "Application", + /** ManagedIdentity */ + ManagedIdentity = "ManagedIdentity", + /** Key */ + Key = "Key" } /** - * Defines values for KeySource. \ - * {@link KnownKeySource} can be used interchangeably with KeySource, + * Defines values for CreatedByType. \ + * {@link KnownCreatedByType} can be used interchangeably with CreatedByType, * this enum contains the known values that the service supports. * ### Known values supported by the service - * **Default** \ - * **Microsoft.Keyvault** + * **User** \ + * **Application** \ + * **ManagedIdentity** \ + * **Key** */ -export type KeySource = string; +export type CreatedByType = string; /** Known values of {@link ProvisioningState} that the service accepts. */ export enum KnownProvisioningState { @@ -622,6 +726,45 @@ export enum KnownProvisioningState { */ export type ProvisioningState = string; +/** Known values of {@link CustomParameterType} that the service accepts. */ +export enum KnownCustomParameterType { + /** Bool */ + Bool = "Bool", + /** Object */ + Object = "Object", + /** String */ + String = "String" +} + +/** + * Defines values for CustomParameterType. \ + * {@link KnownCustomParameterType} can be used interchangeably with CustomParameterType, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **Bool** \ + * **Object** \ + * **String** + */ +export type CustomParameterType = string; + +/** Known values of {@link KeySource} that the service accepts. */ +export enum KnownKeySource { + /** Default */ + Default = "Default", + /** MicrosoftKeyvault */ + MicrosoftKeyvault = "Microsoft.Keyvault" +} + +/** + * Defines values for KeySource. \ + * {@link KnownKeySource} can be used interchangeably with KeySource, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **Default** \ + * **Microsoft.Keyvault** + */ +export type KeySource = string; + /** Known values of {@link EncryptionKeySource} that the service accepts. */ export enum KnownEncryptionKeySource { /** MicrosoftKeyvault */ @@ -727,30 +870,6 @@ export enum KnownRequiredNsgRules { */ 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" -} - -/** - * Defines values for CreatedByType. \ - * {@link KnownCreatedByType} can be used interchangeably with CreatedByType, - * this enum contains the known values that the service supports. - * ### Known values supported by the service - * **User** \ - * **Application** \ - * **ManagedIdentity** \ - * **Key** - */ -export type CreatedByType = string; - /** Known values of {@link PeeringState} that the service accepts. */ export enum KnownPeeringState { /** Initiated */ @@ -796,6 +915,74 @@ export enum KnownPeeringProvisioningState { */ export type PeeringProvisioningState = string; +/** 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 WorkspacesGetOptionalParams extends coreClient.OperationOptions {} @@ -995,8 +1182,6 @@ export interface AzureDatabricksManagementClientOptionalParams extends coreClient.ServiceClientOptions { /** server parameter */ $host?: string; - /** Api Version */ - apiVersion?: string; /** Overrides client endpoint. */ endpoint?: string; } diff --git a/sdk/databricks/arm-databricks/src/models/mappers.ts b/sdk/databricks/arm-databricks/src/models/mappers.ts index 186be95c018b..106f43f5117b 100644 --- a/sdk/databricks/arm-databricks/src/models/mappers.ts +++ b/sdk/databricks/arm-databricks/src/models/mappers.ts @@ -8,6 +8,295 @@ import * as coreClient from "@azure/core-client"; +export const ManagedServiceIdentity: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "ManagedServiceIdentity", + 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" + } + }, + userAssignedIdentities: { + serializedName: "userAssignedIdentities", + type: { + name: "Dictionary", + value: { + type: { name: "Composite", className: "UserAssignedIdentity" } + } + } + } + } + } +}; + +export const UserAssignedIdentity: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "UserAssignedIdentity", + modelProperties: { + principalId: { + serializedName: "principalId", + readOnly: true, + type: { + name: "Uuid" + } + }, + clientId: { + serializedName: "clientId", + readOnly: true, + type: { + name: "Uuid" + } + } + } + } +}; + +export const SystemData: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "SystemData", + modelProperties: { + createdBy: { + serializedName: "createdBy", + type: { + name: "String" + } + }, + createdByType: { + serializedName: "createdByType", + type: { + name: "String" + } + }, + createdAt: { + serializedName: "createdAt", + type: { + name: "DateTime" + } + }, + lastModifiedBy: { + serializedName: "lastModifiedBy", + type: { + name: "String" + } + }, + lastModifiedByType: { + serializedName: "lastModifiedByType", + type: { + name: "String" + } + }, + lastModifiedAt: { + serializedName: "lastModifiedAt", + type: { + name: "DateTime" + } + } + } + } +}; + +export const AccessConnectorProperties: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "AccessConnectorProperties", + modelProperties: { + provisioningState: { + serializedName: "provisioningState", + readOnly: true, + type: { + name: "String" + } + } + } + } +}; + +export const Resource: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "Resource", + modelProperties: { + id: { + serializedName: "id", + readOnly: true, + type: { + name: "String" + } + }, + name: { + serializedName: "name", + readOnly: true, + type: { + name: "String" + } + }, + type: { + serializedName: "type", + readOnly: true, + type: { + name: "String" + } + } + } + } +}; + +export const ErrorResponse: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "ErrorResponse", + modelProperties: { + error: { + serializedName: "error", + type: { + name: "Composite", + className: "ErrorInfo" + } + } + } + } +}; + +export const ErrorInfo: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "ErrorInfo", + modelProperties: { + code: { + serializedName: "code", + required: true, + type: { + name: "String" + } + }, + message: { + serializedName: "message", + required: true, + type: { + name: "String" + } + }, + details: { + serializedName: "details", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "ErrorDetail" + } + } + } + }, + innererror: { + serializedName: "innererror", + type: { + name: "String" + } + } + } + } +}; + +export const ErrorDetail: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "ErrorDetail", + modelProperties: { + code: { + serializedName: "code", + required: true, + type: { + name: "String" + } + }, + message: { + serializedName: "message", + required: true, + type: { + name: "String" + } + }, + target: { + serializedName: "target", + 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: "ManagedServiceIdentity" + } + } + } + } +}; + +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 WorkspaceCustomParameters: coreClient.CompositeMapper = { type: { name: "Composite", @@ -366,6 +655,13 @@ export const EncryptionEntitiesDefinition: coreClient.CompositeMapper = { name: "Composite", className: "EncryptionV2" } + }, + managedDisk: { + serializedName: "managedDisk", + type: { + name: "Composite", + className: "ManagedDiskEncryption" + } } } } @@ -424,6 +720,65 @@ export const EncryptionV2KeyVaultProperties: coreClient.CompositeMapper = { } }; +export const ManagedDiskEncryption: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "ManagedDiskEncryption", + modelProperties: { + keySource: { + serializedName: "keySource", + required: true, + type: { + name: "String" + } + }, + keyVaultProperties: { + serializedName: "keyVaultProperties", + type: { + name: "Composite", + className: "ManagedDiskEncryptionKeyVaultProperties" + } + }, + rotationToLatestKeyVersionEnabled: { + serializedName: "rotationToLatestKeyVersionEnabled", + type: { + name: "Boolean" + } + } + } + } +}; + +export const ManagedDiskEncryptionKeyVaultProperties: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "ManagedDiskEncryptionKeyVaultProperties", + modelProperties: { + keyVaultUri: { + serializedName: "keyVaultUri", + required: true, + type: { + name: "String" + } + }, + keyName: { + serializedName: "keyName", + required: true, + type: { + name: "String" + } + }, + keyVersion: { + serializedName: "keyVersion", + required: true, + type: { + name: "String" + } + } + } + } +}; + export const PrivateEndpointConnection: coreClient.CompositeMapper = { type: { name: "Composite", @@ -557,167 +912,6 @@ export const Sku: coreClient.CompositeMapper = { } }; -export const SystemData: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "SystemData", - modelProperties: { - createdBy: { - serializedName: "createdBy", - type: { - name: "String" - } - }, - createdByType: { - serializedName: "createdByType", - type: { - name: "String" - } - }, - createdAt: { - serializedName: "createdAt", - type: { - name: "DateTime" - } - }, - lastModifiedBy: { - serializedName: "lastModifiedBy", - type: { - name: "String" - } - }, - lastModifiedByType: { - serializedName: "lastModifiedByType", - type: { - name: "String" - } - }, - lastModifiedAt: { - serializedName: "lastModifiedAt", - type: { - name: "DateTime" - } - } - } - } -}; - -export const Resource: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "Resource", - modelProperties: { - id: { - serializedName: "id", - readOnly: true, - type: { - name: "String" - } - }, - name: { - serializedName: "name", - readOnly: true, - type: { - name: "String" - } - }, - type: { - serializedName: "type", - readOnly: true, - type: { - name: "String" - } - } - } - } -}; - -export const ErrorResponse: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "ErrorResponse", - modelProperties: { - error: { - serializedName: "error", - type: { - name: "Composite", - className: "ErrorInfo" - } - } - } - } -}; - -export const ErrorInfo: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "ErrorInfo", - modelProperties: { - code: { - serializedName: "code", - required: true, - type: { - name: "String" - } - }, - message: { - serializedName: "message", - required: true, - type: { - name: "String" - } - }, - details: { - serializedName: "details", - type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "ErrorDetail" - } - } - } - }, - innererror: { - serializedName: "innererror", - type: { - name: "String" - } - } - } - } -}; - -export const ErrorDetail: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "ErrorDetail", - modelProperties: { - code: { - serializedName: "code", - required: true, - type: { - name: "String" - } - }, - message: { - serializedName: "message", - required: true, - type: { - name: "String" - } - }, - target: { - serializedName: "target", - type: { - name: "String" - } - } - } - } -}; - export const WorkspaceUpdate: coreClient.CompositeMapper = { type: { name: "Composite", @@ -1230,6 +1424,37 @@ export const GroupIdInformation: coreClient.CompositeMapper = { } }; +export const AccessConnector: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "AccessConnector", + modelProperties: { + ...TrackedResource.type.modelProperties, + identity: { + serializedName: "identity", + type: { + name: "Composite", + className: "ManagedServiceIdentity" + } + }, + systemData: { + serializedName: "systemData", + type: { + name: "Composite", + className: "SystemData" + } + }, + properties: { + serializedName: "properties", + type: { + name: "Composite", + className: "AccessConnectorProperties" + } + } + } + } +}; + export const Workspace: coreClient.CompositeMapper = { type: { name: "Composite", @@ -1331,6 +1556,19 @@ export const Workspace: coreClient.CompositeMapper = { className: "ManagedIdentityConfiguration" } }, + managedDiskIdentity: { + serializedName: "properties.managedDiskIdentity", + type: { + name: "Composite", + className: "ManagedIdentityConfiguration" + } + }, + diskEncryptionSetId: { + serializedName: "properties.diskEncryptionSetId", + type: { + name: "String" + } + }, encryption: { serializedName: "properties.encryption", type: { diff --git a/sdk/databricks/arm-databricks/src/models/parameters.ts b/sdk/databricks/arm-databricks/src/models/parameters.ts index 9e56f666683b..cac5d1c66af9 100644 --- a/sdk/databricks/arm-databricks/src/models/parameters.ts +++ b/sdk/databricks/arm-databricks/src/models/parameters.ts @@ -12,6 +12,8 @@ import { OperationQueryParameter } from "@azure/core-client"; import { + AccessConnector as AccessConnectorMapper, + AccessConnectorUpdate as AccessConnectorUpdateMapper, Workspace as WorkspaceMapper, WorkspaceUpdate as WorkspaceUpdateMapper, PrivateEndpointConnection as PrivateEndpointConnectionMapper, @@ -58,14 +60,14 @@ export const resourceGroupName: OperationURLParameter = { } }; -export const workspaceName: OperationURLParameter = { - parameterPath: "workspaceName", +export const connectorName: OperationURLParameter = { + parameterPath: "connectorName", mapper: { constraints: { MaxLength: 64, MinLength: 3 }, - serializedName: "workspaceName", + serializedName: "connectorName", required: true, type: { name: "String" @@ -76,7 +78,7 @@ export const workspaceName: OperationURLParameter = { export const apiVersion: OperationQueryParameter = { parameterPath: "apiVersion", mapper: { - defaultValue: "2021-04-01-preview", + defaultValue: "2022-10-01-preview", isConstant: true, serializedName: "api-version", type: { @@ -110,12 +112,12 @@ export const contentType: OperationParameter = { export const parameters: OperationParameter = { parameterPath: "parameters", - mapper: WorkspaceMapper + mapper: AccessConnectorMapper }; export const parameters1: OperationParameter = { parameterPath: "parameters", - mapper: WorkspaceUpdateMapper + mapper: AccessConnectorUpdateMapper }; export const nextLink: OperationURLParameter = { @@ -130,6 +132,43 @@ export const nextLink: OperationURLParameter = { skipEncoding: true }; +export const workspaceName: OperationURLParameter = { + parameterPath: "workspaceName", + mapper: { + constraints: { + MaxLength: 64, + MinLength: 3 + }, + serializedName: "workspaceName", + required: true, + type: { + name: "String" + } + } +}; + +export const apiVersion1: OperationQueryParameter = { + parameterPath: "apiVersion", + mapper: { + defaultValue: "2022-04-01-preview", + isConstant: true, + serializedName: "api-version", + type: { + name: "String" + } + } +}; + +export const parameters2: OperationParameter = { + parameterPath: "parameters", + mapper: WorkspaceMapper +}; + +export const parameters3: OperationParameter = { + parameterPath: "parameters", + mapper: WorkspaceUpdateMapper +}; + export const groupId: OperationURLParameter = { parameterPath: "groupId", mapper: { 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..36896357eaf2 --- /dev/null +++ b/sdk/databricks/arm-databricks/src/operations/accessConnectors.ts @@ -0,0 +1,707 @@ +/* + * 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, PageSettings } from "@azure/core-paging"; +import { setContinuationToken } from "../pagingHelper"; +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, + AccessConnectorsListByResourceGroupResponse, + AccessConnectorsListBySubscriptionNextOptionalParams, + AccessConnectorsListBySubscriptionOptionalParams, + AccessConnectorsListBySubscriptionResponse, + AccessConnectorsGetOptionalParams, + AccessConnectorsGetResponse, + AccessConnectorsDeleteOptionalParams, + AccessConnectorsCreateOrUpdateOptionalParams, + AccessConnectorsCreateOrUpdateResponse, + AccessConnectorUpdate, + AccessConnectorsUpdateOptionalParams, + AccessConnectorsUpdateResponse, + 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: (settings?: PageSettings) => { + if (settings?.maxPageSize) { + throw new Error("maxPageSize is not supported by this operation."); + } + return this.listByResourceGroupPagingPage( + resourceGroupName, + options, + settings + ); + } + }; + } + + private async *listByResourceGroupPagingPage( + resourceGroupName: string, + options?: AccessConnectorsListByResourceGroupOptionalParams, + settings?: PageSettings + ): AsyncIterableIterator { + let result: AccessConnectorsListByResourceGroupResponse; + let continuationToken = settings?.continuationToken; + if (!continuationToken) { + result = await this._listByResourceGroup(resourceGroupName, options); + let page = result.value || []; + continuationToken = result.nextLink; + setContinuationToken(page, continuationToken); + yield page; + } + while (continuationToken) { + result = await this._listByResourceGroupNext( + resourceGroupName, + continuationToken, + options + ); + continuationToken = result.nextLink; + let page = result.value || []; + setContinuationToken(page, continuationToken); + yield page; + } + } + + 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: (settings?: PageSettings) => { + if (settings?.maxPageSize) { + throw new Error("maxPageSize is not supported by this operation."); + } + return this.listBySubscriptionPagingPage(options, settings); + } + }; + } + + private async *listBySubscriptionPagingPage( + options?: AccessConnectorsListBySubscriptionOptionalParams, + settings?: PageSettings + ): AsyncIterableIterator { + let result: AccessConnectorsListBySubscriptionResponse; + let continuationToken = settings?.continuationToken; + if (!continuationToken) { + result = await this._listBySubscription(options); + let page = result.value || []; + continuationToken = result.nextLink; + setContinuationToken(page, continuationToken); + yield page; + } + while (continuationToken) { + result = await this._listBySubscriptionNext(continuationToken, options); + continuationToken = result.nextLink; + let page = result.value || []; + setContinuationToken(page, continuationToken); + yield page; + } + } + + 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.connectorName, + Parameters.subscriptionId + ], + 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.connectorName, + Parameters.subscriptionId + ], + 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.parameters, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.resourceGroupName, + Parameters.connectorName, + Parameters.subscriptionId + ], + 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.parameters1, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.resourceGroupName, + Parameters.connectorName, + Parameters.subscriptionId + ], + 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 + } + }, + 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 + } + }, + 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..39a584d9152f 100644 --- a/sdk/databricks/arm-databricks/src/operations/index.ts +++ b/sdk/databricks/arm-databricks/src/operations/index.ts @@ -6,6 +6,7 @@ * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ +export * from "./accessConnectors"; export * from "./workspaces"; export * from "./operations"; export * from "./privateLinkResources"; diff --git a/sdk/databricks/arm-databricks/src/operations/operations.ts b/sdk/databricks/arm-databricks/src/operations/operations.ts index 4b532aa886fc..14db24934786 100644 --- a/sdk/databricks/arm-databricks/src/operations/operations.ts +++ b/sdk/databricks/arm-databricks/src/operations/operations.ts @@ -127,7 +127,7 @@ const listOperationSpec: coreClient.OperationSpec = { bodyMapper: Mappers.ErrorResponse } }, - queryParameters: [Parameters.apiVersion], + queryParameters: [Parameters.apiVersion1], urlParameters: [Parameters.$host], headerParameters: [Parameters.accept], serializer @@ -143,7 +143,6 @@ const listNextOperationSpec: coreClient.OperationSpec = { bodyMapper: Mappers.ErrorResponse } }, - queryParameters: [Parameters.apiVersion], urlParameters: [Parameters.$host, Parameters.nextLink], headerParameters: [Parameters.accept], serializer diff --git a/sdk/databricks/arm-databricks/src/operations/outboundNetworkDependenciesEndpoints.ts b/sdk/databricks/arm-databricks/src/operations/outboundNetworkDependenciesEndpoints.ts index 3a67adec5252..52d4a8b0e333 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. @@ -73,12 +73,12 @@ const listOperationSpec: coreClient.OperationSpec = { bodyMapper: Mappers.ErrorResponse } }, - queryParameters: [Parameters.apiVersion], + queryParameters: [Parameters.apiVersion1], urlParameters: [ Parameters.$host, Parameters.resourceGroupName, - Parameters.workspaceName, - Parameters.subscriptionId + Parameters.subscriptionId, + Parameters.workspaceName ], headerParameters: [Parameters.accept], serializer diff --git a/sdk/databricks/arm-databricks/src/operations/privateEndpointConnections.ts b/sdk/databricks/arm-databricks/src/operations/privateEndpointConnections.ts index acf8e6096baf..c1232906c151 100644 --- a/sdk/databricks/arm-databricks/src/operations/privateEndpointConnections.ts +++ b/sdk/databricks/arm-databricks/src/operations/privateEndpointConnections.ts @@ -388,12 +388,12 @@ const listOperationSpec: coreClient.OperationSpec = { bodyMapper: Mappers.ErrorResponse } }, - queryParameters: [Parameters.apiVersion], + queryParameters: [Parameters.apiVersion1], urlParameters: [ Parameters.$host, Parameters.resourceGroupName, - Parameters.workspaceName, - Parameters.subscriptionId + Parameters.subscriptionId, + Parameters.workspaceName ], headerParameters: [Parameters.accept], serializer @@ -410,12 +410,12 @@ const getOperationSpec: coreClient.OperationSpec = { bodyMapper: Mappers.ErrorResponse } }, - queryParameters: [Parameters.apiVersion], + queryParameters: [Parameters.apiVersion1], urlParameters: [ Parameters.$host, Parameters.resourceGroupName, - Parameters.workspaceName, Parameters.subscriptionId, + Parameters.workspaceName, Parameters.privateEndpointConnectionName ], headerParameters: [Parameters.accept], @@ -443,12 +443,12 @@ const createOperationSpec: coreClient.OperationSpec = { } }, requestBody: Parameters.privateEndpointConnection, - queryParameters: [Parameters.apiVersion], + queryParameters: [Parameters.apiVersion1], urlParameters: [ Parameters.$host, Parameters.resourceGroupName, - Parameters.workspaceName, Parameters.subscriptionId, + Parameters.workspaceName, Parameters.privateEndpointConnectionName ], headerParameters: [Parameters.accept, Parameters.contentType], @@ -468,12 +468,12 @@ const deleteOperationSpec: coreClient.OperationSpec = { bodyMapper: Mappers.ErrorResponse } }, - queryParameters: [Parameters.apiVersion], + queryParameters: [Parameters.apiVersion1], urlParameters: [ Parameters.$host, Parameters.resourceGroupName, - Parameters.workspaceName, Parameters.subscriptionId, + Parameters.workspaceName, Parameters.privateEndpointConnectionName ], headerParameters: [Parameters.accept], @@ -490,13 +490,12 @@ const listNextOperationSpec: coreClient.OperationSpec = { bodyMapper: Mappers.ErrorResponse } }, - queryParameters: [Parameters.apiVersion], urlParameters: [ Parameters.$host, Parameters.resourceGroupName, - Parameters.workspaceName, Parameters.subscriptionId, - Parameters.nextLink + Parameters.nextLink, + Parameters.workspaceName ], headerParameters: [Parameters.accept], serializer diff --git a/sdk/databricks/arm-databricks/src/operations/privateLinkResources.ts b/sdk/databricks/arm-databricks/src/operations/privateLinkResources.ts index b501b71c536b..534e5945415f 100644 --- a/sdk/databricks/arm-databricks/src/operations/privateLinkResources.ts +++ b/sdk/databricks/arm-databricks/src/operations/privateLinkResources.ts @@ -182,12 +182,12 @@ const listOperationSpec: coreClient.OperationSpec = { bodyMapper: Mappers.ErrorResponse } }, - queryParameters: [Parameters.apiVersion], + queryParameters: [Parameters.apiVersion1], urlParameters: [ Parameters.$host, Parameters.resourceGroupName, - Parameters.workspaceName, - Parameters.subscriptionId + Parameters.subscriptionId, + Parameters.workspaceName ], headerParameters: [Parameters.accept], serializer @@ -204,12 +204,12 @@ const getOperationSpec: coreClient.OperationSpec = { bodyMapper: Mappers.ErrorResponse } }, - queryParameters: [Parameters.apiVersion], + queryParameters: [Parameters.apiVersion1], urlParameters: [ Parameters.$host, Parameters.resourceGroupName, - Parameters.workspaceName, Parameters.subscriptionId, + Parameters.workspaceName, Parameters.groupId ], headerParameters: [Parameters.accept], @@ -226,13 +226,12 @@ const listNextOperationSpec: coreClient.OperationSpec = { bodyMapper: Mappers.ErrorResponse } }, - queryParameters: [Parameters.apiVersion], urlParameters: [ Parameters.$host, Parameters.resourceGroupName, - Parameters.workspaceName, Parameters.subscriptionId, - Parameters.nextLink + Parameters.nextLink, + Parameters.workspaceName ], headerParameters: [Parameters.accept], serializer diff --git a/sdk/databricks/arm-databricks/src/operations/vNetPeering.ts b/sdk/databricks/arm-databricks/src/operations/vNetPeering.ts index 49f3a12545b5..ea97d218c8c8 100644 --- a/sdk/databricks/arm-databricks/src/operations/vNetPeering.ts +++ b/sdk/databricks/arm-databricks/src/operations/vNetPeering.ts @@ -386,12 +386,12 @@ const getOperationSpec: coreClient.OperationSpec = { bodyMapper: Mappers.ErrorResponse } }, - queryParameters: [Parameters.apiVersion], + queryParameters: [Parameters.apiVersion1], urlParameters: [ Parameters.$host, Parameters.resourceGroupName, - Parameters.workspaceName, Parameters.subscriptionId, + Parameters.workspaceName, Parameters.peeringName ], headerParameters: [Parameters.accept], @@ -410,12 +410,12 @@ const deleteOperationSpec: coreClient.OperationSpec = { bodyMapper: Mappers.ErrorResponse } }, - queryParameters: [Parameters.apiVersion], + queryParameters: [Parameters.apiVersion1], urlParameters: [ Parameters.$host, Parameters.resourceGroupName, - Parameters.workspaceName, Parameters.subscriptionId, + Parameters.workspaceName, Parameters.peeringName ], headerParameters: [Parameters.accept], @@ -443,12 +443,12 @@ const createOrUpdateOperationSpec: coreClient.OperationSpec = { } }, requestBody: Parameters.virtualNetworkPeeringParameters, - queryParameters: [Parameters.apiVersion], + queryParameters: [Parameters.apiVersion1], urlParameters: [ Parameters.$host, Parameters.resourceGroupName, - Parameters.workspaceName, Parameters.subscriptionId, + Parameters.workspaceName, Parameters.peeringName ], headerParameters: [Parameters.accept, Parameters.contentType], @@ -467,12 +467,12 @@ const listByWorkspaceOperationSpec: coreClient.OperationSpec = { bodyMapper: Mappers.ErrorResponse } }, - queryParameters: [Parameters.apiVersion], + queryParameters: [Parameters.apiVersion1], urlParameters: [ Parameters.$host, Parameters.resourceGroupName, - Parameters.workspaceName, - Parameters.subscriptionId + Parameters.subscriptionId, + Parameters.workspaceName ], headerParameters: [Parameters.accept], serializer @@ -488,13 +488,12 @@ const listByWorkspaceNextOperationSpec: coreClient.OperationSpec = { bodyMapper: Mappers.ErrorResponse } }, - queryParameters: [Parameters.apiVersion], urlParameters: [ Parameters.$host, Parameters.resourceGroupName, - Parameters.workspaceName, Parameters.subscriptionId, - Parameters.nextLink + Parameters.nextLink, + Parameters.workspaceName ], headerParameters: [Parameters.accept], serializer diff --git a/sdk/databricks/arm-databricks/src/operations/workspaces.ts b/sdk/databricks/arm-databricks/src/operations/workspaces.ts index 72083d1577f4..eacf6e571101 100644 --- a/sdk/databricks/arm-databricks/src/operations/workspaces.ts +++ b/sdk/databricks/arm-databricks/src/operations/workspaces.ts @@ -529,12 +529,12 @@ const getOperationSpec: coreClient.OperationSpec = { bodyMapper: Mappers.ErrorResponse } }, - queryParameters: [Parameters.apiVersion], + queryParameters: [Parameters.apiVersion1], urlParameters: [ Parameters.$host, Parameters.resourceGroupName, - Parameters.workspaceName, - Parameters.subscriptionId + Parameters.subscriptionId, + Parameters.workspaceName ], headerParameters: [Parameters.accept], serializer @@ -552,12 +552,12 @@ const deleteOperationSpec: coreClient.OperationSpec = { bodyMapper: Mappers.ErrorResponse } }, - queryParameters: [Parameters.apiVersion], + queryParameters: [Parameters.apiVersion1], urlParameters: [ Parameters.$host, Parameters.resourceGroupName, - Parameters.workspaceName, - Parameters.subscriptionId + Parameters.subscriptionId, + Parameters.workspaceName ], headerParameters: [Parameters.accept], serializer @@ -583,13 +583,13 @@ const createOrUpdateOperationSpec: coreClient.OperationSpec = { bodyMapper: Mappers.ErrorResponse } }, - requestBody: Parameters.parameters, - queryParameters: [Parameters.apiVersion], + requestBody: Parameters.parameters2, + queryParameters: [Parameters.apiVersion1], urlParameters: [ Parameters.$host, Parameters.resourceGroupName, - Parameters.workspaceName, - Parameters.subscriptionId + Parameters.subscriptionId, + Parameters.workspaceName ], headerParameters: [Parameters.accept, Parameters.contentType], mediaType: "json", @@ -616,13 +616,13 @@ const updateOperationSpec: coreClient.OperationSpec = { bodyMapper: Mappers.ErrorResponse } }, - requestBody: Parameters.parameters1, - queryParameters: [Parameters.apiVersion], + requestBody: Parameters.parameters3, + queryParameters: [Parameters.apiVersion1], urlParameters: [ Parameters.$host, Parameters.resourceGroupName, - Parameters.workspaceName, - Parameters.subscriptionId + Parameters.subscriptionId, + Parameters.workspaceName ], headerParameters: [Parameters.accept, Parameters.contentType], mediaType: "json", @@ -640,7 +640,7 @@ const listByResourceGroupOperationSpec: coreClient.OperationSpec = { bodyMapper: Mappers.ErrorResponse } }, - queryParameters: [Parameters.apiVersion], + queryParameters: [Parameters.apiVersion1], urlParameters: [ Parameters.$host, Parameters.resourceGroupName, @@ -661,7 +661,7 @@ const listBySubscriptionOperationSpec: coreClient.OperationSpec = { bodyMapper: Mappers.ErrorResponse } }, - queryParameters: [Parameters.apiVersion], + queryParameters: [Parameters.apiVersion1], urlParameters: [Parameters.$host, Parameters.subscriptionId], headerParameters: [Parameters.accept], serializer @@ -677,7 +677,6 @@ const listByResourceGroupNextOperationSpec: coreClient.OperationSpec = { bodyMapper: Mappers.ErrorResponse } }, - queryParameters: [Parameters.apiVersion], urlParameters: [ Parameters.$host, Parameters.resourceGroupName, @@ -698,7 +697,6 @@ const listBySubscriptionNextOperationSpec: coreClient.OperationSpec = { bodyMapper: Mappers.ErrorResponse } }, - queryParameters: [Parameters.apiVersion], urlParameters: [ Parameters.$host, Parameters.subscriptionId, 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..39a584d9152f 100644 --- a/sdk/databricks/arm-databricks/src/operationsInterfaces/index.ts +++ b/sdk/databricks/arm-databricks/src/operationsInterfaces/index.ts @@ -6,6 +6,7 @@ * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ +export * from "./accessConnectors"; export * from "./workspaces"; export * from "./operations"; export * from "./privateLinkResources"; 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/src/pagingHelper.ts b/sdk/databricks/arm-databricks/src/pagingHelper.ts index d85fc13bce1e..269a2b9814b5 100644 --- a/sdk/databricks/arm-databricks/src/pagingHelper.ts +++ b/sdk/databricks/arm-databricks/src/pagingHelper.ts @@ -13,11 +13,11 @@ export interface PageInfo { const pageMap = new WeakMap(); /** - * Given a result page from a pageable operation, returns a - * continuation token that can be used to begin paging from + * Given the last `.value` produced by the `byPage` iterator, + * returns a continuation token that can be used to begin paging from * that point later. - * @param page A result object from calling .byPage() on a paged operation. - * @returns The continuation token that can be passed into byPage(). + * @param page An object from accessing `value` on the IteratorResult from a `byPage` iterator. + * @returns The continuation token that can be passed into byPage() during future calls. */ export function getContinuationToken(page: unknown): string | undefined { if (typeof page !== "object" || page === null) { 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"