Skip to content
Permalink
Browse files
AzureBlob: Update API to 2017-11-09
  • Loading branch information
timuralp committed Aug 16, 2021
1 parent a1df0bb commit 519bee9f60cdfe5acf58a838afba2c7315e98494
Showing 4 changed files with 31 additions and 31 deletions.
@@ -62,7 +62,7 @@ protected Builder() {
.name("Microsoft Azure Blob Service API")
.identityName("Account Name")
.credentialName("Access Key")
.version("2017-04-17")
.version("2017-11-09")
.defaultEndpoint("https://${jclouds.identity}.blob.core.windows.net")
.documentation(URI.create("http://msdn.microsoft.com/en-us/library/dd135733.aspx"))
.defaultProperties(AzureBlobApiMetadata.defaultProperties())
@@ -47,7 +47,7 @@
@Singleton
public class AzureBlobRequestSigner implements BlobRequestSigner {
private static final int DEFAULT_EXPIRY_SECONDS = 15 * 60;
private static final String API_VERSION = "2017-04-17";
private static final String API_VERSION = "2017-11-09";

private final String identity;
private final URI storageUrl;
@@ -79,7 +79,7 @@ public void testListContainers() throws SecurityException, NoSuchMethodException
GeneratedHttpRequest request = processor.createRequest(method, ImmutableList.of());

assertRequestLineEquals(request, "GET https://identity.blob.core.windows.net/?comp=list HTTP/1.1");
assertNonPayloadHeadersEqual(request, "x-ms-version: 2017-04-17\n");
assertNonPayloadHeadersEqual(request, "x-ms-version: 2017-11-09\n");
assertPayloadEquals(request, null, null, false);

assertResponseParserClassEquals(method, request, ParseSax.class);
@@ -94,7 +94,7 @@ public void testListContainersOptions() throws SecurityException, NoSuchMethodEx

assertRequestLineEquals(request,
"GET https://identity.blob.core.windows.net/?comp=list&maxresults=1&marker=marker&prefix=prefix HTTP/1.1");
assertNonPayloadHeadersEqual(request, "x-ms-version: 2017-04-17\n");
assertNonPayloadHeadersEqual(request, "x-ms-version: 2017-11-09\n");
assertPayloadEquals(request, null, null, false);

assertResponseParserClassEquals(method, request, ParseSax.class);
@@ -109,7 +109,7 @@ public void testCreateContainer() throws SecurityException, NoSuchMethodExceptio

assertRequestLineEquals(request,
"PUT https://identity.blob.core.windows.net/container?restype=container HTTP/1.1");
assertNonPayloadHeadersEqual(request, "x-ms-version: 2017-04-17\n");
assertNonPayloadHeadersEqual(request, "x-ms-version: 2017-11-09\n");
assertPayloadEquals(request, null, null, false);

assertResponseParserClassEquals(method, request, ReturnTrueIf2xx.class);
@@ -123,7 +123,7 @@ public void testDeleteContainer() throws SecurityException, NoSuchMethodExceptio

assertRequestLineEquals(request,
"DELETE https://identity.blob.core.windows.net/container?restype=container HTTP/1.1");
assertNonPayloadHeadersEqual(request, "x-ms-version: 2017-04-17\n");
assertNonPayloadHeadersEqual(request, "x-ms-version: 2017-11-09\n");
assertPayloadEquals(request, null, null, false);

assertResponseParserClassEquals(method, request, ReleasePayloadAndReturn.class);
@@ -142,7 +142,7 @@ public void testCreateContainerOptions() throws SecurityException, NoSuchMethodE
assertNonPayloadHeadersEqual(request,
"x-ms-blob-public-access: blob\n" +
"x-ms-meta-foo: bar\n" +
"x-ms-version: 2017-04-17\n");
"x-ms-version: 2017-11-09\n");
assertPayloadEquals(request, null, null, false);

assertResponseParserClassEquals(method, request, ReturnTrueIf2xx.class);
@@ -156,7 +156,7 @@ public void testCreateRootContainer() throws SecurityException, NoSuchMethodExce
GeneratedHttpRequest request = processor.createRequest(method, ImmutableList.of());

assertRequestLineEquals(request, "PUT https://identity.blob.core.windows.net/$root?restype=container HTTP/1.1");
assertNonPayloadHeadersEqual(request, "x-ms-version: 2017-04-17\n");
assertNonPayloadHeadersEqual(request, "x-ms-version: 2017-11-09\n");
assertPayloadEquals(request, null, null, false);

assertResponseParserClassEquals(method, request, ReturnTrueIf2xx.class);
@@ -169,7 +169,7 @@ public void testDeleteRootContainer() throws SecurityException, NoSuchMethodExce
GeneratedHttpRequest request = processor.createRequest(method, ImmutableList.of());

assertRequestLineEquals(request, "DELETE https://identity.blob.core.windows.net/$root?restype=container HTTP/1.1");
assertNonPayloadHeadersEqual(request, "x-ms-version: 2017-04-17\n");
assertNonPayloadHeadersEqual(request, "x-ms-version: 2017-11-09\n");
assertPayloadEquals(request, null, null, false);

assertResponseParserClassEquals(method, request, ReleasePayloadAndReturn.class);
@@ -186,7 +186,7 @@ public void testCreateRootContainerOptions() throws SecurityException, NoSuchMet
assertNonPayloadHeadersEqual(request,
"x-ms-blob-public-access: blob\n" +
"x-ms-meta-foo: bar\n" +
"x-ms-version: 2017-04-17\n");
"x-ms-version: 2017-11-09\n");
assertPayloadEquals(request, null, null, false);

