Skip to content

Commit 5ff5fe3

Browse files
authored
add support for listing system containers when listing containers (#1362)
From the documentation: > -system: Version 2020-10-02 and later. Specifies if system containers are to be included in the response. Including this option will list system containers, such as $logs and $changefeed. Note that the specific system containers returned will vary, based on which service features are enabled on the storage account. ref: https://learn.microsoft.com/en-us/rest/api/storageservices/list-containers2?tabs=azure-ad
1 parent 4980dbd commit 5ff5fe3

File tree

105 files changed

+421
-410
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

105 files changed

+421
-410
lines changed

eng/scripts/emulator_tests.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ cd $(dirname ${BASH_SOURCE[0]})/../../
55

66
BUILD=${1:-stable}
77

8-
npm install azurite@3.13.1
8+
npm install azurite@3.26.0
99
npx azurite &
1010

1111
rustup update --no-self-update ${BUILD}

sdk/storage/src/clients.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ pub const EMULATOR_ACCOUNT: &str = "devstoreaccount1";
2222
pub const EMULATOR_ACCOUNT_KEY: &str =
2323
"Eby8vdM02xNOcqFlqUwJPLlmEtlCDXJ1OUzFT50uSRZ6IFsuFq2UVErCz4I6tq/K1SZFPTOtr/KBHBeksoGMGw==";
2424

25-
const AZURE_VERSION: HeaderValue = HeaderValue::from_static("2019-12-12");
25+
const AZURE_VERSION: HeaderValue = HeaderValue::from_static("2020-10-02");
2626

2727
#[derive(Debug, Clone, Copy)]
2828
pub enum ServiceType {

sdk/storage_blobs/src/service/operations/list_containers.rs

Lines changed: 17 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ pub struct ListContainersBuilder {
1515
prefix: Option<Prefix>,
1616
include_metadata: bool,
1717
include_deleted: bool,
18+
include_system: bool,
1819
max_results: Option<MaxResults>,
1920
context: Context,
2021
}
@@ -26,6 +27,7 @@ impl ListContainersBuilder {
2627
prefix: None,
2728
include_metadata: false,
2829
include_deleted: false,
30+
include_system: false,
2931
max_results: None,
3032
context: Context::new(),
3133
}
@@ -35,6 +37,7 @@ impl ListContainersBuilder {
3537
prefix: Prefix => Some(prefix),
3638
include_metadata: bool => include_metadata,
3739
include_deleted: bool => include_deleted,
40+
include_system: bool => include_system,
3841
max_results: MaxResults => Some(max_results),
3942
context: Context => context,
4043
}
@@ -54,13 +57,20 @@ impl ListContainersBuilder {
5457
next_marker.append_to_url_query(&mut url);
5558
}
5659

57-
if let Some(include) = match (this.include_metadata, this.include_deleted) {
58-
(true, true) => Some("metadata,deleted"),
59-
(true, false) => Some("metadata"),
60-
(false, true) => Some("deleted"),
61-
(false, false) => None,
62-
} {
63-
url.query_pairs_mut().append_pair("include", include);
60+
let mut to_include = vec![];
61+
62+
if this.include_metadata {
63+
to_include.push("metadata");
64+
}
65+
if this.include_deleted {
66+
to_include.push("deleted");
67+
}
68+
if this.include_system {
69+
to_include.push("system");
70+
}
71+
if !to_include.is_empty() {
72+
url.query_pairs_mut()
73+
.append_pair("include", &to_include.join(","));
6474
}
6575
this.max_results.append_to_url_query(&mut url);
6676

test/transactions/datalake_file_create_delete/0_request.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@
44
"headers": {
55
"authorization": "<<STRIPPED>>",
66
"content-length": "0",
7-
"user-agent": "azsdk-rust-storage_datalake/0.1.0 (1.58.0; linux; x86_64)",
8-
"x-ms-date": "Tue, 08 Feb 2022 19:19:33 GMT",
9-
"x-ms-version": "2019-12-12"
7+
"user-agent": "azsdk-rust-storage/0.14.0 (1.72.0; linux; x86_64)",
8+
"x-ms-date": "Thu, 07 Sep 2023 19:20:13 GMT",
9+
"x-ms-version": "2020-10-02"
1010
},
1111
"body": ""
1212
}

test/transactions/datalake_file_create_delete/0_response.json

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,13 @@
22
"status": 201,
33
"headers": {
44
"content-length": "0",
5-
"date": "Tue, 08 Feb 2022 19:19:34 GMT",
6-
"etag": "\"0x8D9EB37F12127AD\"",
7-
"last-modified": "Tue, 08 Feb 2022 19:19:35 GMT",
5+
"date": "Thu, 07 Sep 2023 19:20:13 GMT",
6+
"etag": "\"0x8DBAFD776AA95E2\"",
7+
"last-modified": "Thu, 07 Sep 2023 19:20:14 GMT",
88
"server": "Windows-Azure-HDFS/1.0 Microsoft-HTTPAPI/2.0",
99
"x-ms-namespace-enabled": "true",
10-
"x-ms-request-id": "c47a931d-801f-0017-7920-1d865a000000",
11-
"x-ms-version": "2019-12-12"
10+
"x-ms-request-id": "e1ea9c5d-501f-001c-0ac0-e1106d000000",
11+
"x-ms-version": "2020-10-02"
1212
},
1313
"body": ""
1414
}

test/transactions/datalake_file_create_delete/1_request.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@
44
"headers": {
55
"authorization": "<<STRIPPED>>",
66
"content-length": "0",
7-
"user-agent": "azsdk-rust-storage_datalake/0.1.0 (1.58.0; linux; x86_64)",
8-
"x-ms-date": "Tue, 08 Feb 2022 19:19:33 GMT",
9-
"x-ms-version": "2019-12-12"
7+
"user-agent": "azsdk-rust-storage/0.14.0 (1.72.0; linux; x86_64)",
8+
"x-ms-date": "Thu, 07 Sep 2023 19:20:13 GMT",
9+
"x-ms-version": "2020-10-02"
1010
},
1111
"body": ""
1212
}

