Skip to content

Commit

Permalink
undo 'add snapshot to options'
Browse files Browse the repository at this point in the history
  • Loading branch information
Lin Jian committed Mar 24, 2020
1 parent 397d40b commit 331cae3
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 47 deletions.
4 changes: 0 additions & 4 deletions sdk/storage/storage-blob/review/storage-blob.api.md
Original file line number Diff line number Diff line change
Expand Up @@ -454,7 +454,6 @@ export interface BlobDeleteOptions extends CommonOptions {
conditions?: BlobRequestConditions;
customerProvidedKey?: CpkInfo;
deleteSnapshots?: DeleteSnapshotsOptionType;
snapshot?: string;
versionId?: string;
}

Expand Down Expand Up @@ -553,7 +552,6 @@ export interface BlobDownloadToBufferOptions extends CommonOptions {
customerProvidedKey?: CpkInfo;
maxRetryRequestsPerBlock?: number;
onProgress?: (progress: TransferProgressEvent) => void;
snapshot?: string;
versionId?: string;
}

Expand All @@ -562,7 +560,6 @@ export interface BlobExistsOptions extends CommonOptions {
abortSignal?: AbortSignalLike;
conditions?: BlobRequestConditions;
customerProvidedKey?: CpkInfo;
snapshot?: string;
versionId?: string;
}

Expand Down Expand Up @@ -625,7 +622,6 @@ export interface BlobGetPropertiesOptions extends CommonOptions {
abortSignal?: AbortSignalLike;
conditions?: BlobRequestConditions;
customerProvidedKey?: CpkInfo;
snapshot?: string;
versionId?: string;
}

Expand Down
34 changes: 0 additions & 34 deletions sdk/storage/storage-blob/src/Clients.ts
Original file line number Diff line number Diff line change
Expand Up @@ -298,14 +298,6 @@ export interface BlobExistsOptions extends CommonOptions {
* @memberof BlobExistsOptions
*/
conditions?: BlobRequestConditions;
/**
* An opaque DateTime value that, when present, specifies the blob
* snapshot to retrieve.
*
* @type {string}
* @memberof BlobExistsOptions
*/
snapshot?: string;
/**
* An opaque DateTime value that, when present, specifies the version
* of the blob to retrieve. It's for service version 2019-10-10 and newer.
Expand Down Expand Up @@ -345,14 +337,6 @@ export interface BlobGetPropertiesOptions extends CommonOptions {
* @memberof BlobGetPropertiesOptions
*/
customerProvidedKey?: CpkInfo;
/**
* An opaque DateTime value that, when present, specifies the blob
* snapshot to retrieve.
*
* @type {string}
* @memberof BlobGetPropertiesOptions
*/
snapshot?: string;
/**
* An opaque DateTime value that, when present, specifies the version
* of the blob to retrieve. It's for service version 2019-10-10 and newer.
Expand Down Expand Up @@ -401,13 +385,6 @@ export interface BlobDeleteOptions extends CommonOptions {
* @memberof BlobDeleteOptions
*/
customerProvidedKey?: CpkInfo;
/**
* An opaque DateTime value that, when present, specifies the blob snapshot to delete.
*
* @type {string}
* @memberof BlobDeleteOptions
*/
snapshot?: string;
/**
* An opaque DateTime value that, when present, specifies the version
* of the blob to delete. It's for service version 2019-10-10 and newer.
Expand Down Expand Up @@ -913,13 +890,6 @@ export interface BlobDownloadToBufferOptions extends CommonOptions {
* @memberof BlobDownloadToBufferOptions
*/
customerProvidedKey?: CpkInfo;
/**
* An opaque DateTime string value that, when present, specifies the blob snapshot to retrieve.
*
* @type {string}
* @memberof BlobDownloadToBufferOptions
*/
snapshot?: string;
/**
* An opaque DateTime string value that, when present, specifies the version of the blob
* to retrieve. It's for service version 2019-10-10 and newer.
Expand Down Expand Up @@ -1360,7 +1330,6 @@ export class BlobClient extends StorageClient {
abortSignal: options.abortSignal,
customerProvidedKey: options.customerProvidedKey,
versionId: options.versionId,
snapshot: options.snapshot,
conditions: options.conditions,
tracingOptions: {
...options.tracingOptions,
Expand Down Expand Up @@ -1412,7 +1381,6 @@ export class BlobClient extends StorageClient {
leaseAccessConditions: options.conditions,
modifiedAccessConditions: options.conditions,
cpkInfo: options.customerProvidedKey,
snapshot: options.snapshot,
versionId: options.versionId,
spanOptions
});
Expand Down Expand Up @@ -1447,7 +1415,6 @@ export class BlobClient extends StorageClient {
deleteSnapshots: options.deleteSnapshots,
leaseAccessConditions: options.conditions,
modifiedAccessConditions: options.conditions,
snapshot: options.snapshot,
versionId: options.versionId,
spanOptions
});
Expand Down Expand Up @@ -1969,7 +1936,6 @@ export class BlobClient extends StorageClient {
conditions: options.conditions,
maxRetryRequests: options.maxRetryRequestsPerBlock,
customerProvidedKey: options.customerProvidedKey,
snapshot: options.snapshot,
versionId: options.versionId,
tracingOptions: {
...options.tracingOptions,
Expand Down
14 changes: 5 additions & 9 deletions sdk/storage/storage-blob/test/blobversioning.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -138,9 +138,8 @@ describe("Blob versioning", () => {
const snapshotRes = await blobClient.createSnapshot();
let exceptionCaught = false;
try {
await blobClient.getProperties({
await blobClient.withSnapshot(snapshotRes.snapshot!).getProperties({
versionId: uploadRes.versionId,
snapshot: snapshotRes.snapshot
});
} catch (err) {
assert.equal(err.details.errorCode, "MutuallyExclusiveQueryParameters");
Expand Down Expand Up @@ -249,10 +248,9 @@ describe("Blob versioning", () => {
assert.ok(result.snapshot);
assert.ok(result.versionId);

await blobClient.delete({ snapshot: result.snapshot });
const snapshotExists = await blobClient.exists({
snapshot: result.snapshot,
});
const snapshotClient = blobClient.withSnapshot(result.snapshot!);
await snapshotClient.delete();
const snapshotExists = await snapshotClient.exists();
assert.ok(!snapshotExists);

const rootExists = await blobClient.exists();
Expand All @@ -273,9 +271,7 @@ describe("Blob versioning", () => {
assert.ok(exceptionCaught);

blobClient.delete({ deleteSnapshots: "include" });
const snapshotExists = await blobClient.exists({
snapshot: result.snapshot,
});
const snapshotExists = await blobClient.withSnapshot(result.snapshot!).exists();
assert.ok(!snapshotExists);
const rootExists = await blobClient.exists();
assert.ok(!rootExists);
Expand Down

0 comments on commit 331cae3

Please sign in to comment.