Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Tables]Rename package #15448

Merged
4 commits merged into from
Sep 2, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions eng/config.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@
"CoverageGoal": 0.70
},
{
"Name": "tables",
"CoverageGoal": 0.01
"Name": "data",
"CoverageGoal": 0.40
}
]
}
2 changes: 1 addition & 1 deletion sdk/tables/autorest.md → sdk/data/autorest.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ version: "^3.0.0"
input-file: https://github.com/Azure/azure-rest-api-specs/blob/d744b6bcb95ab4034832ded556dbbe58f4287c5b/specification/cosmos-db/data-plane/Microsoft.Tables/preview/2019-02-02/table.json
license-header: MICROSOFT_MIT_NO_VERSION
clear-output-folder: false
output-folder: aztable/internal
output-folder: aztables/internal
tag: package-2019-02
credential-scope: none
use: "@autorest/go@4.0.0-preview.27"
Expand Down
4 changes: 4 additions & 0 deletions sdk/data/aztables/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# Release History

## v0.1.0 (09-07-2021)
* This is the initial release of the `aztables` library
File renamed without changes.
14 changes: 7 additions & 7 deletions sdk/tables/aztable/README.md → sdk/data/aztables/README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Azure Tables client library for Go

Azure Table storage is a service that stores large amounts of structured NoSQL data in the cloud, providing
a key/attribute store with a schema-less design.
Azure Table storage is a service that stores large amounts of structured NoSQL data in the cloud, providing
a key/attribute store with a schema-less design.

Azure Cosmos DB provides a Table API for applications that are written for Azure Table storage that need premium capabilities like:

Expand All @@ -26,13 +26,13 @@ If you need to create either of these, you can use the [Azure CLI][azure_cli].

#### Creating a storage account

Create a storage account `mystorageaccount` in resource group `MyResourceGroup`
Create a storage account `mystorageaccount` in resource group `MyResourceGroup`
in the subscription `MySubscription` in the West US region.


#### Creating a Cosmos DB

Create a Cosmos DB account `MyCosmosDBDatabaseAccount` in resource group `MyResourceGroup`
Create a Cosmos DB account `MyCosmosDBDatabaseAccount` in resource group `MyResourceGroup`
in the subscription `MySubscription` and a table named `MyTableName` in the account.


Expand Down Expand Up @@ -96,7 +96,7 @@ If we no longer need our new table entity, it can be deleted.

## Troubleshooting

When you interact with the Azure table library using the .NET SDK, errors returned by the service correspond to the same HTTP
When you interact with the Azure table library using the .NET SDK, errors returned by the service correspond to the same HTTP
status codes returned for [REST API][tables_rest] requests.

For example, if you try to create a table that already exists, a `409` error is returned, indicating "Conflict".
Expand Down Expand Up @@ -126,14 +126,14 @@ the right to, and actually do, grant us the rights to use your contribution. For
details, visit [cla.microsoft.com][cla].

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
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=aztable --module=aztable --openapi-type="data-plane" --credential-scope=none
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

<!-- LINKS -->
[tables_rest]: https://docs.microsoft.com/rest/api/storageservices/table-service-rest-api
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.

package aztable
package aztables