test/transactions/datalake_file_create_delete/1_response.json

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,13 @@
22
"status": 201,
33
"headers": {
44
"content-length": "0",
5-
"date": "Tue, 08 Feb 2022 19:19:34 GMT",
6-
"etag": "\"0x8D9EB37F16507E0\"",
7-
"last-modified": "Tue, 08 Feb 2022 19:19:35 GMT",
5+
"date": "Thu, 07 Sep 2023 19:20:13 GMT",
6+
"etag": "\"0x8DBAFD776B883D6\"",
7+
"last-modified": "Thu, 07 Sep 2023 19:20:14 GMT",
88
"server": "Windows-Azure-HDFS/1.0 Microsoft-HTTPAPI/2.0",
9-
"x-ms-request-id": "c47a931e-801f-0017-7a20-1d865a000000",
9+
"x-ms-request-id": "e1ea9c60-501f-001c-0dc0-e1106d000000",
1010
"x-ms-request-server-encrypted": "true",
11-
"x-ms-version": "2019-12-12"
11+
"x-ms-version": "2020-10-02"
1212
},
1313
"body": ""
1414
}

test/transactions/datalake_file_create_delete/2_request.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,9 @@
55
"authorization": "<<STRIPPED>>",
66
"content-length": "0",
77
"if-none-match": "*",
8-
"user-agent": "azsdk-rust-storage_datalake/0.1.0 (1.58.0; linux; x86_64)",
9-
"x-ms-date": "Tue, 08 Feb 2022 19:19:34 GMT",
10-
"x-ms-version": "2019-12-12"
8+
"user-agent": "azsdk-rust-storage/0.14.0 (1.72.0; linux; x86_64)",
9+
"x-ms-date": "Thu, 07 Sep 2023 19:20:13 GMT",
10+
"x-ms-version": "2020-10-02"
1111
},
1212
"body": ""
1313
}

test/transactions/datalake_file_create_delete/2_response.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,11 @@
33
"headers": {
44
"content-length": "168",
55
"content-type": "application/json;charset=utf-8",
6-
"date": "Tue, 08 Feb 2022 19:19:34 GMT",
6+
"date": "Thu, 07 Sep 2023 19:20:13 GMT",
77
"server": "Windows-Azure-HDFS/1.0 Microsoft-HTTPAPI/2.0",
88
"x-ms-error-code": "PathAlreadyExists",
9-
"x-ms-request-id": "c47a931f-801f-0017-7b20-1d865a000000",
10-
"x-ms-version": "2019-12-12"
9+
"x-ms-request-id": "e1ea9c65-501f-001c-12c0-e1106d000000",
10+
"x-ms-version": "2020-10-02"
1111
},
12-
"body": "eyJlcnJvciI6eyJjb2RlIjoiUGF0aEFscmVhZHlFeGlzdHMiLCJtZXNzYWdlIjoiVGhlIHNwZWNpZmllZCBwYXRoIGFscmVhZHkgZXhpc3RzLlxuUmVxdWVzdElkOmM0N2E5MzFmLTgwMWYtMDAxNy03YjIwLTFkODY1YTAwMDAwMFxuVGltZToyMDIyLTAyLTA4VDE5OjE5OjM1Ljc4MzQxMDJaIn19"
12+
"body": "eyJlcnJvciI6eyJjb2RlIjoiUGF0aEFscmVhZHlFeGlzdHMiLCJtZXNzYWdlIjoiVGhlIHNwZWNpZmllZCBwYXRoIGFscmVhZHkgZXhpc3RzLlxuUmVxdWVzdElkOmUxZWE5YzY1LTUwMWYtMDAxYy0xMmMwLWUxMTA2ZDAwMDAwMFxuVGltZToyMDIzLTA5LTA3VDE5OjIwOjE0Ljc5OTY4OTdaIn19"
1313
}

test/transactions/datalake_file_create_delete/3_request.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@
44
"headers": {
55
"authorization": "<<STRIPPED>>",
66
"content-length": "0",
7-
"user-agent": "azsdk-rust-storage_datalake/0.1.0 (1.58.0; linux; x86_64)",
8-
"x-ms-date": "Tue, 08 Feb 2022 19:19:34 GMT",
9-
"x-ms-version": "2019-12-12"
7+
"user-agent": "azsdk-rust-storage/0.14.0 (1.72.0; linux; x86_64)",
8+
"x-ms-date": "Thu, 07 Sep 2023 19:20:13 GMT",
9+
"x-ms-version": "2020-10-02"
1010
},
1111
"body": ""
1212
}

0 commit comments

Comments
 (0)