assertResponseParserClassEquals(method, request, ReturnTrueIf2xx.class);
@@ -200,7 +200,7 @@ public void testListBlobs() throws SecurityException, NoSuchMethodException, IOE

assertRequestLineEquals(request,
"GET https://identity.blob.core.windows.net/container?restype=container&comp=list HTTP/1.1");
assertNonPayloadHeadersEqual(request, "x-ms-version: 2017-04-17\n");
assertNonPayloadHeadersEqual(request, "x-ms-version: 2017-11-09\n");
assertPayloadEquals(request, null, null, false);

assertResponseParserClassEquals(method, request, ParseSax.class);
@@ -214,7 +214,7 @@ public void testListBlobsWithOptions() throws SecurityException, NoSuchMethodExc

assertRequestLineEquals(request,
"GET https://identity.blob.core.windows.net/container?restype=container&comp=list&include=copy,metadata,snapshots,uncommittedblobs HTTP/1.1");
assertNonPayloadHeadersEqual(request, "x-ms-version: 2017-04-17\n");
assertNonPayloadHeadersEqual(request, "x-ms-version: 2017-11-09\n");
assertPayloadEquals(request, null, null, false);

assertResponseParserClassEquals(method, request, ParseSax.class);
@@ -228,7 +228,7 @@ public void testListRootBlobs() throws SecurityException, NoSuchMethodException,

assertRequestLineEquals(request,
"GET https://identity.blob.core.windows.net/$root?restype=container&comp=list HTTP/1.1");
assertNonPayloadHeadersEqual(request, "x-ms-version: 2017-04-17\n");
assertNonPayloadHeadersEqual(request, "x-ms-version: 2017-11-09\n");
assertPayloadEquals(request, null, null, false);

assertResponseParserClassEquals(method, request, ParseSax.class);
@@ -242,7 +242,7 @@ public void testContainerProperties() throws SecurityException, NoSuchMethodExce

assertRequestLineEquals(request,
"HEAD https://identity.blob.core.windows.net/container?restype=container HTTP/1.1");
assertNonPayloadHeadersEqual(request, "x-ms-version: 2017-04-17\n");
assertNonPayloadHeadersEqual(request, "x-ms-version: 2017-11-09\n");
assertPayloadEquals(request, null, null, false);

assertResponseParserClassEquals(method, request, ParseContainerPropertiesFromHeaders.class);
@@ -256,7 +256,7 @@ public void testGetPublicAccessForContainer() throws SecurityException, NoSuchMe

assertRequestLineEquals(request,
"HEAD https://identity.blob.core.windows.net/container?restype=container&comp=acl HTTP/1.1");
assertNonPayloadHeadersEqual(request, "x-ms-version: 2017-04-17\n");
assertNonPayloadHeadersEqual(request, "x-ms-version: 2017-11-09\n");
assertPayloadEquals(request, null, null, false);

assertResponseParserClassEquals(method, request, ParsePublicAccessHeader.class);
@@ -281,7 +281,7 @@ private void setAndVerifyPublicAccessForContainer(PublicAccess access, String ex
"PUT https://identity.blob.core.windows.net/container?restype=container&comp=acl HTTP/1.1");
assertNonPayloadHeadersEqual(request,
expectedHeader +
"x-ms-version: 2017-04-17\n");
"x-ms-version: 2017-11-09\n");
assertPayloadEquals(request, null, null, false);