import (
"strconv"
Expand Down
4 changes: 2 additions & 2 deletions sdk/tables/aztable/client.go → sdk/data/aztables/client.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.

package aztable
package aztables

import (
"context"
Expand All @@ -14,7 +14,7 @@ import (

"github.com/Azure/azure-sdk-for-go/sdk/azcore"
"github.com/Azure/azure-sdk-for-go/sdk/azcore/to"
generated "github.com/Azure/azure-sdk-for-go/sdk/tables/aztable/internal"
generated "github.com/Azure/azure-sdk-for-go/sdk/data/aztables/internal"
)

// A Client represents a client to the tables service affinitized to a specific table.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.

package aztable
package aztables

import (
"context"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.

package aztable
package aztables

import (
"fmt"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.

package aztable
package aztables

import (
"encoding/base64"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.

package aztable
package aztables

const (
headerXmsDate = "x-ms-date"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.

package aztable
package aztables

import (
"net/http"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.

package aztable
package aztables

import (
"encoding/base64"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.

package aztable
package aztables

import (
"encoding/json"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.

package aztable
package aztables

import "errors"

Expand Down
2 changes: 1 addition & 1 deletion sdk/tables/aztable/go.mod → sdk/data/aztables/go.mod
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
module github.com/Azure/azure-sdk-for-go/sdk/tables/aztable
module github.com/Azure/azure-sdk-for-go/sdk/data/aztables

go 1.16

Expand Down
File renamed without changes.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions sdk/tables/aztable/models.go → sdk/data/aztables/models.go
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.

package aztable
package aztables

import (
"time"

generated "github.com/Azure/azure-sdk-for-go/sdk/tables/aztable/internal"
generated "github.com/Azure/azure-sdk-for-go/sdk/data/aztables/internal"
)

// CorsRule - CORS is an HTTP feature that enables a web application running under one domain to access resources in another domain. Web browsers implement
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.

package aztable
package aztables

import (
"context"
Expand All @@ -19,7 +19,7 @@ import (
"github.com/stretchr/testify/require"
)

var pathToPackage = "sdk/tables/aztable"
var pathToPackage = "sdk/data/aztables"

type recordingPolicy struct {
options recording.RecordingOptions
Expand Down Expand Up @@ -153,7 +153,7 @@ func initServiceTest(t *testing.T, service string) (*ServiceClient, func()) {
}
}

func getAADCredential(t *testing.T) (azcore.Credential, error) {
func getAADCredential(t *testing.T) (azcore.Credential, error) { //nolint
if recording.InPlayback() {
return NewFakeCredential("fakestorageaccount", "fakeAccountKey"), nil
}
Expand Down Expand Up @@ -222,14 +222,18 @@ func createCosmosClient(t *testing.T) (*Client, error) {

func createStorageServiceClient(t *testing.T) (*ServiceClient, error) {
var cred azcore.Credential
var err error
accountName := recording.GetEnvVariable(t, "TABLES_STORAGE_ACCOUNT_NAME", "fakestorageaccount")
accountKey := recording.GetEnvVariable(t, "TABLES_PRIMARY_STORAGE_ACCOUNT_KEY", "fakestorageaccountkey")

if recording.InPlayback() {
accountName = "fakestorageaccount"
cred, err = getSharedKeyCredential(t)
require.NoError(t, err)
} else {
cred, err = NewSharedKeyCredential(accountName, accountKey)
require.NoError(t, err)
}

cred, err := getAADCredential(t)
require.NoError(t, err)

serviceURL := storageURI(accountName, "core.windows.net")

return createServiceClientForRecording(t, serviceURL, cred)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
"Content-Length": "35",
"Content-Type": "application/json",
"dataserviceversion": "3.0",
"User-Agent": "azsdk-go-aztable/v0.1.0 azsdk-go-azcore/v0.19.0 (go1.17; Windows_NT)",
"User-Agent": "azsdk-go-aztables/v0.1.0 azsdk-go-azcore/v0.19.0 (go1.17; Windows_NT)",
"x-ms-date": "Wed, 01 Sep 2021 18:15:06 GMT",
"x-ms-version": "2019-02-02"
},
Expand Down Expand Up @@ -50,7 +50,7 @@
"Content-Type": "application/json",
"dataserviceversion": "3.0",
"prefer": "return-no-content",
"User-Agent": "azsdk-go-aztable/v0.1.0 azsdk-go-azcore/v0.19.0 (go1.17; Windows_NT)",
"User-Agent": "azsdk-go-aztables/v0.1.0 azsdk-go-azcore/v0.19.0 (go1.17; Windows_NT)",
"x-ms-date": "Wed, 01 Sep 2021 18:15:07 GMT",
"x-ms-version": "2019-02-02"
},
Expand Down Expand Up @@ -86,7 +86,7 @@
"Accept": "application/json",
"Accept-Encoding": "gzip",
"Authorization": "Sanitized",
"User-Agent": "azsdk-go-aztable/v0.1.0 azsdk-go-azcore/v0.19.0 (go1.17; Windows_NT)",
"User-Agent": "azsdk-go-aztables/v0.1.0 azsdk-go-azcore/v0.19.0 (go1.17; Windows_NT)",
"x-ms-date": "Wed, 01 Sep 2021 18:15:07 GMT",
"x-ms-version": "2019-02-02"
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
"Content-Length": "35",
"Content-Type": "application/json",
"dataserviceversion": "3.0",
"User-Agent": "azsdk-go-aztable/v0.1.0 azsdk-go-azcore/v0.19.0 (go1.17; Windows_NT)",
"User-Agent": "azsdk-go-aztables/v0.1.0 azsdk-go-azcore/v0.19.0 (go1.17; Windows_NT)",
"x-ms-date": "Wed, 01 Sep 2021 18:15:05 GMT",
"x-ms-version": "2019-02-02"
},
Expand Down Expand Up @@ -56,7 +56,7 @@
"Content-Type": "application/json",
"dataserviceversion": "3.0",
"prefer": "return-no-content",
"User-Agent": "azsdk-go-aztable/v0.1.0 azsdk-go-azcore/v0.19.0 (go1.17; Windows_NT)",
"User-Agent": "azsdk-go-aztables/v0.1.0 azsdk-go-azcore/v0.19.0 (go1.17; Windows_NT)",
"x-ms-date": "Wed, 01 Sep 2021 18:15:05 GMT",
"x-ms-version": "2019-02-02"
},
Expand Down Expand Up @@ -101,7 +101,7 @@
"Accept": "application/json",
"Accept-Encoding": "gzip",
"Authorization": "Sanitized",
"User-Agent": "azsdk-go-aztable/v0.1.0 azsdk-go-azcore/v0.19.0 (go1.17; Windows_NT)",
"User-Agent": "azsdk-go-aztables/v0.1.0 azsdk-go-azcore/v0.19.0 (go1.17; Windows_NT)",
"x-ms-date": "Wed, 01 Sep 2021 18:15:06 GMT",
"x-ms-version": "2019-02-02"
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
"Content-Length": "35",
"Content-Type": "application/json",
"dataserviceversion": "3.0",
"User-Agent": "azsdk-go-aztable/\u003Cversion\u003E azsdk-go-aztable/\u003Cversion\u003E azcore/v0.16.2 (go1.16.5; Windows_NT)",
"User-Agent": "azsdk-go-aztables/\u003Cversion\u003E azsdk-go-aztables/\u003Cversion\u003E azcore/v0.16.2 (go1.16.5; Windows_NT)",
"x-ms-date": "Mon, 02 Aug 2021 18:01:49 GMT",
"x-ms-version": "2019-02-02"
},
Expand Down Expand Up @@ -50,7 +50,7 @@
"Content-Type": "application/json",
"dataserviceversion": "3.0",
"prefer": "return-no-content",
"User-Agent": "azsdk-go-aztable/\u003Cversion\u003E azsdk-go-aztable/\u003Cversion\u003E azcore/v0.16.2 (go1.16.5; Windows_NT)",
"User-Agent": "azsdk-go-aztables/\u003Cversion\u003E azsdk-go-aztables/\u003Cversion\u003E azcore/v0.16.2 (go1.16.5; Windows_NT)",
"x-ms-date": "Mon, 02 Aug 2021 18:01:49 GMT",
"x-ms-version": "2019-02-02"
},
Expand Down Expand Up @@ -83,7 +83,7 @@
"Accept": "application/json",
"Accept-Encoding": "gzip",
"Authorization": "Sanitized",
"User-Agent": "azsdk-go-aztable/\u003Cversion\u003E azsdk-go-aztable/\u003Cversion\u003E azcore/v0.16.2 (go1.16.5; Windows_NT)",
"User-Agent": "azsdk-go-aztables/\u003Cversion\u003E azsdk-go-aztables/\u003Cversion\u003E azcore/v0.16.2 (go1.16.5; Windows_NT)",
"x-ms-date": "Mon, 02 Aug 2021 18:01:50 GMT",
"x-ms-version": "2019-02-02"
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
"Content-Length": "34",
"Content-Type": "application/json",
"dataserviceversion": "3.0",
"User-Agent": "azsdk-go-aztable/\u003Cversion\u003E azsdk-go-aztable/\u003Cversion\u003E azcore/v0.16.2 (go1.16.5; Windows_NT)",
"User-Agent": "azsdk-go-aztables/\u003Cversion\u003E azsdk-go-aztables/\u003Cversion\u003E azcore/v0.16.2 (go1.16.5; Windows_NT)",
"x-ms-date": "Mon, 02 Aug 2021 18:01:48 GMT",
"x-ms-version": "2019-02-02"
},
Expand Down Expand Up @@ -56,7 +56,7 @@
"Content-Type": "application/json",
"dataserviceversion": "3.0",
"prefer": "return-no-content",
"User-Agent": "azsdk-go-aztable/\u003Cversion\u003E azsdk-go-aztable/\u003Cversion\u003E azcore/v0.16.2 (go1.16.5; Windows_NT)",
"User-Agent": "azsdk-go-aztables/\u003Cversion\u003E azsdk-go-aztables/\u003Cversion\u003E azcore/v0.16.2 (go1.16.5; Windows_NT)",
"x-ms-date": "Mon, 02 Aug 2021 18:01:48 GMT",
"x-ms-version": "2019-02-02"
},
Expand Down Expand Up @@ -98,7 +98,7 @@
"Accept": "application/json",
"Accept-Encoding": "gzip",
"Authorization": "Sanitized",
"User-Agent": "azsdk-go-aztable/\u003Cversion\u003E azsdk-go-aztable/\u003Cversion\u003E azcore/v0.16.2 (go1.16.5; Windows_NT)",
"User-Agent": "azsdk-go-aztables/\u003Cversion\u003E azsdk-go-aztables/\u003Cversion\u003E azcore/v0.16.2 (go1.16.5; Windows_NT)",
"x-ms-date": "Mon, 02 Aug 2021 18:01:49 GMT",
"x-ms-version": "2019-02-02"
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
"Content-Length": "33",
"Content-Type": "application/json",
"dataserviceversion": "3.0",
"User-Agent": "azsdk-go-aztable/\u003Cversion\u003E azsdk-go-aztable/\u003Cversion\u003E azcore/v0.16.2 (go1.16.5; Windows_NT)",
"User-Agent": "azsdk-go-aztables/\u003Cversion\u003E azsdk-go-aztables/\u003Cversion\u003E azcore/v0.16.2 (go1.16.5; Windows_NT)",
"x-ms-date": "Mon, 02 Aug 2021 18:01:36 GMT",
"x-ms-version": "2019-02-02"
},
Expand Down Expand Up @@ -49,7 +49,7 @@
"Content-Length": "6520",
"Content-Type": "multipart/mixed; boundary=batch_fde37ee2-2934-4e48-71f5-cdf1e920ee66",
"dataserviceversion": "3.0",
"User-Agent": "azsdk-go-aztable/\u003Cversion\u003E azcore/v0.16.2 (go1.16.5; Windows_NT)",
"User-Agent": "azsdk-go-aztables/\u003Cversion\u003E azcore/v0.16.2 (go1.16.5; Windows_NT)",
"x-ms-date": "Mon, 02 Aug 2021 18:01:36 GMT",
"x-ms-version": "2019-02-02"
},
Expand All @@ -75,7 +75,7 @@
"Accept-Encoding": "gzip",
"Authorization": "Sanitized",
"dataserviceversion": "3.0",
"User-Agent": "azsdk-go-aztable/\u003Cversion\u003E azsdk-go-aztable/\u003Cversion\u003E azcore/v0.16.2 (go1.16.5; Windows_NT)",
"User-Agent": "azsdk-go-aztables/\u003Cversion\u003E azsdk-go-aztables/\u003Cversion\u003E azcore/v0.16.2 (go1.16.5; Windows_NT)",
"x-ms-date": "Mon, 02 Aug 2021 18:01:37 GMT",
"x-ms-version": "2019-02-02"
},
Expand Down Expand Up @@ -224,7 +224,7 @@
"Accept": "application/json",
"Accept-Encoding": "gzip",
"Authorization": "Sanitized",
"User-Agent": "azsdk-go-aztable/\u003Cversion\u003E azsdk-go-aztable/\u003Cversion\u003E azcore/v0.16.2 (go1.16.5; Windows_NT)",
"User-Agent": "azsdk-go-aztables/\u003Cversion\u003E azsdk-go-aztables/\u003Cversion\u003E azcore/v0.16.2 (go1.16.5; Windows_NT)",
"x-ms-date": "Mon, 02 Aug 2021 18:01:37 GMT",
"x-ms-version": "2019-02-02"
},
Expand Down
Loading