AzureBlob: Update API to 2017-11-09

This commit is contained in:
Timur Alperovich 2021-08-15 23:50:47 -07:00
parent a1df0bb1f5
commit 519bee9f60
4 changed files with 31 additions and 31 deletions

View File

@ -62,7 +62,7 @@ public class AzureBlobApiMetadata extends BaseHttpApiMetadata {
.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())

View File

@ -47,7 +47,7 @@ import com.google.inject.Provider;
@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;

View File

@ -79,7 +79,7 @@ public class AzureBlobClientTest extends BaseRestAnnotationProcessingTest<AzureB
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 class AzureBlobClientTest extends BaseRestAnnotationProcessingTest<AzureB
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 class AzureBlobClientTest extends BaseRestAnnotationProcessingTest<AzureB
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 class AzureBlobClientTest extends BaseRestAnnotationProcessingTest<AzureB
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 class AzureBlobClientTest extends BaseRestAnnotationProcessingTest<AzureB
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 class AzureBlobClientTest extends BaseRestAnnotationProcessingTest<AzureB
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 class AzureBlobClientTest extends BaseRestAnnotationProcessingTest<AzureB
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 class AzureBlobClientTest extends BaseRestAnnotationProcessingTest<AzureB
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 class AzureBlobClientTest extends BaseRestAnnotationProcessingTest<AzureB
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 class AzureBlobClientTest extends BaseRestAnnotationProcessingTest<AzureB
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 class AzureBlobClientTest extends BaseRestAnnotationProcessingTest<AzureB
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 class AzureBlobClientTest extends BaseRestAnnotationProcessingTest<AzureB
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 class AzureBlobClientTest extends BaseRestAnnotationProcessingTest<AzureB
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 @@ public class AzureBlobClientTest extends BaseRestAnnotationProcessingTest<AzureB
"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 class AzureBlobClientTest extends BaseRestAnnotationProcessingTest<AzureB
"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 class AzureBlobClientTest extends BaseRestAnnotationProcessingTest<AzureB
"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 class AzureBlobClientTest extends BaseRestAnnotationProcessingTest<AzureB
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 class AzureBlobClientTest extends BaseRestAnnotationProcessingTest<AzureB
"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 class AzureBlobClientTest extends BaseRestAnnotationProcessingTest<AzureB
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 class AzureBlobClientTest extends BaseRestAnnotationProcessingTest<AzureB
"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 class AzureBlobClientTest extends BaseRestAnnotationProcessingTest<AzureB
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 class AzureBlobClientTest extends BaseRestAnnotationProcessingTest<AzureB
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 class AzureBlobClientTest extends BaseRestAnnotationProcessingTest<AzureB
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 class AzureBlobClientTest extends BaseRestAnnotationProcessingTest<AzureB
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 class AzureBlobClientTest extends BaseRestAnnotationProcessingTest<AzureB
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 class AzureBlobClientTest extends BaseRestAnnotationProcessingTest<AzureB
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);
}

View File

@ -57,7 +57,7 @@ public class AzureBlobRequestSignerTest extends BaseRestAnnotationProcessingTest
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 class AzureBlobRequestSignerTest extends BaseRestAnnotationProcessingTest
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 class AzureBlobRequestSignerTest extends BaseRestAnnotationProcessingTest
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" +