Skip to content
Merged
Show file tree
Hide file tree
Changes from 7 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,6 @@ public String getVersion() {
* @return the latest {@link BlobServiceVersion}
*/
public static BlobServiceVersion getLatest() {
return V2020_08_04;
return V2020_10_02;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -926,8 +926,10 @@ class ContainerAPITest extends APISpec {
@RequiredServiceVersion(clazz = BlobServiceVersion.class, min = "V2020_10_02")
def "list blobs flat options deleted with versions"() {
setup:
def versionedCC = versionedBlobServiceClient.getBlobContainerClient(getContainerName())
versionedCC.create()
def blobName = generateBlobName()
def blob = cc.getBlobClient(blobName).getAppendBlobClient()
def blob = versionedCC.getBlobClient(blobName).getAppendBlobClient()
blob.create()
def metadata = new HashMap<String, String>()
metadata.put("foo", "bar")
Expand All @@ -937,13 +939,16 @@ class ContainerAPITest extends APISpec {
.setDetails(new BlobListDetails().setRetrieveDeletedBlobsWithVersions(true))

when:
def blobs = cc.listBlobs(options, null).iterator()
def blobs = versionedCC.listBlobs(options, null).iterator()

then:
def b = blobs.next()
!blobs.hasNext()
b.getName() == blobName
b.hasVersionsOnly()

cleanup:
versionedCC.delete()
}

def "List blobs prefix with comma"() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,10 +56,10 @@ class ImmutableStorageWithVersioningTest extends APISpec {

private BlobContainerClient vlwContainer;
private BlobClient vlwBlob
private String accountName = env.primaryAccount.name
private String accountName = env.versionedAccount.name
private String containerName
private String resourceGroupName = "XClient"
private String subscriptionId = "ba45b233-e2ef-4169-8808-49eb0d8eba0d"
private String resourceGroupName = env.resourceGroupName
private String subscriptionId = env.subscriptionId
private String apiVersion = "2021-04-01"
private TokenCredential credential = new EnvironmentCredentialBuilder().build()
private BearerTokenAuthenticationPolicy credentialPolicy = new BearerTokenAuthenticationPolicy(credential, "https://management.azure.com/.default")
Expand Down Expand Up @@ -89,12 +89,16 @@ class ImmutableStorageWithVersioningTest extends APISpec {

String serializedBody = new ObjectMapper().writeValueAsString(body)

httpPipeline.send(new HttpRequest(HttpMethod.PUT, new URL(url), new HttpHeaders(),
def response = httpPipeline.send(new HttpRequest(HttpMethod.PUT, new URL(url), new HttpHeaders(),
Flux.just(ByteBuffer.wrap(serializedBody.getBytes(StandardCharsets.UTF_8)))))
.block()
if (response.statusCode != 201) {
println response.getBodyAsString().block()
}
assert response.statusCode == 201
}

vlwContainer = primaryBlobServiceClient.getBlobContainerClient(containerName)
vlwContainer = versionedBlobServiceClient.getBlobContainerClient(containerName)
vlwBlob = vlwContainer.getBlobClient(generateBlobName())
vlwBlob.upload(new ByteArrayInputStream(new byte[0]), 0)
}
Expand Down Expand Up @@ -122,8 +126,8 @@ class ImmutableStorageWithVersioningTest extends APISpec {
.build()
def cleanupClient = new BlobServiceClientBuilder()
.httpClient(getHttpClient())
.credential(env.primaryAccount.credential)
.endpoint(env.primaryAccount.blobEndpoint)
.credential(env.versionedAccount.credential)
.endpoint(env.versionedAccount.blobEndpoint)
.buildClient()

def options = new ListBlobContainersOptions().setPrefix(namer.getResourcePrefix())
Expand Down Expand Up @@ -617,7 +621,7 @@ class ImmutableStorageWithVersioningTest extends APISpec {
def immutabilityPolicy = new BlobImmutabilityPolicy()
.setExpiryTime(expiryTime)
.setPolicyMode(BlobImmutabilityPolicyMode.UNLOCKED)
def sas = primaryBlobServiceClient.generateAccountSas(sasValues)
def sas = versionedBlobServiceClient.generateAccountSas(sasValues)
def client = getBlobClient(sas, vlwContainer.getBlobContainerUrl(), vlwBlob.getBlobName())

when:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,78 +1,99 @@
{
"networkCallRecords" : [ {
"Method" : "PUT",
"Uri" : "https://REDACTED.blob.core.windows.net/8295186e08295186e76780860dbc07e929472486d90d?restype=container",
"Uri" : "https://REDACTED.blob.core.windows.net/8295186e08295186e35586414d243db9c211544dea23?restype=container",
"Headers" : {
"x-ms-version" : "2020-10-02",
"User-Agent" : "azsdk-java-azure-storage-blob/12.12.0-beta.2 (11.0.7; Windows 10; 10.0)",
"x-ms-client-request-id" : "230a2772-1c69-4408-9f21-2424e9a84d78"
"User-Agent" : "azsdk-java-azure-storage-blob/12.13.0-beta.1 (11; Windows 10; 10.0)",
"x-ms-client-request-id" : "307abd84-9a14-40eb-b962-2e369b7ee5cc"
},
"Response" : {
"content-length" : "0",
"x-ms-version" : "2020-10-02",
"Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0",
"eTag" : "0x8D9252E3D6FD9CB",
"Last-Modified" : "Tue, 01 Jun 2021 18:51:17 GMT",
"eTag" : "0x8D94D5D684D8629",
"Last-Modified" : "Thu, 22 Jul 2021 22:09:42 GMT",
"retry-after" : "0",
"StatusCode" : "201",
"x-ms-request-id" : "6d10ded9-c01e-0014-6917-5792ad000000",
"x-ms-client-request-id" : "230a2772-1c69-4408-9f21-2424e9a84d78",
"Date" : "Tue, 01 Jun 2021 18:51:17 GMT"
"x-ms-request-id" : "0eb1676e-401e-0005-0546-7f186a000000",
"x-ms-client-request-id" : "307abd84-9a14-40eb-b962-2e369b7ee5cc",
"Date" : "Thu, 22 Jul 2021 22:09:41 GMT"
},
"Exception" : null
}, {
"Method" : "PUT",
"Uri" : "https://REDACTED.blob.core.windows.net/8295186e08295186e76780860dbc07e929472486d90d/8295186e18295186e767817414aac029851164b3b9b8",
"Uri" : "https://REDACTED.blob.core.windows.net/8295186e08295186e35586414d243db9c211544dea23?restype=container",
"Headers" : {
"x-ms-version" : "2020-10-02",
"User-Agent" : "azsdk-java-azure-storage-blob/12.12.0-beta.2 (11.0.7; Windows 10; 10.0)",
"x-ms-client-request-id" : "4c66d24b-834b-4a3f-845f-996c3121ba78"
"User-Agent" : "azsdk-java-azure-storage-blob/12.13.0-beta.1 (11; Windows 10; 10.0)",
"x-ms-client-request-id" : "a6edab9a-a23e-4f5d-9e7d-6be8e8db0ae2"
},
"Response" : {
"content-length" : "0",
"x-ms-version" : "2020-10-02",
"Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0",
"eTag" : "0x8D9252E3DB29E26",
"Last-Modified" : "Tue, 01 Jun 2021 18:51:18 GMT",
"x-ms-version-id" : "2021-06-01T18:51:18.3475238Z",
"eTag" : "0x8D94D5D689E677E",
"Last-Modified" : "Thu, 22 Jul 2021 22:09:43 GMT",
"retry-after" : "0",
"StatusCode" : "201",
"x-ms-request-id" : "6d10dfab-c01e-0014-5c17-5792ad000000",
"x-ms-request-id" : "00e458a6-e01e-003b-7446-7f3a16000000",
"x-ms-client-request-id" : "a6edab9a-a23e-4f5d-9e7d-6be8e8db0ae2",
"Date" : "Thu, 22 Jul 2021 22:09:42 GMT"
},
"Exception" : null
}, {
"Method" : "PUT",
"Uri" : "https://REDACTED.blob.core.windows.net/8295186e08295186e35586414d243db9c211544dea23/8295186e18295186e35546888feef37328cac4f43b8b",
"Headers" : {
"x-ms-version" : "2020-10-02",
"User-Agent" : "azsdk-java-azure-storage-blob/12.13.0-beta.1 (11; Windows 10; 10.0)",
"x-ms-client-request-id" : "4b0c9ed0-9c58-4c12-a3e7-0a9b51d8702c"
},
"Response" : {
"content-length" : "0",
"x-ms-version" : "2020-10-02",
"Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0",
"eTag" : "0x8D94D5D68B90FD3",
"Last-Modified" : "Thu, 22 Jul 2021 22:09:43 GMT",
"x-ms-version-id" : "2021-07-22T22:09:43.3891795Z",
"retry-after" : "0",
"StatusCode" : "201",
"x-ms-request-id" : "00e4590a-e01e-003b-4446-7f3a16000000",
"x-ms-request-server-encrypted" : "true",
"x-ms-client-request-id" : "4c66d24b-834b-4a3f-845f-996c3121ba78",
"Date" : "Tue, 01 Jun 2021 18:51:18 GMT"
"x-ms-client-request-id" : "4b0c9ed0-9c58-4c12-a3e7-0a9b51d8702c",
"Date" : "Thu, 22 Jul 2021 22:09:42 GMT"
},
"Exception" : null
}, {
"Method" : "PUT",
"Uri" : "https://REDACTED.blob.core.windows.net/8295186e08295186e76780860dbc07e929472486d90d/8295186e18295186e767817414aac029851164b3b9b8?comp=metadata",
"Uri" : "https://REDACTED.blob.core.windows.net/8295186e08295186e35586414d243db9c211544dea23/8295186e18295186e35546888feef37328cac4f43b8b?comp=metadata",
"Headers" : {
"x-ms-version" : "2020-10-02",
"User-Agent" : "azsdk-java-azure-storage-blob/12.12.0-beta.2 (11.0.7; Windows 10; 10.0)",
"x-ms-client-request-id" : "eb48934a-df4c-47bf-90c5-945199f73eb1"
"User-Agent" : "azsdk-java-azure-storage-blob/12.13.0-beta.1 (11; Windows 10; 10.0)",
"x-ms-client-request-id" : "0cda4997-f75c-425c-8f52-0093f9838e63"
},
"Response" : {
"content-length" : "0",
"x-ms-version" : "2020-10-02",
"Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0",
"eTag" : "0x8D9252E3DCCBA9B",
"Last-Modified" : "Tue, 01 Jun 2021 18:51:18 GMT",
"x-ms-version-id" : "2021-06-01T18:51:18.5196459Z",
"eTag" : "0x8D94D5D68CB3B86",
"Last-Modified" : "Thu, 22 Jul 2021 22:09:43 GMT",
"x-ms-version-id" : "2021-07-22T22:09:43.5102635Z",
"retry-after" : "0",
"StatusCode" : "200",
"x-ms-request-id" : "6d10dfdc-c01e-0014-7c17-5792ad000000",
"x-ms-request-id" : "00e4594a-e01e-003b-0246-7f3a16000000",
"x-ms-request-server-encrypted" : "true",
"x-ms-client-request-id" : "eb48934a-df4c-47bf-90c5-945199f73eb1",
"Date" : "Tue, 01 Jun 2021 18:51:18 GMT"
"x-ms-client-request-id" : "0cda4997-f75c-425c-8f52-0093f9838e63",
"Date" : "Thu, 22 Jul 2021 22:09:43 GMT"
},
"Exception" : null
}, {
"Method" : "DELETE",
"Uri" : "https://REDACTED.blob.core.windows.net/8295186e08295186e76780860dbc07e929472486d90d/8295186e18295186e767817414aac029851164b3b9b8",
"Uri" : "https://REDACTED.blob.core.windows.net/8295186e08295186e35586414d243db9c211544dea23/8295186e18295186e35546888feef37328cac4f43b8b",
"Headers" : {
"x-ms-version" : "2020-10-02",
"User-Agent" : "azsdk-java-azure-storage-blob/12.12.0-beta.2 (11.0.7; Windows 10; 10.0)",
"x-ms-client-request-id" : "6d85a718-b07e-4d6e-ac99-3b622bdf53b3"
"User-Agent" : "azsdk-java-azure-storage-blob/12.13.0-beta.1 (11; Windows 10; 10.0)",
"x-ms-client-request-id" : "ef824596-665f-4f34-8cd0-b3986906a74d"
},
"Response" : {
"content-length" : "0",
Expand All @@ -81,32 +102,51 @@
"x-ms-delete-type-permanent" : "false",
"retry-after" : "0",
"StatusCode" : "202",
"x-ms-request-id" : "6d10e00a-c01e-0014-1317-5792ad000000",
"x-ms-client-request-id" : "6d85a718-b07e-4d6e-ac99-3b622bdf53b3",
"Date" : "Tue, 01 Jun 2021 18:51:18 GMT"
"x-ms-request-id" : "00e4597e-e01e-003b-3246-7f3a16000000",
"x-ms-client-request-id" : "ef824596-665f-4f34-8cd0-b3986906a74d",
"Date" : "Thu, 22 Jul 2021 22:09:43 GMT"
},
"Exception" : null
}, {
"Method" : "GET",
"Uri" : "https://REDACTED.blob.core.windows.net/8295186e08295186e76780860dbc07e929472486d90d?restype=container&comp=list&prefix=8295186e18295186e767817414aac029851164b3b9b8&include=deletedwithversions",
"Uri" : "https://REDACTED.blob.core.windows.net/8295186e08295186e35586414d243db9c211544dea23?restype=container&comp=list&prefix=8295186e18295186e35546888feef37328cac4f43b8b&include=deletedwithversions",
"Headers" : {
"x-ms-version" : "2020-10-02",
"User-Agent" : "azsdk-java-azure-storage-blob/12.12.0-beta.2 (11.0.7; Windows 10; 10.0)",
"x-ms-client-request-id" : "7bf450cd-e0d3-45a1-b672-6e34f25fa9d2"
"User-Agent" : "azsdk-java-azure-storage-blob/12.13.0-beta.1 (11; Windows 10; 10.0)",
"x-ms-client-request-id" : "f788ae17-59ad-4a26-a189-8d77482c97e4"
},
"Response" : {
"Transfer-Encoding" : "chunked",
"x-ms-version" : "2020-10-02",
"Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0",
"retry-after" : "0",
"StatusCode" : "200",
"x-ms-request-id" : "6d10e03a-c01e-0014-2a17-5792ad000000",
"Body" : "<?xml version=\"1.0\" encoding=\"utf-8\"?><EnumerationResults ServiceEndpoint=\"https://seanmcccanary3.blob.core.windows.net/\" ContainerName=\"8295186e08295186e76780860dbc07e929472486d90d\"><Prefix>8295186e18295186e767817414aac029851164b3b9b8</Prefix><Blobs><Blob><Name>8295186e18295186e767817414aac029851164b3b9b8</Name><HasVersionsOnly>true</HasVersionsOnly><Properties><Creation-Time>Tue, 01 Jun 2021 18:51:18 GMT</Creation-Time><Last-Modified>Tue, 01 Jun 2021 18:51:18 GMT</Last-Modified><Etag>0x8D9252E3DCCBA9B</Etag><Content-Length>0</Content-Length><Content-Type>application/octet-stream</Content-Type><Content-Encoding /><Content-Language /><Content-CRC64 /><Content-MD5 /><Cache-Control /><Content-Disposition /><BlobType>AppendBlob</BlobType><LeaseStatus>unlocked</LeaseStatus><LeaseState>available</LeaseState><ServerEncrypted>true</ServerEncrypted></Properties><OrMetadata /></Blob></Blobs><NextMarker /></EnumerationResults>",
"x-ms-client-request-id" : "7bf450cd-e0d3-45a1-b672-6e34f25fa9d2",
"Date" : "Tue, 01 Jun 2021 18:51:18 GMT",
"x-ms-request-id" : "00e459b3-e01e-003b-5e46-7f3a16000000",
"Body" : "<?xml version=\"1.0\" encoding=\"utf-8\"?><EnumerationResults ServiceEndpoint=\"https://kasoboljavaversioned.blob.core.windows.net/\" ContainerName=\"8295186e08295186e35586414d243db9c211544dea23\"><Prefix>8295186e18295186e35546888feef37328cac4f43b8b</Prefix><Blobs><Blob><Name>8295186e18295186e35546888feef37328cac4f43b8b</Name><HasVersionsOnly>true</HasVersionsOnly><Properties><Creation-Time>Thu, 22 Jul 2021 22:09:43 GMT</Creation-Time><Last-Modified>Thu, 22 Jul 2021 22:09:43 GMT</Last-Modified><Etag>0x8D94D5D68CB3B86</Etag><Content-Length>0</Content-Length><Content-Type>application/octet-stream</Content-Type><Content-Encoding /><Content-Language /><Content-CRC64 /><Content-MD5 /><Cache-Control /><Content-Disposition /><BlobType>AppendBlob</BlobType><LeaseStatus>unlocked</LeaseStatus><LeaseState>available</LeaseState><ServerEncrypted>true</ServerEncrypted></Properties><OrMetadata /></Blob></Blobs><NextMarker /></EnumerationResults>",
"x-ms-client-request-id" : "f788ae17-59ad-4a26-a189-8d77482c97e4",
"Date" : "Thu, 22 Jul 2021 22:09:43 GMT",
"Content-Type" : "application/xml"
},
"Exception" : null
}, {
"Method" : "DELETE",
"Uri" : "https://REDACTED.blob.core.windows.net/8295186e08295186e35586414d243db9c211544dea23?restype=container",
"Headers" : {
"x-ms-version" : "2020-10-02",
"User-Agent" : "azsdk-java-azure-storage-blob/12.13.0-beta.1 (11; Windows 10; 10.0)",
"x-ms-client-request-id" : "fe5ab77e-199b-4a0f-a70b-e3d11ca67fe4"
},
"Response" : {
"content-length" : "0",
"x-ms-version" : "2020-10-02",
"Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0",
"retry-after" : "0",
"StatusCode" : "202",
"x-ms-request-id" : "00e45a03-e01e-003b-2646-7f3a16000000",
"x-ms-client-request-id" : "fe5ab77e-199b-4a0f-a70b-e3d11ca67fe4",
"Date" : "Thu, 22 Jul 2021 22:09:43 GMT"
},
"Exception" : null
} ],
"variables" : [ "8295186e08295186e76780860dbc07e929472486d90d", "8295186e08295186e76780860dbc07e929472486d111", "8295186e08295186e76780860dbc07e929472486d112", "8295186e18295186e767817414aac029851164b3b9b8" ]
"variables" : [ "8295186e08295186e35586414d243db9c211544dea23", "8295186e66996a11", "8295186e01308ffb", "8295186e18295186e35546888feef37328cac4f43b8b" ]
}
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ public final class Constants {
public static final String PROPERTY_AZURE_STORAGE_SAS_SERVICE_VERSION = "AZURE_STORAGE_SAS_SERVICE_VERSION";

public static final String SAS_SERVICE_VERSION = Configuration.getGlobalConfiguration()
.get(PROPERTY_AZURE_STORAGE_SAS_SERVICE_VERSION, "2020-08-04");
.get(PROPERTY_AZURE_STORAGE_SAS_SERVICE_VERSION, "2020-10-02");

private Constants() {
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,9 @@ public final class TestEnvironment {
private final TestMode testMode;
private final String serviceVersion;

private final String resourceGroupName;
private final String subscriptionId;

private final TestAccount primaryAccount;
private final TestAccount secondaryAccount;
private final TestAccount managedDiskAccount;
Expand All @@ -30,6 +33,8 @@ public final class TestEnvironment {
private TestEnvironment() {
this.testMode = readTestModeFromEnvironment();
this.serviceVersion = readServiceVersionFromEnvironment();
this.resourceGroupName = Configuration.getGlobalConfiguration().get("STORAGE_RESOURCE_GROUP_NAME");
this.subscriptionId = Configuration.getGlobalConfiguration().get("STORAGE_SUBSCRIPTION_ID");
this.primaryAccount = readTestAccountFromEnvironment("PRIMARY_STORAGE_", this.testMode);
this.secondaryAccount = readTestAccountFromEnvironment("SECONDARY_STORAGE_", this.testMode);
this.managedDiskAccount = readTestAccountFromEnvironment("MANAGED_DISK_STORAGE_", this.testMode);
Expand Down Expand Up @@ -143,4 +148,12 @@ public TestAccount getDataLakeSoftDeleteAccount() {
public String getServiceVersion() {
return serviceVersion;
}

public String getResourceGroupName() {
return resourceGroupName;
}

public String getSubscriptionId() {
return subscriptionId;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,6 @@ public String getVersion() {
* @return the latest {@link DataLakeServiceVersion}
*/
public static DataLakeServiceVersion getLatest() {
return V2020_08_04;
return V2020_10_02;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,6 @@ public String getVersion() {
* @return the latest {@link ShareServiceVersion}
*/
public static ShareServiceVersion getLatest() {
return V2020_08_04;
return V2020_10_02;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,6 @@ public String getVersion() {
* @return the latest {@link QueueServiceVersion}
*/
public static QueueServiceVersion getLatest() {
return V2020_08_04;
return V2020_10_02;
}
}
12 changes: 11 additions & 1 deletion sdk/storage/test-resources.json
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,9 @@
"premiumFileAccountName": "[concat('premf', parameters('baseName'))]",
"keyvaultName": "[concat(parameters('baseName'), 'kvlt')]",
"azureKeyVaultUrl": "[format('https://{0}.vault.azure.net', variables('keyvaultName'))]",
"location": "[resourceGroup().location]"
"location": "[resourceGroup().location]",
"resourceGroupName": "[resourceGroup().name]",
"subscriptionId": "[subscription().subscriptionId]"
},
"resources": [
{
Expand Down Expand Up @@ -616,6 +618,14 @@
"KEYVAULT_URL":{
"type": "string",
"value": "[variables('azureKeyVaultUrl')]"
},
"STORAGE_RESOURCE_GROUP_NAME": {
"type": "string",
"value": "[variables('resourceGroupName')]"
},
"STORAGE_SUBSCRIPTION_ID": {
"type": "string",
"value": "[variables('subscriptionId')]"
}
}
}