From 9b9fe1eb877fd16467d2aacf071b4a7aea03ec2b Mon Sep 17 00:00:00 2001 From: seankane-msft Date: Tue, 20 Jul 2021 12:04:44 -0400 Subject: [PATCH 1/5] adding List methods --- .../TestListTables-variables.yaml | 5 + .../TestListTables.yaml | 557 ++++++++++++++ .../TestListTables-variables.yaml | 5 + .../TestListTables.yaml | 713 ++++++++++++++++++ .../TestListEntities-variables.yaml | 5 + .../TestListEntities.yaml | 305 ++++++++ .../TestListEntities-variables.yaml | 5 + .../TestListEntities.yaml | 389 ++++++++++ sdk/tables/aztable/table_client.go | 27 +- sdk/tables/aztable/table_client_test.go | 38 + sdk/tables/aztable/table_service_client.go | 13 +- .../aztable/table_service_client_test.go | 41 + 12 files changed, 2099 insertions(+), 4 deletions(-) create mode 100644 sdk/tables/aztable/recordings/TestServiceClient_Cosmos/TestListTables-variables.yaml create mode 100644 sdk/tables/aztable/recordings/TestServiceClient_Cosmos/TestListTables.yaml create mode 100644 sdk/tables/aztable/recordings/TestServiceClient_Storage/TestListTables-variables.yaml create mode 100644 sdk/tables/aztable/recordings/TestServiceClient_Storage/TestListTables.yaml create mode 100644 sdk/tables/aztable/recordings/TestTableClient_Cosmos/TestListEntities-variables.yaml create mode 100644 sdk/tables/aztable/recordings/TestTableClient_Cosmos/TestListEntities.yaml create mode 100644 sdk/tables/aztable/recordings/TestTableClient_Storage/TestListEntities-variables.yaml create mode 100644 sdk/tables/aztable/recordings/TestTableClient_Storage/TestListEntities.yaml diff --git a/sdk/tables/aztable/recordings/TestServiceClient_Cosmos/TestListTables-variables.yaml b/sdk/tables/aztable/recordings/TestServiceClient_Cosmos/TestListTables-variables.yaml new file mode 100644 index 000000000000..c6777751d235 --- /dev/null +++ b/sdk/tables/aztable/recordings/TestServiceClient_Cosmos/TestListTables-variables.yaml @@ -0,0 +1,5 @@ +--- +COSMOS_TABLES_ENDPOINT_SUFFIX: cosmos.azure.com +TABLES_COSMOS_ACCOUNT_NAME: seankaneprim +TABLES_PRIMARY_COSMOS_ACCOUNT_KEY: Kg== +randomSeed: "1626796896" diff --git a/sdk/tables/aztable/recordings/TestServiceClient_Cosmos/TestListTables.yaml b/sdk/tables/aztable/recordings/TestServiceClient_Cosmos/TestListTables.yaml new file mode 100644 index 000000000000..ba3f4296d831 --- /dev/null +++ b/sdk/tables/aztable/recordings/TestServiceClient_Cosmos/TestListTables.yaml @@ -0,0 +1,557 @@ +--- +version: 1 +interactions: +- request: + body: "" + form: {} + headers: + Accept: + - application/json;odata=minimalmetadata + Authorization: + - sanitized + Dataserviceversion: + - "3.0" + User-Agent: + - azsdk-go-aztable/ azsdk-go-aztable/ azcore/v0.16.2 (go1.16.5; + Windows_NT) + X-Ms-Date: + - Tue, 20 Jul 2021 16:01:36 GMT + X-Ms-Version: + - "2019-02-02" + url: https://seankaneprim.table.cosmos.azure.com/Tables + method: GET + response: + body: '{"value":[{"TableName":"gotable5jq3v0tq94aql4"},{"TableName":"gotableq7wc90zjsaq4o4"},{"TableName":"gotable5jq3v0tq94aql0"},{"TableName":"gotable5jq3v0tq94aql3"},{"TableName":"gotable5jq3v0tq94aql2"},{"TableName":"gotableq7wc90zjsaq4o3"},{"TableName":"gotablel4p8jpfnr5wfc"},{"TableName":"gotableq7wc90zjsaq4o2"},{"TableName":"gotable5jq3v0tq94aql1"},{"TableName":"gotableq7wc90zjsaq4o1"},{"TableName":"gotableq7wc90zjsaq4o0"}],"odata.metadata":"https://seankaneprim.table.cosmos.azure.com/$metadata#Tables"}' + headers: + Content-Type: + - application/json;odata=minimalmetadata + Date: + - Tue, 20 Jul 2021 16:01:36 GMT + X-Ms-Request-Id: + - d1a623e2-60a3-4471-bbdd-c9177dd251b8 + status: 200 OK + code: 200 + duration: "" +- request: + body: "" + form: {} + headers: + Accept: + - application/json + Authorization: + - sanitized + User-Agent: + - azsdk-go-aztable/ azsdk-go-aztable/ azcore/v0.16.2 (go1.16.5; + Windows_NT) + X-Ms-Date: + - Tue, 20 Jul 2021 16:01:36 GMT + X-Ms-Version: + - "2019-02-02" + url: https://seankaneprim.table.cosmos.azure.com/Tables('gotable5jq3v0tq94aql4') + method: DELETE + response: + body: "" + headers: + Date: + - Tue, 20 Jul 2021 16:01:36 GMT + X-Ms-Request-Id: + - c831b329-33a4-422d-bcb2-f521a44e73cd + status: 204 No Content + code: 204 + duration: "" +- request: + body: "" + form: {} + headers: + Accept: + - application/json + Authorization: + - sanitized + User-Agent: + - azsdk-go-aztable/ azsdk-go-aztable/ azcore/v0.16.2 (go1.16.5; + Windows_NT) + X-Ms-Date: + - Tue, 20 Jul 2021 16:01:37 GMT + X-Ms-Version: + - "2019-02-02" + url: https://seankaneprim.table.cosmos.azure.com/Tables('gotableq7wc90zjsaq4o4') + method: DELETE + response: + body: "" + headers: + Date: + - Tue, 20 Jul 2021 16:01:37 GMT + X-Ms-Request-Id: + - ec89c3e4-62c9-4298-87ff-e764077fc45e + status: 204 No Content + code: 204 + duration: "" +- request: + body: "" + form: {} + headers: + Accept: + - application/json + Authorization: + - sanitized + User-Agent: + - azsdk-go-aztable/ azsdk-go-aztable/ azcore/v0.16.2 (go1.16.5; + Windows_NT) + X-Ms-Date: + - Tue, 20 Jul 2021 16:01:37 GMT + X-Ms-Version: + - "2019-02-02" + url: https://seankaneprim.table.cosmos.azure.com/Tables('gotable5jq3v0tq94aql0') + method: DELETE + response: + body: "" + headers: + Date: + - Tue, 20 Jul 2021 16:01:37 GMT + X-Ms-Request-Id: + - 3870142d-c5ec-417d-ba17-46a852cac90c + status: 204 No Content + code: 204 + duration: "" +- request: + body: "" + form: {} + headers: + Accept: + - application/json + Authorization: + - sanitized + User-Agent: + - azsdk-go-aztable/ azsdk-go-aztable/ azcore/v0.16.2 (go1.16.5; + Windows_NT) + X-Ms-Date: + - Tue, 20 Jul 2021 16:01:38 GMT + X-Ms-Version: + - "2019-02-02" + url: https://seankaneprim.table.cosmos.azure.com/Tables('gotable5jq3v0tq94aql3') + method: DELETE + response: + body: "" + headers: + Date: + - Tue, 20 Jul 2021 16:01:37 GMT + X-Ms-Request-Id: + - 5e74aa0a-336a-4f5f-9ce5-314b3423dc47 + status: 204 No Content + code: 204 + duration: "" +- request: + body: "" + form: {} + headers: + Accept: + - application/json + Authorization: + - sanitized + User-Agent: + - azsdk-go-aztable/ azsdk-go-aztable/ azcore/v0.16.2 (go1.16.5; + Windows_NT) + X-Ms-Date: + - Tue, 20 Jul 2021 16:01:38 GMT + X-Ms-Version: + - "2019-02-02" + url: https://seankaneprim.table.cosmos.azure.com/Tables('gotable5jq3v0tq94aql2') + method: DELETE + response: + body: "" + headers: + Date: + - Tue, 20 Jul 2021 16:01:38 GMT + X-Ms-Request-Id: + - e72a9553-2139-4d23-8587-0597293e230d + status: 204 No Content + code: 204 + duration: "" +- request: + body: "" + form: {} + headers: + Accept: + - application/json + Authorization: + - sanitized + User-Agent: + - azsdk-go-aztable/ azsdk-go-aztable/ azcore/v0.16.2 (go1.16.5; + Windows_NT) + X-Ms-Date: + - Tue, 20 Jul 2021 16:01:38 GMT + X-Ms-Version: + - "2019-02-02" + url: https://seankaneprim.table.cosmos.azure.com/Tables('gotableq7wc90zjsaq4o3') + method: DELETE + response: + body: "" + headers: + Date: + - Tue, 20 Jul 2021 16:01:38 GMT + X-Ms-Request-Id: + - 2b2ac4dd-95d3-479f-b43c-dbbe95e24a35 + status: 204 No Content + code: 204 + duration: "" +- request: + body: "" + form: {} + headers: + Accept: + - application/json + Authorization: + - sanitized + User-Agent: + - azsdk-go-aztable/ azsdk-go-aztable/ azcore/v0.16.2 (go1.16.5; + Windows_NT) + X-Ms-Date: + - Tue, 20 Jul 2021 16:01:39 GMT + X-Ms-Version: + - "2019-02-02" + url: https://seankaneprim.table.cosmos.azure.com/Tables('gotablel4p8jpfnr5wfc') + method: DELETE + response: + body: "" + headers: + Date: + - Tue, 20 Jul 2021 16:01:39 GMT + X-Ms-Request-Id: + - 506ecd01-1315-4fdb-87c3-9565da3a8d35 + status: 204 No Content + code: 204 + duration: "" +- request: + body: "" + form: {} + headers: + Accept: + - application/json + Authorization: + - sanitized + User-Agent: + - azsdk-go-aztable/ azsdk-go-aztable/ azcore/v0.16.2 (go1.16.5; + Windows_NT) + X-Ms-Date: + - Tue, 20 Jul 2021 16:01:39 GMT + X-Ms-Version: + - "2019-02-02" + url: https://seankaneprim.table.cosmos.azure.com/Tables('gotableq7wc90zjsaq4o2') + method: DELETE + response: + body: "" + headers: + Date: + - Tue, 20 Jul 2021 16:01:39 GMT + X-Ms-Request-Id: + - de18a430-15e8-44b8-8102-b22c1ad23e31 + status: 204 No Content + code: 204 + duration: "" +- request: + body: "" + form: {} + headers: + Accept: + - application/json + Authorization: + - sanitized + User-Agent: + - azsdk-go-aztable/ azsdk-go-aztable/ azcore/v0.16.2 (go1.16.5; + Windows_NT) + X-Ms-Date: + - Tue, 20 Jul 2021 16:01:39 GMT + X-Ms-Version: + - "2019-02-02" + url: https://seankaneprim.table.cosmos.azure.com/Tables('gotable5jq3v0tq94aql1') + method: DELETE + response: + body: "" + headers: + Date: + - Tue, 20 Jul 2021 16:01:39 GMT + X-Ms-Request-Id: + - ad3e784e-5fe6-48bd-8281-107fab2d16b4 + status: 204 No Content + code: 204 + duration: "" +- request: + body: "" + form: {} + headers: + Accept: + - application/json + Authorization: + - sanitized + User-Agent: + - azsdk-go-aztable/ azsdk-go-aztable/ azcore/v0.16.2 (go1.16.5; + Windows_NT) + X-Ms-Date: + - Tue, 20 Jul 2021 16:01:40 GMT + X-Ms-Version: + - "2019-02-02" + url: https://seankaneprim.table.cosmos.azure.com/Tables('gotableq7wc90zjsaq4o1') + method: DELETE + response: + body: "" + headers: + Date: + - Tue, 20 Jul 2021 16:01:40 GMT + X-Ms-Request-Id: + - c6c69d9b-a4a5-469f-94d5-fa0dbbc7ed30 + status: 204 No Content + code: 204 + duration: "" +- request: + body: "" + form: {} + headers: + Accept: + - application/json + Authorization: + - sanitized + User-Agent: + - azsdk-go-aztable/ azsdk-go-aztable/ azcore/v0.16.2 (go1.16.5; + Windows_NT) + X-Ms-Date: + - Tue, 20 Jul 2021 16:01:40 GMT + X-Ms-Version: + - "2019-02-02" + url: https://seankaneprim.table.cosmos.azure.com/Tables('gotableq7wc90zjsaq4o0') + method: DELETE + response: + body: "" + headers: + Date: + - Tue, 20 Jul 2021 16:01:40 GMT + X-Ms-Request-Id: + - 4e3c0641-f714-49c9-9a24-f9f22df2afa5 + status: 204 No Content + code: 204 + duration: "" +- request: + body: '{"TableName":"gotabled7f5qwr5hskdg0"}' + form: {} + headers: + Accept: + - application/json;odata=minimalmetadata + Authorization: + - sanitized + Content-Length: + - "37" + Content-Type: + - application/json + Dataserviceversion: + - "3.0" + User-Agent: + - azsdk-go-aztable/ azsdk-go-aztable/ azcore/v0.16.2 (go1.16.5; + Windows_NT) + X-Ms-Date: + - Tue, 20 Jul 2021 16:01:41 GMT + X-Ms-Version: + - "2019-02-02" + url: https://seankaneprim.table.cosmos.azure.com/Tables + method: POST + response: + body: '{"TableName":"gotabled7f5qwr5hskdg0","odata.metadata":"https://seankaneprim.table.cosmos.azure.com/$metadata#Tables/@Element"}' + headers: + Content-Type: + - application/json;odata=minimalmetadata + Date: + - Tue, 20 Jul 2021 16:01:41 GMT + Etag: + - W/"datetime'2021-07-20T16%3A01%3A41.6731656Z'" + Location: + - https://seankaneprim.table.cosmos.azure.com/Tables('gotabled7f5qwr5hskdg0') + X-Ms-Request-Id: + - df88e6cf-9bd6-4115-8177-b6aaaf2262e1 + status: 201 Created + code: 201 + duration: "" +- request: + body: '{"TableName":"gotabled7f5qwr5hskdg1"}' + form: {} + headers: + Accept: + - application/json;odata=minimalmetadata + Authorization: + - sanitized + Content-Length: + - "37" + Content-Type: + - application/json + Dataserviceversion: + - "3.0" + User-Agent: + - azsdk-go-aztable/ azsdk-go-aztable/ azcore/v0.16.2 (go1.16.5; + Windows_NT) + X-Ms-Date: + - Tue, 20 Jul 2021 16:01:42 GMT + X-Ms-Version: + - "2019-02-02" + url: https://seankaneprim.table.cosmos.azure.com/Tables + method: POST + response: + body: '{"TableName":"gotabled7f5qwr5hskdg1","odata.metadata":"https://seankaneprim.table.cosmos.azure.com/$metadata#Tables/@Element"}' + headers: + Content-Type: + - application/json;odata=minimalmetadata + Date: + - Tue, 20 Jul 2021 16:01:42 GMT + Etag: + - W/"datetime'2021-07-20T16%3A01%3A42.5668104Z'" + Location: + - https://seankaneprim.table.cosmos.azure.com/Tables('gotabled7f5qwr5hskdg1') + X-Ms-Request-Id: + - 26d147ca-dc5f-4475-aafb-08091ce29e69 + status: 201 Created + code: 201 + duration: "" +- request: + body: '{"TableName":"gotabled7f5qwr5hskdg2"}' + form: {} + headers: + Accept: + - application/json;odata=minimalmetadata + Authorization: + - sanitized + Content-Length: + - "37" + Content-Type: + - application/json + Dataserviceversion: + - "3.0" + User-Agent: + - azsdk-go-aztable/ azsdk-go-aztable/ azcore/v0.16.2 (go1.16.5; + Windows_NT) + X-Ms-Date: + - Tue, 20 Jul 2021 16:01:43 GMT + X-Ms-Version: + - "2019-02-02" + url: https://seankaneprim.table.cosmos.azure.com/Tables + method: POST + response: + body: '{"TableName":"gotabled7f5qwr5hskdg2","odata.metadata":"https://seankaneprim.table.cosmos.azure.com/$metadata#Tables/@Element"}' + headers: + Content-Type: + - application/json;odata=minimalmetadata + Date: + - Tue, 20 Jul 2021 16:01:43 GMT + Etag: + - W/"datetime'2021-07-20T16%3A01%3A43.3920520Z'" + Location: + - https://seankaneprim.table.cosmos.azure.com/Tables('gotabled7f5qwr5hskdg2') + X-Ms-Request-Id: + - ff314918-0c36-4935-8a12-e80e383d60cb + status: 201 Created + code: 201 + duration: "" +- request: + body: '{"TableName":"gotabled7f5qwr5hskdg3"}' + form: {} + headers: + Accept: + - application/json;odata=minimalmetadata + Authorization: + - sanitized + Content-Length: + - "37" + Content-Type: + - application/json + Dataserviceversion: + - "3.0" + User-Agent: + - azsdk-go-aztable/ azsdk-go-aztable/ azcore/v0.16.2 (go1.16.5; + Windows_NT) + X-Ms-Date: + - Tue, 20 Jul 2021 16:01:43 GMT + X-Ms-Version: + - "2019-02-02" + url: https://seankaneprim.table.cosmos.azure.com/Tables + method: POST + response: + body: '{"TableName":"gotabled7f5qwr5hskdg3","odata.metadata":"https://seankaneprim.table.cosmos.azure.com/$metadata#Tables/@Element"}' + headers: + Content-Type: + - application/json;odata=minimalmetadata + Date: + - Tue, 20 Jul 2021 16:01:44 GMT + Etag: + - W/"datetime'2021-07-20T16%3A01%3A44.2174984Z'" + Location: + - https://seankaneprim.table.cosmos.azure.com/Tables('gotabled7f5qwr5hskdg3') + X-Ms-Request-Id: + - a61384c7-ab17-424c-9c04-b0309eea72d0 + status: 201 Created + code: 201 + duration: "" +- request: + body: '{"TableName":"gotabled7f5qwr5hskdg4"}' + form: {} + headers: + Accept: + - application/json;odata=minimalmetadata + Authorization: + - sanitized + Content-Length: + - "37" + Content-Type: + - application/json + Dataserviceversion: + - "3.0" + User-Agent: + - azsdk-go-aztable/ azsdk-go-aztable/ azcore/v0.16.2 (go1.16.5; + Windows_NT) + X-Ms-Date: + - Tue, 20 Jul 2021 16:01:44 GMT + X-Ms-Version: + - "2019-02-02" + url: https://seankaneprim.table.cosmos.azure.com/Tables + method: POST + response: + body: '{"TableName":"gotabled7f5qwr5hskdg4","odata.metadata":"https://seankaneprim.table.cosmos.azure.com/$metadata#Tables/@Element"}' + headers: + Content-Type: + - application/json;odata=minimalmetadata + Date: + - Tue, 20 Jul 2021 16:01:44 GMT + Etag: + - W/"datetime'2021-07-20T16%3A01%3A45.0529800Z'" + Location: + - https://seankaneprim.table.cosmos.azure.com/Tables('gotabled7f5qwr5hskdg4') + X-Ms-Request-Id: + - 31a463d8-b07a-4360-8306-b1e05febc688 + status: 201 Created + code: 201 + duration: "" +- request: + body: "" + form: {} + headers: + Accept: + - application/json;odata=minimalmetadata + Authorization: + - sanitized + Dataserviceversion: + - "3.0" + User-Agent: + - azsdk-go-aztable/ azsdk-go-aztable/ azcore/v0.16.2 (go1.16.5; + Windows_NT) + X-Ms-Date: + - Tue, 20 Jul 2021 16:01:45 GMT + X-Ms-Version: + - "2019-02-02" + url: https://seankaneprim.table.cosmos.azure.com/Tables + method: GET + response: + body: '{"value":[{"TableName":"gotabled7f5qwr5hskdg3"},{"TableName":"gotabled7f5qwr5hskdg1"},{"TableName":"gotabled7f5qwr5hskdg0"},{"TableName":"gotabled7f5qwr5hskdg4"},{"TableName":"gotabled7f5qwr5hskdg2"}],"odata.metadata":"https://seankaneprim.table.cosmos.azure.com/$metadata#Tables"}' + headers: + Content-Type: + - application/json;odata=minimalmetadata + Date: + - Tue, 20 Jul 2021 16:01:45 GMT + X-Ms-Request-Id: + - a88f3060-ca4b-44e0-9ad2-15ec2205999a + status: 200 OK + code: 200 + duration: "" diff --git a/sdk/tables/aztable/recordings/TestServiceClient_Storage/TestListTables-variables.yaml b/sdk/tables/aztable/recordings/TestServiceClient_Storage/TestListTables-variables.yaml new file mode 100644 index 000000000000..5134b5eef979 --- /dev/null +++ b/sdk/tables/aztable/recordings/TestServiceClient_Storage/TestListTables-variables.yaml @@ -0,0 +1,5 @@ +--- +STORAGE_ENDPOINT_SUFFIX: core.windows.net +TABLES_PRIMARY_STORAGE_ACCOUNT_KEY: Kg== +TABLES_STORAGE_ACCOUNT_NAME: seankaneprim +randomSeed: "1626796893" diff --git a/sdk/tables/aztable/recordings/TestServiceClient_Storage/TestListTables.yaml b/sdk/tables/aztable/recordings/TestServiceClient_Storage/TestListTables.yaml new file mode 100644 index 000000000000..e95cb124c90e --- /dev/null +++ b/sdk/tables/aztable/recordings/TestServiceClient_Storage/TestListTables.yaml @@ -0,0 +1,713 @@ +--- +version: 1 +interactions: +- request: + body: "" + form: {} + headers: + Accept: + - application/json;odata=minimalmetadata + Authorization: + - sanitized + Dataserviceversion: + - "3.0" + User-Agent: + - azsdk-go-aztable/ azsdk-go-aztable/ azcore/v0.16.2 (go1.16.5; + Windows_NT) + X-Ms-Date: + - Tue, 20 Jul 2021 16:01:33 GMT + X-Ms-Version: + - "2019-02-02" + url: https://seankaneprim.table.core.windows.net/Tables + method: GET + response: + body: '{"odata.metadata":"https://seankaneprim.table.core.windows.net/$metadata#Tables","value":[{"TableName":"gotable1v1a7j87nvs5o"},{"TableName":"gotable5jq3v0tq94aql0"},{"TableName":"gotable5jq3v0tq94aql1"},{"TableName":"gotable5jq3v0tq94aql2"},{"TableName":"gotable5jq3v0tq94aql3"},{"TableName":"gotable5jq3v0tq94aql4"},{"TableName":"gotablekyd305p8fhn460"},{"TableName":"gotablekyd305p8fhn461"},{"TableName":"gotablekyd305p8fhn462"},{"TableName":"gotablekyd305p8fhn463"},{"TableName":"gotablekyd305p8fhn464"}]}' + headers: + Cache-Control: + - no-cache + Content-Type: + - application/json;odata=minimalmetadata;streaming=true;charset=utf-8 + Date: + - Tue, 20 Jul 2021 16:01:33 GMT + Server: + - Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0 + X-Content-Type-Options: + - nosniff + X-Ms-Request-Id: + - dbf5925b-d002-0079-7380-7d1451000000 + X-Ms-Version: + - "2019-02-02" + status: 200 OK + code: 200 + duration: "" +- request: + body: "" + form: {} + headers: + Accept: + - application/json + Authorization: + - sanitized + User-Agent: + - azsdk-go-aztable/ azsdk-go-aztable/ azcore/v0.16.2 (go1.16.5; + Windows_NT) + X-Ms-Date: + - Tue, 20 Jul 2021 16:01:34 GMT + X-Ms-Version: + - "2019-02-02" + url: https://seankaneprim.table.core.windows.net/Tables('gotable1v1a7j87nvs5o') + method: DELETE + response: + body: "" + headers: + Cache-Control: + - no-cache + Content-Length: + - "0" + Date: + - Tue, 20 Jul 2021 16:01:33 GMT + Server: + - Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0 + X-Content-Type-Options: + - nosniff + X-Ms-Request-Id: + - dbf592d4-d002-0079-6580-7d1451000000 + X-Ms-Version: + - "2019-02-02" + status: 204 No Content + code: 204 + duration: "" +- request: + body: "" + form: {} + headers: + Accept: + - application/json + Authorization: + - sanitized + User-Agent: + - azsdk-go-aztable/ azsdk-go-aztable/ azcore/v0.16.2 (go1.16.5; + Windows_NT) + X-Ms-Date: + - Tue, 20 Jul 2021 16:01:34 GMT + X-Ms-Version: + - "2019-02-02" + url: https://seankaneprim.table.core.windows.net/Tables('gotable5jq3v0tq94aql0') + method: DELETE + response: + body: "" + headers: + Cache-Control: + - no-cache + Content-Length: + - "0" + Date: + - Tue, 20 Jul 2021 16:01:33 GMT + Server: + - Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0 + X-Content-Type-Options: + - nosniff + X-Ms-Request-Id: + - dbf59332-d002-0079-3f80-7d1451000000 + X-Ms-Version: + - "2019-02-02" + status: 204 No Content + code: 204 + duration: "" +- request: + body: "" + form: {} + headers: + Accept: + - application/json + Authorization: + - sanitized + User-Agent: + - azsdk-go-aztable/ azsdk-go-aztable/ azcore/v0.16.2 (go1.16.5; + Windows_NT) + X-Ms-Date: + - Tue, 20 Jul 2021 16:01:34 GMT + X-Ms-Version: + - "2019-02-02" + url: https://seankaneprim.table.core.windows.net/Tables('gotable5jq3v0tq94aql1') + method: DELETE + response: + body: "" + headers: + Cache-Control: + - no-cache + Content-Length: + - "0" + Date: + - Tue, 20 Jul 2021 16:01:33 GMT + Server: + - Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0 + X-Content-Type-Options: + - nosniff + X-Ms-Request-Id: + - dbf59365-d002-0079-7280-7d1451000000 + X-Ms-Version: + - "2019-02-02" + status: 204 No Content + code: 204 + duration: "" +- request: + body: "" + form: {} + headers: + Accept: + - application/json + Authorization: + - sanitized + User-Agent: + - azsdk-go-aztable/ azsdk-go-aztable/ azcore/v0.16.2 (go1.16.5; + Windows_NT) + X-Ms-Date: + - Tue, 20 Jul 2021 16:01:34 GMT + X-Ms-Version: + - "2019-02-02" + url: https://seankaneprim.table.core.windows.net/Tables('gotable5jq3v0tq94aql2') + method: DELETE + response: + body: "" + headers: + Cache-Control: + - no-cache + Content-Length: + - "0" + Date: + - Tue, 20 Jul 2021 16:01:34 GMT + Server: + - Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0 + X-Content-Type-Options: + - nosniff + X-Ms-Request-Id: + - dbf59394-d002-0079-2080-7d1451000000 + X-Ms-Version: + - "2019-02-02" + status: 204 No Content + code: 204 + duration: "" +- request: + body: "" + form: {} + headers: + Accept: + - application/json + Authorization: + - sanitized + User-Agent: + - azsdk-go-aztable/ azsdk-go-aztable/ azcore/v0.16.2 (go1.16.5; + Windows_NT) + X-Ms-Date: + - Tue, 20 Jul 2021 16:01:34 GMT + X-Ms-Version: + - "2019-02-02" + url: https://seankaneprim.table.core.windows.net/Tables('gotable5jq3v0tq94aql3') + method: DELETE + response: + body: "" + headers: + Cache-Control: + - no-cache + Content-Length: + - "0" + Date: + - Tue, 20 Jul 2021 16:01:34 GMT + Server: + - Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0 + X-Content-Type-Options: + - nosniff + X-Ms-Request-Id: + - dbf593f1-d002-0079-7a80-7d1451000000 + X-Ms-Version: + - "2019-02-02" + status: 204 No Content + code: 204 + duration: "" +- request: + body: "" + form: {} + headers: + Accept: + - application/json + Authorization: + - sanitized + User-Agent: + - azsdk-go-aztable/ azsdk-go-aztable/ azcore/v0.16.2 (go1.16.5; + Windows_NT) + X-Ms-Date: + - Tue, 20 Jul 2021 16:01:34 GMT + X-Ms-Version: + - "2019-02-02" + url: https://seankaneprim.table.core.windows.net/Tables('gotable5jq3v0tq94aql4') + method: DELETE + response: + body: "" + headers: + Cache-Control: + - no-cache + Content-Length: + - "0" + Date: + - Tue, 20 Jul 2021 16:01:34 GMT + Server: + - Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0 + X-Content-Type-Options: + - nosniff + X-Ms-Request-Id: + - dbf59437-d002-0079-3f80-7d1451000000 + X-Ms-Version: + - "2019-02-02" + status: 204 No Content + code: 204 + duration: "" +- request: + body: "" + form: {} + headers: + Accept: + - application/json + Authorization: + - sanitized + User-Agent: + - azsdk-go-aztable/ azsdk-go-aztable/ azcore/v0.16.2 (go1.16.5; + Windows_NT) + X-Ms-Date: + - Tue, 20 Jul 2021 16:01:35 GMT + X-Ms-Version: + - "2019-02-02" + url: https://seankaneprim.table.core.windows.net/Tables('gotablekyd305p8fhn460') + method: DELETE + response: + body: "" + headers: + Cache-Control: + - no-cache + Content-Length: + - "0" + Date: + - Tue, 20 Jul 2021 16:01:34 GMT + Server: + - Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0 + X-Content-Type-Options: + - nosniff + X-Ms-Request-Id: + - dbf59477-d002-0079-7e80-7d1451000000 + X-Ms-Version: + - "2019-02-02" + status: 204 No Content + code: 204 + duration: "" +- request: + body: "" + form: {} + headers: + Accept: + - application/json + Authorization: + - sanitized + User-Agent: + - azsdk-go-aztable/ azsdk-go-aztable/ azcore/v0.16.2 (go1.16.5; + Windows_NT) + X-Ms-Date: + - Tue, 20 Jul 2021 16:01:35 GMT + X-Ms-Version: + - "2019-02-02" + url: https://seankaneprim.table.core.windows.net/Tables('gotablekyd305p8fhn461') + method: DELETE + response: + body: "" + headers: + Cache-Control: + - no-cache + Content-Length: + - "0" + Date: + - Tue, 20 Jul 2021 16:01:34 GMT + Server: + - Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0 + X-Content-Type-Options: + - nosniff + X-Ms-Request-Id: + - dbf594b1-d002-0079-3780-7d1451000000 + X-Ms-Version: + - "2019-02-02" + status: 204 No Content + code: 204 + duration: "" +- request: + body: "" + form: {} + headers: + Accept: + - application/json + Authorization: + - sanitized + User-Agent: + - azsdk-go-aztable/ azsdk-go-aztable/ azcore/v0.16.2 (go1.16.5; + Windows_NT) + X-Ms-Date: + - Tue, 20 Jul 2021 16:01:35 GMT + X-Ms-Version: + - "2019-02-02" + url: https://seankaneprim.table.core.windows.net/Tables('gotablekyd305p8fhn462') + method: DELETE + response: + body: "" + headers: + Cache-Control: + - no-cache + Content-Length: + - "0" + Date: + - Tue, 20 Jul 2021 16:01:34 GMT + Server: + - Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0 + X-Content-Type-Options: + - nosniff + X-Ms-Request-Id: + - dbf594e9-d002-0079-6f80-7d1451000000 + X-Ms-Version: + - "2019-02-02" + status: 204 No Content + code: 204 + duration: "" +- request: + body: "" + form: {} + headers: + Accept: + - application/json + Authorization: + - sanitized + User-Agent: + - azsdk-go-aztable/ azsdk-go-aztable/ azcore/v0.16.2 (go1.16.5; + Windows_NT) + X-Ms-Date: + - Tue, 20 Jul 2021 16:01:35 GMT + X-Ms-Version: + - "2019-02-02" + url: https://seankaneprim.table.core.windows.net/Tables('gotablekyd305p8fhn463') + method: DELETE + response: + body: "" + headers: + Cache-Control: + - no-cache + Content-Length: + - "0" + Date: + - Tue, 20 Jul 2021 16:01:34 GMT + Server: + - Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0 + X-Content-Type-Options: + - nosniff + X-Ms-Request-Id: + - dbf5952d-d002-0079-3180-7d1451000000 + X-Ms-Version: + - "2019-02-02" + status: 204 No Content + code: 204 + duration: "" +- request: + body: "" + form: {} + headers: + Accept: + - application/json + Authorization: + - sanitized + User-Agent: + - azsdk-go-aztable/ azsdk-go-aztable/ azcore/v0.16.2 (go1.16.5; + Windows_NT) + X-Ms-Date: + - Tue, 20 Jul 2021 16:01:35 GMT + X-Ms-Version: + - "2019-02-02" + url: https://seankaneprim.table.core.windows.net/Tables('gotablekyd305p8fhn464') + method: DELETE + response: + body: "" + headers: + Cache-Control: + - no-cache + Content-Length: + - "0" + Date: + - Tue, 20 Jul 2021 16:01:34 GMT + Server: + - Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0 + X-Content-Type-Options: + - nosniff + X-Ms-Request-Id: + - dbf59575-d002-0079-7480-7d1451000000 + X-Ms-Version: + - "2019-02-02" + status: 204 No Content + code: 204 + duration: "" +- request: + body: '{"TableName":"gotablebyhusoz3ewumo0"}' + form: {} + headers: + Accept: + - application/json;odata=minimalmetadata + Authorization: + - sanitized + Content-Length: + - "37" + Content-Type: + - application/json + Dataserviceversion: + - "3.0" + User-Agent: + - azsdk-go-aztable/ azsdk-go-aztable/ azcore/v0.16.2 (go1.16.5; + Windows_NT) + X-Ms-Date: + - Tue, 20 Jul 2021 16:01:35 GMT + X-Ms-Version: + - "2019-02-02" + url: https://seankaneprim.table.core.windows.net/Tables + method: POST + response: + body: '{"odata.metadata":"https://seankaneprim.table.core.windows.net/$metadata#Tables/@Element","TableName":"gotablebyhusoz3ewumo0"}' + headers: + Cache-Control: + - no-cache + Content-Type: + - application/json;odata=minimalmetadata;streaming=true;charset=utf-8 + Date: + - Tue, 20 Jul 2021 16:01:34 GMT + Location: + - https://seankaneprim.table.core.windows.net/Tables('gotablebyhusoz3ewumo0') + Server: + - Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0 + X-Content-Type-Options: + - nosniff + X-Ms-Request-Id: + - dbf595ad-d002-0079-2980-7d1451000000 + X-Ms-Version: + - "2019-02-02" + status: 201 Created + code: 201 + duration: "" +- request: + body: '{"TableName":"gotablebyhusoz3ewumo1"}' + form: {} + headers: + Accept: + - application/json;odata=minimalmetadata + Authorization: + - sanitized + Content-Length: + - "37" + Content-Type: + - application/json + Dataserviceversion: + - "3.0" + User-Agent: + - azsdk-go-aztable/ azsdk-go-aztable/ azcore/v0.16.2 (go1.16.5; + Windows_NT) + X-Ms-Date: + - Tue, 20 Jul 2021 16:01:35 GMT + X-Ms-Version: + - "2019-02-02" + url: https://seankaneprim.table.core.windows.net/Tables + method: POST + response: + body: '{"odata.metadata":"https://seankaneprim.table.core.windows.net/$metadata#Tables/@Element","TableName":"gotablebyhusoz3ewumo1"}' + headers: + Cache-Control: + - no-cache + Content-Type: + - application/json;odata=minimalmetadata;streaming=true;charset=utf-8 + Date: + - Tue, 20 Jul 2021 16:01:35 GMT + Location: + - https://seankaneprim.table.core.windows.net/Tables('gotablebyhusoz3ewumo1') + Server: + - Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0 + X-Content-Type-Options: + - nosniff + X-Ms-Request-Id: + - dbf595fa-d002-0079-7280-7d1451000000 + X-Ms-Version: + - "2019-02-02" + status: 201 Created + code: 201 + duration: "" +- request: + body: '{"TableName":"gotablebyhusoz3ewumo2"}' + form: {} + headers: + Accept: + - application/json;odata=minimalmetadata + Authorization: + - sanitized + Content-Length: + - "37" + Content-Type: + - application/json + Dataserviceversion: + - "3.0" + User-Agent: + - azsdk-go-aztable/ azsdk-go-aztable/ azcore/v0.16.2 (go1.16.5; + Windows_NT) + X-Ms-Date: + - Tue, 20 Jul 2021 16:01:35 GMT + X-Ms-Version: + - "2019-02-02" + url: https://seankaneprim.table.core.windows.net/Tables + method: POST + response: + body: '{"odata.metadata":"https://seankaneprim.table.core.windows.net/$metadata#Tables/@Element","TableName":"gotablebyhusoz3ewumo2"}' + headers: + Cache-Control: + - no-cache + Content-Type: + - application/json;odata=minimalmetadata;streaming=true;charset=utf-8 + Date: + - Tue, 20 Jul 2021 16:01:35 GMT + Location: + - https://seankaneprim.table.core.windows.net/Tables('gotablebyhusoz3ewumo2') + Server: + - Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0 + X-Content-Type-Options: + - nosniff + X-Ms-Request-Id: + - dbf5963a-d002-0079-2e80-7d1451000000 + X-Ms-Version: + - "2019-02-02" + status: 201 Created + code: 201 + duration: "" +- request: + body: '{"TableName":"gotablebyhusoz3ewumo3"}' + form: {} + headers: + Accept: + - application/json;odata=minimalmetadata + Authorization: + - sanitized + Content-Length: + - "37" + Content-Type: + - application/json + Dataserviceversion: + - "3.0" + User-Agent: + - azsdk-go-aztable/ azsdk-go-aztable/ azcore/v0.16.2 (go1.16.5; + Windows_NT) + X-Ms-Date: + - Tue, 20 Jul 2021 16:01:35 GMT + X-Ms-Version: + - "2019-02-02" + url: https://seankaneprim.table.core.windows.net/Tables + method: POST + response: + body: '{"odata.metadata":"https://seankaneprim.table.core.windows.net/$metadata#Tables/@Element","TableName":"gotablebyhusoz3ewumo3"}' + headers: + Cache-Control: + - no-cache + Content-Type: + - application/json;odata=minimalmetadata;streaming=true;charset=utf-8 + Date: + - Tue, 20 Jul 2021 16:01:35 GMT + Location: + - https://seankaneprim.table.core.windows.net/Tables('gotablebyhusoz3ewumo3') + Server: + - Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0 + X-Content-Type-Options: + - nosniff + X-Ms-Request-Id: + - dbf59673-d002-0079-6580-7d1451000000 + X-Ms-Version: + - "2019-02-02" + status: 201 Created + code: 201 + duration: "" +- request: + body: '{"TableName":"gotablebyhusoz3ewumo4"}' + form: {} + headers: + Accept: + - application/json;odata=minimalmetadata + Authorization: + - sanitized + Content-Length: + - "37" + Content-Type: + - application/json + Dataserviceversion: + - "3.0" + User-Agent: + - azsdk-go-aztable/ azsdk-go-aztable/ azcore/v0.16.2 (go1.16.5; + Windows_NT) + X-Ms-Date: + - Tue, 20 Jul 2021 16:01:35 GMT + X-Ms-Version: + - "2019-02-02" + url: https://seankaneprim.table.core.windows.net/Tables + method: POST + response: + body: '{"odata.metadata":"https://seankaneprim.table.core.windows.net/$metadata#Tables/@Element","TableName":"gotablebyhusoz3ewumo4"}' + headers: + Cache-Control: + - no-cache + Content-Type: + - application/json;odata=minimalmetadata;streaming=true;charset=utf-8 + Date: + - Tue, 20 Jul 2021 16:01:35 GMT + Location: + - https://seankaneprim.table.core.windows.net/Tables('gotablebyhusoz3ewumo4') + Server: + - Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0 + X-Content-Type-Options: + - nosniff + X-Ms-Request-Id: + - dbf596a6-d002-0079-1780-7d1451000000 + X-Ms-Version: + - "2019-02-02" + status: 201 Created + code: 201 + duration: "" +- request: + body: "" + form: {} + headers: + Accept: + - application/json;odata=minimalmetadata + Authorization: + - sanitized + Dataserviceversion: + - "3.0" + User-Agent: + - azsdk-go-aztable/ azsdk-go-aztable/ azcore/v0.16.2 (go1.16.5; + Windows_NT) + X-Ms-Date: + - Tue, 20 Jul 2021 16:01:36 GMT + X-Ms-Version: + - "2019-02-02" + url: https://seankaneprim.table.core.windows.net/Tables + method: GET + response: + body: '{"odata.metadata":"https://seankaneprim.table.core.windows.net/$metadata#Tables","value":[{"TableName":"gotablebyhusoz3ewumo0"},{"TableName":"gotablebyhusoz3ewumo1"},{"TableName":"gotablebyhusoz3ewumo2"},{"TableName":"gotablebyhusoz3ewumo3"},{"TableName":"gotablebyhusoz3ewumo4"}]}' + headers: + Cache-Control: + - no-cache + Content-Type: + - application/json;odata=minimalmetadata;streaming=true;charset=utf-8 + Date: + - Tue, 20 Jul 2021 16:01:35 GMT + Server: + - Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0 + X-Content-Type-Options: + - nosniff + X-Ms-Request-Id: + - dbf596db-d002-0079-4980-7d1451000000 + X-Ms-Version: + - "2019-02-02" + status: 200 OK + code: 200 + duration: "" diff --git a/sdk/tables/aztable/recordings/TestTableClient_Cosmos/TestListEntities-variables.yaml b/sdk/tables/aztable/recordings/TestTableClient_Cosmos/TestListEntities-variables.yaml new file mode 100644 index 000000000000..020dafba68f5 --- /dev/null +++ b/sdk/tables/aztable/recordings/TestTableClient_Cosmos/TestListEntities-variables.yaml @@ -0,0 +1,5 @@ +--- +COSMOS_TABLES_ENDPOINT_SUFFIX: cosmos.azure.com +TABLES_COSMOS_ACCOUNT_NAME: seankaneprim +TABLES_PRIMARY_COSMOS_ACCOUNT_KEY: Kg== +randomSeed: "1626796656" diff --git a/sdk/tables/aztable/recordings/TestTableClient_Cosmos/TestListEntities.yaml b/sdk/tables/aztable/recordings/TestTableClient_Cosmos/TestListEntities.yaml new file mode 100644 index 000000000000..2b02d7b0d715 --- /dev/null +++ b/sdk/tables/aztable/recordings/TestTableClient_Cosmos/TestListEntities.yaml @@ -0,0 +1,305 @@ +--- +version: 1 +interactions: +- request: + body: '{"TableName":"gotablekpg8v4qrcxayf"}' + form: {} + headers: + Accept: + - application/json;odata=minimalmetadata + Authorization: + - sanitized + Content-Length: + - "36" + Content-Type: + - application/json + Dataserviceversion: + - "3.0" + User-Agent: + - azsdk-go-aztable/ azsdk-go-aztable/ azcore/v0.16.2 (go1.16.5; + Windows_NT) + X-Ms-Date: + - Tue, 20 Jul 2021 15:57:36 GMT + X-Ms-Version: + - "2019-02-02" + url: https://seankaneprim.table.cosmos.azure.com/Tables + method: POST + response: + body: '{"TableName":"gotablekpg8v4qrcxayf","odata.metadata":"https://seankaneprim.table.cosmos.azure.com/$metadata#Tables/@Element"}' + headers: + Content-Type: + - application/json;odata=minimalmetadata + Date: + - Tue, 20 Jul 2021 15:57:36 GMT + Etag: + - W/"datetime'2021-07-20T15%3A57%3A36.9868296Z'" + Location: + - https://seankaneprim.table.cosmos.azure.com/Tables('gotablekpg8v4qrcxayf') + X-Ms-Request-Id: + - 29a6932d-34fe-43bf-bb15-0d6c9eef5b17 + status: 201 Created + code: 201 + duration: "" +- request: + body: '{"PartitionKey":"partition","RowKey":"0","Value":1}' + form: {} + headers: + Accept: + - application/json;odata=minimalmetadata + Authorization: + - sanitized + Content-Length: + - "51" + Content-Type: + - application/json + Dataserviceversion: + - "3.0" + Prefer: + - return-no-content + User-Agent: + - azsdk-go-aztable/ azsdk-go-aztable/ azcore/v0.16.2 (go1.16.5; + Windows_NT) + X-Ms-Date: + - Tue, 20 Jul 2021 15:57:37 GMT + X-Ms-Version: + - "2019-02-02" + url: https://seankaneprim.table.cosmos.azure.com/gotablekpg8v4qrcxayf + method: POST + response: + body: "" + headers: + Date: + - Tue, 20 Jul 2021 15:57:37 GMT + Etag: + - W/"datetime'2021-07-20T15%3A57%3A37.7762312Z'" + Location: + - https://seankaneprim.table.cosmos.azure.com/gotablekpg8v4qrcxayf(PartitionKey='partition',RowKey='0') + Preference-Applied: + - return-no-content + X-Ms-Request-Id: + - 2f1b9870-84c7-46b8-b418-d75d21c3b448 + status: 204 No Content + code: 204 + duration: "" +- request: + body: '{"PartitionKey":"partition","RowKey":"1","Value":2}' + form: {} + headers: + Accept: + - application/json;odata=minimalmetadata + Authorization: + - sanitized + Content-Length: + - "51" + Content-Type: + - application/json + Dataserviceversion: + - "3.0" + Prefer: + - return-no-content + User-Agent: + - azsdk-go-aztable/ azsdk-go-aztable/ azcore/v0.16.2 (go1.16.5; + Windows_NT) + X-Ms-Date: + - Tue, 20 Jul 2021 15:57:37 GMT + X-Ms-Version: + - "2019-02-02" + url: https://seankaneprim.table.cosmos.azure.com/gotablekpg8v4qrcxayf + method: POST + response: + body: "" + headers: + Date: + - Tue, 20 Jul 2021 15:57:37 GMT + Etag: + - W/"datetime'2021-07-20T15%3A57%3A37.8735112Z'" + Location: + - https://seankaneprim.table.cosmos.azure.com/gotablekpg8v4qrcxayf(PartitionKey='partition',RowKey='1') + Preference-Applied: + - return-no-content + X-Ms-Request-Id: + - 7cd30c18-6738-4b94-a3b2-14ef52328a4c + status: 204 No Content + code: 204 + duration: "" +- request: + body: '{"PartitionKey":"partition","RowKey":"2","Value":3}' + form: {} + headers: + Accept: + - application/json;odata=minimalmetadata + Authorization: + - sanitized + Content-Length: + - "51" + Content-Type: + - application/json + Dataserviceversion: + - "3.0" + Prefer: + - return-no-content + User-Agent: + - azsdk-go-aztable/ azsdk-go-aztable/ azcore/v0.16.2 (go1.16.5; + Windows_NT) + X-Ms-Date: + - Tue, 20 Jul 2021 15:57:37 GMT + X-Ms-Version: + - "2019-02-02" + url: https://seankaneprim.table.cosmos.azure.com/gotablekpg8v4qrcxayf + method: POST + response: + body: "" + headers: + Date: + - Tue, 20 Jul 2021 15:57:37 GMT + Etag: + - W/"datetime'2021-07-20T15%3A57%3A37.9680264Z'" + Location: + - https://seankaneprim.table.cosmos.azure.com/gotablekpg8v4qrcxayf(PartitionKey='partition',RowKey='2') + Preference-Applied: + - return-no-content + X-Ms-Request-Id: + - e2d19d8b-055a-4afd-812b-c85a94476427 + status: 204 No Content + code: 204 + duration: "" +- request: + body: '{"PartitionKey":"partition","RowKey":"3","Value":4}' + form: {} + headers: + Accept: + - application/json;odata=minimalmetadata + Authorization: + - sanitized + Content-Length: + - "51" + Content-Type: + - application/json + Dataserviceversion: + - "3.0" + Prefer: + - return-no-content + User-Agent: + - azsdk-go-aztable/ azsdk-go-aztable/ azcore/v0.16.2 (go1.16.5; + Windows_NT) + X-Ms-Date: + - Tue, 20 Jul 2021 15:57:37 GMT + X-Ms-Version: + - "2019-02-02" + url: https://seankaneprim.table.cosmos.azure.com/gotablekpg8v4qrcxayf + method: POST + response: + body: "" + headers: + Date: + - Tue, 20 Jul 2021 15:57:37 GMT + Etag: + - W/"datetime'2021-07-20T15%3A57%3A38.0645896Z'" + Location: + - https://seankaneprim.table.cosmos.azure.com/gotablekpg8v4qrcxayf(PartitionKey='partition',RowKey='3') + Preference-Applied: + - return-no-content + X-Ms-Request-Id: + - 425ae295-a848-455b-8ccd-16ba1cf78366 + status: 204 No Content + code: 204 + duration: "" +- request: + body: '{"PartitionKey":"partition","RowKey":"4","Value":5}' + form: {} + headers: + Accept: + - application/json;odata=minimalmetadata + Authorization: + - sanitized + Content-Length: + - "51" + Content-Type: + - application/json + Dataserviceversion: + - "3.0" + Prefer: + - return-no-content + User-Agent: + - azsdk-go-aztable/ azsdk-go-aztable/ azcore/v0.16.2 (go1.16.5; + Windows_NT) + X-Ms-Date: + - Tue, 20 Jul 2021 15:57:37 GMT + X-Ms-Version: + - "2019-02-02" + url: https://seankaneprim.table.cosmos.azure.com/gotablekpg8v4qrcxayf + method: POST + response: + body: "" + headers: + Date: + - Tue, 20 Jul 2021 15:57:37 GMT + Etag: + - W/"datetime'2021-07-20T15%3A57%3A38.1603336Z'" + Location: + - https://seankaneprim.table.cosmos.azure.com/gotablekpg8v4qrcxayf(PartitionKey='partition',RowKey='4') + Preference-Applied: + - return-no-content + X-Ms-Request-Id: + - 0c8dd131-e14b-49db-8092-02106c01b50c + status: 204 No Content + code: 204 + duration: "" +- request: + body: "" + form: {} + headers: + Accept: + - application/json;odata=minimalmetadata + Authorization: + - sanitized + Dataserviceversion: + - "3.0" + User-Agent: + - azsdk-go-aztable/ azsdk-go-aztable/ azcore/v0.16.2 (go1.16.5; + Windows_NT) + X-Ms-Date: + - Tue, 20 Jul 2021 15:57:37 GMT + X-Ms-Version: + - "2019-02-02" + url: https://seankaneprim.table.cosmos.azure.com/gotablekpg8v4qrcxayf() + method: GET + response: + body: '{"value":[{"odata.etag":"W/\"datetime''2021-07-20T15%3A57%3A37.7762312Z''\"","PartitionKey":"partition","RowKey":"0","Value":1,"Timestamp":"2021-07-20T15:57:37.7762312Z"},{"odata.etag":"W/\"datetime''2021-07-20T15%3A57%3A37.8735112Z''\"","PartitionKey":"partition","RowKey":"1","Value":2,"Timestamp":"2021-07-20T15:57:37.8735112Z"},{"odata.etag":"W/\"datetime''2021-07-20T15%3A57%3A37.9680264Z''\"","PartitionKey":"partition","RowKey":"2","Value":3,"Timestamp":"2021-07-20T15:57:37.9680264Z"},{"odata.etag":"W/\"datetime''2021-07-20T15%3A57%3A38.0645896Z''\"","PartitionKey":"partition","RowKey":"3","Value":4,"Timestamp":"2021-07-20T15:57:38.0645896Z"},{"odata.etag":"W/\"datetime''2021-07-20T15%3A57%3A38.1603336Z''\"","PartitionKey":"partition","RowKey":"4","Value":5,"Timestamp":"2021-07-20T15:57:38.1603336Z"}],"odata.metadata":"https://seankaneprim.table.cosmos.azure.com/$metadata#gotablekpg8v4qrcxayf"}' + headers: + Content-Type: + - application/json;odata=minimalmetadata + Date: + - Tue, 20 Jul 2021 15:57:37 GMT + X-Ms-Request-Id: + - e9ab21c5-dc78-458c-a610-0b7284f6b128 + status: 200 OK + code: 200 + duration: "" +- request: + body: "" + form: {} + headers: + Accept: + - application/json + Authorization: + - sanitized + User-Agent: + - azsdk-go-aztable/ azsdk-go-aztable/ azcore/v0.16.2 (go1.16.5; + Windows_NT) + X-Ms-Date: + - Tue, 20 Jul 2021 15:57:38 GMT + X-Ms-Version: + - "2019-02-02" + url: https://seankaneprim.table.cosmos.azure.com/Tables('gotablekpg8v4qrcxayf') + method: DELETE + response: + body: "" + headers: + Date: + - Tue, 20 Jul 2021 15:57:37 GMT + X-Ms-Request-Id: + - e883f6a8-15bc-4e93-86fa-ce057757595c + status: 204 No Content + code: 204 + duration: "" diff --git a/sdk/tables/aztable/recordings/TestTableClient_Storage/TestListEntities-variables.yaml b/sdk/tables/aztable/recordings/TestTableClient_Storage/TestListEntities-variables.yaml new file mode 100644 index 000000000000..d5b7be133444 --- /dev/null +++ b/sdk/tables/aztable/recordings/TestTableClient_Storage/TestListEntities-variables.yaml @@ -0,0 +1,5 @@ +--- +STORAGE_ENDPOINT_SUFFIX: core.windows.net +TABLES_PRIMARY_STORAGE_ACCOUNT_KEY: Kg== +TABLES_STORAGE_ACCOUNT_NAME: seankaneprim +randomSeed: "1626796654" diff --git a/sdk/tables/aztable/recordings/TestTableClient_Storage/TestListEntities.yaml b/sdk/tables/aztable/recordings/TestTableClient_Storage/TestListEntities.yaml new file mode 100644 index 000000000000..6a1ca63a2c47 --- /dev/null +++ b/sdk/tables/aztable/recordings/TestTableClient_Storage/TestListEntities.yaml @@ -0,0 +1,389 @@ +--- +version: 1 +interactions: +- request: + body: '{"TableName":"gotablemwc9x1cbe9eur"}' + form: {} + headers: + Accept: + - application/json;odata=minimalmetadata + Authorization: + - sanitized + Content-Length: + - "36" + Content-Type: + - application/json + Dataserviceversion: + - "3.0" + User-Agent: + - azsdk-go-aztable/ azsdk-go-aztable/ azcore/v0.16.2 (go1.16.5; + Windows_NT) + X-Ms-Date: + - Tue, 20 Jul 2021 15:57:34 GMT + X-Ms-Version: + - "2019-02-02" + url: https://seankaneprim.table.core.windows.net/Tables + method: POST + response: + body: '{"odata.metadata":"https://seankaneprim.table.core.windows.net/$metadata#Tables/@Element","TableName":"gotablemwc9x1cbe9eur"}' + headers: + Cache-Control: + - no-cache + Content-Type: + - application/json;odata=minimalmetadata;streaming=true;charset=utf-8 + Date: + - Tue, 20 Jul 2021 15:57:34 GMT + Location: + - https://seankaneprim.table.core.windows.net/Tables('gotablemwc9x1cbe9eur') + Server: + - Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0 + X-Content-Type-Options: + - nosniff + X-Ms-Request-Id: + - fa96f097-3002-0071-097f-7d0e5e000000 + X-Ms-Version: + - "2019-02-02" + status: 201 Created + code: 201 + duration: "" +- request: + body: '{"PartitionKey":"partition","RowKey":"0","Value":1}' + form: {} + headers: + Accept: + - application/json;odata=minimalmetadata + Authorization: + - sanitized + Content-Length: + - "51" + Content-Type: + - application/json + Dataserviceversion: + - "3.0" + Prefer: + - return-no-content + User-Agent: + - azsdk-go-aztable/ azsdk-go-aztable/ azcore/v0.16.2 (go1.16.5; + Windows_NT) + X-Ms-Date: + - Tue, 20 Jul 2021 15:57:35 GMT + X-Ms-Version: + - "2019-02-02" + url: https://seankaneprim.table.core.windows.net/gotablemwc9x1cbe9eur + method: POST + response: + body: "" + headers: + Cache-Control: + - no-cache + Content-Length: + - "0" + Dataserviceid: + - https://seankaneprim.table.core.windows.net/gotablemwc9x1cbe9eur(PartitionKey='partition',RowKey='0') + Date: + - Tue, 20 Jul 2021 15:57:34 GMT + Etag: + - W/"datetime'2021-07-20T15%3A57%3A35.6389627Z'" + Location: + - https://seankaneprim.table.core.windows.net/gotablemwc9x1cbe9eur(PartitionKey='partition',RowKey='0') + Preference-Applied: + - return-no-content + Server: + - Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0 + X-Content-Type-Options: + - nosniff + X-Ms-Request-Id: + - fa96f0da-3002-0071-427f-7d0e5e000000 + X-Ms-Version: + - "2019-02-02" + status: 204 No Content + code: 204 + duration: "" +- request: + body: '{"PartitionKey":"partition","RowKey":"1","Value":2}' + form: {} + headers: + Accept: + - application/json;odata=minimalmetadata + Authorization: + - sanitized + Content-Length: + - "51" + Content-Type: + - application/json + Dataserviceversion: + - "3.0" + Prefer: + - return-no-content + User-Agent: + - azsdk-go-aztable/ azsdk-go-aztable/ azcore/v0.16.2 (go1.16.5; + Windows_NT) + X-Ms-Date: + - Tue, 20 Jul 2021 15:57:35 GMT + X-Ms-Version: + - "2019-02-02" + url: https://seankaneprim.table.core.windows.net/gotablemwc9x1cbe9eur + method: POST + response: + body: "" + headers: + Cache-Control: + - no-cache + Content-Length: + - "0" + Dataserviceid: + - https://seankaneprim.table.core.windows.net/gotablemwc9x1cbe9eur(PartitionKey='partition',RowKey='1') + Date: + - Tue, 20 Jul 2021 15:57:35 GMT + Etag: + - W/"datetime'2021-07-20T15%3A57%3A35.7230224Z'" + Location: + - https://seankaneprim.table.core.windows.net/gotablemwc9x1cbe9eur(PartitionKey='partition',RowKey='1') + Preference-Applied: + - return-no-content + Server: + - Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0 + X-Content-Type-Options: + - nosniff + X-Ms-Request-Id: + - fa96f0fd-3002-0071-647f-7d0e5e000000 + X-Ms-Version: + - "2019-02-02" + status: 204 No Content + code: 204 + duration: "" +- request: + body: '{"PartitionKey":"partition","RowKey":"2","Value":3}' + form: {} + headers: + Accept: + - application/json;odata=minimalmetadata + Authorization: + - sanitized + Content-Length: + - "51" + Content-Type: + - application/json + Dataserviceversion: + - "3.0" + Prefer: + - return-no-content + User-Agent: + - azsdk-go-aztable/ azsdk-go-aztable/ azcore/v0.16.2 (go1.16.5; + Windows_NT) + X-Ms-Date: + - Tue, 20 Jul 2021 15:57:35 GMT + X-Ms-Version: + - "2019-02-02" + url: https://seankaneprim.table.core.windows.net/gotablemwc9x1cbe9eur + method: POST + response: + body: "" + headers: + Cache-Control: + - no-cache + Content-Length: + - "0" + Dataserviceid: + - https://seankaneprim.table.core.windows.net/gotablemwc9x1cbe9eur(PartitionKey='partition',RowKey='2') + Date: + - Tue, 20 Jul 2021 15:57:35 GMT + Etag: + - W/"datetime'2021-07-20T15%3A57%3A35.811085Z'" + Location: + - https://seankaneprim.table.core.windows.net/gotablemwc9x1cbe9eur(PartitionKey='partition',RowKey='2') + Preference-Applied: + - return-no-content + Server: + - Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0 + X-Content-Type-Options: + - nosniff + X-Ms-Request-Id: + - fa96f160-3002-0071-447f-7d0e5e000000 + X-Ms-Version: + - "2019-02-02" + status: 204 No Content + code: 204 + duration: "" +- request: + body: '{"PartitionKey":"partition","RowKey":"3","Value":4}' + form: {} + headers: + Accept: + - application/json;odata=minimalmetadata + Authorization: + - sanitized + Content-Length: + - "51" + Content-Type: + - application/json + Dataserviceversion: + - "3.0" + Prefer: + - return-no-content + User-Agent: + - azsdk-go-aztable/ azsdk-go-aztable/ azcore/v0.16.2 (go1.16.5; + Windows_NT) + X-Ms-Date: + - Tue, 20 Jul 2021 15:57:35 GMT + X-Ms-Version: + - "2019-02-02" + url: https://seankaneprim.table.core.windows.net/gotablemwc9x1cbe9eur + method: POST + response: + body: "" + headers: + Cache-Control: + - no-cache + Content-Length: + - "0" + Dataserviceid: + - https://seankaneprim.table.core.windows.net/gotablemwc9x1cbe9eur(PartitionKey='partition',RowKey='3') + Date: + - Tue, 20 Jul 2021 15:57:35 GMT + Etag: + - W/"datetime'2021-07-20T15%3A57%3A35.898147Z'" + Location: + - https://seankaneprim.table.core.windows.net/gotablemwc9x1cbe9eur(PartitionKey='partition',RowKey='3') + Preference-Applied: + - return-no-content + Server: + - Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0 + X-Content-Type-Options: + - nosniff + X-Ms-Request-Id: + - fa96f189-3002-0071-6b7f-7d0e5e000000 + X-Ms-Version: + - "2019-02-02" + status: 204 No Content + code: 204 + duration: "" +- request: + body: '{"PartitionKey":"partition","RowKey":"4","Value":5}' + form: {} + headers: + Accept: + - application/json;odata=minimalmetadata + Authorization: + - sanitized + Content-Length: + - "51" + Content-Type: + - application/json + Dataserviceversion: + - "3.0" + Prefer: + - return-no-content + User-Agent: + - azsdk-go-aztable/ azsdk-go-aztable/ azcore/v0.16.2 (go1.16.5; + Windows_NT) + X-Ms-Date: + - Tue, 20 Jul 2021 15:57:35 GMT + X-Ms-Version: + - "2019-02-02" + url: https://seankaneprim.table.core.windows.net/gotablemwc9x1cbe9eur + method: POST + response: + body: "" + headers: + Cache-Control: + - no-cache + Content-Length: + - "0" + Dataserviceid: + - https://seankaneprim.table.core.windows.net/gotablemwc9x1cbe9eur(PartitionKey='partition',RowKey='4') + Date: + - Tue, 20 Jul 2021 15:57:35 GMT + Etag: + - W/"datetime'2021-07-20T15%3A57%3A35.9842082Z'" + Location: + - https://seankaneprim.table.core.windows.net/gotablemwc9x1cbe9eur(PartitionKey='partition',RowKey='4') + Preference-Applied: + - return-no-content + Server: + - Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0 + X-Content-Type-Options: + - nosniff + X-Ms-Request-Id: + - fa96f1b7-3002-0071-197f-7d0e5e000000 + X-Ms-Version: + - "2019-02-02" + status: 204 No Content + code: 204 + duration: "" +- request: + body: "" + form: {} + headers: + Accept: + - application/json;odata=minimalmetadata + Authorization: + - sanitized + Dataserviceversion: + - "3.0" + User-Agent: + - azsdk-go-aztable/ azsdk-go-aztable/ azcore/v0.16.2 (go1.16.5; + Windows_NT) + X-Ms-Date: + - Tue, 20 Jul 2021 15:57:35 GMT + X-Ms-Version: + - "2019-02-02" + url: https://seankaneprim.table.core.windows.net/gotablemwc9x1cbe9eur() + method: GET + response: + body: '{"odata.metadata":"https://seankaneprim.table.core.windows.net/$metadata#gotablemwc9x1cbe9eur","value":[{"odata.etag":"W/\"datetime''2021-07-20T15%3A57%3A35.6389627Z''\"","PartitionKey":"partition","RowKey":"0","Timestamp":"2021-07-20T15:57:35.6389627Z","Value":1},{"odata.etag":"W/\"datetime''2021-07-20T15%3A57%3A35.7230224Z''\"","PartitionKey":"partition","RowKey":"1","Timestamp":"2021-07-20T15:57:35.7230224Z","Value":2},{"odata.etag":"W/\"datetime''2021-07-20T15%3A57%3A35.811085Z''\"","PartitionKey":"partition","RowKey":"2","Timestamp":"2021-07-20T15:57:35.811085Z","Value":3},{"odata.etag":"W/\"datetime''2021-07-20T15%3A57%3A35.898147Z''\"","PartitionKey":"partition","RowKey":"3","Timestamp":"2021-07-20T15:57:35.898147Z","Value":4},{"odata.etag":"W/\"datetime''2021-07-20T15%3A57%3A35.9842082Z''\"","PartitionKey":"partition","RowKey":"4","Timestamp":"2021-07-20T15:57:35.9842082Z","Value":5}]}' + headers: + Cache-Control: + - no-cache + Content-Type: + - application/json;odata=minimalmetadata;streaming=true;charset=utf-8 + Date: + - Tue, 20 Jul 2021 15:57:35 GMT + Server: + - Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0 + X-Content-Type-Options: + - nosniff + X-Ms-Request-Id: + - fa96f1e0-3002-0071-417f-7d0e5e000000 + X-Ms-Version: + - "2019-02-02" + status: 200 OK + code: 200 + duration: "" +- request: + body: "" + form: {} + headers: + Accept: + - application/json + Authorization: + - sanitized + User-Agent: + - azsdk-go-aztable/ azsdk-go-aztable/ azcore/v0.16.2 (go1.16.5; + Windows_NT) + X-Ms-Date: + - Tue, 20 Jul 2021 15:57:35 GMT + X-Ms-Version: + - "2019-02-02" + url: https://seankaneprim.table.core.windows.net/Tables('gotablemwc9x1cbe9eur') + method: DELETE + response: + body: "" + headers: + Cache-Control: + - no-cache + Content-Length: + - "0" + Date: + - Tue, 20 Jul 2021 15:57:35 GMT + Server: + - Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0 + X-Content-Type-Options: + - nosniff + X-Ms-Request-Id: + - fa96f214-3002-0071-737f-7d0e5e000000 + X-Ms-Version: + - "2019-02-02" + status: 204 No Content + code: 204 + duration: "" diff --git a/sdk/tables/aztable/table_client.go b/sdk/tables/aztable/table_client.go index 6a93eae67a83..21f86fba8fc6 100644 --- a/sdk/tables/aztable/table_client.go +++ b/sdk/tables/aztable/table_client.go @@ -41,7 +41,7 @@ func (t *TableClient) Delete(ctx context.Context) (TableDeleteResponse, error) { return t.service.Delete(ctx, t.Name) } -// Query queries the tables using the specified QueryOptions. +// Query queries the entities using the specified QueryOptions. // QueryOptions can specify the following properties to affect the query results returned: // // Filter: An Odata filter expression that limits results to those entities that satisfy the filter expression. @@ -58,14 +58,35 @@ func (t *TableClient) Delete(ctx context.Context) (TableDeleteResponse, error) { // pager := client.Query(nil) // for pager.NextPage(ctx) { // resp = pager.PageResponse() -// fmt.sprintf("The page contains %i results", len(resp.TableEntityQueryResponse.Value)) +// fmt.Fprintf("The page contains %i results", len(resp.TableEntityQueryResponse.Value)) // } // err := pager.Err() func (t *TableClient) Query(queryOptions *QueryOptions) TableEntityQueryResponsePager { if queryOptions == nil { queryOptions = &QueryOptions{} } - return &tableEntityQueryResponsePager{tableClient: t, queryOptions: queryOptions, tableQueryOptions: &TableQueryEntitiesOptions{}} + return &tableEntityQueryResponsePager{ + tableClient: t, + queryOptions: queryOptions, + tableQueryOptions: &TableQueryEntitiesOptions{}} +} + +// List returns all the entities in a table +// +// List returns a Pager, which allows iteration through each page of results. Example: +// +// pager := client.List() +// for pager.NextPage(ctx) { +// resp = pager.PageResponse() +// fmt.Fprintf("The page contains %i results", len(resp.TableEntityQueryResponse.Value)) +// } +// err := pager.Err() +func (t *TableClient) List() TableEntityQueryResponsePager { + return &tableEntityQueryResponsePager{ + tableClient: t, + queryOptions: &QueryOptions{}, + tableQueryOptions: &TableQueryEntitiesOptions{}, + } } // GetEntity retrieves a specific entity from the service using the specified partitionKey and rowKey values. diff --git a/sdk/tables/aztable/table_client_test.go b/sdk/tables/aztable/table_client_test.go index 98b0cd8fa1ca..792b6441d7b8 100644 --- a/sdk/tables/aztable/table_client_test.go +++ b/sdk/tables/aztable/table_client_test.go @@ -5,6 +5,7 @@ package aztable import ( "bytes" + "context" "errors" "fmt" "io/ioutil" @@ -477,6 +478,43 @@ func (s *tableClientLiveTests) TestInvalidEntity() { assert.Contains(err.Error(), partitionKeyRowKeyError.Error()) } +func (s *tableClientLiveTests) TestListEntities() { + require := require.New(s.T()) + client, delete := s.init(true) + defer delete() + + err := insertNEntities("partition", 5, client) + require.NoError(err) + + count := 0 + pager := client.List() + for pager.NextPage(context.Background()) { + resp := pager.PageResponse() + for _, e := range resp.TableEntityQueryResponse.Value { + require.Equal(e["PartitionKey"].(string), "partition") + count += 1 + } + } + err = pager.Err() + require.NoError(err) + require.Equal(5, count) +} + +func insertNEntities(pk string, n int, client *TableClient) error { + for i := 0; i < n; i++ { + e := &map[string]interface{}{ + "PartitionKey": pk, + "RowKey": fmt.Sprint(i), + "Value": i + 1, + } + _, err := client.AddEntity(ctx, *e) + if err != nil { + return err + } + } + return nil +} + // setup the test environment func (s *tableClientLiveTests) BeforeTest(suite string, test string) { recordedTestSetup(s.T(), s.T().Name(), s.endpointType, s.mode) diff --git a/sdk/tables/aztable/table_service_client.go b/sdk/tables/aztable/table_service_client.go index 90d560afd3e7..c826639e5000 100644 --- a/sdk/tables/aztable/table_service_client.go +++ b/sdk/tables/aztable/table_service_client.go @@ -68,13 +68,24 @@ func (t *TableServiceClient) Delete(ctx context.Context, name string) (TableDele // pager := client.Query(nil) // for pager.NextPage(ctx) { // resp = pager.PageResponse() -// fmt.sprintf("The page contains %i results", len(resp.TableQueryResponse.Value)) +// fmt.Fprintf("The page contains %i results", len(resp.TableQueryResponse.Value)) // } // err := pager.Err() func (t *TableServiceClient) Query(queryOptions *QueryOptions) TableQueryResponsePager { return &tableQueryResponsePager{client: t.client, queryOptions: queryOptions, tableQueryOptions: new(TableQueryOptions)} } +// List returns all the existing tables. +// pager := client.List() +// for pager.NextPage(ctx) { +// resp = pager.PageResponse() +// fmt.Printf("There are %i tables in this page", len(resp.TableQueryResponse.Value)) +// } +// err := pager.Err() +func (t *TableServiceClient) List() TableQueryResponsePager { + return &tableQueryResponsePager{client: t.client, queryOptions: nil, tableQueryOptions: new(TableQueryOptions)} +} + func isCosmosEndpoint(url string) bool { isCosmosEmulator := strings.Contains(url, "localhost") && strings.Contains(url, "8902") return isCosmosEmulator || strings.Contains(url, CosmosTableDomain) || strings.Contains(url, LegacyCosmosTableDomain) diff --git a/sdk/tables/aztable/table_service_client_test.go b/sdk/tables/aztable/table_service_client_test.go index bfba4026dd94..7ef15324e7f9 100644 --- a/sdk/tables/aztable/table_service_client_test.go +++ b/sdk/tables/aztable/table_service_client_test.go @@ -12,6 +12,7 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/internal/recording" "github.com/Azure/azure-sdk-for-go/sdk/internal/runtime" "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" "github.com/stretchr/testify/suite" ) @@ -127,6 +128,46 @@ func (s *tableServiceClientLiveTests) TestQueryTable() { assert.Equal(pageCount, int(top)) } +func clearAllTables(context *testContext) error { + pager := context.client.List() + for pager.NextPage(ctx) { + resp := pager.PageResponse() + for _, v := range resp.TableQueryResponse.Value { + _, err := context.client.Delete(ctx, *v.TableName) + if err != nil { + return err + } + } + } + return pager.Err() +} + +func (s *tableServiceClientLiveTests) TestListTables() { + require := require.New(s.T()) + context := getTestContext(s.T().Name()) + tableName, err := getTableName(context) + require.NoError(err) + + err = clearAllTables(context) + require.NoError(err) + + for i := 0; i < 5; i++ { + _, err := context.client.Create(ctx, fmt.Sprintf("%v%v", tableName, i)) + require.NoError(err) + fmt.Println("Created: ", i) + } + + count := 0 + pager := context.client.List() + for pager.NextPage(ctx) { + resp := pager.PageResponse() + count += len(resp.TableQueryResponse.Value) + } + + require.NoError(pager.Err()) + require.Equal(5, count) +} + func (s *tableServiceClientLiveTests) BeforeTest(suite string, test string) { // setup the test environment recordedTestSetup(s.T(), s.T().Name(), s.endpointType, s.mode) From 56b2cb45ee4eabc9ddea0add441a4f80720792a7 Mon Sep 17 00:00:00 2001 From: seankane-msft Date: Tue, 20 Jul 2021 12:31:20 -0400 Subject: [PATCH 2/5] moving helper to zt file --- sdk/tables/aztable/table_client_test.go | 15 --------------- sdk/tables/aztable/table_service_client_test.go | 1 - sdk/tables/aztable/zt_table_recorded_tests.go | 15 +++++++++++++++ 3 files changed, 15 insertions(+), 16 deletions(-) diff --git a/sdk/tables/aztable/table_client_test.go b/sdk/tables/aztable/table_client_test.go index 792b6441d7b8..6ddef92e3916 100644 --- a/sdk/tables/aztable/table_client_test.go +++ b/sdk/tables/aztable/table_client_test.go @@ -500,21 +500,6 @@ func (s *tableClientLiveTests) TestListEntities() { require.Equal(5, count) } -func insertNEntities(pk string, n int, client *TableClient) error { - for i := 0; i < n; i++ { - e := &map[string]interface{}{ - "PartitionKey": pk, - "RowKey": fmt.Sprint(i), - "Value": i + 1, - } - _, err := client.AddEntity(ctx, *e) - if err != nil { - return err - } - } - return nil -} - // setup the test environment func (s *tableClientLiveTests) BeforeTest(suite string, test string) { recordedTestSetup(s.T(), s.T().Name(), s.endpointType, s.mode) diff --git a/sdk/tables/aztable/table_service_client_test.go b/sdk/tables/aztable/table_service_client_test.go index 7ef15324e7f9..17ba1a199543 100644 --- a/sdk/tables/aztable/table_service_client_test.go +++ b/sdk/tables/aztable/table_service_client_test.go @@ -154,7 +154,6 @@ func (s *tableServiceClientLiveTests) TestListTables() { for i := 0; i < 5; i++ { _, err := context.client.Create(ctx, fmt.Sprintf("%v%v", tableName, i)) require.NoError(err) - fmt.Println("Created: ", i) } count := 0 diff --git a/sdk/tables/aztable/zt_table_recorded_tests.go b/sdk/tables/aztable/zt_table_recorded_tests.go index 6f90551b0104..41a63a86288f 100644 --- a/sdk/tables/aztable/zt_table_recorded_tests.go +++ b/sdk/tables/aztable/zt_table_recorded_tests.go @@ -108,6 +108,21 @@ func recordedTestTeardown(key string) { } } +func insertNEntities(pk string, n int, client *TableClient) error { + for i := 0; i < n; i++ { + e := &map[string]interface{}{ + "PartitionKey": pk, + "RowKey": fmt.Sprint(i), + "Value": i + 1, + } + _, err := client.AddEntity(ctx, *e) + if err != nil { + return err + } + } + return nil +} + // cleans up the specified tables. If tables is nil, all tables will be deleted func cleanupTables(context *testContext, tables *[]string) { c := context.client From 31a44ccefabb8df985594a727e446961df3412e9 Mon Sep 17 00:00:00 2001 From: seankane-msft Date: Tue, 20 Jul 2021 15:13:49 -0400 Subject: [PATCH 3/5] improving docstrings --- sdk/tables/aztable/table_client.go | 4 ++-- sdk/tables/aztable/table_pagers.go | 8 ++++---- sdk/tables/aztable/table_service_client.go | 2 +- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/sdk/tables/aztable/table_client.go b/sdk/tables/aztable/table_client.go index 21f86fba8fc6..4ed252b90fcf 100644 --- a/sdk/tables/aztable/table_client.go +++ b/sdk/tables/aztable/table_client.go @@ -58,7 +58,7 @@ func (t *TableClient) Delete(ctx context.Context) (TableDeleteResponse, error) { // pager := client.Query(nil) // for pager.NextPage(ctx) { // resp = pager.PageResponse() -// fmt.Fprintf("The page contains %i results", len(resp.TableEntityQueryResponse.Value)) +// fmt.Printf("The page contains %i results.\n", len(resp.TableEntityQueryResponse.Value)) // } // err := pager.Err() func (t *TableClient) Query(queryOptions *QueryOptions) TableEntityQueryResponsePager { @@ -78,7 +78,7 @@ func (t *TableClient) Query(queryOptions *QueryOptions) TableEntityQueryResponse // pager := client.List() // for pager.NextPage(ctx) { // resp = pager.PageResponse() -// fmt.Fprintf("The page contains %i results", len(resp.TableEntityQueryResponse.Value)) +// fmt.Printf("The page contains %i results.\n", len(resp.TableEntityQueryResponse.Value)) // } // err := pager.Err() func (t *TableClient) List() TableEntityQueryResponsePager { diff --git a/sdk/tables/aztable/table_pagers.go b/sdk/tables/aztable/table_pagers.go index 1f275ca15f21..6aac08b0dfa3 100644 --- a/sdk/tables/aztable/table_pagers.go +++ b/sdk/tables/aztable/table_pagers.go @@ -29,7 +29,7 @@ import ( // // for pager.NextPage(ctx) { // resp = pager.PageResponse() -// fmt.sprintf("The page contains %i results", len(resp.TableEntityQueryResponse.Value)) +// fmt.Printf("The page contains %i results.\n", len(resp.TableEntityQueryResponse.Value)) // } // err := pager.Err() type TableEntityQueryResponsePager interface { @@ -70,7 +70,7 @@ func (p *tableEntityQueryResponsePager) NextPage(ctx context.Context) bool { // // for pager.NextPage(ctx) { // resp = pager.PageResponse() -// fmt.sprintf("The page contains %i results", len(resp.TableEntityQueryResponse.Value)) +// fmt.Printf("The page contains %i results.\n", len(resp.TableEntityQueryResponse.Value)) // } // err := pager.Err() func (p *tableEntityQueryResponsePager) PageResponse() TableEntityQueryResponseResponse { @@ -94,7 +94,7 @@ func (p *tableEntityQueryResponsePager) Err() error { // // for pager.NextPage(ctx) { // resp = pager.PageResponse() -// fmt.sprintf("The page contains %i results", len(resp.TableEntityQueryResponse.Value)) +// fmt.Printf("The page contains %i results.\n", len(resp.TableEntityQueryResponse.Value)) // } // err := pager.Err() type TableQueryResponsePager interface { @@ -163,7 +163,7 @@ func (p *tableQueryResponsePager) NextPage(ctx context.Context) bool { // // for pager.NextPage(ctx) { // resp = pager.PageResponse() -// fmt.sprintf("The page contains %i results", len(resp.TableEntityQueryResponse.Value)) +// fmt.Printf("The page contains %i results.\n", len(resp.TableEntityQueryResponse.Value)) // } func (p *tableQueryResponsePager) PageResponse() TableQueryResponseResponse { return *p.current diff --git a/sdk/tables/aztable/table_service_client.go b/sdk/tables/aztable/table_service_client.go index c826639e5000..bcaaad686281 100644 --- a/sdk/tables/aztable/table_service_client.go +++ b/sdk/tables/aztable/table_service_client.go @@ -68,7 +68,7 @@ func (t *TableServiceClient) Delete(ctx context.Context, name string) (TableDele // pager := client.Query(nil) // for pager.NextPage(ctx) { // resp = pager.PageResponse() -// fmt.Fprintf("The page contains %i results", len(resp.TableQueryResponse.Value)) +// fmt.Printf("The page contains %i results.\n", len(resp.TableQueryResponse.Value)) // } // err := pager.Err() func (t *TableServiceClient) Query(queryOptions *QueryOptions) TableQueryResponsePager { From 26163d845631f0ed63b7bc1772d46f24471bffae Mon Sep 17 00:00:00 2001 From: seankane-msft Date: Mon, 26 Jul 2021 14:38:02 -0400 Subject: [PATCH 4/5] changing all query methods to list --- sdk/tables/aztable/models.go | 29 ++++++++++++++ sdk/tables/aztable/table_client.go | 31 +++------------ sdk/tables/aztable/table_client_test.go | 39 ++++--------------- sdk/tables/aztable/table_pagers.go | 8 ++-- sdk/tables/aztable/table_service_client.go | 27 +++++-------- .../aztable/table_service_client_test.go | 8 ++-- sdk/tables/aztable/zt_table_recorded_tests.go | 2 +- 7 files changed, 61 insertions(+), 83 deletions(-) create mode 100644 sdk/tables/aztable/models.go diff --git a/sdk/tables/aztable/models.go b/sdk/tables/aztable/models.go new file mode 100644 index 000000000000..c6ec5fc9371c --- /dev/null +++ b/sdk/tables/aztable/models.go @@ -0,0 +1,29 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +package aztable + +// QueryOptions contains a group of parameters for the Table.Query method. +type ListOptions struct { + // OData filter expression. + Filter *string + // Specifies the media type for the response. + Format *OdataMetadataFormat + // Select expression using OData notation. Limits the columns on each record to just those requested, e.g. "$select=PolicyAssignmentId, ResourceId". + Select *string + // Maximum number of records to return. + Top *int32 +} + +func (l *ListOptions) toQueryOptions() *QueryOptions { + if l == nil { + return &QueryOptions{} + } + + return &QueryOptions{ + Filter: l.Filter, + Format: l.Format, + Select: l.Select, + Top: l.Top, + } +} diff --git a/sdk/tables/aztable/table_client.go b/sdk/tables/aztable/table_client.go index 4ed252b90fcf..da4e7ce54a3e 100644 --- a/sdk/tables/aztable/table_client.go +++ b/sdk/tables/aztable/table_client.go @@ -41,8 +41,8 @@ func (t *TableClient) Delete(ctx context.Context) (TableDeleteResponse, error) { return t.service.Delete(ctx, t.Name) } -// Query queries the entities using the specified QueryOptions. -// QueryOptions can specify the following properties to affect the query results returned: +// List queries the entities using the specified ListOptions. +// ListOptions can specify the following properties to affect the query results returned: // // Filter: An Odata filter expression that limits results to those entities that satisfy the filter expression. // For example, the following expression would return only entities with a PartitionKey of 'foo': "PartitionKey eq 'foo'" @@ -53,42 +53,21 @@ func (t *TableClient) Delete(ctx context.Context) (TableDeleteResponse, error) { // Top: The maximum number of entities that will be returned per page of results. // Note: This value does not limit the total number of results if NextPage is called on the returned Pager until it returns false. // -// Query returns a Pager, which allows iteration through each page of results. Example: +// List returns a Pager, which allows iteration through each page of results. Example: // -// pager := client.Query(nil) +// pager := client.List(nil) // for pager.NextPage(ctx) { // resp = pager.PageResponse() // fmt.Printf("The page contains %i results.\n", len(resp.TableEntityQueryResponse.Value)) // } // err := pager.Err() -func (t *TableClient) Query(queryOptions *QueryOptions) TableEntityQueryResponsePager { - if queryOptions == nil { - queryOptions = &QueryOptions{} - } +func (t *TableClient) List(queryOptions *ListOptions) TableEntityQueryResponsePager { return &tableEntityQueryResponsePager{ tableClient: t, queryOptions: queryOptions, tableQueryOptions: &TableQueryEntitiesOptions{}} } -// List returns all the entities in a table -// -// List returns a Pager, which allows iteration through each page of results. Example: -// -// pager := client.List() -// for pager.NextPage(ctx) { -// resp = pager.PageResponse() -// fmt.Printf("The page contains %i results.\n", len(resp.TableEntityQueryResponse.Value)) -// } -// err := pager.Err() -func (t *TableClient) List() TableEntityQueryResponsePager { - return &tableEntityQueryResponsePager{ - tableClient: t, - queryOptions: &QueryOptions{}, - tableQueryOptions: &TableQueryEntitiesOptions{}, - } -} - // GetEntity retrieves a specific entity from the service using the specified partitionKey and rowKey values. func (t *TableClient) GetEntity(ctx context.Context, partitionKey string, rowKey string) (MapOfInterfaceResponse, error) { resp, err := t.client.QueryEntityWithPartitionAndRowKey(ctx, t.Name, partitionKey, rowKey, &TableQueryEntityWithPartitionAndRowKeyOptions{}, nil) diff --git a/sdk/tables/aztable/table_client_test.go b/sdk/tables/aztable/table_client_test.go index 6ddef92e3916..e8a888723e1b 100644 --- a/sdk/tables/aztable/table_client_test.go +++ b/sdk/tables/aztable/table_client_test.go @@ -5,7 +5,6 @@ package aztable import ( "bytes" - "context" "errors" "fmt" "io/ioutil" @@ -113,7 +112,7 @@ func (s *tableClientLiveTests) TestMergeEntity() { var qResp TableEntityQueryResponseResponse filter := "RowKey eq '1'" - pager := client.Query(&QueryOptions{Filter: &filter}) + pager := client.List(&ListOptions{Filter: &filter}) for pager.NextPage(ctx) { qResp = pager.PageResponse() } @@ -130,7 +129,7 @@ func (s *tableClientLiveTests) TestMergeEntity() { _, updateErr := client.UpdateEntity(ctx, mergeProperty, nil, Merge) assert.Nil(updateErr) - pager = client.Query(&QueryOptions{Filter: &filter}) + pager = client.List(&ListOptions{Filter: &filter}) for pager.NextPage(ctx) { qResp = pager.PageResponse() } @@ -154,7 +153,7 @@ func (s *tableClientLiveTests) TestUpsertEntity() { var qResp TableEntityQueryResponseResponse filter := "RowKey eq '1'" - pager := client.Query(&QueryOptions{Filter: &filter}) + pager := client.List(&ListOptions{Filter: &filter}) for pager.NextPage(ctx) { qResp = pager.PageResponse() } @@ -171,7 +170,7 @@ func (s *tableClientLiveTests) TestUpsertEntity() { _, updateErr := client.UpsertEntity(ctx, mergeProperty, Replace) require.Nil(updateErr) - pager = client.Query(&QueryOptions{Filter: &filter}) + pager = client.List(&ListOptions{Filter: &filter}) for pager.NextPage(ctx) { qResp = pager.PageResponse() } @@ -231,7 +230,7 @@ func (s *tableClientLiveTests) TestQuerySimpleEntity() { expectedCount := 4 var resp TableEntityQueryResponseResponse var models []simpleEntity - pager := client.Query(&QueryOptions{Filter: &filter}) + pager := client.List(&ListOptions{Filter: &filter}) for pager.NextPage(ctx) { resp = pager.PageResponse() models = make([]simpleEntity, len(resp.TableEntityQueryResponse.Value)) @@ -282,7 +281,7 @@ func (s *tableClientLiveTests) TestQueryComplexEntity() { filter := "RowKey lt '5'" expectedCount := 4 var resp TableEntityQueryResponseResponse - pager := client.Query(&QueryOptions{Filter: &filter}) + pager := client.List(&ListOptions{Filter: &filter}) for pager.NextPage(ctx) { resp = pager.PageResponse() assert.Equal(expectedCount, len(resp.TableEntityQueryResponse.Value)) @@ -370,7 +369,7 @@ func (s *tableClientLiveTests) TestBatchMixed() { var qResp TableEntityQueryResponseResponse filter := "RowKey eq '1'" - pager := client.Query(&QueryOptions{Filter: &filter}) + pager := client.List(&ListOptions{Filter: &filter}) for pager.NextPage(ctx) { qResp = pager.PageResponse() } @@ -416,7 +415,7 @@ func (s *tableClientLiveTests) TestBatchMixed() { } - pager = client.Query(&QueryOptions{Filter: &filter}) + pager = client.List(&ListOptions{Filter: &filter}) for pager.NextPage(ctx) { qResp = pager.PageResponse() } @@ -478,28 +477,6 @@ func (s *tableClientLiveTests) TestInvalidEntity() { assert.Contains(err.Error(), partitionKeyRowKeyError.Error()) } -func (s *tableClientLiveTests) TestListEntities() { - require := require.New(s.T()) - client, delete := s.init(true) - defer delete() - - err := insertNEntities("partition", 5, client) - require.NoError(err) - - count := 0 - pager := client.List() - for pager.NextPage(context.Background()) { - resp := pager.PageResponse() - for _, e := range resp.TableEntityQueryResponse.Value { - require.Equal(e["PartitionKey"].(string), "partition") - count += 1 - } - } - err = pager.Err() - require.NoError(err) - require.Equal(5, count) -} - // setup the test environment func (s *tableClientLiveTests) BeforeTest(suite string, test string) { recordedTestSetup(s.T(), s.T().Name(), s.endpointType, s.mode) diff --git a/sdk/tables/aztable/table_pagers.go b/sdk/tables/aztable/table_pagers.go index 6aac08b0dfa3..2b3fc63c61eb 100644 --- a/sdk/tables/aztable/table_pagers.go +++ b/sdk/tables/aztable/table_pagers.go @@ -43,7 +43,7 @@ type tableEntityQueryResponsePager struct { tableClient *TableClient current *TableEntityQueryResponseResponse tableQueryOptions *TableQueryEntitiesOptions - queryOptions *QueryOptions + queryOptions *ListOptions err error } @@ -55,7 +55,7 @@ func (p *tableEntityQueryResponsePager) NextPage(ctx context.Context) bool { return false } var resp TableEntityQueryResponseResponse - resp, p.err = p.tableClient.client.QueryEntities(ctx, p.tableClient.Name, p.tableQueryOptions, p.queryOptions) + resp, p.err = p.tableClient.client.QueryEntities(ctx, p.tableClient.Name, p.tableQueryOptions, p.queryOptions.toQueryOptions()) if p.err == nil { castAndRemoveAnnotationsSlice(&resp.TableEntityQueryResponse.Value) } @@ -140,7 +140,7 @@ type tableQueryResponsePager struct { client *tableClient current *TableQueryResponseResponse tableQueryOptions *TableQueryOptions - queryOptions *QueryOptions + queryOptions *ListOptions err error } @@ -152,7 +152,7 @@ func (p *tableQueryResponsePager) NextPage(ctx context.Context) bool { return false } var resp TableQueryResponseResponse - resp, p.err = p.client.Query(ctx, p.tableQueryOptions, p.queryOptions) + resp, p.err = p.client.Query(ctx, p.tableQueryOptions, p.queryOptions.toQueryOptions()) p.current = &resp p.tableQueryOptions.NextTableName = resp.XMSContinuationNextTableName return p.err == nil && resp.TableQueryResponse.Value != nil && len(resp.TableQueryResponse.Value) > 0 diff --git a/sdk/tables/aztable/table_service_client.go b/sdk/tables/aztable/table_service_client.go index bcaaad686281..827abd777316 100644 --- a/sdk/tables/aztable/table_service_client.go +++ b/sdk/tables/aztable/table_service_client.go @@ -54,8 +54,8 @@ func (t *TableServiceClient) Delete(ctx context.Context, name string) (TableDele return t.client.Delete(ctx, name, nil) } -// Query queries the existing tables using the specified QueryOptions. -// QueryOptions can specify the following properties to affect the query results returned: +// List queries the existing tables using the specified ListOptions. +// ListOptions can specify the following properties to affect the query results returned: // // Filter: An Odata filter expression that limits results to those tables that satisfy the filter expression. // For example, the following expression would return only tables with a TableName of 'foo': "TableName eq 'foo'" @@ -63,27 +63,20 @@ func (t *TableServiceClient) Delete(ctx context.Context, name string) (TableDele // Top: The maximum number of tables that will be returned per page of results. // Note: This value does not limit the total number of results if NextPage is called on the returned Pager until it returns false. // -// Query returns a Pager, which allows iteration through each page of results. Example: +// List returns a Pager, which allows iteration through each page of results. Example: // -// pager := client.Query(nil) +// pager := client.List(nil) // for pager.NextPage(ctx) { // resp = pager.PageResponse() // fmt.Printf("The page contains %i results.\n", len(resp.TableQueryResponse.Value)) // } // err := pager.Err() -func (t *TableServiceClient) Query(queryOptions *QueryOptions) TableQueryResponsePager { - return &tableQueryResponsePager{client: t.client, queryOptions: queryOptions, tableQueryOptions: new(TableQueryOptions)} -} - -// List returns all the existing tables. -// pager := client.List() -// for pager.NextPage(ctx) { -// resp = pager.PageResponse() -// fmt.Printf("There are %i tables in this page", len(resp.TableQueryResponse.Value)) -// } -// err := pager.Err() -func (t *TableServiceClient) List() TableQueryResponsePager { - return &tableQueryResponsePager{client: t.client, queryOptions: nil, tableQueryOptions: new(TableQueryOptions)} +func (t *TableServiceClient) List(listOptions *ListOptions) TableQueryResponsePager { + return &tableQueryResponsePager{ + client: t.client, + queryOptions: listOptions, + tableQueryOptions: new(TableQueryOptions), + } } func isCosmosEndpoint(url string) bool { diff --git a/sdk/tables/aztable/table_service_client_test.go b/sdk/tables/aztable/table_service_client_test.go index 17ba1a199543..6a4fd4cc9225 100644 --- a/sdk/tables/aztable/table_service_client_test.go +++ b/sdk/tables/aztable/table_service_client_test.go @@ -100,7 +100,7 @@ func (s *tableServiceClientLiveTests) TestQueryTable() { // Query for tables with no pagination. The filter should exclude one table from the results filter := fmt.Sprintf("TableName ge '%s' and TableName lt '%s'", prefix1, prefix2) - pager := context.client.Query(&QueryOptions{Filter: &filter}) + pager := context.client.List(&ListOptions{Filter: &filter}) resultCount := 0 for pager.NextPage(ctx) { @@ -113,7 +113,7 @@ func (s *tableServiceClientLiveTests) TestQueryTable() { // Query for tables with pagination top := int32(2) - pager = context.client.Query(&QueryOptions{Filter: &filter, Top: &top}) + pager = context.client.List(&ListOptions{Filter: &filter, Top: &top}) resultCount = 0 pageCount := 0 @@ -129,7 +129,7 @@ func (s *tableServiceClientLiveTests) TestQueryTable() { } func clearAllTables(context *testContext) error { - pager := context.client.List() + pager := context.client.List(nil) for pager.NextPage(ctx) { resp := pager.PageResponse() for _, v := range resp.TableQueryResponse.Value { @@ -157,7 +157,7 @@ func (s *tableServiceClientLiveTests) TestListTables() { } count := 0 - pager := context.client.List() + pager := context.client.List(nil) for pager.NextPage(ctx) { resp := pager.PageResponse() count += len(resp.TableQueryResponse.Value) diff --git a/sdk/tables/aztable/zt_table_recorded_tests.go b/sdk/tables/aztable/zt_table_recorded_tests.go index 41a63a86288f..b502eb2c9dfe 100644 --- a/sdk/tables/aztable/zt_table_recorded_tests.go +++ b/sdk/tables/aztable/zt_table_recorded_tests.go @@ -127,7 +127,7 @@ func insertNEntities(pk string, n int, client *TableClient) error { func cleanupTables(context *testContext, tables *[]string) { c := context.client if tables == nil { - pager := c.Query(nil) + pager := c.List(nil) for pager.NextPage(ctx) { for _, t := range pager.PageResponse().TableQueryResponse.Value { _, err := c.Delete(ctx, *t.TableName) From affc053be8740f8749f353266f1342a51e4ced67 Mon Sep 17 00:00:00 2001 From: seankane-msft Date: Mon, 26 Jul 2021 14:45:26 -0400 Subject: [PATCH 5/5] updating docstrings --- sdk/tables/aztable/table_client.go | 3 ++- sdk/tables/aztable/table_service_client.go | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/sdk/tables/aztable/table_client.go b/sdk/tables/aztable/table_client.go index da4e7ce54a3e..c919a4967cb0 100644 --- a/sdk/tables/aztable/table_client.go +++ b/sdk/tables/aztable/table_client.go @@ -55,7 +55,8 @@ func (t *TableClient) Delete(ctx context.Context) (TableDeleteResponse, error) { // // List returns a Pager, which allows iteration through each page of results. Example: // -// pager := client.List(nil) +// options := &ListOptions{Filter: to.StringPtr("PartitionKey eq 'pk001'"), Top: to.Int32Ptr(25), Select: to.StringPtr("PartitionKey,RowKey,Value,Price")} +// pager := client.List(options) // Pass in 'nil' if you want to return all Entities for an account. // for pager.NextPage(ctx) { // resp = pager.PageResponse() // fmt.Printf("The page contains %i results.\n", len(resp.TableEntityQueryResponse.Value)) diff --git a/sdk/tables/aztable/table_service_client.go b/sdk/tables/aztable/table_service_client.go index 827abd777316..17df1262b78a 100644 --- a/sdk/tables/aztable/table_service_client.go +++ b/sdk/tables/aztable/table_service_client.go @@ -65,7 +65,8 @@ func (t *TableServiceClient) Delete(ctx context.Context, name string) (TableDele // // List returns a Pager, which allows iteration through each page of results. Example: // -// pager := client.List(nil) +// options := &ListOptions{Filter: to.StringPtr("PartitionKey eq 'pk001'"), Top: to.Int32Ptr(25)} +// pager := client.List(options) // Pass in 'nil' if you want to return all Tables for an account. // for pager.NextPage(ctx) { // resp = pager.PageResponse() // fmt.Printf("The page contains %i results.\n", len(resp.TableQueryResponse.Value))