diff --git a/sdk/internal/testframework/recording_sanitizer.go b/sdk/internal/testframework/recording_sanitizer.go index ac4311ef46a2..873844b7703b 100644 --- a/sdk/internal/testframework/recording_sanitizer.go +++ b/sdk/internal/testframework/recording_sanitizer.go @@ -28,7 +28,7 @@ var sanitizedValueSlice = []string{SanitizedValue} func DefaultSanitizer(recorder *recorder.Recorder) *RecordingSanitizer { // The default sanitizer sanitizes the Authorization header - s := &RecordingSanitizer{headersToSanitize: map[string]*string{"Authorization": nil}, recorder: recorder, urlSanitizer: DefaultStringSanitizer} + s := &RecordingSanitizer{headersToSanitize: map[string]*string{"Authorization": nil}, recorder: recorder, urlSanitizer: DefaultStringSanitizer, bodySanitizer: DefaultStringSanitizer} recorder.AddSaveFilter(s.applySaveFilter) return s diff --git a/sdk/tables/aztables/README.md b/sdk/tables/aztables/README.md index 18eb9c67c656..ffcd20626bea 100644 --- a/sdk/tables/aztables/README.md +++ b/sdk/tables/aztables/README.md @@ -129,6 +129,12 @@ This project has adopted the [Microsoft Open Source Code of Conduct][coc]. For more information see the [Code of Conduct FAQ][coc_faq] or contact [opencode@microsoft.com][coc_contact] with any additional questions or comments. +## Generating the client + +From the tables dir: + +autorest --use=@autorest/go@4.0.0-preview.20 https://raw.githubusercontent.com/Azure/azure-rest-api-specs/master/specification/cosmos-db/data-plane/readme.md --tag=package-2019-02 --file-prefix="zz_generated_" --modelerfour.lenient-model-deduplication --license-header=MICROSOFT_MIT_NO_VERSION --output-folder=aztables --module=aztables --openapi-type="data-plane" --credential-scope=none + [tables_rest]: https://docs.microsoft.com/rest/api/storageservices/table-service-rest-api [azure_cli]: https://docs.microsoft.com/cli/azure diff --git a/sdk/tables/aztables/cosmos_patch_transform_policy.go b/sdk/tables/aztables/cosmos_patch_transform_policy.go new file mode 100644 index 000000000000..93e8ffa9d61b --- /dev/null +++ b/sdk/tables/aztables/cosmos_patch_transform_policy.go @@ -0,0 +1,27 @@ +// +build go1.13 + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +package aztables + +import ( + "net/http" + + "github.com/Azure/azure-sdk-for-go/sdk/azcore" +) + +// CosmosPatchTransformPolicy transforms PATCH requests into POST requests with the "X-HTTP-Method":"MERGE" header set. +type CosmosPatchTransformPolicy struct{} + +func (p CosmosPatchTransformPolicy) Do(req *azcore.Request) (*azcore.Response, error) { + transformPatchToCosmosPost(req) + return req.Next() +} + +func transformPatchToCosmosPost(req *azcore.Request) { + if req.Method == http.MethodPatch { + req.Method = http.MethodPost + req.Header.Set("X-HTTP-Method", "MERGE") + } +} diff --git a/sdk/tables/aztables/go.mod b/sdk/tables/aztables/go.mod index a37066df4bb0..2992eb5c22c4 100644 --- a/sdk/tables/aztables/go.mod +++ b/sdk/tables/aztables/go.mod @@ -2,7 +2,12 @@ module github.com/Azure/azure-sdk-for-go/sdk/tables/aztables go 1.13 +replace github.com/Azure/azure-sdk-for-go/sdk/internal => ../../internal + require ( - github.com/Azure/azure-sdk-for-go/sdk/azcore v0.14.1 - gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c + github.com/Azure/azure-sdk-for-go/sdk/azcore v0.16.1 + github.com/Azure/azure-sdk-for-go/sdk/internal v0.5.1 + github.com/stretchr/testify v1.7.0 + golang.org/x/net v0.0.0-20210510120150-4163338589ed // indirect + gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b // indirect ) diff --git a/sdk/tables/aztables/go.sum b/sdk/tables/aztables/go.sum index 369497e547f8..6de49c407854 100644 --- a/sdk/tables/aztables/go.sum +++ b/sdk/tables/aztables/go.sum @@ -1,23 +1,38 @@ -github.com/Azure/azure-sdk-for-go/sdk/azcore v0.14.1 h1:7JdDsau2B5IZc0d0CPvSMn8DxJ3GRBxtFS7OrZPIJdA= -github.com/Azure/azure-sdk-for-go/sdk/azcore v0.14.1/go.mod h1:pElNP+u99BvCZD+0jOlhI9OC/NB2IDTOTGZOZH0Qhq8= -github.com/Azure/azure-sdk-for-go/sdk/internal v0.5.0 h1:HG1ggl8L3ZkV/Ydanf7lKr5kkhhPGCpWdnr1J6v7cO4= -github.com/Azure/azure-sdk-for-go/sdk/internal v0.5.0/go.mod h1:k4KbFSunV/+0hOHL1vyFaPsiYQ1Vmvy1TBpmtvCDLZM= -github.com/kr/pretty v0.2.1 h1:Fmg33tUaq4/8ym9TJN1x7sLJnHVwhP33CNkpYV/7rwI= -github.com/kr/pretty v0.2.1/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI= -github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= -github.com/kr/text v0.1.0 h1:45sCR5RtlFHMR4UwH9sdQ5TC8v0qDQCHnXt+kaKSTVE= -github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= +github.com/Azure/azure-sdk-for-go/sdk/azcore v0.16.1 h1:yQw8Ah26gBP4dv66ZNjZpRBRV+gaHH/0TLn1taU4FZ4= +github.com/Azure/azure-sdk-for-go/sdk/azcore v0.16.1/go.mod h1:MVdrcUC4Hup35qHym3VdzoW+NBgBxrta9Vei97jRtM8= +github.com/davecgh/go-spew v1.1.0 h1:ZDRjVQ15GmhC3fiQ8ni8+OwkZQO4DARzQgrnXU1Liz8= +github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= +github.com/dnaeon/go-vcr v1.1.0 h1:ReYa/UBrRyQdant9B4fNHGoCNKw6qh6P0fsdGmZpR7c= +github.com/dnaeon/go-vcr v1.1.0/go.mod h1:M7tiix8f0r6mKKJ3Yq/kqU1OYf3MnfmBWVbPx/yU9ko= +github.com/modocache/gover v0.0.0-20171022184752-b58185e213c5/go.mod h1:caMODM3PzxT8aQXRPkAt8xlV/e7d7w8GM5g0fa5F0D8= +github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= +github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= +github.com/stretchr/objx v0.1.0 h1:4G4v2dO3VZwixGIRoQ5Lfboy6nUhCyYzaqnIAPPhYs4= +github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= +github.com/stretchr/testify v1.7.0 h1:nwc3DEeHmmLAfoZucVR881uASk0Mfjw8xYJ99tb5CcY= +github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= -golang.org/x/net v0.0.0-20201010224723-4f7140c49acb h1:mUVeFHoDKis5nxCAzoAi7E8Ghb86EXh/RK6wtvJIqRY= golang.org/x/net v0.0.0-20201010224723-4f7140c49acb/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= +golang.org/x/net v0.0.0-20210510120150-4163338589ed h1:p9UgmWI9wKpfYmgaV/IZKGdXc5qEK45tDwwwDyjS26I= +golang.org/x/net v0.0.0-20210510120150-4163338589ed/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210423082822-04245dca01da/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= -golang.org/x/text v0.3.3 h1:cokOdA+Jmi5PJGXLlLllQSgYigAEfHXJAERHVMaCc2k= golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= +golang.org/x/text v0.3.6 h1:aRYxNxv6iGQlyVaZmk6ZgYEDa+Jg18DxebPSrd6bg1M= +golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= -gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk= -gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EVd6muEfDQjcINNoR0C8j2r3qZ4Q= +gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 h1:yhCVgyC4o1eVCa2tZl7eS0r+SDo693bJlVdllGtEeKM= +gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= +gopkg.in/yaml.v2 v2.2.1/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= +gopkg.in/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY= +gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ= +gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= +gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b h1:h8qDotaEPuJATrMmW04NCwg7v22aHH28wwpauUhK9Oo= +gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= diff --git a/sdk/tables/aztables/recordings/TestServiceClient_Cosmos/TestCreateTable-variables.yaml b/sdk/tables/aztables/recordings/TestServiceClient_Cosmos/TestCreateTable-variables.yaml new file mode 100644 index 000000000000..7c9e2af36ee8 --- /dev/null +++ b/sdk/tables/aztables/recordings/TestServiceClient_Cosmos/TestCreateTable-variables.yaml @@ -0,0 +1,5 @@ +--- +COSMOS_TABLES_ENDPOINT_SUFFIX: cosmos.azure.com +TABLES_COSMOS_ACCOUNT_NAME: chrisstablesprim +TABLES_PRIMARY_COSMOS_ACCOUNT_KEY: Kg== +randomSeed: "1617573293" diff --git a/sdk/tables/aztables/recordings/TestServiceClient_Cosmos/TestCreateTable.yaml b/sdk/tables/aztables/recordings/TestServiceClient_Cosmos/TestCreateTable.yaml new file mode 100644 index 000000000000..032f93240511 --- /dev/null +++ b/sdk/tables/aztables/recordings/TestServiceClient_Cosmos/TestCreateTable.yaml @@ -0,0 +1,75 @@ +--- +version: 1 +interactions: +- request: + body: '{"TableName":"gotablecwmvbx3xi23m7"}' + form: {} + headers: + Accept: + - application/json;odata=minimalmetadata + Authorization: + - sanitized + Content-Length: + - "36" + Content-Type: + - application/json + Dataserviceversion: + - "3.0" + User-Agent: + - azsdk-go-tables/ azsdk-go-tables/ azcore/v0.13.4 (go1.16.2; + Windows_NT) + X-Ms-Date: + - Sun, 04 Apr 2021 21:54:53 GMT + X-Ms-Version: + - "2019-02-02" + url: https://chrisstablesprim.table.cosmos.azure.com/Tables + method: POST + response: + body: '{"TableName":"gotablecwmvbx3xi23m7","odata.metadata":"https://chrisstablesprim.table.cosmos.azure.com/$metadata#Tables/@Element"}' + headers: + Content-Type: + - application/json;odata=minimalmetadata + Date: + - Sun, 04 Apr 2021 21:54:53 GMT + Etag: + - W/"datetime'2021-04-04T21%3A54%3A53.3743624Z'" + Location: + - https://chrisstablesprim.table.cosmos.azure.com/Tables('gotablecwmvbx3xi23m7') + Server: + - Microsoft-HTTPAPI/2.0 + X-Ms-Request-Id: + - 33edc858-c2fc-436f-a0a0-8f909cfd1114 + status: 201 Created + code: 201 + duration: "" +- request: + body: "" + form: {} + headers: + Accept: + - application/json + Authorization: + - sanitized + User-Agent: + - azsdk-go-tables/ azsdk-go-tables/ azcore/v0.13.4 (go1.16.2; + Windows_NT) + X-Ms-Date: + - Sun, 04 Apr 2021 21:54:53 GMT + X-Ms-Version: + - "2019-02-02" + url: https://chrisstablesprim.table.cosmos.azure.com/Tables('gotablecwmvbx3xi23m7') + method: DELETE + response: + body: "" + headers: + Content-Length: + - "0" + Date: + - Sun, 04 Apr 2021 21:54:53 GMT + Server: + - Microsoft-HTTPAPI/2.0 + X-Ms-Request-Id: + - 654da1b1-025b-451e-8d64-d3c4afe7739a + status: 204 No Content + code: 204 + duration: "" diff --git a/sdk/tables/aztables/recordings/TestServiceClient_Cosmos/TestQueryTable-variables.yaml b/sdk/tables/aztables/recordings/TestServiceClient_Cosmos/TestQueryTable-variables.yaml new file mode 100644 index 000000000000..e1d3c746ac8b --- /dev/null +++ b/sdk/tables/aztables/recordings/TestServiceClient_Cosmos/TestQueryTable-variables.yaml @@ -0,0 +1,5 @@ +--- +COSMOS_TABLES_ENDPOINT_SUFFIX: cosmos.azure.com +TABLES_COSMOS_ACCOUNT_NAME: chrisstablesprim +TABLES_PRIMARY_COSMOS_ACCOUNT_KEY: Kg== +randomSeed: "1617573294" diff --git a/sdk/tables/aztables/recordings/TestServiceClient_Cosmos/TestQueryTable.yaml b/sdk/tables/aztables/recordings/TestServiceClient_Cosmos/TestQueryTable.yaml new file mode 100644 index 000000000000..4451edbf754c --- /dev/null +++ b/sdk/tables/aztables/recordings/TestServiceClient_Cosmos/TestQueryTable.yaml @@ -0,0 +1,499 @@ +--- +version: 1 +interactions: +- request: + body: '{"TableName":"zzza6868drab2e097oxu"}' + form: {} + headers: + Accept: + - application/json;odata=minimalmetadata + Authorization: + - sanitized + Content-Length: + - "36" + Content-Type: + - application/json + Dataserviceversion: + - "3.0" + User-Agent: + - azsdk-go-tables/ azsdk-go-tables/ azcore/v0.13.4 (go1.16.2; + Windows_NT) + X-Ms-Date: + - Sun, 04 Apr 2021 21:54:54 GMT + X-Ms-Version: + - "2019-02-02" + url: https://chrisstablesprim.table.cosmos.azure.com/Tables + method: POST + response: + body: '{"TableName":"zzza6868drab2e097oxu","odata.metadata":"https://chrisstablesprim.table.cosmos.azure.com/$metadata#Tables/@Element"}' + headers: + Content-Type: + - application/json;odata=minimalmetadata + Date: + - Sun, 04 Apr 2021 21:54:53 GMT + Etag: + - W/"datetime'2021-04-04T21%3A54%3A54.2225416Z'" + Location: + - https://chrisstablesprim.table.cosmos.azure.com/Tables('zzza6868drab2e097oxu') + Server: + - Microsoft-HTTPAPI/2.0 + X-Ms-Request-Id: + - b9dd1425-f416-44cd-9759-fa6ddc763d8e + status: 201 Created + code: 201 + duration: "" +- request: + body: '{"TableName":"zzza47kqkxef1dqg6hk5"}' + form: {} + headers: + Accept: + - application/json;odata=minimalmetadata + Authorization: + - sanitized + Content-Length: + - "36" + Content-Type: + - application/json + Dataserviceversion: + - "3.0" + User-Agent: + - azsdk-go-tables/ azsdk-go-tables/ azcore/v0.13.4 (go1.16.2; + Windows_NT) + X-Ms-Date: + - Sun, 04 Apr 2021 21:54:54 GMT + X-Ms-Version: + - "2019-02-02" + url: https://chrisstablesprim.table.cosmos.azure.com/Tables + method: POST + response: + body: '{"TableName":"zzza47kqkxef1dqg6hk5","odata.metadata":"https://chrisstablesprim.table.cosmos.azure.com/$metadata#Tables/@Element"}' + headers: + Content-Type: + - application/json;odata=minimalmetadata + Date: + - Sun, 04 Apr 2021 21:54:55 GMT + Etag: + - W/"datetime'2021-04-04T21%3A54%3A54.7395592Z'" + Location: + - https://chrisstablesprim.table.cosmos.azure.com/Tables('zzza47kqkxef1dqg6hk5') + Server: + - Microsoft-HTTPAPI/2.0 + X-Ms-Request-Id: + - 7cc0bdc4-bc2e-41a5-a9d5-718481425834 + status: 201 Created + code: 201 + duration: "" +- request: + body: '{"TableName":"zzzancjsimv46ssmus2y"}' + form: {} + headers: + Accept: + - application/json;odata=minimalmetadata + Authorization: + - sanitized + Content-Length: + - "36" + Content-Type: + - application/json + Dataserviceversion: + - "3.0" + User-Agent: + - azsdk-go-tables/ azsdk-go-tables/ azcore/v0.13.4 (go1.16.2; + Windows_NT) + X-Ms-Date: + - Sun, 04 Apr 2021 21:54:55 GMT + X-Ms-Version: + - "2019-02-02" + url: https://chrisstablesprim.table.cosmos.azure.com/Tables + method: POST + response: + body: '{"TableName":"zzzancjsimv46ssmus2y","odata.metadata":"https://chrisstablesprim.table.cosmos.azure.com/$metadata#Tables/@Element"}' + headers: + Content-Type: + - application/json;odata=minimalmetadata + Date: + - Sun, 04 Apr 2021 21:54:55 GMT + Etag: + - W/"datetime'2021-04-04T21%3A54%3A55.2994824Z'" + Location: + - https://chrisstablesprim.table.cosmos.azure.com/Tables('zzzancjsimv46ssmus2y') + Server: + - Microsoft-HTTPAPI/2.0 + X-Ms-Request-Id: + - 458c58e3-3247-448a-a542-de9f20e68872 + status: 201 Created + code: 201 + duration: "" +- request: + body: '{"TableName":"zzzau7wd11jeadrhkzia"}' + form: {} + headers: + Accept: + - application/json;odata=minimalmetadata + Authorization: + - sanitized + Content-Length: + - "36" + Content-Type: + - application/json + Dataserviceversion: + - "3.0" + User-Agent: + - azsdk-go-tables/ azsdk-go-tables/ azcore/v0.13.4 (go1.16.2; + Windows_NT) + X-Ms-Date: + - Sun, 04 Apr 2021 21:54:55 GMT + X-Ms-Version: + - "2019-02-02" + url: https://chrisstablesprim.table.cosmos.azure.com/Tables + method: POST + response: + body: '{"TableName":"zzzau7wd11jeadrhkzia","odata.metadata":"https://chrisstablesprim.table.cosmos.azure.com/$metadata#Tables/@Element"}' + headers: + Content-Type: + - application/json;odata=minimalmetadata + Date: + - Sun, 04 Apr 2021 21:54:56 GMT + Etag: + - W/"datetime'2021-04-04T21%3A54%3A55.8298120Z'" + Location: + - https://chrisstablesprim.table.cosmos.azure.com/Tables('zzzau7wd11jeadrhkzia') + Server: + - Microsoft-HTTPAPI/2.0 + X-Ms-Request-Id: + - e08277e1-0ac2-4cb7-a9c2-3ad4d593d33e + status: 201 Created + code: 201 + duration: "" +- request: + body: '{"TableName":"zzzbm74eob1xykl1zb71"}' + form: {} + headers: + Accept: + - application/json;odata=minimalmetadata + Authorization: + - sanitized + Content-Length: + - "36" + Content-Type: + - application/json + Dataserviceversion: + - "3.0" + User-Agent: + - azsdk-go-tables/ azsdk-go-tables/ azcore/v0.13.4 (go1.16.2; + Windows_NT) + X-Ms-Date: + - Sun, 04 Apr 2021 21:54:56 GMT + X-Ms-Version: + - "2019-02-02" + url: https://chrisstablesprim.table.cosmos.azure.com/Tables + method: POST + response: + body: '{"TableName":"zzzbm74eob1xykl1zb71","odata.metadata":"https://chrisstablesprim.table.cosmos.azure.com/$metadata#Tables/@Element"}' + headers: + Content-Type: + - application/json;odata=minimalmetadata + Date: + - Sun, 04 Apr 2021 21:54:56 GMT + Etag: + - W/"datetime'2021-04-04T21%3A54%3A56.4097032Z'" + Location: + - https://chrisstablesprim.table.cosmos.azure.com/Tables('zzzbm74eob1xykl1zb71') + Server: + - Microsoft-HTTPAPI/2.0 + X-Ms-Request-Id: + - aba90f45-d352-46e5-8d0b-32d749a29ac3 + status: 201 Created + code: 201 + duration: "" +- request: + body: "" + form: {} + headers: + Accept: + - application/json;odata=minimalmetadata + Authorization: + - sanitized + Dataserviceversion: + - "3.0" + User-Agent: + - azsdk-go-tables/ azsdk-go-tables/ azcore/v0.13.4 (go1.16.2; + Windows_NT) + X-Ms-Date: + - Sun, 04 Apr 2021 21:54:56 GMT + X-Ms-Version: + - "2019-02-02" + url: https://chrisstablesprim.table.cosmos.azure.com/Tables?%24filter=TableName+ge+%27zzza%27+and+TableName+lt+%27zzzb%27 + method: GET + response: + body: '{"value":[{"TableName":"zzza6868drab2e097oxu"},{"TableName":"zzza47kqkxef1dqg6hk5"},{"TableName":"zzzancjsimv46ssmus2y"},{"TableName":"zzzau7wd11jeadrhkzia"}],"odata.metadata":"https://chrisstablesprim.table.cosmos.azure.com/$metadata#Tables"}' + headers: + Content-Type: + - application/json;odata=minimalmetadata + Date: + - Sun, 04 Apr 2021 21:54:56 GMT + Server: + - Microsoft-HTTPAPI/2.0 + X-Ms-Request-Id: + - e277f56f-be38-4847-bcc7-d404818cc2a4 + status: 200 OK + code: 200 + duration: "" +- request: + body: "" + form: {} + headers: + Accept: + - application/json;odata=minimalmetadata + Authorization: + - sanitized + Dataserviceversion: + - "3.0" + User-Agent: + - azsdk-go-tables/ azsdk-go-tables/ azcore/v0.13.4 (go1.16.2; + Windows_NT) + X-Ms-Date: + - Sun, 04 Apr 2021 21:54:57 GMT + X-Ms-Version: + - "2019-02-02" + url: https://chrisstablesprim.table.cosmos.azure.com/Tables?%24filter=TableName+ge+%27zzza%27+and+TableName+lt+%27zzzb%27&%24top=2 + method: GET + response: + body: '{"value":[{"TableName":"zzza6868drab2e097oxu"},{"TableName":"zzza47kqkxef1dqg6hk5"}],"odata.metadata":"https://chrisstablesprim.table.cosmos.azure.com/$metadata#Tables"}' + headers: + Content-Type: + - application/json;odata=minimalmetadata + Date: + - Sun, 04 Apr 2021 21:54:56 GMT + Server: + - Microsoft-HTTPAPI/2.0 + X-Ms-Continuation-Nexttablename: + - -RID:~-mg9ANt+LD8=#RT:1#TRC:2 + X-Ms-Request-Id: + - 89b83810-e42f-46f9-a174-3a0cd1ebd42b + status: 200 OK + code: 200 + duration: "" +- request: + body: "" + form: {} + headers: + Accept: + - application/json;odata=minimalmetadata + Authorization: + - sanitized + Dataserviceversion: + - "3.0" + User-Agent: + - azsdk-go-tables/ azsdk-go-tables/ azcore/v0.13.4 (go1.16.2; + Windows_NT) + X-Ms-Date: + - Sun, 04 Apr 2021 21:54:57 GMT + X-Ms-Version: + - "2019-02-02" + url: https://chrisstablesprim.table.cosmos.azure.com/Tables?%24filter=TableName+ge+%27zzza%27+and+TableName+lt+%27zzzb%27&%24top=2&NextTableName=-RID%3A~-mg9ANt%2BLD8%3D%23RT%3A1%23TRC%3A2 + method: GET + response: + body: '{"value":[{"TableName":"zzzancjsimv46ssmus2y"},{"TableName":"zzzau7wd11jeadrhkzia"}],"odata.metadata":"https://chrisstablesprim.table.cosmos.azure.com/$metadata#Tables"}' + headers: + Content-Type: + - application/json;odata=minimalmetadata + Date: + - Sun, 04 Apr 2021 21:54:56 GMT + Server: + - Microsoft-HTTPAPI/2.0 + X-Ms-Continuation-Nexttablename: + - -RID:~-mg9AOab5rE=#RT:2#TRC:4 + X-Ms-Request-Id: + - 5b359f2a-f01b-4b51-88b8-f555384be342 + status: 200 OK + code: 200 + duration: "" +- request: + body: "" + form: {} + headers: + Accept: + - application/json;odata=minimalmetadata + Authorization: + - sanitized + Dataserviceversion: + - "3.0" + User-Agent: + - azsdk-go-tables/ azsdk-go-tables/ azcore/v0.13.4 (go1.16.2; + Windows_NT) + X-Ms-Date: + - Sun, 04 Apr 2021 21:54:57 GMT + X-Ms-Version: + - "2019-02-02" + url: https://chrisstablesprim.table.cosmos.azure.com/Tables?%24filter=TableName+ge+%27zzza%27+and+TableName+lt+%27zzzb%27&%24top=2&NextTableName=-RID%3A~-mg9AOab5rE%3D%23RT%3A2%23TRC%3A4 + method: GET + response: + body: '{"value":[],"odata.metadata":"https://chrisstablesprim.table.cosmos.azure.com/$metadata#Tables"}' + headers: + Content-Type: + - application/json;odata=minimalmetadata + Date: + - Sun, 04 Apr 2021 21:54:56 GMT + Server: + - Microsoft-HTTPAPI/2.0 + X-Ms-Request-Id: + - bac31683-48dc-4dba-86b7-5299f8f80b14 + status: 200 OK + code: 200 + duration: "" +- request: + body: "" + form: {} + headers: + Accept: + - application/json + Authorization: + - sanitized + User-Agent: + - azsdk-go-tables/ azsdk-go-tables/ azcore/v0.13.4 (go1.16.2; + Windows_NT) + X-Ms-Date: + - Sun, 04 Apr 2021 21:54:57 GMT + X-Ms-Version: + - "2019-02-02" + url: https://chrisstablesprim.table.cosmos.azure.com/Tables('zzza6868drab2e097oxu') + method: DELETE + response: + body: "" + headers: + Content-Length: + - "0" + Date: + - Sun, 04 Apr 2021 21:54:57 GMT + Server: + - Microsoft-HTTPAPI/2.0 + X-Ms-Request-Id: + - 4e2b7f94-e9a9-4397-9ec1-c4808f908cf0 + status: 204 No Content + code: 204 + duration: "" +- request: + body: "" + form: {} + headers: + Accept: + - application/json + Authorization: + - sanitized + User-Agent: + - azsdk-go-tables/ azsdk-go-tables/ azcore/v0.13.4 (go1.16.2; + Windows_NT) + X-Ms-Date: + - Sun, 04 Apr 2021 21:54:57 GMT + X-Ms-Version: + - "2019-02-02" + url: https://chrisstablesprim.table.cosmos.azure.com/Tables('zzza47kqkxef1dqg6hk5') + method: DELETE + response: + body: "" + headers: + Content-Length: + - "0" + Date: + - Sun, 04 Apr 2021 21:54:57 GMT + Server: + - Microsoft-HTTPAPI/2.0 + X-Ms-Request-Id: + - 0c5dda5b-2983-493f-8114-90378a12a073 + status: 204 No Content + code: 204 + duration: "" +- request: + body: "" + form: {} + headers: + Accept: + - application/json + Authorization: + - sanitized + User-Agent: + - azsdk-go-tables/ azsdk-go-tables/ azcore/v0.13.4 (go1.16.2; + Windows_NT) + X-Ms-Date: + - Sun, 04 Apr 2021 21:54:58 GMT + X-Ms-Version: + - "2019-02-02" + url: https://chrisstablesprim.table.cosmos.azure.com/Tables('zzzancjsimv46ssmus2y') + method: DELETE + response: + body: "" + headers: + Content-Length: + - "0" + Date: + - Sun, 04 Apr 2021 21:54:57 GMT + Server: + - Microsoft-HTTPAPI/2.0 + X-Ms-Request-Id: + - 7f4c8bcf-9801-493b-90b8-84ee3935af02 + status: 204 No Content + code: 204 + duration: "" +- request: + body: "" + form: {} + headers: + Accept: + - application/json + Authorization: + - sanitized + User-Agent: + - azsdk-go-tables/ azsdk-go-tables/ azcore/v0.13.4 (go1.16.2; + Windows_NT) + X-Ms-Date: + - Sun, 04 Apr 2021 21:54:58 GMT + X-Ms-Version: + - "2019-02-02" + url: https://chrisstablesprim.table.cosmos.azure.com/Tables('zzzau7wd11jeadrhkzia') + method: DELETE + response: + body: "" + headers: + Content-Length: + - "0" + Date: + - Sun, 04 Apr 2021 21:54:58 GMT + Server: + - Microsoft-HTTPAPI/2.0 + X-Ms-Request-Id: + - a05000dd-1cfe-4256-88b7-e6be74a2d7df + status: 204 No Content + code: 204 + duration: "" +- request: + body: "" + form: {} + headers: + Accept: + - application/json + Authorization: + - sanitized + User-Agent: + - azsdk-go-tables/ azsdk-go-tables/ azcore/v0.13.4 (go1.16.2; + Windows_NT) + X-Ms-Date: + - Sun, 04 Apr 2021 21:54:58 GMT + X-Ms-Version: + - "2019-02-02" + url: https://chrisstablesprim.table.cosmos.azure.com/Tables('zzzbm74eob1xykl1zb71') + method: DELETE + response: + body: "" + headers: + Content-Length: + - "0" + Date: + - Sun, 04 Apr 2021 21:54:58 GMT + Server: + - Microsoft-HTTPAPI/2.0 + X-Ms-Request-Id: + - 81acb8ac-7460-4aa8-b548-e426c88aba21 + status: 204 No Content + code: 204 + duration: "" diff --git a/sdk/tables/aztables/recordings/TestServiceClient_Cosmos/TestServiceErrors-variables.yaml b/sdk/tables/aztables/recordings/TestServiceClient_Cosmos/TestServiceErrors-variables.yaml new file mode 100644 index 000000000000..760bc4d4fdfb --- /dev/null +++ b/sdk/tables/aztables/recordings/TestServiceClient_Cosmos/TestServiceErrors-variables.yaml @@ -0,0 +1,5 @@ +--- +COSMOS_TABLES_ENDPOINT_SUFFIX: cosmos.azure.com +TABLES_COSMOS_ACCOUNT_NAME: chrisstablesprim +TABLES_PRIMARY_COSMOS_ACCOUNT_KEY: Kg== +randomSeed: "1617573550" diff --git a/sdk/tables/aztables/recordings/TestServiceClient_Cosmos/TestServiceErrors.yaml b/sdk/tables/aztables/recordings/TestServiceClient_Cosmos/TestServiceErrors.yaml new file mode 100644 index 000000000000..d3b9bf432eb8 --- /dev/null +++ b/sdk/tables/aztables/recordings/TestServiceClient_Cosmos/TestServiceErrors.yaml @@ -0,0 +1,113 @@ +--- +version: 1 +interactions: +- request: + body: '{"TableName":"gotable5hickrxl8lpbo"}' + form: {} + headers: + Accept: + - application/json;odata=minimalmetadata + Authorization: + - sanitized + Content-Length: + - "36" + Content-Type: + - application/json + Dataserviceversion: + - "3.0" + User-Agent: + - azsdk-go-tables/ azsdk-go-tables/ azcore/v0.13.4 (go1.16.2; + Windows_NT) + X-Ms-Date: + - Sun, 04 Apr 2021 21:59:10 GMT + X-Ms-Version: + - "2019-02-02" + url: https://chrisstablesprim.table.cosmos.azure.com/Tables + method: POST + response: + body: '{"TableName":"gotable5hickrxl8lpbo","odata.metadata":"https://chrisstablesprim.table.cosmos.azure.com/$metadata#Tables/@Element"}' + headers: + Content-Type: + - application/json;odata=minimalmetadata + Date: + - Sun, 04 Apr 2021 21:59:11 GMT + Etag: + - W/"datetime'2021-04-04T21%3A59%3A10.9652488Z'" + Location: + - https://chrisstablesprim.table.cosmos.azure.com/Tables('gotable5hickrxl8lpbo') + Server: + - Microsoft-HTTPAPI/2.0 + X-Ms-Request-Id: + - a5903255-58e5-4c43-bad9-f5e92cd5bd68 + status: 201 Created + code: 201 + duration: "" +- request: + body: '{"TableName":"gotable5hickrxl8lpbo"}' + form: {} + headers: + Accept: + - application/json;odata=minimalmetadata + Authorization: + - sanitized + Content-Length: + - "36" + Content-Type: + - application/json + Dataserviceversion: + - "3.0" + User-Agent: + - azsdk-go-tables/ azsdk-go-tables/ azcore/v0.13.4 (go1.16.2; + Windows_NT) + X-Ms-Date: + - Sun, 04 Apr 2021 21:59:11 GMT + X-Ms-Version: + - "2019-02-02" + url: https://chrisstablesprim.table.cosmos.azure.com/Tables + method: POST + response: + body: "{\"odata.error\":{\"code\":\"TableAlreadyExists\",\"message\":{\"lang\":\"en-us\",\"value\":\"The + specified table already exists.\\nRequestID:e216471c-9dae-4105-99a9-66a274775cce\\n\"}}}\r\n" + headers: + Content-Type: + - application/json;odata=minimalmetadata + Date: + - Sun, 04 Apr 2021 21:59:11 GMT + Server: + - Microsoft-HTTPAPI/2.0 + X-Ms-Request-Id: + - e216471c-9dae-4105-99a9-66a274775cce + status: 409 Conflict + code: 409 + duration: "" +- request: + body: "" + form: {} + headers: + Accept: + - application/json + Authorization: + - sanitized + User-Agent: + - azsdk-go-tables/ azsdk-go-tables/ azcore/v0.13.4 (go1.16.2; + Windows_NT) + X-Ms-Date: + - Sun, 04 Apr 2021 21:59:11 GMT + X-Ms-Version: + - "2019-02-02" + url: https://chrisstablesprim.table.cosmos.azure.com/Tables('gotable5hickrxl8lpbo') + method: DELETE + response: + body: "" + headers: + Content-Length: + - "0" + Date: + - Sun, 04 Apr 2021 21:59:11 GMT + Server: + - Microsoft-HTTPAPI/2.0 + X-Ms-Request-Id: + - c8bbfa46-7d78-46af-a6cb-b54bd57237af + status: 204 No Content + code: 204 + duration: "" diff --git a/sdk/tables/aztables/recordings/TestServiceClient_Storage/TestCreateTable-variables.yaml b/sdk/tables/aztables/recordings/TestServiceClient_Storage/TestCreateTable-variables.yaml new file mode 100644 index 000000000000..9b7c965397f6 --- /dev/null +++ b/sdk/tables/aztables/recordings/TestServiceClient_Storage/TestCreateTable-variables.yaml @@ -0,0 +1,5 @@ +--- +STORAGE_ENDPOINT_SUFFIX: core.windows.net +TABLES_PRIMARY_STORAGE_ACCOUNT_KEY: Kg== +TABLES_STORAGE_ACCOUNT_NAME: chrisstablesprim +randomSeed: "1617573291" diff --git a/sdk/tables/aztables/recordings/TestServiceClient_Storage/TestCreateTable.yaml b/sdk/tables/aztables/recordings/TestServiceClient_Storage/TestCreateTable.yaml new file mode 100644 index 000000000000..f5f90205815d --- /dev/null +++ b/sdk/tables/aztables/recordings/TestServiceClient_Storage/TestCreateTable.yaml @@ -0,0 +1,85 @@ +--- +version: 1 +interactions: +- request: + body: '{"TableName":"gotablep06y44pq0dcqy"}' + form: {} + headers: + Accept: + - application/json;odata=minimalmetadata + Authorization: + - sanitized + Content-Length: + - "36" + Content-Type: + - application/json + Dataserviceversion: + - "3.0" + User-Agent: + - azsdk-go-tables/ azsdk-go-tables/ azcore/v0.13.4 (go1.16.2; + Windows_NT) + X-Ms-Date: + - Sun, 04 Apr 2021 21:54:51 GMT + X-Ms-Version: + - "2019-02-02" + url: https://chrisstablesprim.table.core.windows.net/Tables + method: POST + response: + body: '{"odata.metadata":"https://chrisstablesprim.table.core.windows.net/$metadata#Tables/@Element","TableName":"gotablep06y44pq0dcqy"}' + headers: + Cache-Control: + - no-cache + Content-Type: + - application/json;odata=minimalmetadata;streaming=true;charset=utf-8 + Date: + - Sun, 04 Apr 2021 21:54:51 GMT + Location: + - https://chrisstablesprim.table.core.windows.net/Tables('gotablep06y44pq0dcqy') + Server: + - Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0 + X-Content-Type-Options: + - nosniff + X-Ms-Request-Id: + - aa171c82-c002-0053-409d-291720000000 + X-Ms-Version: + - "2019-02-02" + status: 201 Created + code: 201 + duration: "" +- request: + body: "" + form: {} + headers: + Accept: + - application/json + Authorization: + - sanitized + User-Agent: + - azsdk-go-tables/ azsdk-go-tables/ azcore/v0.13.4 (go1.16.2; + Windows_NT) + X-Ms-Date: + - Sun, 04 Apr 2021 21:54:51 GMT + X-Ms-Version: + - "2019-02-02" + url: https://chrisstablesprim.table.core.windows.net/Tables('gotablep06y44pq0dcqy') + method: DELETE + response: + body: "" + headers: + Cache-Control: + - no-cache + Content-Length: + - "0" + Date: + - Sun, 04 Apr 2021 21:54:51 GMT + Server: + - Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0 + X-Content-Type-Options: + - nosniff + X-Ms-Request-Id: + - aa171c8d-c002-0053-4a9d-291720000000 + X-Ms-Version: + - "2019-02-02" + status: 204 No Content + code: 204 + duration: "" diff --git a/sdk/tables/aztables/recordings/TestServiceClient_Storage/TestQueryTable-variables.yaml b/sdk/tables/aztables/recordings/TestServiceClient_Storage/TestQueryTable-variables.yaml new file mode 100644 index 000000000000..9b7c965397f6 --- /dev/null +++ b/sdk/tables/aztables/recordings/TestServiceClient_Storage/TestQueryTable-variables.yaml @@ -0,0 +1,5 @@ +--- +STORAGE_ENDPOINT_SUFFIX: core.windows.net +TABLES_PRIMARY_STORAGE_ACCOUNT_KEY: Kg== +TABLES_STORAGE_ACCOUNT_NAME: chrisstablesprim +randomSeed: "1617573291" diff --git a/sdk/tables/aztables/recordings/TestServiceClient_Storage/TestQueryTable.yaml b/sdk/tables/aztables/recordings/TestServiceClient_Storage/TestQueryTable.yaml new file mode 100644 index 000000000000..2431a475cb56 --- /dev/null +++ b/sdk/tables/aztables/recordings/TestServiceClient_Storage/TestQueryTable.yaml @@ -0,0 +1,532 @@ +--- +version: 1 +interactions: +- request: + body: '{"TableName":"zzzap06y44pq0dcqyefd"}' + form: {} + headers: + Accept: + - application/json;odata=minimalmetadata + Authorization: + - sanitized + Content-Length: + - "36" + Content-Type: + - application/json + Dataserviceversion: + - "3.0" + User-Agent: + - azsdk-go-tables/ azsdk-go-tables/ azcore/v0.13.4 (go1.16.2; + Windows_NT) + X-Ms-Date: + - Sun, 04 Apr 2021 21:54:51 GMT + X-Ms-Version: + - "2019-02-02" + url: https://chrisstablesprim.table.core.windows.net/Tables + method: POST + response: + body: '{"odata.metadata":"https://chrisstablesprim.table.core.windows.net/$metadata#Tables/@Element","TableName":"zzzap06y44pq0dcqyefd"}' + headers: + Cache-Control: + - no-cache + Content-Type: + - application/json;odata=minimalmetadata;streaming=true;charset=utf-8 + Date: + - Sun, 04 Apr 2021 21:54:51 GMT + Location: + - https://chrisstablesprim.table.core.windows.net/Tables('zzzap06y44pq0dcqyefd') + Server: + - Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0 + X-Content-Type-Options: + - nosniff + X-Ms-Request-Id: + - aa171c98-c002-0053-539d-291720000000 + X-Ms-Version: + - "2019-02-02" + status: 201 Created + code: 201 + duration: "" +- request: + body: '{"TableName":"zzzas5q9cqk9i1o44v25"}' + form: {} + headers: + Accept: + - application/json;odata=minimalmetadata + Authorization: + - sanitized + Content-Length: + - "36" + Content-Type: + - application/json + Dataserviceversion: + - "3.0" + User-Agent: + - azsdk-go-tables/ azsdk-go-tables/ azcore/v0.13.4 (go1.16.2; + Windows_NT) + X-Ms-Date: + - Sun, 04 Apr 2021 21:54:52 GMT + X-Ms-Version: + - "2019-02-02" + url: https://chrisstablesprim.table.core.windows.net/Tables + method: POST + response: + body: '{"odata.metadata":"https://chrisstablesprim.table.core.windows.net/$metadata#Tables/@Element","TableName":"zzzas5q9cqk9i1o44v25"}' + headers: + Cache-Control: + - no-cache + Content-Type: + - application/json;odata=minimalmetadata;streaming=true;charset=utf-8 + Date: + - Sun, 04 Apr 2021 21:54:51 GMT + Location: + - https://chrisstablesprim.table.core.windows.net/Tables('zzzas5q9cqk9i1o44v25') + Server: + - Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0 + X-Content-Type-Options: + - nosniff + X-Ms-Request-Id: + - aa171ca1-c002-0053-5b9d-291720000000 + X-Ms-Version: + - "2019-02-02" + status: 201 Created + code: 201 + duration: "" +- request: + body: '{"TableName":"zzzavphdrg4ipo7z4boc"}' + form: {} + headers: + Accept: + - application/json;odata=minimalmetadata + Authorization: + - sanitized + Content-Length: + - "36" + Content-Type: + - application/json + Dataserviceversion: + - "3.0" + User-Agent: + - azsdk-go-tables/ azsdk-go-tables/ azcore/v0.13.4 (go1.16.2; + Windows_NT) + X-Ms-Date: + - Sun, 04 Apr 2021 21:54:52 GMT + X-Ms-Version: + - "2019-02-02" + url: https://chrisstablesprim.table.core.windows.net/Tables + method: POST + response: + body: '{"odata.metadata":"https://chrisstablesprim.table.core.windows.net/$metadata#Tables/@Element","TableName":"zzzavphdrg4ipo7z4boc"}' + headers: + Cache-Control: + - no-cache + Content-Type: + - application/json;odata=minimalmetadata;streaming=true;charset=utf-8 + Date: + - Sun, 04 Apr 2021 21:54:51 GMT + Location: + - https://chrisstablesprim.table.core.windows.net/Tables('zzzavphdrg4ipo7z4boc') + Server: + - Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0 + X-Content-Type-Options: + - nosniff + X-Ms-Request-Id: + - aa171ca9-c002-0053-629d-291720000000 + X-Ms-Version: + - "2019-02-02" + status: 201 Created + code: 201 + duration: "" +- request: + body: '{"TableName":"zzzanoa2c4lxhmr55w1n"}' + form: {} + headers: + Accept: + - application/json;odata=minimalmetadata + Authorization: + - sanitized + Content-Length: + - "36" + Content-Type: + - application/json + Dataserviceversion: + - "3.0" + User-Agent: + - azsdk-go-tables/ azsdk-go-tables/ azcore/v0.13.4 (go1.16.2; + Windows_NT) + X-Ms-Date: + - Sun, 04 Apr 2021 21:54:52 GMT + X-Ms-Version: + - "2019-02-02" + url: https://chrisstablesprim.table.core.windows.net/Tables + method: POST + response: + body: '{"odata.metadata":"https://chrisstablesprim.table.core.windows.net/$metadata#Tables/@Element","TableName":"zzzanoa2c4lxhmr55w1n"}' + headers: + Cache-Control: + - no-cache + Content-Type: + - application/json;odata=minimalmetadata;streaming=true;charset=utf-8 + Date: + - Sun, 04 Apr 2021 21:54:51 GMT + Location: + - https://chrisstablesprim.table.core.windows.net/Tables('zzzanoa2c4lxhmr55w1n') + Server: + - Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0 + X-Content-Type-Options: + - nosniff + X-Ms-Request-Id: + - aa171cb5-c002-0053-6c9d-291720000000 + X-Ms-Version: + - "2019-02-02" + status: 201 Created + code: 201 + duration: "" +- request: + body: '{"TableName":"zzzbq0ics0v4b1nbyytz"}' + form: {} + headers: + Accept: + - application/json;odata=minimalmetadata + Authorization: + - sanitized + Content-Length: + - "36" + Content-Type: + - application/json + Dataserviceversion: + - "3.0" + User-Agent: + - azsdk-go-tables/ azsdk-go-tables/ azcore/v0.13.4 (go1.16.2; + Windows_NT) + X-Ms-Date: + - Sun, 04 Apr 2021 21:54:52 GMT + X-Ms-Version: + - "2019-02-02" + url: https://chrisstablesprim.table.core.windows.net/Tables + method: POST + response: + body: '{"odata.metadata":"https://chrisstablesprim.table.core.windows.net/$metadata#Tables/@Element","TableName":"zzzbq0ics0v4b1nbyytz"}' + headers: + Cache-Control: + - no-cache + Content-Type: + - application/json;odata=minimalmetadata;streaming=true;charset=utf-8 + Date: + - Sun, 04 Apr 2021 21:54:51 GMT + Location: + - https://chrisstablesprim.table.core.windows.net/Tables('zzzbq0ics0v4b1nbyytz') + Server: + - Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0 + X-Content-Type-Options: + - nosniff + X-Ms-Request-Id: + - aa171cbe-c002-0053-739d-291720000000 + 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-tables/ azsdk-go-tables/ azcore/v0.13.4 (go1.16.2; + Windows_NT) + X-Ms-Date: + - Sun, 04 Apr 2021 21:54:52 GMT + X-Ms-Version: + - "2019-02-02" + url: https://chrisstablesprim.table.core.windows.net/Tables?%24filter=TableName+ge+%27zzza%27+and+TableName+lt+%27zzzb%27 + method: GET + response: + body: '{"odata.metadata":"https://chrisstablesprim.table.core.windows.net/$metadata#Tables","value":[{"TableName":"zzzanoa2c4lxhmr55w1n"},{"TableName":"zzzap06y44pq0dcqyefd"},{"TableName":"zzzas5q9cqk9i1o44v25"},{"TableName":"zzzavphdrg4ipo7z4boc"}]}' + headers: + Cache-Control: + - no-cache + Content-Type: + - application/json;odata=minimalmetadata;streaming=true;charset=utf-8 + Date: + - Sun, 04 Apr 2021 21:54:51 GMT + Server: + - Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0 + X-Content-Type-Options: + - nosniff + X-Ms-Request-Id: + - aa171ccc-c002-0053-7f9d-291720000000 + X-Ms-Version: + - "2019-02-02" + status: 200 OK + code: 200 + duration: "" +- request: + body: "" + form: {} + headers: + Accept: + - application/json;odata=minimalmetadata + Authorization: + - sanitized + Dataserviceversion: + - "3.0" + User-Agent: + - azsdk-go-tables/ azsdk-go-tables/ azcore/v0.13.4 (go1.16.2; + Windows_NT) + X-Ms-Date: + - Sun, 04 Apr 2021 21:54:52 GMT + X-Ms-Version: + - "2019-02-02" + url: https://chrisstablesprim.table.core.windows.net/Tables?%24filter=TableName+ge+%27zzza%27+and+TableName+lt+%27zzzb%27&%24top=2 + method: GET + response: + body: '{"odata.metadata":"https://chrisstablesprim.table.core.windows.net/$metadata#Tables","value":[{"TableName":"zzzanoa2c4lxhmr55w1n"},{"TableName":"zzzap06y44pq0dcqyefd"}]}' + headers: + Cache-Control: + - no-cache + Content-Type: + - application/json;odata=minimalmetadata;streaming=true;charset=utf-8 + Date: + - Sun, 04 Apr 2021 21:54:51 GMT + Server: + - Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0 + X-Content-Type-Options: + - nosniff + X-Ms-Continuation-Nexttablename: + - 1!52!enp6YXM1cTljcWs5aTFvNDR2MjUBMDFkNzI5OWQyM2U4NjU2Yw-- + X-Ms-Request-Id: + - aa171ce3-c002-0053-159d-291720000000 + X-Ms-Version: + - "2019-02-02" + status: 200 OK + code: 200 + duration: "" +- request: + body: "" + form: {} + headers: + Accept: + - application/json;odata=minimalmetadata + Authorization: + - sanitized + Dataserviceversion: + - "3.0" + User-Agent: + - azsdk-go-tables/ azsdk-go-tables/ azcore/v0.13.4 (go1.16.2; + Windows_NT) + X-Ms-Date: + - Sun, 04 Apr 2021 21:54:52 GMT + X-Ms-Version: + - "2019-02-02" + url: https://chrisstablesprim.table.core.windows.net/Tables?%24filter=TableName+ge+%27zzza%27+and+TableName+lt+%27zzzb%27&%24top=2&NextTableName=1%2152%21enp6YXM1cTljcWs5aTFvNDR2MjUBMDFkNzI5OWQyM2U4NjU2Yw-- + method: GET + response: + body: '{"odata.metadata":"https://chrisstablesprim.table.core.windows.net/$metadata#Tables","value":[{"TableName":"zzzas5q9cqk9i1o44v25"},{"TableName":"zzzavphdrg4ipo7z4boc"}]}' + headers: + Cache-Control: + - no-cache + Content-Type: + - application/json;odata=minimalmetadata;streaming=true;charset=utf-8 + Date: + - Sun, 04 Apr 2021 21:54:51 GMT + Server: + - Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0 + X-Content-Type-Options: + - nosniff + X-Ms-Request-Id: + - aa171cf4-c002-0053-269d-291720000000 + 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-tables/ azsdk-go-tables/ azcore/v0.13.4 (go1.16.2; + Windows_NT) + X-Ms-Date: + - Sun, 04 Apr 2021 21:54:52 GMT + X-Ms-Version: + - "2019-02-02" + url: https://chrisstablesprim.table.core.windows.net/Tables('zzzap06y44pq0dcqyefd') + method: DELETE + response: + body: "" + headers: + Cache-Control: + - no-cache + Content-Length: + - "0" + Date: + - Sun, 04 Apr 2021 21:54:52 GMT + Server: + - Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0 + X-Content-Type-Options: + - nosniff + X-Ms-Request-Id: + - aa171d07-c002-0053-369d-291720000000 + 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-tables/ azsdk-go-tables/ azcore/v0.13.4 (go1.16.2; + Windows_NT) + X-Ms-Date: + - Sun, 04 Apr 2021 21:54:52 GMT + X-Ms-Version: + - "2019-02-02" + url: https://chrisstablesprim.table.core.windows.net/Tables('zzzas5q9cqk9i1o44v25') + method: DELETE + response: + body: "" + headers: + Cache-Control: + - no-cache + Content-Length: + - "0" + Date: + - Sun, 04 Apr 2021 21:54:52 GMT + Server: + - Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0 + X-Content-Type-Options: + - nosniff + X-Ms-Request-Id: + - aa171d16-c002-0053-459d-291720000000 + 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-tables/ azsdk-go-tables/ azcore/v0.13.4 (go1.16.2; + Windows_NT) + X-Ms-Date: + - Sun, 04 Apr 2021 21:54:52 GMT + X-Ms-Version: + - "2019-02-02" + url: https://chrisstablesprim.table.core.windows.net/Tables('zzzavphdrg4ipo7z4boc') + method: DELETE + response: + body: "" + headers: + Cache-Control: + - no-cache + Content-Length: + - "0" + Date: + - Sun, 04 Apr 2021 21:54:52 GMT + Server: + - Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0 + X-Content-Type-Options: + - nosniff + X-Ms-Request-Id: + - aa171d2a-c002-0053-599d-291720000000 + 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-tables/ azsdk-go-tables/ azcore/v0.13.4 (go1.16.2; + Windows_NT) + X-Ms-Date: + - Sun, 04 Apr 2021 21:54:52 GMT + X-Ms-Version: + - "2019-02-02" + url: https://chrisstablesprim.table.core.windows.net/Tables('zzzanoa2c4lxhmr55w1n') + method: DELETE + response: + body: "" + headers: + Cache-Control: + - no-cache + Content-Length: + - "0" + Date: + - Sun, 04 Apr 2021 21:54:52 GMT + Server: + - Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0 + X-Content-Type-Options: + - nosniff + X-Ms-Request-Id: + - aa171d3d-c002-0053-6c9d-291720000000 + 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-tables/ azsdk-go-tables/ azcore/v0.13.4 (go1.16.2; + Windows_NT) + X-Ms-Date: + - Sun, 04 Apr 2021 21:54:53 GMT + X-Ms-Version: + - "2019-02-02" + url: https://chrisstablesprim.table.core.windows.net/Tables('zzzbq0ics0v4b1nbyytz') + method: DELETE + response: + body: "" + headers: + Cache-Control: + - no-cache + Content-Length: + - "0" + Date: + - Sun, 04 Apr 2021 21:54:52 GMT + Server: + - Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0 + X-Content-Type-Options: + - nosniff + X-Ms-Request-Id: + - aa171d51-c002-0053-7d9d-291720000000 + X-Ms-Version: + - "2019-02-02" + status: 204 No Content + code: 204 + duration: "" diff --git a/sdk/tables/aztables/recordings/TestServiceClient_Storage/TestServiceErrors-variables.yaml b/sdk/tables/aztables/recordings/TestServiceClient_Storage/TestServiceErrors-variables.yaml new file mode 100644 index 000000000000..3f5acca6cabc --- /dev/null +++ b/sdk/tables/aztables/recordings/TestServiceClient_Storage/TestServiceErrors-variables.yaml @@ -0,0 +1,5 @@ +--- +STORAGE_ENDPOINT_SUFFIX: core.windows.net +TABLES_PRIMARY_STORAGE_ACCOUNT_KEY: Kg== +TABLES_STORAGE_ACCOUNT_NAME: chrisstablesprim +randomSeed: "1617573550" diff --git a/sdk/tables/aztables/recordings/TestServiceClient_Storage/TestServiceErrors.yaml b/sdk/tables/aztables/recordings/TestServiceClient_Storage/TestServiceErrors.yaml new file mode 100644 index 000000000000..55b918ae4d98 --- /dev/null +++ b/sdk/tables/aztables/recordings/TestServiceClient_Storage/TestServiceErrors.yaml @@ -0,0 +1,129 @@ +--- +version: 1 +interactions: +- request: + body: '{"TableName":"gotable5hickrxl8lpbo"}' + form: {} + headers: + Accept: + - application/json;odata=minimalmetadata + Authorization: + - sanitized + Content-Length: + - "36" + Content-Type: + - application/json + Dataserviceversion: + - "3.0" + User-Agent: + - azsdk-go-tables/ azsdk-go-tables/ azcore/v0.13.4 (go1.16.2; + Windows_NT) + X-Ms-Date: + - Sun, 04 Apr 2021 21:59:10 GMT + X-Ms-Version: + - "2019-02-02" + url: https://chrisstablesprim.table.core.windows.net/Tables + method: POST + response: + body: '{"odata.metadata":"https://chrisstablesprim.table.core.windows.net/$metadata#Tables/@Element","TableName":"gotable5hickrxl8lpbo"}' + headers: + Cache-Control: + - no-cache + Content-Type: + - application/json;odata=minimalmetadata;streaming=true;charset=utf-8 + Date: + - Sun, 04 Apr 2021 21:59:09 GMT + Location: + - https://chrisstablesprim.table.core.windows.net/Tables('gotable5hickrxl8lpbo') + Server: + - Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0 + X-Content-Type-Options: + - nosniff + X-Ms-Request-Id: + - a5bfa352-3002-0057-209d-299a27000000 + X-Ms-Version: + - "2019-02-02" + status: 201 Created + code: 201 + duration: "" +- request: + body: '{"TableName":"gotable5hickrxl8lpbo"}' + form: {} + headers: + Accept: + - application/json;odata=minimalmetadata + Authorization: + - sanitized + Content-Length: + - "36" + Content-Type: + - application/json + Dataserviceversion: + - "3.0" + User-Agent: + - azsdk-go-tables/ azsdk-go-tables/ azcore/v0.13.4 (go1.16.2; + Windows_NT) + X-Ms-Date: + - Sun, 04 Apr 2021 21:59:10 GMT + X-Ms-Version: + - "2019-02-02" + url: https://chrisstablesprim.table.core.windows.net/Tables + method: POST + response: + body: '{"odata.error":{"code":"TableAlreadyExists","message":{"lang":"en-US","value":"The + table specified already exists.\nRequestId:a5bfa358-3002-0057-259d-299a27000000\nTime:2021-04-04T21:59:10.6883876Z"}}}' + headers: + Cache-Control: + - no-cache + Content-Type: + - application/json;odata=minimalmetadata;streaming=true;charset=utf-8 + Date: + - Sun, 04 Apr 2021 21:59:10 GMT + Server: + - Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0 + X-Content-Type-Options: + - nosniff + X-Ms-Request-Id: + - a5bfa358-3002-0057-259d-299a27000000 + X-Ms-Version: + - "2019-02-02" + status: 409 Conflict + code: 409 + duration: "" +- request: + body: "" + form: {} + headers: + Accept: + - application/json + Authorization: + - sanitized + User-Agent: + - azsdk-go-tables/ azsdk-go-tables/ azcore/v0.13.4 (go1.16.2; + Windows_NT) + X-Ms-Date: + - Sun, 04 Apr 2021 21:59:10 GMT + X-Ms-Version: + - "2019-02-02" + url: https://chrisstablesprim.table.core.windows.net/Tables('gotable5hickrxl8lpbo') + method: DELETE + response: + body: "" + headers: + Cache-Control: + - no-cache + Content-Length: + - "0" + Date: + - Sun, 04 Apr 2021 21:59:10 GMT + Server: + - Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0 + X-Content-Type-Options: + - nosniff + X-Ms-Request-Id: + - a5bfa35c-3002-0057-299d-299a27000000 + X-Ms-Version: + - "2019-02-02" + status: 204 No Content + code: 204 + duration: "" diff --git a/sdk/tables/aztables/recordings/TestTableClient_Cosmos/TestAddComplexEntity-variables.yaml b/sdk/tables/aztables/recordings/TestTableClient_Cosmos/TestAddComplexEntity-variables.yaml new file mode 100644 index 000000000000..a5295bc78865 --- /dev/null +++ b/sdk/tables/aztables/recordings/TestTableClient_Cosmos/TestAddComplexEntity-variables.yaml @@ -0,0 +1,6 @@ +--- +COSMOS_TABLES_ENDPOINT_SUFFIX: cosmos.azure.com +TABLES_COSMOS_ACCOUNT_NAME: chrisstablesprim +TABLES_PRIMARY_COSMOS_ACCOUNT_KEY: Kg== +now: "2021-04-10T19:18:39.9706889-05:00" +randomSeed: "1618100318" diff --git a/sdk/tables/aztables/recordings/TestTableClient_Cosmos/TestAddComplexEntity.yaml b/sdk/tables/aztables/recordings/TestTableClient_Cosmos/TestAddComplexEntity.yaml new file mode 100644 index 000000000000..a90bdd2b73da --- /dev/null +++ b/sdk/tables/aztables/recordings/TestTableClient_Cosmos/TestAddComplexEntity.yaml @@ -0,0 +1,121 @@ +--- +version: 1 +interactions: +- request: + body: '{"TableName":"gotablexiw8zfw9mws0q"}' + form: {} + headers: + Accept: + - application/json;odata=minimalmetadata + Authorization: + - sanitized + Content-Length: + - "36" + Content-Type: + - application/json + Dataserviceversion: + - "3.0" + User-Agent: + - azsdk-go-tables/ azsdk-go-tables/ azcore/v0.13.4 (go1.16.2; + Windows_NT) + X-Ms-Date: + - Sun, 11 Apr 2021 00:18:38 GMT + X-Ms-Version: + - "2019-02-02" + url: https://chrisstablesprim.table.cosmos.azure.com/Tables + method: POST + response: + body: '{"TableName":"gotablexiw8zfw9mws0q","odata.metadata":"https://chrisstablesprim.table.cosmos.azure.com/$metadata#Tables/@Element"}' + headers: + Content-Type: + - application/json;odata=minimalmetadata + Date: + - Sun, 11 Apr 2021 00:18:39 GMT + Etag: + - W/"datetime'2021-04-11T00%3A18%3A39.0866952Z'" + Location: + - https://chrisstablesprim.table.cosmos.azure.com/Tables('gotablexiw8zfw9mws0q') + Server: + - Microsoft-HTTPAPI/2.0 + X-Ms-Request-Id: + - 8d38468e-c994-404d-90cc-925db534f55f + status: 201 Created + code: 201 + duration: "" +- request: + body: '{"PartitionKey":"partition","RowKey":"row","SomeBinaryProperty":"c29tZSBieXRlcw==","SomeBinaryProperty@odata.type":"Edm.Binary","SomeDateProperty":"2021-04-11T00:18:39.9706889Z","SomeDateProperty@odata.type":"Edm.DateTime","SomeDoubleProperty0":1,"SomeDoubleProperty0@odata.type":"Edm.Double","SomeDoubleProperty1":1.2345,"SomeDoubleProperty1@odata.type":"Edm.Double","SomeGuidProperty":"4346b1a2-6141-483a-779b-1332da28b7d5","SomeGuidProperty@odata.type":"Edm.Guid","SomeInt64Property":"9223372036854775807","SomeInt64Property@odata.type":"Edm.Int64","SomeIntProperty":42,"SomePtrStringProperty":"some + pointer to string","SomeStringProperty":"some string"}' + form: {} + headers: + Accept: + - application/json;odata=minimalmetadata + Authorization: + - sanitized + Content-Length: + - "657" + Content-Type: + - application/json + Dataserviceversion: + - "3.0" + Prefer: + - return-no-content + User-Agent: + - azsdk-go-tables/ azsdk-go-tables/ azcore/v0.13.4 (go1.16.2; + Windows_NT) + X-Ms-Date: + - Sun, 11 Apr 2021 00:18:39 GMT + X-Ms-Version: + - "2019-02-02" + url: https://chrisstablesprim.table.cosmos.azure.com/gotablexiw8zfw9mws0q + method: POST + response: + body: "" + headers: + Content-Length: + - "0" + Date: + - Sun, 11 Apr 2021 00:18:39 GMT + Etag: + - W/"datetime'2021-04-11T00%3A18%3A39.7189128Z'" + Location: + - https://chrisstablesprim.table.cosmos.azure.com/gotablexiw8zfw9mws0q(PartitionKey='partition',RowKey='row') + Preference-Applied: + - return-no-content + Server: + - Microsoft-HTTPAPI/2.0 + X-Ms-Request-Id: + - cec68903-00ae-4306-ae0a-5200c5f8bb60 + status: 204 No Content + code: 204 + duration: "" +- request: + body: "" + form: {} + headers: + Accept: + - application/json + Authorization: + - sanitized + User-Agent: + - azsdk-go-tables/ azsdk-go-tables/ azcore/v0.13.4 (go1.16.2; + Windows_NT) + X-Ms-Date: + - Sun, 11 Apr 2021 00:18:40 GMT + X-Ms-Version: + - "2019-02-02" + url: https://chrisstablesprim.table.cosmos.azure.com/Tables('gotablexiw8zfw9mws0q') + method: DELETE + response: + body: "" + headers: + Content-Length: + - "0" + Date: + - Sun, 11 Apr 2021 00:18:39 GMT + Server: + - Microsoft-HTTPAPI/2.0 + X-Ms-Request-Id: + - ef2e97eb-017c-458b-be6d-9c130a33dfa6 + status: 204 No Content + code: 204 + duration: "" diff --git a/sdk/tables/aztables/recordings/TestTableClient_Cosmos/TestAddEntity-variables.yaml b/sdk/tables/aztables/recordings/TestTableClient_Cosmos/TestAddEntity-variables.yaml new file mode 100644 index 000000000000..dd3226b5e15b --- /dev/null +++ b/sdk/tables/aztables/recordings/TestTableClient_Cosmos/TestAddEntity-variables.yaml @@ -0,0 +1,5 @@ +--- +COSMOS_TABLES_ENDPOINT_SUFFIX: cosmos.azure.com +TABLES_COSMOS_ACCOUNT_NAME: chrisstablesprim +TABLES_PRIMARY_COSMOS_ACCOUNT_KEY: Kg== +randomSeed: "1617580856" diff --git a/sdk/tables/aztables/recordings/TestTableClient_Cosmos/TestAddEntity.yaml b/sdk/tables/aztables/recordings/TestTableClient_Cosmos/TestAddEntity.yaml new file mode 100644 index 000000000000..f8993d0f4f77 --- /dev/null +++ b/sdk/tables/aztables/recordings/TestTableClient_Cosmos/TestAddEntity.yaml @@ -0,0 +1,121 @@ +--- +version: 1 +interactions: +- request: + body: '{"TableName":"gotable7ws4xms1mzf9z"}' + form: {} + headers: + Accept: + - application/json;odata=minimalmetadata + Authorization: + - sanitized + Content-Length: + - "36" + Content-Type: + - application/json + Dataserviceversion: + - "3.0" + User-Agent: + - azsdk-go-tables/ azsdk-go-tables/ azcore/v0.13.4 (go1.16.2; + Windows_NT) + X-Ms-Date: + - Mon, 05 Apr 2021 00:00:56 GMT + X-Ms-Version: + - "2019-02-02" + url: https://chrisstablesprim.table.cosmos.azure.com/Tables + method: POST + response: + body: '{"TableName":"gotable7ws4xms1mzf9z","odata.metadata":"https://chrisstablesprim.table.cosmos.azure.com/$metadata#Tables/@Element"}' + headers: + Content-Type: + - application/json;odata=minimalmetadata + Date: + - Mon, 05 Apr 2021 00:00:56 GMT + Etag: + - W/"datetime'2021-04-05T00%3A00%3A56.5521416Z'" + Location: + - https://chrisstablesprim.table.cosmos.azure.com/Tables('gotable7ws4xms1mzf9z') + Server: + - Microsoft-HTTPAPI/2.0 + X-Ms-Request-Id: + - 9ca87b9a-5e66-4ec1-97d0-0ea03fd04375 + status: 201 Created + code: 201 + duration: "" +- request: + body: '{"BoolProp":true,"IntProp":1,"PartitionKey":"partition","RowKey":"1","StringProp":"some + string 1"}' + form: {} + headers: + Accept: + - application/json;odata=minimalmetadata + Authorization: + - sanitized + Content-Length: + - "98" + Content-Type: + - application/json + Dataserviceversion: + - "3.0" + Prefer: + - return-no-content + User-Agent: + - azsdk-go-tables/ azsdk-go-tables/ azcore/v0.13.4 (go1.16.2; + Windows_NT) + X-Ms-Date: + - Mon, 05 Apr 2021 00:00:57 GMT + X-Ms-Version: + - "2019-02-02" + url: https://chrisstablesprim.table.cosmos.azure.com/gotable7ws4xms1mzf9z + method: POST + response: + body: "" + headers: + Content-Length: + - "0" + Date: + - Mon, 05 Apr 2021 00:00:56 GMT + Etag: + - W/"datetime'2021-04-05T00%3A00%3A57.0277896Z'" + Location: + - https://chrisstablesprim.table.cosmos.azure.com/gotable7ws4xms1mzf9z(PartitionKey='partition',RowKey='1') + Preference-Applied: + - return-no-content + Server: + - Microsoft-HTTPAPI/2.0 + X-Ms-Request-Id: + - 57a01ccb-9f82-4e3c-a2be-601d4ed96b9d + status: 204 No Content + code: 204 + duration: "" +- request: + body: "" + form: {} + headers: + Accept: + - application/json + Authorization: + - sanitized + User-Agent: + - azsdk-go-tables/ azsdk-go-tables/ azcore/v0.13.4 (go1.16.2; + Windows_NT) + X-Ms-Date: + - Mon, 05 Apr 2021 00:00:57 GMT + X-Ms-Version: + - "2019-02-02" + url: https://chrisstablesprim.table.cosmos.azure.com/Tables('gotable7ws4xms1mzf9z') + method: DELETE + response: + body: "" + headers: + Content-Length: + - "0" + Date: + - Mon, 05 Apr 2021 00:00:56 GMT + Server: + - Microsoft-HTTPAPI/2.0 + X-Ms-Request-Id: + - a515445a-2616-4e51-a4ea-bf4a788ad138 + status: 204 No Content + code: 204 + duration: "" diff --git a/sdk/tables/aztables/recordings/TestTableClient_Cosmos/TestBatchAdd-variables.yaml b/sdk/tables/aztables/recordings/TestTableClient_Cosmos/TestBatchAdd-variables.yaml new file mode 100644 index 000000000000..1d74b5b453b7 --- /dev/null +++ b/sdk/tables/aztables/recordings/TestTableClient_Cosmos/TestBatchAdd-variables.yaml @@ -0,0 +1,6 @@ +--- +COSMOS_TABLES_ENDPOINT_SUFFIX: cosmos.azure.com +TABLES_COSMOS_ACCOUNT_NAME: chrisstablesprim +TABLES_PRIMARY_COSMOS_ACCOUNT_KEY: Kg== +now: "2021-05-18T10:39:59.9902777-05:00" +randomSeed: "1621352398" diff --git a/sdk/tables/aztables/recordings/TestTableClient_Cosmos/TestBatchAdd.yaml b/sdk/tables/aztables/recordings/TestTableClient_Cosmos/TestBatchAdd.yaml new file mode 100644 index 000000000000..633e16370940 --- /dev/null +++ b/sdk/tables/aztables/recordings/TestTableClient_Cosmos/TestBatchAdd.yaml @@ -0,0 +1,203 @@ +--- +version: 1 +interactions: +- request: + body: '{"TableName":"gotable9m3drbgv2znqx"}' + form: {} + headers: + Accept: + - application/json;odata=minimalmetadata + Authorization: + - sanitized + Content-Length: + - "36" + Content-Type: + - application/json + Dataserviceversion: + - "3.0" + User-Agent: + - azsdk-go-tables/ azsdk-go-tables/ azcore/v0.13.4 (go1.16.2; + Windows_NT) + X-Ms-Date: + - Tue, 18 May 2021 15:39:58 GMT + X-Ms-Version: + - "2019-02-02" + url: https://chrisstablesprim.table.cosmos.azure.com/Tables + method: POST + response: + body: '{"TableName":"gotable9m3drbgv2znqx","odata.metadata":"https://chrisstablesprim.table.cosmos.azure.com/$metadata#Tables/@Element"}' + headers: + Content-Type: + - application/json;odata=minimalmetadata + Date: + - Tue, 18 May 2021 15:40:00 GMT + Etag: + - W/"datetime'2021-05-18T15%3A40%3A00.0075784Z'" + Location: + - https://chrisstablesprim.table.cosmos.azure.com/Tables('gotable9m3drbgv2znqx') + Server: + - Microsoft-HTTPAPI/2.0 + X-Ms-Request-Id: + - 85c6b886-4404-4b2e-865e-266f59837b2a + status: 201 Ok + code: 201 + duration: "" +- request: + body: "--batch_bae5ce88-edc3-4b25-7b33-be5c7454aefc\r\nContent-Type: multipart/mixed; + boundary=changeset_dd23acc5-a2fb-419d-5006-1de1ca035a9f\r\n\r\n--changeset_dd23acc5-a2fb-419d-5006-1de1ca035a9f\r\nContent-Transfer-Encoding: + binary\r\nContent-Type: application/http\r\n\r\nPOST https://chrisstablesprim.table.cosmos.azure.com/gotable9m3drbgv2znqx?%24format=application%2Fjson%3Bodata%3Dminimalmetadata + HTTP/1.1\r\nAccept: application/json;odata=minimalmetadata\r\nContent-Length: + 663\r\nContent-Type: application/json\r\nDataserviceversion: 3.0\r\nPrefer: + return-no-content\r\nX-Ms-Version: 2019-02-02\r\n\r\n{\"BoolProp\":true,\"IntProp\":1,\"PartitionKey\":\"partition\",\"RowKey\":\"1\",\"SomeBinaryProperty\":\"c29tZSBieXRlcw==\",\"SomeBinaryProperty@odata.type\":\"Edm.Binary\",\"SomeDateProperty\":\"2021-05-18T15:39:59.9902777Z\",\"SomeDateProperty@odata.type\":\"Edm.DateTime\",\"SomeDoubleProperty0\":1,\"SomeDoubleProperty0@odata.type\":\"Edm.Double\",\"SomeDoubleProperty1\":1.2345,\"SomeDoubleProperty1@odata.type\":\"Edm.Double\",\"SomeGuidProperty\":\"1fb643ec-1e6e-4fc0-5606-be23d98cef50\",\"SomeGuidProperty@odata.type\":\"Edm.Guid\",\"SomeInt64Property\":\"9223372036854775807\",\"SomeInt64Property@odata.type\":\"Edm.Int64\",\"SomeIntProperty\":42,\"SomeStringProperty\":\"some + string\",\"StringProp\":\"some string 1\"}\r\n--changeset_dd23acc5-a2fb-419d-5006-1de1ca035a9f\r\nContent-Transfer-Encoding: + binary\r\nContent-Type: application/http\r\n\r\nPOST https://chrisstablesprim.table.cosmos.azure.com/gotable9m3drbgv2znqx?%24format=application%2Fjson%3Bodata%3Dminimalmetadata + HTTP/1.1\r\nAccept: application/json;odata=minimalmetadata\r\nContent-Length: + 663\r\nContent-Type: application/json\r\nDataserviceversion: 3.0\r\nPrefer: + return-no-content\r\nX-Ms-Version: 2019-02-02\r\n\r\n{\"BoolProp\":true,\"IntProp\":2,\"PartitionKey\":\"partition\",\"RowKey\":\"2\",\"SomeBinaryProperty\":\"c29tZSBieXRlcw==\",\"SomeBinaryProperty@odata.type\":\"Edm.Binary\",\"SomeDateProperty\":\"2021-05-18T15:39:59.9902777Z\",\"SomeDateProperty@odata.type\":\"Edm.DateTime\",\"SomeDoubleProperty0\":1,\"SomeDoubleProperty0@odata.type\":\"Edm.Double\",\"SomeDoubleProperty1\":1.2345,\"SomeDoubleProperty1@odata.type\":\"Edm.Double\",\"SomeGuidProperty\":\"24d3bd3d-3e02-4411-580f-5a3a8146d1ed\",\"SomeGuidProperty@odata.type\":\"Edm.Guid\",\"SomeInt64Property\":\"9223372036854775807\",\"SomeInt64Property@odata.type\":\"Edm.Int64\",\"SomeIntProperty\":42,\"SomeStringProperty\":\"some + string\",\"StringProp\":\"some string 2\"}\r\n--changeset_dd23acc5-a2fb-419d-5006-1de1ca035a9f\r\nContent-Transfer-Encoding: + binary\r\nContent-Type: application/http\r\n\r\nPOST https://chrisstablesprim.table.cosmos.azure.com/gotable9m3drbgv2znqx?%24format=application%2Fjson%3Bodata%3Dminimalmetadata + HTTP/1.1\r\nAccept: application/json;odata=minimalmetadata\r\nContent-Length: + 663\r\nContent-Type: application/json\r\nDataserviceversion: 3.0\r\nPrefer: + return-no-content\r\nX-Ms-Version: 2019-02-02\r\n\r\n{\"BoolProp\":true,\"IntProp\":3,\"PartitionKey\":\"partition\",\"RowKey\":\"3\",\"SomeBinaryProperty\":\"c29tZSBieXRlcw==\",\"SomeBinaryProperty@odata.type\":\"Edm.Binary\",\"SomeDateProperty\":\"2021-05-18T15:39:59.9902777Z\",\"SomeDateProperty@odata.type\":\"Edm.DateTime\",\"SomeDoubleProperty0\":1,\"SomeDoubleProperty0@odata.type\":\"Edm.Double\",\"SomeDoubleProperty1\":1.2345,\"SomeDoubleProperty1@odata.type\":\"Edm.Double\",\"SomeGuidProperty\":\"84d4e62a-f422-4b27-6dc2-6c322e138b6d\",\"SomeGuidProperty@odata.type\":\"Edm.Guid\",\"SomeInt64Property\":\"9223372036854775807\",\"SomeInt64Property@odata.type\":\"Edm.Int64\",\"SomeIntProperty\":42,\"SomeStringProperty\":\"some + string\",\"StringProp\":\"some string 3\"}\r\n--changeset_dd23acc5-a2fb-419d-5006-1de1ca035a9f\r\nContent-Transfer-Encoding: + binary\r\nContent-Type: application/http\r\n\r\nPOST https://chrisstablesprim.table.cosmos.azure.com/gotable9m3drbgv2znqx?%24format=application%2Fjson%3Bodata%3Dminimalmetadata + HTTP/1.1\r\nAccept: application/json;odata=minimalmetadata\r\nContent-Length: + 663\r\nContent-Type: application/json\r\nDataserviceversion: 3.0\r\nPrefer: + return-no-content\r\nX-Ms-Version: 2019-02-02\r\n\r\n{\"BoolProp\":true,\"IntProp\":4,\"PartitionKey\":\"partition\",\"RowKey\":\"4\",\"SomeBinaryProperty\":\"c29tZSBieXRlcw==\",\"SomeBinaryProperty@odata.type\":\"Edm.Binary\",\"SomeDateProperty\":\"2021-05-18T15:39:59.9902777Z\",\"SomeDateProperty@odata.type\":\"Edm.DateTime\",\"SomeDoubleProperty0\":1,\"SomeDoubleProperty0@odata.type\":\"Edm.Double\",\"SomeDoubleProperty1\":1.2345,\"SomeDoubleProperty1@odata.type\":\"Edm.Double\",\"SomeGuidProperty\":\"76ce5e7d-a431-4b17-472c-2a589bf333cf\",\"SomeGuidProperty@odata.type\":\"Edm.Guid\",\"SomeInt64Property\":\"9223372036854775807\",\"SomeInt64Property@odata.type\":\"Edm.Int64\",\"SomeIntProperty\":42,\"SomeStringProperty\":\"some + string\",\"StringProp\":\"some string 4\"}\r\n--changeset_dd23acc5-a2fb-419d-5006-1de1ca035a9f\r\nContent-Transfer-Encoding: + binary\r\nContent-Type: application/http\r\n\r\nPOST https://chrisstablesprim.table.cosmos.azure.com/gotable9m3drbgv2znqx?%24format=application%2Fjson%3Bodata%3Dminimalmetadata + HTTP/1.1\r\nAccept: application/json;odata=minimalmetadata\r\nContent-Length: + 663\r\nContent-Type: application/json\r\nDataserviceversion: 3.0\r\nPrefer: + return-no-content\r\nX-Ms-Version: 2019-02-02\r\n\r\n{\"BoolProp\":true,\"IntProp\":5,\"PartitionKey\":\"partition\",\"RowKey\":\"5\",\"SomeBinaryProperty\":\"c29tZSBieXRlcw==\",\"SomeBinaryProperty@odata.type\":\"Edm.Binary\",\"SomeDateProperty\":\"2021-05-18T15:39:59.9902777Z\",\"SomeDateProperty@odata.type\":\"Edm.DateTime\",\"SomeDoubleProperty0\":1,\"SomeDoubleProperty0@odata.type\":\"Edm.Double\",\"SomeDoubleProperty1\":1.2345,\"SomeDoubleProperty1@odata.type\":\"Edm.Double\",\"SomeGuidProperty\":\"39afa2e2-8d46-446d-4141-034427ec5a5c\",\"SomeGuidProperty@odata.type\":\"Edm.Guid\",\"SomeInt64Property\":\"9223372036854775807\",\"SomeInt64Property@odata.type\":\"Edm.Int64\",\"SomeIntProperty\":42,\"SomeStringProperty\":\"some + string\",\"StringProp\":\"some string 5\"}\r\n--changeset_dd23acc5-a2fb-419d-5006-1de1ca035a9f\r\nContent-Transfer-Encoding: + binary\r\nContent-Type: application/http\r\n\r\nPOST https://chrisstablesprim.table.cosmos.azure.com/gotable9m3drbgv2znqx?%24format=application%2Fjson%3Bodata%3Dminimalmetadata + HTTP/1.1\r\nAccept: application/json;odata=minimalmetadata\r\nContent-Length: + 663\r\nContent-Type: application/json\r\nDataserviceversion: 3.0\r\nPrefer: + return-no-content\r\nX-Ms-Version: 2019-02-02\r\n\r\n{\"BoolProp\":true,\"IntProp\":6,\"PartitionKey\":\"partition\",\"RowKey\":\"6\",\"SomeBinaryProperty\":\"c29tZSBieXRlcw==\",\"SomeBinaryProperty@odata.type\":\"Edm.Binary\",\"SomeDateProperty\":\"2021-05-18T15:39:59.9902777Z\",\"SomeDateProperty@odata.type\":\"Edm.DateTime\",\"SomeDoubleProperty0\":1,\"SomeDoubleProperty0@odata.type\":\"Edm.Double\",\"SomeDoubleProperty1\":1.2345,\"SomeDoubleProperty1@odata.type\":\"Edm.Double\",\"SomeGuidProperty\":\"b0bcacc3-0388-4bf4-6e61-0e60dfa720f3\",\"SomeGuidProperty@odata.type\":\"Edm.Guid\",\"SomeInt64Property\":\"9223372036854775807\",\"SomeInt64Property@odata.type\":\"Edm.Int64\",\"SomeIntProperty\":42,\"SomeStringProperty\":\"some + string\",\"StringProp\":\"some string 6\"}\r\n--changeset_dd23acc5-a2fb-419d-5006-1de1ca035a9f\r\nContent-Transfer-Encoding: + binary\r\nContent-Type: application/http\r\n\r\nPOST https://chrisstablesprim.table.cosmos.azure.com/gotable9m3drbgv2znqx?%24format=application%2Fjson%3Bodata%3Dminimalmetadata + HTTP/1.1\r\nAccept: application/json;odata=minimalmetadata\r\nContent-Length: + 663\r\nContent-Type: application/json\r\nDataserviceversion: 3.0\r\nPrefer: + return-no-content\r\nX-Ms-Version: 2019-02-02\r\n\r\n{\"BoolProp\":true,\"IntProp\":7,\"PartitionKey\":\"partition\",\"RowKey\":\"7\",\"SomeBinaryProperty\":\"c29tZSBieXRlcw==\",\"SomeBinaryProperty@odata.type\":\"Edm.Binary\",\"SomeDateProperty\":\"2021-05-18T15:39:59.9902777Z\",\"SomeDateProperty@odata.type\":\"Edm.DateTime\",\"SomeDoubleProperty0\":1,\"SomeDoubleProperty0@odata.type\":\"Edm.Double\",\"SomeDoubleProperty1\":1.2345,\"SomeDoubleProperty1@odata.type\":\"Edm.Double\",\"SomeGuidProperty\":\"6f8a8185-7c64-437c-451b-3dcde76a19d1\",\"SomeGuidProperty@odata.type\":\"Edm.Guid\",\"SomeInt64Property\":\"9223372036854775807\",\"SomeInt64Property@odata.type\":\"Edm.Int64\",\"SomeIntProperty\":42,\"SomeStringProperty\":\"some + string\",\"StringProp\":\"some string 7\"}\r\n--changeset_dd23acc5-a2fb-419d-5006-1de1ca035a9f\r\nContent-Transfer-Encoding: + binary\r\nContent-Type: application/http\r\n\r\nPOST https://chrisstablesprim.table.cosmos.azure.com/gotable9m3drbgv2znqx?%24format=application%2Fjson%3Bodata%3Dminimalmetadata + HTTP/1.1\r\nAccept: application/json;odata=minimalmetadata\r\nContent-Length: + 663\r\nContent-Type: application/json\r\nDataserviceversion: 3.0\r\nPrefer: + return-no-content\r\nX-Ms-Version: 2019-02-02\r\n\r\n{\"BoolProp\":true,\"IntProp\":8,\"PartitionKey\":\"partition\",\"RowKey\":\"8\",\"SomeBinaryProperty\":\"c29tZSBieXRlcw==\",\"SomeBinaryProperty@odata.type\":\"Edm.Binary\",\"SomeDateProperty\":\"2021-05-18T15:39:59.9902777Z\",\"SomeDateProperty@odata.type\":\"Edm.DateTime\",\"SomeDoubleProperty0\":1,\"SomeDoubleProperty0@odata.type\":\"Edm.Double\",\"SomeDoubleProperty1\":1.2345,\"SomeDoubleProperty1@odata.type\":\"Edm.Double\",\"SomeGuidProperty\":\"3d524c9f-5e29-42bf-5626-8d39c21fb846\",\"SomeGuidProperty@odata.type\":\"Edm.Guid\",\"SomeInt64Property\":\"9223372036854775807\",\"SomeInt64Property@odata.type\":\"Edm.Int64\",\"SomeIntProperty\":42,\"SomeStringProperty\":\"some + string\",\"StringProp\":\"some string 8\"}\r\n--changeset_dd23acc5-a2fb-419d-5006-1de1ca035a9f\r\nContent-Transfer-Encoding: + binary\r\nContent-Type: application/http\r\n\r\nPOST https://chrisstablesprim.table.cosmos.azure.com/gotable9m3drbgv2znqx?%24format=application%2Fjson%3Bodata%3Dminimalmetadata + HTTP/1.1\r\nAccept: application/json;odata=minimalmetadata\r\nContent-Length: + 663\r\nContent-Type: application/json\r\nDataserviceversion: 3.0\r\nPrefer: + return-no-content\r\nX-Ms-Version: 2019-02-02\r\n\r\n{\"BoolProp\":true,\"IntProp\":9,\"PartitionKey\":\"partition\",\"RowKey\":\"9\",\"SomeBinaryProperty\":\"c29tZSBieXRlcw==\",\"SomeBinaryProperty@odata.type\":\"Edm.Binary\",\"SomeDateProperty\":\"2021-05-18T15:39:59.9902777Z\",\"SomeDateProperty@odata.type\":\"Edm.DateTime\",\"SomeDoubleProperty0\":1,\"SomeDoubleProperty0@odata.type\":\"Edm.Double\",\"SomeDoubleProperty1\":1.2345,\"SomeDoubleProperty1@odata.type\":\"Edm.Double\",\"SomeGuidProperty\":\"8b8c218f-b30b-40bc-62c0-92f1c52bebf9\",\"SomeGuidProperty@odata.type\":\"Edm.Guid\",\"SomeInt64Property\":\"9223372036854775807\",\"SomeInt64Property@odata.type\":\"Edm.Int64\",\"SomeIntProperty\":42,\"SomeStringProperty\":\"some + string\",\"StringProp\":\"some string 9\"}\r\n--changeset_dd23acc5-a2fb-419d-5006-1de1ca035a9f\r\nContent-Transfer-Encoding: + binary\r\nContent-Type: application/http\r\n\r\nPOST https://chrisstablesprim.table.cosmos.azure.com/gotable9m3drbgv2znqx?%24format=application%2Fjson%3Bodata%3Dminimalmetadata + HTTP/1.1\r\nAccept: application/json;odata=minimalmetadata\r\nContent-Length: + 666\r\nContent-Type: application/json\r\nDataserviceversion: 3.0\r\nPrefer: + return-no-content\r\nX-Ms-Version: 2019-02-02\r\n\r\n{\"BoolProp\":true,\"IntProp\":10,\"PartitionKey\":\"partition\",\"RowKey\":\"10\",\"SomeBinaryProperty\":\"c29tZSBieXRlcw==\",\"SomeBinaryProperty@odata.type\":\"Edm.Binary\",\"SomeDateProperty\":\"2021-05-18T15:39:59.9902777Z\",\"SomeDateProperty@odata.type\":\"Edm.DateTime\",\"SomeDoubleProperty0\":1,\"SomeDoubleProperty0@odata.type\":\"Edm.Double\",\"SomeDoubleProperty1\":1.2345,\"SomeDoubleProperty1@odata.type\":\"Edm.Double\",\"SomeGuidProperty\":\"c1891fd1-e63b-4c16-7b74-1502bcab7668\",\"SomeGuidProperty@odata.type\":\"Edm.Guid\",\"SomeInt64Property\":\"9223372036854775807\",\"SomeInt64Property@odata.type\":\"Edm.Int64\",\"SomeIntProperty\":42,\"SomeStringProperty\":\"some + string\",\"StringProp\":\"some string 10\"}\r\n--changeset_dd23acc5-a2fb-419d-5006-1de1ca035a9f--\r\n\r\n--batch_bae5ce88-edc3-4b25-7b33-be5c7454aefc--\r\n" + form: {} + headers: + Accept: + - application/json;odata=minimalmetadata + Authorization: + - sanitized + Content-Length: + - "11281" + Content-Type: + - multipart/mixed; boundary=batch_bae5ce88-edc3-4b25-7b33-be5c7454aefc + Dataserviceversion: + - "3.0" + User-Agent: + - azsdk-go-tables/ azcore/v0.13.4 (go1.16.2; Windows_NT) + X-Ms-Date: + - Tue, 18 May 2021 15:39:59 GMT + X-Ms-Version: + - "2019-02-02" + url: https://chrisstablesprim.table.cosmos.azure.com/$batch + method: POST + response: + body: "--batchresponse_38a3240d-92fd-45d7-a9f4-1507ec60bf61\r\nContent-Type: multipart/mixed; + boundary=changesetresponse_69a6b8e4-6cec-4fb2-a7f3-975a3df93882\r\n\r\n--changesetresponse_69a6b8e4-6cec-4fb2-a7f3-975a3df93882\nContent-Type: + application/http\nContent-Transfer-Encoding: binary\n\nHTTP/1.1 204 No Content\r\nETag: + W/\"datetime'2021-05-18T15%3A40%3A00.4656136Z'\"\r\nPreference-Applied: return-no-content\r\nLocation: + https://chrisstablesprim.table.cosmos.azure.com/gotable9m3drbgv2znqx(PartitionKey='partition',RowKey='1')\r\nContent-ID: + 1\r\n\r\n\r\n--changesetresponse_69a6b8e4-6cec-4fb2-a7f3-975a3df93882\nContent-Type: + application/http\nContent-Transfer-Encoding: binary\n\nHTTP/1.1 204 No Content\r\nETag: + W/\"datetime'2021-05-18T15%3A40%3A00.4663304Z'\"\r\nPreference-Applied: return-no-content\r\nLocation: + https://chrisstablesprim.table.cosmos.azure.com/gotable9m3drbgv2znqx(PartitionKey='partition',RowKey='2')\r\nContent-ID: + 2\r\n\r\n\r\n--changesetresponse_69a6b8e4-6cec-4fb2-a7f3-975a3df93882\nContent-Type: + application/http\nContent-Transfer-Encoding: binary\n\nHTTP/1.1 204 No Content\r\nETag: + W/\"datetime'2021-05-18T15%3A40%3A00.4669448Z'\"\r\nPreference-Applied: return-no-content\r\nLocation: + https://chrisstablesprim.table.cosmos.azure.com/gotable9m3drbgv2znqx(PartitionKey='partition',RowKey='3')\r\nContent-ID: + 3\r\n\r\n\r\n--changesetresponse_69a6b8e4-6cec-4fb2-a7f3-975a3df93882\nContent-Type: + application/http\nContent-Transfer-Encoding: binary\n\nHTTP/1.1 204 No Content\r\nETag: + W/\"datetime'2021-05-18T15%3A40%3A00.4675592Z'\"\r\nPreference-Applied: return-no-content\r\nLocation: + https://chrisstablesprim.table.cosmos.azure.com/gotable9m3drbgv2znqx(PartitionKey='partition',RowKey='4')\r\nContent-ID: + 4\r\n\r\n\r\n--changesetresponse_69a6b8e4-6cec-4fb2-a7f3-975a3df93882\nContent-Type: + application/http\nContent-Transfer-Encoding: binary\n\nHTTP/1.1 204 No Content\r\nETag: + W/\"datetime'2021-05-18T15%3A40%3A00.4680712Z'\"\r\nPreference-Applied: return-no-content\r\nLocation: + https://chrisstablesprim.table.cosmos.azure.com/gotable9m3drbgv2znqx(PartitionKey='partition',RowKey='5')\r\nContent-ID: + 5\r\n\r\n\r\n--changesetresponse_69a6b8e4-6cec-4fb2-a7f3-975a3df93882\nContent-Type: + application/http\nContent-Transfer-Encoding: binary\n\nHTTP/1.1 204 No Content\r\nETag: + W/\"datetime'2021-05-18T15%3A40%3A00.4685832Z'\"\r\nPreference-Applied: return-no-content\r\nLocation: + https://chrisstablesprim.table.cosmos.azure.com/gotable9m3drbgv2znqx(PartitionKey='partition',RowKey='6')\r\nContent-ID: + 6\r\n\r\n\r\n--changesetresponse_69a6b8e4-6cec-4fb2-a7f3-975a3df93882\nContent-Type: + application/http\nContent-Transfer-Encoding: binary\n\nHTTP/1.1 204 No Content\r\nETag: + W/\"datetime'2021-05-18T15%3A40%3A00.4689928Z'\"\r\nPreference-Applied: return-no-content\r\nLocation: + https://chrisstablesprim.table.cosmos.azure.com/gotable9m3drbgv2znqx(PartitionKey='partition',RowKey='7')\r\nContent-ID: + 7\r\n\r\n\r\n--changesetresponse_69a6b8e4-6cec-4fb2-a7f3-975a3df93882\nContent-Type: + application/http\nContent-Transfer-Encoding: binary\n\nHTTP/1.1 204 No Content\r\nETag: + W/\"datetime'2021-05-18T15%3A40%3A00.4695048Z'\"\r\nPreference-Applied: return-no-content\r\nLocation: + https://chrisstablesprim.table.cosmos.azure.com/gotable9m3drbgv2znqx(PartitionKey='partition',RowKey='8')\r\nContent-ID: + 8\r\n\r\n\r\n--changesetresponse_69a6b8e4-6cec-4fb2-a7f3-975a3df93882\nContent-Type: + application/http\nContent-Transfer-Encoding: binary\n\nHTTP/1.1 204 No Content\r\nETag: + W/\"datetime'2021-05-18T15%3A40%3A00.4699144Z'\"\r\nPreference-Applied: return-no-content\r\nLocation: + https://chrisstablesprim.table.cosmos.azure.com/gotable9m3drbgv2znqx(PartitionKey='partition',RowKey='9')\r\nContent-ID: + 9\r\n\r\n\r\n--changesetresponse_69a6b8e4-6cec-4fb2-a7f3-975a3df93882\nContent-Type: + application/http\nContent-Transfer-Encoding: binary\n\nHTTP/1.1 204 No Content\r\nETag: + W/\"datetime'2021-05-18T15%3A40%3A00.4703240Z'\"\r\nPreference-Applied: return-no-content\r\nLocation: + https://chrisstablesprim.table.cosmos.azure.com/gotable9m3drbgv2znqx(PartitionKey='partition',RowKey='10')\r\nContent-ID: + 10\r\n\r\n\r\n--changesetresponse_69a6b8e4-6cec-4fb2-a7f3-975a3df93882--\n--batchresponse_38a3240d-92fd-45d7-a9f4-1507ec60bf61--\r\n" + headers: + Content-Type: + - multipart/mixed; boundary=batchresponse_38a3240d-92fd-45d7-a9f4-1507ec60bf61 + Date: + - Tue, 18 May 2021 15:40:00 GMT + Server: + - Microsoft-HTTPAPI/2.0 + X-Ms-Request-Id: + - 24146f57-712a-4890-923b-e24eb0f41461 + status: 202 Accepted + code: 202 + duration: "" +- request: + body: "" + form: {} + headers: + Accept: + - application/json + Authorization: + - sanitized + User-Agent: + - azsdk-go-tables/ azsdk-go-tables/ azcore/v0.13.4 (go1.16.2; + Windows_NT) + X-Ms-Date: + - Tue, 18 May 2021 15:40:00 GMT + X-Ms-Version: + - "2019-02-02" + url: https://chrisstablesprim.table.cosmos.azure.com/Tables('gotable9m3drbgv2znqx') + method: DELETE + response: + body: "" + headers: + Content-Length: + - "0" + Date: + - Tue, 18 May 2021 15:40:00 GMT + Server: + - Microsoft-HTTPAPI/2.0 + X-Ms-Request-Id: + - 51bb42ce-1f87-455b-a029-6d83ef15ef14 + status: 204 No Content + code: 204 + duration: "" diff --git a/sdk/tables/aztables/recordings/TestTableClient_Cosmos/TestBatchError-variables.yaml b/sdk/tables/aztables/recordings/TestTableClient_Cosmos/TestBatchError-variables.yaml new file mode 100644 index 000000000000..62baaafd7ab9 --- /dev/null +++ b/sdk/tables/aztables/recordings/TestTableClient_Cosmos/TestBatchError-variables.yaml @@ -0,0 +1,6 @@ +--- +COSMOS_TABLES_ENDPOINT_SUFFIX: cosmos.azure.com +TABLES_COSMOS_ACCOUNT_NAME: chrisstablesprim +TABLES_PRIMARY_COSMOS_ACCOUNT_KEY: Kg== +now: "2021-05-21T13:23:34.3457407-05:00" +randomSeed: "1621621412" diff --git a/sdk/tables/aztables/recordings/TestTableClient_Cosmos/TestBatchError.yaml b/sdk/tables/aztables/recordings/TestTableClient_Cosmos/TestBatchError.yaml new file mode 100644 index 000000000000..1957a9d8bae5 --- /dev/null +++ b/sdk/tables/aztables/recordings/TestTableClient_Cosmos/TestBatchError.yaml @@ -0,0 +1,177 @@ +--- +version: 1 +interactions: +- request: + body: '{"TableName":"gotabletzmby34yuxg6n"}' + form: {} + headers: + Accept: + - application/json;odata=minimalmetadata + Authorization: + - sanitized + Content-Length: + - "36" + Content-Type: + - application/json + Dataserviceversion: + - "3.0" + User-Agent: + - azsdk-go-tables/ azsdk-go-tables/ azcore/v0.16.1 (go1.16.2; + Windows_NT) + X-Ms-Date: + - Fri, 21 May 2021 18:23:32 GMT + X-Ms-Version: + - "2019-02-02" + url: https://chrisstablesprim.table.cosmos.azure.com/Tables + method: POST + response: + body: '{"TableName":"gotabletzmby34yuxg6n","odata.metadata":"https://chrisstablesprim.table.cosmos.azure.com/$metadata#Tables/@Element"}' + headers: + Content-Type: + - application/json;odata=minimalmetadata + Date: + - Fri, 21 May 2021 18:23:34 GMT + Etag: + - W/"datetime'2021-05-21T18%3A23%3A34.0203016Z'" + Location: + - https://chrisstablesprim.table.cosmos.azure.com/Tables('gotabletzmby34yuxg6n') + Server: + - Microsoft-HTTPAPI/2.0 + X-Ms-Request-Id: + - fc4b4542-c0a5-4264-a7ee-fecd96b9b9b4 + status: 201 Ok + code: 201 + duration: "" +- request: + body: '{"BoolProp":true,"IntProp":3,"PartitionKey":"partition","RowKey":"3","SomeBinaryProperty":"c29tZSBieXRlcw==","SomeBinaryProperty@odata.type":"Edm.Binary","SomeDateProperty":"2021-05-21T18:23:34.3457407Z","SomeDateProperty@odata.type":"Edm.DateTime","SomeDoubleProperty0":1,"SomeDoubleProperty0@odata.type":"Edm.Double","SomeDoubleProperty1":1.2345,"SomeDoubleProperty1@odata.type":"Edm.Double","SomeGuidProperty":"4d7bd7de-2c53-477c-4d41-30b23d6c6016","SomeGuidProperty@odata.type":"Edm.Guid","SomeInt64Property":"9223372036854775807","SomeInt64Property@odata.type":"Edm.Int64","SomeIntProperty":42,"SomeStringProperty":"some + string","StringProp":"some string 3"}' + form: {} + headers: + Accept: + - application/json;odata=minimalmetadata + Authorization: + - sanitized + Content-Length: + - "663" + Content-Type: + - application/json + Dataserviceversion: + - "3.0" + Prefer: + - return-no-content + User-Agent: + - azsdk-go-tables/ azsdk-go-tables/ azcore/v0.16.1 (go1.16.2; + Windows_NT) + X-Ms-Date: + - Fri, 21 May 2021 18:23:34 GMT + X-Ms-Version: + - "2019-02-02" + url: https://chrisstablesprim.table.cosmos.azure.com/gotabletzmby34yuxg6n + method: POST + response: + body: "" + headers: + Content-Length: + - "0" + Date: + - Fri, 21 May 2021 18:23:34 GMT + Etag: + - W/"datetime'2021-05-21T18%3A23%3A34.5252360Z'" + Location: + - https://chrisstablesprim.table.cosmos.azure.com/gotabletzmby34yuxg6n(PartitionKey='partition',RowKey='3') + Preference-Applied: + - return-no-content + Server: + - Microsoft-HTTPAPI/2.0 + X-Ms-Request-Id: + - 86973fa6-1d80-4ca1-ab39-2af2c5bf73a5 + status: 204 No Content + code: 204 + duration: "" +- request: + body: "--batch_9e5262f4-1bac-49aa-5e98-659e96cc8629\r\nContent-Type: multipart/mixed; + boundary=changeset_03f12eec-7a2f-46c8-78a3-30799f56b3c0\r\n\r\n--changeset_03f12eec-7a2f-46c8-78a3-30799f56b3c0\r\nContent-Transfer-Encoding: + binary\r\nContent-Type: application/http\r\n\r\nPOST https://chrisstablesprim.table.cosmos.azure.com/gotabletzmby34yuxg6n?%24format=application%2Fjson%3Bodata%3Dminimalmetadata + HTTP/1.1\r\nAccept: application/json;odata=minimalmetadata\r\nContent-Length: + 663\r\nContent-Type: application/json\r\nDataserviceversion: 3.0\r\nPrefer: + return-no-content\r\nX-Ms-Version: 2019-02-02\r\n\r\n{\"BoolProp\":true,\"IntProp\":1,\"PartitionKey\":\"partition\",\"RowKey\":\"1\",\"SomeBinaryProperty\":\"c29tZSBieXRlcw==\",\"SomeBinaryProperty@odata.type\":\"Edm.Binary\",\"SomeDateProperty\":\"2021-05-21T18:23:34.3457407Z\",\"SomeDateProperty@odata.type\":\"Edm.DateTime\",\"SomeDoubleProperty0\":1,\"SomeDoubleProperty0@odata.type\":\"Edm.Double\",\"SomeDoubleProperty1\":1.2345,\"SomeDoubleProperty1@odata.type\":\"Edm.Double\",\"SomeGuidProperty\":\"b5d5aa35-2089-4822-604b-edcdba3d0e2e\",\"SomeGuidProperty@odata.type\":\"Edm.Guid\",\"SomeInt64Property\":\"9223372036854775807\",\"SomeInt64Property@odata.type\":\"Edm.Int64\",\"SomeIntProperty\":42,\"SomeStringProperty\":\"some + string\",\"StringProp\":\"some string 1\"}\r\n--changeset_03f12eec-7a2f-46c8-78a3-30799f56b3c0\r\nContent-Transfer-Encoding: + binary\r\nContent-Type: application/http\r\n\r\nPOST https://chrisstablesprim.table.cosmos.azure.com/gotabletzmby34yuxg6n?%24format=application%2Fjson%3Bodata%3Dminimalmetadata + HTTP/1.1\r\nAccept: application/json;odata=minimalmetadata\r\nContent-Length: + 663\r\nContent-Type: application/json\r\nDataserviceversion: 3.0\r\nPrefer: + return-no-content\r\nX-Ms-Version: 2019-02-02\r\n\r\n{\"BoolProp\":true,\"IntProp\":2,\"PartitionKey\":\"partition\",\"RowKey\":\"2\",\"SomeBinaryProperty\":\"c29tZSBieXRlcw==\",\"SomeBinaryProperty@odata.type\":\"Edm.Binary\",\"SomeDateProperty\":\"2021-05-21T18:23:34.3457407Z\",\"SomeDateProperty@odata.type\":\"Edm.DateTime\",\"SomeDoubleProperty0\":1,\"SomeDoubleProperty0@odata.type\":\"Edm.Double\",\"SomeDoubleProperty1\":1.2345,\"SomeDoubleProperty1@odata.type\":\"Edm.Double\",\"SomeGuidProperty\":\"e88aeec4-8336-490d-5024-b16bb25b3a57\",\"SomeGuidProperty@odata.type\":\"Edm.Guid\",\"SomeInt64Property\":\"9223372036854775807\",\"SomeInt64Property@odata.type\":\"Edm.Int64\",\"SomeIntProperty\":42,\"SomeStringProperty\":\"some + string\",\"StringProp\":\"some string 2\"}\r\n--changeset_03f12eec-7a2f-46c8-78a3-30799f56b3c0\r\nContent-Transfer-Encoding: + binary\r\nContent-Type: application/http\r\n\r\nPOST https://chrisstablesprim.table.cosmos.azure.com/gotabletzmby34yuxg6n?%24format=application%2Fjson%3Bodata%3Dminimalmetadata + HTTP/1.1\r\nAccept: application/json;odata=minimalmetadata\r\nContent-Length: + 663\r\nContent-Type: application/json\r\nDataserviceversion: 3.0\r\nPrefer: + return-no-content\r\nX-Ms-Version: 2019-02-02\r\n\r\n{\"BoolProp\":true,\"IntProp\":3,\"PartitionKey\":\"partition\",\"RowKey\":\"3\",\"SomeBinaryProperty\":\"c29tZSBieXRlcw==\",\"SomeBinaryProperty@odata.type\":\"Edm.Binary\",\"SomeDateProperty\":\"2021-05-21T18:23:34.3457407Z\",\"SomeDateProperty@odata.type\":\"Edm.DateTime\",\"SomeDoubleProperty0\":1,\"SomeDoubleProperty0@odata.type\":\"Edm.Double\",\"SomeDoubleProperty1\":1.2345,\"SomeDoubleProperty1@odata.type\":\"Edm.Double\",\"SomeGuidProperty\":\"4d7bd7de-2c53-477c-4d41-30b23d6c6016\",\"SomeGuidProperty@odata.type\":\"Edm.Guid\",\"SomeInt64Property\":\"9223372036854775807\",\"SomeInt64Property@odata.type\":\"Edm.Int64\",\"SomeIntProperty\":42,\"SomeStringProperty\":\"some + string\",\"StringProp\":\"some string 3\"}\r\n--changeset_03f12eec-7a2f-46c8-78a3-30799f56b3c0--\r\n\r\n--batch_9e5262f4-1bac-49aa-5e98-659e96cc8629--\r\n" + form: {} + headers: + Accept: + - application/json;odata=minimalmetadata + Authorization: + - sanitized + Content-Length: + - "3550" + Content-Type: + - multipart/mixed; boundary=batch_9e5262f4-1bac-49aa-5e98-659e96cc8629 + Dataserviceversion: + - "3.0" + User-Agent: + - azsdk-go-tables/ azcore/v0.16.1 (go1.16.2; Windows_NT) + X-Ms-Date: + - Fri, 21 May 2021 18:23:34 GMT + X-Ms-Version: + - "2019-02-02" + url: https://chrisstablesprim.table.cosmos.azure.com/$batch + method: POST + response: + body: "--batchresponse_2c374acb-11fe-45dd-abb9-b8fa0285e378\r\nContent-Type: multipart/mixed; + boundary=changesetresponse_2a51fb17-83d0-47ff-ab71-943237da06ed\r\n\r\n--changesetresponse_2a51fb17-83d0-47ff-ab71-943237da06ed\nContent-Type: + application/http\nContent-Transfer-Encoding: binary\n\nHTTP/1.1 409 Conflict\r\nContent-Type: + application/json;odata=fullmetadata\r\n\r\n{\"odata.error\":{\"code\":\"EntityAlreadyExists\",\"message\":{\"lang\":\"en-us\",\"value\":\"2:The + specified entity already exists.\\n\\nRequestID:d2475065-a351-4a8b-92cc-ad5777e346de\\n\"}}}\r\n--changesetresponse_2a51fb17-83d0-47ff-ab71-943237da06ed--\n--batchresponse_2c374acb-11fe-45dd-abb9-b8fa0285e378--\r\n" + headers: + Content-Type: + - multipart/mixed; boundary=batchresponse_2c374acb-11fe-45dd-abb9-b8fa0285e378 + Date: + - Fri, 21 May 2021 18:23:34 GMT + Server: + - Microsoft-HTTPAPI/2.0 + X-Ms-Request-Id: + - d2475065-a351-4a8b-92cc-ad5777e346de + status: 202 Accepted + code: 202 + duration: "" +- request: + body: "" + form: {} + headers: + Accept: + - application/json + Authorization: + - sanitized + User-Agent: + - azsdk-go-tables/ azsdk-go-tables/ azcore/v0.16.1 (go1.16.2; + Windows_NT) + X-Ms-Date: + - Fri, 21 May 2021 18:23:34 GMT + X-Ms-Version: + - "2019-02-02" + url: https://chrisstablesprim.table.cosmos.azure.com/Tables('gotabletzmby34yuxg6n') + method: DELETE + response: + body: "" + headers: + Content-Length: + - "0" + Date: + - Fri, 21 May 2021 18:23:34 GMT + Server: + - Microsoft-HTTPAPI/2.0 + X-Ms-Request-Id: + - 4005b91f-1bc7-4149-9f87-9ed556c393de + status: 204 No Content + code: 204 + duration: "" diff --git a/sdk/tables/aztables/recordings/TestTableClient_Cosmos/TestBatchMixed-variables.yaml b/sdk/tables/aztables/recordings/TestTableClient_Cosmos/TestBatchMixed-variables.yaml new file mode 100644 index 000000000000..b41be654bf47 --- /dev/null +++ b/sdk/tables/aztables/recordings/TestTableClient_Cosmos/TestBatchMixed-variables.yaml @@ -0,0 +1,6 @@ +--- +COSMOS_TABLES_ENDPOINT_SUFFIX: cosmos.azure.com +TABLES_COSMOS_ACCOUNT_NAME: chrisstablesprim +TABLES_PRIMARY_COSMOS_ACCOUNT_KEY: Kg== +now: "2021-05-21T14:41:05.1021027-05:00" +randomSeed: "1621626063" diff --git a/sdk/tables/aztables/recordings/TestTableClient_Cosmos/TestBatchMixed.yaml b/sdk/tables/aztables/recordings/TestTableClient_Cosmos/TestBatchMixed.yaml new file mode 100644 index 000000000000..376c67befeb3 --- /dev/null +++ b/sdk/tables/aztables/recordings/TestTableClient_Cosmos/TestBatchMixed.yaml @@ -0,0 +1,281 @@ +--- +version: 1 +interactions: +- request: + body: '{"TableName":"gotable3m8dvqbvcbgmg"}' + form: {} + headers: + Accept: + - application/json;odata=minimalmetadata + Authorization: + - sanitized + Content-Length: + - "36" + Content-Type: + - application/json + Dataserviceversion: + - "3.0" + User-Agent: + - azsdk-go-tables/ azsdk-go-tables/ azcore/v0.16.1 (go1.16.2; + Windows_NT) + X-Ms-Date: + - Fri, 21 May 2021 19:41:03 GMT + X-Ms-Version: + - "2019-02-02" + url: https://chrisstablesprim.table.cosmos.azure.com/Tables + method: POST + response: + body: '{"TableName":"gotable3m8dvqbvcbgmg","odata.metadata":"https://chrisstablesprim.table.cosmos.azure.com/$metadata#Tables/@Element"}' + headers: + Content-Type: + - application/json;odata=minimalmetadata + Date: + - Fri, 21 May 2021 19:41:04 GMT + Etag: + - W/"datetime'2021-05-21T19%3A41%3A04.7087112Z'" + Location: + - https://chrisstablesprim.table.cosmos.azure.com/Tables('gotable3m8dvqbvcbgmg') + Server: + - Microsoft-HTTPAPI/2.0 + X-Ms-Request-Id: + - 3f6441cb-4700-494e-9552-bfe42d0f6ce0 + status: 201 Ok + code: 201 + duration: "" +- request: + body: "--batch_80320635-4aac-4149-7852-98d9c153d70c\r\nContent-Type: multipart/mixed; + boundary=changeset_f291243d-1675-4bd4-7c0d-8f9c37b602db\r\n\r\n--changeset_f291243d-1675-4bd4-7c0d-8f9c37b602db\r\nContent-Transfer-Encoding: + binary\r\nContent-Type: application/http\r\n\r\nPOST https://chrisstablesprim.table.cosmos.azure.com/gotable3m8dvqbvcbgmg?%24format=application%2Fjson%3Bodata%3Dminimalmetadata + HTTP/1.1\r\nAccept: application/json;odata=minimalmetadata\r\nContent-Length: + 663\r\nContent-Type: application/json\r\nDataserviceversion: 3.0\r\nPrefer: + return-no-content\r\nX-Ms-Version: 2019-02-02\r\n\r\n{\"BoolProp\":true,\"IntProp\":1,\"PartitionKey\":\"partition\",\"RowKey\":\"1\",\"SomeBinaryProperty\":\"c29tZSBieXRlcw==\",\"SomeBinaryProperty@odata.type\":\"Edm.Binary\",\"SomeDateProperty\":\"2021-05-21T19:41:05.1021027Z\",\"SomeDateProperty@odata.type\":\"Edm.DateTime\",\"SomeDoubleProperty0\":1,\"SomeDoubleProperty0@odata.type\":\"Edm.Double\",\"SomeDoubleProperty1\":1.2345,\"SomeDoubleProperty1@odata.type\":\"Edm.Double\",\"SomeGuidProperty\":\"c4d3ae3f-7292-4e24-6ba8-2e7aeb230a6a\",\"SomeGuidProperty@odata.type\":\"Edm.Guid\",\"SomeInt64Property\":\"9223372036854775807\",\"SomeInt64Property@odata.type\":\"Edm.Int64\",\"SomeIntProperty\":42,\"SomeStringProperty\":\"some + string\",\"StringProp\":\"some string 1\"}\r\n--changeset_f291243d-1675-4bd4-7c0d-8f9c37b602db\r\nContent-Transfer-Encoding: + binary\r\nContent-Type: application/http\r\n\r\nPOST https://chrisstablesprim.table.cosmos.azure.com/gotable3m8dvqbvcbgmg?%24format=application%2Fjson%3Bodata%3Dminimalmetadata + HTTP/1.1\r\nAccept: application/json;odata=minimalmetadata\r\nContent-Length: + 663\r\nContent-Type: application/json\r\nDataserviceversion: 3.0\r\nPrefer: + return-no-content\r\nX-Ms-Version: 2019-02-02\r\n\r\n{\"BoolProp\":true,\"IntProp\":2,\"PartitionKey\":\"partition\",\"RowKey\":\"2\",\"SomeBinaryProperty\":\"c29tZSBieXRlcw==\",\"SomeBinaryProperty@odata.type\":\"Edm.Binary\",\"SomeDateProperty\":\"2021-05-21T19:41:05.1021027Z\",\"SomeDateProperty@odata.type\":\"Edm.DateTime\",\"SomeDoubleProperty0\":1,\"SomeDoubleProperty0@odata.type\":\"Edm.Double\",\"SomeDoubleProperty1\":1.2345,\"SomeDoubleProperty1@odata.type\":\"Edm.Double\",\"SomeGuidProperty\":\"1180f1b3-b1de-48ad-71c4-ef4f70b3b49a\",\"SomeGuidProperty@odata.type\":\"Edm.Guid\",\"SomeInt64Property\":\"9223372036854775807\",\"SomeInt64Property@odata.type\":\"Edm.Int64\",\"SomeIntProperty\":42,\"SomeStringProperty\":\"some + string\",\"StringProp\":\"some string 2\"}\r\n--changeset_f291243d-1675-4bd4-7c0d-8f9c37b602db\r\nContent-Transfer-Encoding: + binary\r\nContent-Type: application/http\r\n\r\nPOST https://chrisstablesprim.table.cosmos.azure.com/gotable3m8dvqbvcbgmg?%24format=application%2Fjson%3Bodata%3Dminimalmetadata + HTTP/1.1\r\nAccept: application/json;odata=minimalmetadata\r\nContent-Length: + 663\r\nContent-Type: application/json\r\nDataserviceversion: 3.0\r\nPrefer: + return-no-content\r\nX-Ms-Version: 2019-02-02\r\n\r\n{\"BoolProp\":true,\"IntProp\":3,\"PartitionKey\":\"partition\",\"RowKey\":\"3\",\"SomeBinaryProperty\":\"c29tZSBieXRlcw==\",\"SomeBinaryProperty@odata.type\":\"Edm.Binary\",\"SomeDateProperty\":\"2021-05-21T19:41:05.1021027Z\",\"SomeDateProperty@odata.type\":\"Edm.DateTime\",\"SomeDoubleProperty0\":1,\"SomeDoubleProperty0@odata.type\":\"Edm.Double\",\"SomeDoubleProperty1\":1.2345,\"SomeDoubleProperty1@odata.type\":\"Edm.Double\",\"SomeGuidProperty\":\"51d51f9f-3692-4675-7e9b-8ee1a704204f\",\"SomeGuidProperty@odata.type\":\"Edm.Guid\",\"SomeInt64Property\":\"9223372036854775807\",\"SomeInt64Property@odata.type\":\"Edm.Int64\",\"SomeIntProperty\":42,\"SomeStringProperty\":\"some + string\",\"StringProp\":\"some string 3\"}\r\n--changeset_f291243d-1675-4bd4-7c0d-8f9c37b602db--\r\n\r\n--batch_80320635-4aac-4149-7852-98d9c153d70c--\r\n" + form: {} + headers: + Accept: + - application/json;odata=minimalmetadata + Authorization: + - sanitized + Content-Length: + - "3550" + Content-Type: + - multipart/mixed; boundary=batch_80320635-4aac-4149-7852-98d9c153d70c + Dataserviceversion: + - "3.0" + User-Agent: + - azsdk-go-tables/ azcore/v0.16.1 (go1.16.2; Windows_NT) + X-Ms-Date: + - Fri, 21 May 2021 19:41:05 GMT + X-Ms-Version: + - "2019-02-02" + url: https://chrisstablesprim.table.cosmos.azure.com/$batch + method: POST + response: + body: "--batchresponse_a9702722-351c-4503-882c-974676140382\r\nContent-Type: multipart/mixed; + boundary=changesetresponse_01d951c7-cf0c-4ef5-a40a-38b651d346bf\r\n\r\n--changesetresponse_01d951c7-cf0c-4ef5-a40a-38b651d346bf\nContent-Type: + application/http\nContent-Transfer-Encoding: binary\n\nHTTP/1.1 204 No Content\r\nETag: + W/\"datetime'2021-05-21T19%3A41%3A05.3346824Z'\"\r\nPreference-Applied: return-no-content\r\nLocation: + https://chrisstablesprim.table.cosmos.azure.com/gotable3m8dvqbvcbgmg(PartitionKey='partition',RowKey='1')\r\nContent-ID: + 1\r\n\r\n\r\n--changesetresponse_01d951c7-cf0c-4ef5-a40a-38b651d346bf\nContent-Type: + application/http\nContent-Transfer-Encoding: binary\n\nHTTP/1.1 204 No Content\r\nETag: + W/\"datetime'2021-05-21T19%3A41%3A05.3356040Z'\"\r\nPreference-Applied: return-no-content\r\nLocation: + https://chrisstablesprim.table.cosmos.azure.com/gotable3m8dvqbvcbgmg(PartitionKey='partition',RowKey='2')\r\nContent-ID: + 2\r\n\r\n\r\n--changesetresponse_01d951c7-cf0c-4ef5-a40a-38b651d346bf\nContent-Type: + application/http\nContent-Transfer-Encoding: binary\n\nHTTP/1.1 204 No Content\r\nETag: + W/\"datetime'2021-05-21T19%3A41%3A05.3362184Z'\"\r\nPreference-Applied: return-no-content\r\nLocation: + https://chrisstablesprim.table.cosmos.azure.com/gotable3m8dvqbvcbgmg(PartitionKey='partition',RowKey='3')\r\nContent-ID: + 3\r\n\r\n\r\n--changesetresponse_01d951c7-cf0c-4ef5-a40a-38b651d346bf--\n--batchresponse_a9702722-351c-4503-882c-974676140382--\r\n" + headers: + Content-Type: + - multipart/mixed; boundary=batchresponse_a9702722-351c-4503-882c-974676140382 + Date: + - Fri, 21 May 2021 19:41:04 GMT + Server: + - Microsoft-HTTPAPI/2.0 + X-Ms-Request-Id: + - 94500c18-401b-4b44-9882-f954843f31bd + status: 202 Accepted + code: 202 + duration: "" +- request: + body: "" + form: {} + headers: + Accept: + - application/json;odata=minimalmetadata + Authorization: + - sanitized + Dataserviceversion: + - "3.0" + User-Agent: + - azsdk-go-tables/ azsdk-go-tables/ azcore/v0.16.1 (go1.16.2; + Windows_NT) + X-Ms-Date: + - Fri, 21 May 2021 19:41:05 GMT + X-Ms-Version: + - "2019-02-02" + url: https://chrisstablesprim.table.cosmos.azure.com/gotable3m8dvqbvcbgmg()?%24filter=RowKey+eq+%271%27 + method: GET + response: + body: '{"value":[{"odata.etag":"W/\"datetime''2021-05-21T19%3A41%3A05.3346824Z''\"","BoolProp":true,"IntProp":1,"PartitionKey":"partition","RowKey":"1","SomeBinaryProperty@odata.type":"Edm.Binary","SomeBinaryProperty":"c29tZSBieXRlcw==","SomeDateProperty@odata.type":"Edm.DateTime","SomeDateProperty":"2021-05-21T19:41:05.1021027Z","SomeDoubleProperty0":1.0,"SomeDoubleProperty1":1.2345,"SomeGuidProperty@odata.type":"Edm.Guid","SomeGuidProperty":"c4d3ae3f-7292-4e24-6ba8-2e7aeb230a6a","SomeInt64Property@odata.type":"Edm.Int64","SomeInt64Property":"9223372036854775807","SomeIntProperty":42,"SomeStringProperty":"some + string","StringProp":"some string 1","Timestamp":"2021-05-21T19:41:05.3346824Z"}],"odata.metadata":"https://chrisstablesprim.table.cosmos.azure.com/$metadata#gotable3m8dvqbvcbgmg"}' + headers: + Content-Type: + - application/json;odata=minimalmetadata + Date: + - Fri, 21 May 2021 19:41:04 GMT + Server: + - Microsoft-HTTPAPI/2.0 + X-Ms-Request-Id: + - 938e335a-d6f0-4d10-904f-ea9f7800149c + status: 200 Ok + code: 200 + duration: "" +- request: + body: "--batch_1de6d73d-d2eb-4a17-7801-13a2879cfa9c\r\nContent-Type: multipart/mixed; + boundary=changeset_f6299849-8235-4d0c-757f-95ac2ffe2db7\r\n\r\n--changeset_f6299849-8235-4d0c-757f-95ac2ffe2db7\r\nContent-Transfer-Encoding: + binary\r\nContent-Type: application/http\r\n\r\nPOST https://chrisstablesprim.table.cosmos.azure.com/gotable3m8dvqbvcbgmg(PartitionKey='partition',RowKey='1')?%24format=application%2Fjson%3Bodata%3Dminimalmetadata + HTTP/1.1\r\nAccept: application/json\r\nContent-Length: 63\r\nContent-Type: + application/json\r\nDataserviceversion: 3.0\r\nIf-Match: W/\"datetime'2021-05-21T19%3A41%3A05.3346824Z'\"\r\nX-Http-Method: + MERGE\r\nX-Ms-Version: 2019-02-02\r\n\r\n{\"MergeProperty\":\"foo\",\"PartitionKey\":\"partition\",\"RowKey\":\"1\"}\r\n--changeset_f6299849-8235-4d0c-757f-95ac2ffe2db7\r\nContent-Transfer-Encoding: + binary\r\nContent-Type: application/http\r\n\r\nDELETE https://chrisstablesprim.table.cosmos.azure.com/gotable3m8dvqbvcbgmg(PartitionKey='partition',RowKey='2')?%24format=application%2Fjson%3Bodata%3Dminimalmetadata + HTTP/1.1\r\nAccept: application/json;odata=minimalmetadata\r\nDataserviceversion: + 3.0\r\nIf-Match: *\r\nX-Ms-Version: 2019-02-02\r\n\r\n\r\n--changeset_f6299849-8235-4d0c-757f-95ac2ffe2db7\r\nContent-Transfer-Encoding: + binary\r\nContent-Type: application/http\r\n\r\nPUT https://chrisstablesprim.table.cosmos.azure.com/gotable3m8dvqbvcbgmg(PartitionKey='partition',RowKey='3')?%24format=application%2Fjson%3Bodata%3Dminimalmetadata + HTTP/1.1\r\nAccept: application/json\r\nContent-Length: 65\r\nContent-Type: + application/json\r\nDataserviceversion: 3.0\r\nIf-Match: *\r\nX-Ms-Version: + 2019-02-02\r\n\r\n{\"PartitionKey\":\"partition\",\"ReplaceProperty\":\"foo\",\"RowKey\":\"3\"}\r\n--changeset_f6299849-8235-4d0c-757f-95ac2ffe2db7\r\nContent-Transfer-Encoding: + binary\r\nContent-Type: application/http\r\n\r\nPOST https://chrisstablesprim.table.cosmos.azure.com/gotable3m8dvqbvcbgmg?%24format=application%2Fjson%3Bodata%3Dminimalmetadata + HTTP/1.1\r\nAccept: application/json;odata=minimalmetadata\r\nContent-Length: + 663\r\nContent-Type: application/json\r\nDataserviceversion: 3.0\r\nPrefer: + return-no-content\r\nX-Ms-Version: 2019-02-02\r\n\r\n{\"BoolProp\":true,\"IntProp\":4,\"PartitionKey\":\"partition\",\"RowKey\":\"4\",\"SomeBinaryProperty\":\"c29tZSBieXRlcw==\",\"SomeBinaryProperty@odata.type\":\"Edm.Binary\",\"SomeDateProperty\":\"2021-05-21T19:41:05.1021027Z\",\"SomeDateProperty@odata.type\":\"Edm.DateTime\",\"SomeDoubleProperty0\":1,\"SomeDoubleProperty0@odata.type\":\"Edm.Double\",\"SomeDoubleProperty1\":1.2345,\"SomeDoubleProperty1@odata.type\":\"Edm.Double\",\"SomeGuidProperty\":\"e08237e7-441b-4d89-7e71-dc8cd8dd82fb\",\"SomeGuidProperty@odata.type\":\"Edm.Guid\",\"SomeInt64Property\":\"9223372036854775807\",\"SomeInt64Property@odata.type\":\"Edm.Int64\",\"SomeIntProperty\":42,\"SomeStringProperty\":\"some + string\",\"StringProp\":\"some string 4\"}\r\n--changeset_f6299849-8235-4d0c-757f-95ac2ffe2db7\r\nContent-Transfer-Encoding: + binary\r\nContent-Type: application/http\r\n\r\nPOST https://chrisstablesprim.table.cosmos.azure.com/gotable3m8dvqbvcbgmg?%24format=application%2Fjson%3Bodata%3Dminimalmetadata + HTTP/1.1\r\nAccept: application/json;odata=minimalmetadata\r\nContent-Length: + 663\r\nContent-Type: application/json\r\nDataserviceversion: 3.0\r\nPrefer: + return-no-content\r\nX-Ms-Version: 2019-02-02\r\n\r\n{\"BoolProp\":true,\"IntProp\":5,\"PartitionKey\":\"partition\",\"RowKey\":\"5\",\"SomeBinaryProperty\":\"c29tZSBieXRlcw==\",\"SomeBinaryProperty@odata.type\":\"Edm.Binary\",\"SomeDateProperty\":\"2021-05-21T19:41:05.1021027Z\",\"SomeDateProperty@odata.type\":\"Edm.DateTime\",\"SomeDoubleProperty0\":1,\"SomeDoubleProperty0@odata.type\":\"Edm.Double\",\"SomeDoubleProperty1\":1.2345,\"SomeDoubleProperty1@odata.type\":\"Edm.Double\",\"SomeGuidProperty\":\"b486e769-b01f-4a13-5231-bca1795f2797\",\"SomeGuidProperty@odata.type\":\"Edm.Guid\",\"SomeInt64Property\":\"9223372036854775807\",\"SomeInt64Property@odata.type\":\"Edm.Int64\",\"SomeIntProperty\":42,\"SomeStringProperty\":\"some + string\",\"StringProp\":\"some string 5\"}\r\n--changeset_f6299849-8235-4d0c-757f-95ac2ffe2db7--\r\n\r\n--batch_1de6d73d-d2eb-4a17-7801-13a2879cfa9c--\r\n" + form: {} + headers: + Accept: + - application/json;odata=minimalmetadata + Authorization: + - sanitized + Content-Length: + - "3935" + Content-Type: + - multipart/mixed; boundary=batch_1de6d73d-d2eb-4a17-7801-13a2879cfa9c + Dataserviceversion: + - "3.0" + User-Agent: + - azsdk-go-tables/ azcore/v0.16.1 (go1.16.2; Windows_NT) + X-Ms-Date: + - Fri, 21 May 2021 19:41:05 GMT + X-Ms-Version: + - "2019-02-02" + url: https://chrisstablesprim.table.cosmos.azure.com/$batch + method: POST + response: + body: "--batchresponse_26ff053e-5a43-4bed-9fee-351647f22cb8\r\nContent-Type: multipart/mixed; + boundary=changesetresponse_7bd4dd3f-b230-48aa-93a0-659d19e94058\r\n\r\n--changesetresponse_7bd4dd3f-b230-48aa-93a0-659d19e94058\nContent-Type: + application/http\nContent-Transfer-Encoding: binary\n\nHTTP/1.1 204 No Content\r\nETag: + W/\"datetime'2021-05-21T19%3A41%3A05.5514632Z'\"\r\nContent-ID: 1\r\n\r\n\r\n--changesetresponse_7bd4dd3f-b230-48aa-93a0-659d19e94058\nContent-Type: + application/http\nContent-Transfer-Encoding: binary\n\nHTTP/1.1 204 No Content\r\nContent-ID: + 2\r\n\r\n\r\n--changesetresponse_7bd4dd3f-b230-48aa-93a0-659d19e94058\nContent-Type: + application/http\nContent-Transfer-Encoding: binary\n\nHTTP/1.1 204 No Content\r\nETag: + W/\"datetime'2021-05-21T19%3A41%3A05.5545352Z'\"\r\nContent-ID: 3\r\n\r\n\r\n--changesetresponse_7bd4dd3f-b230-48aa-93a0-659d19e94058\nContent-Type: + application/http\nContent-Transfer-Encoding: binary\n\nHTTP/1.1 204 No Content\r\nETag: + W/\"datetime'2021-05-21T19%3A41%3A05.5551496Z'\"\r\nPreference-Applied: return-no-content\r\nLocation: + https://chrisstablesprim.table.cosmos.azure.com/gotable3m8dvqbvcbgmg(PartitionKey='partition',RowKey='4')\r\nContent-ID: + 4\r\n\r\n\r\n--changesetresponse_7bd4dd3f-b230-48aa-93a0-659d19e94058\nContent-Type: + application/http\nContent-Transfer-Encoding: binary\n\nHTTP/1.1 204 No Content\r\nETag: + W/\"datetime'2021-05-21T19%3A41%3A05.5557640Z'\"\r\nPreference-Applied: return-no-content\r\nLocation: + https://chrisstablesprim.table.cosmos.azure.com/gotable3m8dvqbvcbgmg(PartitionKey='partition',RowKey='5')\r\nContent-ID: + 5\r\n\r\n\r\n--changesetresponse_7bd4dd3f-b230-48aa-93a0-659d19e94058--\n--batchresponse_26ff053e-5a43-4bed-9fee-351647f22cb8--\r\n" + headers: + Content-Type: + - multipart/mixed; boundary=batchresponse_26ff053e-5a43-4bed-9fee-351647f22cb8 + Date: + - Fri, 21 May 2021 19:41:04 GMT + Server: + - Microsoft-HTTPAPI/2.0 + X-Ms-Request-Id: + - 1fdc1f60-328f-4921-aa92-4daa90d9d983 + status: 202 Accepted + code: 202 + duration: "" +- request: + body: "" + form: {} + headers: + Accept: + - application/json;odata=minimalmetadata + Authorization: + - sanitized + Dataserviceversion: + - "3.0" + User-Agent: + - azsdk-go-tables/ azsdk-go-tables/ azcore/v0.16.1 (go1.16.2; + Windows_NT) + X-Ms-Date: + - Fri, 21 May 2021 19:41:05 GMT + X-Ms-Version: + - "2019-02-02" + url: https://chrisstablesprim.table.cosmos.azure.com/gotable3m8dvqbvcbgmg()?%24filter=RowKey+eq+%271%27 + method: GET + response: + body: '{"value":[{"odata.etag":"W/\"datetime''2021-05-21T19%3A41%3A05.5514632Z''\"","BoolProp":true,"IntProp":1,"PartitionKey":"partition","RowKey":"1","SomeBinaryProperty@odata.type":"Edm.Binary","SomeBinaryProperty":"c29tZSBieXRlcw==","SomeDateProperty@odata.type":"Edm.DateTime","SomeDateProperty":"2021-05-21T19:41:05.1021027Z","SomeDoubleProperty0":1.0,"SomeDoubleProperty1":1.2345,"SomeGuidProperty@odata.type":"Edm.Guid","SomeGuidProperty":"c4d3ae3f-7292-4e24-6ba8-2e7aeb230a6a","SomeInt64Property@odata.type":"Edm.Int64","SomeInt64Property":"9223372036854775807","SomeIntProperty":42,"SomeStringProperty":"some + string","StringProp":"some string 1","MergeProperty":"foo","Timestamp":"2021-05-21T19:41:05.5514632Z"}],"odata.metadata":"https://chrisstablesprim.table.cosmos.azure.com/$metadata#gotable3m8dvqbvcbgmg"}' + headers: + Content-Type: + - application/json;odata=minimalmetadata + Date: + - Fri, 21 May 2021 19:41:04 GMT + Server: + - Microsoft-HTTPAPI/2.0 + X-Ms-Request-Id: + - 36f8f06d-a7db-40ca-a5c3-9995d9921dc2 + status: 200 Ok + code: 200 + duration: "" +- request: + body: "" + form: {} + headers: + Accept: + - application/json + Authorization: + - sanitized + User-Agent: + - azsdk-go-tables/ azsdk-go-tables/ azcore/v0.16.1 (go1.16.2; + Windows_NT) + X-Ms-Date: + - Fri, 21 May 2021 19:41:05 GMT + X-Ms-Version: + - "2019-02-02" + url: https://chrisstablesprim.table.cosmos.azure.com/Tables('gotable3m8dvqbvcbgmg') + method: DELETE + response: + body: "" + headers: + Content-Length: + - "0" + Date: + - Fri, 21 May 2021 19:41:06 GMT + Server: + - Microsoft-HTTPAPI/2.0 + X-Ms-Request-Id: + - a468a3f2-b961-4185-9082-454f33840250 + status: 204 No Content + code: 204 + duration: "" diff --git a/sdk/tables/aztables/recordings/TestTableClient_Cosmos/TestCreateTable-variables.yaml b/sdk/tables/aztables/recordings/TestTableClient_Cosmos/TestCreateTable-variables.yaml new file mode 100644 index 000000000000..5a403251353a --- /dev/null +++ b/sdk/tables/aztables/recordings/TestTableClient_Cosmos/TestCreateTable-variables.yaml @@ -0,0 +1,5 @@ +--- +COSMOS_TABLES_ENDPOINT_SUFFIX: cosmos.azure.com +TABLES_COSMOS_ACCOUNT_NAME: chrisstablesprim +TABLES_PRIMARY_COSMOS_ACCOUNT_KEY: Kg== +randomSeed: "1617573289" diff --git a/sdk/tables/aztables/recordings/TestTableClient_Cosmos/TestCreateTable.yaml b/sdk/tables/aztables/recordings/TestTableClient_Cosmos/TestCreateTable.yaml new file mode 100644 index 000000000000..a60e34d514b1 --- /dev/null +++ b/sdk/tables/aztables/recordings/TestTableClient_Cosmos/TestCreateTable.yaml @@ -0,0 +1,75 @@ +--- +version: 1 +interactions: +- request: + body: '{"TableName":"gotable3atc3ia9qkkbd"}' + form: {} + headers: + Accept: + - application/json;odata=minimalmetadata + Authorization: + - sanitized + Content-Length: + - "36" + Content-Type: + - application/json + Dataserviceversion: + - "3.0" + User-Agent: + - azsdk-go-tables/ azsdk-go-tables/ azcore/v0.13.4 (go1.16.2; + Windows_NT) + X-Ms-Date: + - Sun, 04 Apr 2021 21:54:49 GMT + X-Ms-Version: + - "2019-02-02" + url: https://chrisstablesprim.table.cosmos.azure.com/Tables + method: POST + response: + body: '{"TableName":"gotable3atc3ia9qkkbd","odata.metadata":"https://chrisstablesprim.table.cosmos.azure.com/$metadata#Tables/@Element"}' + headers: + Content-Type: + - application/json;odata=minimalmetadata + Date: + - Sun, 04 Apr 2021 21:54:50 GMT + Etag: + - W/"datetime'2021-04-04T21%3A54%3A49.7968136Z'" + Location: + - https://chrisstablesprim.table.cosmos.azure.com/Tables('gotable3atc3ia9qkkbd') + Server: + - Microsoft-HTTPAPI/2.0 + X-Ms-Request-Id: + - b9386c93-2228-4a78-bcab-652c24994580 + status: 201 Created + code: 201 + duration: "" +- request: + body: "" + form: {} + headers: + Accept: + - application/json + Authorization: + - sanitized + User-Agent: + - azsdk-go-tables/ azsdk-go-tables/ azcore/v0.13.4 (go1.16.2; + Windows_NT) + X-Ms-Date: + - Sun, 04 Apr 2021 21:54:50 GMT + X-Ms-Version: + - "2019-02-02" + url: https://chrisstablesprim.table.cosmos.azure.com/Tables('gotable3atc3ia9qkkbd') + method: DELETE + response: + body: "" + headers: + Content-Length: + - "0" + Date: + - Sun, 04 Apr 2021 21:54:50 GMT + Server: + - Microsoft-HTTPAPI/2.0 + X-Ms-Request-Id: + - f8cecc20-febd-48ed-950f-6fb532eb326d + status: 204 No Content + code: 204 + duration: "" diff --git a/sdk/tables/aztables/recordings/TestTableClient_Cosmos/TestDeleteEntity-variables.yaml b/sdk/tables/aztables/recordings/TestTableClient_Cosmos/TestDeleteEntity-variables.yaml new file mode 100644 index 000000000000..4c7074f25ef1 --- /dev/null +++ b/sdk/tables/aztables/recordings/TestTableClient_Cosmos/TestDeleteEntity-variables.yaml @@ -0,0 +1,5 @@ +--- +COSMOS_TABLES_ENDPOINT_SUFFIX: cosmos.azure.com +TABLES_COSMOS_ACCOUNT_NAME: chrisstablesprim +TABLES_PRIMARY_COSMOS_ACCOUNT_KEY: Kg== +randomSeed: "1621624378" diff --git a/sdk/tables/aztables/recordings/TestTableClient_Cosmos/TestDeleteEntity.yaml b/sdk/tables/aztables/recordings/TestTableClient_Cosmos/TestDeleteEntity.yaml new file mode 100644 index 000000000000..dbdadd952053 --- /dev/null +++ b/sdk/tables/aztables/recordings/TestTableClient_Cosmos/TestDeleteEntity.yaml @@ -0,0 +1,156 @@ +--- +version: 1 +interactions: +- request: + body: '{"TableName":"gotablezdpmnyzkryrie"}' + form: {} + headers: + Accept: + - application/json;odata=minimalmetadata + Authorization: + - sanitized + Content-Length: + - "36" + Content-Type: + - application/json + Dataserviceversion: + - "3.0" + User-Agent: + - azsdk-go-tables/ azsdk-go-tables/ azcore/v0.16.1 (go1.16.2; + Windows_NT) + X-Ms-Date: + - Fri, 21 May 2021 19:12:58 GMT + X-Ms-Version: + - "2019-02-02" + url: https://chrisstablesprim.table.cosmos.azure.com/Tables + method: POST + response: + body: '{"TableName":"gotablezdpmnyzkryrie","odata.metadata":"https://chrisstablesprim.table.cosmos.azure.com/$metadata#Tables/@Element"}' + headers: + Content-Type: + - application/json;odata=minimalmetadata + Date: + - Fri, 21 May 2021 19:12:59 GMT + Etag: + - W/"datetime'2021-05-21T19%3A12%3A59.2534536Z'" + Location: + - https://chrisstablesprim.table.cosmos.azure.com/Tables('gotablezdpmnyzkryrie') + Server: + - Microsoft-HTTPAPI/2.0 + X-Ms-Request-Id: + - 7c429f5f-dca8-4df1-bd4b-f5bc1fde8790 + status: 201 Ok + code: 201 + duration: "" +- request: + body: '{"BoolProp":true,"IntProp":1,"PartitionKey":"partition","RowKey":"1","StringProp":"some + string 1"}' + form: {} + headers: + Accept: + - application/json;odata=minimalmetadata + Authorization: + - sanitized + Content-Length: + - "98" + Content-Type: + - application/json + Dataserviceversion: + - "3.0" + Prefer: + - return-no-content + User-Agent: + - azsdk-go-tables/ azsdk-go-tables/ azcore/v0.16.1 (go1.16.2; + Windows_NT) + X-Ms-Date: + - Fri, 21 May 2021 19:12:59 GMT + X-Ms-Version: + - "2019-02-02" + url: https://chrisstablesprim.table.cosmos.azure.com/gotablezdpmnyzkryrie + method: POST + response: + body: "" + headers: + Content-Length: + - "0" + Date: + - Fri, 21 May 2021 19:12:59 GMT + Etag: + - W/"datetime'2021-05-21T19%3A12%3A59.7676040Z'" + Location: + - https://chrisstablesprim.table.cosmos.azure.com/gotablezdpmnyzkryrie(PartitionKey='partition',RowKey='1') + Preference-Applied: + - return-no-content + Server: + - Microsoft-HTTPAPI/2.0 + X-Ms-Request-Id: + - 44675488-a37b-4fe1-b501-0e28dbe55652 + status: 204 No Content + code: 204 + duration: "" +- request: + body: "" + form: {} + headers: + Accept: + - application/json;odata=minimalmetadata + Authorization: + - sanitized + Dataserviceversion: + - "3.0" + If-Match: + - '*' + User-Agent: + - azsdk-go-tables/ azsdk-go-tables/ azcore/v0.16.1 (go1.16.2; + Windows_NT) + X-Ms-Date: + - Fri, 21 May 2021 19:12:59 GMT + X-Ms-Version: + - "2019-02-02" + url: https://chrisstablesprim.table.cosmos.azure.com/gotablezdpmnyzkryrie(PartitionKey='partition',RowKey='1') + method: DELETE + response: + body: "" + headers: + Content-Length: + - "0" + Date: + - Fri, 21 May 2021 19:12:59 GMT + Server: + - Microsoft-HTTPAPI/2.0 + X-Ms-Request-Id: + - 34dc8550-34e5-45c7-9625-0f5ba9721089 + status: 204 No Content + code: 204 + duration: "" +- request: + body: "" + form: {} + headers: + Accept: + - application/json + Authorization: + - sanitized + User-Agent: + - azsdk-go-tables/ azsdk-go-tables/ azcore/v0.16.1 (go1.16.2; + Windows_NT) + X-Ms-Date: + - Fri, 21 May 2021 19:12:59 GMT + X-Ms-Version: + - "2019-02-02" + url: https://chrisstablesprim.table.cosmos.azure.com/Tables('gotablezdpmnyzkryrie') + method: DELETE + response: + body: "" + headers: + Content-Length: + - "0" + Date: + - Fri, 21 May 2021 19:12:59 GMT + Server: + - Microsoft-HTTPAPI/2.0 + X-Ms-Request-Id: + - 56f22cb9-bf6b-4764-8f79-2afa92a5c479 + status: 204 No Content + code: 204 + duration: "" diff --git a/sdk/tables/aztables/recordings/TestTableClient_Cosmos/TestGetEntity-variables.yaml b/sdk/tables/aztables/recordings/TestTableClient_Cosmos/TestGetEntity-variables.yaml new file mode 100644 index 000000000000..4caa11ec87e2 --- /dev/null +++ b/sdk/tables/aztables/recordings/TestTableClient_Cosmos/TestGetEntity-variables.yaml @@ -0,0 +1,5 @@ +--- +COSMOS_TABLES_ENDPOINT_SUFFIX: cosmos.azure.com +TABLES_COSMOS_ACCOUNT_NAME: chrisstablesprim +TABLES_PRIMARY_COSMOS_ACCOUNT_KEY: Kg== +randomSeed: "1621634379" diff --git a/sdk/tables/aztables/recordings/TestTableClient_Cosmos/TestGetEntity.yaml b/sdk/tables/aztables/recordings/TestTableClient_Cosmos/TestGetEntity.yaml new file mode 100644 index 000000000000..8d9555ed484a --- /dev/null +++ b/sdk/tables/aztables/recordings/TestTableClient_Cosmos/TestGetEntity.yaml @@ -0,0 +1,157 @@ +--- +version: 1 +interactions: +- request: + body: '{"TableName":"gotable6durux9k2gsr8"}' + form: {} + headers: + Accept: + - application/json;odata=minimalmetadata + Authorization: + - sanitized + Content-Length: + - "36" + Content-Type: + - application/json + Dataserviceversion: + - "3.0" + User-Agent: + - azsdk-go-tables/ azsdk-go-tables/ azcore/v0.16.1 (go1.16.2; + Windows_NT) + X-Ms-Date: + - Fri, 21 May 2021 21:59:39 GMT + X-Ms-Version: + - "2019-02-02" + url: https://chrisstablesprim.table.cosmos.azure.com/Tables + method: POST + response: + body: '{"TableName":"gotable6durux9k2gsr8","odata.metadata":"https://chrisstablesprim.table.cosmos.azure.com/$metadata#Tables/@Element"}' + headers: + Content-Type: + - application/json;odata=minimalmetadata + Date: + - Fri, 21 May 2021 21:59:40 GMT + Etag: + - W/"datetime'2021-05-21T21%3A59%3A40.3318280Z'" + Location: + - https://chrisstablesprim.table.cosmos.azure.com/Tables('gotable6durux9k2gsr8') + Server: + - Microsoft-HTTPAPI/2.0 + X-Ms-Request-Id: + - c2e26f70-23d9-4093-a9a4-9540ad534c18 + status: 201 Ok + code: 201 + duration: "" +- request: + body: '{"BoolProp":true,"IntProp":1,"PartitionKey":"partition","RowKey":"1","StringProp":"some + string 1"}' + form: {} + headers: + Accept: + - application/json;odata=minimalmetadata + Authorization: + - sanitized + Content-Length: + - "98" + Content-Type: + - application/json + Dataserviceversion: + - "3.0" + Prefer: + - return-no-content + User-Agent: + - azsdk-go-tables/ azsdk-go-tables/ azcore/v0.16.1 (go1.16.2; + Windows_NT) + X-Ms-Date: + - Fri, 21 May 2021 21:59:40 GMT + X-Ms-Version: + - "2019-02-02" + url: https://chrisstablesprim.table.cosmos.azure.com/gotable6durux9k2gsr8 + method: POST + response: + body: "" + headers: + Content-Length: + - "0" + Date: + - Fri, 21 May 2021 21:59:40 GMT + Etag: + - W/"datetime'2021-05-21T21%3A59%3A40.8694280Z'" + Location: + - https://chrisstablesprim.table.cosmos.azure.com/gotable6durux9k2gsr8(PartitionKey='partition',RowKey='1') + Preference-Applied: + - return-no-content + Server: + - Microsoft-HTTPAPI/2.0 + X-Ms-Request-Id: + - 6c631ecc-f986-46a6-9fbb-7d3c853b0ed1 + 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-tables/ azsdk-go-tables/ azcore/v0.16.1 (go1.16.2; + Windows_NT) + X-Ms-Date: + - Fri, 21 May 2021 21:59:40 GMT + X-Ms-Version: + - "2019-02-02" + url: https://chrisstablesprim.table.cosmos.azure.com/gotable6durux9k2gsr8(PartitionKey='partition',RowKey='1') + method: GET + response: + body: '{"odata.metadata":"https://chrisstablesprim.table.cosmos.azure.com/gotable6durux9k2gsr8/$metadata#gotable6durux9k2gsr8/@Element","odata.etag":"W/\"datetime''2021-05-21T21%3A59%3A40.8694280Z''\"","BoolProp":true,"IntProp":1,"PartitionKey":"partition","RowKey":"1","StringProp":"some + string 1","Timestamp":"2021-05-21T21:59:40.8694280Z"}' + headers: + Content-Type: + - application/json;odata=minimalmetadata + Date: + - Fri, 21 May 2021 21:59:40 GMT + Etag: + - W/"datetime'2021-05-21T21%3A59%3A40.8694280Z'" + Server: + - Microsoft-HTTPAPI/2.0 + X-Ms-Request-Id: + - fdfab123-339c-4d90-947e-caf22d86c87d + status: 200 Ok + code: 200 + duration: "" +- request: + body: "" + form: {} + headers: + Accept: + - application/json + Authorization: + - sanitized + User-Agent: + - azsdk-go-tables/ azsdk-go-tables/ azcore/v0.16.1 (go1.16.2; + Windows_NT) + X-Ms-Date: + - Fri, 21 May 2021 21:59:40 GMT + X-Ms-Version: + - "2019-02-02" + url: https://chrisstablesprim.table.cosmos.azure.com/Tables('gotable6durux9k2gsr8') + method: DELETE + response: + body: "" + headers: + Content-Length: + - "0" + Date: + - Fri, 21 May 2021 21:59:40 GMT + Server: + - Microsoft-HTTPAPI/2.0 + X-Ms-Request-Id: + - 8dd07d23-ae92-459a-bbb4-3f8575021ad5 + status: 204 No Content + code: 204 + duration: "" diff --git a/sdk/tables/aztables/recordings/TestTableClient_Cosmos/TestMergeEntity-variables.yaml b/sdk/tables/aztables/recordings/TestTableClient_Cosmos/TestMergeEntity-variables.yaml new file mode 100644 index 000000000000..db05ce09d74c --- /dev/null +++ b/sdk/tables/aztables/recordings/TestTableClient_Cosmos/TestMergeEntity-variables.yaml @@ -0,0 +1,5 @@ +--- +COSMOS_TABLES_ENDPOINT_SUFFIX: cosmos.azure.com +TABLES_COSMOS_ACCOUNT_NAME: chrisstablesprim +TABLES_PRIMARY_COSMOS_ACCOUNT_KEY: Kg== +randomSeed: "1621628756" diff --git a/sdk/tables/aztables/recordings/TestTableClient_Cosmos/TestMergeEntity.yaml b/sdk/tables/aztables/recordings/TestTableClient_Cosmos/TestMergeEntity.yaml new file mode 100644 index 000000000000..77bdca4ccce1 --- /dev/null +++ b/sdk/tables/aztables/recordings/TestTableClient_Cosmos/TestMergeEntity.yaml @@ -0,0 +1,232 @@ +--- +version: 1 +interactions: +- request: + body: '{"TableName":"gotable6emf0bk6m2agc"}' + form: {} + headers: + Accept: + - application/json;odata=minimalmetadata + Authorization: + - sanitized + Content-Length: + - "36" + Content-Type: + - application/json + Dataserviceversion: + - "3.0" + User-Agent: + - azsdk-go-tables/ azsdk-go-tables/ azcore/v0.16.1 (go1.16.2; + Windows_NT) + X-Ms-Date: + - Fri, 21 May 2021 20:25:56 GMT + X-Ms-Version: + - "2019-02-02" + url: https://chrisstablesprim.table.cosmos.azure.com/Tables + method: POST + response: + body: '{"TableName":"gotable6emf0bk6m2agc","odata.metadata":"https://chrisstablesprim.table.cosmos.azure.com/$metadata#Tables/@Element"}' + headers: + Content-Type: + - application/json;odata=minimalmetadata + Date: + - Fri, 21 May 2021 20:25:57 GMT + Etag: + - W/"datetime'2021-05-21T20%3A25%3A57.4829064Z'" + Location: + - https://chrisstablesprim.table.cosmos.azure.com/Tables('gotable6emf0bk6m2agc') + Server: + - Microsoft-HTTPAPI/2.0 + X-Ms-Request-Id: + - 5fa5b82f-551e-424c-8695-36d3099e2ec0 + status: 201 Ok + code: 201 + duration: "" +- request: + body: '{"BoolProp":true,"IntProp":1,"PartitionKey":"partition","RowKey":"1","StringProp":"some + string 1"}' + form: {} + headers: + Accept: + - application/json;odata=minimalmetadata + Authorization: + - sanitized + Content-Length: + - "98" + Content-Type: + - application/json + Dataserviceversion: + - "3.0" + Prefer: + - return-no-content + User-Agent: + - azsdk-go-tables/ azsdk-go-tables/ azcore/v0.16.1 (go1.16.2; + Windows_NT) + X-Ms-Date: + - Fri, 21 May 2021 20:25:57 GMT + X-Ms-Version: + - "2019-02-02" + url: https://chrisstablesprim.table.cosmos.azure.com/gotable6emf0bk6m2agc + method: POST + response: + body: "" + headers: + Content-Length: + - "0" + Date: + - Fri, 21 May 2021 20:25:57 GMT + Etag: + - W/"datetime'2021-05-21T20%3A25%3A58.0876808Z'" + Location: + - https://chrisstablesprim.table.cosmos.azure.com/gotable6emf0bk6m2agc(PartitionKey='partition',RowKey='1') + Preference-Applied: + - return-no-content + Server: + - Microsoft-HTTPAPI/2.0 + X-Ms-Request-Id: + - 51bcbecc-ab8e-4c77-8f28-92843e3bd90c + 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-tables/ azsdk-go-tables/ azcore/v0.16.1 (go1.16.2; + Windows_NT) + X-Ms-Date: + - Fri, 21 May 2021 20:25:57 GMT + X-Ms-Version: + - "2019-02-02" + url: https://chrisstablesprim.table.cosmos.azure.com/gotable6emf0bk6m2agc()?%24filter=RowKey+eq+%271%27 + method: GET + response: + body: '{"value":[{"odata.etag":"W/\"datetime''2021-05-21T20%3A25%3A58.0876808Z''\"","BoolProp":true,"IntProp":1,"PartitionKey":"partition","RowKey":"1","StringProp":"some + string 1","Timestamp":"2021-05-21T20:25:58.0876808Z"}],"odata.metadata":"https://chrisstablesprim.table.cosmos.azure.com/$metadata#gotable6emf0bk6m2agc"}' + headers: + Content-Type: + - application/json;odata=minimalmetadata + Date: + - Fri, 21 May 2021 20:25:57 GMT + Server: + - Microsoft-HTTPAPI/2.0 + X-Ms-Request-Id: + - 82b460c2-5845-41f1-a62f-854fe69ac246 + status: 200 Ok + code: 200 + duration: "" +- request: + body: '{"MergeProperty":"foo","PartitionKey":"partition","RowKey":"1"}' + form: {} + headers: + Accept: + - application/json + Authorization: + - sanitized + Content-Length: + - "63" + Content-Type: + - application/json + Dataserviceversion: + - "3.0" + If-Match: + - '*' + User-Agent: + - azsdk-go-tables/ azsdk-go-tables/ azcore/v0.16.1 (go1.16.2; + Windows_NT) + X-Http-Method: + - MERGE + X-Ms-Date: + - Fri, 21 May 2021 20:25:58 GMT + X-Ms-Version: + - "2019-02-02" + url: https://chrisstablesprim.table.cosmos.azure.com/gotable6emf0bk6m2agc(PartitionKey='partition',RowKey='1') + method: POST + response: + body: "" + headers: + Content-Length: + - "0" + Date: + - Fri, 21 May 2021 20:25:58 GMT + Etag: + - W/"datetime'2021-05-21T20%3A25%3A58.2475272Z'" + Server: + - Microsoft-HTTPAPI/2.0 + X-Ms-Request-Id: + - 9dc5e715-8500-4ef9-a2d0-d26602a86f16 + 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-tables/ azsdk-go-tables/ azcore/v0.16.1 (go1.16.2; + Windows_NT) + X-Ms-Date: + - Fri, 21 May 2021 20:25:58 GMT + X-Ms-Version: + - "2019-02-02" + url: https://chrisstablesprim.table.cosmos.azure.com/gotable6emf0bk6m2agc()?%24filter=RowKey+eq+%271%27 + method: GET + response: + body: '{"value":[{"odata.etag":"W/\"datetime''2021-05-21T20%3A25%3A58.2475272Z''\"","BoolProp":true,"IntProp":1,"PartitionKey":"partition","RowKey":"1","StringProp":"some + string 1","MergeProperty":"foo","Timestamp":"2021-05-21T20:25:58.2475272Z"}],"odata.metadata":"https://chrisstablesprim.table.cosmos.azure.com/$metadata#gotable6emf0bk6m2agc"}' + headers: + Content-Type: + - application/json;odata=minimalmetadata + Date: + - Fri, 21 May 2021 20:25:58 GMT + Server: + - Microsoft-HTTPAPI/2.0 + X-Ms-Request-Id: + - 87e09a62-3363-49b8-bb37-9d68a981b6cd + status: 200 Ok + code: 200 + duration: "" +- request: + body: "" + form: {} + headers: + Accept: + - application/json + Authorization: + - sanitized + User-Agent: + - azsdk-go-tables/ azsdk-go-tables/ azcore/v0.16.1 (go1.16.2; + Windows_NT) + X-Ms-Date: + - Fri, 21 May 2021 20:25:58 GMT + X-Ms-Version: + - "2019-02-02" + url: https://chrisstablesprim.table.cosmos.azure.com/Tables('gotable6emf0bk6m2agc') + method: DELETE + response: + body: "" + headers: + Content-Length: + - "0" + Date: + - Fri, 21 May 2021 20:25:58 GMT + Server: + - Microsoft-HTTPAPI/2.0 + X-Ms-Request-Id: + - adb03d8d-0443-442d-99ed-1546b9f305dd + status: 204 No Content + code: 204 + duration: "" diff --git a/sdk/tables/aztables/recordings/TestTableClient_Cosmos/TestQueryComplexEntity-variables.yaml b/sdk/tables/aztables/recordings/TestTableClient_Cosmos/TestQueryComplexEntity-variables.yaml new file mode 100644 index 000000000000..1a38b8ca8f7c --- /dev/null +++ b/sdk/tables/aztables/recordings/TestTableClient_Cosmos/TestQueryComplexEntity-variables.yaml @@ -0,0 +1,6 @@ +--- +COSMOS_TABLES_ENDPOINT_SUFFIX: cosmos.azure.com +TABLES_COSMOS_ACCOUNT_NAME: chrisstablesprim +TABLES_PRIMARY_COSMOS_ACCOUNT_KEY: Kg== +now: "2021-05-19T11:25:36.9614656-05:00" +randomSeed: "1621441535" diff --git a/sdk/tables/aztables/recordings/TestTableClient_Cosmos/TestQueryComplexEntity.yaml b/sdk/tables/aztables/recordings/TestTableClient_Cosmos/TestQueryComplexEntity.yaml new file mode 100644 index 000000000000..2df9bc1de628 --- /dev/null +++ b/sdk/tables/aztables/recordings/TestTableClient_Cosmos/TestQueryComplexEntity.yaml @@ -0,0 +1,342 @@ +--- +version: 1 +interactions: +- request: + body: '{"TableName":"gotableerbzz3oh8axos"}' + form: {} + headers: + Accept: + - application/json;odata=minimalmetadata + Authorization: + - sanitized + Content-Length: + - "36" + Content-Type: + - application/json + Dataserviceversion: + - "3.0" + User-Agent: + - azsdk-go-tables/ azsdk-go-tables/ azcore/v0.16.1 (go1.16.2; + Windows_NT) + X-Ms-Date: + - Wed, 19 May 2021 16:25:35 GMT + X-Ms-Version: + - "2019-02-02" + url: https://chrisstablesprim.table.cosmos.azure.com/Tables + method: POST + response: + body: '{"TableName":"gotableerbzz3oh8axos","odata.metadata":"https://chrisstablesprim.table.cosmos.azure.com/$metadata#Tables/@Element"}' + headers: + Content-Type: + - application/json;odata=minimalmetadata + Date: + - Wed, 19 May 2021 16:25:36 GMT + Etag: + - W/"datetime'2021-05-19T16%3A25%3A36.7447560Z'" + Location: + - https://chrisstablesprim.table.cosmos.azure.com/Tables('gotableerbzz3oh8axos') + Server: + - Microsoft-HTTPAPI/2.0 + X-Ms-Request-Id: + - 5c17ccda-a639-4be6-96cb-e8273c725aef + status: 201 Ok + code: 201 + duration: "" +- request: + body: '{"BoolProp":true,"IntProp":1,"PartitionKey":"partition","RowKey":"1","SomeBinaryProperty":"c29tZSBieXRlcw==","SomeBinaryProperty@odata.type":"Edm.Binary","SomeDateProperty":"2021-05-19T16:25:36.9614656Z","SomeDateProperty@odata.type":"Edm.DateTime","SomeDoubleProperty0":1,"SomeDoubleProperty0@odata.type":"Edm.Double","SomeDoubleProperty1":1.2345,"SomeDoubleProperty1@odata.type":"Edm.Double","SomeGuidProperty":"d043f74e-07ff-4cc6-466d-4a3e83bea7a6","SomeGuidProperty@odata.type":"Edm.Guid","SomeInt64Property":"9223372036854775807","SomeInt64Property@odata.type":"Edm.Int64","SomeIntProperty":42,"SomeStringProperty":"some + string","StringProp":"some string 1"}' + form: {} + headers: + Accept: + - application/json;odata=minimalmetadata + Authorization: + - sanitized + Content-Length: + - "663" + Content-Type: + - application/json + Dataserviceversion: + - "3.0" + Prefer: + - return-no-content + User-Agent: + - azsdk-go-tables/ azsdk-go-tables/ azcore/v0.16.1 (go1.16.2; + Windows_NT) + X-Ms-Date: + - Wed, 19 May 2021 16:25:36 GMT + X-Ms-Version: + - "2019-02-02" + url: https://chrisstablesprim.table.cosmos.azure.com/gotableerbzz3oh8axos + method: POST + response: + body: "" + headers: + Content-Length: + - "0" + Date: + - Wed, 19 May 2021 16:25:37 GMT + Etag: + - W/"datetime'2021-05-19T16%3A25%3A37.2379144Z'" + Location: + - https://chrisstablesprim.table.cosmos.azure.com/gotableerbzz3oh8axos(PartitionKey='partition',RowKey='1') + Preference-Applied: + - return-no-content + Server: + - Microsoft-HTTPAPI/2.0 + X-Ms-Request-Id: + - 4bc36820-3f67-4d67-8498-614f874bdad2 + status: 204 No Content + code: 204 + duration: "" +- request: + body: '{"BoolProp":true,"IntProp":2,"PartitionKey":"partition","RowKey":"2","SomeBinaryProperty":"c29tZSBieXRlcw==","SomeBinaryProperty@odata.type":"Edm.Binary","SomeDateProperty":"2021-05-19T16:25:36.9614656Z","SomeDateProperty@odata.type":"Edm.DateTime","SomeDoubleProperty0":1,"SomeDoubleProperty0@odata.type":"Edm.Double","SomeDoubleProperty1":1.2345,"SomeDoubleProperty1@odata.type":"Edm.Double","SomeGuidProperty":"7ff97177-74be-48b0-6508-e241a43145ca","SomeGuidProperty@odata.type":"Edm.Guid","SomeInt64Property":"9223372036854775807","SomeInt64Property@odata.type":"Edm.Int64","SomeIntProperty":42,"SomeStringProperty":"some + string","StringProp":"some string 2"}' + form: {} + headers: + Accept: + - application/json;odata=minimalmetadata + Authorization: + - sanitized + Content-Length: + - "663" + Content-Type: + - application/json + Dataserviceversion: + - "3.0" + Prefer: + - return-no-content + User-Agent: + - azsdk-go-tables/ azsdk-go-tables/ azcore/v0.16.1 (go1.16.2; + Windows_NT) + X-Ms-Date: + - Wed, 19 May 2021 16:25:37 GMT + X-Ms-Version: + - "2019-02-02" + url: https://chrisstablesprim.table.cosmos.azure.com/gotableerbzz3oh8axos + method: POST + response: + body: "" + headers: + Content-Length: + - "0" + Date: + - Wed, 19 May 2021 16:25:37 GMT + Etag: + - W/"datetime'2021-05-19T16%3A25%3A37.3221896Z'" + Location: + - https://chrisstablesprim.table.cosmos.azure.com/gotableerbzz3oh8axos(PartitionKey='partition',RowKey='2') + Preference-Applied: + - return-no-content + Server: + - Microsoft-HTTPAPI/2.0 + X-Ms-Request-Id: + - 6b425666-7fd5-48fb-a84b-43b4b0f282cb + status: 204 No Content + code: 204 + duration: "" +- request: + body: '{"BoolProp":true,"IntProp":3,"PartitionKey":"partition","RowKey":"3","SomeBinaryProperty":"c29tZSBieXRlcw==","SomeBinaryProperty@odata.type":"Edm.Binary","SomeDateProperty":"2021-05-19T16:25:36.9614656Z","SomeDateProperty@odata.type":"Edm.DateTime","SomeDoubleProperty0":1,"SomeDoubleProperty0@odata.type":"Edm.Double","SomeDoubleProperty1":1.2345,"SomeDoubleProperty1@odata.type":"Edm.Double","SomeGuidProperty":"e3d25206-7ddd-45f3-5914-7324bcac30da","SomeGuidProperty@odata.type":"Edm.Guid","SomeInt64Property":"9223372036854775807","SomeInt64Property@odata.type":"Edm.Int64","SomeIntProperty":42,"SomeStringProperty":"some + string","StringProp":"some string 3"}' + form: {} + headers: + Accept: + - application/json;odata=minimalmetadata + Authorization: + - sanitized + Content-Length: + - "663" + Content-Type: + - application/json + Dataserviceversion: + - "3.0" + Prefer: + - return-no-content + User-Agent: + - azsdk-go-tables/ azsdk-go-tables/ azcore/v0.16.1 (go1.16.2; + Windows_NT) + X-Ms-Date: + - Wed, 19 May 2021 16:25:37 GMT + X-Ms-Version: + - "2019-02-02" + url: https://chrisstablesprim.table.cosmos.azure.com/gotableerbzz3oh8axos + method: POST + response: + body: "" + headers: + Content-Length: + - "0" + Date: + - Wed, 19 May 2021 16:25:37 GMT + Etag: + - W/"datetime'2021-05-19T16%3A25%3A37.3971464Z'" + Location: + - https://chrisstablesprim.table.cosmos.azure.com/gotableerbzz3oh8axos(PartitionKey='partition',RowKey='3') + Preference-Applied: + - return-no-content + Server: + - Microsoft-HTTPAPI/2.0 + X-Ms-Request-Id: + - 37712eb5-d553-4201-8281-557bb6a05794 + status: 204 No Content + code: 204 + duration: "" +- request: + body: '{"BoolProp":true,"IntProp":4,"PartitionKey":"partition","RowKey":"4","SomeBinaryProperty":"c29tZSBieXRlcw==","SomeBinaryProperty@odata.type":"Edm.Binary","SomeDateProperty":"2021-05-19T16:25:36.9614656Z","SomeDateProperty@odata.type":"Edm.DateTime","SomeDoubleProperty0":1,"SomeDoubleProperty0@odata.type":"Edm.Double","SomeDoubleProperty1":1.2345,"SomeDoubleProperty1@odata.type":"Edm.Double","SomeGuidProperty":"10b21c2d-8c8a-4171-6d54-b3c3c44c5a13","SomeGuidProperty@odata.type":"Edm.Guid","SomeInt64Property":"9223372036854775807","SomeInt64Property@odata.type":"Edm.Int64","SomeIntProperty":42,"SomeStringProperty":"some + string","StringProp":"some string 4"}' + form: {} + headers: + Accept: + - application/json;odata=minimalmetadata + Authorization: + - sanitized + Content-Length: + - "663" + Content-Type: + - application/json + Dataserviceversion: + - "3.0" + Prefer: + - return-no-content + User-Agent: + - azsdk-go-tables/ azsdk-go-tables/ azcore/v0.16.1 (go1.16.2; + Windows_NT) + X-Ms-Date: + - Wed, 19 May 2021 16:25:37 GMT + X-Ms-Version: + - "2019-02-02" + url: https://chrisstablesprim.table.cosmos.azure.com/gotableerbzz3oh8axos + method: POST + response: + body: "" + headers: + Content-Length: + - "0" + Date: + - Wed, 19 May 2021 16:25:37 GMT + Etag: + - W/"datetime'2021-05-19T16%3A25%3A37.4755848Z'" + Location: + - https://chrisstablesprim.table.cosmos.azure.com/gotableerbzz3oh8axos(PartitionKey='partition',RowKey='4') + Preference-Applied: + - return-no-content + Server: + - Microsoft-HTTPAPI/2.0 + X-Ms-Request-Id: + - 208c2931-b5c1-4d93-8608-1dd165a5cb9a + status: 204 No Content + code: 204 + duration: "" +- request: + body: '{"BoolProp":true,"IntProp":5,"PartitionKey":"partition","RowKey":"5","SomeBinaryProperty":"c29tZSBieXRlcw==","SomeBinaryProperty@odata.type":"Edm.Binary","SomeDateProperty":"2021-05-19T16:25:36.9614656Z","SomeDateProperty@odata.type":"Edm.DateTime","SomeDoubleProperty0":1,"SomeDoubleProperty0@odata.type":"Edm.Double","SomeDoubleProperty1":1.2345,"SomeDoubleProperty1@odata.type":"Edm.Double","SomeGuidProperty":"ac1bacb5-1e2a-453e-5410-2ba3ec3bcbf5","SomeGuidProperty@odata.type":"Edm.Guid","SomeInt64Property":"9223372036854775807","SomeInt64Property@odata.type":"Edm.Int64","SomeIntProperty":42,"SomeStringProperty":"some + string","StringProp":"some string 5"}' + form: {} + headers: + Accept: + - application/json;odata=minimalmetadata + Authorization: + - sanitized + Content-Length: + - "663" + Content-Type: + - application/json + Dataserviceversion: + - "3.0" + Prefer: + - return-no-content + User-Agent: + - azsdk-go-tables/ azsdk-go-tables/ azcore/v0.16.1 (go1.16.2; + Windows_NT) + X-Ms-Date: + - Wed, 19 May 2021 16:25:37 GMT + X-Ms-Version: + - "2019-02-02" + url: https://chrisstablesprim.table.cosmos.azure.com/gotableerbzz3oh8axos + method: POST + response: + body: "" + headers: + Content-Length: + - "0" + Date: + - Wed, 19 May 2021 16:25:37 GMT + Etag: + - W/"datetime'2021-05-19T16%3A25%3A37.5523848Z'" + Location: + - https://chrisstablesprim.table.cosmos.azure.com/gotableerbzz3oh8axos(PartitionKey='partition',RowKey='5') + Preference-Applied: + - return-no-content + Server: + - Microsoft-HTTPAPI/2.0 + X-Ms-Request-Id: + - c720727d-3141-4628-9d6a-5fe36e7c1f3f + 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-tables/ azsdk-go-tables/ azcore/v0.16.1 (go1.16.2; + Windows_NT) + X-Ms-Date: + - Wed, 19 May 2021 16:25:37 GMT + X-Ms-Version: + - "2019-02-02" + url: https://chrisstablesprim.table.cosmos.azure.com/gotableerbzz3oh8axos()?%24filter=RowKey+lt+%275%27 + method: GET + response: + body: '{"value":[{"odata.etag":"W/\"datetime''2021-05-19T16%3A25%3A37.2379144Z''\"","BoolProp":true,"IntProp":1,"PartitionKey":"partition","RowKey":"1","SomeBinaryProperty@odata.type":"Edm.Binary","SomeBinaryProperty":"c29tZSBieXRlcw==","SomeDateProperty@odata.type":"Edm.DateTime","SomeDateProperty":"2021-05-19T16:25:36.9614656Z","SomeDoubleProperty0":1.0,"SomeDoubleProperty1":1.2345,"SomeGuidProperty@odata.type":"Edm.Guid","SomeGuidProperty":"d043f74e-07ff-4cc6-466d-4a3e83bea7a6","SomeInt64Property@odata.type":"Edm.Int64","SomeInt64Property":"9223372036854775807","SomeIntProperty":42,"SomeStringProperty":"some + string","StringProp":"some string 1","Timestamp":"2021-05-19T16:25:37.2379144Z"},{"odata.etag":"W/\"datetime''2021-05-19T16%3A25%3A37.3221896Z''\"","BoolProp":true,"IntProp":2,"PartitionKey":"partition","RowKey":"2","SomeBinaryProperty@odata.type":"Edm.Binary","SomeBinaryProperty":"c29tZSBieXRlcw==","SomeDateProperty@odata.type":"Edm.DateTime","SomeDateProperty":"2021-05-19T16:25:36.9614656Z","SomeDoubleProperty0":1.0,"SomeDoubleProperty1":1.2345,"SomeGuidProperty@odata.type":"Edm.Guid","SomeGuidProperty":"7ff97177-74be-48b0-6508-e241a43145ca","SomeInt64Property@odata.type":"Edm.Int64","SomeInt64Property":"9223372036854775807","SomeIntProperty":42,"SomeStringProperty":"some + string","StringProp":"some string 2","Timestamp":"2021-05-19T16:25:37.3221896Z"},{"odata.etag":"W/\"datetime''2021-05-19T16%3A25%3A37.3971464Z''\"","BoolProp":true,"IntProp":3,"PartitionKey":"partition","RowKey":"3","SomeBinaryProperty@odata.type":"Edm.Binary","SomeBinaryProperty":"c29tZSBieXRlcw==","SomeDateProperty@odata.type":"Edm.DateTime","SomeDateProperty":"2021-05-19T16:25:36.9614656Z","SomeDoubleProperty0":1.0,"SomeDoubleProperty1":1.2345,"SomeGuidProperty@odata.type":"Edm.Guid","SomeGuidProperty":"e3d25206-7ddd-45f3-5914-7324bcac30da","SomeInt64Property@odata.type":"Edm.Int64","SomeInt64Property":"9223372036854775807","SomeIntProperty":42,"SomeStringProperty":"some + string","StringProp":"some string 3","Timestamp":"2021-05-19T16:25:37.3971464Z"},{"odata.etag":"W/\"datetime''2021-05-19T16%3A25%3A37.4755848Z''\"","BoolProp":true,"IntProp":4,"PartitionKey":"partition","RowKey":"4","SomeBinaryProperty@odata.type":"Edm.Binary","SomeBinaryProperty":"c29tZSBieXRlcw==","SomeDateProperty@odata.type":"Edm.DateTime","SomeDateProperty":"2021-05-19T16:25:36.9614656Z","SomeDoubleProperty0":1.0,"SomeDoubleProperty1":1.2345,"SomeGuidProperty@odata.type":"Edm.Guid","SomeGuidProperty":"10b21c2d-8c8a-4171-6d54-b3c3c44c5a13","SomeInt64Property@odata.type":"Edm.Int64","SomeInt64Property":"9223372036854775807","SomeIntProperty":42,"SomeStringProperty":"some + string","StringProp":"some string 4","Timestamp":"2021-05-19T16:25:37.4755848Z"}],"odata.metadata":"https://chrisstablesprim.table.cosmos.azure.com/$metadata#gotableerbzz3oh8axos"}' + headers: + Content-Type: + - application/json;odata=minimalmetadata + Date: + - Wed, 19 May 2021 16:25:37 GMT + Server: + - Microsoft-HTTPAPI/2.0 + X-Ms-Request-Id: + - 3cdbe1a7-78e9-468f-97f3-ac9797a0b9d0 + status: 200 Ok + code: 200 + duration: "" +- request: + body: "" + form: {} + headers: + Accept: + - application/json + Authorization: + - sanitized + User-Agent: + - azsdk-go-tables/ azsdk-go-tables/ azcore/v0.16.1 (go1.16.2; + Windows_NT) + X-Ms-Date: + - Wed, 19 May 2021 16:25:37 GMT + X-Ms-Version: + - "2019-02-02" + url: https://chrisstablesprim.table.cosmos.azure.com/Tables('gotableerbzz3oh8axos') + method: DELETE + response: + body: "" + headers: + Content-Length: + - "0" + Date: + - Wed, 19 May 2021 16:25:37 GMT + Server: + - Microsoft-HTTPAPI/2.0 + X-Ms-Request-Id: + - 8bfec822-1a10-4c87-97ec-875c49da7acb + status: 204 No Content + code: 204 + duration: "" diff --git a/sdk/tables/aztables/recordings/TestTableClient_Cosmos/TestQuerySimpleEntity-variables.yaml b/sdk/tables/aztables/recordings/TestTableClient_Cosmos/TestQuerySimpleEntity-variables.yaml new file mode 100644 index 000000000000..05898e645159 --- /dev/null +++ b/sdk/tables/aztables/recordings/TestTableClient_Cosmos/TestQuerySimpleEntity-variables.yaml @@ -0,0 +1,5 @@ +--- +COSMOS_TABLES_ENDPOINT_SUFFIX: cosmos.azure.com +TABLES_COSMOS_ACCOUNT_NAME: chrisstablesprim +TABLES_PRIMARY_COSMOS_ACCOUNT_KEY: Kg== +randomSeed: "1617598959" diff --git a/sdk/tables/aztables/recordings/TestTableClient_Cosmos/TestQuerySimpleEntity.yaml b/sdk/tables/aztables/recordings/TestTableClient_Cosmos/TestQuerySimpleEntity.yaml new file mode 100644 index 000000000000..4cc2c9ff4295 --- /dev/null +++ b/sdk/tables/aztables/recordings/TestTableClient_Cosmos/TestQuerySimpleEntity.yaml @@ -0,0 +1,342 @@ +--- +version: 1 +interactions: +- request: + body: '{"TableName":"gotabledtlot4b2qfkop"}' + form: {} + headers: + Accept: + - application/json;odata=minimalmetadata + Authorization: + - sanitized + Content-Length: + - "36" + Content-Type: + - application/json + Dataserviceversion: + - "3.0" + User-Agent: + - azsdk-go-tables/ azsdk-go-tables/ azcore/v0.13.4 (go1.16.2; + Windows_NT) + X-Ms-Date: + - Mon, 05 Apr 2021 05:02:39 GMT + X-Ms-Version: + - "2019-02-02" + url: https://chrisstablesprim.table.cosmos.azure.com/Tables + method: POST + response: + body: '{"TableName":"gotabledtlot4b2qfkop","odata.metadata":"https://chrisstablesprim.table.cosmos.azure.com/$metadata#Tables/@Element"}' + headers: + Content-Type: + - application/json;odata=minimalmetadata + Date: + - Mon, 05 Apr 2021 05:02:40 GMT + Etag: + - W/"datetime'2021-04-05T05%3A02%3A40.1485832Z'" + Location: + - https://chrisstablesprim.table.cosmos.azure.com/Tables('gotabledtlot4b2qfkop') + Server: + - Microsoft-HTTPAPI/2.0 + X-Ms-Request-Id: + - 0c4ccc90-a38a-47db-b904-ec327ee3f600 + status: 201 Created + code: 201 + duration: "" +- request: + body: '{"BoolProp":true,"IntProp":1,"PartitionKey":"partition","RowKey":"1","StringProp":"some + string 1"}' + form: {} + headers: + Accept: + - application/json;odata=minimalmetadata + Authorization: + - sanitized + Content-Length: + - "98" + Content-Type: + - application/json + Dataserviceversion: + - "3.0" + Prefer: + - return-no-content + User-Agent: + - azsdk-go-tables/ azsdk-go-tables/ azcore/v0.13.4 (go1.16.2; + Windows_NT) + X-Ms-Date: + - Mon, 05 Apr 2021 05:02:40 GMT + X-Ms-Version: + - "2019-02-02" + url: https://chrisstablesprim.table.cosmos.azure.com/gotabledtlot4b2qfkop + method: POST + response: + body: "" + headers: + Content-Length: + - "0" + Date: + - Mon, 05 Apr 2021 05:02:40 GMT + Etag: + - W/"datetime'2021-04-05T05%3A02%3A40.7371784Z'" + Location: + - https://chrisstablesprim.table.cosmos.azure.com/gotabledtlot4b2qfkop(PartitionKey='partition',RowKey='1') + Preference-Applied: + - return-no-content + Server: + - Microsoft-HTTPAPI/2.0 + X-Ms-Request-Id: + - 40cfa5d5-3867-469b-a5fe-aa61bfdded39 + status: 204 No Content + code: 204 + duration: "" +- request: + body: '{"BoolProp":true,"IntProp":2,"PartitionKey":"partition","RowKey":"2","StringProp":"some + string 2"}' + form: {} + headers: + Accept: + - application/json;odata=minimalmetadata + Authorization: + - sanitized + Content-Length: + - "98" + Content-Type: + - application/json + Dataserviceversion: + - "3.0" + Prefer: + - return-no-content + User-Agent: + - azsdk-go-tables/ azsdk-go-tables/ azcore/v0.13.4 (go1.16.2; + Windows_NT) + X-Ms-Date: + - Mon, 05 Apr 2021 05:02:40 GMT + X-Ms-Version: + - "2019-02-02" + url: https://chrisstablesprim.table.cosmos.azure.com/gotabledtlot4b2qfkop + method: POST + response: + body: "" + headers: + Content-Length: + - "0" + Date: + - Mon, 05 Apr 2021 05:02:40 GMT + Etag: + - W/"datetime'2021-04-05T05%3A02%3A40.8410120Z'" + Location: + - https://chrisstablesprim.table.cosmos.azure.com/gotabledtlot4b2qfkop(PartitionKey='partition',RowKey='2') + Preference-Applied: + - return-no-content + Server: + - Microsoft-HTTPAPI/2.0 + X-Ms-Request-Id: + - 3c31aac3-2859-47ad-abd7-8203e7f10b11 + status: 204 No Content + code: 204 + duration: "" +- request: + body: '{"BoolProp":true,"IntProp":3,"PartitionKey":"partition","RowKey":"3","StringProp":"some + string 3"}' + form: {} + headers: + Accept: + - application/json;odata=minimalmetadata + Authorization: + - sanitized + Content-Length: + - "98" + Content-Type: + - application/json + Dataserviceversion: + - "3.0" + Prefer: + - return-no-content + User-Agent: + - azsdk-go-tables/ azsdk-go-tables/ azcore/v0.13.4 (go1.16.2; + Windows_NT) + X-Ms-Date: + - Mon, 05 Apr 2021 05:02:41 GMT + X-Ms-Version: + - "2019-02-02" + url: https://chrisstablesprim.table.cosmos.azure.com/gotabledtlot4b2qfkop + method: POST + response: + body: "" + headers: + Content-Length: + - "0" + Date: + - Mon, 05 Apr 2021 05:02:40 GMT + Etag: + - W/"datetime'2021-04-05T05%3A02%3A40.9537544Z'" + Location: + - https://chrisstablesprim.table.cosmos.azure.com/gotabledtlot4b2qfkop(PartitionKey='partition',RowKey='3') + Preference-Applied: + - return-no-content + Server: + - Microsoft-HTTPAPI/2.0 + X-Ms-Request-Id: + - 0cd7d680-2274-4e93-9b7f-4d44cacff771 + status: 204 No Content + code: 204 + duration: "" +- request: + body: '{"BoolProp":true,"IntProp":4,"PartitionKey":"partition","RowKey":"4","StringProp":"some + string 4"}' + form: {} + headers: + Accept: + - application/json;odata=minimalmetadata + Authorization: + - sanitized + Content-Length: + - "98" + Content-Type: + - application/json + Dataserviceversion: + - "3.0" + Prefer: + - return-no-content + User-Agent: + - azsdk-go-tables/ azsdk-go-tables/ azcore/v0.13.4 (go1.16.2; + Windows_NT) + X-Ms-Date: + - Mon, 05 Apr 2021 05:02:41 GMT + X-Ms-Version: + - "2019-02-02" + url: https://chrisstablesprim.table.cosmos.azure.com/gotabledtlot4b2qfkop + method: POST + response: + body: "" + headers: + Content-Length: + - "0" + Date: + - Mon, 05 Apr 2021 05:02:40 GMT + Etag: + - W/"datetime'2021-04-05T05%3A02%3A41.0579976Z'" + Location: + - https://chrisstablesprim.table.cosmos.azure.com/gotabledtlot4b2qfkop(PartitionKey='partition',RowKey='4') + Preference-Applied: + - return-no-content + Server: + - Microsoft-HTTPAPI/2.0 + X-Ms-Request-Id: + - 2c18f6d8-af7f-4533-bf30-9243a8e31e18 + status: 204 No Content + code: 204 + duration: "" +- request: + body: '{"BoolProp":true,"IntProp":5,"PartitionKey":"partition","RowKey":"5","StringProp":"some + string 5"}' + form: {} + headers: + Accept: + - application/json;odata=minimalmetadata + Authorization: + - sanitized + Content-Length: + - "98" + Content-Type: + - application/json + Dataserviceversion: + - "3.0" + Prefer: + - return-no-content + User-Agent: + - azsdk-go-tables/ azsdk-go-tables/ azcore/v0.13.4 (go1.16.2; + Windows_NT) + X-Ms-Date: + - Mon, 05 Apr 2021 05:02:41 GMT + X-Ms-Version: + - "2019-02-02" + url: https://chrisstablesprim.table.cosmos.azure.com/gotabledtlot4b2qfkop + method: POST + response: + body: "" + headers: + Content-Length: + - "0" + Date: + - Mon, 05 Apr 2021 05:02:40 GMT + Etag: + - W/"datetime'2021-04-05T05%3A02%3A41.1676680Z'" + Location: + - https://chrisstablesprim.table.cosmos.azure.com/gotabledtlot4b2qfkop(PartitionKey='partition',RowKey='5') + Preference-Applied: + - return-no-content + Server: + - Microsoft-HTTPAPI/2.0 + X-Ms-Request-Id: + - 6ca39a1d-05ef-4d68-bfc2-5a79a009fdeb + 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-tables/ azsdk-go-tables/ azcore/v0.13.4 (go1.16.2; + Windows_NT) + X-Ms-Date: + - Mon, 05 Apr 2021 05:02:41 GMT + X-Ms-Version: + - "2019-02-02" + url: https://chrisstablesprim.table.cosmos.azure.com/gotabledtlot4b2qfkop()?%24filter=RowKey+lt+%275%27 + method: GET + response: + body: '{"value":[{"odata.etag":"W/\"datetime''2021-04-05T05%3A02%3A40.7371784Z''\"","BoolProp":true,"IntProp":1,"PartitionKey":"partition","RowKey":"1","StringProp":"some + string 1","Timestamp":"2021-04-05T05:02:40.7371784Z"},{"odata.etag":"W/\"datetime''2021-04-05T05%3A02%3A40.8410120Z''\"","BoolProp":true,"IntProp":2,"PartitionKey":"partition","RowKey":"2","StringProp":"some + string 2","Timestamp":"2021-04-05T05:02:40.8410120Z"},{"odata.etag":"W/\"datetime''2021-04-05T05%3A02%3A40.9537544Z''\"","BoolProp":true,"IntProp":3,"PartitionKey":"partition","RowKey":"3","StringProp":"some + string 3","Timestamp":"2021-04-05T05:02:40.9537544Z"},{"odata.etag":"W/\"datetime''2021-04-05T05%3A02%3A41.0579976Z''\"","BoolProp":true,"IntProp":4,"PartitionKey":"partition","RowKey":"4","StringProp":"some + string 4","Timestamp":"2021-04-05T05:02:41.0579976Z"}],"odata.metadata":"https://chrisstablesprim.table.cosmos.azure.com/$metadata#gotabledtlot4b2qfkop"}' + headers: + Content-Type: + - application/json;odata=minimalmetadata + Date: + - Mon, 05 Apr 2021 05:02:40 GMT + Server: + - Microsoft-HTTPAPI/2.0 + X-Ms-Request-Id: + - 98466a7e-727a-4e2d-8f48-37039dae8f64 + status: 200 OK + code: 200 + duration: "" +- request: + body: "" + form: {} + headers: + Accept: + - application/json + Authorization: + - sanitized + User-Agent: + - azsdk-go-tables/ azsdk-go-tables/ azcore/v0.13.4 (go1.16.2; + Windows_NT) + X-Ms-Date: + - Mon, 05 Apr 2021 05:02:41 GMT + X-Ms-Version: + - "2019-02-02" + url: https://chrisstablesprim.table.cosmos.azure.com/Tables('gotabledtlot4b2qfkop') + method: DELETE + response: + body: "" + headers: + Content-Length: + - "0" + Date: + - Mon, 05 Apr 2021 05:02:41 GMT + Server: + - Microsoft-HTTPAPI/2.0 + X-Ms-Request-Id: + - d7fa3ec7-64ad-43a3-8444-9f567b156391 + status: 204 No Content + code: 204 + duration: "" diff --git a/sdk/tables/aztables/recordings/TestTableClient_Cosmos/TestServiceErrors-variables.yaml b/sdk/tables/aztables/recordings/TestTableClient_Cosmos/TestServiceErrors-variables.yaml new file mode 100644 index 000000000000..be617c45b1f0 --- /dev/null +++ b/sdk/tables/aztables/recordings/TestTableClient_Cosmos/TestServiceErrors-variables.yaml @@ -0,0 +1,5 @@ +--- +COSMOS_TABLES_ENDPOINT_SUFFIX: cosmos.azure.com +TABLES_COSMOS_ACCOUNT_NAME: chrisstablesprim +TABLES_PRIMARY_COSMOS_ACCOUNT_KEY: Kg== +randomSeed: "1617580014" diff --git a/sdk/tables/aztables/recordings/TestTableClient_Cosmos/TestServiceErrors.yaml b/sdk/tables/aztables/recordings/TestTableClient_Cosmos/TestServiceErrors.yaml new file mode 100644 index 000000000000..0a52371c64d2 --- /dev/null +++ b/sdk/tables/aztables/recordings/TestTableClient_Cosmos/TestServiceErrors.yaml @@ -0,0 +1,113 @@ +--- +version: 1 +interactions: +- request: + body: '{"TableName":"gotable85g6eby7icg1v"}' + form: {} + headers: + Accept: + - application/json;odata=minimalmetadata + Authorization: + - sanitized + Content-Length: + - "36" + Content-Type: + - application/json + Dataserviceversion: + - "3.0" + User-Agent: + - azsdk-go-tables/ azsdk-go-tables/ azcore/v0.13.4 (go1.16.2; + Windows_NT) + X-Ms-Date: + - Sun, 04 Apr 2021 23:46:54 GMT + X-Ms-Version: + - "2019-02-02" + url: https://chrisstablesprim.table.cosmos.azure.com/Tables + method: POST + response: + body: '{"TableName":"gotable85g6eby7icg1v","odata.metadata":"https://chrisstablesprim.table.cosmos.azure.com/$metadata#Tables/@Element"}' + headers: + Content-Type: + - application/json;odata=minimalmetadata + Date: + - Sun, 04 Apr 2021 23:46:54 GMT + Etag: + - W/"datetime'2021-04-04T23%3A46%3A54.7914760Z'" + Location: + - https://chrisstablesprim.table.cosmos.azure.com/Tables('gotable85g6eby7icg1v') + Server: + - Microsoft-HTTPAPI/2.0 + X-Ms-Request-Id: + - 947f9642-3c9b-475a-b3a0-6c04b3c2d40b + status: 201 Created + code: 201 + duration: "" +- request: + body: '{"TableName":"gotable85g6eby7icg1v"}' + form: {} + headers: + Accept: + - application/json;odata=minimalmetadata + Authorization: + - sanitized + Content-Length: + - "36" + Content-Type: + - application/json + Dataserviceversion: + - "3.0" + User-Agent: + - azsdk-go-tables/ azsdk-go-tables/ azcore/v0.13.4 (go1.16.2; + Windows_NT) + X-Ms-Date: + - Sun, 04 Apr 2021 23:46:55 GMT + X-Ms-Version: + - "2019-02-02" + url: https://chrisstablesprim.table.cosmos.azure.com/Tables + method: POST + response: + body: "{\"odata.error\":{\"code\":\"TableAlreadyExists\",\"message\":{\"lang\":\"en-us\",\"value\":\"The + specified table already exists.\\nRequestID:58f7ef4b-3378-4612-8f88-7fad883916de\\n\"}}}\r\n" + headers: + Content-Type: + - application/json;odata=minimalmetadata + Date: + - Sun, 04 Apr 2021 23:46:54 GMT + Server: + - Microsoft-HTTPAPI/2.0 + X-Ms-Request-Id: + - 58f7ef4b-3378-4612-8f88-7fad883916de + status: 409 Conflict + code: 409 + duration: "" +- request: + body: "" + form: {} + headers: + Accept: + - application/json + Authorization: + - sanitized + User-Agent: + - azsdk-go-tables/ azsdk-go-tables/ azcore/v0.13.4 (go1.16.2; + Windows_NT) + X-Ms-Date: + - Sun, 04 Apr 2021 23:46:55 GMT + X-Ms-Version: + - "2019-02-02" + url: https://chrisstablesprim.table.cosmos.azure.com/Tables('gotable85g6eby7icg1v') + method: DELETE + response: + body: "" + headers: + Content-Length: + - "0" + Date: + - Sun, 04 Apr 2021 23:46:54 GMT + Server: + - Microsoft-HTTPAPI/2.0 + X-Ms-Request-Id: + - 40da51e2-3c50-4a09-a6e9-78663d0215c4 + status: 204 No Content + code: 204 + duration: "" diff --git a/sdk/tables/aztables/recordings/TestTableClient_Cosmos/TestUpsertEntity-variables.yaml b/sdk/tables/aztables/recordings/TestTableClient_Cosmos/TestUpsertEntity-variables.yaml new file mode 100644 index 000000000000..c1db334f613b --- /dev/null +++ b/sdk/tables/aztables/recordings/TestTableClient_Cosmos/TestUpsertEntity-variables.yaml @@ -0,0 +1,5 @@ +--- +COSMOS_TABLES_ENDPOINT_SUFFIX: cosmos.azure.com +TABLES_COSMOS_ACCOUNT_NAME: chrisstablesprim +TABLES_PRIMARY_COSMOS_ACCOUNT_KEY: Kg== +randomSeed: "1621629299" diff --git a/sdk/tables/aztables/recordings/TestTableClient_Cosmos/TestUpsertEntity.yaml b/sdk/tables/aztables/recordings/TestTableClient_Cosmos/TestUpsertEntity.yaml new file mode 100644 index 000000000000..6401f20d46cd --- /dev/null +++ b/sdk/tables/aztables/recordings/TestTableClient_Cosmos/TestUpsertEntity.yaml @@ -0,0 +1,225 @@ +--- +version: 1 +interactions: +- request: + body: '{"TableName":"gotable1msfgttesz2cp"}' + form: {} + headers: + Accept: + - application/json;odata=minimalmetadata + Authorization: + - sanitized + Content-Length: + - "36" + Content-Type: + - application/json + Dataserviceversion: + - "3.0" + User-Agent: + - azsdk-go-tables/ azsdk-go-tables/ azcore/v0.16.1 (go1.16.2; + Windows_NT) + X-Ms-Date: + - Fri, 21 May 2021 20:34:59 GMT + X-Ms-Version: + - "2019-02-02" + url: https://chrisstablesprim.table.cosmos.azure.com/Tables + method: POST + response: + body: '{"TableName":"gotable1msfgttesz2cp","odata.metadata":"https://chrisstablesprim.table.cosmos.azure.com/$metadata#Tables/@Element"}' + headers: + Content-Type: + - application/json;odata=minimalmetadata + Date: + - Fri, 21 May 2021 20:35:00 GMT + Etag: + - W/"datetime'2021-05-21T20%3A35%3A00.7158280Z'" + Location: + - https://chrisstablesprim.table.cosmos.azure.com/Tables('gotable1msfgttesz2cp') + Server: + - Microsoft-HTTPAPI/2.0 + X-Ms-Request-Id: + - a06787e1-1d41-432c-92bc-45ab333cf72d + status: 201 Ok + code: 201 + duration: "" +- request: + body: '{"BoolProp":true,"IntProp":1,"PartitionKey":"partition","RowKey":"1","StringProp":"some + string 1"}' + form: {} + headers: + Accept: + - application/json + Authorization: + - sanitized + Content-Length: + - "98" + Content-Type: + - application/json + Dataserviceversion: + - "3.0" + User-Agent: + - azsdk-go-tables/ azsdk-go-tables/ azcore/v0.16.1 (go1.16.2; + Windows_NT) + X-Ms-Date: + - Fri, 21 May 2021 20:35:01 GMT + X-Ms-Version: + - "2019-02-02" + url: https://chrisstablesprim.table.cosmos.azure.com/gotable1msfgttesz2cp(PartitionKey='partition',RowKey='1') + method: PUT + response: + body: "" + headers: + Content-Length: + - "0" + Content-Type: + - application/json + Date: + - Fri, 21 May 2021 20:35:00 GMT + Etag: + - W/"datetime'2021-05-21T20%3A35%3A01.3144584Z'" + Server: + - Microsoft-HTTPAPI/2.0 + X-Ms-Request-Id: + - ae166874-a09d-4ddb-83cf-72d2728bcbbc + 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-tables/ azsdk-go-tables/ azcore/v0.16.1 (go1.16.2; + Windows_NT) + X-Ms-Date: + - Fri, 21 May 2021 20:35:01 GMT + X-Ms-Version: + - "2019-02-02" + url: https://chrisstablesprim.table.cosmos.azure.com/gotable1msfgttesz2cp()?%24filter=RowKey+eq+%271%27 + method: GET + response: + body: '{"value":[{"odata.etag":"W/\"datetime''2021-05-21T20%3A35%3A01.3144584Z''\"","PartitionKey":"partition","RowKey":"1","BoolProp":true,"IntProp":1,"StringProp":"some + string 1","Timestamp":"2021-05-21T20:35:01.3144584Z"}],"odata.metadata":"https://chrisstablesprim.table.cosmos.azure.com/$metadata#gotable1msfgttesz2cp"}' + headers: + Content-Type: + - application/json;odata=minimalmetadata + Date: + - Fri, 21 May 2021 20:35:00 GMT + Server: + - Microsoft-HTTPAPI/2.0 + X-Ms-Request-Id: + - d091e8e7-5c01-4fd7-8637-fc7960d805b2 + status: 200 Ok + code: 200 + duration: "" +- request: + body: '{"MergeProperty":"foo","PartitionKey":"partition","RowKey":"1"}' + form: {} + headers: + Accept: + - application/json + Authorization: + - sanitized + Content-Length: + - "63" + Content-Type: + - application/json + Dataserviceversion: + - "3.0" + User-Agent: + - azsdk-go-tables/ azsdk-go-tables/ azcore/v0.16.1 (go1.16.2; + Windows_NT) + X-Ms-Date: + - Fri, 21 May 2021 20:35:01 GMT + X-Ms-Version: + - "2019-02-02" + url: https://chrisstablesprim.table.cosmos.azure.com/gotable1msfgttesz2cp(PartitionKey='partition',RowKey='1') + method: PUT + response: + body: "" + headers: + Content-Length: + - "0" + Content-Type: + - application/json + Date: + - Fri, 21 May 2021 20:35:00 GMT + Etag: + - W/"datetime'2021-05-21T20%3A35%3A01.4885384Z'" + Server: + - Microsoft-HTTPAPI/2.0 + X-Ms-Request-Id: + - 54960acf-d75a-4bf5-b2eb-b20a4e546c72 + 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-tables/ azsdk-go-tables/ azcore/v0.16.1 (go1.16.2; + Windows_NT) + X-Ms-Date: + - Fri, 21 May 2021 20:35:01 GMT + X-Ms-Version: + - "2019-02-02" + url: https://chrisstablesprim.table.cosmos.azure.com/gotable1msfgttesz2cp()?%24filter=RowKey+eq+%271%27 + method: GET + response: + body: '{"value":[{"odata.etag":"W/\"datetime''2021-05-21T20%3A35%3A01.4885384Z''\"","PartitionKey":"partition","RowKey":"1","MergeProperty":"foo","Timestamp":"2021-05-21T20:35:01.4885384Z"}],"odata.metadata":"https://chrisstablesprim.table.cosmos.azure.com/$metadata#gotable1msfgttesz2cp"}' + headers: + Content-Type: + - application/json;odata=minimalmetadata + Date: + - Fri, 21 May 2021 20:35:00 GMT + Server: + - Microsoft-HTTPAPI/2.0 + X-Ms-Request-Id: + - 656e83b0-2e58-4c39-beec-116830e09468 + status: 200 Ok + code: 200 + duration: "" +- request: + body: "" + form: {} + headers: + Accept: + - application/json + Authorization: + - sanitized + User-Agent: + - azsdk-go-tables/ azsdk-go-tables/ azcore/v0.16.1 (go1.16.2; + Windows_NT) + X-Ms-Date: + - Fri, 21 May 2021 20:35:01 GMT + X-Ms-Version: + - "2019-02-02" + url: https://chrisstablesprim.table.cosmos.azure.com/Tables('gotable1msfgttesz2cp') + method: DELETE + response: + body: "" + headers: + Content-Length: + - "0" + Date: + - Fri, 21 May 2021 20:35:01 GMT + Server: + - Microsoft-HTTPAPI/2.0 + X-Ms-Request-Id: + - 6d490fec-695f-4191-9f6c-50c27bafe0ef + status: 204 No Content + code: 204 + duration: "" diff --git a/sdk/tables/aztables/recordings/TestTableClient_Storage/TestAddComplexEntity-variables.yaml b/sdk/tables/aztables/recordings/TestTableClient_Storage/TestAddComplexEntity-variables.yaml new file mode 100644 index 000000000000..f86a77d88694 --- /dev/null +++ b/sdk/tables/aztables/recordings/TestTableClient_Storage/TestAddComplexEntity-variables.yaml @@ -0,0 +1,6 @@ +--- +STORAGE_ENDPOINT_SUFFIX: core.windows.net +TABLES_PRIMARY_STORAGE_ACCOUNT_KEY: Kg== +TABLES_STORAGE_ACCOUNT_NAME: chrisstablesprim +now: "2021-04-10T19:18:38.5403201-05:00" +randomSeed: "1618100317" diff --git a/sdk/tables/aztables/recordings/TestTableClient_Storage/TestAddComplexEntity.yaml b/sdk/tables/aztables/recordings/TestTableClient_Storage/TestAddComplexEntity.yaml new file mode 100644 index 000000000000..78e8e8f28f88 --- /dev/null +++ b/sdk/tables/aztables/recordings/TestTableClient_Storage/TestAddComplexEntity.yaml @@ -0,0 +1,139 @@ +--- +version: 1 +interactions: +- request: + body: '{"TableName":"gotableseqkydnlewbop"}' + form: {} + headers: + Accept: + - application/json;odata=minimalmetadata + Authorization: + - sanitized + Content-Length: + - "36" + Content-Type: + - application/json + Dataserviceversion: + - "3.0" + User-Agent: + - azsdk-go-tables/ azsdk-go-tables/ azcore/v0.13.4 (go1.16.2; + Windows_NT) + X-Ms-Date: + - Sun, 11 Apr 2021 00:18:37 GMT + X-Ms-Version: + - "2019-02-02" + url: https://chrisstablesprim.table.core.windows.net/Tables + method: POST + response: + body: '{"odata.metadata":"https://chrisstablesprim.table.core.windows.net/$metadata#Tables/@Element","TableName":"gotableseqkydnlewbop"}' + headers: + Cache-Control: + - no-cache + Content-Type: + - application/json;odata=minimalmetadata;streaming=true;charset=utf-8 + Date: + - Sun, 11 Apr 2021 00:18:38 GMT + Location: + - https://chrisstablesprim.table.core.windows.net/Tables('gotableseqkydnlewbop') + Server: + - Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0 + X-Content-Type-Options: + - nosniff + X-Ms-Request-Id: + - 91267bb0-7002-0034-4468-2e07dc000000 + X-Ms-Version: + - "2019-02-02" + status: 201 Created + code: 201 + duration: "" +- request: + body: '{"PartitionKey":"partition","RowKey":"row","SomeBinaryProperty":"c29tZSBieXRlcw==","SomeBinaryProperty@odata.type":"Edm.Binary","SomeDateProperty":"2021-04-11T00:18:38.5403201Z","SomeDateProperty@odata.type":"Edm.DateTime","SomeDoubleProperty0":1,"SomeDoubleProperty0@odata.type":"Edm.Double","SomeDoubleProperty1":1.2345,"SomeDoubleProperty1@odata.type":"Edm.Double","SomeGuidProperty":"bc08bdf6-10bd-4b3e-612f-62de19f57821","SomeGuidProperty@odata.type":"Edm.Guid","SomeInt64Property":"9223372036854775807","SomeInt64Property@odata.type":"Edm.Int64","SomeIntProperty":42,"SomePtrStringProperty":"some + pointer to string","SomeStringProperty":"some string"}' + form: {} + headers: + Accept: + - application/json;odata=minimalmetadata + Authorization: + - sanitized + Content-Length: + - "657" + Content-Type: + - application/json + Dataserviceversion: + - "3.0" + Prefer: + - return-no-content + User-Agent: + - azsdk-go-tables/ azsdk-go-tables/ azcore/v0.13.4 (go1.16.2; + Windows_NT) + X-Ms-Date: + - Sun, 11 Apr 2021 00:18:38 GMT + X-Ms-Version: + - "2019-02-02" + url: https://chrisstablesprim.table.core.windows.net/gotableseqkydnlewbop + method: POST + response: + body: "" + headers: + Cache-Control: + - no-cache + Content-Length: + - "0" + Dataserviceid: + - https://chrisstablesprim.table.core.windows.net/gotableseqkydnlewbop(PartitionKey='partition',RowKey='row') + Date: + - Sun, 11 Apr 2021 00:18:38 GMT + Etag: + - W/"datetime'2021-04-11T00%3A18%3A38.2407207Z'" + Location: + - https://chrisstablesprim.table.core.windows.net/gotableseqkydnlewbop(PartitionKey='partition',RowKey='row') + Preference-Applied: + - return-no-content + Server: + - Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0 + X-Content-Type-Options: + - nosniff + X-Ms-Request-Id: + - 91267bbe-7002-0034-5068-2e07dc000000 + 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-tables/ azsdk-go-tables/ azcore/v0.13.4 (go1.16.2; + Windows_NT) + X-Ms-Date: + - Sun, 11 Apr 2021 00:18:38 GMT + X-Ms-Version: + - "2019-02-02" + url: https://chrisstablesprim.table.core.windows.net/Tables('gotableseqkydnlewbop') + method: DELETE + response: + body: "" + headers: + Cache-Control: + - no-cache + Content-Length: + - "0" + Date: + - Sun, 11 Apr 2021 00:18:38 GMT + Server: + - Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0 + X-Content-Type-Options: + - nosniff + X-Ms-Request-Id: + - 91267bc3-7002-0034-5568-2e07dc000000 + X-Ms-Version: + - "2019-02-02" + status: 204 No Content + code: 204 + duration: "" diff --git a/sdk/tables/aztables/recordings/TestTableClient_Storage/TestAddEntity-variables.yaml b/sdk/tables/aztables/recordings/TestTableClient_Storage/TestAddEntity-variables.yaml new file mode 100644 index 000000000000..b2ce8f9f7145 --- /dev/null +++ b/sdk/tables/aztables/recordings/TestTableClient_Storage/TestAddEntity-variables.yaml @@ -0,0 +1,5 @@ +--- +STORAGE_ENDPOINT_SUFFIX: core.windows.net +TABLES_PRIMARY_STORAGE_ACCOUNT_KEY: Kg== +TABLES_STORAGE_ACCOUNT_NAME: chrisstablesprim +randomSeed: "1617580855" diff --git a/sdk/tables/aztables/recordings/TestTableClient_Storage/TestAddEntity.yaml b/sdk/tables/aztables/recordings/TestTableClient_Storage/TestAddEntity.yaml new file mode 100644 index 000000000000..e5b71baad0b6 --- /dev/null +++ b/sdk/tables/aztables/recordings/TestTableClient_Storage/TestAddEntity.yaml @@ -0,0 +1,139 @@ +--- +version: 1 +interactions: +- request: + body: '{"TableName":"gotableldjhskq166plj"}' + form: {} + headers: + Accept: + - application/json;odata=minimalmetadata + Authorization: + - sanitized + Content-Length: + - "36" + Content-Type: + - application/json + Dataserviceversion: + - "3.0" + User-Agent: + - azsdk-go-tables/ azsdk-go-tables/ azcore/v0.13.4 (go1.16.2; + Windows_NT) + X-Ms-Date: + - Mon, 05 Apr 2021 00:00:55 GMT + X-Ms-Version: + - "2019-02-02" + url: https://chrisstablesprim.table.core.windows.net/Tables + method: POST + response: + body: '{"odata.metadata":"https://chrisstablesprim.table.core.windows.net/$metadata#Tables/@Element","TableName":"gotableldjhskq166plj"}' + headers: + Cache-Control: + - no-cache + Content-Type: + - application/json;odata=minimalmetadata;streaming=true;charset=utf-8 + Date: + - Mon, 05 Apr 2021 00:00:55 GMT + Location: + - https://chrisstablesprim.table.core.windows.net/Tables('gotableldjhskq166plj') + Server: + - Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0 + X-Content-Type-Options: + - nosniff + X-Ms-Request-Id: + - 204673eb-b002-003b-64ae-2971b0000000 + X-Ms-Version: + - "2019-02-02" + status: 201 Created + code: 201 + duration: "" +- request: + body: '{"BoolProp":true,"IntProp":1,"PartitionKey":"partition","RowKey":"1","StringProp":"some + string 1"}' + form: {} + headers: + Accept: + - application/json;odata=minimalmetadata + Authorization: + - sanitized + Content-Length: + - "98" + Content-Type: + - application/json + Dataserviceversion: + - "3.0" + Prefer: + - return-no-content + User-Agent: + - azsdk-go-tables/ azsdk-go-tables/ azcore/v0.13.4 (go1.16.2; + Windows_NT) + X-Ms-Date: + - Mon, 05 Apr 2021 00:00:55 GMT + X-Ms-Version: + - "2019-02-02" + url: https://chrisstablesprim.table.core.windows.net/gotableldjhskq166plj + method: POST + response: + body: "" + headers: + Cache-Control: + - no-cache + Content-Length: + - "0" + Dataserviceid: + - https://chrisstablesprim.table.core.windows.net/gotableldjhskq166plj(PartitionKey='partition',RowKey='1') + Date: + - Mon, 05 Apr 2021 00:00:55 GMT + Etag: + - W/"datetime'2021-04-05T00%3A00%3A55.7477359Z'" + Location: + - https://chrisstablesprim.table.core.windows.net/gotableldjhskq166plj(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: + - 204673f0-b002-003b-67ae-2971b0000000 + 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-tables/ azsdk-go-tables/ azcore/v0.13.4 (go1.16.2; + Windows_NT) + X-Ms-Date: + - Mon, 05 Apr 2021 00:00:55 GMT + X-Ms-Version: + - "2019-02-02" + url: https://chrisstablesprim.table.core.windows.net/Tables('gotableldjhskq166plj') + method: DELETE + response: + body: "" + headers: + Cache-Control: + - no-cache + Content-Length: + - "0" + Date: + - Mon, 05 Apr 2021 00:00:55 GMT + Server: + - Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0 + X-Content-Type-Options: + - nosniff + X-Ms-Request-Id: + - 204673f1-b002-003b-68ae-2971b0000000 + X-Ms-Version: + - "2019-02-02" + status: 204 No Content + code: 204 + duration: "" diff --git a/sdk/tables/aztables/recordings/TestTableClient_Storage/TestBatchAdd-variables.yaml b/sdk/tables/aztables/recordings/TestTableClient_Storage/TestBatchAdd-variables.yaml new file mode 100644 index 000000000000..6f3cfa81b06e --- /dev/null +++ b/sdk/tables/aztables/recordings/TestTableClient_Storage/TestBatchAdd-variables.yaml @@ -0,0 +1,6 @@ +--- +STORAGE_ENDPOINT_SUFFIX: core.windows.net +TABLES_PRIMARY_STORAGE_ACCOUNT_KEY: Kg== +TABLES_STORAGE_ACCOUNT_NAME: chrisstablesprim +now: "2021-05-18T10:39:58.4641986-05:00" +randomSeed: "1621352397" diff --git a/sdk/tables/aztables/recordings/TestTableClient_Storage/TestBatchAdd.yaml b/sdk/tables/aztables/recordings/TestTableClient_Storage/TestBatchAdd.yaml new file mode 100644 index 000000000000..ba8083378d10 --- /dev/null +++ b/sdk/tables/aztables/recordings/TestTableClient_Storage/TestBatchAdd.yaml @@ -0,0 +1,229 @@ +--- +version: 1 +interactions: +- request: + body: '{"TableName":"gotablenmikoizges9as"}' + form: {} + headers: + Accept: + - application/json;odata=minimalmetadata + Authorization: + - sanitized + Content-Length: + - "36" + Content-Type: + - application/json + Dataserviceversion: + - "3.0" + User-Agent: + - azsdk-go-tables/ azsdk-go-tables/ azcore/v0.13.4 (go1.16.2; + Windows_NT) + X-Ms-Date: + - Tue, 18 May 2021 15:39:57 GMT + X-Ms-Version: + - "2019-02-02" + url: https://chrisstablesprim.table.core.windows.net/Tables + method: POST + response: + body: '{"odata.metadata":"https://chrisstablesprim.table.core.windows.net/$metadata#Tables/@Element","TableName":"gotablenmikoizges9as"}' + headers: + Cache-Control: + - no-cache + Content-Type: + - application/json;odata=minimalmetadata;streaming=true;charset=utf-8 + Date: + - Tue, 18 May 2021 15:39:58 GMT + Location: + - https://chrisstablesprim.table.core.windows.net/Tables('gotablenmikoizges9as') + Server: + - Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0 + X-Content-Type-Options: + - nosniff + X-Ms-Request-Id: + - 5375fa6b-7002-0024-30fc-4bc2b4000000 + X-Ms-Version: + - "2019-02-02" + status: 201 Created + code: 201 + duration: "" +- request: + body: "--batch_648025d9-6ce8-4fa4-5da7-940a633d3404\r\nContent-Type: multipart/mixed; + boundary=changeset_0f2514c8-6c9b-4052-78de-f6e2e355e3f3\r\n\r\n--changeset_0f2514c8-6c9b-4052-78de-f6e2e355e3f3\r\nContent-Transfer-Encoding: + binary\r\nContent-Type: application/http\r\n\r\nPOST https://chrisstablesprim.table.core.windows.net/gotablenmikoizges9as?%24format=application%2Fjson%3Bodata%3Dminimalmetadata + HTTP/1.1\r\nAccept: application/json;odata=minimalmetadata\r\nContent-Length: + 663\r\nContent-Type: application/json\r\nDataserviceversion: 3.0\r\nPrefer: + return-no-content\r\nX-Ms-Version: 2019-02-02\r\n\r\n{\"BoolProp\":true,\"IntProp\":1,\"PartitionKey\":\"partition\",\"RowKey\":\"1\",\"SomeBinaryProperty\":\"c29tZSBieXRlcw==\",\"SomeBinaryProperty@odata.type\":\"Edm.Binary\",\"SomeDateProperty\":\"2021-05-18T15:39:58.4641986Z\",\"SomeDateProperty@odata.type\":\"Edm.DateTime\",\"SomeDoubleProperty0\":1,\"SomeDoubleProperty0@odata.type\":\"Edm.Double\",\"SomeDoubleProperty1\":1.2345,\"SomeDoubleProperty1@odata.type\":\"Edm.Double\",\"SomeGuidProperty\":\"d2a8e9ac-0663-4275-5820-8cf92d76404b\",\"SomeGuidProperty@odata.type\":\"Edm.Guid\",\"SomeInt64Property\":\"9223372036854775807\",\"SomeInt64Property@odata.type\":\"Edm.Int64\",\"SomeIntProperty\":42,\"SomeStringProperty\":\"some + string\",\"StringProp\":\"some string 1\"}\r\n--changeset_0f2514c8-6c9b-4052-78de-f6e2e355e3f3\r\nContent-Transfer-Encoding: + binary\r\nContent-Type: application/http\r\n\r\nPOST https://chrisstablesprim.table.core.windows.net/gotablenmikoizges9as?%24format=application%2Fjson%3Bodata%3Dminimalmetadata + HTTP/1.1\r\nAccept: application/json;odata=minimalmetadata\r\nContent-Length: + 663\r\nContent-Type: application/json\r\nDataserviceversion: 3.0\r\nPrefer: + return-no-content\r\nX-Ms-Version: 2019-02-02\r\n\r\n{\"BoolProp\":true,\"IntProp\":2,\"PartitionKey\":\"partition\",\"RowKey\":\"2\",\"SomeBinaryProperty\":\"c29tZSBieXRlcw==\",\"SomeBinaryProperty@odata.type\":\"Edm.Binary\",\"SomeDateProperty\":\"2021-05-18T15:39:58.4641986Z\",\"SomeDateProperty@odata.type\":\"Edm.DateTime\",\"SomeDoubleProperty0\":1,\"SomeDoubleProperty0@odata.type\":\"Edm.Double\",\"SomeDoubleProperty1\":1.2345,\"SomeDoubleProperty1@odata.type\":\"Edm.Double\",\"SomeGuidProperty\":\"bd350865-51bd-4c75-5d83-9b7096e127d1\",\"SomeGuidProperty@odata.type\":\"Edm.Guid\",\"SomeInt64Property\":\"9223372036854775807\",\"SomeInt64Property@odata.type\":\"Edm.Int64\",\"SomeIntProperty\":42,\"SomeStringProperty\":\"some + string\",\"StringProp\":\"some string 2\"}\r\n--changeset_0f2514c8-6c9b-4052-78de-f6e2e355e3f3\r\nContent-Transfer-Encoding: + binary\r\nContent-Type: application/http\r\n\r\nPOST https://chrisstablesprim.table.core.windows.net/gotablenmikoizges9as?%24format=application%2Fjson%3Bodata%3Dminimalmetadata + HTTP/1.1\r\nAccept: application/json;odata=minimalmetadata\r\nContent-Length: + 663\r\nContent-Type: application/json\r\nDataserviceversion: 3.0\r\nPrefer: + return-no-content\r\nX-Ms-Version: 2019-02-02\r\n\r\n{\"BoolProp\":true,\"IntProp\":3,\"PartitionKey\":\"partition\",\"RowKey\":\"3\",\"SomeBinaryProperty\":\"c29tZSBieXRlcw==\",\"SomeBinaryProperty@odata.type\":\"Edm.Binary\",\"SomeDateProperty\":\"2021-05-18T15:39:58.4641986Z\",\"SomeDateProperty@odata.type\":\"Edm.DateTime\",\"SomeDoubleProperty0\":1,\"SomeDoubleProperty0@odata.type\":\"Edm.Double\",\"SomeDoubleProperty1\":1.2345,\"SomeDoubleProperty1@odata.type\":\"Edm.Double\",\"SomeGuidProperty\":\"07f327de-fc7c-4354-5ed6-4a0722415e8e\",\"SomeGuidProperty@odata.type\":\"Edm.Guid\",\"SomeInt64Property\":\"9223372036854775807\",\"SomeInt64Property@odata.type\":\"Edm.Int64\",\"SomeIntProperty\":42,\"SomeStringProperty\":\"some + string\",\"StringProp\":\"some string 3\"}\r\n--changeset_0f2514c8-6c9b-4052-78de-f6e2e355e3f3\r\nContent-Transfer-Encoding: + binary\r\nContent-Type: application/http\r\n\r\nPOST https://chrisstablesprim.table.core.windows.net/gotablenmikoizges9as?%24format=application%2Fjson%3Bodata%3Dminimalmetadata + HTTP/1.1\r\nAccept: application/json;odata=minimalmetadata\r\nContent-Length: + 663\r\nContent-Type: application/json\r\nDataserviceversion: 3.0\r\nPrefer: + return-no-content\r\nX-Ms-Version: 2019-02-02\r\n\r\n{\"BoolProp\":true,\"IntProp\":4,\"PartitionKey\":\"partition\",\"RowKey\":\"4\",\"SomeBinaryProperty\":\"c29tZSBieXRlcw==\",\"SomeBinaryProperty@odata.type\":\"Edm.Binary\",\"SomeDateProperty\":\"2021-05-18T15:39:58.4641986Z\",\"SomeDateProperty@odata.type\":\"Edm.DateTime\",\"SomeDoubleProperty0\":1,\"SomeDoubleProperty0@odata.type\":\"Edm.Double\",\"SomeDoubleProperty1\":1.2345,\"SomeDoubleProperty1@odata.type\":\"Edm.Double\",\"SomeGuidProperty\":\"e59c88f8-9b85-4105-5557-82e7260ec226\",\"SomeGuidProperty@odata.type\":\"Edm.Guid\",\"SomeInt64Property\":\"9223372036854775807\",\"SomeInt64Property@odata.type\":\"Edm.Int64\",\"SomeIntProperty\":42,\"SomeStringProperty\":\"some + string\",\"StringProp\":\"some string 4\"}\r\n--changeset_0f2514c8-6c9b-4052-78de-f6e2e355e3f3\r\nContent-Transfer-Encoding: + binary\r\nContent-Type: application/http\r\n\r\nPOST https://chrisstablesprim.table.core.windows.net/gotablenmikoizges9as?%24format=application%2Fjson%3Bodata%3Dminimalmetadata + HTTP/1.1\r\nAccept: application/json;odata=minimalmetadata\r\nContent-Length: + 663\r\nContent-Type: application/json\r\nDataserviceversion: 3.0\r\nPrefer: + return-no-content\r\nX-Ms-Version: 2019-02-02\r\n\r\n{\"BoolProp\":true,\"IntProp\":5,\"PartitionKey\":\"partition\",\"RowKey\":\"5\",\"SomeBinaryProperty\":\"c29tZSBieXRlcw==\",\"SomeBinaryProperty@odata.type\":\"Edm.Binary\",\"SomeDateProperty\":\"2021-05-18T15:39:58.4641986Z\",\"SomeDateProperty@odata.type\":\"Edm.DateTime\",\"SomeDoubleProperty0\":1,\"SomeDoubleProperty0@odata.type\":\"Edm.Double\",\"SomeDoubleProperty1\":1.2345,\"SomeDoubleProperty1@odata.type\":\"Edm.Double\",\"SomeGuidProperty\":\"89770aa3-03ca-42b6-65f8-5a125274b222\",\"SomeGuidProperty@odata.type\":\"Edm.Guid\",\"SomeInt64Property\":\"9223372036854775807\",\"SomeInt64Property@odata.type\":\"Edm.Int64\",\"SomeIntProperty\":42,\"SomeStringProperty\":\"some + string\",\"StringProp\":\"some string 5\"}\r\n--changeset_0f2514c8-6c9b-4052-78de-f6e2e355e3f3\r\nContent-Transfer-Encoding: + binary\r\nContent-Type: application/http\r\n\r\nPOST https://chrisstablesprim.table.core.windows.net/gotablenmikoizges9as?%24format=application%2Fjson%3Bodata%3Dminimalmetadata + HTTP/1.1\r\nAccept: application/json;odata=minimalmetadata\r\nContent-Length: + 663\r\nContent-Type: application/json\r\nDataserviceversion: 3.0\r\nPrefer: + return-no-content\r\nX-Ms-Version: 2019-02-02\r\n\r\n{\"BoolProp\":true,\"IntProp\":6,\"PartitionKey\":\"partition\",\"RowKey\":\"6\",\"SomeBinaryProperty\":\"c29tZSBieXRlcw==\",\"SomeBinaryProperty@odata.type\":\"Edm.Binary\",\"SomeDateProperty\":\"2021-05-18T15:39:58.4641986Z\",\"SomeDateProperty@odata.type\":\"Edm.DateTime\",\"SomeDoubleProperty0\":1,\"SomeDoubleProperty0@odata.type\":\"Edm.Double\",\"SomeDoubleProperty1\":1.2345,\"SomeDoubleProperty1@odata.type\":\"Edm.Double\",\"SomeGuidProperty\":\"d19dcff6-9768-4ddf-71a6-55acc1a48e27\",\"SomeGuidProperty@odata.type\":\"Edm.Guid\",\"SomeInt64Property\":\"9223372036854775807\",\"SomeInt64Property@odata.type\":\"Edm.Int64\",\"SomeIntProperty\":42,\"SomeStringProperty\":\"some + string\",\"StringProp\":\"some string 6\"}\r\n--changeset_0f2514c8-6c9b-4052-78de-f6e2e355e3f3\r\nContent-Transfer-Encoding: + binary\r\nContent-Type: application/http\r\n\r\nPOST https://chrisstablesprim.table.core.windows.net/gotablenmikoizges9as?%24format=application%2Fjson%3Bodata%3Dminimalmetadata + HTTP/1.1\r\nAccept: application/json;odata=minimalmetadata\r\nContent-Length: + 663\r\nContent-Type: application/json\r\nDataserviceversion: 3.0\r\nPrefer: + return-no-content\r\nX-Ms-Version: 2019-02-02\r\n\r\n{\"BoolProp\":true,\"IntProp\":7,\"PartitionKey\":\"partition\",\"RowKey\":\"7\",\"SomeBinaryProperty\":\"c29tZSBieXRlcw==\",\"SomeBinaryProperty@odata.type\":\"Edm.Binary\",\"SomeDateProperty\":\"2021-05-18T15:39:58.4641986Z\",\"SomeDateProperty@odata.type\":\"Edm.DateTime\",\"SomeDoubleProperty0\":1,\"SomeDoubleProperty0@odata.type\":\"Edm.Double\",\"SomeDoubleProperty1\":1.2345,\"SomeDoubleProperty1@odata.type\":\"Edm.Double\",\"SomeGuidProperty\":\"df72b407-50b5-49dc-6c76-75d1d1a9d347\",\"SomeGuidProperty@odata.type\":\"Edm.Guid\",\"SomeInt64Property\":\"9223372036854775807\",\"SomeInt64Property@odata.type\":\"Edm.Int64\",\"SomeIntProperty\":42,\"SomeStringProperty\":\"some + string\",\"StringProp\":\"some string 7\"}\r\n--changeset_0f2514c8-6c9b-4052-78de-f6e2e355e3f3\r\nContent-Transfer-Encoding: + binary\r\nContent-Type: application/http\r\n\r\nPOST https://chrisstablesprim.table.core.windows.net/gotablenmikoizges9as?%24format=application%2Fjson%3Bodata%3Dminimalmetadata + HTTP/1.1\r\nAccept: application/json;odata=minimalmetadata\r\nContent-Length: + 663\r\nContent-Type: application/json\r\nDataserviceversion: 3.0\r\nPrefer: + return-no-content\r\nX-Ms-Version: 2019-02-02\r\n\r\n{\"BoolProp\":true,\"IntProp\":8,\"PartitionKey\":\"partition\",\"RowKey\":\"8\",\"SomeBinaryProperty\":\"c29tZSBieXRlcw==\",\"SomeBinaryProperty@odata.type\":\"Edm.Binary\",\"SomeDateProperty\":\"2021-05-18T15:39:58.4641986Z\",\"SomeDateProperty@odata.type\":\"Edm.DateTime\",\"SomeDoubleProperty0\":1,\"SomeDoubleProperty0@odata.type\":\"Edm.Double\",\"SomeDoubleProperty1\":1.2345,\"SomeDoubleProperty1@odata.type\":\"Edm.Double\",\"SomeGuidProperty\":\"5c09c881-918b-4a0d-5ad0-9f3e71a3d14b\",\"SomeGuidProperty@odata.type\":\"Edm.Guid\",\"SomeInt64Property\":\"9223372036854775807\",\"SomeInt64Property@odata.type\":\"Edm.Int64\",\"SomeIntProperty\":42,\"SomeStringProperty\":\"some + string\",\"StringProp\":\"some string 8\"}\r\n--changeset_0f2514c8-6c9b-4052-78de-f6e2e355e3f3\r\nContent-Transfer-Encoding: + binary\r\nContent-Type: application/http\r\n\r\nPOST https://chrisstablesprim.table.core.windows.net/gotablenmikoizges9as?%24format=application%2Fjson%3Bodata%3Dminimalmetadata + HTTP/1.1\r\nAccept: application/json;odata=minimalmetadata\r\nContent-Length: + 663\r\nContent-Type: application/json\r\nDataserviceversion: 3.0\r\nPrefer: + return-no-content\r\nX-Ms-Version: 2019-02-02\r\n\r\n{\"BoolProp\":true,\"IntProp\":9,\"PartitionKey\":\"partition\",\"RowKey\":\"9\",\"SomeBinaryProperty\":\"c29tZSBieXRlcw==\",\"SomeBinaryProperty@odata.type\":\"Edm.Binary\",\"SomeDateProperty\":\"2021-05-18T15:39:58.4641986Z\",\"SomeDateProperty@odata.type\":\"Edm.DateTime\",\"SomeDoubleProperty0\":1,\"SomeDoubleProperty0@odata.type\":\"Edm.Double\",\"SomeDoubleProperty1\":1.2345,\"SomeDoubleProperty1@odata.type\":\"Edm.Double\",\"SomeGuidProperty\":\"d685a381-7648-4e16-74a5-c2c58f30d7b0\",\"SomeGuidProperty@odata.type\":\"Edm.Guid\",\"SomeInt64Property\":\"9223372036854775807\",\"SomeInt64Property@odata.type\":\"Edm.Int64\",\"SomeIntProperty\":42,\"SomeStringProperty\":\"some + string\",\"StringProp\":\"some string 9\"}\r\n--changeset_0f2514c8-6c9b-4052-78de-f6e2e355e3f3\r\nContent-Transfer-Encoding: + binary\r\nContent-Type: application/http\r\n\r\nPOST https://chrisstablesprim.table.core.windows.net/gotablenmikoizges9as?%24format=application%2Fjson%3Bodata%3Dminimalmetadata + HTTP/1.1\r\nAccept: application/json;odata=minimalmetadata\r\nContent-Length: + 666\r\nContent-Type: application/json\r\nDataserviceversion: 3.0\r\nPrefer: + return-no-content\r\nX-Ms-Version: 2019-02-02\r\n\r\n{\"BoolProp\":true,\"IntProp\":10,\"PartitionKey\":\"partition\",\"RowKey\":\"10\",\"SomeBinaryProperty\":\"c29tZSBieXRlcw==\",\"SomeBinaryProperty@odata.type\":\"Edm.Binary\",\"SomeDateProperty\":\"2021-05-18T15:39:58.4641986Z\",\"SomeDateProperty@odata.type\":\"Edm.DateTime\",\"SomeDoubleProperty0\":1,\"SomeDoubleProperty0@odata.type\":\"Edm.Double\",\"SomeDoubleProperty1\":1.2345,\"SomeDoubleProperty1@odata.type\":\"Edm.Double\",\"SomeGuidProperty\":\"6fd6a8cb-a3c9-4a59-6648-0b7127b4d451\",\"SomeGuidProperty@odata.type\":\"Edm.Guid\",\"SomeInt64Property\":\"9223372036854775807\",\"SomeInt64Property@odata.type\":\"Edm.Int64\",\"SomeIntProperty\":42,\"SomeStringProperty\":\"some + string\",\"StringProp\":\"some string 10\"}\r\n--changeset_0f2514c8-6c9b-4052-78de-f6e2e355e3f3--\r\n\r\n--batch_648025d9-6ce8-4fa4-5da7-940a633d3404--\r\n" + form: {} + headers: + Accept: + - application/json;odata=minimalmetadata + Authorization: + - sanitized + Content-Length: + - "11281" + Content-Type: + - multipart/mixed; boundary=batch_648025d9-6ce8-4fa4-5da7-940a633d3404 + Dataserviceversion: + - "3.0" + User-Agent: + - azsdk-go-tables/ azcore/v0.13.4 (go1.16.2; Windows_NT) + X-Ms-Date: + - Tue, 18 May 2021 15:39:58 GMT + X-Ms-Version: + - "2019-02-02" + url: https://chrisstablesprim.table.core.windows.net/$batch + method: POST + response: + body: "--batchresponse_68cd5b83-b388-4748-a611-24bdcdcb20e5\r\nContent-Type: multipart/mixed; + boundary=changesetresponse_48be468e-4dd0-4b63-aaab-535394c983c2\r\n\r\n--changesetresponse_48be468e-4dd0-4b63-aaab-535394c983c2\r\nContent-Type: + application/http\r\nContent-Transfer-Encoding: binary\r\n\r\nHTTP/1.1 204 No + Content\r\nX-Content-Type-Options: nosniff\r\nCache-Control: no-cache\r\nPreference-Applied: + return-no-content\r\nDataServiceVersion: 3.0;\r\nLocation: https://chrisstablesprim.table.core.windows.net/gotablenmikoizges9as(PartitionKey='partition',RowKey='1')\r\nDataServiceId: + https://chrisstablesprim.table.core.windows.net/gotablenmikoizges9as(PartitionKey='partition',RowKey='1')\r\nETag: + W/\"datetime'2021-05-18T15%3A39%3A58.8905171Z'\"\r\n\r\n\r\n--changesetresponse_48be468e-4dd0-4b63-aaab-535394c983c2\r\nContent-Type: + application/http\r\nContent-Transfer-Encoding: binary\r\n\r\nHTTP/1.1 204 No + Content\r\nX-Content-Type-Options: nosniff\r\nCache-Control: no-cache\r\nPreference-Applied: + return-no-content\r\nDataServiceVersion: 3.0;\r\nLocation: https://chrisstablesprim.table.core.windows.net/gotablenmikoizges9as(PartitionKey='partition',RowKey='2')\r\nDataServiceId: + https://chrisstablesprim.table.core.windows.net/gotablenmikoizges9as(PartitionKey='partition',RowKey='2')\r\nETag: + W/\"datetime'2021-05-18T15%3A39%3A58.8905171Z'\"\r\n\r\n\r\n--changesetresponse_48be468e-4dd0-4b63-aaab-535394c983c2\r\nContent-Type: + application/http\r\nContent-Transfer-Encoding: binary\r\n\r\nHTTP/1.1 204 No + Content\r\nX-Content-Type-Options: nosniff\r\nCache-Control: no-cache\r\nPreference-Applied: + return-no-content\r\nDataServiceVersion: 3.0;\r\nLocation: https://chrisstablesprim.table.core.windows.net/gotablenmikoizges9as(PartitionKey='partition',RowKey='3')\r\nDataServiceId: + https://chrisstablesprim.table.core.windows.net/gotablenmikoizges9as(PartitionKey='partition',RowKey='3')\r\nETag: + W/\"datetime'2021-05-18T15%3A39%3A58.8905171Z'\"\r\n\r\n\r\n--changesetresponse_48be468e-4dd0-4b63-aaab-535394c983c2\r\nContent-Type: + application/http\r\nContent-Transfer-Encoding: binary\r\n\r\nHTTP/1.1 204 No + Content\r\nX-Content-Type-Options: nosniff\r\nCache-Control: no-cache\r\nPreference-Applied: + return-no-content\r\nDataServiceVersion: 3.0;\r\nLocation: https://chrisstablesprim.table.core.windows.net/gotablenmikoizges9as(PartitionKey='partition',RowKey='4')\r\nDataServiceId: + https://chrisstablesprim.table.core.windows.net/gotablenmikoizges9as(PartitionKey='partition',RowKey='4')\r\nETag: + W/\"datetime'2021-05-18T15%3A39%3A58.8905171Z'\"\r\n\r\n\r\n--changesetresponse_48be468e-4dd0-4b63-aaab-535394c983c2\r\nContent-Type: + application/http\r\nContent-Transfer-Encoding: binary\r\n\r\nHTTP/1.1 204 No + Content\r\nX-Content-Type-Options: nosniff\r\nCache-Control: no-cache\r\nPreference-Applied: + return-no-content\r\nDataServiceVersion: 3.0;\r\nLocation: https://chrisstablesprim.table.core.windows.net/gotablenmikoizges9as(PartitionKey='partition',RowKey='5')\r\nDataServiceId: + https://chrisstablesprim.table.core.windows.net/gotablenmikoizges9as(PartitionKey='partition',RowKey='5')\r\nETag: + W/\"datetime'2021-05-18T15%3A39%3A58.8905171Z'\"\r\n\r\n\r\n--changesetresponse_48be468e-4dd0-4b63-aaab-535394c983c2\r\nContent-Type: + application/http\r\nContent-Transfer-Encoding: binary\r\n\r\nHTTP/1.1 204 No + Content\r\nX-Content-Type-Options: nosniff\r\nCache-Control: no-cache\r\nPreference-Applied: + return-no-content\r\nDataServiceVersion: 3.0;\r\nLocation: https://chrisstablesprim.table.core.windows.net/gotablenmikoizges9as(PartitionKey='partition',RowKey='6')\r\nDataServiceId: + https://chrisstablesprim.table.core.windows.net/gotablenmikoizges9as(PartitionKey='partition',RowKey='6')\r\nETag: + W/\"datetime'2021-05-18T15%3A39%3A58.8905171Z'\"\r\n\r\n\r\n--changesetresponse_48be468e-4dd0-4b63-aaab-535394c983c2\r\nContent-Type: + application/http\r\nContent-Transfer-Encoding: binary\r\n\r\nHTTP/1.1 204 No + Content\r\nX-Content-Type-Options: nosniff\r\nCache-Control: no-cache\r\nPreference-Applied: + return-no-content\r\nDataServiceVersion: 3.0;\r\nLocation: https://chrisstablesprim.table.core.windows.net/gotablenmikoizges9as(PartitionKey='partition',RowKey='7')\r\nDataServiceId: + https://chrisstablesprim.table.core.windows.net/gotablenmikoizges9as(PartitionKey='partition',RowKey='7')\r\nETag: + W/\"datetime'2021-05-18T15%3A39%3A58.8905171Z'\"\r\n\r\n\r\n--changesetresponse_48be468e-4dd0-4b63-aaab-535394c983c2\r\nContent-Type: + application/http\r\nContent-Transfer-Encoding: binary\r\n\r\nHTTP/1.1 204 No + Content\r\nX-Content-Type-Options: nosniff\r\nCache-Control: no-cache\r\nPreference-Applied: + return-no-content\r\nDataServiceVersion: 3.0;\r\nLocation: https://chrisstablesprim.table.core.windows.net/gotablenmikoizges9as(PartitionKey='partition',RowKey='8')\r\nDataServiceId: + https://chrisstablesprim.table.core.windows.net/gotablenmikoizges9as(PartitionKey='partition',RowKey='8')\r\nETag: + W/\"datetime'2021-05-18T15%3A39%3A58.8905171Z'\"\r\n\r\n\r\n--changesetresponse_48be468e-4dd0-4b63-aaab-535394c983c2\r\nContent-Type: + application/http\r\nContent-Transfer-Encoding: binary\r\n\r\nHTTP/1.1 204 No + Content\r\nX-Content-Type-Options: nosniff\r\nCache-Control: no-cache\r\nPreference-Applied: + return-no-content\r\nDataServiceVersion: 3.0;\r\nLocation: https://chrisstablesprim.table.core.windows.net/gotablenmikoizges9as(PartitionKey='partition',RowKey='9')\r\nDataServiceId: + https://chrisstablesprim.table.core.windows.net/gotablenmikoizges9as(PartitionKey='partition',RowKey='9')\r\nETag: + W/\"datetime'2021-05-18T15%3A39%3A58.8905171Z'\"\r\n\r\n\r\n--changesetresponse_48be468e-4dd0-4b63-aaab-535394c983c2\r\nContent-Type: + application/http\r\nContent-Transfer-Encoding: binary\r\n\r\nHTTP/1.1 204 No + Content\r\nX-Content-Type-Options: nosniff\r\nCache-Control: no-cache\r\nPreference-Applied: + return-no-content\r\nDataServiceVersion: 3.0;\r\nLocation: https://chrisstablesprim.table.core.windows.net/gotablenmikoizges9as(PartitionKey='partition',RowKey='10')\r\nDataServiceId: + https://chrisstablesprim.table.core.windows.net/gotablenmikoizges9as(PartitionKey='partition',RowKey='10')\r\nETag: + W/\"datetime'2021-05-18T15%3A39%3A58.8905171Z'\"\r\n\r\n\r\n--changesetresponse_48be468e-4dd0-4b63-aaab-535394c983c2--\r\n--batchresponse_68cd5b83-b388-4748-a611-24bdcdcb20e5--\r\n" + headers: + Cache-Control: + - no-cache + Content-Type: + - multipart/mixed; boundary=batchresponse_68cd5b83-b388-4748-a611-24bdcdcb20e5 + Date: + - Tue, 18 May 2021 15:39:58 GMT + Server: + - Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0 + X-Content-Type-Options: + - nosniff + X-Ms-Request-Id: + - 5375fa87-7002-0024-46fc-4bc2b4000000 + X-Ms-Version: + - "2019-02-02" + status: 202 Accepted + code: 202 + duration: "" +- request: + body: "" + form: {} + headers: + Accept: + - application/json + Authorization: + - sanitized + User-Agent: + - azsdk-go-tables/ azsdk-go-tables/ azcore/v0.13.4 (go1.16.2; + Windows_NT) + X-Ms-Date: + - Tue, 18 May 2021 15:39:58 GMT + X-Ms-Version: + - "2019-02-02" + url: https://chrisstablesprim.table.core.windows.net/Tables('gotablenmikoizges9as') + method: DELETE + response: + body: "" + headers: + Cache-Control: + - no-cache + Content-Length: + - "0" + Date: + - Tue, 18 May 2021 15:39:58 GMT + Server: + - Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0 + X-Content-Type-Options: + - nosniff + X-Ms-Request-Id: + - 5375fab1-7002-0024-70fc-4bc2b4000000 + X-Ms-Version: + - "2019-02-02" + status: 204 No Content + code: 204 + duration: "" diff --git a/sdk/tables/aztables/recordings/TestTableClient_Storage/TestBatchError-variables.yaml b/sdk/tables/aztables/recordings/TestTableClient_Storage/TestBatchError-variables.yaml new file mode 100644 index 000000000000..5b36d6860273 --- /dev/null +++ b/sdk/tables/aztables/recordings/TestTableClient_Storage/TestBatchError-variables.yaml @@ -0,0 +1,6 @@ +--- +STORAGE_ENDPOINT_SUFFIX: core.windows.net +TABLES_PRIMARY_STORAGE_ACCOUNT_KEY: Kg== +TABLES_STORAGE_ACCOUNT_NAME: chrisstablesprim +now: "2021-05-21T13:23:32.659245-05:00" +randomSeed: "1621621411" diff --git a/sdk/tables/aztables/recordings/TestTableClient_Storage/TestBatchError.yaml b/sdk/tables/aztables/recordings/TestTableClient_Storage/TestBatchError.yaml new file mode 100644 index 000000000000..c6524481065f --- /dev/null +++ b/sdk/tables/aztables/recordings/TestTableClient_Storage/TestBatchError.yaml @@ -0,0 +1,202 @@ +--- +version: 1 +interactions: +- request: + body: '{"TableName":"gotablepqb1rkgf82uab"}' + form: {} + headers: + Accept: + - application/json;odata=minimalmetadata + Authorization: + - sanitized + Content-Length: + - "36" + Content-Type: + - application/json + Dataserviceversion: + - "3.0" + User-Agent: + - azsdk-go-tables/ azsdk-go-tables/ azcore/v0.16.1 (go1.16.2; + Windows_NT) + X-Ms-Date: + - Fri, 21 May 2021 18:23:31 GMT + X-Ms-Version: + - "2019-02-02" + url: https://chrisstablesprim.table.core.windows.net/Tables + method: POST + response: + body: '{"odata.metadata":"https://chrisstablesprim.table.core.windows.net/$metadata#Tables/@Element","TableName":"gotablepqb1rkgf82uab"}' + headers: + Cache-Control: + - no-cache + Content-Type: + - application/json;odata=minimalmetadata;streaming=true;charset=utf-8 + Date: + - Fri, 21 May 2021 18:23:32 GMT + Location: + - https://chrisstablesprim.table.core.windows.net/Tables('gotablepqb1rkgf82uab') + Server: + - Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0 + X-Content-Type-Options: + - nosniff + X-Ms-Request-Id: + - fef5bddc-1002-000d-2f6e-4efcc0000000 + X-Ms-Version: + - "2019-02-02" + status: 201 Created + code: 201 + duration: "" +- request: + body: '{"BoolProp":true,"IntProp":3,"PartitionKey":"partition","RowKey":"3","SomeBinaryProperty":"c29tZSBieXRlcw==","SomeBinaryProperty@odata.type":"Edm.Binary","SomeDateProperty":"2021-05-21T18:23:32.659245Z","SomeDateProperty@odata.type":"Edm.DateTime","SomeDoubleProperty0":1,"SomeDoubleProperty0@odata.type":"Edm.Double","SomeDoubleProperty1":1.2345,"SomeDoubleProperty1@odata.type":"Edm.Double","SomeGuidProperty":"4c51dc80-5e1c-4a79-4b58-8b5d1a887417","SomeGuidProperty@odata.type":"Edm.Guid","SomeInt64Property":"9223372036854775807","SomeInt64Property@odata.type":"Edm.Int64","SomeIntProperty":42,"SomeStringProperty":"some + string","StringProp":"some string 3"}' + form: {} + headers: + Accept: + - application/json;odata=minimalmetadata + Authorization: + - sanitized + Content-Length: + - "662" + Content-Type: + - application/json + Dataserviceversion: + - "3.0" + Prefer: + - return-no-content + User-Agent: + - azsdk-go-tables/ azsdk-go-tables/ azcore/v0.16.1 (go1.16.2; + Windows_NT) + X-Ms-Date: + - Fri, 21 May 2021 18:23:32 GMT + X-Ms-Version: + - "2019-02-02" + url: https://chrisstablesprim.table.core.windows.net/gotablepqb1rkgf82uab + method: POST + response: + body: "" + headers: + Cache-Control: + - no-cache + Content-Length: + - "0" + Dataserviceid: + - https://chrisstablesprim.table.core.windows.net/gotablepqb1rkgf82uab(PartitionKey='partition',RowKey='3') + Date: + - Fri, 21 May 2021 18:23:32 GMT + Etag: + - W/"datetime'2021-05-21T18%3A23%3A32.8055163Z'" + Location: + - https://chrisstablesprim.table.core.windows.net/gotablepqb1rkgf82uab(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: + - fef5bdf4-1002-000d-446e-4efcc0000000 + X-Ms-Version: + - "2019-02-02" + status: 204 No Content + code: 204 + duration: "" +- request: + body: "--batch_082f04d4-15cc-43be-66be-49e083de268c\r\nContent-Type: multipart/mixed; + boundary=changeset_239ec220-4c24-4f16-5cbf-8fbd53fd6135\r\n\r\n--changeset_239ec220-4c24-4f16-5cbf-8fbd53fd6135\r\nContent-Transfer-Encoding: + binary\r\nContent-Type: application/http\r\n\r\nPOST https://chrisstablesprim.table.core.windows.net/gotablepqb1rkgf82uab?%24format=application%2Fjson%3Bodata%3Dminimalmetadata + HTTP/1.1\r\nAccept: application/json;odata=minimalmetadata\r\nContent-Length: + 662\r\nContent-Type: application/json\r\nDataserviceversion: 3.0\r\nPrefer: + return-no-content\r\nX-Ms-Version: 2019-02-02\r\n\r\n{\"BoolProp\":true,\"IntProp\":1,\"PartitionKey\":\"partition\",\"RowKey\":\"1\",\"SomeBinaryProperty\":\"c29tZSBieXRlcw==\",\"SomeBinaryProperty@odata.type\":\"Edm.Binary\",\"SomeDateProperty\":\"2021-05-21T18:23:32.659245Z\",\"SomeDateProperty@odata.type\":\"Edm.DateTime\",\"SomeDoubleProperty0\":1,\"SomeDoubleProperty0@odata.type\":\"Edm.Double\",\"SomeDoubleProperty1\":1.2345,\"SomeDoubleProperty1@odata.type\":\"Edm.Double\",\"SomeGuidProperty\":\"24322eae-ac26-4914-7a51-4291c19121c7\",\"SomeGuidProperty@odata.type\":\"Edm.Guid\",\"SomeInt64Property\":\"9223372036854775807\",\"SomeInt64Property@odata.type\":\"Edm.Int64\",\"SomeIntProperty\":42,\"SomeStringProperty\":\"some + string\",\"StringProp\":\"some string 1\"}\r\n--changeset_239ec220-4c24-4f16-5cbf-8fbd53fd6135\r\nContent-Transfer-Encoding: + binary\r\nContent-Type: application/http\r\n\r\nPOST https://chrisstablesprim.table.core.windows.net/gotablepqb1rkgf82uab?%24format=application%2Fjson%3Bodata%3Dminimalmetadata + HTTP/1.1\r\nAccept: application/json;odata=minimalmetadata\r\nContent-Length: + 662\r\nContent-Type: application/json\r\nDataserviceversion: 3.0\r\nPrefer: + return-no-content\r\nX-Ms-Version: 2019-02-02\r\n\r\n{\"BoolProp\":true,\"IntProp\":2,\"PartitionKey\":\"partition\",\"RowKey\":\"2\",\"SomeBinaryProperty\":\"c29tZSBieXRlcw==\",\"SomeBinaryProperty@odata.type\":\"Edm.Binary\",\"SomeDateProperty\":\"2021-05-21T18:23:32.659245Z\",\"SomeDateProperty@odata.type\":\"Edm.DateTime\",\"SomeDoubleProperty0\":1,\"SomeDoubleProperty0@odata.type\":\"Edm.Double\",\"SomeDoubleProperty1\":1.2345,\"SomeDoubleProperty1@odata.type\":\"Edm.Double\",\"SomeGuidProperty\":\"ea15bdd7-a18a-45f7-52b5-f2dafe05af3c\",\"SomeGuidProperty@odata.type\":\"Edm.Guid\",\"SomeInt64Property\":\"9223372036854775807\",\"SomeInt64Property@odata.type\":\"Edm.Int64\",\"SomeIntProperty\":42,\"SomeStringProperty\":\"some + string\",\"StringProp\":\"some string 2\"}\r\n--changeset_239ec220-4c24-4f16-5cbf-8fbd53fd6135\r\nContent-Transfer-Encoding: + binary\r\nContent-Type: application/http\r\n\r\nPOST https://chrisstablesprim.table.core.windows.net/gotablepqb1rkgf82uab?%24format=application%2Fjson%3Bodata%3Dminimalmetadata + HTTP/1.1\r\nAccept: application/json;odata=minimalmetadata\r\nContent-Length: + 662\r\nContent-Type: application/json\r\nDataserviceversion: 3.0\r\nPrefer: + return-no-content\r\nX-Ms-Version: 2019-02-02\r\n\r\n{\"BoolProp\":true,\"IntProp\":3,\"PartitionKey\":\"partition\",\"RowKey\":\"3\",\"SomeBinaryProperty\":\"c29tZSBieXRlcw==\",\"SomeBinaryProperty@odata.type\":\"Edm.Binary\",\"SomeDateProperty\":\"2021-05-21T18:23:32.659245Z\",\"SomeDateProperty@odata.type\":\"Edm.DateTime\",\"SomeDoubleProperty0\":1,\"SomeDoubleProperty0@odata.type\":\"Edm.Double\",\"SomeDoubleProperty1\":1.2345,\"SomeDoubleProperty1@odata.type\":\"Edm.Double\",\"SomeGuidProperty\":\"4c51dc80-5e1c-4a79-4b58-8b5d1a887417\",\"SomeGuidProperty@odata.type\":\"Edm.Guid\",\"SomeInt64Property\":\"9223372036854775807\",\"SomeInt64Property@odata.type\":\"Edm.Int64\",\"SomeIntProperty\":42,\"SomeStringProperty\":\"some + string\",\"StringProp\":\"some string 3\"}\r\n--changeset_239ec220-4c24-4f16-5cbf-8fbd53fd6135--\r\n\r\n--batch_082f04d4-15cc-43be-66be-49e083de268c--\r\n" + form: {} + headers: + Accept: + - application/json;odata=minimalmetadata + Authorization: + - sanitized + Content-Length: + - "3547" + Content-Type: + - multipart/mixed; boundary=batch_082f04d4-15cc-43be-66be-49e083de268c + Dataserviceversion: + - "3.0" + User-Agent: + - azsdk-go-tables/ azcore/v0.16.1 (go1.16.2; Windows_NT) + X-Ms-Date: + - Fri, 21 May 2021 18:23:32 GMT + X-Ms-Version: + - "2019-02-02" + url: https://chrisstablesprim.table.core.windows.net/$batch + method: POST + response: + body: "--batchresponse_38af3102-a3c4-4d6b-9ad4-0d936fb607d7\r\nContent-Type: multipart/mixed; + boundary=changesetresponse_a33fe87c-1503-4bd5-971b-a32caf04061f\r\n\r\n--changesetresponse_a33fe87c-1503-4bd5-971b-a32caf04061f\r\nContent-Type: + application/http\r\nContent-Transfer-Encoding: binary\r\n\r\nHTTP/1.1 409 Conflict\r\nX-Content-Type-Options: + nosniff\r\nCache-Control: no-cache\r\nPreference-Applied: return-no-content\r\nDataServiceVersion: + 3.0;\r\nContent-Type: application/json;odata=minimalmetadata;streaming=true;charset=utf-8\r\n\r\n{\"odata.error\":{\"code\":\"EntityAlreadyExists\",\"message\":{\"lang\":\"en-US\",\"value\":\"2:The + specified entity already exists.\\nRequestId:fef5be0e-1002-000d-5d6e-4efcc0000000\\nTime:2021-05-21T18:23:32.8905761Z\"}}}\r\n--changesetresponse_a33fe87c-1503-4bd5-971b-a32caf04061f--\r\n--batchresponse_38af3102-a3c4-4d6b-9ad4-0d936fb607d7--\r\n" + headers: + Cache-Control: + - no-cache + Content-Type: + - multipart/mixed; boundary=batchresponse_38af3102-a3c4-4d6b-9ad4-0d936fb607d7 + Date: + - Fri, 21 May 2021 18:23:32 GMT + Server: + - Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0 + X-Content-Type-Options: + - nosniff + X-Ms-Request-Id: + - fef5be0e-1002-000d-5d6e-4efcc0000000 + X-Ms-Version: + - "2019-02-02" + status: 202 Accepted + code: 202 + duration: "" +- request: + body: "" + form: {} + headers: + Accept: + - application/json + Authorization: + - sanitized + User-Agent: + - azsdk-go-tables/ azsdk-go-tables/ azcore/v0.16.1 (go1.16.2; + Windows_NT) + X-Ms-Date: + - Fri, 21 May 2021 18:23:32 GMT + X-Ms-Version: + - "2019-02-02" + url: https://chrisstablesprim.table.core.windows.net/Tables('gotablepqb1rkgf82uab') + method: DELETE + response: + body: "" + headers: + Cache-Control: + - no-cache + Content-Length: + - "0" + Date: + - Fri, 21 May 2021 18:23:32 GMT + Server: + - Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0 + X-Content-Type-Options: + - nosniff + X-Ms-Request-Id: + - fef5be1c-1002-000d-6b6e-4efcc0000000 + X-Ms-Version: + - "2019-02-02" + status: 204 No Content + code: 204 + duration: "" diff --git a/sdk/tables/aztables/recordings/TestTableClient_Storage/TestBatchMixed-variables.yaml b/sdk/tables/aztables/recordings/TestTableClient_Storage/TestBatchMixed-variables.yaml new file mode 100644 index 000000000000..72609d6fa263 --- /dev/null +++ b/sdk/tables/aztables/recordings/TestTableClient_Storage/TestBatchMixed-variables.yaml @@ -0,0 +1,6 @@ +--- +STORAGE_ENDPOINT_SUFFIX: core.windows.net +TABLES_PRIMARY_STORAGE_ACCOUNT_KEY: Kg== +TABLES_STORAGE_ACCOUNT_NAME: chrisstablesprim +now: "2021-05-21T14:41:03.2032731-05:00" +randomSeed: "1621626062" diff --git a/sdk/tables/aztables/recordings/TestTableClient_Storage/TestBatchMixed.yaml b/sdk/tables/aztables/recordings/TestTableClient_Storage/TestBatchMixed.yaml new file mode 100644 index 000000000000..171a61c4c7be --- /dev/null +++ b/sdk/tables/aztables/recordings/TestTableClient_Storage/TestBatchMixed.yaml @@ -0,0 +1,323 @@ +--- +version: 1 +interactions: +- request: + body: '{"TableName":"gotableg8scudpw7lv7b"}' + form: {} + headers: + Accept: + - application/json;odata=minimalmetadata + Authorization: + - sanitized + Content-Length: + - "36" + Content-Type: + - application/json + Dataserviceversion: + - "3.0" + User-Agent: + - azsdk-go-tables/ azsdk-go-tables/ azcore/v0.16.1 (go1.16.2; + Windows_NT) + X-Ms-Date: + - Fri, 21 May 2021 19:41:02 GMT + X-Ms-Version: + - "2019-02-02" + url: https://chrisstablesprim.table.core.windows.net/Tables + method: POST + response: + body: '{"odata.metadata":"https://chrisstablesprim.table.core.windows.net/$metadata#Tables/@Element","TableName":"gotableg8scudpw7lv7b"}' + headers: + Cache-Control: + - no-cache + Content-Type: + - application/json;odata=minimalmetadata;streaming=true;charset=utf-8 + Date: + - Fri, 21 May 2021 19:41:03 GMT + Location: + - https://chrisstablesprim.table.core.windows.net/Tables('gotableg8scudpw7lv7b') + Server: + - Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0 + X-Content-Type-Options: + - nosniff + X-Ms-Request-Id: + - 8e3dc898-5002-001c-4c79-4e6674000000 + X-Ms-Version: + - "2019-02-02" + status: 201 Created + code: 201 + duration: "" +- request: + body: "--batch_2de7b066-5519-4c0f-4a33-ddc8370312e9\r\nContent-Type: multipart/mixed; + boundary=changeset_2e8293fd-fcc9-4729-761c-8513e70db34b\r\n\r\n--changeset_2e8293fd-fcc9-4729-761c-8513e70db34b\r\nContent-Transfer-Encoding: + binary\r\nContent-Type: application/http\r\n\r\nPOST https://chrisstablesprim.table.core.windows.net/gotableg8scudpw7lv7b?%24format=application%2Fjson%3Bodata%3Dminimalmetadata + HTTP/1.1\r\nAccept: application/json;odata=minimalmetadata\r\nContent-Length: + 663\r\nContent-Type: application/json\r\nDataserviceversion: 3.0\r\nPrefer: + return-no-content\r\nX-Ms-Version: 2019-02-02\r\n\r\n{\"BoolProp\":true,\"IntProp\":1,\"PartitionKey\":\"partition\",\"RowKey\":\"1\",\"SomeBinaryProperty\":\"c29tZSBieXRlcw==\",\"SomeBinaryProperty@odata.type\":\"Edm.Binary\",\"SomeDateProperty\":\"2021-05-21T19:41:03.2032731Z\",\"SomeDateProperty@odata.type\":\"Edm.DateTime\",\"SomeDoubleProperty0\":1,\"SomeDoubleProperty0@odata.type\":\"Edm.Double\",\"SomeDoubleProperty1\":1.2345,\"SomeDoubleProperty1@odata.type\":\"Edm.Double\",\"SomeGuidProperty\":\"27bdea07-48bb-49a1-7575-fa9c92b50ecc\",\"SomeGuidProperty@odata.type\":\"Edm.Guid\",\"SomeInt64Property\":\"9223372036854775807\",\"SomeInt64Property@odata.type\":\"Edm.Int64\",\"SomeIntProperty\":42,\"SomeStringProperty\":\"some + string\",\"StringProp\":\"some string 1\"}\r\n--changeset_2e8293fd-fcc9-4729-761c-8513e70db34b\r\nContent-Transfer-Encoding: + binary\r\nContent-Type: application/http\r\n\r\nPOST https://chrisstablesprim.table.core.windows.net/gotableg8scudpw7lv7b?%24format=application%2Fjson%3Bodata%3Dminimalmetadata + HTTP/1.1\r\nAccept: application/json;odata=minimalmetadata\r\nContent-Length: + 663\r\nContent-Type: application/json\r\nDataserviceversion: 3.0\r\nPrefer: + return-no-content\r\nX-Ms-Version: 2019-02-02\r\n\r\n{\"BoolProp\":true,\"IntProp\":2,\"PartitionKey\":\"partition\",\"RowKey\":\"2\",\"SomeBinaryProperty\":\"c29tZSBieXRlcw==\",\"SomeBinaryProperty@odata.type\":\"Edm.Binary\",\"SomeDateProperty\":\"2021-05-21T19:41:03.2032731Z\",\"SomeDateProperty@odata.type\":\"Edm.DateTime\",\"SomeDoubleProperty0\":1,\"SomeDoubleProperty0@odata.type\":\"Edm.Double\",\"SomeDoubleProperty1\":1.2345,\"SomeDoubleProperty1@odata.type\":\"Edm.Double\",\"SomeGuidProperty\":\"4a7ba0e9-458c-4f1c-5a5d-e7c330b95315\",\"SomeGuidProperty@odata.type\":\"Edm.Guid\",\"SomeInt64Property\":\"9223372036854775807\",\"SomeInt64Property@odata.type\":\"Edm.Int64\",\"SomeIntProperty\":42,\"SomeStringProperty\":\"some + string\",\"StringProp\":\"some string 2\"}\r\n--changeset_2e8293fd-fcc9-4729-761c-8513e70db34b\r\nContent-Transfer-Encoding: + binary\r\nContent-Type: application/http\r\n\r\nPOST https://chrisstablesprim.table.core.windows.net/gotableg8scudpw7lv7b?%24format=application%2Fjson%3Bodata%3Dminimalmetadata + HTTP/1.1\r\nAccept: application/json;odata=minimalmetadata\r\nContent-Length: + 663\r\nContent-Type: application/json\r\nDataserviceversion: 3.0\r\nPrefer: + return-no-content\r\nX-Ms-Version: 2019-02-02\r\n\r\n{\"BoolProp\":true,\"IntProp\":3,\"PartitionKey\":\"partition\",\"RowKey\":\"3\",\"SomeBinaryProperty\":\"c29tZSBieXRlcw==\",\"SomeBinaryProperty@odata.type\":\"Edm.Binary\",\"SomeDateProperty\":\"2021-05-21T19:41:03.2032731Z\",\"SomeDateProperty@odata.type\":\"Edm.DateTime\",\"SomeDoubleProperty0\":1,\"SomeDoubleProperty0@odata.type\":\"Edm.Double\",\"SomeDoubleProperty1\":1.2345,\"SomeDoubleProperty1@odata.type\":\"Edm.Double\",\"SomeGuidProperty\":\"167df718-ab10-4028-4462-d89bd2eab843\",\"SomeGuidProperty@odata.type\":\"Edm.Guid\",\"SomeInt64Property\":\"9223372036854775807\",\"SomeInt64Property@odata.type\":\"Edm.Int64\",\"SomeIntProperty\":42,\"SomeStringProperty\":\"some + string\",\"StringProp\":\"some string 3\"}\r\n--changeset_2e8293fd-fcc9-4729-761c-8513e70db34b--\r\n\r\n--batch_2de7b066-5519-4c0f-4a33-ddc8370312e9--\r\n" + form: {} + headers: + Accept: + - application/json;odata=minimalmetadata + Authorization: + - sanitized + Content-Length: + - "3550" + Content-Type: + - multipart/mixed; boundary=batch_2de7b066-5519-4c0f-4a33-ddc8370312e9 + Dataserviceversion: + - "3.0" + User-Agent: + - azsdk-go-tables/ azcore/v0.16.1 (go1.16.2; Windows_NT) + X-Ms-Date: + - Fri, 21 May 2021 19:41:03 GMT + X-Ms-Version: + - "2019-02-02" + url: https://chrisstablesprim.table.core.windows.net/$batch + method: POST + response: + body: "--batchresponse_69af1b31-119b-4d4d-9bf8-35b4f6c0713c\r\nContent-Type: multipart/mixed; + boundary=changesetresponse_54cb4ac8-f287-4dc7-856c-b3c2dc2be705\r\n\r\n--changesetresponse_54cb4ac8-f287-4dc7-856c-b3c2dc2be705\r\nContent-Type: + application/http\r\nContent-Transfer-Encoding: binary\r\n\r\nHTTP/1.1 204 No + Content\r\nX-Content-Type-Options: nosniff\r\nCache-Control: no-cache\r\nPreference-Applied: + return-no-content\r\nDataServiceVersion: 3.0;\r\nLocation: https://chrisstablesprim.table.core.windows.net/gotableg8scudpw7lv7b(PartitionKey='partition',RowKey='1')\r\nDataServiceId: + https://chrisstablesprim.table.core.windows.net/gotableg8scudpw7lv7b(PartitionKey='partition',RowKey='1')\r\nETag: + W/\"datetime'2021-05-21T19%3A41%3A03.3758609Z'\"\r\n\r\n\r\n--changesetresponse_54cb4ac8-f287-4dc7-856c-b3c2dc2be705\r\nContent-Type: + application/http\r\nContent-Transfer-Encoding: binary\r\n\r\nHTTP/1.1 204 No + Content\r\nX-Content-Type-Options: nosniff\r\nCache-Control: no-cache\r\nPreference-Applied: + return-no-content\r\nDataServiceVersion: 3.0;\r\nLocation: https://chrisstablesprim.table.core.windows.net/gotableg8scudpw7lv7b(PartitionKey='partition',RowKey='2')\r\nDataServiceId: + https://chrisstablesprim.table.core.windows.net/gotableg8scudpw7lv7b(PartitionKey='partition',RowKey='2')\r\nETag: + W/\"datetime'2021-05-21T19%3A41%3A03.3758609Z'\"\r\n\r\n\r\n--changesetresponse_54cb4ac8-f287-4dc7-856c-b3c2dc2be705\r\nContent-Type: + application/http\r\nContent-Transfer-Encoding: binary\r\n\r\nHTTP/1.1 204 No + Content\r\nX-Content-Type-Options: nosniff\r\nCache-Control: no-cache\r\nPreference-Applied: + return-no-content\r\nDataServiceVersion: 3.0;\r\nLocation: https://chrisstablesprim.table.core.windows.net/gotableg8scudpw7lv7b(PartitionKey='partition',RowKey='3')\r\nDataServiceId: + https://chrisstablesprim.table.core.windows.net/gotableg8scudpw7lv7b(PartitionKey='partition',RowKey='3')\r\nETag: + W/\"datetime'2021-05-21T19%3A41%3A03.3758609Z'\"\r\n\r\n\r\n--changesetresponse_54cb4ac8-f287-4dc7-856c-b3c2dc2be705--\r\n--batchresponse_69af1b31-119b-4d4d-9bf8-35b4f6c0713c--\r\n" + headers: + Cache-Control: + - no-cache + Content-Type: + - multipart/mixed; boundary=batchresponse_69af1b31-119b-4d4d-9bf8-35b4f6c0713c + Date: + - Fri, 21 May 2021 19:41:03 GMT + Server: + - Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0 + X-Content-Type-Options: + - nosniff + X-Ms-Request-Id: + - 8e3dc8a8-5002-001c-5879-4e6674000000 + X-Ms-Version: + - "2019-02-02" + status: 202 Accepted + code: 202 + duration: "" +- request: + body: "" + form: {} + headers: + Accept: + - application/json;odata=minimalmetadata + Authorization: + - sanitized + Dataserviceversion: + - "3.0" + User-Agent: + - azsdk-go-tables/ azsdk-go-tables/ azcore/v0.16.1 (go1.16.2; + Windows_NT) + X-Ms-Date: + - Fri, 21 May 2021 19:41:03 GMT + X-Ms-Version: + - "2019-02-02" + url: https://chrisstablesprim.table.core.windows.net/gotableg8scudpw7lv7b()?%24filter=RowKey+eq+%271%27 + method: GET + response: + body: '{"odata.metadata":"https://chrisstablesprim.table.core.windows.net/$metadata#gotableg8scudpw7lv7b","value":[{"odata.etag":"W/\"datetime''2021-05-21T19%3A41%3A03.3758609Z''\"","PartitionKey":"partition","RowKey":"1","Timestamp":"2021-05-21T19:41:03.3758609Z","BoolProp":true,"IntProp":1,"SomeBinaryProperty@odata.type":"Edm.Binary","SomeBinaryProperty":"c29tZSBieXRlcw==","SomeDateProperty@odata.type":"Edm.DateTime","SomeDateProperty":"2021-05-21T19:41:03.2032731Z","SomeDoubleProperty0":1.0,"SomeDoubleProperty1":1.2345,"SomeGuidProperty@odata.type":"Edm.Guid","SomeGuidProperty":"27bdea07-48bb-49a1-7575-fa9c92b50ecc","SomeInt64Property@odata.type":"Edm.Int64","SomeInt64Property":"9223372036854775807","SomeIntProperty":42,"SomeStringProperty":"some + string","StringProp":"some string 1"}]}' + headers: + Cache-Control: + - no-cache + Content-Type: + - application/json;odata=minimalmetadata;streaming=true;charset=utf-8 + Date: + - Fri, 21 May 2021 19:41:03 GMT + Server: + - Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0 + X-Content-Type-Options: + - nosniff + X-Ms-Request-Id: + - 8e3dc8ba-5002-001c-6879-4e6674000000 + X-Ms-Version: + - "2019-02-02" + status: 200 OK + code: 200 + duration: "" +- request: + body: "--batch_9f2e9a16-b748-4c4a-7498-385179c10249\r\nContent-Type: multipart/mixed; + boundary=changeset_06606488-add1-4c38-456b-b53b0a02871d\r\n\r\n--changeset_06606488-add1-4c38-456b-b53b0a02871d\r\nContent-Transfer-Encoding: + binary\r\nContent-Type: application/http\r\n\r\nPATCH https://chrisstablesprim.table.core.windows.net/gotableg8scudpw7lv7b(PartitionKey='partition',RowKey='1')?%24format=application%2Fjson%3Bodata%3Dminimalmetadata + HTTP/1.1\r\nAccept: application/json\r\nContent-Length: 63\r\nContent-Type: + application/json\r\nDataserviceversion: 3.0\r\nIf-Match: W/\"datetime'2021-05-21T19%3A41%3A03.3758609Z'\"\r\nX-Ms-Version: + 2019-02-02\r\n\r\n{\"MergeProperty\":\"foo\",\"PartitionKey\":\"partition\",\"RowKey\":\"1\"}\r\n--changeset_06606488-add1-4c38-456b-b53b0a02871d\r\nContent-Transfer-Encoding: + binary\r\nContent-Type: application/http\r\n\r\nDELETE https://chrisstablesprim.table.core.windows.net/gotableg8scudpw7lv7b(PartitionKey='partition',RowKey='2')?%24format=application%2Fjson%3Bodata%3Dminimalmetadata + HTTP/1.1\r\nAccept: application/json;odata=minimalmetadata\r\nDataserviceversion: + 3.0\r\nIf-Match: *\r\nX-Ms-Version: 2019-02-02\r\n\r\n\r\n--changeset_06606488-add1-4c38-456b-b53b0a02871d\r\nContent-Transfer-Encoding: + binary\r\nContent-Type: application/http\r\n\r\nPUT https://chrisstablesprim.table.core.windows.net/gotableg8scudpw7lv7b(PartitionKey='partition',RowKey='3')?%24format=application%2Fjson%3Bodata%3Dminimalmetadata + HTTP/1.1\r\nAccept: application/json\r\nContent-Length: 65\r\nContent-Type: + application/json\r\nDataserviceversion: 3.0\r\nIf-Match: *\r\nX-Ms-Version: + 2019-02-02\r\n\r\n{\"PartitionKey\":\"partition\",\"ReplaceProperty\":\"foo\",\"RowKey\":\"3\"}\r\n--changeset_06606488-add1-4c38-456b-b53b0a02871d\r\nContent-Transfer-Encoding: + binary\r\nContent-Type: application/http\r\n\r\nPOST https://chrisstablesprim.table.core.windows.net/gotableg8scudpw7lv7b?%24format=application%2Fjson%3Bodata%3Dminimalmetadata + HTTP/1.1\r\nAccept: application/json;odata=minimalmetadata\r\nContent-Length: + 663\r\nContent-Type: application/json\r\nDataserviceversion: 3.0\r\nPrefer: + return-no-content\r\nX-Ms-Version: 2019-02-02\r\n\r\n{\"BoolProp\":true,\"IntProp\":4,\"PartitionKey\":\"partition\",\"RowKey\":\"4\",\"SomeBinaryProperty\":\"c29tZSBieXRlcw==\",\"SomeBinaryProperty@odata.type\":\"Edm.Binary\",\"SomeDateProperty\":\"2021-05-21T19:41:03.2032731Z\",\"SomeDateProperty@odata.type\":\"Edm.DateTime\",\"SomeDoubleProperty0\":1,\"SomeDoubleProperty0@odata.type\":\"Edm.Double\",\"SomeDoubleProperty1\":1.2345,\"SomeDoubleProperty1@odata.type\":\"Edm.Double\",\"SomeGuidProperty\":\"58c5605e-f11c-4b8c-5280-4a1bbea87efe\",\"SomeGuidProperty@odata.type\":\"Edm.Guid\",\"SomeInt64Property\":\"9223372036854775807\",\"SomeInt64Property@odata.type\":\"Edm.Int64\",\"SomeIntProperty\":42,\"SomeStringProperty\":\"some + string\",\"StringProp\":\"some string 4\"}\r\n--changeset_06606488-add1-4c38-456b-b53b0a02871d\r\nContent-Transfer-Encoding: + binary\r\nContent-Type: application/http\r\n\r\nPOST https://chrisstablesprim.table.core.windows.net/gotableg8scudpw7lv7b?%24format=application%2Fjson%3Bodata%3Dminimalmetadata + HTTP/1.1\r\nAccept: application/json;odata=minimalmetadata\r\nContent-Length: + 663\r\nContent-Type: application/json\r\nDataserviceversion: 3.0\r\nPrefer: + return-no-content\r\nX-Ms-Version: 2019-02-02\r\n\r\n{\"BoolProp\":true,\"IntProp\":5,\"PartitionKey\":\"partition\",\"RowKey\":\"5\",\"SomeBinaryProperty\":\"c29tZSBieXRlcw==\",\"SomeBinaryProperty@odata.type\":\"Edm.Binary\",\"SomeDateProperty\":\"2021-05-21T19:41:03.2032731Z\",\"SomeDateProperty@odata.type\":\"Edm.DateTime\",\"SomeDoubleProperty0\":1,\"SomeDoubleProperty0@odata.type\":\"Edm.Double\",\"SomeDoubleProperty1\":1.2345,\"SomeDoubleProperty1@odata.type\":\"Edm.Double\",\"SomeGuidProperty\":\"1778baf7-61ae-4e82-7bf8-b5279e3ec598\",\"SomeGuidProperty@odata.type\":\"Edm.Guid\",\"SomeInt64Property\":\"9223372036854775807\",\"SomeInt64Property@odata.type\":\"Edm.Int64\",\"SomeIntProperty\":42,\"SomeStringProperty\":\"some + string\",\"StringProp\":\"some string 5\"}\r\n--changeset_06606488-add1-4c38-456b-b53b0a02871d--\r\n\r\n--batch_9f2e9a16-b748-4c4a-7498-385179c10249--\r\n" + form: {} + headers: + Accept: + - application/json;odata=minimalmetadata + Authorization: + - sanitized + Content-Length: + - "3914" + Content-Type: + - multipart/mixed; boundary=batch_9f2e9a16-b748-4c4a-7498-385179c10249 + Dataserviceversion: + - "3.0" + User-Agent: + - azsdk-go-tables/ azcore/v0.16.1 (go1.16.2; Windows_NT) + X-Ms-Date: + - Fri, 21 May 2021 19:41:03 GMT + X-Ms-Version: + - "2019-02-02" + url: https://chrisstablesprim.table.core.windows.net/$batch + method: POST + response: + body: "--batchresponse_159fb801-3c8d-46db-a03b-b292c7948339\r\nContent-Type: multipart/mixed; + boundary=changesetresponse_a0c7390f-4e2a-4953-bcdb-f3d6c4033244\r\n\r\n--changesetresponse_a0c7390f-4e2a-4953-bcdb-f3d6c4033244\r\nContent-Type: + application/http\r\nContent-Transfer-Encoding: binary\r\n\r\nHTTP/1.1 204 No + Content\r\nX-Content-Type-Options: nosniff\r\nCache-Control: no-cache\r\nDataServiceVersion: + 1.0;\r\nETag: W/\"datetime'2021-05-21T19%3A41%3A03.5240944Z'\"\r\n\r\n\r\n--changesetresponse_a0c7390f-4e2a-4953-bcdb-f3d6c4033244\r\nContent-Type: + application/http\r\nContent-Transfer-Encoding: binary\r\n\r\nHTTP/1.1 204 No + Content\r\nX-Content-Type-Options: nosniff\r\nCache-Control: no-cache\r\nDataServiceVersion: + 1.0;\r\n\r\n\r\n--changesetresponse_a0c7390f-4e2a-4953-bcdb-f3d6c4033244\r\nContent-Type: + application/http\r\nContent-Transfer-Encoding: binary\r\n\r\nHTTP/1.1 204 No + Content\r\nX-Content-Type-Options: nosniff\r\nCache-Control: no-cache\r\nDataServiceVersion: + 1.0;\r\nETag: W/\"datetime'2021-05-21T19%3A41%3A03.5240944Z'\"\r\n\r\n\r\n--changesetresponse_a0c7390f-4e2a-4953-bcdb-f3d6c4033244\r\nContent-Type: + application/http\r\nContent-Transfer-Encoding: binary\r\n\r\nHTTP/1.1 204 No + Content\r\nX-Content-Type-Options: nosniff\r\nCache-Control: no-cache\r\nPreference-Applied: + return-no-content\r\nDataServiceVersion: 3.0;\r\nLocation: https://chrisstablesprim.table.core.windows.net/gotableg8scudpw7lv7b(PartitionKey='partition',RowKey='4')\r\nDataServiceId: + https://chrisstablesprim.table.core.windows.net/gotableg8scudpw7lv7b(PartitionKey='partition',RowKey='4')\r\nETag: + W/\"datetime'2021-05-21T19%3A41%3A03.5239662Z'\"\r\n\r\n\r\n--changesetresponse_a0c7390f-4e2a-4953-bcdb-f3d6c4033244\r\nContent-Type: + application/http\r\nContent-Transfer-Encoding: binary\r\n\r\nHTTP/1.1 204 No + Content\r\nX-Content-Type-Options: nosniff\r\nCache-Control: no-cache\r\nPreference-Applied: + return-no-content\r\nDataServiceVersion: 3.0;\r\nLocation: https://chrisstablesprim.table.core.windows.net/gotableg8scudpw7lv7b(PartitionKey='partition',RowKey='5')\r\nDataServiceId: + https://chrisstablesprim.table.core.windows.net/gotableg8scudpw7lv7b(PartitionKey='partition',RowKey='5')\r\nETag: + W/\"datetime'2021-05-21T19%3A41%3A03.5239662Z'\"\r\n\r\n\r\n--changesetresponse_a0c7390f-4e2a-4953-bcdb-f3d6c4033244--\r\n--batchresponse_159fb801-3c8d-46db-a03b-b292c7948339--\r\n" + headers: + Cache-Control: + - no-cache + Content-Type: + - multipart/mixed; boundary=batchresponse_159fb801-3c8d-46db-a03b-b292c7948339 + Date: + - Fri, 21 May 2021 19:41:03 GMT + Server: + - Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0 + X-Content-Type-Options: + - nosniff + X-Ms-Request-Id: + - 8e3dc8c6-5002-001c-7379-4e6674000000 + X-Ms-Version: + - "2019-02-02" + status: 202 Accepted + code: 202 + duration: "" +- request: + body: "" + form: {} + headers: + Accept: + - application/json;odata=minimalmetadata + Authorization: + - sanitized + Dataserviceversion: + - "3.0" + User-Agent: + - azsdk-go-tables/ azsdk-go-tables/ azcore/v0.16.1 (go1.16.2; + Windows_NT) + X-Ms-Date: + - Fri, 21 May 2021 19:41:03 GMT + X-Ms-Version: + - "2019-02-02" + url: https://chrisstablesprim.table.core.windows.net/gotableg8scudpw7lv7b()?%24filter=RowKey+eq+%271%27 + method: GET + response: + body: '{"odata.metadata":"https://chrisstablesprim.table.core.windows.net/$metadata#gotableg8scudpw7lv7b","value":[{"odata.etag":"W/\"datetime''2021-05-21T19%3A41%3A03.5240944Z''\"","PartitionKey":"partition","RowKey":"1","Timestamp":"2021-05-21T19:41:03.5240944Z","BoolProp":true,"IntProp":1,"MergeProperty":"foo","SomeBinaryProperty@odata.type":"Edm.Binary","SomeBinaryProperty":"c29tZSBieXRlcw==","SomeDateProperty@odata.type":"Edm.DateTime","SomeDateProperty":"2021-05-21T19:41:03.2032731Z","SomeDoubleProperty0":1.0,"SomeDoubleProperty1":1.2345,"SomeGuidProperty@odata.type":"Edm.Guid","SomeGuidProperty":"27bdea07-48bb-49a1-7575-fa9c92b50ecc","SomeInt64Property@odata.type":"Edm.Int64","SomeInt64Property":"9223372036854775807","SomeIntProperty":42,"SomeStringProperty":"some + string","StringProp":"some string 1"}]}' + headers: + Cache-Control: + - no-cache + Content-Type: + - application/json;odata=minimalmetadata;streaming=true;charset=utf-8 + Date: + - Fri, 21 May 2021 19:41:03 GMT + Server: + - Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0 + X-Content-Type-Options: + - nosniff + X-Ms-Request-Id: + - 8e3dc8da-5002-001c-0579-4e6674000000 + 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-tables/ azsdk-go-tables/ azcore/v0.16.1 (go1.16.2; + Windows_NT) + X-Ms-Date: + - Fri, 21 May 2021 19:41:03 GMT + X-Ms-Version: + - "2019-02-02" + url: https://chrisstablesprim.table.core.windows.net/Tables('gotableg8scudpw7lv7b') + method: DELETE + response: + body: "" + headers: + Cache-Control: + - no-cache + Content-Length: + - "0" + Date: + - Fri, 21 May 2021 19:41:03 GMT + Server: + - Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0 + X-Content-Type-Options: + - nosniff + X-Ms-Request-Id: + - 8e3dc8e3-5002-001c-0d79-4e6674000000 + X-Ms-Version: + - "2019-02-02" + status: 204 No Content + code: 204 + duration: "" diff --git a/sdk/tables/aztables/recordings/TestTableClient_Storage/TestCreateTable-variables.yaml b/sdk/tables/aztables/recordings/TestTableClient_Storage/TestCreateTable-variables.yaml new file mode 100644 index 000000000000..db82b723a5c5 --- /dev/null +++ b/sdk/tables/aztables/recordings/TestTableClient_Storage/TestCreateTable-variables.yaml @@ -0,0 +1,5 @@ +--- +STORAGE_ENDPOINT_SUFFIX: core.windows.net +TABLES_PRIMARY_STORAGE_ACCOUNT_KEY: Kg== +TABLES_STORAGE_ACCOUNT_NAME: chrisstablesprim +randomSeed: "1617573288" diff --git a/sdk/tables/aztables/recordings/TestTableClient_Storage/TestCreateTable.yaml b/sdk/tables/aztables/recordings/TestTableClient_Storage/TestCreateTable.yaml new file mode 100644 index 000000000000..6ef28bf11ac7 --- /dev/null +++ b/sdk/tables/aztables/recordings/TestTableClient_Storage/TestCreateTable.yaml @@ -0,0 +1,85 @@ +--- +version: 1 +interactions: +- request: + body: '{"TableName":"gotable9uourkrfkri2m"}' + form: {} + headers: + Accept: + - application/json;odata=minimalmetadata + Authorization: + - sanitized + Content-Length: + - "36" + Content-Type: + - application/json + Dataserviceversion: + - "3.0" + User-Agent: + - azsdk-go-tables/ azsdk-go-tables/ azcore/v0.13.4 (go1.16.2; + Windows_NT) + X-Ms-Date: + - Sun, 04 Apr 2021 21:54:48 GMT + X-Ms-Version: + - "2019-02-02" + url: https://chrisstablesprim.table.core.windows.net/Tables + method: POST + response: + body: '{"odata.metadata":"https://chrisstablesprim.table.core.windows.net/$metadata#Tables/@Element","TableName":"gotable9uourkrfkri2m"}' + headers: + Cache-Control: + - no-cache + Content-Type: + - application/json;odata=minimalmetadata;streaming=true;charset=utf-8 + Date: + - Sun, 04 Apr 2021 21:54:48 GMT + Location: + - https://chrisstablesprim.table.core.windows.net/Tables('gotable9uourkrfkri2m') + Server: + - Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0 + X-Content-Type-Options: + - nosniff + X-Ms-Request-Id: + - aa171ae1-c002-0053-399d-291720000000 + X-Ms-Version: + - "2019-02-02" + status: 201 Created + code: 201 + duration: "" +- request: + body: "" + form: {} + headers: + Accept: + - application/json + Authorization: + - sanitized + User-Agent: + - azsdk-go-tables/ azsdk-go-tables/ azcore/v0.13.4 (go1.16.2; + Windows_NT) + X-Ms-Date: + - Sun, 04 Apr 2021 21:54:48 GMT + X-Ms-Version: + - "2019-02-02" + url: https://chrisstablesprim.table.core.windows.net/Tables('gotable9uourkrfkri2m') + method: DELETE + response: + body: "" + headers: + Cache-Control: + - no-cache + Content-Length: + - "0" + Date: + - Sun, 04 Apr 2021 21:54:48 GMT + Server: + - Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0 + X-Content-Type-Options: + - nosniff + X-Ms-Request-Id: + - aa171aec-c002-0053-419d-291720000000 + X-Ms-Version: + - "2019-02-02" + status: 204 No Content + code: 204 + duration: "" diff --git a/sdk/tables/aztables/recordings/TestTableClient_Storage/TestDeleteEntity-variables.yaml b/sdk/tables/aztables/recordings/TestTableClient_Storage/TestDeleteEntity-variables.yaml new file mode 100644 index 000000000000..ab689c50cddf --- /dev/null +++ b/sdk/tables/aztables/recordings/TestTableClient_Storage/TestDeleteEntity-variables.yaml @@ -0,0 +1,5 @@ +--- +STORAGE_ENDPOINT_SUFFIX: core.windows.net +TABLES_PRIMARY_STORAGE_ACCOUNT_KEY: Kg== +TABLES_STORAGE_ACCOUNT_NAME: chrisstablesprim +randomSeed: "1621624377" diff --git a/sdk/tables/aztables/recordings/TestTableClient_Storage/TestDeleteEntity.yaml b/sdk/tables/aztables/recordings/TestTableClient_Storage/TestDeleteEntity.yaml new file mode 100644 index 000000000000..4bc5d74b1533 --- /dev/null +++ b/sdk/tables/aztables/recordings/TestTableClient_Storage/TestDeleteEntity.yaml @@ -0,0 +1,180 @@ +--- +version: 1 +interactions: +- request: + body: '{"TableName":"gotable1eyzuuvhvub30"}' + form: {} + headers: + Accept: + - application/json;odata=minimalmetadata + Authorization: + - sanitized + Content-Length: + - "36" + Content-Type: + - application/json + Dataserviceversion: + - "3.0" + User-Agent: + - azsdk-go-tables/ azsdk-go-tables/ azcore/v0.16.1 (go1.16.2; + Windows_NT) + X-Ms-Date: + - Fri, 21 May 2021 19:12:57 GMT + X-Ms-Version: + - "2019-02-02" + url: https://chrisstablesprim.table.core.windows.net/Tables + method: POST + response: + body: '{"odata.metadata":"https://chrisstablesprim.table.core.windows.net/$metadata#Tables/@Element","TableName":"gotable1eyzuuvhvub30"}' + headers: + Cache-Control: + - no-cache + Content-Type: + - application/json;odata=minimalmetadata;streaming=true;charset=utf-8 + Date: + - Fri, 21 May 2021 19:12:57 GMT + Location: + - https://chrisstablesprim.table.core.windows.net/Tables('gotable1eyzuuvhvub30') + Server: + - Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0 + X-Content-Type-Options: + - nosniff + X-Ms-Request-Id: + - d8f0ab3d-2002-0006-0275-4e07ab000000 + X-Ms-Version: + - "2019-02-02" + status: 201 Created + code: 201 + duration: "" +- request: + body: '{"BoolProp":true,"IntProp":1,"PartitionKey":"partition","RowKey":"1","StringProp":"some + string 1"}' + form: {} + headers: + Accept: + - application/json;odata=minimalmetadata + Authorization: + - sanitized + Content-Length: + - "98" + Content-Type: + - application/json + Dataserviceversion: + - "3.0" + Prefer: + - return-no-content + User-Agent: + - azsdk-go-tables/ azsdk-go-tables/ azcore/v0.16.1 (go1.16.2; + Windows_NT) + X-Ms-Date: + - Fri, 21 May 2021 19:12:57 GMT + X-Ms-Version: + - "2019-02-02" + url: https://chrisstablesprim.table.core.windows.net/gotable1eyzuuvhvub30 + method: POST + response: + body: "" + headers: + Cache-Control: + - no-cache + Content-Length: + - "0" + Dataserviceid: + - https://chrisstablesprim.table.core.windows.net/gotable1eyzuuvhvub30(PartitionKey='partition',RowKey='1') + Date: + - Fri, 21 May 2021 19:12:57 GMT + Etag: + - W/"datetime'2021-05-21T19%3A12%3A58.1142822Z'" + Location: + - https://chrisstablesprim.table.core.windows.net/gotable1eyzuuvhvub30(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: + - d8f0ab55-2002-0006-1575-4e07ab000000 + 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" + If-Match: + - '*' + User-Agent: + - azsdk-go-tables/ azsdk-go-tables/ azcore/v0.16.1 (go1.16.2; + Windows_NT) + X-Ms-Date: + - Fri, 21 May 2021 19:12:58 GMT + X-Ms-Version: + - "2019-02-02" + url: https://chrisstablesprim.table.core.windows.net/gotable1eyzuuvhvub30(PartitionKey='partition',RowKey='1') + method: DELETE + response: + body: "" + headers: + Cache-Control: + - no-cache + Content-Length: + - "0" + Date: + - Fri, 21 May 2021 19:12:58 GMT + Server: + - Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0 + X-Content-Type-Options: + - nosniff + X-Ms-Request-Id: + - d8f0ab6c-2002-0006-2975-4e07ab000000 + 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-tables/ azsdk-go-tables/ azcore/v0.16.1 (go1.16.2; + Windows_NT) + X-Ms-Date: + - Fri, 21 May 2021 19:12:58 GMT + X-Ms-Version: + - "2019-02-02" + url: https://chrisstablesprim.table.core.windows.net/Tables('gotable1eyzuuvhvub30') + method: DELETE + response: + body: "" + headers: + Cache-Control: + - no-cache + Content-Length: + - "0" + Date: + - Fri, 21 May 2021 19:12:58 GMT + Server: + - Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0 + X-Content-Type-Options: + - nosniff + X-Ms-Request-Id: + - d8f0ab7c-2002-0006-3975-4e07ab000000 + X-Ms-Version: + - "2019-02-02" + status: 204 No Content + code: 204 + duration: "" diff --git a/sdk/tables/aztables/recordings/TestTableClient_Storage/TestGetEntity-variables.yaml b/sdk/tables/aztables/recordings/TestTableClient_Storage/TestGetEntity-variables.yaml new file mode 100644 index 000000000000..cf961f9b1cd5 --- /dev/null +++ b/sdk/tables/aztables/recordings/TestTableClient_Storage/TestGetEntity-variables.yaml @@ -0,0 +1,5 @@ +--- +STORAGE_ENDPOINT_SUFFIX: core.windows.net +TABLES_PRIMARY_STORAGE_ACCOUNT_KEY: Kg== +TABLES_STORAGE_ACCOUNT_NAME: chrisstablesprim +randomSeed: "1621634376" diff --git a/sdk/tables/aztables/recordings/TestTableClient_Storage/TestGetEntity.yaml b/sdk/tables/aztables/recordings/TestTableClient_Storage/TestGetEntity.yaml new file mode 100644 index 000000000000..908730a04650 --- /dev/null +++ b/sdk/tables/aztables/recordings/TestTableClient_Storage/TestGetEntity.yaml @@ -0,0 +1,181 @@ +--- +version: 1 +interactions: +- request: + body: '{"TableName":"gotabler50ulgi64r43f"}' + form: {} + headers: + Accept: + - application/json;odata=minimalmetadata + Authorization: + - sanitized + Content-Length: + - "36" + Content-Type: + - application/json + Dataserviceversion: + - "3.0" + User-Agent: + - azsdk-go-tables/ azsdk-go-tables/ azcore/v0.16.1 (go1.16.2; + Windows_NT) + X-Ms-Date: + - Fri, 21 May 2021 21:59:36 GMT + X-Ms-Version: + - "2019-02-02" + url: https://chrisstablesprim.table.core.windows.net/Tables + method: POST + response: + body: '{"odata.metadata":"https://chrisstablesprim.table.core.windows.net/$metadata#Tables/@Element","TableName":"gotabler50ulgi64r43f"}' + headers: + Cache-Control: + - no-cache + Content-Type: + - application/json;odata=minimalmetadata;streaming=true;charset=utf-8 + Date: + - Fri, 21 May 2021 21:59:38 GMT + Location: + - https://chrisstablesprim.table.core.windows.net/Tables('gotabler50ulgi64r43f') + Server: + - Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0 + X-Content-Type-Options: + - nosniff + X-Ms-Request-Id: + - 32966ff3-c002-006c-348c-4edf83000000 + X-Ms-Version: + - "2019-02-02" + status: 201 Created + code: 201 + duration: "" +- request: + body: '{"BoolProp":true,"IntProp":1,"PartitionKey":"partition","RowKey":"1","StringProp":"some + string 1"}' + form: {} + headers: + Accept: + - application/json;odata=minimalmetadata + Authorization: + - sanitized + Content-Length: + - "98" + Content-Type: + - application/json + Dataserviceversion: + - "3.0" + Prefer: + - return-no-content + User-Agent: + - azsdk-go-tables/ azsdk-go-tables/ azcore/v0.16.1 (go1.16.2; + Windows_NT) + X-Ms-Date: + - Fri, 21 May 2021 21:59:38 GMT + X-Ms-Version: + - "2019-02-02" + url: https://chrisstablesprim.table.core.windows.net/gotabler50ulgi64r43f + method: POST + response: + body: "" + headers: + Cache-Control: + - no-cache + Content-Length: + - "0" + Dataserviceid: + - https://chrisstablesprim.table.core.windows.net/gotabler50ulgi64r43f(PartitionKey='partition',RowKey='1') + Date: + - Fri, 21 May 2021 21:59:38 GMT + Etag: + - W/"datetime'2021-05-21T21%3A59%3A39.1154205Z'" + Location: + - https://chrisstablesprim.table.core.windows.net/gotabler50ulgi64r43f(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: + - 32967012-c002-006c-4f8c-4edf83000000 + 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-tables/ azsdk-go-tables/ azcore/v0.16.1 (go1.16.2; + Windows_NT) + X-Ms-Date: + - Fri, 21 May 2021 21:59:38 GMT + X-Ms-Version: + - "2019-02-02" + url: https://chrisstablesprim.table.core.windows.net/gotabler50ulgi64r43f(PartitionKey='partition',RowKey='1') + method: GET + response: + body: '{"odata.metadata":"https://chrisstablesprim.table.core.windows.net/$metadata#gotabler50ulgi64r43f/@Element","odata.etag":"W/\"datetime''2021-05-21T21%3A59%3A39.1154205Z''\"","PartitionKey":"partition","RowKey":"1","Timestamp":"2021-05-21T21:59:39.1154205Z","BoolProp":true,"IntProp":1,"StringProp":"some + string 1"}' + headers: + Cache-Control: + - no-cache + Content-Type: + - application/json;odata=minimalmetadata;streaming=true;charset=utf-8 + Date: + - Fri, 21 May 2021 21:59:39 GMT + Etag: + - W/"datetime'2021-05-21T21%3A59%3A39.1154205Z'" + Server: + - Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0 + X-Content-Type-Options: + - nosniff + X-Ms-Request-Id: + - 3296702c-c002-006c-648c-4edf83000000 + 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-tables/ azsdk-go-tables/ azcore/v0.16.1 (go1.16.2; + Windows_NT) + X-Ms-Date: + - Fri, 21 May 2021 21:59:39 GMT + X-Ms-Version: + - "2019-02-02" + url: https://chrisstablesprim.table.core.windows.net/Tables('gotabler50ulgi64r43f') + method: DELETE + response: + body: "" + headers: + Cache-Control: + - no-cache + Content-Length: + - "0" + Date: + - Fri, 21 May 2021 21:59:39 GMT + Server: + - Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0 + X-Content-Type-Options: + - nosniff + X-Ms-Request-Id: + - 32967036-c002-006c-6d8c-4edf83000000 + X-Ms-Version: + - "2019-02-02" + status: 204 No Content + code: 204 + duration: "" diff --git a/sdk/tables/aztables/recordings/TestTableClient_Storage/TestMergeEntity-variables.yaml b/sdk/tables/aztables/recordings/TestTableClient_Storage/TestMergeEntity-variables.yaml new file mode 100644 index 000000000000..e53058d11dbe --- /dev/null +++ b/sdk/tables/aztables/recordings/TestTableClient_Storage/TestMergeEntity-variables.yaml @@ -0,0 +1,5 @@ +--- +STORAGE_ENDPOINT_SUFFIX: core.windows.net +TABLES_PRIMARY_STORAGE_ACCOUNT_KEY: Kg== +TABLES_STORAGE_ACCOUNT_NAME: chrisstablesprim +randomSeed: "1621628754" diff --git a/sdk/tables/aztables/recordings/TestTableClient_Storage/TestMergeEntity.yaml b/sdk/tables/aztables/recordings/TestTableClient_Storage/TestMergeEntity.yaml new file mode 100644 index 000000000000..8f3bc72088cb --- /dev/null +++ b/sdk/tables/aztables/recordings/TestTableClient_Storage/TestMergeEntity.yaml @@ -0,0 +1,266 @@ +--- +version: 1 +interactions: +- request: + body: '{"TableName":"gotable29xnpgoal4avd"}' + form: {} + headers: + Accept: + - application/json;odata=minimalmetadata + Authorization: + - sanitized + Content-Length: + - "36" + Content-Type: + - application/json + Dataserviceversion: + - "3.0" + User-Agent: + - azsdk-go-tables/ azsdk-go-tables/ azcore/v0.16.1 (go1.16.2; + Windows_NT) + X-Ms-Date: + - Fri, 21 May 2021 20:25:54 GMT + X-Ms-Version: + - "2019-02-02" + url: https://chrisstablesprim.table.core.windows.net/Tables + method: POST + response: + body: '{"odata.metadata":"https://chrisstablesprim.table.core.windows.net/$metadata#Tables/@Element","TableName":"gotable29xnpgoal4avd"}' + headers: + Cache-Control: + - no-cache + Content-Type: + - application/json;odata=minimalmetadata;streaming=true;charset=utf-8 + Date: + - Fri, 21 May 2021 20:25:55 GMT + Location: + - https://chrisstablesprim.table.core.windows.net/Tables('gotable29xnpgoal4avd') + Server: + - Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0 + X-Content-Type-Options: + - nosniff + X-Ms-Request-Id: + - 9335a71f-b002-002b-2d7f-4eb4d8000000 + X-Ms-Version: + - "2019-02-02" + status: 201 Created + code: 201 + duration: "" +- request: + body: '{"BoolProp":true,"IntProp":1,"PartitionKey":"partition","RowKey":"1","StringProp":"some + string 1"}' + form: {} + headers: + Accept: + - application/json;odata=minimalmetadata + Authorization: + - sanitized + Content-Length: + - "98" + Content-Type: + - application/json + Dataserviceversion: + - "3.0" + Prefer: + - return-no-content + User-Agent: + - azsdk-go-tables/ azsdk-go-tables/ azcore/v0.16.1 (go1.16.2; + Windows_NT) + X-Ms-Date: + - Fri, 21 May 2021 20:25:55 GMT + X-Ms-Version: + - "2019-02-02" + url: https://chrisstablesprim.table.core.windows.net/gotable29xnpgoal4avd + method: POST + response: + body: "" + headers: + Cache-Control: + - no-cache + Content-Length: + - "0" + Dataserviceid: + - https://chrisstablesprim.table.core.windows.net/gotable29xnpgoal4avd(PartitionKey='partition',RowKey='1') + Date: + - Fri, 21 May 2021 20:25:55 GMT + Etag: + - W/"datetime'2021-05-21T20%3A25%3A56.1541897Z'" + Location: + - https://chrisstablesprim.table.core.windows.net/gotable29xnpgoal4avd(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: + - 9335a734-b002-002b-3b7f-4eb4d8000000 + 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-tables/ azsdk-go-tables/ azcore/v0.16.1 (go1.16.2; + Windows_NT) + X-Ms-Date: + - Fri, 21 May 2021 20:25:56 GMT + X-Ms-Version: + - "2019-02-02" + url: https://chrisstablesprim.table.core.windows.net/gotable29xnpgoal4avd()?%24filter=RowKey+eq+%271%27 + method: GET + response: + body: '{"odata.metadata":"https://chrisstablesprim.table.core.windows.net/$metadata#gotable29xnpgoal4avd","value":[{"odata.etag":"W/\"datetime''2021-05-21T20%3A25%3A56.1541897Z''\"","PartitionKey":"partition","RowKey":"1","Timestamp":"2021-05-21T20:25:56.1541897Z","BoolProp":true,"IntProp":1,"StringProp":"some + string 1"}]}' + headers: + Cache-Control: + - no-cache + Content-Type: + - application/json;odata=minimalmetadata;streaming=true;charset=utf-8 + Date: + - Fri, 21 May 2021 20:25:56 GMT + Server: + - Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0 + X-Content-Type-Options: + - nosniff + X-Ms-Request-Id: + - 9335a73c-b002-002b-437f-4eb4d8000000 + X-Ms-Version: + - "2019-02-02" + status: 200 OK + code: 200 + duration: "" +- request: + body: '{"MergeProperty":"foo","PartitionKey":"partition","RowKey":"1"}' + form: {} + headers: + Accept: + - application/json + Authorization: + - sanitized + Content-Length: + - "63" + Content-Type: + - application/json + Dataserviceversion: + - "3.0" + If-Match: + - '*' + User-Agent: + - azsdk-go-tables/ azsdk-go-tables/ azcore/v0.16.1 (go1.16.2; + Windows_NT) + X-Ms-Date: + - Fri, 21 May 2021 20:25:56 GMT + X-Ms-Version: + - "2019-02-02" + url: https://chrisstablesprim.table.core.windows.net/gotable29xnpgoal4avd(PartitionKey='partition',RowKey='1') + method: PATCH + response: + body: "" + headers: + Cache-Control: + - no-cache + Content-Length: + - "0" + Date: + - Fri, 21 May 2021 20:25:56 GMT + Etag: + - W/"datetime'2021-05-21T20%3A25%3A56.3029412Z'" + Server: + - Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0 + X-Content-Type-Options: + - nosniff + X-Ms-Request-Id: + - 9335a74a-b002-002b-4f7f-4eb4d8000000 + 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-tables/ azsdk-go-tables/ azcore/v0.16.1 (go1.16.2; + Windows_NT) + X-Ms-Date: + - Fri, 21 May 2021 20:25:56 GMT + X-Ms-Version: + - "2019-02-02" + url: https://chrisstablesprim.table.core.windows.net/gotable29xnpgoal4avd()?%24filter=RowKey+eq+%271%27 + method: GET + response: + body: '{"odata.metadata":"https://chrisstablesprim.table.core.windows.net/$metadata#gotable29xnpgoal4avd","value":[{"odata.etag":"W/\"datetime''2021-05-21T20%3A25%3A56.3029412Z''\"","PartitionKey":"partition","RowKey":"1","Timestamp":"2021-05-21T20:25:56.3029412Z","BoolProp":true,"IntProp":1,"MergeProperty":"foo","StringProp":"some + string 1"}]}' + headers: + Cache-Control: + - no-cache + Content-Type: + - application/json;odata=minimalmetadata;streaming=true;charset=utf-8 + Date: + - Fri, 21 May 2021 20:25:56 GMT + Server: + - Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0 + X-Content-Type-Options: + - nosniff + X-Ms-Request-Id: + - 9335a753-b002-002b-587f-4eb4d8000000 + 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-tables/ azsdk-go-tables/ azcore/v0.16.1 (go1.16.2; + Windows_NT) + X-Ms-Date: + - Fri, 21 May 2021 20:25:56 GMT + X-Ms-Version: + - "2019-02-02" + url: https://chrisstablesprim.table.core.windows.net/Tables('gotable29xnpgoal4avd') + method: DELETE + response: + body: "" + headers: + Cache-Control: + - no-cache + Content-Length: + - "0" + Date: + - Fri, 21 May 2021 20:25:56 GMT + Server: + - Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0 + X-Content-Type-Options: + - nosniff + X-Ms-Request-Id: + - 9335a758-b002-002b-5d7f-4eb4d8000000 + X-Ms-Version: + - "2019-02-02" + status: 204 No Content + code: 204 + duration: "" diff --git a/sdk/tables/aztables/recordings/TestTableClient_Storage/TestQueryComplexEntity-variables.yaml b/sdk/tables/aztables/recordings/TestTableClient_Storage/TestQueryComplexEntity-variables.yaml new file mode 100644 index 000000000000..3716fc99c1ac --- /dev/null +++ b/sdk/tables/aztables/recordings/TestTableClient_Storage/TestQueryComplexEntity-variables.yaml @@ -0,0 +1,6 @@ +--- +STORAGE_ENDPOINT_SUFFIX: core.windows.net +TABLES_PRIMARY_STORAGE_ACCOUNT_KEY: Kg== +TABLES_STORAGE_ACCOUNT_NAME: chrisstablesprim +now: "2021-05-19T11:25:34.8176907-05:00" +randomSeed: "1621441533" diff --git a/sdk/tables/aztables/recordings/TestTableClient_Storage/TestQueryComplexEntity.yaml b/sdk/tables/aztables/recordings/TestTableClient_Storage/TestQueryComplexEntity.yaml new file mode 100644 index 000000000000..a4520174812d --- /dev/null +++ b/sdk/tables/aztables/recordings/TestTableClient_Storage/TestQueryComplexEntity.yaml @@ -0,0 +1,398 @@ +--- +version: 1 +interactions: +- request: + body: '{"TableName":"gotablejb1ox80o3u07d"}' + form: {} + headers: + Accept: + - application/json;odata=minimalmetadata + Authorization: + - sanitized + Content-Length: + - "36" + Content-Type: + - application/json + Dataserviceversion: + - "3.0" + User-Agent: + - azsdk-go-tables/ azsdk-go-tables/ azcore/v0.16.1 (go1.16.2; + Windows_NT) + X-Ms-Date: + - Wed, 19 May 2021 16:25:33 GMT + X-Ms-Version: + - "2019-02-02" + url: https://chrisstablesprim.table.core.windows.net/Tables + method: POST + response: + body: '{"odata.metadata":"https://chrisstablesprim.table.core.windows.net/$metadata#Tables/@Element","TableName":"gotablejb1ox80o3u07d"}' + headers: + Cache-Control: + - no-cache + Content-Type: + - application/json;odata=minimalmetadata;streaming=true;charset=utf-8 + Date: + - Wed, 19 May 2021 16:25:34 GMT + Location: + - https://chrisstablesprim.table.core.windows.net/Tables('gotablejb1ox80o3u07d') + Server: + - Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0 + X-Content-Type-Options: + - nosniff + X-Ms-Request-Id: + - fc7aa098-d002-0012-61cb-4c4fc4000000 + X-Ms-Version: + - "2019-02-02" + status: 201 Created + code: 201 + duration: "" +- request: + body: '{"BoolProp":true,"IntProp":1,"PartitionKey":"partition","RowKey":"1","SomeBinaryProperty":"c29tZSBieXRlcw==","SomeBinaryProperty@odata.type":"Edm.Binary","SomeDateProperty":"2021-05-19T16:25:34.8176907Z","SomeDateProperty@odata.type":"Edm.DateTime","SomeDoubleProperty0":1,"SomeDoubleProperty0@odata.type":"Edm.Double","SomeDoubleProperty1":1.2345,"SomeDoubleProperty1@odata.type":"Edm.Double","SomeGuidProperty":"db1ac97d-fb93-4b44-7d4b-d4f954a074cd","SomeGuidProperty@odata.type":"Edm.Guid","SomeInt64Property":"9223372036854775807","SomeInt64Property@odata.type":"Edm.Int64","SomeIntProperty":42,"SomeStringProperty":"some + string","StringProp":"some string 1"}' + form: {} + headers: + Accept: + - application/json;odata=minimalmetadata + Authorization: + - sanitized + Content-Length: + - "663" + Content-Type: + - application/json + Dataserviceversion: + - "3.0" + Prefer: + - return-no-content + User-Agent: + - azsdk-go-tables/ azsdk-go-tables/ azcore/v0.16.1 (go1.16.2; + Windows_NT) + X-Ms-Date: + - Wed, 19 May 2021 16:25:34 GMT + X-Ms-Version: + - "2019-02-02" + url: https://chrisstablesprim.table.core.windows.net/gotablejb1ox80o3u07d + method: POST + response: + body: "" + headers: + Cache-Control: + - no-cache + Content-Length: + - "0" + Dataserviceid: + - https://chrisstablesprim.table.core.windows.net/gotablejb1ox80o3u07d(PartitionKey='partition',RowKey='1') + Date: + - Wed, 19 May 2021 16:25:34 GMT + Etag: + - W/"datetime'2021-05-19T16%3A25%3A35.0582247Z'" + Location: + - https://chrisstablesprim.table.core.windows.net/gotablejb1ox80o3u07d(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: + - fc7aa0a7-d002-0012-68cb-4c4fc4000000 + X-Ms-Version: + - "2019-02-02" + status: 204 No Content + code: 204 + duration: "" +- request: + body: '{"BoolProp":true,"IntProp":2,"PartitionKey":"partition","RowKey":"2","SomeBinaryProperty":"c29tZSBieXRlcw==","SomeBinaryProperty@odata.type":"Edm.Binary","SomeDateProperty":"2021-05-19T16:25:34.8176907Z","SomeDateProperty@odata.type":"Edm.DateTime","SomeDoubleProperty0":1,"SomeDoubleProperty0@odata.type":"Edm.Double","SomeDoubleProperty1":1.2345,"SomeDoubleProperty1@odata.type":"Edm.Double","SomeGuidProperty":"fb4d0c37-ce1d-4be9-7caf-b33d2c76c8d2","SomeGuidProperty@odata.type":"Edm.Guid","SomeInt64Property":"9223372036854775807","SomeInt64Property@odata.type":"Edm.Int64","SomeIntProperty":42,"SomeStringProperty":"some + string","StringProp":"some string 2"}' + form: {} + headers: + Accept: + - application/json;odata=minimalmetadata + Authorization: + - sanitized + Content-Length: + - "663" + Content-Type: + - application/json + Dataserviceversion: + - "3.0" + Prefer: + - return-no-content + User-Agent: + - azsdk-go-tables/ azsdk-go-tables/ azcore/v0.16.1 (go1.16.2; + Windows_NT) + X-Ms-Date: + - Wed, 19 May 2021 16:25:34 GMT + X-Ms-Version: + - "2019-02-02" + url: https://chrisstablesprim.table.core.windows.net/gotablejb1ox80o3u07d + method: POST + response: + body: "" + headers: + Cache-Control: + - no-cache + Content-Length: + - "0" + Dataserviceid: + - https://chrisstablesprim.table.core.windows.net/gotablejb1ox80o3u07d(PartitionKey='partition',RowKey='2') + Date: + - Wed, 19 May 2021 16:25:34 GMT + Etag: + - W/"datetime'2021-05-19T16%3A25%3A35.1402835Z'" + Location: + - https://chrisstablesprim.table.core.windows.net/gotablejb1ox80o3u07d(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: + - fc7aa0bc-d002-0012-74cb-4c4fc4000000 + X-Ms-Version: + - "2019-02-02" + status: 204 No Content + code: 204 + duration: "" +- request: + body: '{"BoolProp":true,"IntProp":3,"PartitionKey":"partition","RowKey":"3","SomeBinaryProperty":"c29tZSBieXRlcw==","SomeBinaryProperty@odata.type":"Edm.Binary","SomeDateProperty":"2021-05-19T16:25:34.8176907Z","SomeDateProperty@odata.type":"Edm.DateTime","SomeDoubleProperty0":1,"SomeDoubleProperty0@odata.type":"Edm.Double","SomeDoubleProperty1":1.2345,"SomeDoubleProperty1@odata.type":"Edm.Double","SomeGuidProperty":"dcc950e1-9b4d-4921-641f-6b027f009872","SomeGuidProperty@odata.type":"Edm.Guid","SomeInt64Property":"9223372036854775807","SomeInt64Property@odata.type":"Edm.Int64","SomeIntProperty":42,"SomeStringProperty":"some + string","StringProp":"some string 3"}' + form: {} + headers: + Accept: + - application/json;odata=minimalmetadata + Authorization: + - sanitized + Content-Length: + - "663" + Content-Type: + - application/json + Dataserviceversion: + - "3.0" + Prefer: + - return-no-content + User-Agent: + - azsdk-go-tables/ azsdk-go-tables/ azcore/v0.16.1 (go1.16.2; + Windows_NT) + X-Ms-Date: + - Wed, 19 May 2021 16:25:34 GMT + X-Ms-Version: + - "2019-02-02" + url: https://chrisstablesprim.table.core.windows.net/gotablejb1ox80o3u07d + method: POST + response: + body: "" + headers: + Cache-Control: + - no-cache + Content-Length: + - "0" + Dataserviceid: + - https://chrisstablesprim.table.core.windows.net/gotablejb1ox80o3u07d(PartitionKey='partition',RowKey='3') + Date: + - Wed, 19 May 2021 16:25:34 GMT + Etag: + - W/"datetime'2021-05-19T16%3A25%3A35.2163375Z'" + Location: + - https://chrisstablesprim.table.core.windows.net/gotablejb1ox80o3u07d(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: + - fc7aa0c9-d002-0012-7ccb-4c4fc4000000 + X-Ms-Version: + - "2019-02-02" + status: 204 No Content + code: 204 + duration: "" +- request: + body: '{"BoolProp":true,"IntProp":4,"PartitionKey":"partition","RowKey":"4","SomeBinaryProperty":"c29tZSBieXRlcw==","SomeBinaryProperty@odata.type":"Edm.Binary","SomeDateProperty":"2021-05-19T16:25:34.8176907Z","SomeDateProperty@odata.type":"Edm.DateTime","SomeDoubleProperty0":1,"SomeDoubleProperty0@odata.type":"Edm.Double","SomeDoubleProperty1":1.2345,"SomeDoubleProperty1@odata.type":"Edm.Double","SomeGuidProperty":"1d4ec065-b163-4655-6837-dfb00d348f05","SomeGuidProperty@odata.type":"Edm.Guid","SomeInt64Property":"9223372036854775807","SomeInt64Property@odata.type":"Edm.Int64","SomeIntProperty":42,"SomeStringProperty":"some + string","StringProp":"some string 4"}' + form: {} + headers: + Accept: + - application/json;odata=minimalmetadata + Authorization: + - sanitized + Content-Length: + - "663" + Content-Type: + - application/json + Dataserviceversion: + - "3.0" + Prefer: + - return-no-content + User-Agent: + - azsdk-go-tables/ azsdk-go-tables/ azcore/v0.16.1 (go1.16.2; + Windows_NT) + X-Ms-Date: + - Wed, 19 May 2021 16:25:35 GMT + X-Ms-Version: + - "2019-02-02" + url: https://chrisstablesprim.table.core.windows.net/gotablejb1ox80o3u07d + method: POST + response: + body: "" + headers: + Cache-Control: + - no-cache + Content-Length: + - "0" + Dataserviceid: + - https://chrisstablesprim.table.core.windows.net/gotablejb1ox80o3u07d(PartitionKey='partition',RowKey='4') + Date: + - Wed, 19 May 2021 16:25:34 GMT + Etag: + - W/"datetime'2021-05-19T16%3A25%3A35.2903901Z'" + Location: + - https://chrisstablesprim.table.core.windows.net/gotablejb1ox80o3u07d(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: + - fc7aa0d4-d002-0012-02cb-4c4fc4000000 + X-Ms-Version: + - "2019-02-02" + status: 204 No Content + code: 204 + duration: "" +- request: + body: '{"BoolProp":true,"IntProp":5,"PartitionKey":"partition","RowKey":"5","SomeBinaryProperty":"c29tZSBieXRlcw==","SomeBinaryProperty@odata.type":"Edm.Binary","SomeDateProperty":"2021-05-19T16:25:34.8176907Z","SomeDateProperty@odata.type":"Edm.DateTime","SomeDoubleProperty0":1,"SomeDoubleProperty0@odata.type":"Edm.Double","SomeDoubleProperty1":1.2345,"SomeDoubleProperty1@odata.type":"Edm.Double","SomeGuidProperty":"56f00341-cce5-4e8b-7071-d032809fc2ba","SomeGuidProperty@odata.type":"Edm.Guid","SomeInt64Property":"9223372036854775807","SomeInt64Property@odata.type":"Edm.Int64","SomeIntProperty":42,"SomeStringProperty":"some + string","StringProp":"some string 5"}' + form: {} + headers: + Accept: + - application/json;odata=minimalmetadata + Authorization: + - sanitized + Content-Length: + - "663" + Content-Type: + - application/json + Dataserviceversion: + - "3.0" + Prefer: + - return-no-content + User-Agent: + - azsdk-go-tables/ azsdk-go-tables/ azcore/v0.16.1 (go1.16.2; + Windows_NT) + X-Ms-Date: + - Wed, 19 May 2021 16:25:35 GMT + X-Ms-Version: + - "2019-02-02" + url: https://chrisstablesprim.table.core.windows.net/gotablejb1ox80o3u07d + method: POST + response: + body: "" + headers: + Cache-Control: + - no-cache + Content-Length: + - "0" + Dataserviceid: + - https://chrisstablesprim.table.core.windows.net/gotablejb1ox80o3u07d(PartitionKey='partition',RowKey='5') + Date: + - Wed, 19 May 2021 16:25:34 GMT + Etag: + - W/"datetime'2021-05-19T16%3A25%3A35.368446Z'" + Location: + - https://chrisstablesprim.table.core.windows.net/gotablejb1ox80o3u07d(PartitionKey='partition',RowKey='5') + Preference-Applied: + - return-no-content + Server: + - Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0 + X-Content-Type-Options: + - nosniff + X-Ms-Request-Id: + - fc7aa0e3-d002-0012-0bcb-4c4fc4000000 + 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-tables/ azsdk-go-tables/ azcore/v0.16.1 (go1.16.2; + Windows_NT) + X-Ms-Date: + - Wed, 19 May 2021 16:25:35 GMT + X-Ms-Version: + - "2019-02-02" + url: https://chrisstablesprim.table.core.windows.net/gotablejb1ox80o3u07d()?%24filter=RowKey+lt+%275%27 + method: GET + response: + body: '{"odata.metadata":"https://chrisstablesprim.table.core.windows.net/$metadata#gotablejb1ox80o3u07d","value":[{"odata.etag":"W/\"datetime''2021-05-19T16%3A25%3A35.0582247Z''\"","PartitionKey":"partition","RowKey":"1","Timestamp":"2021-05-19T16:25:35.0582247Z","BoolProp":true,"IntProp":1,"SomeBinaryProperty@odata.type":"Edm.Binary","SomeBinaryProperty":"c29tZSBieXRlcw==","SomeDateProperty@odata.type":"Edm.DateTime","SomeDateProperty":"2021-05-19T16:25:34.8176907Z","SomeDoubleProperty0":1.0,"SomeDoubleProperty1":1.2345,"SomeGuidProperty@odata.type":"Edm.Guid","SomeGuidProperty":"db1ac97d-fb93-4b44-7d4b-d4f954a074cd","SomeInt64Property@odata.type":"Edm.Int64","SomeInt64Property":"9223372036854775807","SomeIntProperty":42,"SomeStringProperty":"some + string","StringProp":"some string 1"},{"odata.etag":"W/\"datetime''2021-05-19T16%3A25%3A35.1402835Z''\"","PartitionKey":"partition","RowKey":"2","Timestamp":"2021-05-19T16:25:35.1402835Z","BoolProp":true,"IntProp":2,"SomeBinaryProperty@odata.type":"Edm.Binary","SomeBinaryProperty":"c29tZSBieXRlcw==","SomeDateProperty@odata.type":"Edm.DateTime","SomeDateProperty":"2021-05-19T16:25:34.8176907Z","SomeDoubleProperty0":1.0,"SomeDoubleProperty1":1.2345,"SomeGuidProperty@odata.type":"Edm.Guid","SomeGuidProperty":"fb4d0c37-ce1d-4be9-7caf-b33d2c76c8d2","SomeInt64Property@odata.type":"Edm.Int64","SomeInt64Property":"9223372036854775807","SomeIntProperty":42,"SomeStringProperty":"some + string","StringProp":"some string 2"},{"odata.etag":"W/\"datetime''2021-05-19T16%3A25%3A35.2163375Z''\"","PartitionKey":"partition","RowKey":"3","Timestamp":"2021-05-19T16:25:35.2163375Z","BoolProp":true,"IntProp":3,"SomeBinaryProperty@odata.type":"Edm.Binary","SomeBinaryProperty":"c29tZSBieXRlcw==","SomeDateProperty@odata.type":"Edm.DateTime","SomeDateProperty":"2021-05-19T16:25:34.8176907Z","SomeDoubleProperty0":1.0,"SomeDoubleProperty1":1.2345,"SomeGuidProperty@odata.type":"Edm.Guid","SomeGuidProperty":"dcc950e1-9b4d-4921-641f-6b027f009872","SomeInt64Property@odata.type":"Edm.Int64","SomeInt64Property":"9223372036854775807","SomeIntProperty":42,"SomeStringProperty":"some + string","StringProp":"some string 3"},{"odata.etag":"W/\"datetime''2021-05-19T16%3A25%3A35.2903901Z''\"","PartitionKey":"partition","RowKey":"4","Timestamp":"2021-05-19T16:25:35.2903901Z","BoolProp":true,"IntProp":4,"SomeBinaryProperty@odata.type":"Edm.Binary","SomeBinaryProperty":"c29tZSBieXRlcw==","SomeDateProperty@odata.type":"Edm.DateTime","SomeDateProperty":"2021-05-19T16:25:34.8176907Z","SomeDoubleProperty0":1.0,"SomeDoubleProperty1":1.2345,"SomeGuidProperty@odata.type":"Edm.Guid","SomeGuidProperty":"1d4ec065-b163-4655-6837-dfb00d348f05","SomeInt64Property@odata.type":"Edm.Int64","SomeInt64Property":"9223372036854775807","SomeIntProperty":42,"SomeStringProperty":"some + string","StringProp":"some string 4"}]}' + headers: + Cache-Control: + - no-cache + Content-Type: + - application/json;odata=minimalmetadata;streaming=true;charset=utf-8 + Date: + - Wed, 19 May 2021 16:25:34 GMT + Server: + - Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0 + X-Content-Type-Options: + - nosniff + X-Ms-Request-Id: + - fc7aa0e9-d002-0012-11cb-4c4fc4000000 + 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-tables/ azsdk-go-tables/ azcore/v0.16.1 (go1.16.2; + Windows_NT) + X-Ms-Date: + - Wed, 19 May 2021 16:25:35 GMT + X-Ms-Version: + - "2019-02-02" + url: https://chrisstablesprim.table.core.windows.net/Tables('gotablejb1ox80o3u07d') + method: DELETE + response: + body: "" + headers: + Cache-Control: + - no-cache + Content-Length: + - "0" + Date: + - Wed, 19 May 2021 16:25:34 GMT + Server: + - Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0 + X-Content-Type-Options: + - nosniff + X-Ms-Request-Id: + - fc7aa0f9-d002-0012-21cb-4c4fc4000000 + X-Ms-Version: + - "2019-02-02" + status: 204 No Content + code: 204 + duration: "" diff --git a/sdk/tables/aztables/recordings/TestTableClient_Storage/TestQuerySimpleEntity-variables.yaml b/sdk/tables/aztables/recordings/TestTableClient_Storage/TestQuerySimpleEntity-variables.yaml new file mode 100644 index 000000000000..7a6b1b1ab41d --- /dev/null +++ b/sdk/tables/aztables/recordings/TestTableClient_Storage/TestQuerySimpleEntity-variables.yaml @@ -0,0 +1,5 @@ +--- +STORAGE_ENDPOINT_SUFFIX: core.windows.net +TABLES_PRIMARY_STORAGE_ACCOUNT_KEY: Kg== +TABLES_STORAGE_ACCOUNT_NAME: chrisstablesprim +randomSeed: "1617598958" diff --git a/sdk/tables/aztables/recordings/TestTableClient_Storage/TestQuerySimpleEntity.yaml b/sdk/tables/aztables/recordings/TestTableClient_Storage/TestQuerySimpleEntity.yaml new file mode 100644 index 000000000000..1735178553e0 --- /dev/null +++ b/sdk/tables/aztables/recordings/TestTableClient_Storage/TestQuerySimpleEntity.yaml @@ -0,0 +1,398 @@ +--- +version: 1 +interactions: +- request: + body: '{"TableName":"gotablev9ymy16fzote2"}' + form: {} + headers: + Accept: + - application/json;odata=minimalmetadata + Authorization: + - sanitized + Content-Length: + - "36" + Content-Type: + - application/json + Dataserviceversion: + - "3.0" + User-Agent: + - azsdk-go-tables/ azsdk-go-tables/ azcore/v0.13.4 (go1.16.2; + Windows_NT) + X-Ms-Date: + - Mon, 05 Apr 2021 05:02:38 GMT + X-Ms-Version: + - "2019-02-02" + url: https://chrisstablesprim.table.core.windows.net/Tables + method: POST + response: + body: '{"odata.metadata":"https://chrisstablesprim.table.core.windows.net/$metadata#Tables/@Element","TableName":"gotablev9ymy16fzote2"}' + headers: + Cache-Control: + - no-cache + Content-Type: + - application/json;odata=minimalmetadata;streaming=true;charset=utf-8 + Date: + - Mon, 05 Apr 2021 05:02:37 GMT + Location: + - https://chrisstablesprim.table.core.windows.net/Tables('gotablev9ymy16fzote2') + Server: + - Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0 + X-Content-Type-Options: + - nosniff + X-Ms-Request-Id: + - 95cfebe3-e002-0019-49d8-29b4af000000 + X-Ms-Version: + - "2019-02-02" + status: 201 Created + code: 201 + duration: "" +- request: + body: '{"BoolProp":true,"IntProp":1,"PartitionKey":"partition","RowKey":"1","StringProp":"some + string 1"}' + form: {} + headers: + Accept: + - application/json;odata=minimalmetadata + Authorization: + - sanitized + Content-Length: + - "98" + Content-Type: + - application/json + Dataserviceversion: + - "3.0" + Prefer: + - return-no-content + User-Agent: + - azsdk-go-tables/ azsdk-go-tables/ azcore/v0.13.4 (go1.16.2; + Windows_NT) + X-Ms-Date: + - Mon, 05 Apr 2021 05:02:38 GMT + X-Ms-Version: + - "2019-02-02" + url: https://chrisstablesprim.table.core.windows.net/gotablev9ymy16fzote2 + method: POST + response: + body: "" + headers: + Cache-Control: + - no-cache + Content-Length: + - "0" + Dataserviceid: + - https://chrisstablesprim.table.core.windows.net/gotablev9ymy16fzote2(PartitionKey='partition',RowKey='1') + Date: + - Mon, 05 Apr 2021 05:02:37 GMT + Etag: + - W/"datetime'2021-04-05T05%3A02%3A38.4885381Z'" + Location: + - https://chrisstablesprim.table.core.windows.net/gotablev9ymy16fzote2(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: + - 95cfebec-e002-0019-50d8-29b4af000000 + X-Ms-Version: + - "2019-02-02" + status: 204 No Content + code: 204 + duration: "" +- request: + body: '{"BoolProp":true,"IntProp":2,"PartitionKey":"partition","RowKey":"2","StringProp":"some + string 2"}' + form: {} + headers: + Accept: + - application/json;odata=minimalmetadata + Authorization: + - sanitized + Content-Length: + - "98" + Content-Type: + - application/json + Dataserviceversion: + - "3.0" + Prefer: + - return-no-content + User-Agent: + - azsdk-go-tables/ azsdk-go-tables/ azcore/v0.13.4 (go1.16.2; + Windows_NT) + X-Ms-Date: + - Mon, 05 Apr 2021 05:02:38 GMT + X-Ms-Version: + - "2019-02-02" + url: https://chrisstablesprim.table.core.windows.net/gotablev9ymy16fzote2 + method: POST + response: + body: "" + headers: + Cache-Control: + - no-cache + Content-Length: + - "0" + Dataserviceid: + - https://chrisstablesprim.table.core.windows.net/gotablev9ymy16fzote2(PartitionKey='partition',RowKey='2') + Date: + - Mon, 05 Apr 2021 05:02:37 GMT + Etag: + - W/"datetime'2021-04-05T05%3A02%3A38.5946142Z'" + Location: + - https://chrisstablesprim.table.core.windows.net/gotablev9ymy16fzote2(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: + - 95cfebf1-e002-0019-55d8-29b4af000000 + X-Ms-Version: + - "2019-02-02" + status: 204 No Content + code: 204 + duration: "" +- request: + body: '{"BoolProp":true,"IntProp":3,"PartitionKey":"partition","RowKey":"3","StringProp":"some + string 3"}' + form: {} + headers: + Accept: + - application/json;odata=minimalmetadata + Authorization: + - sanitized + Content-Length: + - "98" + Content-Type: + - application/json + Dataserviceversion: + - "3.0" + Prefer: + - return-no-content + User-Agent: + - azsdk-go-tables/ azsdk-go-tables/ azcore/v0.13.4 (go1.16.2; + Windows_NT) + X-Ms-Date: + - Mon, 05 Apr 2021 05:02:38 GMT + X-Ms-Version: + - "2019-02-02" + url: https://chrisstablesprim.table.core.windows.net/gotablev9ymy16fzote2 + method: POST + response: + body: "" + headers: + Cache-Control: + - no-cache + Content-Length: + - "0" + Dataserviceid: + - https://chrisstablesprim.table.core.windows.net/gotablev9ymy16fzote2(PartitionKey='partition',RowKey='3') + Date: + - Mon, 05 Apr 2021 05:02:38 GMT + Etag: + - W/"datetime'2021-04-05T05%3A02%3A38.6866808Z'" + Location: + - https://chrisstablesprim.table.core.windows.net/gotablev9ymy16fzote2(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: + - 95cfebf3-e002-0019-57d8-29b4af000000 + X-Ms-Version: + - "2019-02-02" + status: 204 No Content + code: 204 + duration: "" +- request: + body: '{"BoolProp":true,"IntProp":4,"PartitionKey":"partition","RowKey":"4","StringProp":"some + string 4"}' + form: {} + headers: + Accept: + - application/json;odata=minimalmetadata + Authorization: + - sanitized + Content-Length: + - "98" + Content-Type: + - application/json + Dataserviceversion: + - "3.0" + Prefer: + - return-no-content + User-Agent: + - azsdk-go-tables/ azsdk-go-tables/ azcore/v0.13.4 (go1.16.2; + Windows_NT) + X-Ms-Date: + - Mon, 05 Apr 2021 05:02:38 GMT + X-Ms-Version: + - "2019-02-02" + url: https://chrisstablesprim.table.core.windows.net/gotablev9ymy16fzote2 + method: POST + response: + body: "" + headers: + Cache-Control: + - no-cache + Content-Length: + - "0" + Dataserviceid: + - https://chrisstablesprim.table.core.windows.net/gotablev9ymy16fzote2(PartitionKey='partition',RowKey='4') + Date: + - Mon, 05 Apr 2021 05:02:38 GMT + Etag: + - W/"datetime'2021-04-05T05%3A02%3A38.7727417Z'" + Location: + - https://chrisstablesprim.table.core.windows.net/gotablev9ymy16fzote2(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: + - 95cfebf5-e002-0019-59d8-29b4af000000 + X-Ms-Version: + - "2019-02-02" + status: 204 No Content + code: 204 + duration: "" +- request: + body: '{"BoolProp":true,"IntProp":5,"PartitionKey":"partition","RowKey":"5","StringProp":"some + string 5"}' + form: {} + headers: + Accept: + - application/json;odata=minimalmetadata + Authorization: + - sanitized + Content-Length: + - "98" + Content-Type: + - application/json + Dataserviceversion: + - "3.0" + Prefer: + - return-no-content + User-Agent: + - azsdk-go-tables/ azsdk-go-tables/ azcore/v0.13.4 (go1.16.2; + Windows_NT) + X-Ms-Date: + - Mon, 05 Apr 2021 05:02:38 GMT + X-Ms-Version: + - "2019-02-02" + url: https://chrisstablesprim.table.core.windows.net/gotablev9ymy16fzote2 + method: POST + response: + body: "" + headers: + Cache-Control: + - no-cache + Content-Length: + - "0" + Dataserviceid: + - https://chrisstablesprim.table.core.windows.net/gotablev9ymy16fzote2(PartitionKey='partition',RowKey='5') + Date: + - Mon, 05 Apr 2021 05:02:38 GMT + Etag: + - W/"datetime'2021-04-05T05%3A02%3A38.8487963Z'" + Location: + - https://chrisstablesprim.table.core.windows.net/gotablev9ymy16fzote2(PartitionKey='partition',RowKey='5') + Preference-Applied: + - return-no-content + Server: + - Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0 + X-Content-Type-Options: + - nosniff + X-Ms-Request-Id: + - 95cfebfb-e002-0019-5cd8-29b4af000000 + 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-tables/ azsdk-go-tables/ azcore/v0.13.4 (go1.16.2; + Windows_NT) + X-Ms-Date: + - Mon, 05 Apr 2021 05:02:39 GMT + X-Ms-Version: + - "2019-02-02" + url: https://chrisstablesprim.table.core.windows.net/gotablev9ymy16fzote2()?%24filter=RowKey+lt+%275%27 + method: GET + response: + body: '{"odata.metadata":"https://chrisstablesprim.table.core.windows.net/$metadata#gotablev9ymy16fzote2","value":[{"odata.etag":"W/\"datetime''2021-04-05T05%3A02%3A38.4885381Z''\"","PartitionKey":"partition","RowKey":"1","Timestamp":"2021-04-05T05:02:38.4885381Z","BoolProp":true,"IntProp":1,"StringProp":"some + string 1"},{"odata.etag":"W/\"datetime''2021-04-05T05%3A02%3A38.5946142Z''\"","PartitionKey":"partition","RowKey":"2","Timestamp":"2021-04-05T05:02:38.5946142Z","BoolProp":true,"IntProp":2,"StringProp":"some + string 2"},{"odata.etag":"W/\"datetime''2021-04-05T05%3A02%3A38.6866808Z''\"","PartitionKey":"partition","RowKey":"3","Timestamp":"2021-04-05T05:02:38.6866808Z","BoolProp":true,"IntProp":3,"StringProp":"some + string 3"},{"odata.etag":"W/\"datetime''2021-04-05T05%3A02%3A38.7727417Z''\"","PartitionKey":"partition","RowKey":"4","Timestamp":"2021-04-05T05:02:38.7727417Z","BoolProp":true,"IntProp":4,"StringProp":"some + string 4"}]}' + headers: + Cache-Control: + - no-cache + Content-Type: + - application/json;odata=minimalmetadata;streaming=true;charset=utf-8 + Date: + - Mon, 05 Apr 2021 05:02:38 GMT + Server: + - Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0 + X-Content-Type-Options: + - nosniff + X-Ms-Request-Id: + - 95cfebfe-e002-0019-5ed8-29b4af000000 + 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-tables/ azsdk-go-tables/ azcore/v0.13.4 (go1.16.2; + Windows_NT) + X-Ms-Date: + - Mon, 05 Apr 2021 05:02:39 GMT + X-Ms-Version: + - "2019-02-02" + url: https://chrisstablesprim.table.core.windows.net/Tables('gotablev9ymy16fzote2') + method: DELETE + response: + body: "" + headers: + Cache-Control: + - no-cache + Content-Length: + - "0" + Date: + - Mon, 05 Apr 2021 05:02:38 GMT + Server: + - Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0 + X-Content-Type-Options: + - nosniff + X-Ms-Request-Id: + - 95cfec00-e002-0019-60d8-29b4af000000 + X-Ms-Version: + - "2019-02-02" + status: 204 No Content + code: 204 + duration: "" diff --git a/sdk/tables/aztables/recordings/TestTableClient_Storage/TestServiceErrors-variables.yaml b/sdk/tables/aztables/recordings/TestTableClient_Storage/TestServiceErrors-variables.yaml new file mode 100644 index 000000000000..db3e9cbbe8a7 --- /dev/null +++ b/sdk/tables/aztables/recordings/TestTableClient_Storage/TestServiceErrors-variables.yaml @@ -0,0 +1,5 @@ +--- +STORAGE_ENDPOINT_SUFFIX: core.windows.net +TABLES_PRIMARY_STORAGE_ACCOUNT_KEY: Kg== +TABLES_STORAGE_ACCOUNT_NAME: chrisstablesprim +randomSeed: "1617580013" diff --git a/sdk/tables/aztables/recordings/TestTableClient_Storage/TestServiceErrors.yaml b/sdk/tables/aztables/recordings/TestTableClient_Storage/TestServiceErrors.yaml new file mode 100644 index 000000000000..65a3e042f9f4 --- /dev/null +++ b/sdk/tables/aztables/recordings/TestTableClient_Storage/TestServiceErrors.yaml @@ -0,0 +1,129 @@ +--- +version: 1 +interactions: +- request: + body: '{"TableName":"gotable4gghmbc0umbca"}' + form: {} + headers: + Accept: + - application/json;odata=minimalmetadata + Authorization: + - sanitized + Content-Length: + - "36" + Content-Type: + - application/json + Dataserviceversion: + - "3.0" + User-Agent: + - azsdk-go-tables/ azsdk-go-tables/ azcore/v0.13.4 (go1.16.2; + Windows_NT) + X-Ms-Date: + - Sun, 04 Apr 2021 23:46:53 GMT + X-Ms-Version: + - "2019-02-02" + url: https://chrisstablesprim.table.core.windows.net/Tables + method: POST + response: + body: '{"odata.metadata":"https://chrisstablesprim.table.core.windows.net/$metadata#Tables/@Element","TableName":"gotable4gghmbc0umbca"}' + headers: + Cache-Control: + - no-cache + Content-Type: + - application/json;odata=minimalmetadata;streaming=true;charset=utf-8 + Date: + - Sun, 04 Apr 2021 23:46:53 GMT + Location: + - https://chrisstablesprim.table.core.windows.net/Tables('gotable4gghmbc0umbca') + Server: + - Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0 + X-Content-Type-Options: + - nosniff + X-Ms-Request-Id: + - 89afb2ba-b002-0066-1aac-297b34000000 + X-Ms-Version: + - "2019-02-02" + status: 201 Created + code: 201 + duration: "" +- request: + body: '{"TableName":"gotable4gghmbc0umbca"}' + form: {} + headers: + Accept: + - application/json;odata=minimalmetadata + Authorization: + - sanitized + Content-Length: + - "36" + Content-Type: + - application/json + Dataserviceversion: + - "3.0" + User-Agent: + - azsdk-go-tables/ azsdk-go-tables/ azcore/v0.13.4 (go1.16.2; + Windows_NT) + X-Ms-Date: + - Sun, 04 Apr 2021 23:46:54 GMT + X-Ms-Version: + - "2019-02-02" + url: https://chrisstablesprim.table.core.windows.net/Tables + method: POST + response: + body: '{"odata.error":{"code":"TableAlreadyExists","message":{"lang":"en-US","value":"The + table specified already exists.\nRequestId:89afb2c5-b002-0066-23ac-297b34000000\nTime:2021-04-04T23:46:53.9829008Z"}}}' + headers: + Cache-Control: + - no-cache + Content-Type: + - application/json;odata=minimalmetadata;streaming=true;charset=utf-8 + Date: + - Sun, 04 Apr 2021 23:46:53 GMT + Server: + - Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0 + X-Content-Type-Options: + - nosniff + X-Ms-Request-Id: + - 89afb2c5-b002-0066-23ac-297b34000000 + X-Ms-Version: + - "2019-02-02" + status: 409 Conflict + code: 409 + duration: "" +- request: + body: "" + form: {} + headers: + Accept: + - application/json + Authorization: + - sanitized + User-Agent: + - azsdk-go-tables/ azsdk-go-tables/ azcore/v0.13.4 (go1.16.2; + Windows_NT) + X-Ms-Date: + - Sun, 04 Apr 2021 23:46:54 GMT + X-Ms-Version: + - "2019-02-02" + url: https://chrisstablesprim.table.core.windows.net/Tables('gotable4gghmbc0umbca') + method: DELETE + response: + body: "" + headers: + Cache-Control: + - no-cache + Content-Length: + - "0" + Date: + - Sun, 04 Apr 2021 23:46:53 GMT + Server: + - Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0 + X-Content-Type-Options: + - nosniff + X-Ms-Request-Id: + - 89afb2cd-b002-0066-2aac-297b34000000 + X-Ms-Version: + - "2019-02-02" + status: 204 No Content + code: 204 + duration: "" diff --git a/sdk/tables/aztables/recordings/TestTableClient_Storage/TestUpsertEntity-variables.yaml b/sdk/tables/aztables/recordings/TestTableClient_Storage/TestUpsertEntity-variables.yaml new file mode 100644 index 000000000000..0d48c901e16e --- /dev/null +++ b/sdk/tables/aztables/recordings/TestTableClient_Storage/TestUpsertEntity-variables.yaml @@ -0,0 +1,5 @@ +--- +STORAGE_ENDPOINT_SUFFIX: core.windows.net +TABLES_PRIMARY_STORAGE_ACCOUNT_KEY: Kg== +TABLES_STORAGE_ACCOUNT_NAME: chrisstablesprim +randomSeed: "1621629298" diff --git a/sdk/tables/aztables/recordings/TestTableClient_Storage/TestUpsertEntity.yaml b/sdk/tables/aztables/recordings/TestTableClient_Storage/TestUpsertEntity.yaml new file mode 100644 index 000000000000..a051ad2e5f87 --- /dev/null +++ b/sdk/tables/aztables/recordings/TestTableClient_Storage/TestUpsertEntity.yaml @@ -0,0 +1,255 @@ +--- +version: 1 +interactions: +- request: + body: '{"TableName":"gotableybpwrxkkatqur"}' + form: {} + headers: + Accept: + - application/json;odata=minimalmetadata + Authorization: + - sanitized + Content-Length: + - "36" + Content-Type: + - application/json + Dataserviceversion: + - "3.0" + User-Agent: + - azsdk-go-tables/ azsdk-go-tables/ azcore/v0.16.1 (go1.16.2; + Windows_NT) + X-Ms-Date: + - Fri, 21 May 2021 20:34:58 GMT + X-Ms-Version: + - "2019-02-02" + url: https://chrisstablesprim.table.core.windows.net/Tables + method: POST + response: + body: '{"odata.metadata":"https://chrisstablesprim.table.core.windows.net/$metadata#Tables/@Element","TableName":"gotableybpwrxkkatqur"}' + headers: + Cache-Control: + - no-cache + Content-Type: + - application/json;odata=minimalmetadata;streaming=true;charset=utf-8 + Date: + - Fri, 21 May 2021 20:34:58 GMT + Location: + - https://chrisstablesprim.table.core.windows.net/Tables('gotableybpwrxkkatqur') + Server: + - Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0 + X-Content-Type-Options: + - nosniff + X-Ms-Request-Id: + - c1ecaa3f-8002-0030-1d80-4e8adb000000 + X-Ms-Version: + - "2019-02-02" + status: 201 Created + code: 201 + duration: "" +- request: + body: '{"BoolProp":true,"IntProp":1,"PartitionKey":"partition","RowKey":"1","StringProp":"some + string 1"}' + form: {} + headers: + Accept: + - application/json + Authorization: + - sanitized + Content-Length: + - "98" + Content-Type: + - application/json + Dataserviceversion: + - "3.0" + User-Agent: + - azsdk-go-tables/ azsdk-go-tables/ azcore/v0.16.1 (go1.16.2; + Windows_NT) + X-Ms-Date: + - Fri, 21 May 2021 20:34:59 GMT + X-Ms-Version: + - "2019-02-02" + url: https://chrisstablesprim.table.core.windows.net/gotableybpwrxkkatqur(PartitionKey='partition',RowKey='1') + method: PUT + response: + body: "" + headers: + Cache-Control: + - no-cache + Content-Length: + - "0" + Date: + - Fri, 21 May 2021 20:34:58 GMT + Etag: + - W/"datetime'2021-05-21T20%3A34%3A59.5369667Z'" + Server: + - Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0 + X-Content-Type-Options: + - nosniff + X-Ms-Request-Id: + - c1ecaa49-8002-0030-2380-4e8adb000000 + 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-tables/ azsdk-go-tables/ azcore/v0.16.1 (go1.16.2; + Windows_NT) + X-Ms-Date: + - Fri, 21 May 2021 20:34:59 GMT + X-Ms-Version: + - "2019-02-02" + url: https://chrisstablesprim.table.core.windows.net/gotableybpwrxkkatqur()?%24filter=RowKey+eq+%271%27 + method: GET + response: + body: '{"odata.metadata":"https://chrisstablesprim.table.core.windows.net/$metadata#gotableybpwrxkkatqur","value":[{"odata.etag":"W/\"datetime''2021-05-21T20%3A34%3A59.5369667Z''\"","PartitionKey":"partition","RowKey":"1","Timestamp":"2021-05-21T20:34:59.5369667Z","BoolProp":true,"IntProp":1,"StringProp":"some + string 1"}]}' + headers: + Cache-Control: + - no-cache + Content-Type: + - application/json;odata=minimalmetadata;streaming=true;charset=utf-8 + Date: + - Fri, 21 May 2021 20:34:58 GMT + Server: + - Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0 + X-Content-Type-Options: + - nosniff + X-Ms-Request-Id: + - c1ecaa4c-8002-0030-2580-4e8adb000000 + X-Ms-Version: + - "2019-02-02" + status: 200 OK + code: 200 + duration: "" +- request: + body: '{"MergeProperty":"foo","PartitionKey":"partition","RowKey":"1"}' + form: {} + headers: + Accept: + - application/json + Authorization: + - sanitized + Content-Length: + - "63" + Content-Type: + - application/json + Dataserviceversion: + - "3.0" + User-Agent: + - azsdk-go-tables/ azsdk-go-tables/ azcore/v0.16.1 (go1.16.2; + Windows_NT) + X-Ms-Date: + - Fri, 21 May 2021 20:34:59 GMT + X-Ms-Version: + - "2019-02-02" + url: https://chrisstablesprim.table.core.windows.net/gotableybpwrxkkatqur(PartitionKey='partition',RowKey='1') + method: PUT + response: + body: "" + headers: + Cache-Control: + - no-cache + Content-Length: + - "0" + Date: + - Fri, 21 May 2021 20:34:58 GMT + Etag: + - W/"datetime'2021-05-21T20%3A34%3A59.6890733Z'" + Server: + - Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0 + X-Content-Type-Options: + - nosniff + X-Ms-Request-Id: + - c1ecaa52-8002-0030-2b80-4e8adb000000 + 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-tables/ azsdk-go-tables/ azcore/v0.16.1 (go1.16.2; + Windows_NT) + X-Ms-Date: + - Fri, 21 May 2021 20:34:59 GMT + X-Ms-Version: + - "2019-02-02" + url: https://chrisstablesprim.table.core.windows.net/gotableybpwrxkkatqur()?%24filter=RowKey+eq+%271%27 + method: GET + response: + body: '{"odata.metadata":"https://chrisstablesprim.table.core.windows.net/$metadata#gotableybpwrxkkatqur","value":[{"odata.etag":"W/\"datetime''2021-05-21T20%3A34%3A59.6890733Z''\"","PartitionKey":"partition","RowKey":"1","Timestamp":"2021-05-21T20:34:59.6890733Z","MergeProperty":"foo"}]}' + headers: + Cache-Control: + - no-cache + Content-Type: + - application/json;odata=minimalmetadata;streaming=true;charset=utf-8 + Date: + - Fri, 21 May 2021 20:34:58 GMT + Server: + - Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0 + X-Content-Type-Options: + - nosniff + X-Ms-Request-Id: + - c1ecaa53-8002-0030-2c80-4e8adb000000 + 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-tables/ azsdk-go-tables/ azcore/v0.16.1 (go1.16.2; + Windows_NT) + X-Ms-Date: + - Fri, 21 May 2021 20:34:59 GMT + X-Ms-Version: + - "2019-02-02" + url: https://chrisstablesprim.table.core.windows.net/Tables('gotableybpwrxkkatqur') + method: DELETE + response: + body: "" + headers: + Cache-Control: + - no-cache + Content-Length: + - "0" + Date: + - Fri, 21 May 2021 20:34:58 GMT + Server: + - Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0 + X-Content-Type-Options: + - nosniff + X-Ms-Request-Id: + - c1ecaa59-8002-0030-3180-4e8adb000000 + X-Ms-Version: + - "2019-02-02" + status: 204 No Content + code: 204 + duration: "" diff --git a/sdk/tables/aztables/tableClient.go b/sdk/tables/aztables/tableClient.go deleted file mode 100644 index d24ae0a14931..000000000000 --- a/sdk/tables/aztables/tableClient.go +++ /dev/null @@ -1,40 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package aztables - -import ( - "context" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore" -) - -// A TableClient represents a URL to an Azure Storage blob; the blob may be a block blob, append blob, or page blob. -type TableClient struct { - client *tableClient - cred SharedKeyCredential -} - -// NewTableClient creates a TableClient object using the specified URL and request policy pipeline. -func NewTableClient(serviceURL string, cred azcore.Credential, options *TableClientOptions) (*TableClient, error) { - con := newConnection(serviceURL, cred, options.getConnectionOptions()) - - c, _ := cred.(*SharedKeyCredential) - - return &TableClient{client: &tableClient{con}, cred: *c}, nil -} - -// Create -func (t TableClient) Create(ctx context.Context, name string) (TableResponseResponse, error) { - resp, err := t.client.Create(ctx, TableProperties{&name}, nil, nil) - if resp == nil { - return TableResponseResponse{}, err - } else { - return resp.(TableResponseResponse), err - } -} - -// Delete -func (t TableClient) Delete(ctx context.Context, name string) (TableDeleteResponse, error) { - return t.client.Delete(ctx, name, nil) -} diff --git a/sdk/tables/aztables/tableClient_test.go b/sdk/tables/aztables/tableClient_test.go deleted file mode 100644 index 45b97edc2d47..000000000000 --- a/sdk/tables/aztables/tableClient_test.go +++ /dev/null @@ -1,18 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package aztables - -import ( - "testing" -) - -func TestContainerCreateAccessContainer(t *testing.T) { - // TODO - cred, err := NewSharedKeyCredential("foo", "Kg==") - if err != nil { - t.Fatal(err) - } - - NewTableClient("https://foo", cred, &TableClientOptions{}) -} diff --git a/sdk/tables/aztables/table_client.go b/sdk/tables/aztables/table_client.go new file mode 100644 index 000000000000..ec4a3e16819c --- /dev/null +++ b/sdk/tables/aztables/table_client.go @@ -0,0 +1,129 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +package aztables + +import ( + "context" + "errors" + + "github.com/Azure/azure-sdk-for-go/sdk/azcore" + "github.com/Azure/azure-sdk-for-go/sdk/internal/runtime" +) + +// A TableClient represents a URL to an Azure Storage blob; the blob may be a block blob, append blob, or page blob. +type TableClient struct { + client *tableClient + service *TableServiceClient + cred SharedKeyCredential + Name string +} + +type TableUpdateMode string + +const ( + Replace TableUpdateMode = "replace" + Merge TableUpdateMode = "merge" +) + +// NewTableClient creates a TableClient object using the specified URL and request policy pipeline. +func NewTableClient(tableName string, serviceURL string, cred azcore.Credential, options *TableClientOptions) (*TableClient, error) { + s, err := NewTableServiceClient(serviceURL, cred, options) + return s.GetTableClient(tableName), err +} + +// Create creates the table with the name specified in NewTableClient +func (t *TableClient) Create(ctx context.Context) (*TableResponseResponse, *runtime.ResponseError) { + return t.service.Create(ctx, t.Name) +} + +// Delete deletes the current table +func (t *TableClient) Delete(ctx context.Context) (*TableDeleteResponse, *runtime.ResponseError) { + return t.service.Delete(ctx, t.Name) +} + +// Query queries the tables using the specified QueryOptions +func (t *TableClient) Query(queryOptions QueryOptions) TableEntityQueryResponsePager { + return &tableEntityQueryResponsePager{tableClient: t, queryOptions: &queryOptions, tableQueryOptions: &TableQueryEntitiesOptions{}} +} + +// QueryAsModel queries the table using the specified QueryOptions and attempts to serialize the response as the supplied interface type +func (t *TableClient) QueryAsModel(opt QueryOptions, s FromMapper) StructEntityQueryResponsePager { + return &structQueryResponsePager{mapper: s, tableClient: t, queryOptions: &opt, tableQueryOptions: &TableQueryEntitiesOptions{}} +} + +func (t *TableClient) GetEntity(ctx context.Context, partitionKey string, rowKey string) (MapOfInterfaceResponse, error) { + resp, err := t.client.QueryEntityWithPartitionAndRowKey(ctx, t.Name, partitionKey, rowKey, &TableQueryEntityWithPartitionAndRowKeyOptions{}, &QueryOptions{}) + if err != nil { + return resp, err + } + castAndRemoveAnnotations(&resp.Value) + return resp, err +} + +// AddEntity Creates an entity from a map value. +func (t *TableClient) AddEntity(ctx context.Context, entity map[string]interface{}) (*TableInsertEntityResponse, *runtime.ResponseError) { + toOdataAnnotatedDictionary(&entity) + resp, err := t.client.InsertEntity(ctx, t.Name, &TableInsertEntityOptions{TableEntityProperties: entity, ResponsePreference: ResponseFormatReturnNoContent.ToPtr()}, &QueryOptions{}) + if err == nil { + insertResp := resp.(TableInsertEntityResponse) + return &insertResp, nil + } else { + return nil, convertErr(err) + } +} + +// AddModelEntity creates an entity from an arbitrary struct value. +func (t *TableClient) AddModelEntity(ctx context.Context, entity interface{}) (*TableInsertEntityResponse, *runtime.ResponseError) { + entmap, err := toMap(entity) + if err != nil { + return nil, azcore.NewResponseError(err, nil).(*runtime.ResponseError) + } + resp, err := t.client.InsertEntity(ctx, t.Name, &TableInsertEntityOptions{TableEntityProperties: *entmap, ResponsePreference: ResponseFormatReturnNoContent.ToPtr()}, &QueryOptions{}) + if err == nil { + insertResp := resp.(TableInsertEntityResponse) + return &insertResp, nil + } else { + return nil, convertErr(err) + } +} + +func (t *TableClient) DeleteEntity(ctx context.Context, partitionKey string, rowKey string, etag string) (TableDeleteEntityResponse, error) { + return t.client.DeleteEntity(ctx, t.Name, partitionKey, rowKey, etag, nil, &QueryOptions{}) +} + +// UpdateEntity updates the specified table entity if it exists. +// If updateMode is Replace, the entity will be replaced. +// If updateMode is Merge, the property values present in the specified entity will be merged with the existing entity. +// The response type will be TableEntityMergeResponse if updateMode is Merge and TableEntityUpdateResponse if updateMode is Replace. +func (t *TableClient) UpdateEntity(ctx context.Context, entity map[string]interface{}, etag *string, updateMode TableUpdateMode) (interface{}, error) { + pk := entity[partitionKey].(string) + rk := entity[rowKey].(string) + var ifMatch string = "*" + if etag != nil { + ifMatch = *etag + } + switch updateMode { + case Merge: + return t.client.MergeEntity(ctx, t.Name, pk, rk, &TableMergeEntityOptions{IfMatch: &ifMatch, TableEntityProperties: entity}, &QueryOptions{}) + case Replace: + return t.client.UpdateEntity(ctx, t.Name, pk, rk, &TableUpdateEntityOptions{IfMatch: &ifMatch, TableEntityProperties: entity}, &QueryOptions{}) + } + return nil, errors.New("Invalid TableUpdateMode") +} + +// UpsertEntity replaces the specified table entity if it exists or creates the entity if it does not exist. +// If the entity exists and updateMode is Merge, the property values present in the specified entity will be merged with the existing entity rather than replaced. +// The response type will be TableEntityMergeResponse if updateMode is Merge and TableEntityUpdateResponse if updateMode is Replace. +func (t *TableClient) UpsertEntity(ctx context.Context, entity map[string]interface{}, updateMode TableUpdateMode) (interface{}, error) { + pk := entity[partitionKey].(string) + rk := entity[rowKey].(string) + + switch updateMode { + case Merge: + return t.client.MergeEntity(ctx, t.Name, pk, rk, &TableMergeEntityOptions{TableEntityProperties: entity}, &QueryOptions{}) + case Replace: + return t.client.UpdateEntity(ctx, t.Name, pk, rk, &TableUpdateEntityOptions{TableEntityProperties: entity}, &QueryOptions{}) + } + return nil, errors.New("Invalid TableUpdateMode") +} diff --git a/sdk/tables/aztables/table_client_test.go b/sdk/tables/aztables/table_client_test.go new file mode 100644 index 000000000000..3d07b0cba508 --- /dev/null +++ b/sdk/tables/aztables/table_client_test.go @@ -0,0 +1,489 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +package aztables + +import ( + "bytes" + "io/ioutil" + "net/http" + "testing" + "time" + + "github.com/Azure/azure-sdk-for-go/sdk/internal/runtime" + "github.com/Azure/azure-sdk-for-go/sdk/internal/testframework" + "github.com/Azure/azure-sdk-for-go/sdk/internal/uuid" + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" + "github.com/stretchr/testify/suite" +) + +type tableClientLiveTests struct { + suite.Suite + endpointType EndpointType + mode testframework.RecordMode +} + +// Hookup to the testing framework +func TestTableClient_Storage(t *testing.T) { + storage := tableClientLiveTests{endpointType: StorageEndpoint, mode: testframework.Playback /* change to Record to re-record tests */} + suite.Run(t, &storage) +} + +// Hookup to the testing framework +func TestTableClient_Cosmos(t *testing.T) { + cosmos := tableClientLiveTests{endpointType: CosmosEndpoint, mode: testframework.Playback /* change to Record to re-record tests */} + suite.Run(t, &cosmos) +} + +func (s *tableClientLiveTests) TestServiceErrors() { + client, delete := s.init(true) + defer delete() + + // Create a duplicate table to produce an error + _, err := client.Create(ctx) + assert.Equal(s.T(), err.RawResponse().StatusCode, http.StatusConflict) +} + +func (s *tableClientLiveTests) TestCreateTable() { + assert := assert.New(s.T()) + client, delete := s.init(false) + defer delete() + + resp, err := client.Create(ctx) + + assert.Nil(err) + assert.Equal(*resp.TableResponse.TableName, client.Name) +} + +func (s *tableClientLiveTests) TestAddEntity() { + assert := assert.New(s.T()) + client, delete := s.init(true) + defer delete() + + entitiesToCreate := createSimpleEntities(1, "partition") + + _, err := client.AddEntity(ctx, (*entitiesToCreate)[0]) + assert.Nil(err) +} + +func (s *tableClientLiveTests) TestAddComplexEntity() { + assert := assert.New(s.T()) + context := getTestContext(s.T().Name()) + client, delete := s.init(true) + defer delete() + + entitiesToCreate := createComplexEntities(context, 1, "partition") + + for _, e := range *entitiesToCreate { + _, err := client.AddModelEntity(ctx, e) + assert.Nilf(err, getStringFromBody(err)) + } +} + +func (s *tableClientLiveTests) TestDeleteEntity() { + assert := assert.New(s.T()) + client, delete := s.init(true) + defer delete() + + entitiesToCreate := createSimpleEntities(1, "partition") + + _, err := client.AddEntity(ctx, (*entitiesToCreate)[0]) + assert.Nil(err) + _, delErr := client.DeleteEntity(ctx, (*entitiesToCreate)[0][partitionKey].(string), (*entitiesToCreate)[0][rowKey].(string), "*") + assert.Nil(delErr) +} + +func (s *tableClientLiveTests) TestMergeEntity() { + assert := assert.New(s.T()) + client, delete := s.init(true) + defer delete() + + entitiesToCreate := createSimpleEntities(1, "partition") + + _, err := client.AddEntity(ctx, (*entitiesToCreate)[0]) + assert.Nil(err) + + var qResp TableEntityQueryResponseResponse + filter := "RowKey eq '1'" + pager := client.Query(QueryOptions{Filter: &filter}) + for pager.NextPage(ctx) { + qResp = pager.PageResponse() + } + preMerge := qResp.TableEntityQueryResponse.Value[0] + + mergeProp := "MergeProperty" + val := "foo" + var mergeProperty = map[string]interface{}{ + partitionKey: (*entitiesToCreate)[0][partitionKey], + rowKey: (*entitiesToCreate)[0][rowKey], + mergeProp: val, + } + + _, updateErr := client.UpdateEntity(ctx, mergeProperty, nil, Merge) + assert.Nil(updateErr) + + pager = client.Query(QueryOptions{Filter: &filter}) + for pager.NextPage(ctx) { + qResp = pager.PageResponse() + } + postMerge := qResp.TableEntityQueryResponse.Value[0] + + // The merged entity has all its properties + the merged property + assert.Equalf(len(preMerge)+1, len(postMerge), "postMerge should have one more property than preMerge") + assert.Equalf(postMerge[mergeProp], val, "%s property should equal %s", mergeProp, val) +} + +func (s *tableClientLiveTests) TestUpsertEntity() { + assert := assert.New(s.T()) + require := require.New(s.T()) + client, delete := s.init(true) + defer delete() + + entitiesToCreate := createSimpleEntities(1, "partition") + + _, err := client.UpsertEntity(ctx, (*entitiesToCreate)[0], Replace) + require.Nil(err) + + var qResp TableEntityQueryResponseResponse + filter := "RowKey eq '1'" + pager := client.Query(QueryOptions{Filter: &filter}) + for pager.NextPage(ctx) { + qResp = pager.PageResponse() + } + preMerge := qResp.TableEntityQueryResponse.Value[0] + + mergeProp := "MergeProperty" + val := "foo" + var mergeProperty = map[string]interface{}{ + partitionKey: (*entitiesToCreate)[0][partitionKey], + rowKey: (*entitiesToCreate)[0][rowKey], + mergeProp: val, + } + + _, updateErr := client.UpsertEntity(ctx, mergeProperty, Replace) + require.Nil(updateErr) + + pager = client.Query(QueryOptions{Filter: &filter}) + for pager.NextPage(ctx) { + qResp = pager.PageResponse() + } + postMerge := qResp.TableEntityQueryResponse.Value[0] + + // The merged entity has only the standard properties + the merged property + assert.Greater(len(preMerge), len(postMerge), "postMerge should have fewer properties than preMerge") + assert.Equalf(postMerge[mergeProp], val, "%s property should equal %s", mergeProp, val) +} + +func (s *tableClientLiveTests) _TestGetEntity() { + assert := assert.New(s.T()) + require := require.New(s.T()) + client, delete := s.init(true) + defer delete() + + // Add 5 entities + entitiesToCreate := createSimpleEntities(1, "partition") + for _, e := range *entitiesToCreate { + _, err := client.AddEntity(ctx, e) + assert.Nil(err) + } + + resp, err := client.GetEntity(ctx, "partition", "1") + require.Nil(err) + e := resp.Value + _, ok := e[partitionKey].(string) + assert.True(ok) + _, ok = e[rowKey].(string) + assert.True(ok) + _, ok = e[timestamp].(string) + assert.True(ok) + _, ok = e[etagOdata].(string) + assert.True(ok) + _, ok = e["StringProp"].(string) + assert.True(ok) + //TODO: fix when serialization is implemented + _, ok = e["IntProp"].(float64) + assert.True(ok) + _, ok = e["BoolProp"].(bool) + assert.True(ok) +} + +func (s *tableClientLiveTests) TestQuerySimpleEntity() { + assert := assert.New(s.T()) + client, delete := s.init(true) + defer delete() + + // Add 5 entities + entitiesToCreate := createSimpleEntities(5, "partition") + for _, e := range *entitiesToCreate { + _, err := client.AddEntity(ctx, e) + assert.Nil(err) + } + + filter := "RowKey lt '5'" + expectedCount := 4 + var resp TableEntityQueryResponseResponse + pager := client.Query(QueryOptions{Filter: &filter}) + for pager.NextPage(ctx) { + resp = pager.PageResponse() + assert.Equal(len(resp.TableEntityQueryResponse.Value), expectedCount) + } + resp = pager.PageResponse() + assert.Nil(pager.Err()) + for _, e := range resp.TableEntityQueryResponse.Value { + _, ok := e[partitionKey].(string) + assert.True(ok) + _, ok = e[rowKey].(string) + assert.True(ok) + _, ok = e[timestamp].(string) + assert.True(ok) + _, ok = e[etagOdata].(string) + assert.True(ok) + _, ok = e["StringProp"].(string) + assert.True(ok) + //TODO: fix when serialization is implemented + _, ok = e["IntProp"].(float64) + assert.True(ok) + _, ok = e["BoolProp"].(bool) + assert.True(ok) + } +} + +func (s *tableClientLiveTests) TestQueryComplexEntity() { + assert := assert.New(s.T()) + context := getTestContext(s.T().Name()) + client, delete := s.init(true) + defer delete() + + // Add 5 entities + entitiesToCreate := createComplexMapEntities(context, 5, "partition") + for _, e := range *entitiesToCreate { + _, err := client.AddEntity(ctx, e) + assert.Nil(err) + } + + filter := "RowKey lt '5'" + expectedCount := 4 + var resp TableEntityQueryResponseResponse + pager := client.Query(QueryOptions{Filter: &filter}) + for pager.NextPage(ctx) { + resp = pager.PageResponse() + assert.Equal(expectedCount, len(resp.TableEntityQueryResponse.Value)) + } + resp = pager.PageResponse() + assert.Nil(pager.Err()) + for _, e := range resp.TableEntityQueryResponse.Value { + _, ok := e[partitionKey].(string) + assert.True(ok) + _, ok = e[rowKey].(string) + assert.True(ok) + _, ok = e[timestamp].(string) + assert.True(ok) + _, ok = e[etagOdata].(string) + assert.True(ok) + _, ok = e["StringProp"].(string) + assert.True(ok) + //TODO: fix when serialization is implemented + _, ok = e["IntProp"].(float64) + assert.True(ok) + _, ok = e["BoolProp"].(bool) + assert.True(ok) + _, ok = e["SomeBinaryProperty"].([]byte) + assert.True(ok) + _, ok = e["SomeDateProperty"].(time.Time) + assert.True(ok) + _, ok = e["SomeDoubleProperty0"].(float64) + assert.True(ok) + _, ok = e["SomeDoubleProperty1"].(float64) + assert.True(ok) + _, ok = e["SomeGuidProperty"].(uuid.UUID) + assert.True(ok) + _, ok = e["SomeInt64Property"].(int64) + assert.True(ok) + //TODO: fix when serialization is implemented + _, ok = e["SomeIntProperty"].(float64) + assert.True(ok) + _, ok = e["SomeStringProperty"].(string) + assert.True(ok) + } +} + +func (s *tableClientLiveTests) TestBatchAdd() { + assert := assert.New(s.T()) + context := getTestContext(s.T().Name()) + client, delete := s.init(true) + defer delete() + + entitiesToCreate := createComplexMapEntities(context, 10, "partition") + batch := make([]TableTransactionAction, 10) + + for i, e := range *entitiesToCreate { + batch[i] = TableTransactionAction{ActionType: Add, Entity: e} + } + + resp, err := client.submitTransactionInternal(ctx, &batch, context.recording.UUID(), context.recording.UUID(), nil) + assert.Nil(err) + for i := 0; i < len(*resp.TransactionResponses); i++ { + r := (*resp.TransactionResponses)[i] + assert.Equal(r.StatusCode, http.StatusNoContent) + } +} + +func (s *tableClientLiveTests) TestBatchMixed() { + assert := assert.New(s.T()) + require := require.New(s.T()) + context := getTestContext(s.T().Name()) + client, delete := s.init(true) + defer delete() + + entitiesToCreate := createComplexMapEntities(context, 5, "partition") + batch := make([]TableTransactionAction, 3) + + // Add the first 3 entities. + for i := range batch { + batch[i] = TableTransactionAction{ActionType: Add, Entity: (*entitiesToCreate)[i]} + } + + resp, err := client.submitTransactionInternal(ctx, &batch, context.recording.UUID(), context.recording.UUID(), nil) + require.Nil(err) + for i := 0; i < len(*resp.TransactionResponses); i++ { + r := (*resp.TransactionResponses)[i] + assert.Equal(http.StatusNoContent, r.StatusCode) + } + + var qResp TableEntityQueryResponseResponse + filter := "RowKey eq '1'" + pager := client.Query(QueryOptions{Filter: &filter}) + for pager.NextPage(ctx) { + qResp = pager.PageResponse() + } + preMerge := qResp.TableEntityQueryResponse.Value[0] + + // create a new batch slice. + batch = make([]TableTransactionAction, 5) + + // create a merge action for the first added entity + mergeProp := "MergeProperty" + val := "foo" + var mergeProperty = map[string]interface{}{ + partitionKey: (*entitiesToCreate)[0][partitionKey], + rowKey: (*entitiesToCreate)[0][rowKey], + mergeProp: val, + } + batch[0] = TableTransactionAction{ActionType: UpdateMerge, Entity: mergeProperty, ETag: (*resp.TransactionResponses)[0].Header.Get(etag)} + + // create a delete action for the second added entity + batch[1] = TableTransactionAction{ActionType: Delete, Entity: (*entitiesToCreate)[1]} + + // create an upsert action to replace the third added entity with a new value + replaceProp := "ReplaceProperty" + var replaceProperties = map[string]interface{}{ + partitionKey: (*entitiesToCreate)[2][partitionKey], + rowKey: (*entitiesToCreate)[2][rowKey], + replaceProp: val, + } + batch[2] = TableTransactionAction{ActionType: UpsertReplace, Entity: replaceProperties} + + // Add the remaining 2 entities. + batch[3] = TableTransactionAction{ActionType: Add, Entity: (*entitiesToCreate)[3]} + batch[4] = TableTransactionAction{ActionType: Add, Entity: (*entitiesToCreate)[4]} + + //batch = batch[1:] + + resp, err = client.submitTransactionInternal(ctx, &batch, context.recording.UUID(), context.recording.UUID(), nil) + require.Nil(err) + + for i := 0; i < len(*resp.TransactionResponses); i++ { + r := (*resp.TransactionResponses)[i] + assert.Equal(http.StatusNoContent, r.StatusCode) + + } + + pager = client.Query(QueryOptions{Filter: &filter}) + for pager.NextPage(ctx) { + qResp = pager.PageResponse() + } + postMerge := qResp.TableEntityQueryResponse.Value[0] + + // The merged entity has all its properties + the merged property + assert.Equalf(len(preMerge)+1, len(postMerge), "postMerge should have one more property than preMerge") + assert.Equalf(postMerge[mergeProp], val, "%s property should equal %s", mergeProp, val) +} + +func (s *tableClientLiveTests) TestBatchError() { + assert := assert.New(s.T()) + require := require.New(s.T()) + context := getTestContext(s.T().Name()) + client, delete := s.init(true) + defer delete() + + entitiesToCreate := createComplexMapEntities(context, 3, "partition") + + // Create the batch. + batch := make([]TableTransactionAction, 0, 3) + + // Sending an empty batch throws. + _, err := client.submitTransactionInternal(ctx, &batch, context.recording.UUID(), context.recording.UUID(), nil) + assert.NotNil(err) + assert.Equal(error_empty_transaction, err.Error()) + + // Add the last entity to the table prior to adding it as part of the batch to cause a batch failure. + client.AddEntity(ctx, (*entitiesToCreate)[2]) + + // Add the entities to the batch + for i := 0; i < cap(batch); i++ { + batch = append(batch, TableTransactionAction{ActionType: Add, Entity: (*entitiesToCreate)[i]}) + } + + resp, err := client.submitTransactionInternal(ctx, &batch, context.recording.UUID(), context.recording.UUID(), nil) + assert.NotNil(err) + te, ok := err.(*TableTransactionError) + require.Truef(ok, "err should be of type TableTransactionError") + assert.Equal("EntityAlreadyExists", te.OdataError.Code) + assert.Equal(2, te.FailedEntityIndex) + assert.Equal(http.StatusConflict, (*resp.TransactionResponses)[0].StatusCode) +} + +// setup the test environment +func (s *tableClientLiveTests) BeforeTest(suite string, test string) { + recordedTestSetup(s.T(), s.T().Name(), s.endpointType, s.mode) +} + +// teardown the test context +func (s *tableClientLiveTests) AfterTest(suite string, test string) { + recordedTestTeardown(s.T().Name()) +} + +func (s *tableClientLiveTests) init(doCreate bool) (*TableClient, func()) { + assert := assert.New(s.T()) + context := getTestContext(s.T().Name()) + tableName, _ := getTableName(context) + client := context.client.GetTableClient(tableName) + if doCreate { + _, err := client.Create(ctx) + if err != nil { + assert.FailNow(getStringFromBody(err)) + } + } + return client, func() { + client.Delete(ctx) + } +} + +func getStringFromBody(e *runtime.ResponseError) string { + if e == nil { + return "Error is nil" + } + r := e.RawResponse() + body := bytes.Buffer{} + b := r.Body + b.Close() + if b != nil { + _, err := body.ReadFrom(b) + if err != nil { + return "" + } + b = ioutil.NopCloser(&body) + } + return body.String() +} diff --git a/sdk/tables/aztables/table_pagers.go b/sdk/tables/aztables/table_pagers.go new file mode 100644 index 000000000000..d73de8a8f5c3 --- /dev/null +++ b/sdk/tables/aztables/table_pagers.go @@ -0,0 +1,442 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +package aztables + +import ( + "context" + "encoding/base64" + "errors" + "fmt" + "net/http" + "reflect" + "strconv" + "strings" + "time" + + "github.com/Azure/azure-sdk-for-go/sdk/internal/uuid" +) + +// Pager for Table entity queries +type TableEntityQueryResponsePager interface { + // NextPage returns true if the pager advanced to the next page. + // Returns false if there are no more pages or an error occurred. + NextPage(context.Context) bool + + // Page returns the current TableQueryResponseResponse. + PageResponse() TableEntityQueryResponseResponse + + // Err returns the last error encountered while paging. + Err() error +} + +type StructEntityQueryResponsePager interface { + NextPage(context.Context) bool + PageResponse() StructQueryResponseResponse + Err() error +} + +type StructQueryResponseResponse struct { + // ClientRequestID contains the information returned from the x-ms-client-request-id header response. + ClientRequestID *string + + // Date contains the information returned from the Date header response. + Date *time.Time + + // ETag contains the information returned from the ETag header response. + ETag *string + + // RawResponse contains the underlying HTTP response. + RawResponse *http.Response + + // RequestID contains the information returned from the x-ms-request-id header response. + RequestID *string + + // The properties for the table entity query response. + StructQueryResponse *StructQueryResponse + + // Version contains the information returned from the x-ms-version header response. + Version *string + + // XMSContinuationNextPartitionKey contains the information returned from the x-ms-continuation-NextPartitionKey header response. + XMSContinuationNextPartitionKey *string + + // XMSContinuationNextRowKey contains the information returned from the x-ms-continuation-NextRowKey header response. + XMSContinuationNextRowKey *string +} + +type StructQueryResponse struct { + // The metadata response of the table. + OdataMetadata *string `json:"odata.metadata,omitempty"` + + // List of table entities. + Value *[]interface{} `json:"value,omitempty"` +} + +type tableEntityQueryResponsePager struct { + tableClient *TableClient + current *TableEntityQueryResponseResponse + tableQueryOptions *TableQueryEntitiesOptions + queryOptions *QueryOptions + err error +} + +func (p *tableEntityQueryResponsePager) NextPage(ctx context.Context) bool { + if p.err != nil || (p.current != nil && p.current.XMSContinuationNextPartitionKey == nil && p.current.XMSContinuationNextRowKey == nil) { + return false + } + var resp TableEntityQueryResponseResponse + resp, p.err = p.tableClient.client.QueryEntities(ctx, p.tableClient.Name, p.tableQueryOptions, p.queryOptions) + castAndRemoveAnnotationsSlice(&resp.TableEntityQueryResponse.Value) + p.current = &resp + p.tableQueryOptions.NextPartitionKey = resp.XMSContinuationNextPartitionKey + p.tableQueryOptions.NextRowKey = resp.XMSContinuationNextRowKey + return p.err == nil && resp.TableEntityQueryResponse.Value != nil && len(resp.TableEntityQueryResponse.Value) > 0 +} + +func (p *tableEntityQueryResponsePager) PageResponse() TableEntityQueryResponseResponse { + return *p.current +} + +func (p *tableEntityQueryResponsePager) Err() error { + return p.err +} + +type structQueryResponsePager struct { + mapper FromMapper + tableClient *TableClient + current *StructQueryResponseResponse + tableQueryOptions *TableQueryEntitiesOptions + queryOptions *QueryOptions + err error +} + +func (p *structQueryResponsePager) NextPage(ctx context.Context) bool { + if p.err != nil || (p.current != nil && p.current.XMSContinuationNextPartitionKey == nil && p.current.XMSContinuationNextRowKey == nil) { + return false + } + var resp TableEntityQueryResponseResponse + resp, p.err = p.tableClient.client.QueryEntities(ctx, p.tableClient.Name, p.tableQueryOptions, p.queryOptions) + castAndRemoveAnnotationsSlice(&resp.TableEntityQueryResponse.Value) + //p.current = &resp + r := make([]interface{}, 0, len(resp.TableEntityQueryResponse.Value)) + for _, e := range resp.TableEntityQueryResponse.Value { + r = append(r, p.mapper.FromMap(&e)) + } + p.current = &StructQueryResponseResponse{StructQueryResponse: &StructQueryResponse{Value: &r}} + p.tableQueryOptions.NextPartitionKey = resp.XMSContinuationNextPartitionKey + p.tableQueryOptions.NextRowKey = resp.XMSContinuationNextRowKey + return p.err == nil && resp.TableEntityQueryResponse.Value != nil && len(resp.TableEntityQueryResponse.Value) > 0 +} + +func (p *structQueryResponsePager) PageResponse() StructQueryResponseResponse { + return *p.current +} + +func (p *structQueryResponsePager) Err() error { + return p.err +} + +// Pager for Table Queries +type TableQueryResponsePager interface { + // NextPage returns true if the pager advanced to the next page. + // Returns false if there are no more pages or an error occurred. + NextPage(context.Context) bool + + // Page returns the current TableQueryResponseResponse. + PageResponse() TableQueryResponseResponse + + // Err returns the last error encountered while paging. + Err() error +} + +type FromMapper interface { + FromMap(e *map[string]interface{}) interface{} +} + +type tableQueryResponsePager struct { + client *tableClient + current *TableQueryResponseResponse + tableQueryOptions *TableQueryOptions + queryOptions *QueryOptions + err error +} + +func (p *tableQueryResponsePager) NextPage(ctx context.Context) bool { + if p.err != nil || (p.current != nil && p.current.XMSContinuationNextTableName == nil) { + return false + } + var resp TableQueryResponseResponse + resp, p.err = p.client.Query(ctx, p.tableQueryOptions, p.queryOptions) + p.current = &resp + p.tableQueryOptions.NextTableName = resp.XMSContinuationNextTableName + return p.err == nil && resp.TableQueryResponse.Value != nil && len(resp.TableQueryResponse.Value) > 0 +} + +func (p *tableQueryResponsePager) PageResponse() TableQueryResponseResponse { + return *p.current +} + +func (p *tableQueryResponsePager) Err() error { + return p.err +} + +func castAndRemoveAnnotationsSlice(entities *[]map[string]interface{}) { + for _, e := range *entities { + castAndRemoveAnnotations(&e) + } +} + +// TODO: The default behavior of json.Unmarshal is to deserialize all json numbers as Float64. +// This can be a problem for table entities which store float and int differently +func castAndRemoveAnnotations(entity *map[string]interface{}) error { + //value := (*entity)["value"].([]interface{})[0].(map[string]interface{}) + value := *entity + for k, v := range value { + + iSuffix := strings.Index(k, OdataType) + if iSuffix > 0 { + // Get the name of the property that this odataType key describes. + valueKey := k[0:iSuffix] + // get the string value of the value at the valueKey + valAsString := value[valueKey].(string) + + switch v { + case edmBinary: + value[valueKey] = []byte(valAsString) + case edmDateTime: + t, err := time.Parse(ISO8601, valAsString) + if err != nil { + return err + } + value[valueKey] = t + case edmGuid: + value[valueKey] = uuid.Parse(valAsString) + case edmInt64: + i, err := strconv.ParseInt(valAsString, 10, 64) + if err != nil { + return err + } + value[valueKey] = i + default: + return errors.New(fmt.Sprintf("unsupported annotation found: %s", k)) + } + // remove the annotation key + delete(value, k) + } + } + return nil +} + +func toOdataAnnotatedDictionary(entity *map[string]interface{}) error { + entMap := *entity + for k, v := range entMap { + t := reflect.TypeOf(v) + Switch: + switch t.Kind() { + case reflect.Slice, reflect.Array: + if GetTypeArray(v) != reflect.TypeOf(byte(0)) { + return errors.New("arrays and slices must be of type byte") + } + // check if this is a uuid + uuidVal, ok := v.(uuid.UUID) + if ok { + entMap[k] = uuidVal.String() + entMap[odataType(k)] = edmGuid + } else { + entMap[odataType(k)] = edmBinary + b := v.([]byte) + entMap[k] = base64.StdEncoding.EncodeToString(b) + } + case reflect.Struct: + switch tn := reflect.TypeOf(v).String(); tn { + case "time.Time": + entMap[odataType(k)] = edmDateTime + time := v.(time.Time) + entMap[k] = time.UTC().Format(ISO8601) + continue + default: + return errors.New(fmt.Sprintf("Invalid struct for entity field '%s' of type '%s'", k, tn)) + } + case reflect.Float32, reflect.Float64: + entMap[odataType(k)] = edmDouble + case reflect.Int64: + entMap[odataType(k)] = edmInt64 + i64 := v.(int64) + entMap[k] = strconv.FormatInt(i64, 10) + case reflect.Ptr: + if v == nil { + // if the pointer is nil, ignore it. + continue + } + // follow the pointer to the type and re-run the switch + t = reflect.ValueOf(v).Elem().Type() + goto Switch + } + } + return nil +} + +func toMap(ent interface{}) (*map[string]interface{}, error) { + var s reflect.Value + if reflect.ValueOf(ent).Kind() == reflect.Ptr { + s = reflect.ValueOf(ent).Elem() + } else { + s = reflect.ValueOf(&ent).Elem().Elem() + } + typeOfT := s.Type() + nf := s.NumField() + entMap := make(map[string]interface{}, nf) + + for i := 0; i < nf; i++ { + v := s.Field(i) + Switch: + f := typeOfT.Field(i) + name := f.Name + if name == etag || name == timestamp { + // we do not need to serialize ETag or TimeStamp + continue + } + // add odata annotations for the types that require it. + switch k := v.Type().Kind(); k { + case reflect.Array, reflect.Slice: + if GetTypeArray(v.Interface()) != reflect.TypeOf(byte(0)) { + return nil, errors.New("arrays and slices must be of type byte") + } + // check if this is a uuid field as decorated by a tag + if _, ok := f.Tag.Lookup("uuid"); ok { + entMap[odataType(name)] = edmGuid + u := v.Interface().([16]byte) + var uu uuid.UUID = u + entMap[name] = uu.String() + continue + } else { + entMap[odataType(name)] = edmBinary + b := v.Interface().([]byte) + entMap[name] = base64.StdEncoding.EncodeToString(b) + continue + } + case reflect.Struct: + switch tn := v.Type().String(); tn { + case "time.Time": + entMap[odataType(name)] = edmDateTime + time := v.Interface().(time.Time) + entMap[name] = time.UTC().Format(ISO8601) + continue + default: + return nil, errors.New(fmt.Sprintf("Invalid struct for entity field '%s' of type '%s'", typeOfT.Field(i).Name, tn)) + } + case reflect.Float32, reflect.Float64: + entMap[odataType(name)] = edmDouble + case reflect.Int64: + entMap[odataType(name)] = edmInt64 + i64 := v.Interface().(int64) + entMap[name] = strconv.FormatInt(i64, 10) + continue + case reflect.Ptr: + if v.IsNil() { + // if the pointer is nil, ignore it. + continue + } + // follow the pointer to the type and re-run the switch + v = v.Elem() + goto Switch + + // typeOfT.Field(i).Name, f.Type(), f.Interface()) + } + entMap[name] = v.Interface() + } + return &entMap, nil +} + +func fromMap(src interface{}, fmap *map[string]int, m *map[string]interface{}) (interface{}, error) { + tt := reflect.TypeOf(src) + srcVal := reflect.New(tt).Elem() + + for k, v := range *m { + // skip if this is an OData type descriptor + iSuffix := strings.Index(k, OdataType) + if iSuffix > 0 { + continue + } + // fetch the Field index by property name from the field map + fIndex := (*fmap)[k] + // Get the Value for the Field + val := srcVal.Field(fIndex) + Switch: + switch val.Kind() { + case reflect.String: + val.SetString(v.(string)) + case reflect.Float64: + val.SetFloat(v.(float64)) + case reflect.Int: + val.SetInt(int64(v.(float64))) + case reflect.Int64: + i64, err := strconv.ParseInt(v.(string), 10, 64) + if err != nil { + return nil, err + } + val.SetInt(i64) + case reflect.Struct: + switch tn := val.Type().String(); tn { + case "time.Time": + t, err := time.Parse(ISO8601, v.(string)) + if err != nil { + return nil, err + } + val.Set(reflect.ValueOf(t)) + } + case reflect.Ptr: + if val.IsNil() { + // populate the nil pointer with it's element type and re-run the type evaluation + val.Set(reflect.New(val.Type().Elem())) + val = val.Elem() + goto Switch + } + case reflect.Array, reflect.Map, reflect.Slice: + if GetTypeArray(val.Interface()) != reflect.TypeOf(byte(0)) { + return nil, errors.New("arrays and slices must be of type byte") + } + // // check if this is a uuid field as decorated by a tag + if _, ok := tt.Field(fIndex).Tag.Lookup("uuid"); ok { + u := uuid.Parse(v.(string)) + val.Set(reflect.ValueOf(u)) + } else { + b, err := base64.StdEncoding.DecodeString(v.(string)) + if err != nil { + return nil, err + } + val.SetBytes(b) + } + } + } + return srcVal.Interface(), nil +} + +// getTypeValueMap - builds a map of Field names to their Field index for the given interface{} +func getTypeValueMap(i interface{}) *map[string]int { + tt := reflect.TypeOf(complexEntity{}) + nf := tt.NumField() + fmap := make(map[string]int) + // build a map of field types + for i := 0; i < nf; i++ { + f := tt.Field(i) + fmap[f.Name] = i + if f.Name == etag { + fmap[etagOdata] = i + } + } + return &fmap +} + +func odataType(n string) string { + var b strings.Builder + b.Grow(len(n) + len(OdataType)) + b.WriteString(n) + b.WriteString(OdataType) + return b.String() +} + +func GetTypeArray(arr interface{}) reflect.Type { + return reflect.TypeOf(arr).Elem() +} diff --git a/sdk/tables/aztables/table_pagers_test.go b/sdk/tables/aztables/table_pagers_test.go new file mode 100644 index 000000000000..92b06191ad4f --- /dev/null +++ b/sdk/tables/aztables/table_pagers_test.go @@ -0,0 +1,244 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +package aztables + +import ( + "encoding/base64" + "encoding/json" + "fmt" + "io" + "io/ioutil" + "math" + "net/http" + "strconv" + "strings" + "testing" + "time" + + "github.com/Azure/azure-sdk-for-go/sdk/azcore" + "github.com/Azure/azure-sdk-for-go/sdk/internal/uuid" + "github.com/stretchr/testify/assert" +) + +type pagerTests struct{} + +func TestCastAndRemoveAnnotations(t *testing.T) { + assert := assert.New(t) + + r := &http.Response{Body: closerFromString(complexPayload)} + resp := azcore.Response{Response: r} + + var val map[string]interface{} + err := resp.UnmarshalAsJSON(&val) + assert.Nil(err) + err = castAndRemoveAnnotations(&val) + assert.Nil(err) + // assert all odata annotations are removed. + for k := range val { + assert.NotContains(k, OdataType) + } + + assert.IsType(time.Now(), val["SomeDateProperty"]) + assert.IsType([]byte{}, val["SomeBinaryProperty"]) + assert.IsType(float64(0), val["SomeDoubleProperty0"]) + // TODO: fix this + // assert.IsType(int(0), (*entity)["SomeIntProperty"]) +} + +func TestToOdataAnnotatedDictionary(t *testing.T) { + assert := assert.New(t) + + var val = createComplexEntityMap() + err := toOdataAnnotatedDictionary(&val) + assert.Nil(err) + // assert all odata annotations are removed. + for k := range odataHintProps { + _, ok := val[k] + assert.Truef(ok, fmt.Sprintf("map does not contain %s", k)) + iSuffix := strings.Index(k, OdataType) + if iSuffix > 0 { + // Get the name of the property that this odataType key describes. + valueKey := k[0:iSuffix] + if !strings.Contains(valueKey, "SomeDoubleProperty") { + assert.IsTypef("", val[valueKey], fmt.Sprintf("should be type string %s", valueKey)) + } + } + _, ok = val[odataType(k)] + assert.Truef(ok, fmt.Sprintf("map does not contain %s", odataType(k))) + } +} + +func BenchmarkUnMarshal_AsJson_CastAndRemove_Map(b *testing.B) { + assert := assert.New(b) + b.ReportAllocs() + bt := []byte(complexPayload) + for i := 0; i < b.N; i++ { + var val = make(map[string]interface{}) + json.Unmarshal(bt, &val) + castAndRemoveAnnotations(&val) + assert.Equal("somePartition", val["PartitionKey"]) + } +} + +func BenchmarkUnMarshal_FromMap_Entity(b *testing.B) { + assert := assert.New(b) + fmap := getTypeValueMap(complexEntity{}) + bt := []byte(complexPayload) + for i := 0; i < b.N; i++ { + var val = make(map[string]interface{}) + json.Unmarshal(bt, &val) + result, err := fromMap(complexEntity{}, fmap, &val) + assert.Nil(err) + ent := result.(complexEntity) + assert.Equal("somePartition", ent.PartitionKey) + } +} + +func BenchmarkMarshal_Entity_ToMap_ToOdataDict_Map(b *testing.B) { + ent := createComplexEntity() + for i := 0; i < b.N; i++ { + m, _ := toMap(ent) + toOdataAnnotatedDictionary(m) + json.Marshal(m) + } +} + +func BenchmarkMarshal_Map_ToOdataDict_Map(b *testing.B) { + ent := createComplexEntityMap() + for i := 0; i < b.N; i++ { + toOdataAnnotatedDictionary(&ent) + json.Marshal(ent) + } +} + +func TestToMap(t *testing.T) { + assert := assert.New(t) + + ent := createComplexEntity() + + entMap, err := toMap(ent) + assert.Nil(err) + + // Validate that we have all the @odata.type properties for types []byte, int64, float64, time.Time, and uuid + for k, v := range odataHintProps { + vv, ok := (*entMap)[odataType(k)] + assert.Truef(ok, "Should have found map key of name '%s'", odataType(k)) + assert.Equal(v, vv) + } + + // validate all the types were properly casted / converted + assert.Equal(ent.PartitionKey, (*entMap)["PartitionKey"]) + assert.Equal(ent.RowKey, (*entMap)["RowKey"]) + assert.Equal(base64.StdEncoding.EncodeToString(ent.SomeBinaryProperty), string((*entMap)["SomeBinaryProperty"].(string))) + ts, _ := time.Parse(ISO8601, (*entMap)["SomeDateProperty"].(string)) + assert.Equal(ent.SomeDateProperty.UTC().Format(ISO8601), ts.Format(ISO8601)) + assert.Equal(ent.SomeDoubleProperty0, (*entMap)["SomeDoubleProperty0"]) + assert.Equal(ent.SomeDoubleProperty1, (*entMap)["SomeDoubleProperty1"]) + var u uuid.UUID = ent.SomeGuidProperty + assert.Equal(u.String(), (*entMap)["SomeGuidProperty"].(string)) + assert.Equal(strconv.FormatInt(ent.SomeInt64Property, 10), (*entMap)["SomeInt64Property"].(string)) + assert.Equal(ent.SomeIntProperty, (*entMap)["SomeIntProperty"]) + assert.Equal(ent.SomeStringProperty, (*entMap)["SomeStringProperty"]) + assert.Equal(*ent.SomePtrStringProperty, (*entMap)["SomePtrStringProperty"]) +} + +func TestEntitySerialization(t *testing.T) { + assert := assert.New(t) + + ent := createComplexEntity() + + b, err := json.Marshal(ent) + assert.Nil(err) + assert.NotEmpty(b) + s := string(b) + //assert.FailNow(s) + assert.NotEmpty(s) +} + +func TestDeserializeFromMap(t *testing.T) { + assert := assert.New(t) + + expected := createComplexEntity() + bt := []byte(complexPayload) + var val = make(map[string]interface{}) + json.Unmarshal(bt, &val) + result, err := fromMap(complexEntity{}, getTypeValueMap(complexEntity{}), &val) + assert.Nil(err) + ent := result.(complexEntity) + assert.EqualValues(expected, ent) +} + +func createComplexEntity() complexEntity { + sp := "some pointer to string" + t, _ := time.Parse(ISO8601, "2021-03-23T18:29:15.9686039Z") + t2, _ := time.Parse(ISO8601, "2020-01-01T01:02:00Z") + b, _ := base64.StdEncoding.DecodeString("AQIDBAU=") + var e = complexEntity{ + PartitionKey: "somePartition", + ETag: "W/\"datetime'2021-04-05T05%3A02%3A40.7371784Z'\"", + RowKey: "01", + Timestamp: t, + SomeBinaryProperty: b, + SomeDateProperty: t2, + SomeDoubleProperty0: float64(1.0), + SomeDoubleProperty1: float64(1.5), + SomeGuidProperty: uuid.Parse("0d391d16-97f1-4b9a-be68-4cc871f90001"), + SomeInt64Property: int64(math.MaxInt64), + SomeIntProperty: 42, + SomeStringProperty: "This is table entity number 01", + SomePtrStringProperty: &sp} + return e +} + +func createComplexEntityMap() map[string]interface{} { + sp := "some pointer to string" + t, _ := time.Parse(ISO8601, "2021-03-23T18:29:15.9686039Z") + t2, _ := time.Parse(ISO8601, "2020-01-01T01:02:00Z") + b, _ := base64.StdEncoding.DecodeString("AQIDBAU=") + var e = map[string]interface{}{ + "PartitionKey": "somePartition", + "ETag": "W/\"datetime'2021-04-05T05%3A02%3A40.7371784Z'\"", + "RowKey": "01", + "Timestamp": t, + "SomeBinaryProperty": b, + "SomeDateProperty": t2, + "SomeDoubleProperty0": float64(1.0), + "SomeDoubleProperty1": float64(1.5), + "SomeGuidProperty": uuid.Parse("0d391d16-97f1-4b9a-be68-4cc871f90001"), + "SomeInt64Property": int64(math.MaxInt64), + "SomeIntProperty": 42, + "SomeStringProperty": "This is table entity number 01", + "SomePtrStringProperty": &sp} + return e +} + +func closerFromString(content string) io.ReadCloser { + return ioutil.NopCloser(strings.NewReader(content)) +} + +var odataHintProps = map[string]string{ + "SomeBinaryProperty": edmBinary, + "SomeDateProperty": edmDateTime, + "SomeDoubleProperty0": edmDouble, + "SomeDoubleProperty1": edmDouble, + "SomeGuidProperty": edmGuid, + "SomeInt64Property": edmInt64} + +var complexPayload = "{\"odata.etag\": \"W/\\\"datetime'2021-04-05T05%3A02%3A40.7371784Z'\\\"\"," + + "\"PartitionKey\": \"somePartition\"," + + "\"RowKey\": \"01\"," + + "\"Timestamp\": \"2021-03-23T18:29:15.9686039Z\"," + + "\"SomeBinaryProperty@odata.type\": \"Edm.Binary\"," + + "\"SomeBinaryProperty\": \"AQIDBAU=\"," + + "\"SomeDateProperty@odata.type\": \"Edm.DateTime\"," + + "\"SomeDateProperty\": \"2020-01-01T01:02:00Z\"," + + "\"SomeDoubleProperty0\": 1.0," + + "\"SomeDoubleProperty1\": 1.5," + + "\"SomeGuidProperty@odata.type\": \"Edm.Guid\"," + + "\"SomeGuidProperty\": \"0d391d16-97f1-4b9a-be68-4cc871f90001\"," + + "\"SomeInt64Property@odata.type\": \"Edm.Int64\"," + + "\"SomeInt64Property\": \"" + strconv.FormatInt(math.MaxInt64, 10) + "\"," + + "\"SomeIntProperty\": 42," + + "\"SomeStringProperty\": \"This is table entity number 01\"," + + "\"SomePtrStringProperty\": \"some pointer to string\" }" diff --git a/sdk/tables/aztables/table_service_client.go b/sdk/tables/aztables/table_service_client.go new file mode 100644 index 000000000000..63dc45093e93 --- /dev/null +++ b/sdk/tables/aztables/table_service_client.go @@ -0,0 +1,79 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +package aztables + +import ( + "context" + "errors" + "strings" + + "github.com/Azure/azure-sdk-for-go/sdk/azcore" + "github.com/Azure/azure-sdk-for-go/sdk/internal/runtime" +) + +const ( + LegacyCosmosTableDomain = ".table.cosmosdb." + CosmosTableDomain = ".table.cosmos." +) + +// A TableServiceClient represents a URL to an Azure Storage blob; the blob may be a block blob, append blob, or page blob. +type TableServiceClient struct { + client *tableClient + service *serviceClient + cred SharedKeyCredential +} + +// NewTableServiceClient creates a TableClient object using the specified URL and request policy pipeline. +func NewTableServiceClient(serviceURL string, cred azcore.Credential, options *TableClientOptions) (*TableServiceClient, error) { + conOptions := options.getConnectionOptions() + if isCosmosEndpoint(serviceURL) { + conOptions.PerCallPolicies = []azcore.Policy{CosmosPatchTransformPolicy{}} + } + con := newConnection(serviceURL, cred, conOptions) + c, _ := cred.(*SharedKeyCredential) + return &TableServiceClient{client: &tableClient{con}, service: &serviceClient{con}, cred: *c}, nil +} + +// Gets a TableClient affinitzed to the specified table name and initialized with the same serviceURL and credentials as this TableServiceClient +func (t *TableServiceClient) GetTableClient(tableName string) *TableClient { + return &TableClient{client: t.client, cred: t.cred, Name: tableName, service: t} +} + +// Creates a table with the specified name +func (t *TableServiceClient) Create(ctx context.Context, name string) (*TableResponseResponse, *runtime.ResponseError) { + var r *TableResponseResponse = nil + resp, err := t.client.Create(ctx, TableProperties{&name}, new(TableCreateOptions), new(QueryOptions)) + if err == nil { + tableResp := resp.(TableResponseResponse) + r = &tableResp + } + return r, convertErr(err) +} + +// Deletes a table by name +func (t *TableServiceClient) Delete(ctx context.Context, name string) (*TableDeleteResponse, *runtime.ResponseError) { + resp, err := t.client.Delete(ctx, name, nil) + return &resp, convertErr(err) +} + +// Queries the tables using the specified QueryOptions +func (t *TableServiceClient) QueryTables(queryOptions QueryOptions) TableQueryResponsePager { + return &tableQueryResponsePager{client: t.client, queryOptions: &queryOptions, tableQueryOptions: new(TableQueryOptions)} +} + +func isCosmosEndpoint(url string) bool { + isCosmosEmulator := strings.Index(url, "localhost") >= 0 && strings.Index(url, "8902") >= 0 + return isCosmosEmulator || + strings.Index(url, CosmosTableDomain) >= 0 || + strings.Index(url, LegacyCosmosTableDomain) >= 0 +} + +func convertErr(err error) *runtime.ResponseError { + var e *runtime.ResponseError + if err == nil || !errors.As(err, &e) { + return nil + } else { + return e + } +} diff --git a/sdk/tables/aztables/table_service_client_test.go b/sdk/tables/aztables/table_service_client_test.go new file mode 100644 index 000000000000..a1f728789ebe --- /dev/null +++ b/sdk/tables/aztables/table_service_client_test.go @@ -0,0 +1,120 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +package aztables + +import ( + "fmt" + "net/http" + "testing" + + "github.com/Azure/azure-sdk-for-go/sdk/internal/testframework" + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/suite" +) + +type tableServiceClientLiveTests struct { + suite.Suite + endpointType EndpointType + mode testframework.RecordMode +} + +// Hookup to the testing framework +func TestServiceClient_Storage(t *testing.T) { + storage := tableServiceClientLiveTests{endpointType: StorageEndpoint, mode: testframework.Playback /* change to Record to re-record tests */} + suite.Run(t, &storage) +} + +// Hookup to the testing framework +func TestServiceClient_Cosmos(t *testing.T) { + cosmos := tableServiceClientLiveTests{endpointType: CosmosEndpoint, mode: testframework.Playback /* change to Record to re-record tests */} + suite.Run(t, &cosmos) +} + +func (s *tableServiceClientLiveTests) TestServiceErrors() { + assert := assert.New(s.T()) + context := getTestContext(s.T().Name()) + tableName, err := getTableName(context) + + _, err = context.client.Create(ctx, tableName) + defer context.client.Delete(ctx, tableName) + assert.Nil(err) + + // Create a duplicate table to produce an error + _, svcErr := context.client.Create(ctx, tableName) + assert.Equal(svcErr.RawResponse().StatusCode, http.StatusConflict) +} + +func (s *tableServiceClientLiveTests) TestCreateTable() { + assert := assert.New(s.T()) + context := getTestContext(s.T().Name()) + tableName, err := getTableName(context) + + resp, err := context.client.Create(ctx, tableName) + defer context.client.Delete(ctx, tableName) + + assert.Nil(err) + assert.Equal(*resp.TableResponse.TableName, tableName) +} + +func (s *tableServiceClientLiveTests) TestQueryTable() { + assert := assert.New(s.T()) + context := getTestContext(s.T().Name()) + tableCount := 5 + tableNames := make([]string, tableCount) + prefix1 := "zzza" + prefix2 := "zzzb" + + defer cleanupTables(context, &tableNames) + //create 10 tables with our exected prefix and 1 with a different prefix + for i := 0; i < tableCount; i++ { + if i < (tableCount - 1) { + name, _ := getTableName(context, prefix1) + tableNames[i] = name + } else { + name, _ := getTableName(context, prefix2) + tableNames[i] = name + } + _, err := context.client.Create(ctx, tableNames[i]) + assert.Nil(err) + } + + // 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.QueryTables(QueryOptions{Filter: &filter}) + + resultCount := 0 + for pager.NextPage(ctx) { + resp := pager.PageResponse() + resultCount += len(resp.TableQueryResponse.Value) + } + + assert.Nil(pager.Err()) + assert.Equal(resultCount, tableCount-1) + + // Query for tables with pagination + top := int32(2) + pager = context.client.QueryTables(QueryOptions{Filter: &filter, Top: &top}) + + resultCount = 0 + pageCount := 0 + for pager.NextPage(ctx) { + resp := pager.PageResponse() + resultCount += len(resp.TableQueryResponse.Value) + pageCount++ + } + + assert.Nil(pager.Err()) + assert.Equal(resultCount, tableCount-1) + assert.Equal(pageCount, int(top)) +} + +func (s *tableServiceClientLiveTests) BeforeTest(suite string, test string) { + // setup the test environment + recordedTestSetup(s.T(), s.T().Name(), s.endpointType, s.mode) +} + +func (s *tableServiceClientLiveTests) AfterTest(suite string, test string) { + // teardown the test context + recordedTestTeardown(s.T().Name()) +} diff --git a/sdk/tables/aztables/table_transactional_batch.go b/sdk/tables/aztables/table_transactional_batch.go new file mode 100644 index 000000000000..f208725c3a39 --- /dev/null +++ b/sdk/tables/aztables/table_transactional_batch.go @@ -0,0 +1,346 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +package aztables + +import ( + "bufio" + "bytes" + "context" + "encoding/json" + "errors" + "fmt" + "io" + "io/ioutil" + "mime/multipart" + "net/http" + "net/textproto" + "sort" + "strconv" + "strings" + "time" + + "github.com/Azure/azure-sdk-for-go/sdk/azcore" + "github.com/Azure/azure-sdk-for-go/sdk/internal/uuid" +) + +type TableTransactionActionType string + +const ( + Add TableTransactionActionType = "add" + UpdateMerge TableTransactionActionType = "updatemerge" + UpdateReplace TableTransactionActionType = "updatereplace" + Delete TableTransactionActionType = "delete" + UpsertMerge TableTransactionActionType = "upsertmerge" + UpsertReplace TableTransactionActionType = "upsertreplace" +) + +const ( + headerContentType = "Content-Type" + headerContentTransferEncoding = "Content-Transfer-Encoding" + error_empty_transaction = "Transaction cannot be empty." +) + +type OdataErrorMessage struct { + Lang string `json:"lang"` + Value string `json:"value"` +} + +type OdataError struct { + Code string `json:"code"` + Message OdataErrorMessage `json:"message"` +} + +type TableTransactionError struct { + OdataError OdataError `json:"odata.error"` + FailedEntityIndex int +} + +func (e *TableTransactionError) Error() string { + return fmt.Sprintf("Code: %s, Message: %s", e.OdataError.Code, e.OdataError.Message.Value) +} + +type TableTransactionAction struct { + ActionType TableTransactionActionType + Entity map[string]interface{} + ETag string +} + +type TableTransactionResponse struct { + // ClientRequestID contains the information returned from the x-ms-client-request-id header response. + ClientRequestID *string + + // Date contains the information returned from the Date header response. + Date *time.Time + + // PreferenceApplied contains the information returned from the Preference-Applied header response. + PreferenceApplied *string + + // RawResponse contains the underlying HTTP response. + RawResponse *http.Response + + // RequestID contains the information returned from the x-ms-request-id header response. + RequestID *string + + // The response for a single table. + TransactionResponses *[]azcore.Response + + // Version contains the information returned from the x-ms-version header response. + Version *string + + // ContentType contains the information returned from the Content-Type header response. + ContentType *string +} + +type TableSubmitTransactionOptions struct { + RequestID *string +} + +var defaultChangesetHeaders = map[string]string{ + "Accept": "application/json;odata=minimalmetadata", + "Content-Type": "application/json", + "Prefer": "return-no-content", +} + +// SubmitTransaction submits the table transactional batch according to the slice of TableTransactionActions provided. +func (t *TableClient) SubmitTransaction(ctx context.Context, transactionActions []TableTransactionAction, tableSubmitTransactionOptions *TableSubmitTransactionOptions) (TableTransactionResponse, error) { + return t.submitTransactionInternal(ctx, &transactionActions, uuid.New(), uuid.New(), tableSubmitTransactionOptions) +} + +// submitTransactionInternal is the internal implementation for SubmitTransaction. It allows for explicit configuration of the batch and changeset UUID values for testing. +func (t *TableClient) submitTransactionInternal(ctx context.Context, transactionActions *[]TableTransactionAction, batchUuid uuid.UUID, changesetUuid uuid.UUID, tableSubmitTransactionOptions *TableSubmitTransactionOptions) (TableTransactionResponse, error) { + if len(*transactionActions) == 0 { + return TableTransactionResponse{}, errors.New(error_empty_transaction) + } + changesetBoundary := fmt.Sprintf("changeset_%s", changesetUuid.String()) + changeSetBody, err := t.generateChangesetBody(changesetBoundary, transactionActions) + if err != nil { + return TableTransactionResponse{}, err + } + req, err := azcore.NewRequest(ctx, http.MethodPost, azcore.JoinPaths(t.client.con.Endpoint(), "$batch")) + if err != nil { + return TableTransactionResponse{}, err + } + req.Header.Set("x-ms-version", "2019-02-02") + if tableSubmitTransactionOptions != nil && tableSubmitTransactionOptions.RequestID != nil { + req.Header.Set("x-ms-client-request-id", *tableSubmitTransactionOptions.RequestID) + } + req.Header.Set("DataServiceVersion", "3.0") + req.Header.Set("Accept", string(OdataMetadataFormatApplicationJSONOdataMinimalmetadata)) + + boundary := fmt.Sprintf("batch_%s", batchUuid.String()) + body := new(bytes.Buffer) + writer := multipart.NewWriter(body) + writer.SetBoundary(boundary) + h := make(textproto.MIMEHeader) + h.Set(headerContentType, fmt.Sprintf("multipart/mixed; boundary=%s", changesetBoundary)) + batchWriter, err := writer.CreatePart(h) + if err != nil { + return TableTransactionResponse{}, err + } + batchWriter.Write(changeSetBody.Bytes()) + writer.Close() + + req.SetBody(azcore.NopCloser(bytes.NewReader(body.Bytes())), fmt.Sprintf("multipart/mixed; boundary=%s", boundary)) + + resp, err := t.client.con.Pipeline().Do(req) + if err != nil { + return TableTransactionResponse{}, err + } + + transactionResponse, err := buildTransactionResponse(req, resp, len(*transactionActions)) + if err != nil { + return transactionResponse, err + } + + if !resp.HasStatusCode(http.StatusAccepted, http.StatusNoContent) { + return TableTransactionResponse{}, azcore.NewResponseError(err, resp.Response) + } + return transactionResponse, nil +} + +func buildTransactionResponse(req *azcore.Request, resp *azcore.Response, itemCount int) (TableTransactionResponse, error) { + innerResponses := make([]azcore.Response, itemCount) + result := TableTransactionResponse{RawResponse: resp.Response, TransactionResponses: &innerResponses} + + if val := resp.Header.Get("x-ms-client-request-id"); val != "" { + result.ClientRequestID = &val + } + if val := resp.Header.Get("x-ms-request-id"); val != "" { + result.RequestID = &val + } + if val := resp.Header.Get("x-ms-version"); val != "" { + result.Version = &val + } + if val := resp.Header.Get("Date"); val != "" { + date, err := time.Parse(time.RFC1123, val) + if err != nil { + return TableTransactionResponse{}, err + } + result.Date = &date + } + + if val := resp.Header.Get("Preference-Applied"); val != "" { + result.PreferenceApplied = &val + } + if val := resp.Header.Get("Content-Type"); val != "" { + result.ContentType = &val + } + + bytesBody, err := ioutil.ReadAll(resp.Body) + if err != nil { + return TableTransactionResponse{}, err + } + reader := bytes.NewReader(bytesBody) + if bytes.IndexByte(bytesBody, '{') == 0 { + // This is a failure and the body is json + return TableTransactionResponse{}, newTableTransactionError(bytesBody) + } + outerBoundary := getBoundaryName(bytesBody) + mpReader := multipart.NewReader(reader, outerBoundary) + outerPart, err := mpReader.NextPart() + innerBytes, err := ioutil.ReadAll(outerPart) + innerBoundary := getBoundaryName(innerBytes) + reader = bytes.NewReader(innerBytes) + mpReader = multipart.NewReader(reader, innerBoundary) + i := 0 + innerPart, err := mpReader.NextPart() + for ; err == nil; innerPart, err = mpReader.NextPart() { + part, err := ioutil.ReadAll(innerPart) + if err != nil { + break + } + r, err := http.ReadResponse(bufio.NewReader(bytes.NewBuffer(part)), req.Request) + if err != nil { + return TableTransactionResponse{}, err + } + if r.StatusCode >= 400 { + errorBody, err := ioutil.ReadAll(r.Body) + if err != nil { + return TableTransactionResponse{}, err + } else { + innerResponses = []azcore.Response{{Response: r}} + return result, newTableTransactionError(errorBody) + } + } + innerResponses[i] = azcore.Response{Response: r} + i++ + } + + return result, nil +} + +func getBoundaryName(bytesBody []byte) string { + end := bytes.Index(bytesBody, []byte("\n")) + if end > 0 && bytesBody[end-1] == '\r' { + end -= 1 + } + return string(bytesBody[2:end]) +} + +// newTableTransactionError handles the SubmitTransaction error response. +func newTableTransactionError(errorBody []byte) error { + oe := TableTransactionError{} + if err := json.Unmarshal(errorBody, &oe); err == nil { + if i := strings.Index(oe.OdataError.Message.Value, ":"); i > 0 { + if val, err := strconv.Atoi(oe.OdataError.Message.Value[0:i]); err == nil { + oe.FailedEntityIndex = val + } + } + return &oe + } + return errors.New("Unknown error.") +} + +// generateChangesetBody generates the individual changesets for the various operations within the batch request. +// There is a changeset for Insert, Delete, Merge etc. +func (t *TableClient) generateChangesetBody(changesetBoundary string, transactionActions *[]TableTransactionAction) (*bytes.Buffer, error) { + + body := new(bytes.Buffer) + writer := multipart.NewWriter(body) + writer.SetBoundary(changesetBoundary) + + for _, be := range *transactionActions { + err := t.generateEntitySubset(&be, writer) + if err != nil { + return nil, err + } + } + + writer.Close() + return body, nil +} + +// generateEntitySubset generates body payload for particular batch entity +func (t *TableClient) generateEntitySubset(transactionAction *TableTransactionAction, writer *multipart.Writer) error { + + h := make(textproto.MIMEHeader) + h.Set(headerContentTransferEncoding, "binary") + h.Set(headerContentType, "application/http") + qo := &QueryOptions{Format: OdataMetadataFormatApplicationJSONOdataMinimalmetadata.ToPtr()} + + operationWriter, err := writer.CreatePart(h) + if err != nil { + return err + } + var req *azcore.Request + var entity map[string]interface{} = transactionAction.Entity + + if _, ok := entity[partitionKey]; !ok { + return fmt.Errorf("entity properties must contain a %s property", partitionKey) + } + if _, ok := entity[rowKey]; !ok { + return fmt.Errorf("entity properties must contain a %s property", rowKey) + } + // Consider empty ETags as '*' + if len(transactionAction.ETag) == 0 { + transactionAction.ETag = "*" + } + + switch transactionAction.ActionType { + case Delete: + req, err = t.client.deleteEntityCreateRequest(ctx, t.Name, entity[partitionKey].(string), entity[rowKey].(string), transactionAction.ETag, &TableDeleteEntityOptions{}, qo) + case Add: + toOdataAnnotatedDictionary(&entity) + req, err = t.client.insertEntityCreateRequest(ctx, t.Name, &TableInsertEntityOptions{TableEntityProperties: entity, ResponsePreference: ResponseFormatReturnNoContent.ToPtr()}, qo) + case UpdateMerge: + fallthrough + case UpsertMerge: + toOdataAnnotatedDictionary(&entity) + opts := &TableMergeEntityOptions{TableEntityProperties: entity} + if len(transactionAction.ETag) > 0 { + opts.IfMatch = &transactionAction.ETag + } + req, err = t.client.mergeEntityCreateRequest(ctx, t.Name, entity[partitionKey].(string), entity[rowKey].(string), opts, qo) + if isCosmosEndpoint(t.client.con.Endpoint()) { + transformPatchToCosmosPost(req) + } + case UpdateReplace: + fallthrough + case UpsertReplace: + toOdataAnnotatedDictionary(&entity) + req, err = t.client.updateEntityCreateRequest(ctx, t.Name, entity[partitionKey].(string), entity[rowKey].(string), &TableUpdateEntityOptions{TableEntityProperties: entity, IfMatch: &transactionAction.ETag}, qo) + } + + urlAndVerb := fmt.Sprintf("%s %s HTTP/1.1\r\n", req.Method, req.URL) + operationWriter.Write([]byte(urlAndVerb)) + writeHeaders(req.Header, &operationWriter) + operationWriter.Write([]byte("\r\n")) // additional \r\n is needed per changeset separating the "headers" and the body. + if req.Body != nil { + io.Copy(operationWriter, req.Body) + } + + return nil +} + +func writeHeaders(h http.Header, writer *io.Writer) { + // This way it is guaranteed the headers will be written in a sorted order + var keys []string + for k := range h { + keys = append(keys, k) + } + sort.Strings(keys) + for _, k := range keys { + (*writer).Write([]byte(fmt.Sprintf("%s: %s\r\n", k, h.Get(k)))) + } +} diff --git a/sdk/tables/aztables/zc_tableConstants.go b/sdk/tables/aztables/zc_tableConstants.go new file mode 100644 index 000000000000..69d77706df20 --- /dev/null +++ b/sdk/tables/aztables/zc_tableConstants.go @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +package aztables + +const ( + timestamp = "Timestamp" + partitionKey = "PartitionKey" + rowKey = "RowKey" + etagOdata = "odata.etag" + etag = "ETag" + odataMetadata = "odata.metadata" + OdataType = "@odata.type" + edmBinary = "Edm.Binary" + edmBoolean = "Emd.Boolean" + edmDateTime = "Edm.DateTime" + edmDouble = "Edm.Double" + edmGuid = "Edm.Guid" + edmInt32 = "Edm.Int32" + edmInt64 = "Edm.Int64" + edmString = "Edm.String" + ISO8601 = "2006-01-02T15:04:05.9999999Z" +) diff --git a/sdk/tables/aztables/zt_tableRecordedTests.go b/sdk/tables/aztables/zt_tableRecordedTests.go new file mode 100644 index 000000000000..1141e42396fc --- /dev/null +++ b/sdk/tables/aztables/zt_tableRecordedTests.go @@ -0,0 +1,203 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +package aztables + +import ( + "context" + "fmt" + "math" + "testing" + "time" + + "github.com/Azure/azure-sdk-for-go/sdk/azcore" + "github.com/Azure/azure-sdk-for-go/sdk/internal/testframework" + "github.com/stretchr/testify/assert" +) + +type tablesRecordedTests struct{} + +type testContext struct { + recording *testframework.Recording + client *TableServiceClient + context *testframework.TestContext +} + +const ( + storageAccountNameEnvVar = "TABLES_STORAGE_ACCOUNT_NAME" + cosmosAccountNameEnnVar = "TABLES_COSMOS_ACCOUNT_NAME" + storageEndpointSuffixEnvVar = "STORAGE_ENDPOINT_SUFFIX" + cosmosEndpointSuffixEnvVar = "COSMOS_TABLES_ENDPOINT_SUFFIX" + storageAccountKeyEnvVar = "TABLES_PRIMARY_STORAGE_ACCOUNT_KEY" + cosmosAccountKeyEnvVar = "TABLES_PRIMARY_COSMOS_ACCOUNT_KEY" + tableNamePrefix = "gotable" + DefaultStorageSuffix = "core.windows.net" + DefaultCosmosSuffix = "cosmos.azure.com" +) + +type EndpointType string + +const ( + StorageEndpoint EndpointType = "storage" + CosmosEndpoint EndpointType = "cosmos" +) + +var ctx = context.Background() +var clientsMap map[string]*testContext = make(map[string]*testContext) + +func storageURI(accountName string, endpointSuffix string) string { + return "https://" + accountName + ".table." + endpointSuffix +} + +func cosmosURI(accountName string, endpointSuffix string) string { + return "https://" + accountName + ".table." + endpointSuffix +} + +// create the test specific TableClient and wire it up to recordings +func recordedTestSetup(t *testing.T, testName string, endpointType EndpointType, mode testframework.RecordMode) { + var accountName string + var suffix string + var cred *SharedKeyCredential + var secret string + var uri string + assert := assert.New(t) + + // init the test framework + context := testframework.NewTestContext(func(msg string) { assert.FailNow(msg) }, func(msg string) { t.Log(msg) }, func() string { return testName }) + recording, err := testframework.NewRecording(context, mode) + assert.Nil(err) + + if endpointType == StorageEndpoint { + accountName, err = recording.GetRecordedVariable(storageAccountNameEnvVar, testframework.Default) + suffix = recording.GetOptionalRecordedVariable(storageEndpointSuffixEnvVar, DefaultStorageSuffix, testframework.Default) + secret, err = recording.GetRecordedVariable(storageAccountKeyEnvVar, testframework.Secret_Base64String) + cred, _ = NewSharedKeyCredential(accountName, secret) + uri = storageURI(accountName, suffix) + } else { + accountName, err = recording.GetRecordedVariable(cosmosAccountNameEnnVar, testframework.Default) + suffix = recording.GetOptionalRecordedVariable(cosmosEndpointSuffixEnvVar, DefaultCosmosSuffix, testframework.Default) + secret, err = recording.GetRecordedVariable(cosmosAccountKeyEnvVar, testframework.Secret_Base64String) + cred, _ = NewSharedKeyCredential(accountName, secret) + uri = cosmosURI(accountName, suffix) + } + + client, err := NewTableServiceClient(uri, cred, &TableClientOptions{HTTPClient: recording, Retry: azcore.RetryOptions{MaxRetries: -1}}) + assert.Nil(err) + clientsMap[testName] = &testContext{client: client, recording: recording, context: &context} +} + +func recordedTestTeardown(key string) { + context, ok := clientsMap[key] + if ok && !(*context.context).IsFailed() { + context.recording.Stop() + } +} + +// cleans up the specified tables. If tables is nil, all tables will be deleted +func cleanupTables(context *testContext, tables *[]string) { + c := context.client + if tables == nil { + pager := c.QueryTables(QueryOptions{}) + for pager.NextPage(ctx) { + for _, t := range pager.PageResponse().TableQueryResponse.Value { + c.Delete(ctx, *t.TableName) + } + } + } else { + for _, t := range *tables { + c.Delete(ctx, t) + } + } +} + +func getTestContext(key string) *testContext { + return clientsMap[key] +} + +func getTableName(context *testContext, prefix ...string) (string, error) { + if len(prefix) == 0 { + return context.recording.GenerateAlphaNumericID(tableNamePrefix, 20, true) + } else { + return context.recording.GenerateAlphaNumericID(prefix[0], 20, true) + } +} + +func createSimpleEntities(count int, pk string) *[]map[string]interface{} { + result := make([]map[string]interface{}, count) + + for i := 1; i <= count; i++ { + var e = map[string]interface{}{ + partitionKey: pk, + rowKey: fmt.Sprint(i), + "StringProp": fmt.Sprintf("some string %d", i), + "IntProp": i, + "BoolProp": true, + } + result[i-1] = e + } + return &result +} + +func createComplexMapEntities(context *testContext, count int, pk string) *[]map[string]interface{} { + result := make([]map[string]interface{}, count) + + for i := 1; i <= count; i++ { + var e = map[string]interface{}{ + partitionKey: pk, + rowKey: fmt.Sprint(i), + "StringProp": fmt.Sprintf("some string %d", i), + "IntProp": i, + "BoolProp": true, + "SomeBinaryProperty": []byte("some bytes"), + "SomeDateProperty": context.recording.Now(), + "SomeDoubleProperty0": float64(1), + "SomeDoubleProperty1": float64(1.2345), + "SomeGuidProperty": context.recording.UUID(), + "SomeInt64Property": (int64)(math.MaxInt64), + "SomeIntProperty": 42, + "SomeStringProperty": "some string", + } + result[i-1] = e + } + return &result +} + +func createComplexEntities(context *testContext, count int, pk string) *[]complexEntity { + result := make([]complexEntity, count) + + sp := "some pointer to string" + for i := 1; i <= count; i++ { + var e = complexEntity{ + PartitionKey: "partition", + ETag: "*", + RowKey: "row", + Timestamp: context.recording.Now(), + SomeBinaryProperty: []byte("some bytes"), + SomeDateProperty: context.recording.Now(), + SomeDoubleProperty0: float64(1), + SomeDoubleProperty1: float64(1.2345), + SomeGuidProperty: context.recording.UUID(), + SomeInt64Property: math.MaxInt64, + SomeIntProperty: 42, + SomeStringProperty: "some string", + SomePtrStringProperty: &sp} + result[i-1] = e + } + return &result +} + +type complexEntity struct { + ETag string + PartitionKey string + RowKey string + Timestamp time.Time + SomeBinaryProperty []byte + SomeDateProperty time.Time + SomeDoubleProperty0 float64 + SomeDoubleProperty1 float64 + SomeGuidProperty [16]byte `uuid:""` + SomeInt64Property int64 + SomeIntProperty int + SomeStringProperty string + SomePtrStringProperty *string +} diff --git a/sdk/tables/aztables/zt_test.go b/sdk/tables/aztables/zt_test.go deleted file mode 100644 index c9e649bca203..000000000000 --- a/sdk/tables/aztables/zt_test.go +++ /dev/null @@ -1,123 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package aztables - -import ( - "context" - "errors" - "fmt" - "os" - "testing" - "time" - - chk "gopkg.in/check.v1" -) - -// For testing docs, see: https://labix.org/gocheck -// To test a specific test: go test -check.f MyTestSuite - -// Hookup to the testing framework -func Test(t *testing.T) { chk.TestingT(t) } - -type aztestsSuite struct{} - -var _ = chk.Suite(&aztestsSuite{}) - -const ( - storageAccountNameEnvVar = "TABLES_STORAGE_ACCOUNT_NAME" - cosmosAccountNameEnnVar = "TABLES_COSMOS_ACCOUNT_NAME" - accountKeyEnvVar = "TABLES_PRIMARY_STORAGE_ACCOUNT_KEY" - storageEndpointSuffixEnvVar = "STORAGE_ENDPOINT_SUFFIX" - cosmosEndpointSuffixEnvVar = "COSMOS_TABLES_ENDPOINT_SUFFIX" - storageAccountKeyEnvVar = "TABLES_PRIMARY_STORAGE_ACCOUNT_KEY" - cosmosAccountKeyEnvVar = "TABLES_PRIMARY_COSMOS_ACCOUNT_KEY" - tableNamePrefix = "gotable" - DefaultStorageSuffix = "core.windows.net" - DefaultCosmosSuffix = "cosmos.azure.com" -) - -type EndpointType string - -const ( - StorageEndpoint EndpointType = "storage" - CosmosEndpoint EndpointType = "cosmos" -) - -var ctx = context.Background() - -func getRequiredEnv(name string) string { - env, ok := os.LookupEnv(name) - if ok { - return env - } else { - panic("Required environment variable not set: " + name) - } -} - -func storageURI() string { - return "https://" + storageAccountName() + ".table." + storageEndpointSuffix() -} - -func cosmosURI() string { - return "https://" + cosmosAccountName() + ".table" + cosmosAccountName() -} - -func storageAccountName() string { - return getRequiredEnv(storageAccountNameEnvVar) -} - -func cosmosAccountName() string { - return getRequiredEnv(cosmosAccountNameEnnVar) -} - -func cosmosAccountKey() string { - return getRequiredEnv(cosmosAccountKeyEnvVar) -} - -func storageAccountKey() string { - return getRequiredEnv(storageAccountKeyEnvVar) -} - -func storageEndpointSuffix() string { - suffix, ok := os.LookupEnv(storageEndpointSuffixEnvVar) - if ok { - return suffix - } else { - return DefaultStorageSuffix - } -} - -func cosmosEndpointSuffix() string { - suffix, ok := os.LookupEnv(cosmosEndpointSuffix()) - if ok { - return suffix - } else { - return DefaultCosmosSuffix - } -} - -func createTableClient(endpointType EndpointType) (*TableClient, error) { - if endpointType == StorageEndpoint { - storageCred, _ := NewSharedKeyCredential(storageAccountName(), storageAccountKey()) - return NewTableClient(storageURI(), storageCred, nil) - } else { - cosmosCred, _ := NewSharedKeyCredential(cosmosAccountName(), cosmosAccountKey()) - return NewTableClient(cosmosURI(), cosmosCred, nil) - } -} - -func getGenericCredential(accountType string) (*SharedKeyCredential, error) { - - accountName, accountKey := getRequiredEnv(storageAccountNameEnvVar), getRequiredEnv(accountKeyEnvVar) - if accountName == "" || accountKey == "" { - return nil, errors.New(storageAccountNameEnvVar + " and/or " + accountKeyEnvVar + " environment variables not specified.") - } - return NewSharedKeyCredential(accountName, accountKey) -} - -func generateName() string { - currentTime := time.Now() - name := fmt.Sprintf("%s%d%d%d", tableNamePrefix, currentTime.Minute(), currentTime.Second(), currentTime.Nanosecond()) - return name -} diff --git a/sdk/tables/aztables/zz_generated_connection.go b/sdk/tables/aztables/zz_generated_connection.go index 325fa053b1bd..188d3c30126a 100644 --- a/sdk/tables/aztables/zz_generated_connection.go +++ b/sdk/tables/aztables/zz_generated_connection.go @@ -12,8 +12,8 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/azcore" ) -const scope = "foo" -const telemetryInfo = "azsdk-go-tables/" +const scope = "none" +const telemetryInfo = "azsdk-go-aztables/" // connectionOptions contains configuration settings for the connection's pipeline. // All zero-value fields will be initialized with their default values. @@ -26,6 +26,12 @@ type connectionOptions struct { Telemetry azcore.TelemetryOptions // Logging configures the built-in logging policy behavior. Logging azcore.LogOptions + // PerCallPolicies contains custom policies to inject into the pipeline. + // Each policy is executed once per request. + PerCallPolicies []azcore.Policy + // PerRetryPolicies contains custom policies to inject into the pipeline. + // Each policy is executed once per request, and for each retry request. + PerRetryPolicies []azcore.Policy } func (c *connectionOptions) telemetryOptions() *azcore.TelemetryOptions { @@ -49,17 +55,15 @@ func newConnection(endpoint string, cred azcore.Credential, options *connectionO if options == nil { options = &connectionOptions{} } - p := azcore.NewPipeline(options.HTTPClient, + policies := []azcore.Policy{ azcore.NewTelemetryPolicy(options.telemetryOptions()), - azcore.NewRetryPolicy(&options.Retry), - cred.AuthenticationPolicy(azcore.AuthenticationPolicyOptions{Options: azcore.TokenRequestOptions{Scopes: []string{scope}}}), - azcore.NewLogPolicy(&options.Logging)) - return newConnectionWithPipeline(endpoint, p) -} - -// newConnectionWithPipeline creates an instance of the connection type with the specified endpoint and pipeline. -func newConnectionWithPipeline(endpoint string, p azcore.Pipeline) *connection { - return &connection{u: endpoint, p: p} + } + policies = append(policies, options.PerCallPolicies...) + policies = append(policies, azcore.NewRetryPolicy(&options.Retry)) + policies = append(policies, options.PerRetryPolicies...) + policies = append(policies, cred.AuthenticationPolicy(azcore.AuthenticationPolicyOptions{Options: azcore.TokenRequestOptions{Scopes: []string{scope}}})) + policies = append(policies, azcore.NewLogPolicy(&options.Logging)) + return &connection{u: endpoint, p: azcore.NewPipeline(options.HTTPClient, policies...)} } // Endpoint returns the connection's endpoint. diff --git a/sdk/tables/aztables/zz_generated_constants.go b/sdk/tables/aztables/zz_generated_constants.go index f117e6efcbe9..2b5930e1e9bc 100644 --- a/sdk/tables/aztables/zz_generated_constants.go +++ b/sdk/tables/aztables/zz_generated_constants.go @@ -25,7 +25,7 @@ func PossibleGeoReplicationStatusTypeValues() []GeoReplicationStatusType { } } -// ToPtr() returns a *GeoReplicationStatusType pointing to the current value. +// ToPtr returns a *GeoReplicationStatusType pointing to the current value. func (c GeoReplicationStatusType) ToPtr() *GeoReplicationStatusType { return &c } @@ -47,7 +47,7 @@ func PossibleOdataMetadataFormatValues() []OdataMetadataFormat { } } -// ToPtr() returns a *OdataMetadataFormat pointing to the current value. +// ToPtr returns a *OdataMetadataFormat pointing to the current value. func (c OdataMetadataFormat) ToPtr() *OdataMetadataFormat { return &c } @@ -67,7 +67,7 @@ func PossibleResponseFormatValues() []ResponseFormat { } } -// ToPtr() returns a *ResponseFormat pointing to the current value. +// ToPtr returns a *ResponseFormat pointing to the current value. func (c ResponseFormat) ToPtr() *ResponseFormat { return &c } diff --git a/sdk/tables/aztables/zz_generated_models.go b/sdk/tables/aztables/zz_generated_models.go index 00bbe531834a..d855a4d87bd4 100644 --- a/sdk/tables/aztables/zz_generated_models.go +++ b/sdk/tables/aztables/zz_generated_models.go @@ -8,21 +8,22 @@ package aztables import ( + "encoding/json" "encoding/xml" - "fmt" - "net/http" + "github.com/Azure/azure-sdk-for-go/sdk/azcore" + "reflect" "time" ) -// An Access policy. +// AccessPolicy - An Access policy. type AccessPolicy struct { - // The datetime that the policy expires. + // REQUIRED; The datetime that the policy expires. Expiry *time.Time `xml:"Expiry"` - // The permissions for the acl policy. + // REQUIRED; The permissions for the acl policy. Permission *string `xml:"Permission"` - // The start datetime from which the policy is active. + // REQUIRED; The start datetime from which the policy is active. Start *time.Time `xml:"Start"` } @@ -59,37 +60,37 @@ func (a *AccessPolicy) UnmarshalXML(d *xml.Decoder, start xml.StartElement) erro return nil } -// CORS is an HTTP feature that enables a web application running under one domain to access resources in another domain. Web browsers implement a security -// restriction known as same-origin policy that +// CorsRule - CORS is an HTTP feature that enables a web application running under one domain to access resources in another domain. Web browsers implement +// a security restriction known as same-origin policy that // prevents a web page from calling APIs in a different domain; CORS provides a secure way to allow one domain (the origin domain) to call APIs in another // domain. type CorsRule struct { - // The request headers that the origin domain may specify on the CORS request. + // REQUIRED; The request headers that the origin domain may specify on the CORS request. AllowedHeaders *string `xml:"AllowedHeaders"` - // The methods (HTTP request verbs) that the origin domain may use for a CORS request. (comma separated) + // REQUIRED; The methods (HTTP request verbs) that the origin domain may use for a CORS request. (comma separated) AllowedMethods *string `xml:"AllowedMethods"` - // The origin domains that are permitted to make a request against the service via CORS. The origin domain is the domain from which the request originates. - // Note that the origin must be an exact + // REQUIRED; The origin domains that are permitted to make a request against the service via CORS. The origin domain is the domain from which the request + // originates. Note that the origin must be an exact // case-sensitive match with the origin that the user age sends to the service. You can also use the wildcard character '*' to allow all origin domains // to make requests via CORS. AllowedOrigins *string `xml:"AllowedOrigins"` - // The response headers that may be sent in the response to the CORS request and exposed by the browser to the request issuer. + // REQUIRED; The response headers that may be sent in the response to the CORS request and exposed by the browser to the request issuer. ExposedHeaders *string `xml:"ExposedHeaders"` - // The maximum amount time that a browser should cache the preflight OPTIONS request. + // REQUIRED; The maximum amount time that a browser should cache the preflight OPTIONS request. MaxAgeInSeconds *int32 `xml:"MaxAgeInSeconds"` } type GeoReplication struct { - // A GMT date/time value, to the second. All primary writes preceding this value are guaranteed to be available for read operations at the secondary. Primary - // writes after this point in time may or may + // REQUIRED; A GMT date/time value, to the second. All primary writes preceding this value are guaranteed to be available for read operations at the secondary. + // Primary writes after this point in time may or may // not be available for reads. LastSyncTime *time.Time `xml:"LastSyncTime"` - // The status of the secondary location. + // REQUIRED; The status of the secondary location. Status *GeoReplicationStatusType `xml:"Status"` } @@ -122,56 +123,26 @@ func (g *GeoReplication) UnmarshalXML(d *xml.Decoder, start xml.StartElement) er return nil } -// Azure Analytics Logging settings. +// Logging - Azure Analytics Logging settings. type Logging struct { - // Indicates whether all delete requests should be logged. + // REQUIRED; Indicates whether all delete requests should be logged. Delete *bool `xml:"Delete"` - // Indicates whether all read requests should be logged. + // REQUIRED; Indicates whether all read requests should be logged. Read *bool `xml:"Read"` - // The retention policy. + // REQUIRED; The retention policy. RetentionPolicy *RetentionPolicy `xml:"RetentionPolicy"` - // The version of Analytics to configure. + // REQUIRED; The version of Analytics to configure. Version *string `xml:"Version"` - // Indicates whether all write requests should be logged. + // REQUIRED; Indicates whether all write requests should be logged. Write *bool `xml:"Write"` } -// MapOfInterfaceResponse is the response envelope for operations that return a map[string]interface{} type. -type MapOfInterfaceResponse struct { - // ClientRequestID contains the information returned from the x-ms-client-request-id header response. - ClientRequestID *string - - // ContentType contains the information returned from the Content-Type header response. - ContentType *string - - // Date contains the information returned from the Date header response. - Date *time.Time - - // ETag contains the information returned from the ETag header response. - ETag *string - - // PreferenceApplied contains the information returned from the Preference-Applied header response. - PreferenceApplied *string - - // RawResponse contains the underlying HTTP response. - RawResponse *http.Response - - // RequestID contains the information returned from the x-ms-request-id header response. - RequestID *string - - // The other properties of the table entity. - Value map[string]interface{} - - // Version contains the information returned from the x-ms-version header response. - Version *string -} - type Metrics struct { - // Indicates whether metrics are enabled for the Table service. + // REQUIRED; Indicates whether metrics are enabled for the Table service. Enabled *bool `xml:"Enabled"` // Indicates whether metrics should generate summary statistics for called API operations. @@ -196,13 +167,13 @@ type QueryOptions struct { Top *int32 } -// The retention policy. +// RetentionPolicy - The retention policy. type RetentionPolicy struct { + // REQUIRED; Indicates whether a retention policy is enabled for the service. + Enabled *bool `xml:"Enabled"` + // Indicates the number of days that metrics or logging or soft-deleted data should be retained. All data older than this value will be deleted. Days *int32 `xml:"Days"` - - // Indicates whether a retention policy is enabled for the service. - Enabled *bool `xml:"Enabled"` } // ServiceGetPropertiesOptions contains the optional parameters for the Service.GetProperties method. @@ -229,51 +200,15 @@ type ServiceSetPropertiesOptions struct { Timeout *int32 } -// ServiceSetPropertiesResponse contains the response from method Service.SetProperties. -type ServiceSetPropertiesResponse struct { - // ClientRequestID contains the information returned from the x-ms-client-request-id header response. - ClientRequestID *string - - // RawResponse contains the underlying HTTP response. - RawResponse *http.Response - - // RequestID contains the information returned from the x-ms-request-id header response. - RequestID *string - - // Version contains the information returned from the x-ms-version header response. - Version *string -} - -// A signed identifier. +// SignedIdentifier - A signed identifier. type SignedIdentifier struct { - // The access policy. + // REQUIRED; The access policy. AccessPolicy *AccessPolicy `xml:"AccessPolicy"` - // A unique id. + // REQUIRED; A unique id. ID *string `xml:"Id"` } -// SignedIdentifierArrayResponse is the response envelope for operations that return a []SignedIdentifier type. -type SignedIdentifierArrayResponse struct { - // ClientRequestID contains the information returned from the x-ms-client-request-id header response. - ClientRequestID *string `xml:"ClientRequestID"` - - // Date contains the information returned from the Date header response. - Date *time.Time `xml:"Date"` - - // RawResponse contains the underlying HTTP response. - RawResponse *http.Response - - // RequestID contains the information returned from the x-ms-request-id header response. - RequestID *string `xml:"RequestID"` - - // A collection of signed identifiers. - SignedIdentifiers []SignedIdentifier `xml:"SignedIdentifier"` - - // Version contains the information returned from the x-ms-version header response. - Version *string `xml:"Version"` -} - // TableCreateOptions contains the optional parameters for the Table.Create method. type TableCreateOptions struct { // Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the analytics logs when analytics logging is enabled. @@ -282,27 +217,6 @@ type TableCreateOptions struct { ResponsePreference *ResponseFormat } -// TableCreateResponse contains the response from method Table.Create. -type TableCreateResponse struct { - // ClientRequestID contains the information returned from the x-ms-client-request-id header response. - ClientRequestID *string - - // Date contains the information returned from the Date header response. - Date *time.Time - - // PreferenceApplied contains the information returned from the Preference-Applied header response. - PreferenceApplied *string - - // RawResponse contains the underlying HTTP response. - RawResponse *http.Response - - // RequestID contains the information returned from the x-ms-request-id header response. - RequestID *string - - // Version contains the information returned from the x-ms-version header response. - Version *string -} - // TableDeleteEntityOptions contains the optional parameters for the Table.DeleteEntity method. type TableDeleteEntityOptions struct { // Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the analytics logs when analytics logging is enabled. @@ -311,85 +225,27 @@ type TableDeleteEntityOptions struct { Timeout *int32 } -// TableDeleteEntityResponse contains the response from method Table.DeleteEntity. -type TableDeleteEntityResponse struct { - // ClientRequestID contains the information returned from the x-ms-client-request-id header response. - ClientRequestID *string - - // Date contains the information returned from the Date header response. - Date *time.Time - - // RawResponse contains the underlying HTTP response. - RawResponse *http.Response - - // RequestID contains the information returned from the x-ms-request-id header response. - RequestID *string - - // Version contains the information returned from the x-ms-version header response. - Version *string -} - // TableDeleteOptions contains the optional parameters for the Table.Delete method. type TableDeleteOptions struct { // Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the analytics logs when analytics logging is enabled. RequestID *string } -// TableDeleteResponse contains the response from method Table.Delete. -type TableDeleteResponse struct { - // ClientRequestID contains the information returned from the x-ms-client-request-id header response. - ClientRequestID *string - - // Date contains the information returned from the Date header response. - Date *time.Time - - // RawResponse contains the underlying HTTP response. - RawResponse *http.Response - - // RequestID contains the information returned from the x-ms-request-id header response. - RequestID *string - - // Version contains the information returned from the x-ms-version header response. - Version *string -} - -// The properties for the table entity query response. +// TableEntityQueryResponse - The properties for the table entity query response. type TableEntityQueryResponse struct { // The metadata response of the table. OdataMetadata *string `json:"odata.metadata,omitempty"` // List of table entities. - Value *[]map[string]interface{} `json:"value,omitempty"` + Value []map[string]interface{} `json:"value,omitempty"` } -// TableEntityQueryResponseResponse is the response envelope for operations that return a TableEntityQueryResponse type. -type TableEntityQueryResponseResponse struct { - // ClientRequestID contains the information returned from the x-ms-client-request-id header response. - ClientRequestID *string - - // Date contains the information returned from the Date header response. - Date *time.Time - - // ETag contains the information returned from the ETag header response. - ETag *string - - // RawResponse contains the underlying HTTP response. - RawResponse *http.Response - - // RequestID contains the information returned from the x-ms-request-id header response. - RequestID *string - - // The properties for the table entity query response. - TableEntityQueryResponse *TableEntityQueryResponse - - // Version contains the information returned from the x-ms-version header response. - Version *string - - // XMSContinuationNextPartitionKey contains the information returned from the x-ms-continuation-NextPartitionKey header response. - XMSContinuationNextPartitionKey *string - - // XMSContinuationNextRowKey contains the information returned from the x-ms-continuation-NextRowKey header response. - XMSContinuationNextRowKey *string +// MarshalJSON implements the json.Marshaller interface for type TableEntityQueryResponse. +func (t TableEntityQueryResponse) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "odata.metadata", t.OdataMetadata) + populate(objectMap, "value", t.Value) + return json.Marshal(objectMap) } // TableGetAccessPolicyOptions contains the optional parameters for the Table.GetAccessPolicy method. @@ -407,38 +263,11 @@ type TableInsertEntityOptions struct { // Specifies whether the response should include the inserted entity in the payload. Possible values are return-no-content and return-content. ResponsePreference *ResponseFormat // The properties for the table entity. - TableEntityProperties *map[string]interface{} + TableEntityProperties map[string]interface{} // The timeout parameter is expressed in seconds. Timeout *int32 } -// TableInsertEntityResponse contains the response from method Table.InsertEntity. -type TableInsertEntityResponse struct { - // ClientRequestID contains the information returned from the x-ms-client-request-id header response. - ClientRequestID *string - - // ContentType contains the information returned from the Content-Type header response. - ContentType *string - - // Date contains the information returned from the Date header response. - Date *time.Time - - // ETag contains the information returned from the ETag header response. - ETag *string - - // PreferenceApplied contains the information returned from the Preference-Applied header response. - PreferenceApplied *string - - // RawResponse contains the underlying HTTP response. - RawResponse *http.Response - - // RequestID contains the information returned from the x-ms-request-id header response. - RequestID *string - - // Version contains the information returned from the x-ms-version header response. - Version *string -} - // TableMergeEntityOptions contains the optional parameters for the Table.MergeEntity method. type TableMergeEntityOptions struct { // Match condition for an entity to be updated. If specified and a matching entity is not found, an error will be raised. To force an unconditional update, @@ -448,33 +277,12 @@ type TableMergeEntityOptions struct { // Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the analytics logs when analytics logging is enabled. RequestID *string // The properties for the table entity. - TableEntityProperties *map[string]interface{} + TableEntityProperties map[string]interface{} // The timeout parameter is expressed in seconds. Timeout *int32 } -// TableMergeEntityResponse contains the response from method Table.MergeEntity. -type TableMergeEntityResponse struct { - // ClientRequestID contains the information returned from the x-ms-client-request-id header response. - ClientRequestID *string - - // Date contains the information returned from the Date header response. - Date *time.Time - - // ETag contains the information returned from the ETag header response. - ETag *string - - // RawResponse contains the underlying HTTP response. - RawResponse *http.Response - - // RequestID contains the information returned from the x-ms-request-id header response. - RequestID *string - - // Version contains the information returned from the x-ms-version header response. - Version *string -} - -// The properties for creating a table. +// TableProperties - The properties for creating a table. type TableProperties struct { // The name of the table to create. TableName *string `json:"TableName,omitempty"` @@ -492,8 +300,8 @@ type TableQueryEntitiesOptions struct { Timeout *int32 } -// TableQueryEntitiesWithPartitionAndRowKeyOptions contains the optional parameters for the Table.QueryEntitiesWithPartitionAndRowKey method. -type TableQueryEntitiesWithPartitionAndRowKeyOptions struct { +// TableQueryEntityWithPartitionAndRowKeyOptions contains the optional parameters for the Table.QueryEntityWithPartitionAndRowKey method. +type TableQueryEntityWithPartitionAndRowKeyOptions struct { // Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the analytics logs when analytics logging is enabled. RequestID *string // The timeout parameter is expressed in seconds. @@ -508,47 +316,31 @@ type TableQueryOptions struct { RequestID *string } -// The properties for the table query response. +// TableQueryResponse - The properties for the table query response. type TableQueryResponse struct { // The metadata response of the table. OdataMetadata *string `json:"odata.metadata,omitempty"` // List of tables. - Value *[]TableResponseProperties `json:"value,omitempty"` + Value []*TableResponseProperties `json:"value,omitempty"` } -// TableQueryResponseResponse is the response envelope for operations that return a TableQueryResponse type. -type TableQueryResponseResponse struct { - // ClientRequestID contains the information returned from the x-ms-client-request-id header response. - ClientRequestID *string - - // Date contains the information returned from the Date header response. - Date *time.Time - - // RawResponse contains the underlying HTTP response. - RawResponse *http.Response - - // RequestID contains the information returned from the x-ms-request-id header response. - RequestID *string - - // The properties for the table query response. - TableQueryResponse *TableQueryResponse - - // Version contains the information returned from the x-ms-version header response. - Version *string - - // XMSContinuationNextTableName contains the information returned from the x-ms-continuation-NextTableName header response. - XMSContinuationNextTableName *string +// MarshalJSON implements the json.Marshaller interface for type TableQueryResponse. +func (t TableQueryResponse) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "odata.metadata", t.OdataMetadata) + populate(objectMap, "value", t.Value) + return json.Marshal(objectMap) } -// The response for a single table. +// TableResponse - The response for a single table. type TableResponse struct { TableResponseProperties // The metadata response of the table. OdataMetadata *string `json:"odata.metadata,omitempty"` } -// The properties for the table response. +// TableResponseProperties - The properties for the table response. type TableResponseProperties struct { // The edit link of the table. OdataEditLink *string `json:"odata.editLink,omitempty"` @@ -563,52 +355,24 @@ type TableResponseProperties struct { TableName *string `json:"TableName,omitempty"` } -// TableResponseResponse is the response envelope for operations that return a TableResponse type. -type TableResponseResponse struct { - // ClientRequestID contains the information returned from the x-ms-client-request-id header response. - ClientRequestID *string - - // Date contains the information returned from the Date header response. - Date *time.Time - - // PreferenceApplied contains the information returned from the Preference-Applied header response. - PreferenceApplied *string - - // RawResponse contains the underlying HTTP response. - RawResponse *http.Response - - // RequestID contains the information returned from the x-ms-request-id header response. - RequestID *string - - // The response for a single table. - TableResponse *TableResponse - - // Version contains the information returned from the x-ms-version header response. - Version *string -} - -// Table Service error. +// TableServiceError - Table Service error. +// Implements the error and azcore.HTTPResponse interfaces. type TableServiceError struct { + raw string // The error message. Message *string `json:"Message,omitempty"` } // Error implements the error interface for type TableServiceError. +// The contents of the error text are not contractual and subject to change. func (e TableServiceError) Error() string { - msg := "" - if e.Message != nil { - msg += fmt.Sprintf("Message: %v\n", *e.Message) - } - if msg == "" { - msg = "missing error info" - } - return msg + return e.raw } -// Table Service Properties. +// TableServiceProperties - Table Service Properties. type TableServiceProperties struct { // The set of CORS rules. - Cors *[]CorsRule `xml:"Cors>CorsRule"` + Cors []*CorsRule `xml:"Cors>CorsRule"` // A summary of request statistics grouped by API in hourly aggregates for tables. HourMetrics *Metrics `xml:"HourMetrics"` @@ -626,85 +390,32 @@ func (t TableServiceProperties) MarshalXML(e *xml.Encoder, start xml.StartElemen type alias TableServiceProperties aux := &struct { *alias + Cors *[]*CorsRule `xml:"Cors>CorsRule"` }{ alias: (*alias)(&t), } + if t.Cors != nil { + aux.Cors = &t.Cors + } return e.EncodeElement(aux, start) } -// TableServicePropertiesResponse is the response envelope for operations that return a TableServiceProperties type. -type TableServicePropertiesResponse struct { - // ClientRequestID contains the information returned from the x-ms-client-request-id header response. - ClientRequestID *string `xml:"ClientRequestID"` - - // RawResponse contains the underlying HTTP response. - RawResponse *http.Response - - // RequestID contains the information returned from the x-ms-request-id header response. - RequestID *string `xml:"RequestID"` - - // Table Service Properties. - StorageServiceProperties *TableServiceProperties `xml:"StorageServiceProperties"` - - // Version contains the information returned from the x-ms-version header response. - Version *string `xml:"Version"` -} - -// Stats for the service. +// TableServiceStats - Stats for the service. type TableServiceStats struct { // Geo-Replication information for the Secondary Storage Service. GeoReplication *GeoReplication `xml:"GeoReplication"` } -// TableServiceStatsResponse is the response envelope for operations that return a TableServiceStats type. -type TableServiceStatsResponse struct { - // ClientRequestID contains the information returned from the x-ms-client-request-id header response. - ClientRequestID *string `xml:"ClientRequestID"` - - // Date contains the information returned from the Date header response. - Date *time.Time `xml:"Date"` - - // RawResponse contains the underlying HTTP response. - RawResponse *http.Response - - // RequestID contains the information returned from the x-ms-request-id header response. - RequestID *string `xml:"RequestID"` - - // Stats for the service. - StorageServiceStats *TableServiceStats `xml:"StorageServiceStats"` - - // Version contains the information returned from the x-ms-version header response. - Version *string `xml:"Version"` -} - // TableSetAccessPolicyOptions contains the optional parameters for the Table.SetAccessPolicy method. type TableSetAccessPolicyOptions struct { // Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the analytics logs when analytics logging is enabled. RequestID *string // The acls for the table. - TableACL *[]SignedIdentifier + TableACL []*SignedIdentifier // The timeout parameter is expressed in seconds. Timeout *int32 } -// TableSetAccessPolicyResponse contains the response from method Table.SetAccessPolicy. -type TableSetAccessPolicyResponse struct { - // ClientRequestID contains the information returned from the x-ms-client-request-id header response. - ClientRequestID *string - - // Date contains the information returned from the Date header response. - Date *time.Time - - // RawResponse contains the underlying HTTP response. - RawResponse *http.Response - - // RequestID contains the information returned from the x-ms-request-id header response. - RequestID *string - - // Version contains the information returned from the x-ms-version header response. - Version *string -} - // TableUpdateEntityOptions contains the optional parameters for the Table.UpdateEntity method. type TableUpdateEntityOptions struct { // Match condition for an entity to be updated. If specified and a matching entity is not found, an error will be raised. To force an unconditional update, @@ -714,28 +425,17 @@ type TableUpdateEntityOptions struct { // Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the analytics logs when analytics logging is enabled. RequestID *string // The properties for the table entity. - TableEntityProperties *map[string]interface{} + TableEntityProperties map[string]interface{} // The timeout parameter is expressed in seconds. Timeout *int32 } -// TableUpdateEntityResponse contains the response from method Table.UpdateEntity. -type TableUpdateEntityResponse struct { - // ClientRequestID contains the information returned from the x-ms-client-request-id header response. - ClientRequestID *string - - // Date contains the information returned from the Date header response. - Date *time.Time - - // ETag contains the information returned from the ETag header response. - ETag *string - - // RawResponse contains the underlying HTTP response. - RawResponse *http.Response - - // RequestID contains the information returned from the x-ms-request-id header response. - RequestID *string - - // Version contains the information returned from the x-ms-version header response. - Version *string +func populate(m map[string]interface{}, k string, v interface{}) { + if v == nil { + return + } else if azcore.IsNullValue(v) { + m[k] = nil + } else if !reflect.ValueOf(v).IsNil() { + m[k] = v + } } diff --git a/sdk/tables/aztables/zz_generated_response_types.go b/sdk/tables/aztables/zz_generated_response_types.go new file mode 100644 index 000000000000..ec81d9e0ca7b --- /dev/null +++ b/sdk/tables/aztables/zz_generated_response_types.go @@ -0,0 +1,343 @@ +// +build go1.13 + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +package aztables + +import ( + "net/http" + "time" +) + +// MapOfInterfaceResponse is the response envelope for operations that return a map[string]interface{} type. +type MapOfInterfaceResponse struct { + // ClientRequestID contains the information returned from the x-ms-client-request-id header response. + ClientRequestID *string + + // ContentType contains the information returned from the Content-Type header response. + ContentType *string + + // Date contains the information returned from the Date header response. + Date *time.Time + + // ETag contains the information returned from the ETag header response. + ETag *string + + // PreferenceApplied contains the information returned from the Preference-Applied header response. + PreferenceApplied *string + + // RawResponse contains the underlying HTTP response. + RawResponse *http.Response + + // RequestID contains the information returned from the x-ms-request-id header response. + RequestID *string + + // The other properties of the table entity. + Value map[string]interface{} + + // Version contains the information returned from the x-ms-version header response. + Version *string + + // XMSContinuationNextPartitionKey contains the information returned from the x-ms-continuation-NextPartitionKey header response. + XMSContinuationNextPartitionKey *string + + // XMSContinuationNextRowKey contains the information returned from the x-ms-continuation-NextRowKey header response. + XMSContinuationNextRowKey *string +} + +// ServiceSetPropertiesResponse contains the response from method Service.SetProperties. +type ServiceSetPropertiesResponse struct { + // ClientRequestID contains the information returned from the x-ms-client-request-id header response. + ClientRequestID *string + + // RawResponse contains the underlying HTTP response. + RawResponse *http.Response + + // RequestID contains the information returned from the x-ms-request-id header response. + RequestID *string + + // Version contains the information returned from the x-ms-version header response. + Version *string +} + +// SignedIdentifierArrayResponse is the response envelope for operations that return a []*SignedIdentifier type. +type SignedIdentifierArrayResponse struct { + // ClientRequestID contains the information returned from the x-ms-client-request-id header response. + ClientRequestID *string `xml:"ClientRequestID"` + + // Date contains the information returned from the Date header response. + Date *time.Time `xml:"Date"` + + // RawResponse contains the underlying HTTP response. + RawResponse *http.Response + + // RequestID contains the information returned from the x-ms-request-id header response. + RequestID *string `xml:"RequestID"` + + // A collection of signed identifiers. + SignedIdentifiers []*SignedIdentifier `xml:"SignedIdentifier"` + + // Version contains the information returned from the x-ms-version header response. + Version *string `xml:"Version"` +} + +// TableCreateResponse contains the response from method Table.Create. +type TableCreateResponse struct { + // ClientRequestID contains the information returned from the x-ms-client-request-id header response. + ClientRequestID *string + + // Date contains the information returned from the Date header response. + Date *time.Time + + // PreferenceApplied contains the information returned from the Preference-Applied header response. + PreferenceApplied *string + + // RawResponse contains the underlying HTTP response. + RawResponse *http.Response + + // RequestID contains the information returned from the x-ms-request-id header response. + RequestID *string + + // Version contains the information returned from the x-ms-version header response. + Version *string +} + +// TableDeleteEntityResponse contains the response from method Table.DeleteEntity. +type TableDeleteEntityResponse struct { + // ClientRequestID contains the information returned from the x-ms-client-request-id header response. + ClientRequestID *string + + // Date contains the information returned from the Date header response. + Date *time.Time + + // RawResponse contains the underlying HTTP response. + RawResponse *http.Response + + // RequestID contains the information returned from the x-ms-request-id header response. + RequestID *string + + // Version contains the information returned from the x-ms-version header response. + Version *string +} + +// TableDeleteResponse contains the response from method Table.Delete. +type TableDeleteResponse struct { + // ClientRequestID contains the information returned from the x-ms-client-request-id header response. + ClientRequestID *string + + // Date contains the information returned from the Date header response. + Date *time.Time + + // RawResponse contains the underlying HTTP response. + RawResponse *http.Response + + // RequestID contains the information returned from the x-ms-request-id header response. + RequestID *string + + // Version contains the information returned from the x-ms-version header response. + Version *string +} + +// TableEntityQueryResponseResponse is the response envelope for operations that return a TableEntityQueryResponse type. +type TableEntityQueryResponseResponse struct { + // ClientRequestID contains the information returned from the x-ms-client-request-id header response. + ClientRequestID *string + + // Date contains the information returned from the Date header response. + Date *time.Time + + // RawResponse contains the underlying HTTP response. + RawResponse *http.Response + + // RequestID contains the information returned from the x-ms-request-id header response. + RequestID *string + + // The properties for the table entity query response. + TableEntityQueryResponse *TableEntityQueryResponse + + // Version contains the information returned from the x-ms-version header response. + Version *string + + // XMSContinuationNextPartitionKey contains the information returned from the x-ms-continuation-NextPartitionKey header response. + XMSContinuationNextPartitionKey *string + + // XMSContinuationNextRowKey contains the information returned from the x-ms-continuation-NextRowKey header response. + XMSContinuationNextRowKey *string +} + +// TableInsertEntityResponse contains the response from method Table.InsertEntity. +type TableInsertEntityResponse struct { + // ClientRequestID contains the information returned from the x-ms-client-request-id header response. + ClientRequestID *string + + // ContentType contains the information returned from the Content-Type header response. + ContentType *string + + // Date contains the information returned from the Date header response. + Date *time.Time + + // ETag contains the information returned from the ETag header response. + ETag *string + + // PreferenceApplied contains the information returned from the Preference-Applied header response. + PreferenceApplied *string + + // RawResponse contains the underlying HTTP response. + RawResponse *http.Response + + // RequestID contains the information returned from the x-ms-request-id header response. + RequestID *string + + // Version contains the information returned from the x-ms-version header response. + Version *string +} + +// TableMergeEntityResponse contains the response from method Table.MergeEntity. +type TableMergeEntityResponse struct { + // ClientRequestID contains the information returned from the x-ms-client-request-id header response. + ClientRequestID *string + + // Date contains the information returned from the Date header response. + Date *time.Time + + // ETag contains the information returned from the ETag header response. + ETag *string + + // RawResponse contains the underlying HTTP response. + RawResponse *http.Response + + // RequestID contains the information returned from the x-ms-request-id header response. + RequestID *string + + // Version contains the information returned from the x-ms-version header response. + Version *string +} + +// TableQueryResponseResponse is the response envelope for operations that return a TableQueryResponse type. +type TableQueryResponseResponse struct { + // ClientRequestID contains the information returned from the x-ms-client-request-id header response. + ClientRequestID *string + + // Date contains the information returned from the Date header response. + Date *time.Time + + // RawResponse contains the underlying HTTP response. + RawResponse *http.Response + + // RequestID contains the information returned from the x-ms-request-id header response. + RequestID *string + + // The properties for the table query response. + TableQueryResponse *TableQueryResponse + + // Version contains the information returned from the x-ms-version header response. + Version *string + + // XMSContinuationNextTableName contains the information returned from the x-ms-continuation-NextTableName header response. + XMSContinuationNextTableName *string +} + +// TableResponseResponse is the response envelope for operations that return a TableResponse type. +type TableResponseResponse struct { + // ClientRequestID contains the information returned from the x-ms-client-request-id header response. + ClientRequestID *string + + // Date contains the information returned from the Date header response. + Date *time.Time + + // PreferenceApplied contains the information returned from the Preference-Applied header response. + PreferenceApplied *string + + // RawResponse contains the underlying HTTP response. + RawResponse *http.Response + + // RequestID contains the information returned from the x-ms-request-id header response. + RequestID *string + + // The response for a single table. + TableResponse *TableResponse + + // Version contains the information returned from the x-ms-version header response. + Version *string +} + +// TableServicePropertiesResponse is the response envelope for operations that return a TableServiceProperties type. +type TableServicePropertiesResponse struct { + // ClientRequestID contains the information returned from the x-ms-client-request-id header response. + ClientRequestID *string `xml:"ClientRequestID"` + + // RawResponse contains the underlying HTTP response. + RawResponse *http.Response + + // RequestID contains the information returned from the x-ms-request-id header response. + RequestID *string `xml:"RequestID"` + + // Table Service Properties. + StorageServiceProperties *TableServiceProperties `xml:"StorageServiceProperties"` + + // Version contains the information returned from the x-ms-version header response. + Version *string `xml:"Version"` +} + +// TableServiceStatsResponse is the response envelope for operations that return a TableServiceStats type. +type TableServiceStatsResponse struct { + // ClientRequestID contains the information returned from the x-ms-client-request-id header response. + ClientRequestID *string `xml:"ClientRequestID"` + + // Date contains the information returned from the Date header response. + Date *time.Time `xml:"Date"` + + // RawResponse contains the underlying HTTP response. + RawResponse *http.Response + + // RequestID contains the information returned from the x-ms-request-id header response. + RequestID *string `xml:"RequestID"` + + // Stats for the service. + StorageServiceStats *TableServiceStats `xml:"StorageServiceStats"` + + // Version contains the information returned from the x-ms-version header response. + Version *string `xml:"Version"` +} + +// TableSetAccessPolicyResponse contains the response from method Table.SetAccessPolicy. +type TableSetAccessPolicyResponse struct { + // ClientRequestID contains the information returned from the x-ms-client-request-id header response. + ClientRequestID *string + + // Date contains the information returned from the Date header response. + Date *time.Time + + // RawResponse contains the underlying HTTP response. + RawResponse *http.Response + + // RequestID contains the information returned from the x-ms-request-id header response. + RequestID *string + + // Version contains the information returned from the x-ms-version header response. + Version *string +} + +// TableUpdateEntityResponse contains the response from method Table.UpdateEntity. +type TableUpdateEntityResponse struct { + // ClientRequestID contains the information returned from the x-ms-client-request-id header response. + ClientRequestID *string + + // Date contains the information returned from the Date header response. + Date *time.Time + + // ETag contains the information returned from the ETag header response. + ETag *string + + // RawResponse contains the underlying HTTP response. + RawResponse *http.Response + + // RequestID contains the information returned from the x-ms-request-id header response. + RequestID *string + + // Version contains the information returned from the x-ms-version header response. + Version *string +} diff --git a/sdk/tables/aztables/zz_generated_service.go b/sdk/tables/aztables/zz_generated_service_client.go similarity index 79% rename from sdk/tables/aztables/zz_generated_service.go rename to sdk/tables/aztables/zz_generated_service_client.go index 182f446e1484..014bdf4fee9e 100644 --- a/sdk/tables/aztables/zz_generated_service.go +++ b/sdk/tables/aztables/zz_generated_service_client.go @@ -9,11 +9,11 @@ package aztables import ( "context" + "fmt" + "github.com/Azure/azure-sdk-for-go/sdk/azcore" "net/http" "strconv" "time" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore" ) type serviceClient struct { @@ -21,6 +21,7 @@ type serviceClient struct { } // GetProperties - Gets the properties of an account's Table service, including properties for Analytics and CORS (Cross-Origin Resource Sharing) rules. +// If the operation fails it returns the *TableServiceError error type. func (client *serviceClient) GetProperties(ctx context.Context, options *ServiceGetPropertiesOptions) (TableServicePropertiesResponse, error) { req, err := client.getPropertiesCreateRequest(ctx, options) if err != nil { @@ -43,13 +44,13 @@ func (client *serviceClient) getPropertiesCreateRequest(ctx context.Context, opt return nil, err } req.Telemetry(telemetryInfo) - query := req.URL.Query() - query.Set("restype", "service") - query.Set("comp", "properties") + reqQP := req.URL.Query() + reqQP.Set("restype", "service") + reqQP.Set("comp", "properties") if options != nil && options.Timeout != nil { - query.Set("timeout", strconv.FormatInt(int64(*options.Timeout), 10)) + reqQP.Set("timeout", strconv.FormatInt(int64(*options.Timeout), 10)) } - req.URL.RawQuery = query.Encode() + req.URL.RawQuery = reqQP.Encode() req.Header.Set("x-ms-version", "2019-02-02") if options != nil && options.RequestID != nil { req.Header.Set("x-ms-client-request-id", *options.RequestID) @@ -79,15 +80,20 @@ func (client *serviceClient) getPropertiesHandleResponse(resp *azcore.Response) // getPropertiesHandleError handles the GetProperties error response. func (client *serviceClient) getPropertiesHandleError(resp *azcore.Response) error { - var err TableServiceError - if err := resp.UnmarshalAsJSON(&err); err != nil { - return err + body, err := resp.Payload() + if err != nil { + return azcore.NewResponseError(err, resp.Response) + } + errType := TableServiceError{raw: string(body)} + if err := resp.UnmarshalAsJSON(&errType); err != nil { + return azcore.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp.Response) } - return azcore.NewResponseError(&err, resp.Response) + return azcore.NewResponseError(&errType, resp.Response) } // GetStatistics - Retrieves statistics related to replication for the Table service. It is only available on the secondary location endpoint when read-access // geo-redundant replication is enabled for the account. +// If the operation fails it returns the *TableServiceError error type. func (client *serviceClient) GetStatistics(ctx context.Context, options *ServiceGetStatisticsOptions) (TableServiceStatsResponse, error) { req, err := client.getStatisticsCreateRequest(ctx, options) if err != nil { @@ -110,13 +116,13 @@ func (client *serviceClient) getStatisticsCreateRequest(ctx context.Context, opt return nil, err } req.Telemetry(telemetryInfo) - query := req.URL.Query() - query.Set("restype", "service") - query.Set("comp", "stats") + reqQP := req.URL.Query() + reqQP.Set("restype", "service") + reqQP.Set("comp", "stats") if options != nil && options.Timeout != nil { - query.Set("timeout", strconv.FormatInt(int64(*options.Timeout), 10)) + reqQP.Set("timeout", strconv.FormatInt(int64(*options.Timeout), 10)) } - req.URL.RawQuery = query.Encode() + req.URL.RawQuery = reqQP.Encode() req.Header.Set("x-ms-version", "2019-02-02") if options != nil && options.RequestID != nil { req.Header.Set("x-ms-client-request-id", *options.RequestID) @@ -153,15 +159,20 @@ func (client *serviceClient) getStatisticsHandleResponse(resp *azcore.Response) // getStatisticsHandleError handles the GetStatistics error response. func (client *serviceClient) getStatisticsHandleError(resp *azcore.Response) error { - var err TableServiceError - if err := resp.UnmarshalAsJSON(&err); err != nil { - return err + body, err := resp.Payload() + if err != nil { + return azcore.NewResponseError(err, resp.Response) + } + errType := TableServiceError{raw: string(body)} + if err := resp.UnmarshalAsJSON(&errType); err != nil { + return azcore.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp.Response) } - return azcore.NewResponseError(&err, resp.Response) + return azcore.NewResponseError(&errType, resp.Response) } // SetProperties - Sets properties for an account's Table service endpoint, including properties for Analytics and CORS (Cross-Origin Resource Sharing) // rules. +// If the operation fails it returns the *TableServiceError error type. func (client *serviceClient) SetProperties(ctx context.Context, tableServiceProperties TableServiceProperties, options *ServiceSetPropertiesOptions) (ServiceSetPropertiesResponse, error) { req, err := client.setPropertiesCreateRequest(ctx, tableServiceProperties, options) if err != nil { @@ -184,13 +195,13 @@ func (client *serviceClient) setPropertiesCreateRequest(ctx context.Context, tab return nil, err } req.Telemetry(telemetryInfo) - query := req.URL.Query() - query.Set("restype", "service") - query.Set("comp", "properties") + reqQP := req.URL.Query() + reqQP.Set("restype", "service") + reqQP.Set("comp", "properties") if options != nil && options.Timeout != nil { - query.Set("timeout", strconv.FormatInt(int64(*options.Timeout), 10)) + reqQP.Set("timeout", strconv.FormatInt(int64(*options.Timeout), 10)) } - req.URL.RawQuery = query.Encode() + req.URL.RawQuery = reqQP.Encode() req.Header.Set("x-ms-version", "2019-02-02") if options != nil && options.RequestID != nil { req.Header.Set("x-ms-client-request-id", *options.RequestID) @@ -216,9 +227,13 @@ func (client *serviceClient) setPropertiesHandleResponse(resp *azcore.Response) // setPropertiesHandleError handles the SetProperties error response. func (client *serviceClient) setPropertiesHandleError(resp *azcore.Response) error { - var err TableServiceError - if err := resp.UnmarshalAsJSON(&err); err != nil { - return err + body, err := resp.Payload() + if err != nil { + return azcore.NewResponseError(err, resp.Response) + } + errType := TableServiceError{raw: string(body)} + if err := resp.UnmarshalAsJSON(&errType); err != nil { + return azcore.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp.Response) } - return azcore.NewResponseError(&err, resp.Response) + return azcore.NewResponseError(&errType, resp.Response) } diff --git a/sdk/tables/aztables/zz_generated_table.go b/sdk/tables/aztables/zz_generated_table_client.go similarity index 74% rename from sdk/tables/aztables/zz_generated_table.go rename to sdk/tables/aztables/zz_generated_table_client.go index b7bf3cd8a88d..322ff68c7481 100644 --- a/sdk/tables/aztables/zz_generated_table.go +++ b/sdk/tables/aztables/zz_generated_table_client.go @@ -12,7 +12,6 @@ import ( "encoding/xml" "errors" "fmt" - "io/ioutil" "net/http" "net/url" "strconv" @@ -27,6 +26,7 @@ type tableClient struct { } // Create - Creates a new table under the given account. +// If the operation fails it returns the *TableServiceError error type. // Possible return types are *TableResponseResponse, *TableCreateResponse func (client *tableClient) Create(ctx context.Context, tableProperties TableProperties, tableCreateOptions *TableCreateOptions, queryOptions *QueryOptions) (interface{}, error) { req, err := client.createCreateRequest(ctx, tableProperties, tableCreateOptions, queryOptions) @@ -51,11 +51,11 @@ func (client *tableClient) createCreateRequest(ctx context.Context, tablePropert return nil, err } req.Telemetry(telemetryInfo) - query := req.URL.Query() + reqQP := req.URL.Query() if queryOptions != nil && queryOptions.Format != nil { - query.Set("$format", string(*queryOptions.Format)) + reqQP.Set("$format", string(*queryOptions.Format)) } - req.URL.RawQuery = query.Encode() + req.URL.RawQuery = reqQP.Encode() req.Header.Set("x-ms-version", "2019-02-02") if tableCreateOptions != nil && tableCreateOptions.RequestID != nil { req.Header.Set("x-ms-client-request-id", *tableCreateOptions.RequestID) @@ -126,14 +126,19 @@ func (client *tableClient) createHandleResponse(resp *azcore.Response) (interfac // createHandleError handles the Create error response. func (client *tableClient) createHandleError(resp *azcore.Response) error { - var err TableServiceError - if err := resp.UnmarshalAsJSON(&err); err != nil { - return err + body, err := resp.Payload() + if err != nil { + return azcore.NewResponseError(err, resp.Response) + } + errType := TableServiceError{raw: string(body)} + if err := resp.UnmarshalAsJSON(&errType); err != nil { + return azcore.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp.Response) } - return azcore.NewResponseError(&err, resp.Response) + return azcore.NewResponseError(&errType, resp.Response) } // Delete - Operation permanently deletes the specified table. +// If the operation fails it returns the *TableServiceError error type. func (client *tableClient) Delete(ctx context.Context, table string, options *TableDeleteOptions) (TableDeleteResponse, error) { req, err := client.deleteCreateRequest(ctx, table, options) if err != nil { @@ -152,6 +157,9 @@ func (client *tableClient) Delete(ctx context.Context, table string, options *Ta // deleteCreateRequest creates the Delete request. func (client *tableClient) deleteCreateRequest(ctx context.Context, table string, options *TableDeleteOptions) (*azcore.Request, error) { urlPath := "/Tables('{table}')" + if table == "" { + return nil, errors.New("parameter table cannot be empty") + } urlPath = strings.ReplaceAll(urlPath, "{table}", url.PathEscape(table)) req, err := azcore.NewRequest(ctx, http.MethodDelete, azcore.JoinPaths(client.con.Endpoint(), urlPath)) if err != nil { @@ -190,14 +198,19 @@ func (client *tableClient) deleteHandleResponse(resp *azcore.Response) (TableDel // deleteHandleError handles the Delete error response. func (client *tableClient) deleteHandleError(resp *azcore.Response) error { - var err TableServiceError - if err := resp.UnmarshalAsJSON(&err); err != nil { - return err + body, err := resp.Payload() + if err != nil { + return azcore.NewResponseError(err, resp.Response) } - return azcore.NewResponseError(&err, resp.Response) + errType := TableServiceError{raw: string(body)} + if err := resp.UnmarshalAsJSON(&errType); err != nil { + return azcore.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp.Response) + } + return azcore.NewResponseError(&errType, resp.Response) } // DeleteEntity - Deletes the specified entity in a table. +// If the operation fails it returns the *TableServiceError error type. func (client *tableClient) DeleteEntity(ctx context.Context, table string, partitionKey string, rowKey string, ifMatch string, tableDeleteEntityOptions *TableDeleteEntityOptions, queryOptions *QueryOptions) (TableDeleteEntityResponse, error) { req, err := client.deleteEntityCreateRequest(ctx, table, partitionKey, rowKey, ifMatch, tableDeleteEntityOptions, queryOptions) if err != nil { @@ -216,22 +229,31 @@ func (client *tableClient) DeleteEntity(ctx context.Context, table string, parti // deleteEntityCreateRequest creates the DeleteEntity request. func (client *tableClient) deleteEntityCreateRequest(ctx context.Context, table string, partitionKey string, rowKey string, ifMatch string, tableDeleteEntityOptions *TableDeleteEntityOptions, queryOptions *QueryOptions) (*azcore.Request, error) { urlPath := "/{table}(PartitionKey='{partitionKey}',RowKey='{rowKey}')" + if table == "" { + return nil, errors.New("parameter table cannot be empty") + } urlPath = strings.ReplaceAll(urlPath, "{table}", url.PathEscape(table)) + if partitionKey == "" { + return nil, errors.New("parameter partitionKey cannot be empty") + } urlPath = strings.ReplaceAll(urlPath, "{partitionKey}", url.PathEscape(partitionKey)) + if rowKey == "" { + return nil, errors.New("parameter rowKey cannot be empty") + } urlPath = strings.ReplaceAll(urlPath, "{rowKey}", url.PathEscape(rowKey)) req, err := azcore.NewRequest(ctx, http.MethodDelete, azcore.JoinPaths(client.con.Endpoint(), urlPath)) if err != nil { return nil, err } req.Telemetry(telemetryInfo) - query := req.URL.Query() + reqQP := req.URL.Query() if tableDeleteEntityOptions != nil && tableDeleteEntityOptions.Timeout != nil { - query.Set("timeout", strconv.FormatInt(int64(*tableDeleteEntityOptions.Timeout), 10)) + reqQP.Set("timeout", strconv.FormatInt(int64(*tableDeleteEntityOptions.Timeout), 10)) } if queryOptions != nil && queryOptions.Format != nil { - query.Set("$format", string(*queryOptions.Format)) + reqQP.Set("$format", string(*queryOptions.Format)) } - req.URL.RawQuery = query.Encode() + req.URL.RawQuery = reqQP.Encode() req.Header.Set("x-ms-version", "2019-02-02") if tableDeleteEntityOptions != nil && tableDeleteEntityOptions.RequestID != nil { req.Header.Set("x-ms-client-request-id", *tableDeleteEntityOptions.RequestID) @@ -266,14 +288,19 @@ func (client *tableClient) deleteEntityHandleResponse(resp *azcore.Response) (Ta // deleteEntityHandleError handles the DeleteEntity error response. func (client *tableClient) deleteEntityHandleError(resp *azcore.Response) error { - var err TableServiceError - if err := resp.UnmarshalAsJSON(&err); err != nil { - return err + body, err := resp.Payload() + if err != nil { + return azcore.NewResponseError(err, resp.Response) } - return azcore.NewResponseError(&err, resp.Response) + errType := TableServiceError{raw: string(body)} + if err := resp.UnmarshalAsJSON(&errType); err != nil { + return azcore.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp.Response) + } + return azcore.NewResponseError(&errType, resp.Response) } // GetAccessPolicy - Retrieves details about any stored access policies specified on the table that may be used with Shared Access Signatures. +// If the operation fails it returns the *TableServiceError error type. func (client *tableClient) GetAccessPolicy(ctx context.Context, table string, options *TableGetAccessPolicyOptions) (SignedIdentifierArrayResponse, error) { req, err := client.getAccessPolicyCreateRequest(ctx, table, options) if err != nil { @@ -292,18 +319,21 @@ func (client *tableClient) GetAccessPolicy(ctx context.Context, table string, op // getAccessPolicyCreateRequest creates the GetAccessPolicy request. func (client *tableClient) getAccessPolicyCreateRequest(ctx context.Context, table string, options *TableGetAccessPolicyOptions) (*azcore.Request, error) { urlPath := "/{table}" + if table == "" { + return nil, errors.New("parameter table cannot be empty") + } urlPath = strings.ReplaceAll(urlPath, "{table}", url.PathEscape(table)) req, err := azcore.NewRequest(ctx, http.MethodGet, azcore.JoinPaths(client.con.Endpoint(), urlPath)) if err != nil { return nil, err } req.Telemetry(telemetryInfo) - query := req.URL.Query() + reqQP := req.URL.Query() if options != nil && options.Timeout != nil { - query.Set("timeout", strconv.FormatInt(int64(*options.Timeout), 10)) + reqQP.Set("timeout", strconv.FormatInt(int64(*options.Timeout), 10)) } - query.Set("comp", "acl") - req.URL.RawQuery = query.Encode() + reqQP.Set("comp", "acl") + req.URL.RawQuery = reqQP.Encode() req.Header.Set("x-ms-version", "2019-02-02") if options != nil && options.RequestID != nil { req.Header.Set("x-ms-client-request-id", *options.RequestID) @@ -339,14 +369,19 @@ func (client *tableClient) getAccessPolicyHandleResponse(resp *azcore.Response) // getAccessPolicyHandleError handles the GetAccessPolicy error response. func (client *tableClient) getAccessPolicyHandleError(resp *azcore.Response) error { - var err TableServiceError - if err := resp.UnmarshalAsJSON(&err); err != nil { - return err + body, err := resp.Payload() + if err != nil { + return azcore.NewResponseError(err, resp.Response) + } + errType := TableServiceError{raw: string(body)} + if err := resp.UnmarshalAsJSON(&errType); err != nil { + return azcore.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp.Response) } - return azcore.NewResponseError(&err, resp.Response) + return azcore.NewResponseError(&errType, resp.Response) } // InsertEntity - Insert entity in a table. +// If the operation fails it returns the *TableServiceError error type. // Possible return types are *MapOfInterfaceResponse, *TableInsertEntityResponse func (client *tableClient) InsertEntity(ctx context.Context, table string, tableInsertEntityOptions *TableInsertEntityOptions, queryOptions *QueryOptions) (interface{}, error) { req, err := client.insertEntityCreateRequest(ctx, table, tableInsertEntityOptions, queryOptions) @@ -366,20 +401,23 @@ func (client *tableClient) InsertEntity(ctx context.Context, table string, table // insertEntityCreateRequest creates the InsertEntity request. func (client *tableClient) insertEntityCreateRequest(ctx context.Context, table string, tableInsertEntityOptions *TableInsertEntityOptions, queryOptions *QueryOptions) (*azcore.Request, error) { urlPath := "/{table}" + if table == "" { + return nil, errors.New("parameter table cannot be empty") + } urlPath = strings.ReplaceAll(urlPath, "{table}", url.PathEscape(table)) req, err := azcore.NewRequest(ctx, http.MethodPost, azcore.JoinPaths(client.con.Endpoint(), urlPath)) if err != nil { return nil, err } req.Telemetry(telemetryInfo) - query := req.URL.Query() + reqQP := req.URL.Query() if tableInsertEntityOptions != nil && tableInsertEntityOptions.Timeout != nil { - query.Set("timeout", strconv.FormatInt(int64(*tableInsertEntityOptions.Timeout), 10)) + reqQP.Set("timeout", strconv.FormatInt(int64(*tableInsertEntityOptions.Timeout), 10)) } if queryOptions != nil && queryOptions.Format != nil { - query.Set("$format", string(*queryOptions.Format)) + reqQP.Set("$format", string(*queryOptions.Format)) } - req.URL.RawQuery = query.Encode() + req.URL.RawQuery = reqQP.Encode() req.Header.Set("x-ms-version", "2019-02-02") if tableInsertEntityOptions != nil && tableInsertEntityOptions.RequestID != nil { req.Header.Set("x-ms-client-request-id", *tableInsertEntityOptions.RequestID) @@ -389,7 +427,7 @@ func (client *tableClient) insertEntityCreateRequest(ctx context.Context, table req.Header.Set("Prefer", string(*tableInsertEntityOptions.ResponsePreference)) } req.Header.Set("Accept", "application/json;odata=minimalmetadata") - if tableInsertEntityOptions != nil { + if tableInsertEntityOptions != nil && tableInsertEntityOptions.TableEntityProperties != nil { return req, req.MarshalAsJSON(tableInsertEntityOptions.TableEntityProperties) } return req, nil @@ -423,6 +461,12 @@ func (client *tableClient) insertEntityHandleResponse(resp *azcore.Response) (in if val := resp.Header.Get("ETag"); val != "" { result.ETag = &val } + if val := resp.Header.Get("x-ms-continuation-NextPartitionKey"); val != "" { + result.XMSContinuationNextPartitionKey = &val + } + if val := resp.Header.Get("x-ms-continuation-NextRowKey"); val != "" { + result.XMSContinuationNextRowKey = &val + } if val := resp.Header.Get("Preference-Applied"); val != "" { result.PreferenceApplied = &val } @@ -465,14 +509,19 @@ func (client *tableClient) insertEntityHandleResponse(resp *azcore.Response) (in // insertEntityHandleError handles the InsertEntity error response. func (client *tableClient) insertEntityHandleError(resp *azcore.Response) error { - var err TableServiceError - if err := resp.UnmarshalAsJSON(&err); err != nil { - return err + body, err := resp.Payload() + if err != nil { + return azcore.NewResponseError(err, resp.Response) + } + errType := TableServiceError{raw: string(body)} + if err := resp.UnmarshalAsJSON(&errType); err != nil { + return azcore.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp.Response) } - return azcore.NewResponseError(&err, resp.Response) + return azcore.NewResponseError(&errType, resp.Response) } // MergeEntity - Merge entity in a table. +// If the operation fails it returns the *TableServiceError error type. func (client *tableClient) MergeEntity(ctx context.Context, table string, partitionKey string, rowKey string, tableMergeEntityOptions *TableMergeEntityOptions, queryOptions *QueryOptions) (TableMergeEntityResponse, error) { req, err := client.mergeEntityCreateRequest(ctx, table, partitionKey, rowKey, tableMergeEntityOptions, queryOptions) if err != nil { @@ -491,22 +540,31 @@ func (client *tableClient) MergeEntity(ctx context.Context, table string, partit // mergeEntityCreateRequest creates the MergeEntity request. func (client *tableClient) mergeEntityCreateRequest(ctx context.Context, table string, partitionKey string, rowKey string, tableMergeEntityOptions *TableMergeEntityOptions, queryOptions *QueryOptions) (*azcore.Request, error) { urlPath := "/{table}(PartitionKey='{partitionKey}',RowKey='{rowKey}')" + if table == "" { + return nil, errors.New("parameter table cannot be empty") + } urlPath = strings.ReplaceAll(urlPath, "{table}", url.PathEscape(table)) + if partitionKey == "" { + return nil, errors.New("parameter partitionKey cannot be empty") + } urlPath = strings.ReplaceAll(urlPath, "{partitionKey}", url.PathEscape(partitionKey)) + if rowKey == "" { + return nil, errors.New("parameter rowKey cannot be empty") + } urlPath = strings.ReplaceAll(urlPath, "{rowKey}", url.PathEscape(rowKey)) req, err := azcore.NewRequest(ctx, http.MethodPatch, azcore.JoinPaths(client.con.Endpoint(), urlPath)) if err != nil { return nil, err } req.Telemetry(telemetryInfo) - query := req.URL.Query() + reqQP := req.URL.Query() if tableMergeEntityOptions != nil && tableMergeEntityOptions.Timeout != nil { - query.Set("timeout", strconv.FormatInt(int64(*tableMergeEntityOptions.Timeout), 10)) + reqQP.Set("timeout", strconv.FormatInt(int64(*tableMergeEntityOptions.Timeout), 10)) } if queryOptions != nil && queryOptions.Format != nil { - query.Set("$format", string(*queryOptions.Format)) + reqQP.Set("$format", string(*queryOptions.Format)) } - req.URL.RawQuery = query.Encode() + req.URL.RawQuery = reqQP.Encode() req.Header.Set("x-ms-version", "2019-02-02") if tableMergeEntityOptions != nil && tableMergeEntityOptions.RequestID != nil { req.Header.Set("x-ms-client-request-id", *tableMergeEntityOptions.RequestID) @@ -516,7 +574,7 @@ func (client *tableClient) mergeEntityCreateRequest(ctx context.Context, table s req.Header.Set("If-Match", *tableMergeEntityOptions.IfMatch) } req.Header.Set("Accept", "application/json") - if tableMergeEntityOptions != nil { + if tableMergeEntityOptions != nil && tableMergeEntityOptions.TableEntityProperties != nil { return req, req.MarshalAsJSON(tableMergeEntityOptions.TableEntityProperties) } return req, nil @@ -549,14 +607,19 @@ func (client *tableClient) mergeEntityHandleResponse(resp *azcore.Response) (Tab // mergeEntityHandleError handles the MergeEntity error response. func (client *tableClient) mergeEntityHandleError(resp *azcore.Response) error { - var err TableServiceError - if err := resp.UnmarshalAsJSON(&err); err != nil { - return err + body, err := resp.Payload() + if err != nil { + return azcore.NewResponseError(err, resp.Response) + } + errType := TableServiceError{raw: string(body)} + if err := resp.UnmarshalAsJSON(&errType); err != nil { + return azcore.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp.Response) } - return azcore.NewResponseError(&err, resp.Response) + return azcore.NewResponseError(&errType, resp.Response) } // Query - Queries tables under the given account. +// If the operation fails it returns a generic error. func (client *tableClient) Query(ctx context.Context, tableQueryOptions *TableQueryOptions, queryOptions *QueryOptions) (TableQueryResponseResponse, error) { req, err := client.queryCreateRequest(ctx, tableQueryOptions, queryOptions) if err != nil { @@ -580,23 +643,23 @@ func (client *tableClient) queryCreateRequest(ctx context.Context, tableQueryOpt return nil, err } req.Telemetry(telemetryInfo) - query := req.URL.Query() + reqQP := req.URL.Query() if queryOptions != nil && queryOptions.Format != nil { - query.Set("$format", string(*queryOptions.Format)) + reqQP.Set("$format", string(*queryOptions.Format)) } if queryOptions != nil && queryOptions.Top != nil { - query.Set("$top", strconv.FormatInt(int64(*queryOptions.Top), 10)) + reqQP.Set("$top", strconv.FormatInt(int64(*queryOptions.Top), 10)) } if queryOptions != nil && queryOptions.Select != nil { - query.Set("$select", *queryOptions.Select) + reqQP.Set("$select", *queryOptions.Select) } if queryOptions != nil && queryOptions.Filter != nil { - query.Set("$filter", *queryOptions.Filter) + reqQP.Set("$filter", *queryOptions.Filter) } if tableQueryOptions != nil && tableQueryOptions.NextTableName != nil { - query.Set("NextTableName", *tableQueryOptions.NextTableName) + reqQP.Set("NextTableName", *tableQueryOptions.NextTableName) } - req.URL.RawQuery = query.Encode() + req.URL.RawQuery = reqQP.Encode() req.Header.Set("x-ms-version", "2019-02-02") if tableQueryOptions != nil && tableQueryOptions.RequestID != nil { req.Header.Set("x-ms-client-request-id", *tableQueryOptions.RequestID) @@ -637,9 +700,9 @@ func (client *tableClient) queryHandleResponse(resp *azcore.Response) (TableQuer // queryHandleError handles the Query error response. func (client *tableClient) queryHandleError(resp *azcore.Response) error { - body, err := ioutil.ReadAll(resp.Body) + body, err := resp.Payload() if err != nil { - return fmt.Errorf("%s; failed to read response body: %w", resp.Status, err) + return azcore.NewResponseError(err, resp.Response) } if len(body) == 0 { return azcore.NewResponseError(errors.New(resp.Status), resp.Response) @@ -648,6 +711,7 @@ func (client *tableClient) queryHandleError(resp *azcore.Response) error { } // QueryEntities - Queries entities in a table. +// If the operation fails it returns the *TableServiceError error type. func (client *tableClient) QueryEntities(ctx context.Context, table string, tableQueryEntitiesOptions *TableQueryEntitiesOptions, queryOptions *QueryOptions) (TableEntityQueryResponseResponse, error) { req, err := client.queryEntitiesCreateRequest(ctx, table, tableQueryEntitiesOptions, queryOptions) if err != nil { @@ -666,35 +730,38 @@ func (client *tableClient) QueryEntities(ctx context.Context, table string, tabl // queryEntitiesCreateRequest creates the QueryEntities request. func (client *tableClient) queryEntitiesCreateRequest(ctx context.Context, table string, tableQueryEntitiesOptions *TableQueryEntitiesOptions, queryOptions *QueryOptions) (*azcore.Request, error) { urlPath := "/{table}()" + if table == "" { + return nil, errors.New("parameter table cannot be empty") + } urlPath = strings.ReplaceAll(urlPath, "{table}", url.PathEscape(table)) req, err := azcore.NewRequest(ctx, http.MethodGet, azcore.JoinPaths(client.con.Endpoint(), urlPath)) if err != nil { return nil, err } req.Telemetry(telemetryInfo) - query := req.URL.Query() + reqQP := req.URL.Query() if tableQueryEntitiesOptions != nil && tableQueryEntitiesOptions.Timeout != nil { - query.Set("timeout", strconv.FormatInt(int64(*tableQueryEntitiesOptions.Timeout), 10)) + reqQP.Set("timeout", strconv.FormatInt(int64(*tableQueryEntitiesOptions.Timeout), 10)) } if queryOptions != nil && queryOptions.Format != nil { - query.Set("$format", string(*queryOptions.Format)) + reqQP.Set("$format", string(*queryOptions.Format)) } if queryOptions != nil && queryOptions.Top != nil { - query.Set("$top", strconv.FormatInt(int64(*queryOptions.Top), 10)) + reqQP.Set("$top", strconv.FormatInt(int64(*queryOptions.Top), 10)) } if queryOptions != nil && queryOptions.Select != nil { - query.Set("$select", *queryOptions.Select) + reqQP.Set("$select", *queryOptions.Select) } if queryOptions != nil && queryOptions.Filter != nil { - query.Set("$filter", *queryOptions.Filter) + reqQP.Set("$filter", *queryOptions.Filter) } if tableQueryEntitiesOptions != nil && tableQueryEntitiesOptions.NextPartitionKey != nil { - query.Set("NextPartitionKey", *tableQueryEntitiesOptions.NextPartitionKey) + reqQP.Set("NextPartitionKey", *tableQueryEntitiesOptions.NextPartitionKey) } if tableQueryEntitiesOptions != nil && tableQueryEntitiesOptions.NextRowKey != nil { - query.Set("NextRowKey", *tableQueryEntitiesOptions.NextRowKey) + reqQP.Set("NextRowKey", *tableQueryEntitiesOptions.NextRowKey) } - req.URL.RawQuery = query.Encode() + req.URL.RawQuery = reqQP.Encode() req.Header.Set("x-ms-version", "2019-02-02") if tableQueryEntitiesOptions != nil && tableQueryEntitiesOptions.RequestID != nil { req.Header.Set("x-ms-client-request-id", *tableQueryEntitiesOptions.RequestID) @@ -733,78 +800,89 @@ func (client *tableClient) queryEntitiesHandleResponse(resp *azcore.Response) (T if val := resp.Header.Get("x-ms-continuation-NextRowKey"); val != "" { result.XMSContinuationNextRowKey = &val } - if val := resp.Header.Get("ETag"); val != "" { - result.ETag = &val - } return result, nil } // queryEntitiesHandleError handles the QueryEntities error response. func (client *tableClient) queryEntitiesHandleError(resp *azcore.Response) error { - var err TableServiceError - if err := resp.UnmarshalAsJSON(&err); err != nil { - return err + body, err := resp.Payload() + if err != nil { + return azcore.NewResponseError(err, resp.Response) + } + errType := TableServiceError{raw: string(body)} + if err := resp.UnmarshalAsJSON(&errType); err != nil { + return azcore.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp.Response) } - return azcore.NewResponseError(&err, resp.Response) + return azcore.NewResponseError(&errType, resp.Response) } -// QueryEntitiesWithPartitionAndRowKey - Queries entities in a table. -func (client *tableClient) QueryEntitiesWithPartitionAndRowKey(ctx context.Context, table string, partitionKey string, rowKey string, tableQueryEntitiesWithPartitionAndRowKeyOptions *TableQueryEntitiesWithPartitionAndRowKeyOptions, queryOptions *QueryOptions) (TableEntityQueryResponseResponse, error) { - req, err := client.queryEntitiesWithPartitionAndRowKeyCreateRequest(ctx, table, partitionKey, rowKey, tableQueryEntitiesWithPartitionAndRowKeyOptions, queryOptions) +// QueryEntityWithPartitionAndRowKey - Queries a single entity in a table. +// If the operation fails it returns the *TableServiceError error type. +func (client *tableClient) QueryEntityWithPartitionAndRowKey(ctx context.Context, table string, partitionKey string, rowKey string, tableQueryEntityWithPartitionAndRowKeyOptions *TableQueryEntityWithPartitionAndRowKeyOptions, queryOptions *QueryOptions) (MapOfInterfaceResponse, error) { + req, err := client.queryEntityWithPartitionAndRowKeyCreateRequest(ctx, table, partitionKey, rowKey, tableQueryEntityWithPartitionAndRowKeyOptions, queryOptions) if err != nil { - return TableEntityQueryResponseResponse{}, err + return MapOfInterfaceResponse{}, err } resp, err := client.con.Pipeline().Do(req) if err != nil { - return TableEntityQueryResponseResponse{}, err + return MapOfInterfaceResponse{}, err } if !resp.HasStatusCode(http.StatusOK) { - return TableEntityQueryResponseResponse{}, client.queryEntitiesWithPartitionAndRowKeyHandleError(resp) + return MapOfInterfaceResponse{}, client.queryEntityWithPartitionAndRowKeyHandleError(resp) } - return client.queryEntitiesWithPartitionAndRowKeyHandleResponse(resp) + return client.queryEntityWithPartitionAndRowKeyHandleResponse(resp) } -// queryEntitiesWithPartitionAndRowKeyCreateRequest creates the QueryEntitiesWithPartitionAndRowKey request. -func (client *tableClient) queryEntitiesWithPartitionAndRowKeyCreateRequest(ctx context.Context, table string, partitionKey string, rowKey string, tableQueryEntitiesWithPartitionAndRowKeyOptions *TableQueryEntitiesWithPartitionAndRowKeyOptions, queryOptions *QueryOptions) (*azcore.Request, error) { +// queryEntityWithPartitionAndRowKeyCreateRequest creates the QueryEntityWithPartitionAndRowKey request. +func (client *tableClient) queryEntityWithPartitionAndRowKeyCreateRequest(ctx context.Context, table string, partitionKey string, rowKey string, tableQueryEntityWithPartitionAndRowKeyOptions *TableQueryEntityWithPartitionAndRowKeyOptions, queryOptions *QueryOptions) (*azcore.Request, error) { urlPath := "/{table}(PartitionKey='{partitionKey}',RowKey='{rowKey}')" + if table == "" { + return nil, errors.New("parameter table cannot be empty") + } urlPath = strings.ReplaceAll(urlPath, "{table}", url.PathEscape(table)) + if partitionKey == "" { + return nil, errors.New("parameter partitionKey cannot be empty") + } urlPath = strings.ReplaceAll(urlPath, "{partitionKey}", url.PathEscape(partitionKey)) + if rowKey == "" { + return nil, errors.New("parameter rowKey cannot be empty") + } urlPath = strings.ReplaceAll(urlPath, "{rowKey}", url.PathEscape(rowKey)) req, err := azcore.NewRequest(ctx, http.MethodGet, azcore.JoinPaths(client.con.Endpoint(), urlPath)) if err != nil { return nil, err } req.Telemetry(telemetryInfo) - query := req.URL.Query() - if tableQueryEntitiesWithPartitionAndRowKeyOptions != nil && tableQueryEntitiesWithPartitionAndRowKeyOptions.Timeout != nil { - query.Set("timeout", strconv.FormatInt(int64(*tableQueryEntitiesWithPartitionAndRowKeyOptions.Timeout), 10)) + reqQP := req.URL.Query() + if tableQueryEntityWithPartitionAndRowKeyOptions != nil && tableQueryEntityWithPartitionAndRowKeyOptions.Timeout != nil { + reqQP.Set("timeout", strconv.FormatInt(int64(*tableQueryEntityWithPartitionAndRowKeyOptions.Timeout), 10)) } if queryOptions != nil && queryOptions.Format != nil { - query.Set("$format", string(*queryOptions.Format)) + reqQP.Set("$format", string(*queryOptions.Format)) } if queryOptions != nil && queryOptions.Select != nil { - query.Set("$select", *queryOptions.Select) + reqQP.Set("$select", *queryOptions.Select) } if queryOptions != nil && queryOptions.Filter != nil { - query.Set("$filter", *queryOptions.Filter) + reqQP.Set("$filter", *queryOptions.Filter) } - req.URL.RawQuery = query.Encode() + req.URL.RawQuery = reqQP.Encode() req.Header.Set("x-ms-version", "2019-02-02") - if tableQueryEntitiesWithPartitionAndRowKeyOptions != nil && tableQueryEntitiesWithPartitionAndRowKeyOptions.RequestID != nil { - req.Header.Set("x-ms-client-request-id", *tableQueryEntitiesWithPartitionAndRowKeyOptions.RequestID) + if tableQueryEntityWithPartitionAndRowKeyOptions != nil && tableQueryEntityWithPartitionAndRowKeyOptions.RequestID != nil { + req.Header.Set("x-ms-client-request-id", *tableQueryEntityWithPartitionAndRowKeyOptions.RequestID) } req.Header.Set("DataServiceVersion", "3.0") req.Header.Set("Accept", "application/json;odata=minimalmetadata") return req, nil } -// queryEntitiesWithPartitionAndRowKeyHandleResponse handles the QueryEntitiesWithPartitionAndRowKey response. -func (client *tableClient) queryEntitiesWithPartitionAndRowKeyHandleResponse(resp *azcore.Response) (TableEntityQueryResponseResponse, error) { - var val *TableEntityQueryResponse +// queryEntityWithPartitionAndRowKeyHandleResponse handles the QueryEntityWithPartitionAndRowKey response. +func (client *tableClient) queryEntityWithPartitionAndRowKeyHandleResponse(resp *azcore.Response) (MapOfInterfaceResponse, error) { + var val map[string]interface{} if err := resp.UnmarshalAsJSON(&val); err != nil { - return TableEntityQueryResponseResponse{}, err + return MapOfInterfaceResponse{}, err } - result := TableEntityQueryResponseResponse{RawResponse: resp.Response, TableEntityQueryResponse: val} + result := MapOfInterfaceResponse{RawResponse: resp.Response, Value: val} if val := resp.Header.Get("x-ms-client-request-id"); val != "" { result.ClientRequestID = &val } @@ -817,32 +895,43 @@ func (client *tableClient) queryEntitiesWithPartitionAndRowKeyHandleResponse(res if val := resp.Header.Get("Date"); val != "" { date, err := time.Parse(time.RFC1123, val) if err != nil { - return TableEntityQueryResponseResponse{}, err + return MapOfInterfaceResponse{}, err } result.Date = &date } + if val := resp.Header.Get("ETag"); val != "" { + result.ETag = &val + } if val := resp.Header.Get("x-ms-continuation-NextPartitionKey"); val != "" { result.XMSContinuationNextPartitionKey = &val } if val := resp.Header.Get("x-ms-continuation-NextRowKey"); val != "" { result.XMSContinuationNextRowKey = &val } - if val := resp.Header.Get("ETag"); val != "" { - result.ETag = &val + if val := resp.Header.Get("Preference-Applied"); val != "" { + result.PreferenceApplied = &val + } + if val := resp.Header.Get("Content-Type"); val != "" { + result.ContentType = &val } return result, nil } -// queryEntitiesWithPartitionAndRowKeyHandleError handles the QueryEntitiesWithPartitionAndRowKey error response. -func (client *tableClient) queryEntitiesWithPartitionAndRowKeyHandleError(resp *azcore.Response) error { - var err TableServiceError - if err := resp.UnmarshalAsJSON(&err); err != nil { - return err +// queryEntityWithPartitionAndRowKeyHandleError handles the QueryEntityWithPartitionAndRowKey error response. +func (client *tableClient) queryEntityWithPartitionAndRowKeyHandleError(resp *azcore.Response) error { + body, err := resp.Payload() + if err != nil { + return azcore.NewResponseError(err, resp.Response) } - return azcore.NewResponseError(&err, resp.Response) + errType := TableServiceError{raw: string(body)} + if err := resp.UnmarshalAsJSON(&errType); err != nil { + return azcore.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp.Response) + } + return azcore.NewResponseError(&errType, resp.Response) } // SetAccessPolicy - Sets stored access policies for the table that may be used with Shared Access Signatures. +// If the operation fails it returns the *TableServiceError error type. func (client *tableClient) SetAccessPolicy(ctx context.Context, table string, options *TableSetAccessPolicyOptions) (TableSetAccessPolicyResponse, error) { req, err := client.setAccessPolicyCreateRequest(ctx, table, options) if err != nil { @@ -861,29 +950,32 @@ func (client *tableClient) SetAccessPolicy(ctx context.Context, table string, op // setAccessPolicyCreateRequest creates the SetAccessPolicy request. func (client *tableClient) setAccessPolicyCreateRequest(ctx context.Context, table string, options *TableSetAccessPolicyOptions) (*azcore.Request, error) { urlPath := "/{table}" + if table == "" { + return nil, errors.New("parameter table cannot be empty") + } urlPath = strings.ReplaceAll(urlPath, "{table}", url.PathEscape(table)) req, err := azcore.NewRequest(ctx, http.MethodPut, azcore.JoinPaths(client.con.Endpoint(), urlPath)) if err != nil { return nil, err } req.Telemetry(telemetryInfo) - query := req.URL.Query() + reqQP := req.URL.Query() if options != nil && options.Timeout != nil { - query.Set("timeout", strconv.FormatInt(int64(*options.Timeout), 10)) + reqQP.Set("timeout", strconv.FormatInt(int64(*options.Timeout), 10)) } - query.Set("comp", "acl") - req.URL.RawQuery = query.Encode() + reqQP.Set("comp", "acl") + req.URL.RawQuery = reqQP.Encode() req.Header.Set("x-ms-version", "2019-02-02") if options != nil && options.RequestID != nil { req.Header.Set("x-ms-client-request-id", *options.RequestID) } req.Header.Set("Accept", "application/xml") type wrapper struct { - XMLName xml.Name `xml:"SignedIdentifiers"` - TableACL *[]SignedIdentifier `xml:"SignedIdentifier"` + XMLName xml.Name `xml:"SignedIdentifiers"` + TableACL *[]*SignedIdentifier `xml:"SignedIdentifier"` } - if options != nil { - return req, req.MarshalAsXML(wrapper{TableACL: options.TableACL}) + if options != nil && options.TableACL != nil { + return req, req.MarshalAsXML(wrapper{TableACL: &options.TableACL}) } return req, nil } @@ -912,14 +1004,19 @@ func (client *tableClient) setAccessPolicyHandleResponse(resp *azcore.Response) // setAccessPolicyHandleError handles the SetAccessPolicy error response. func (client *tableClient) setAccessPolicyHandleError(resp *azcore.Response) error { - var err TableServiceError - if err := resp.UnmarshalAsJSON(&err); err != nil { - return err + body, err := resp.Payload() + if err != nil { + return azcore.NewResponseError(err, resp.Response) } - return azcore.NewResponseError(&err, resp.Response) + errType := TableServiceError{raw: string(body)} + if err := resp.UnmarshalAsJSON(&errType); err != nil { + return azcore.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp.Response) + } + return azcore.NewResponseError(&errType, resp.Response) } // UpdateEntity - Update entity in a table. +// If the operation fails it returns the *TableServiceError error type. func (client *tableClient) UpdateEntity(ctx context.Context, table string, partitionKey string, rowKey string, tableUpdateEntityOptions *TableUpdateEntityOptions, queryOptions *QueryOptions) (TableUpdateEntityResponse, error) { req, err := client.updateEntityCreateRequest(ctx, table, partitionKey, rowKey, tableUpdateEntityOptions, queryOptions) if err != nil { @@ -938,22 +1035,31 @@ func (client *tableClient) UpdateEntity(ctx context.Context, table string, parti // updateEntityCreateRequest creates the UpdateEntity request. func (client *tableClient) updateEntityCreateRequest(ctx context.Context, table string, partitionKey string, rowKey string, tableUpdateEntityOptions *TableUpdateEntityOptions, queryOptions *QueryOptions) (*azcore.Request, error) { urlPath := "/{table}(PartitionKey='{partitionKey}',RowKey='{rowKey}')" + if table == "" { + return nil, errors.New("parameter table cannot be empty") + } urlPath = strings.ReplaceAll(urlPath, "{table}", url.PathEscape(table)) + if partitionKey == "" { + return nil, errors.New("parameter partitionKey cannot be empty") + } urlPath = strings.ReplaceAll(urlPath, "{partitionKey}", url.PathEscape(partitionKey)) + if rowKey == "" { + return nil, errors.New("parameter rowKey cannot be empty") + } urlPath = strings.ReplaceAll(urlPath, "{rowKey}", url.PathEscape(rowKey)) req, err := azcore.NewRequest(ctx, http.MethodPut, azcore.JoinPaths(client.con.Endpoint(), urlPath)) if err != nil { return nil, err } req.Telemetry(telemetryInfo) - query := req.URL.Query() + reqQP := req.URL.Query() if tableUpdateEntityOptions != nil && tableUpdateEntityOptions.Timeout != nil { - query.Set("timeout", strconv.FormatInt(int64(*tableUpdateEntityOptions.Timeout), 10)) + reqQP.Set("timeout", strconv.FormatInt(int64(*tableUpdateEntityOptions.Timeout), 10)) } if queryOptions != nil && queryOptions.Format != nil { - query.Set("$format", string(*queryOptions.Format)) + reqQP.Set("$format", string(*queryOptions.Format)) } - req.URL.RawQuery = query.Encode() + req.URL.RawQuery = reqQP.Encode() req.Header.Set("x-ms-version", "2019-02-02") if tableUpdateEntityOptions != nil && tableUpdateEntityOptions.RequestID != nil { req.Header.Set("x-ms-client-request-id", *tableUpdateEntityOptions.RequestID) @@ -963,7 +1069,7 @@ func (client *tableClient) updateEntityCreateRequest(ctx context.Context, table req.Header.Set("If-Match", *tableUpdateEntityOptions.IfMatch) } req.Header.Set("Accept", "application/json") - if tableUpdateEntityOptions != nil { + if tableUpdateEntityOptions != nil && tableUpdateEntityOptions.TableEntityProperties != nil { return req, req.MarshalAsJSON(tableUpdateEntityOptions.TableEntityProperties) } return req, nil @@ -996,9 +1102,13 @@ func (client *tableClient) updateEntityHandleResponse(resp *azcore.Response) (Ta // updateEntityHandleError handles the UpdateEntity error response. func (client *tableClient) updateEntityHandleError(resp *azcore.Response) error { - var err TableServiceError - if err := resp.UnmarshalAsJSON(&err); err != nil { - return err + body, err := resp.Payload() + if err != nil { + return azcore.NewResponseError(err, resp.Response) + } + errType := TableServiceError{raw: string(body)} + if err := resp.UnmarshalAsJSON(&errType); err != nil { + return azcore.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp.Response) } - return azcore.NewResponseError(&err, resp.Response) + return azcore.NewResponseError(&errType, resp.Response) }