assertResponseParserClassEquals(method, request, ParseETagHeader.class);
@@ -298,7 +298,7 @@ public void testSetResourceMetadata() throws SecurityException, NoSuchMethodExce
"PUT https://identity.blob.core.windows.net/container?restype=container&comp=metadata HTTP/1.1");
assertNonPayloadHeadersEqual(request,
"x-ms-meta-key: value\n" +
"x-ms-version: 2017-04-17\n");
"x-ms-version: 2017-11-09\n");
assertPayloadEquals(request, null, null, false);

assertResponseParserClassEquals(method, request, ReleasePayloadAndReturn.class);
@@ -322,7 +322,7 @@ public void testPutBlob() throws Exception {
"Expect: 100-continue\n" +
"x-ms-blob-cache-control: " + cacheControl + "\n" +
"x-ms-blob-type: BlockBlob\n" +
"x-ms-version: 2017-04-17\n");
"x-ms-version: 2017-11-09\n");
assertPayloadEquals(request, payload, "application/unknown", false);

assertResponseParserClassEquals(method, request, ParseETagHeader.class);
@@ -335,7 +335,7 @@ public void testGetBlob() throws SecurityException, NoSuchMethodException, IOExc
GeneratedHttpRequest request = processor.createRequest(method, ImmutableList.<Object> of("container", "blob"));

assertRequestLineEquals(request, "GET https://identity.blob.core.windows.net/container/blob HTTP/1.1");
assertNonPayloadHeadersEqual(request, "x-ms-version: 2017-04-17\n");
assertNonPayloadHeadersEqual(request, "x-ms-version: 2017-11-09\n");
assertPayloadEquals(request, null, null, false);

assertResponseParserClassEquals(method, request, ParseBlobFromHeadersAndHttpContent.class);
@@ -351,7 +351,7 @@ public void testSetBlobMetadata() throws SecurityException, NoSuchMethodExceptio
"PUT https://identity.blob.core.windows.net/container/blob?comp=metadata HTTP/1.1");
assertNonPayloadHeadersEqual(request,
"x-ms-meta-key: value\n" +
"x-ms-version: 2017-04-17\n");
"x-ms-version: 2017-11-09\n");
assertPayloadEquals(request, null, null, false);

assertResponseParserClassEquals(method, request, ParseETagHeader.class);
@@ -372,7 +372,7 @@ public void testSetBlobProperties() throws Exception {
assertNonPayloadHeadersEqual(request,
"x-ms-blob-cache-control: " + cacheControl + "\n" +
"x-ms-blob-content-type: application/unknown\n" +
"x-ms-version: 2017-04-17\n");
"x-ms-version: 2017-11-09\n");
assertPayloadEquals(request, null, null, false);

assertResponseParserClassEquals(method, request, ParseETagHeader.class);
@@ -389,7 +389,7 @@ public void testSetBlobTier() throws Exception {
"PUT https://identity.blob.core.windows.net/container/blob?comp=tier HTTP/1.1");
assertNonPayloadHeadersEqual(request,
"x-ms-access-tier: " + tier + "\n" +
"x-ms-version: 2017-04-17\n");
"x-ms-version: 2017-11-09\n");
assertPayloadEquals(request, null, null, false);

assertResponseParserClassEquals(method, request, ReleasePayloadAndReturn.class);
@@ -407,7 +407,7 @@ public void testCopyBlob() throws Exception {
checkFilters(request);
assertNonPayloadHeadersEqual(request,
"x-ms-copy-source: https://identity.blob.core.windows.net/fromcontainer/fromblob\n" +
"x-ms-version: 2017-04-17\n");
"x-ms-version: 2017-11-09\n");
assertPayloadEquals(request, null, null, false);
}

@@ -423,7 +423,7 @@ public void testCopyBlobOverwriteUserMetadata() throws Exception {
assertNonPayloadHeadersEqual(request,
"x-ms-copy-source: https://identity.blob.core.windows.net/fromcontainer/fromblob\n" +
"x-ms-meta-foo: bar\n" +
"x-ms-version: 2017-04-17\n");
"x-ms-version: 2017-11-09\n");
assertPayloadEquals(request, null, null, false);
}

@@ -439,7 +439,7 @@ public void testCopyBlobIfModifiedSince() throws Exception {
assertNonPayloadHeadersEqual(request,
"x-ms-copy-source: https://identity.blob.core.windows.net/fromcontainer/fromblob\n" +
"x-ms-source-if-modified-since: Thu, 01 Jan 1970 00:00:01 GMT\n" +
"x-ms-version: 2017-04-17\n");
"x-ms-version: 2017-11-09\n");
assertPayloadEquals(request, null, null, false);
}

