diff --git a/common/config/rush/pnpm-lock.yaml b/common/config/rush/pnpm-lock.yaml index fc08b3d3a565..642dcce214a8 100644 --- a/common/config/rush/pnpm-lock.yaml +++ b/common/config/rush/pnpm-lock.yaml @@ -10256,28 +10256,27 @@ packages: dev: false file:projects/arm-databox.tgz: - resolution: {integrity: sha512-KYAF7nM4Jg3NRQFKe8+g4qIT3ai7ltTLdgY/K8jPVQXJcLuRKM3jRnxR8e8dJywVA0MraKWiKkUtggF8jNUoZA==, tarball: file:projects/arm-databox.tgz} + resolution: {integrity: sha512-xt/1SjsT2CIDzxfmcmO2WnbgXH70/zG3iqB/aN9r31uhW75GEeC4B7x7U/h79V8lZ1BTBs/UnoAOQgn52GCfgA==, tarball: file:projects/arm-databox.tgz} name: '@rush-temp/arm-databox' version: 0.0.0 dependencies: '@azure-tools/test-recorder': 1.0.2 '@azure/identity': 2.0.4 - '@microsoft/api-extractor': 7.18.11 - '@rollup/plugin-commonjs': 21.0.3_rollup@2.70.1 - '@rollup/plugin-json': 4.1.0_rollup@2.70.1 - '@rollup/plugin-multi-entry': 4.1.0_rollup@2.70.1 - '@rollup/plugin-node-resolve': 13.2.0_rollup@2.70.1 + '@microsoft/api-extractor': 7.22.1 + '@rollup/plugin-commonjs': 11.0.2_rollup@1.32.1 + '@rollup/plugin-json': 4.1.0_rollup@1.32.1 + '@rollup/plugin-multi-entry': 3.0.1_rollup@1.32.1 + '@rollup/plugin-node-resolve': 8.4.0_rollup@1.32.1 cross-env: 7.0.3 mkdirp: 1.0.4 mocha: 7.2.0 rimraf: 3.0.2 - rollup: 2.70.1 - rollup-plugin-sourcemaps: 0.6.3_rollup@2.70.1 + rollup: 1.32.1 + rollup-plugin-sourcemaps: 0.4.2_rollup@1.32.1 tslib: 2.3.1 typescript: 4.2.4 uglify-js: 3.15.4 transitivePeerDependencies: - - '@types/node' - debug - encoding - supports-color diff --git a/sdk/databox/arm-databox/CHANGELOG.md b/sdk/databox/arm-databox/CHANGELOG.md index 86bd3fbd23a3..7040d09d7033 100644 --- a/sdk/databox/arm-databox/CHANGELOG.md +++ b/sdk/databox/arm-databox/CHANGELOG.md @@ -1,18 +1,8 @@ # Release History + +## 5.0.0 (2022-04-26) -## 5.0.0-beta.3 (Unreleased) - -### Features Added - -### Breaking Changes - -### Bugs Fixed - -### Other Changes - -## 5.0.0-beta.2 (2022-04-15) - -The package of @azure/arm-databox is using our next generation design principles since version 5.0.0-beta.2, which contains breaking changes. +The package of @azure/arm-databox is using our next generation design principles since version 5.0.0, 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/databox/arm-databox/README.md b/sdk/databox/arm-databox/README.md index bae43e628c5f..4768faefb440 100644 --- a/sdk/databox/arm-databox/README.md +++ b/sdk/databox/arm-databox/README.md @@ -6,7 +6,7 @@ This package contains an isomorphic SDK (runs both in Node.js and in browsers) f [Source code](https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/databox/arm-databox) | [Package (NPM)](https://www.npmjs.com/package/@azure/arm-databox) | -[API reference documentation](https://docs.microsoft.com/javascript/api/@azure/arm-databox?view=azure-node-preview) | +[API reference documentation](https://docs.microsoft.com/javascript/api/@azure/arm-databox) | [Samples](https://github.com/Azure-Samples/azure-samples-js-management) ## Getting started @@ -16,8 +16,6 @@ This package contains an isomorphic SDK (runs both in Node.js and in browsers) f - [LTS versions of Node.js](https://nodejs.org/about/releases/) - Latest versions of Safari, Chrome, Edge and Firefox. -See our [support policy](https://github.com/Azure/azure-sdk-for-js/blob/main/SUPPORT.md) for more details. - ### Prerequisites - An [Azure subscription][azure_sub]. @@ -51,17 +49,8 @@ For more information about how to create an Azure AD Application check out [this ```javascript const { DataBoxManagementClient } = require("@azure/arm-databox"); const { DefaultAzureCredential } = require("@azure/identity"); -// For client-side applications running in the browser, use InteractiveBrowserCredential instead of DefaultAzureCredential. See https://aka.ms/azsdk/js/identity/examples for more details. - const subscriptionId = "00000000-0000-0000-0000-000000000000"; const client = new DataBoxManagementClient(new DefaultAzureCredential(), subscriptionId); - -// For client-side applications running in the browser, use this code instead: -// const credential = new InteractiveBrowserCredential({ -// tenantId: "", -// clientId: "" -// }); -// const client = new DataBoxManagementClient(credential, subscriptionId); ``` diff --git a/sdk/databox/arm-databox/_meta.json b/sdk/databox/arm-databox/_meta.json index a796f10dd9fc..75d787663d74 100644 --- a/sdk/databox/arm-databox/_meta.json +++ b/sdk/databox/arm-databox/_meta.json @@ -1,8 +1,8 @@ { - "commit": "e6a2296d02ec6c4b2c32479198bfbcb9b16ea247", - "readme": "specification\\databox\\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\\databox\\resource-manager\\readme.md --use=@autorest/typescript@6.0.0-alpha.19.20220408.1 --generate-sample=true", + "commit": "5543826cdd190aaf306c435b64710512b8261506", + "readme": "specification/databox/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=/mnt/vss/_work/1/s/azure-sdk-for-js ../azure-rest-api-specs/specification/databox/resource-manager/readme.md --use=@autorest/typescript@6.0.0-alpha.16.20220105.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.3.0", + "use": "@autorest/typescript@6.0.0-alpha.16.20220105.1" } \ No newline at end of file diff --git a/sdk/databox/arm-databox/package.json b/sdk/databox/arm-databox/package.json index a070b259d0ce..4620b7c2a442 100644 --- a/sdk/databox/arm-databox/package.json +++ b/sdk/databox/arm-databox/package.json @@ -3,7 +3,7 @@ "sdk-type": "mgmt", "author": "Microsoft Corporation", "description": "A generated SDK for DataBoxManagementClient.", - "version": "5.0.0-beta.3", + "version": "5.0.0", "engines": { "node": ">=12.0.0" }, @@ -11,9 +11,9 @@ "@azure/core-lro": "^2.2.0", "@azure/abort-controller": "^1.0.0", "@azure/core-paging": "^1.2.0", - "@azure/core-client": "^1.5.0", + "@azure/core-client": "^1.0.0", "@azure/core-auth": "^1.3.0", - "@azure/core-rest-pipeline": "^1.8.0", + "@azure/core-rest-pipeline": "^1.1.0", "tslib": "^2.2.0" }, "keywords": [ @@ -28,14 +28,14 @@ "module": "./dist-esm/src/index.js", "types": "./types/arm-databox.d.ts", "devDependencies": { - "@microsoft/api-extractor": "7.18.11", - "@rollup/plugin-commonjs": "^21.0.1", - "@rollup/plugin-json": "^4.1.0", - "@rollup/plugin-multi-entry": "^4.1.0", - "@rollup/plugin-node-resolve": "^13.1.3", + "@microsoft/api-extractor": "^7.18.11", + "@rollup/plugin-commonjs": "11.0.2", + "@rollup/plugin-json": "^4.0.0", + "@rollup/plugin-multi-entry": "^3.0.0", + "@rollup/plugin-node-resolve": "^8.0.0", "mkdirp": "^1.0.4", - "rollup": "^2.66.1", - "rollup-plugin-sourcemaps": "^0.6.3", + "rollup": "^1.16.3", + "rollup-plugin-sourcemaps": "^0.4.2", "typescript": "~4.2.0", "uglify-js": "^3.4.9", "rimraf": "^3.0.0", @@ -98,21 +98,5 @@ "docs": "echo skipped" }, "sideEffects": false, - "//metadata": { - "constantPaths": [ - { - "path": "src/dataBoxManagementClient.ts", - "prefix": "packageDetails" - } - ] - }, - "autoPublish": true, - "//sampleConfiguration": { - "productName": "", - "productSlugs": [ - "azure" - ], - "disableDocsMs": true, - "apiRefLink": "https://docs.microsoft.com/javascript/api/@azure/arm-databox?view=azure-node-preview" - } -} + "autoPublish": true +} \ No newline at end of file diff --git a/sdk/databox/arm-databox/review/arm-databox.api.md b/sdk/databox/arm-databox/review/arm-databox.api.md index 14f686cf11df..d9d6f0bcf17c 100644 --- a/sdk/databox/arm-databox/review/arm-databox.api.md +++ b/sdk/databox/arm-databox/review/arm-databox.api.md @@ -177,7 +177,7 @@ export type CustomerDiskJobSecrets = JobSecrets & { }; // @public -export type CustomerResolutionCode = "None" | "MoveToCleanUpDevice" | "Resume"; +export type CustomerResolutionCode = "None" | "MoveToCleanUpDevice" | "Resume" | "Restart" | "ReachOutToOperation"; // @public export interface DataAccountDetails { @@ -244,6 +244,21 @@ export interface DataBoxDiskCopyProgress { readonly status?: CopyStatus; } +// @public +export type DataBoxDiskGranularCopyLogDetails = GranularCopyLogDetails & { + copyLogDetailsType: "DataBoxCustomerDisk"; + readonly serialNumber?: string; + readonly accountName?: string; + readonly errorLogLink?: string; + readonly verboseLogLink?: string; +}; + +// @public +export type DataBoxDiskGranularCopyProgress = GranularCopyProgress & { + readonly serialNumber?: string; + readonly copyStatus?: CopyStatus; +}; + // @public export type DataBoxDiskJobDetails = JobDetails & { jobDetailsType: "DataBoxDisk"; @@ -251,6 +266,7 @@ export type DataBoxDiskJobDetails = JobDetails & { [propertyName: string]: number; }; readonly copyProgress?: DataBoxDiskCopyProgress[]; + readonly granularCopyProgress?: DataBoxDiskGranularCopyProgress[]; readonly disksAndSizeDetails?: { [propertyName: string]: number; }; @@ -441,6 +457,12 @@ export interface Details { message: string; } +// @public +export interface DeviceErasureDetails { + readonly deviceErasureStatus?: StageStatus; + readonly erasureOrDestructionCertificateSasKey?: string; +} + // @public export type DiskScheduleAvailabilityRequest = ScheduleAvailabilityRequest & { skuName: "DataBoxDisk"; @@ -489,6 +511,33 @@ export interface FilterFileDetails { // @public export type FilterFileType = "AzureBlob" | "AzureFile"; +// @public +export interface GranularCopyLogDetails { + copyLogDetailsType: "DataBoxCustomerDisk"; +} + +// @public (undocumented) +export type GranularCopyLogDetailsUnion = GranularCopyLogDetails | DataBoxDiskGranularCopyLogDetails; + +// @public +export interface GranularCopyProgress { + readonly accountId?: string; + readonly bytesProcessed?: number; + readonly dataAccountType?: DataAccountType; + readonly directoriesErroredOut?: number; + readonly filesErroredOut?: number; + readonly filesProcessed?: number; + readonly invalidDirectoriesProcessed?: number; + readonly invalidFileBytesUploaded?: number; + readonly invalidFilesProcessed?: number; + readonly isEnumerationInProgress?: boolean; + readonly renamedContainerCount?: number; + readonly storageAccountName?: string; + readonly totalBytesToProcess?: number; + readonly totalFilesToProcess?: number; + readonly transferType?: TransferType; +} + // @public export type HeavyScheduleAvailabilityRequest = ScheduleAvailabilityRequest & { skuName: "DataBoxHeavy"; @@ -527,6 +576,7 @@ export interface JobDetails { dataExportDetails?: DataExportDetails[]; dataImportDetails?: DataImportDetails[]; readonly deliveryPackage?: PackageShippingDetails; + readonly deviceErasureDetails?: DeviceErasureDetails; expectedDataSizeInTeraBytes?: number; jobDetailsType: "DataBoxCustomerDisk" | "DataBoxDisk" | "DataBoxHeavy" | "DataBox"; readonly jobStages?: JobStages[]; @@ -748,12 +798,16 @@ export enum KnownDataCenterCode { // (undocumented) BJB = "BJB", // (undocumented) + BJS20 = "BJS20", + // (undocumented) BL20 = "BL20", // (undocumented) BL7 = "BL7", // (undocumented) BN1 = "BN1", // (undocumented) + BN7 = "BN7", + // (undocumented) BOM01 = "BOM01", // (undocumented) BY1 = "BY1", @@ -778,6 +832,8 @@ export enum KnownDataCenterCode { // (undocumented) DSM05 = "DSM05", // (undocumented) + DUB07 = "DUB07", + // (undocumented) FRA22 = "FRA22", // (undocumented) HKG20 = "HKG20", @@ -800,8 +856,16 @@ export enum KnownDataCenterCode { // (undocumented) ORK70 = "ORK70", // (undocumented) + OSA02 = "OSA02", + // (undocumented) OSA20 = "OSA20", // (undocumented) + OSA22 = "OSA22", + // (undocumented) + PAR22 = "PAR22", + // (undocumented) + PNQ01 = "PNQ01", + // (undocumented) PUS20 = "PUS20", // (undocumented) SEL20 = "SEL20", @@ -816,10 +880,14 @@ export enum KnownDataCenterCode { // (undocumented) SN5 = "SN5", // (undocumented) + SN6 = "SN6", + // (undocumented) SN8 = "SN8", // (undocumented) SSE90 = "SSE90", // (undocumented) + SVG20 = "SVG20", + // (undocumented) SYD03 = "SYD03", // (undocumented) SYD23 = "SYD23", @@ -983,6 +1051,7 @@ export interface PackageShippingDetails { export interface Preferences { encryptionPreferences?: EncryptionPreferences; preferredDataCenterRegion?: string[]; + storageAccountAccessTierPreferences?: string[]; transportPreferences?: TransportPreferences; } @@ -1204,7 +1273,7 @@ export type SkuName = "DataBox" | "DataBoxDisk" | "DataBoxHeavy" | "DataBoxCusto export type StageName = string; // @public -export type StageStatus = "None" | "InProgress" | "Succeeded" | "Failed" | "Cancelled" | "Cancelling" | "SucceededWithErrors" | "WaitingForCustomerAction" | "SucceededWithWarnings" | "WaitingForCustomerActionForKek" | "WaitingForCustomerActionForCleanUp" | "CustomerActionPerformedForCleanUp"; +export type StageStatus = "None" | "InProgress" | "Succeeded" | "Failed" | "Cancelled" | "Cancelling" | "SucceededWithErrors" | "WaitingForCustomerAction" | "SucceededWithWarnings" | "WaitingForCustomerActionForKek" | "WaitingForCustomerActionForCleanUp" | "CustomerActionPerformedForCleanUp" | "CustomerActionPerformed"; // @public export type StorageAccountDetails = DataAccountDetails & { diff --git a/sdk/databox/arm-databox/rollup.config.js b/sdk/databox/arm-databox/rollup.config.js index 3f89d7309da5..9be1955eb7f1 100644 --- a/sdk/databox/arm-databox/rollup.config.js +++ b/sdk/databox/arm-databox/rollup.config.js @@ -14,14 +14,62 @@ import json from "@rollup/plugin-json"; import nodeBuiltins from "builtin-modules"; +/** + * Gets the proper configuration needed for rollup's commonJS plugin for @opentelemetry/api. + * + * NOTE: this manual configuration is only needed because OpenTelemetry uses an + * __exportStar downleveled helper function to declare its exports which confuses + * rollup's automatic discovery mechanism. + * + * @returns an object reference that can be `...`'d into your cjs() configuration. + */ +export function openTelemetryCommonJs() { + const namedExports = {}; + + for (const key of [ + "@opentelemetry/api", + "@azure/core-tracing/node_modules/@opentelemetry/api" + ]) { + namedExports[key] = [ + "SpanKind", + "TraceFlags", + "getSpan", + "setSpan", + "SpanStatusCode", + "getSpanContext", + "setSpanContext" + ]; + } + + const releasedOpenTelemetryVersions = ["0.10.2", "1.0.0-rc.0"]; + + for (const version of releasedOpenTelemetryVersions) { + namedExports[ + // working around a limitation in the rollup common.js plugin - it's not able to resolve these modules so the named exports listed above will not get applied. We have to drill down to the actual path. + `../../../common/temp/node_modules/.pnpm/@opentelemetry/api@${version}/node_modules/@opentelemetry/api/build/src/index.js` + ] = [ + "SpanKind", + "TraceFlags", + "getSpan", + "setSpan", + "StatusCode", + "CanonicalCode", + "getSpanContext", + "setSpanContext" + ]; + } + + return namedExports; +} + // #region Warning Handler /** - * A function that can determine whether a rollup warning should be ignored. If + * A function that can determine whether a rollupwarning should be ignored. If * the function returns `true`, then the warning will not be displayed. */ -function ignoreNiseSinonEval(warning) { +function ignoreNiseSinonEvalWarnings(warning) { return ( warning.code === "EVAL" && warning.id && @@ -30,14 +78,17 @@ function ignoreNiseSinonEval(warning) { ); } -function ignoreChaiCircularDependency(warning) { +function ignoreChaiCircularDependencyWarnings(warning) { return ( warning.code === "CIRCULAR_DEPENDENCY" && warning.importer && warning.importer.includes("node_modules/chai") === true ); } -const warningInhibitors = [ignoreChaiCircularDependency, ignoreNiseSinonEval]; +const warningInhibitors = [ + ignoreChaiCircularDependencyWarnings, + ignoreNiseSinonEvalWarnings +]; /** * Construct a warning handler for the shared rollup configuration @@ -71,7 +122,22 @@ function makeBrowserTestConfig() { nodeResolve({ mainFields: ["module", "browser"] }), - cjs(), + cjs({ + namedExports: { + // Chai's strange internal architecture makes it impossible to statically + // analyze its exports. + chai: [ + "version", + "use", + "util", + "config", + "expect", + "should", + "assert" + ], + ...openTelemetryCommonJs() + } + }), json(), sourcemaps() //viz({ filename: "dist-test/browser-stats.html", sourcemap: true }) @@ -107,7 +173,7 @@ export function makeConfig(pkg, options) { ], output: { file: "dist/index.js", format: "cjs", sourcemap: true }, preserveSymlinks: false, - plugins: [sourcemaps(), nodeResolve()] + plugins: [sourcemaps(), nodeResolve(), cjs()] }; const config = [baseConfig]; diff --git a/sdk/databox/arm-databox/src/dataBoxManagementClient.ts b/sdk/databox/arm-databox/src/dataBoxManagementClient.ts index d87068de3356..6498f25f3cd8 100644 --- a/sdk/databox/arm-databox/src/dataBoxManagementClient.ts +++ b/sdk/databox/arm-databox/src/dataBoxManagementClient.ts @@ -7,7 +7,6 @@ */ import * as coreClient from "@azure/core-client"; -import * as coreRestPipeline from "@azure/core-rest-pipeline"; import * as coreAuth from "@azure/core-auth"; import { OperationsImpl, JobsImpl, ServiceImpl } from "./operations"; import { Operations, Jobs, Service } from "./operationsInterfaces"; @@ -51,7 +50,7 @@ export class DataBoxManagementClient extends coreClient.ServiceClient { credential: credentials }; - const packageDetails = `azsdk-js-arm-databox/5.0.0-beta.3`; + const packageDetails = `azsdk-js-arm-databox/5.0.0`; const userAgentPrefix = options.userAgentOptions && options.userAgentOptions.userAgentPrefix ? `${options.userAgentOptions.userAgentPrefix} ${packageDetails}` @@ -66,39 +65,15 @@ export class DataBoxManagementClient extends coreClient.ServiceClient { userAgentOptions: { userAgentPrefix }, - baseUri: - options.endpoint ?? options.baseUri ?? "https://management.azure.com" + baseUri: options.endpoint || "https://management.azure.com" }; super(optionsWithDefaults); - - if (options?.pipeline && options.pipeline.getOrderedPolicies().length > 0) { - const pipelinePolicies: coreRestPipeline.PipelinePolicy[] = options.pipeline.getOrderedPolicies(); - const bearerTokenAuthenticationPolicyFound = pipelinePolicies.some( - (pipelinePolicy) => - pipelinePolicy.name === - coreRestPipeline.bearerTokenAuthenticationPolicyName - ); - if (!bearerTokenAuthenticationPolicyFound) { - this.pipeline.removePolicy({ - name: coreRestPipeline.bearerTokenAuthenticationPolicyName - }); - this.pipeline.addPolicy( - coreRestPipeline.bearerTokenAuthenticationPolicy({ - scopes: `${optionsWithDefaults.baseUri}/.default`, - challengeCallbacks: { - authorizeRequestOnChallenge: - coreClient.authorizeRequestOnClaimChallenge - } - }) - ); - } - } // Parameter assignments this.subscriptionId = subscriptionId; // Assigning values to Constant parameters this.$host = options.$host || "https://management.azure.com"; - this.apiVersion = options.apiVersion || "2021-08-01-preview"; + this.apiVersion = options.apiVersion || "2022-02-01"; this.operations = new OperationsImpl(this); this.jobs = new JobsImpl(this); this.service = new ServiceImpl(this); diff --git a/sdk/databox/arm-databox/src/models/index.ts b/sdk/databox/arm-databox/src/models/index.ts index 1786edc46313..69e2f008aa23 100644 --- a/sdk/databox/arm-databox/src/models/index.ts +++ b/sdk/databox/arm-databox/src/models/index.ts @@ -56,6 +56,9 @@ export type ScheduleAvailabilityRequestUnion = | DataBoxScheduleAvailabilityRequest | DiskScheduleAvailabilityRequest | HeavyScheduleAvailabilityRequest; +export type GranularCopyLogDetailsUnion = + | GranularCopyLogDetails + | DataBoxDiskGranularCopyLogDetails; /** Operation Collection. */ export interface OperationList { @@ -130,32 +133,32 @@ export interface JobResourceList { nextLink?: string; } -/** Cloud error. */ +/** Provides additional information about an http error response. */ export interface CloudError { - /** Cloud error code. */ - code?: string; - /** Cloud error message. */ - message?: string; - /** Cloud error target. */ - target?: string; /** - * Cloud error details. + * Gets or sets additional error info. * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly details?: CloudError[]; + readonly additionalInfo?: AdditionalErrorInfo[]; + /** Error code. */ + code?: string; /** - * Cloud error additional info. + * Gets or sets details for the error. * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly additionalInfo?: AdditionalErrorInfo[]; + readonly details?: CloudError[]; + /** The error message parsed from the body of the http error response. */ + message?: string; + /** Gets or sets the target of the error. */ + target?: string; } -/** Additional error info. */ +/** This class represents additional info which Resource Providers pass when an error occurs. */ export interface AdditionalErrorInfo { - /** Additional error type. */ - type?: string; - /** Additional error info. */ + /** Additional information of the type of error. */ info?: Record; + /** Type of error (e.g. CustomerIntervention, PolicyViolation, SecurityViolation). */ + type?: string; } /** Job details. */ @@ -206,6 +209,11 @@ export interface JobDetails { * NOTE: This property will not be serialized. It can only be populated by the server. */ readonly chainOfCustodySasKey?: string; + /** + * Holds device data erasure details + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly deviceErasureDetails?: DeviceErasureDetails; /** Details about which key encryption type is being used. */ keyEncryptionKey?: KeyEncryptionKey; /** The expected size of the data, which needs to be transferred in this job, in terabytes. */ @@ -434,6 +442,8 @@ export interface Preferences { transportPreferences?: TransportPreferences; /** Preferences related to the Encryption. */ encryptionPreferences?: EncryptionPreferences; + /** Preferences related to the Access Tier of storage accounts. */ + storageAccountAccessTierPreferences?: string[]; } /** Preferences related to the shipment logistics of the sku */ @@ -458,6 +468,20 @@ export interface CopyLogDetails { | "DataBoxHeavy"; } +/** Device erasure details with erasure completion status and erasureordestructionlog sas key */ +export interface DeviceErasureDetails { + /** + * Holds the device erasure completion status + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly deviceErasureStatus?: StageStatus; + /** + * Shared access key to download cleanup or destruction certificate for device + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly erasureOrDestructionCertificateSasKey?: string; +} + /** Encryption key containing details about key to encrypt different keys. */ export interface KeyEncryptionKey { /** Type of encryption key used for key encryption. */ @@ -1098,6 +1122,12 @@ export interface ArmBaseObject { readonly type?: string; } +/** Granular Details for log generated during copy. */ +export interface GranularCopyLogDetails { + /** Polymorphic discriminator, which specifies the different types this object can be */ + copyLogDetailsType: "DataBoxCustomerDisk"; +} + /** Copy progress. */ export interface CopyProgress { /** @@ -1178,6 +1208,86 @@ export interface CopyProgress { readonly isEnumerationInProgress?: boolean; } +/** Granular Copy progress. */ +export interface GranularCopyProgress { + /** + * Name of the storage account. This will be empty for data account types other than storage account. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly storageAccountName?: string; + /** + * Transfer type of data + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly transferType?: TransferType; + /** + * Data Account Type. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly dataAccountType?: DataAccountType; + /** + * Id of the account where the data needs to be uploaded. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly accountId?: string; + /** + * To indicate bytes transferred. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly bytesProcessed?: number; + /** + * Total amount of data to be processed by the job. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly totalBytesToProcess?: number; + /** + * Number of files processed + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly filesProcessed?: number; + /** + * Total files to process + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly totalFilesToProcess?: number; + /** + * Number of files not adhering to azure naming conventions which were processed by automatic renaming + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly invalidFilesProcessed?: number; + /** + * Total amount of data not adhering to azure naming conventions which were processed by automatic renaming + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly invalidFileBytesUploaded?: number; + /** + * Number of folders not adhering to azure naming conventions which were processed by automatic renaming + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly renamedContainerCount?: number; + /** + * Number of files which could not be copied + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly filesErroredOut?: number; + /** + * To indicate directories errored out in the job. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly directoriesErroredOut?: number; + /** + * To indicate directories renamed + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly invalidDirectoriesProcessed?: number; + /** + * To indicate if enumeration of data is in progress. + * Until this is true, the TotalBytesToProcess may not be valid. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly isEnumerationInProgress?: boolean; +} + /** Import disk details */ export interface ImportDiskDetails { /** The relative path of the manifest file on the disk. */ @@ -1348,6 +1458,11 @@ export type DataBoxDiskJobDetails = JobDetails & { * NOTE: This property will not be serialized. It can only be populated by the server. */ readonly copyProgress?: DataBoxDiskCopyProgress[]; + /** + * Copy progress per disk. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly granularCopyProgress?: DataBoxDiskGranularCopyProgress[]; /** * Contains the map of disk serial number to the disk size being used for the job. Is returned only after the disks are shipped to the customer. * NOTE: This property will not be serialized. It can only be populated by the server. @@ -1861,6 +1976,32 @@ export type HeavyScheduleAvailabilityRequest = ScheduleAvailabilityRequest & { skuName: "DataBoxHeavy"; }; +/** Granular Copy Log Details for customer disk */ +export type DataBoxDiskGranularCopyLogDetails = GranularCopyLogDetails & { + /** Polymorphic discriminator, which specifies the different types this object can be */ + copyLogDetailsType: "DataBoxCustomerDisk"; + /** + * Disk Serial Number. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly serialNumber?: string; + /** + * Account name. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly accountName?: string; + /** + * Link for copy error logs. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly errorLogLink?: string; + /** + * Link for copy verbose logs. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly verboseLogLink?: string; +}; + /** DataBox CustomerDisk Copy Progress */ export type DataBoxCustomerDiskCopyProgress = CopyProgress & { /** @@ -1875,6 +2016,20 @@ export type DataBoxCustomerDiskCopyProgress = CopyProgress & { readonly copyStatus?: CopyStatus; }; +/** DataBox Disk Granular Copy Progress */ +export type DataBoxDiskGranularCopyProgress = GranularCopyProgress & { + /** + * Disk Serial Number. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly serialNumber?: string; + /** + * The Status of the copy + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly copyStatus?: CopyStatus; +}; + /** Known values of {@link StageName} that the service accepts. */ export enum KnownStageName { /** An order has been created. */ @@ -2037,7 +2192,16 @@ export enum KnownDataCenterCode { PUS20 = "PUS20", AdHoc = "AdHoc", CH1 = "CH1", - DSM05 = "DSM05" + DSM05 = "DSM05", + DUB07 = "DUB07", + PNQ01 = "PNQ01", + SVG20 = "SVG20", + OSA02 = "OSA02", + OSA22 = "OSA22", + PAR22 = "PAR22", + BN7 = "BN7", + SN6 = "SN6", + BJS20 = "BJS20" } /** @@ -2094,7 +2258,16 @@ export enum KnownDataCenterCode { * **PUS20** \ * **AdHoc** \ * **CH1** \ - * **DSM05** + * **DSM05** \ + * **DUB07** \ + * **PNQ01** \ + * **SVG20** \ + * **OSA02** \ + * **OSA22** \ + * **PAR22** \ + * **BN7** \ + * **SN6** \ + * **BJS20** */ export type DataCenterCode = string; @@ -2134,7 +2307,7 @@ export enum KnownCopyStatus { DriveNotDetected = "DriveNotDetected", /** Copy failed due to corrupted drive. */ DriveCorrupted = "DriveCorrupted", - /** Copy failed due to modified or removed metadata files. */ + /** Copy failed due to modified or removed metadata files. */ MetadataFilesModifiedOrRemoved = "MetadataFilesModifiedOrRemoved" } @@ -2160,7 +2333,7 @@ export enum KnownCopyStatus { * **OtherUserError**: Copy failed due to user error. \ * **DriveNotDetected**: Copy failed due to disk detection error. \ * **DriveCorrupted**: Copy failed due to corrupted drive. \ - * **MetadataFilesModifiedOrRemoved**: Copy failed due to modified or removed metadata files. + * **MetadataFilesModifiedOrRemoved**: Copy failed due to modified or removed metadata files. */ export type CopyStatus = string; /** Defines values for TransferType. */ @@ -2178,7 +2351,8 @@ export type StageStatus = | "SucceededWithWarnings" | "WaitingForCustomerActionForKek" | "WaitingForCustomerActionForCleanUp" - | "CustomerActionPerformedForCleanUp"; + | "CustomerActionPerformedForCleanUp" + | "CustomerActionPerformed"; /** Defines values for AddressType. */ export type AddressType = "None" | "Residential" | "Commercial"; /** Defines values for DataAccountType. */ @@ -2202,7 +2376,12 @@ export type DoubleEncryption = "Enabled" | "Disabled"; /** Defines values for KekType. */ export type KekType = "MicrosoftManaged" | "CustomerManaged"; /** Defines values for CustomerResolutionCode. */ -export type CustomerResolutionCode = "None" | "MoveToCleanUpDevice" | "Resume"; +export type CustomerResolutionCode = + | "None" + | "MoveToCleanUpDevice" + | "Resume" + | "Restart" + | "ReachOutToOperation"; /** Defines values for DatacenterAddressType. */ export type DatacenterAddressType = | "DatacenterAddressLocation" diff --git a/sdk/databox/arm-databox/src/models/mappers.ts b/sdk/databox/arm-databox/src/models/mappers.ts index a48a105ad0ce..148bd17764a1 100644 --- a/sdk/databox/arm-databox/src/models/mappers.ts +++ b/sdk/databox/arm-databox/src/models/mappers.ts @@ -225,20 +225,21 @@ export const CloudError: coreClient.CompositeMapper = { name: "Composite", className: "CloudError", modelProperties: { - code: { - serializedName: "code", - type: { - name: "String" - } - }, - message: { - serializedName: "message", + additionalInfo: { + serializedName: "additionalInfo", + readOnly: true, type: { - name: "String" + name: "Sequence", + element: { + type: { + name: "Composite", + className: "AdditionalErrorInfo" + } + } } }, - target: { - serializedName: "target", + code: { + serializedName: "code", type: { name: "String" } @@ -256,17 +257,16 @@ export const CloudError: coreClient.CompositeMapper = { } } }, - additionalInfo: { - serializedName: "additionalInfo", - readOnly: true, + message: { + serializedName: "message", type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "AdditionalErrorInfo" - } - } + name: "String" + } + }, + target: { + serializedName: "target", + type: { + name: "String" } } } @@ -278,18 +278,18 @@ export const AdditionalErrorInfo: coreClient.CompositeMapper = { name: "Composite", className: "AdditionalErrorInfo", modelProperties: { - type: { - serializedName: "type", - type: { - name: "String" - } - }, info: { serializedName: "info", type: { name: "Dictionary", value: { type: { name: "any" } } } + }, + type: { + serializedName: "type", + type: { + name: "String" + } } } } @@ -417,6 +417,13 @@ export const JobDetails: coreClient.CompositeMapper = { name: "String" } }, + deviceErasureDetails: { + serializedName: "deviceErasureDetails", + type: { + name: "Composite", + className: "DeviceErasureDetails" + } + }, keyEncryptionKey: { serializedName: "keyEncryptionKey", type: { @@ -438,7 +445,13 @@ export const JobDetails: coreClient.CompositeMapper = { element: { type: { name: "Enum", - allowedValues: ["None", "MoveToCleanUpDevice", "Resume"] + allowedValues: [ + "None", + "MoveToCleanUpDevice", + "Resume", + "Restart", + "ReachOutToOperation" + ] } } } @@ -504,7 +517,8 @@ export const JobStages: coreClient.CompositeMapper = { "SucceededWithWarnings", "WaitingForCustomerActionForKek", "WaitingForCustomerActionForCleanUp", - "CustomerActionPerformedForCleanUp" + "CustomerActionPerformedForCleanUp", + "CustomerActionPerformed" ] } }, @@ -1066,6 +1080,19 @@ export const Preferences: coreClient.CompositeMapper = { name: "Composite", className: "EncryptionPreferences" } + }, + storageAccountAccessTierPreferences: { + serializedName: "storageAccountAccessTierPreferences", + type: { + name: "Sequence", + element: { + defaultValue: "Archive", + isConstant: true, + type: { + name: "String" + } + } + } } } } @@ -1132,6 +1159,44 @@ export const CopyLogDetails: coreClient.CompositeMapper = { } }; +export const DeviceErasureDetails: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "DeviceErasureDetails", + modelProperties: { + deviceErasureStatus: { + serializedName: "deviceErasureStatus", + readOnly: true, + type: { + name: "Enum", + allowedValues: [ + "None", + "InProgress", + "Succeeded", + "Failed", + "Cancelled", + "Cancelling", + "SucceededWithErrors", + "WaitingForCustomerAction", + "SucceededWithWarnings", + "WaitingForCustomerActionForKek", + "WaitingForCustomerActionForCleanUp", + "CustomerActionPerformedForCleanUp", + "CustomerActionPerformed" + ] + } + }, + erasureOrDestructionCertificateSasKey: { + serializedName: "erasureOrDestructionCertificateSasKey", + readOnly: true, + type: { + name: "String" + } + } + } + } +}; + export const KeyEncryptionKey: coreClient.CompositeMapper = { type: { name: "Composite", @@ -1227,7 +1292,13 @@ export const LastMitigationActionOnJob: coreClient.CompositeMapper = { serializedName: "customerResolution", type: { name: "Enum", - allowedValues: ["None", "MoveToCleanUpDevice", "Resume"] + allowedValues: [ + "None", + "MoveToCleanUpDevice", + "Resume", + "Restart", + "ReachOutToOperation" + ] } } } @@ -1487,7 +1558,13 @@ export const MitigateJobRequest: coreClient.CompositeMapper = { required: true, type: { name: "Enum", - allowedValues: ["None", "MoveToCleanUpDevice", "Resume"] + allowedValues: [ + "None", + "MoveToCleanUpDevice", + "Resume", + "Restart", + "ReachOutToOperation" + ] } } } @@ -2605,6 +2682,33 @@ export const ArmBaseObject: coreClient.CompositeMapper = { } }; +export const GranularCopyLogDetails: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "GranularCopyLogDetails", + uberParent: "GranularCopyLogDetails", + polymorphicDiscriminator: { + serializedName: "copyLogDetailsType", + clientName: "copyLogDetailsType" + }, + modelProperties: { + copyLogDetailsType: { + serializedName: "copyLogDetailsType", + required: true, + type: { + name: "Enum", + allowedValues: [ + "DataBox", + "DataBoxDisk", + "DataBoxHeavy", + "DataBoxCustomerDisk" + ] + } + } + } + } +}; + export const CopyProgress: coreClient.CompositeMapper = { type: { name: "Composite", @@ -2721,6 +2825,122 @@ export const CopyProgress: coreClient.CompositeMapper = { } }; +export const GranularCopyProgress: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "GranularCopyProgress", + modelProperties: { + storageAccountName: { + serializedName: "storageAccountName", + readOnly: true, + type: { + name: "String" + } + }, + transferType: { + serializedName: "transferType", + readOnly: true, + type: { + name: "Enum", + allowedValues: ["ImportToAzure", "ExportFromAzure"] + } + }, + dataAccountType: { + serializedName: "dataAccountType", + readOnly: true, + type: { + name: "Enum", + allowedValues: ["StorageAccount", "ManagedDisk"] + } + }, + accountId: { + serializedName: "accountId", + readOnly: true, + type: { + name: "String" + } + }, + bytesProcessed: { + serializedName: "bytesProcessed", + readOnly: true, + type: { + name: "Number" + } + }, + totalBytesToProcess: { + serializedName: "totalBytesToProcess", + readOnly: true, + type: { + name: "Number" + } + }, + filesProcessed: { + serializedName: "filesProcessed", + readOnly: true, + type: { + name: "Number" + } + }, + totalFilesToProcess: { + serializedName: "totalFilesToProcess", + readOnly: true, + type: { + name: "Number" + } + }, + invalidFilesProcessed: { + serializedName: "invalidFilesProcessed", + readOnly: true, + type: { + name: "Number" + } + }, + invalidFileBytesUploaded: { + serializedName: "invalidFileBytesUploaded", + readOnly: true, + type: { + name: "Number" + } + }, + renamedContainerCount: { + serializedName: "renamedContainerCount", + readOnly: true, + type: { + name: "Number" + } + }, + filesErroredOut: { + serializedName: "filesErroredOut", + readOnly: true, + type: { + name: "Number" + } + }, + directoriesErroredOut: { + serializedName: "directoriesErroredOut", + readOnly: true, + type: { + name: "Number" + } + }, + invalidDirectoriesProcessed: { + serializedName: "invalidDirectoriesProcessed", + readOnly: true, + type: { + name: "Number" + } + }, + isEnumerationInProgress: { + serializedName: "isEnumerationInProgress", + readOnly: true, + type: { + name: "Boolean" + } + } + } + } +}; + export const ImportDiskDetails: coreClient.CompositeMapper = { type: { name: "Composite", @@ -3051,6 +3271,19 @@ export const DataBoxDiskJobDetails: coreClient.CompositeMapper = { } } }, + granularCopyProgress: { + serializedName: "granularCopyProgress", + readOnly: true, + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "DataBoxDiskGranularCopyProgress" + } + } + } + }, disksAndSizeDetails: { serializedName: "disksAndSizeDetails", readOnly: true, @@ -4138,6 +4371,48 @@ export const HeavyScheduleAvailabilityRequest: coreClient.CompositeMapper = { } }; +export const DataBoxDiskGranularCopyLogDetails: coreClient.CompositeMapper = { + serializedName: "DataBoxCustomerDisk", + type: { + name: "Composite", + className: "DataBoxDiskGranularCopyLogDetails", + uberParent: "GranularCopyLogDetails", + polymorphicDiscriminator: + GranularCopyLogDetails.type.polymorphicDiscriminator, + modelProperties: { + ...GranularCopyLogDetails.type.modelProperties, + serialNumber: { + serializedName: "serialNumber", + readOnly: true, + type: { + name: "String" + } + }, + accountName: { + serializedName: "accountName", + readOnly: true, + type: { + name: "String" + } + }, + errorLogLink: { + serializedName: "errorLogLink", + readOnly: true, + type: { + name: "String" + } + }, + verboseLogLink: { + serializedName: "verboseLogLink", + readOnly: true, + type: { + name: "String" + } + } + } + } +}; + export const DataBoxCustomerDiskCopyProgress: coreClient.CompositeMapper = { type: { name: "Composite", @@ -4162,6 +4437,30 @@ export const DataBoxCustomerDiskCopyProgress: coreClient.CompositeMapper = { } }; +export const DataBoxDiskGranularCopyProgress: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "DataBoxDiskGranularCopyProgress", + modelProperties: { + ...GranularCopyProgress.type.modelProperties, + serialNumber: { + serializedName: "serialNumber", + readOnly: true, + type: { + name: "String" + } + }, + copyStatus: { + serializedName: "copyStatus", + readOnly: true, + type: { + name: "String" + } + } + } + } +}; + export let discriminators = { JobDetails: JobDetails, DataAccountDetails: DataAccountDetails, @@ -4172,6 +4471,7 @@ export let discriminators = { ValidationRequest: ValidationRequest, JobSecrets: JobSecrets, ScheduleAvailabilityRequest: ScheduleAvailabilityRequest, + GranularCopyLogDetails: GranularCopyLogDetails, "JobDetails.DataBoxCustomerDisk": DataBoxCustomerDiskJobDetails, "JobDetails.DataBoxDisk": DataBoxDiskJobDetails, "JobDetails.DataBoxHeavy": DataBoxHeavyJobDetails, @@ -4203,5 +4503,6 @@ export let discriminators = { "JobSecrets.DataBox": DataboxJobSecrets, "ScheduleAvailabilityRequest.DataBox": DataBoxScheduleAvailabilityRequest, "ScheduleAvailabilityRequest.DataBoxDisk": DiskScheduleAvailabilityRequest, - "ScheduleAvailabilityRequest.DataBoxHeavy": HeavyScheduleAvailabilityRequest + "ScheduleAvailabilityRequest.DataBoxHeavy": HeavyScheduleAvailabilityRequest, + "GranularCopyLogDetails.DataBoxCustomerDisk": DataBoxDiskGranularCopyLogDetails }; diff --git a/sdk/databox/arm-databox/src/models/parameters.ts b/sdk/databox/arm-databox/src/models/parameters.ts index 71e340c9765a..97c8aed1c546 100644 --- a/sdk/databox/arm-databox/src/models/parameters.ts +++ b/sdk/databox/arm-databox/src/models/parameters.ts @@ -51,7 +51,7 @@ export const $host: OperationURLParameter = { export const apiVersion: OperationQueryParameter = { parameterPath: "apiVersion", mapper: { - defaultValue: "2021-08-01-preview", + defaultValue: "2022-02-01", isConstant: true, serializedName: "api-version", type: { diff --git a/sdk/databox/arm-databox/src/operations/jobs.ts b/sdk/databox/arm-databox/src/operations/jobs.ts index b75a64755bb6..b87c104294d2 100644 --- a/sdk/databox/arm-databox/src/operations/jobs.ts +++ b/sdk/databox/arm-databox/src/operations/jobs.ts @@ -335,12 +335,10 @@ export class JobsImpl implements Jobs { { resourceGroupName, jobName, jobResource, options }, createOperationSpec ); - const poller = new LroEngine(lro, { + return new LroEngine(lro, { resumeFrom: options?.resumeFrom, intervalInMs: options?.updateIntervalInMs }); - await poller.poll(); - return poller; } /** @@ -423,12 +421,10 @@ export class JobsImpl implements Jobs { { resourceGroupName, jobName, options }, deleteOperationSpec ); - const poller = new LroEngine(lro, { + return new LroEngine(lro, { resumeFrom: options?.resumeFrom, intervalInMs: options?.updateIntervalInMs }); - await poller.poll(); - return poller; } /** @@ -507,12 +503,10 @@ export class JobsImpl implements Jobs { { resourceGroupName, jobName, jobResourceUpdateParameter, options }, updateOperationSpec ); - const poller = new LroEngine(lro, { + return new LroEngine(lro, { resumeFrom: options?.resumeFrom, intervalInMs: options?.updateIntervalInMs }); - await poller.poll(); - return poller; } /** diff --git a/sdk/databox/arm-databox/tsconfig.json b/sdk/databox/arm-databox/tsconfig.json index 7f0a11d9ac11..3e6ae96443f3 100644 --- a/sdk/databox/arm-databox/tsconfig.json +++ b/sdk/databox/arm-databox/tsconfig.json @@ -15,17 +15,11 @@ ], "declaration": true, "outDir": "./dist-esm", - "importHelpers": true, - "paths": { - "@azure/arm-databox": [ - "./src/index" - ] - } + "importHelpers": true }, "include": [ "./src/**/*.ts", - "./test/**/*.ts", - "samples-dev/**/*.ts" + "./test/**/*.ts" ], "exclude": [ "node_modules"