@@ -455,7 +455,7 @@ public void testCopyBlobIfUnmodifiedSince() throws Exception {
assertNonPayloadHeadersEqual(request,
"x-ms-copy-source: https://identity.blob.core.windows.net/fromcontainer/fromblob\n" +
"x-ms-source-if-unmodified-since: Thu, 01 Jan 1970 00:00:01 GMT\n" +
"x-ms-version: 2017-04-17\n");
"x-ms-version: 2017-11-09\n");
assertPayloadEquals(request, null, null, false);
}

@@ -472,7 +472,7 @@ public void testCopyBlobIfMatch() throws Exception {
assertNonPayloadHeadersEqual(request,
"x-ms-copy-source: https://identity.blob.core.windows.net/fromcontainer/fromblob\n" +
"x-ms-source-if-match: " + eTag + "\n" +
"x-ms-version: 2017-04-17\n");
"x-ms-version: 2017-11-09\n");
assertPayloadEquals(request, null, null, false);
}

@@ -489,7 +489,7 @@ public void testCopyBlobIfNoneMatch() throws Exception {
assertNonPayloadHeadersEqual(request,
"x-ms-copy-source: https://identity.blob.core.windows.net/fromcontainer/fromblob\n" +
"x-ms-source-if-none-match: " + eTag + "\n" +
"x-ms-version: 2017-04-17\n");
"x-ms-version: 2017-11-09\n");
assertPayloadEquals(request, null, null, false);
}

@@ -57,7 +57,7 @@ public void testSignGetBlob() throws ArrayIndexOutOfBoundsException, SecurityExc
NoSuchMethodException, IOException {
HttpRequest request = signer.signGetBlob("container", "name");

assertRequestLineEquals(request, "GET https://identity.blob.core.windows.net/container/name?sv=2017-04-17&se=2008-06-05T16%3A53%3A19Z&sr=b&sp=r&sig=HzCwPCszb39utrHpHKFK6eeZWHJVLcaIwJYXVUgJ%2BQo%3D HTTP/1.1");
assertRequestLineEquals(request, "GET https://identity.blob.core.windows.net/container/name?sv=2017-11-09&se=2008-06-05T16%3A53%3A19Z&sr=b&sp=r&sig=pE9fJqe8oVfYF4DoxcEE7R8p9kbzEkDvP/jot7QuyTo%3D HTTP/1.1");
assertNonPayloadHeadersEqual(request, "Date: Thu, 05 Jun 2008 16:38:19 GMT\n");
assertPayloadEquals(request, null, null, false);

@@ -68,7 +68,7 @@ public void testSignRemoveBlob() throws ArrayIndexOutOfBoundsException, Security
NoSuchMethodException, IOException {
HttpRequest request = signer.signRemoveBlob("container", "name");

assertRequestLineEquals(request, "DELETE https://identity.blob.core.windows.net/container/name?sv=2017-04-17&se=2008-06-05T16%3A53%3A19Z&sr=b&sp=d&sig=xyHwMhO1Dg2LoJH/VoXeLraAp1FBWjdfcc0y31LMKnY%3D HTTP/1.1");
assertRequestLineEquals(request, "DELETE https://identity.blob.core.windows.net/container/name?sv=2017-11-09&se=2008-06-05T16%3A53%3A19Z&sr=b&sp=d&sig=BWQi9JrAVgZgiElhBKEEF/%2BRqhUJFeheG8cDkSAGHX4%3D HTTP/1.1");
assertNonPayloadHeadersEqual(request, "Date: Thu, 05 Jun 2008 16:38:19 GMT\n");
assertPayloadEquals(request, null, null, false);

@@ -88,7 +88,7 @@ public void testSignPutBlob() throws ArrayIndexOutOfBoundsException, SecurityExc

HttpRequest request = signer.signPutBlob("container", blob);

assertRequestLineEquals(request, "PUT https://identity.blob.core.windows.net/container/name?sv=2017-04-17&se=2008-06-05T16%3A53%3A19Z&sr=b&sp=w&sig=blX/iud63gLIPVkDEeTYreIopqiVmHalxfrFFsHMJFc%3D HTTP/1.1");
assertRequestLineEquals(request, "PUT https://identity.blob.core.windows.net/container/name?sv=2017-11-09&se=2008-06-05T16%3A53%3A19Z&sr=b&sp=w&sig=NbnJbaUxRK/VPr5xZy75VCgAG7rpzut2IJEjXDSbT8k%3D HTTP/1.1");
assertNonPayloadHeadersEqual(
request,
"Content-Length: 2\n" +

0 comments on commit 519bee9

Please sign in to comment.