Skip to content

Commit bcd2b48

Browse files
tasherif-msftjhendrixMSFTealsurrichardpark-msftazure-sdk
authored
AzDatalake APIView (#20757)
* Enable gocritic during linting (#20715) Enabled gocritic's evalOrder to catch dependencies on undefined behavior on return statements. Updated to latest version of golangci-lint. Fixed issue in azblob flagged by latest linter. * Cosmos DB: Enable merge support (#20716) * Adding header and value * Wiring and tests * format * Fixing value * change log * [azservicebus, azeventhubs] Stress test and logging improvement (#20710) Logging improvements: * Updating the logging to print more tracing information (per-link) in prep for the bigger release coming up. * Trimming out some of the verbose logging, seeing if I can get it a bit more reasonable. Stress tests: * Add a timestamp to the log name we generate and also default to append, not overwrite. * Use 0.5 cores, 0.5GB as our baseline. Some pods use more and I'll tune them more later. * update proxy version (#20712) Co-authored-by: Scott Beddall <[email protected]> * Return an error when you try to send a message that's too large. (#20721) This now works just like the message batch - you'll get an ErrMessageTooLarge if you attempt to send a message that's too large for the link's configured size. NOTE: there's a patch to `internal/go-amqp/Sender.go` to match what's in go-amqp's main so it returns a programmatically useful error when the message is too large. Fixes #20647 * Changes in test that is failing in pipeline (#20693) * [azservicebus, azeventhubs] Treat 'entity full' as a fatal error (#20722) When the remote entity is full we get a resource-limit-exceeded condition. This isn't something we should keep retrying on and it's best to just abort and let the user know immediately, rather than hoping it might eventually clear out. This affected both Event Hubs and Service Bus. Fixes #20647 * [azservicebus/azeventhubs] Redirect stderr and stdout to tee (#20726) * Update changelog with latest features (#20730) * Update changelog with latest features Prepare for upcoming release. * bump minor version * pass along the artifact name so we can override it later (#20732) Co-authored-by: scbedd <[email protected]> * [azeventhubs] Fixing checkpoint store race condition (#20727) The checkpoint store wasn't guarding against multiple owners claiming for the first time - fixing this by using IfNoneMatch Fixes #20717 * Fix azidentity troubleshooting guide link (#20736) * [Release] sdk/resourcemanager/paloaltonetworksngfw/armpanngfw/0.1.0 (#20437) * [Release] sdk/resourcemanager/paloaltonetworksngfw/armpanngfw/0.1.0 generation from spec commit: 85fb4ac6f8bfefd179e6c2632976a154b5c9ff04 * client factory * fix * fix * update * add sdk/resourcemanager/postgresql/armpostgresql live test (#20685) * add sdk/resourcemanager/postgresql/armpostgresql live test * update assets.json * set subscriptionId default value * format * add sdk/resourcemanager/eventhub/armeventhub live test (#20686) * add sdk/resourcemanager/eventhub/armeventhub live test * update assets * add sdk/resourcemanager/compute/armcompute live test (#20048) * add sdk/resourcemanager/compute/armcompute live test * skus filter * fix subscriptionId default value * fix * gofmt * update recording * sdk/resourcemanager/network/armnetwork live test (#20331) * sdk/resourcemanager/network/armnetwork live test * update subscriptionId default value * update recording * add sdk/resourcemanager/cosmos/armcosmos live test (#20705) * add sdk/resourcemanager/cosmos/armcosmos live test * update assets.json * update assets.json * update assets.json * update assets.json * Increment package version after release of azcore (#20740) * [azeventhubs] Improperly resetting etag in the checkpoint store (#20737) We shouldn't be resetting the etag to nil - it's what we use to enforce a "single winner" when doing ownership claims. The bug here was two-fold: I had bad logic in my previous claim ownership, which I fixed in a previous PR, but we need to reflect that same constraint properly in our in-memory checkpoint store for these tests. * Eng workflows sync and branch cleanup additions (#20743) Co-authored-by: James Suplizio <[email protected]> * [azeventhubs] Latest start position can also be inclusive (ie, get the latest message) (#20744) * Update GitHubEventProcessor version and remove pull_request_review procesing (#20751) Co-authored-by: James Suplizio <[email protected]> * Rename DisableAuthorityValidationAndInstanceDiscovery (#20746) * added basic fs methods * corrections * fix (#20707) * AzFile (#20739) * azfile: Fixing connection string parsing logic (#20798) * Fixing connection string parse logic * Update README * [azadmin] fix flaky test (#20758) * fix flaky test * charles suggestion * Prepare azidentity v1.3.0 for release (#20756) * Fix broken podman link (#20801) Co-authored-by: Wes Haggard <[email protected]> * [azquery] update doc comments (#20755) * update doc comments * update statistics and visualization generation * prep-for-release * Fixed contribution section (#20752) Co-authored-by: Bob Tabor <[email protected]> * [azeventhubs,azservicebus] Some API cleanup, renames (#20754) * Adding options to UpdateCheckpoint(), just for future potential expansion * Make Offset an int64, not a *int64 (it's not optional, it'll always come back with ReceivedEvents) * Adding more logging into the checkpoint store. * Point all imports at the production go-amqp * Add supporting features to enable distributed tracing (#20301) (#20708) * Add supporting features to enable distributed tracing This includes new internal pipeline policies and other supporting types. See the changelog for a full description. Added some missing doc comments. * fix linter issue * add net.peer.name trace attribute sequence custom HTTP header policy before logging policy. sequence logging policy after HTTP trace policy. keep body download policy at the end. * add span for iterating over pages * Restore ARM CAE support for azcore beta (#20657) This reverts commit 9020972. * Upgrade to stable azcore (#20808) * Increment package version after release of data/azcosmos (#20807) * Updating changelog (#20810) * Add fake package to azcore (#20711) * Add fake package to azcore This is the supporting infrastructure for the generated SDK fakes. * fix doc comment * Updating CHANGELOG.md (#20809) * changelog (#20811) * Increment package version after release of storage/azfile (#20813) * Update changelog (azblob) (#20815) * Updating CHANGELOG.md * Update the changelog with correct version * [azquery] migration guide (#20742) * migration guide * Charles feedback * Richard feedback --------- Co-authored-by: Charles Lowell <[email protected]> * Increment package version after release of monitor/azquery (#20820) * [keyvault] prep for release (#20819) * prep for release * perf tests * update date * more models * changed generated code and added more models * added client files * regenrated and added more models * file and dir clients setup * combined into one package * added listing methods * separated clients * added additional clients * clean up on path client * more cleanup * more models for file client * cleanup * regenerated using new autorest * more models for fs * cleanup imports * further cleanup * lease acc conditions fixes * lease acc conditions fixes * rename methods return type * added lease * cleanup * cleanup * cleanup * added go version * feedback and cleanup * feedback and cleanup * move path to internal and create common * moved access helpers to internal * make access conditions common * cleanup * handled feedback * cleanup * conn string parsing --------- Co-authored-by: Joel Hendrix <[email protected]> Co-authored-by: Matias Quaranta <[email protected]> Co-authored-by: Richard Park <[email protected]> Co-authored-by: Azure SDK Bot <[email protected]> Co-authored-by: Scott Beddall <[email protected]> Co-authored-by: siminsavani-msft <[email protected]> Co-authored-by: scbedd <[email protected]> Co-authored-by: Charles Lowell <[email protected]> Co-authored-by: Peng Jiahui <[email protected]> Co-authored-by: James Suplizio <[email protected]> Co-authored-by: Sourav Gupta <[email protected]> Co-authored-by: gracewilcox <[email protected]> Co-authored-by: Wes Haggard <[email protected]> Co-authored-by: Bob Tabor <[email protected]> Co-authored-by: Bob Tabor <[email protected]>
1 parent a93ed52 commit bcd2b48

Some content is hidden

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

48 files changed

+3435
-189
lines changed

sdk/storage/azdatalake/common.go

+31
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
//go:build go1.18
2+
// +build go1.18
3+
4+
// Copyright (c) Microsoft Corporation. All rights reserved.
5+
// Licensed under the MIT License. See License.txt in the project root for license information.
6+
7+
package azdatalake
8+
9+
import (
10+
"github.com/Azure/azure-sdk-for-go/sdk/azcore"
11+
"github.com/Azure/azure-sdk-for-go/sdk/storage/azdatalake/internal/generated"
12+
)
13+
14+
// ClientOptions contains the optional parameters when creating a Client.
15+
type ClientOptions struct {
16+
azcore.ClientOptions
17+
}
18+
19+
const SnapshotTimeFormat = "2006-01-02T15:04:05.0000000Z07:00"
20+
21+
// AccessConditions identifies container-specific access conditions which you optionally set.
22+
type AccessConditions struct {
23+
ModifiedAccessConditions *ModifiedAccessConditions
24+
LeaseAccessConditions *LeaseAccessConditions
25+
}
26+
27+
// LeaseAccessConditions contains optional parameters to access leased entity.
28+
type LeaseAccessConditions = generated.LeaseAccessConditions
29+
30+
// ModifiedAccessConditions contains a group of parameters for specifying access conditions.
31+
type ModifiedAccessConditions = generated.ModifiedAccessConditions
+72
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,72 @@
1+
//go:build go1.18
2+
// +build go1.18
3+
4+
// Copyright (c) Microsoft Corporation. All rights reserved.
5+
// Licensed under the MIT License. See License.txt in the project root for license information.
6+
7+
package directory
8+
9+
import (
10+
"context"
11+
"github.com/Azure/azure-sdk-for-go/sdk/azcore"
12+
"github.com/Azure/azure-sdk-for-go/sdk/storage/azdatalake"
13+
"github.com/Azure/azure-sdk-for-go/sdk/storage/azdatalake/internal/path"
14+
)
15+
16+
// Client represents a URL to the Azure Datalake Storage service allowing you to manipulate datalake directories.
17+
type Client struct {
18+
path.Client
19+
}
20+
21+
// NewClient creates an instance of Client with the specified values.
22+
// - serviceURL - the URL of the storage account e.g. https://<account>.dfs.core.windows.net/
23+
// - cred - an Azure AD credential, typically obtained via the azidentity module
24+
// - options - client options; pass nil to accept the default values
25+
func NewClient(serviceURL string, cred azcore.TokenCredential, options *azdatalake.ClientOptions) (*Client, error) {
26+
return nil, nil
27+
}
28+
29+
// NewClientWithNoCredential creates an instance of Client with the specified values.
30+
// This is used to anonymously access a storage account or with a shared access signature (SAS) token.
31+
// - serviceURL - the URL of the storage account e.g. https://<account>.dfs.core.windows.net/?<sas token>
32+
// - options - client options; pass nil to accept the default values
33+
func NewClientWithNoCredential(serviceURL string, options *azdatalake.ClientOptions) (*Client, error) {
34+
return nil, nil
35+
}
36+
37+
// NewClientWithSharedKeyCredential creates an instance of Client with the specified values.
38+
// - serviceURL - the URL of the storage account e.g. https://<account>.dfs.core.windows.net/
39+
// - cred - a SharedKeyCredential created with the matching storage account and access key
40+
// - options - client options; pass nil to accept the default values
41+
func NewClientWithSharedKeyCredential(serviceURL string, cred *SharedKeyCredential, options *azdatalake.ClientOptions) (*Client, error) {
42+
return nil, nil
43+
}
44+
45+
// NewClientFromConnectionString creates an instance of Client with the specified values.
46+
// - connectionString - a connection string for the desired storage account
47+
// - options - client options; pass nil to accept the default values
48+
func NewClientFromConnectionString(connectionString string, options *azdatalake.ClientOptions) (*Client, error) {
49+
return nil, nil
50+
}
51+
52+
// Create creates a new directory (dfs1).
53+
func (d *Client) Create(ctx context.Context, options *CreateOptions) (CreateResponse, error) {
54+
return CreateResponse{}, nil
55+
}
56+
57+
// Delete removes the directory (dfs1).
58+
func (d *Client) Delete(ctx context.Context, options *DeleteOptions) (DeleteResponse, error) {
59+
//TODO: pass recursive = true
60+
return DeleteResponse{}, nil
61+
}
62+
63+
// GetProperties returns the properties of the directory (blob3). #TODO: we may just move this method to path client
64+
func (d *Client) GetProperties(ctx context.Context, options *GetPropertiesOptions) (GetPropertiesResponse, error) {
65+
// TODO: format blob response to path response
66+
return GetPropertiesResponse{}, nil
67+
}
68+
69+
// Rename renames the directory (dfs1).
70+
func (d *Client) Rename(ctx context.Context, newName string, options *RenameOptions) (RenameResponse, error) {
71+
return RenameResponse{}, nil
72+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
//go:build go1.18
2+
// +build go1.18
3+
4+
// Copyright (c) Microsoft Corporation. All rights reserved.
5+
// Licensed under the MIT License. See License.txt in the project root for license information.
6+
7+
package directory
8+
9+
import (
10+
"github.com/Azure/azure-sdk-for-go/sdk/storage/azdatalake/internal/path"
11+
)
12+
13+
// RenameMode defines the rename mode for RenameDirectory
14+
type RenameMode = path.RenameMode
15+
16+
const (
17+
RenameModeLegacy RenameMode = path.RenameModeLegacy
18+
RenameModePosix RenameMode = path.RenameModePosix
19+
)
20+
21+
// SetAccessControlRecursiveMode defines the set access control recursive mode for SetAccessControlRecursive
22+
type SetAccessControlRecursiveMode = path.SetAccessControlRecursiveMode
23+
24+
const (
25+
SetAccessControlRecursiveModeSet SetAccessControlRecursiveMode = path.SetAccessControlRecursiveModeSet
26+
SetAccessControlRecursiveModeModify SetAccessControlRecursiveMode = path.SetAccessControlRecursiveModeModify
27+
SetAccessControlRecursiveModeRemove SetAccessControlRecursiveMode = path.SetAccessControlRecursiveModeRemove
28+
)
29+
30+
type EncryptionAlgorithmType = path.EncryptionAlgorithmType
31+
32+
const (
33+
EncryptionAlgorithmTypeNone EncryptionAlgorithmType = path.EncryptionAlgorithmTypeNone
34+
EncryptionAlgorithmTypeAES256 EncryptionAlgorithmType = path.EncryptionAlgorithmTypeAES256
35+
)
+136
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,136 @@
1+
//go:build go1.18
2+
// +build go1.18
3+
4+
// Copyright (c) Microsoft Corporation. All rights reserved.
5+
// Licensed under the MIT License. See License.txt in the project root for license information.
6+
7+
package directory
8+
9+
import (
10+
"github.com/Azure/azure-sdk-for-go/sdk/storage/azblob/blob"
11+
"github.com/Azure/azure-sdk-for-go/sdk/storage/azdatalake"
12+
"github.com/Azure/azure-sdk-for-go/sdk/storage/azdatalake/internal/exported"
13+
"github.com/Azure/azure-sdk-for-go/sdk/storage/azdatalake/internal/generated"
14+
"github.com/Azure/azure-sdk-for-go/sdk/storage/azdatalake/internal/path"
15+
"github.com/Azure/azure-sdk-for-go/sdk/storage/azdatalake/internal/shared"
16+
"time"
17+
)
18+
19+
// CreateOptions contains the optional parameters when calling the Create operation. dfs endpoint
20+
type CreateOptions struct {
21+
// AccessConditions contains parameters for accessing the file.
22+
AccessConditions *azdatalake.AccessConditions
23+
// Metadata is a map of name-value pairs to associate with the file storage object.
24+
Metadata map[string]*string
25+
// CPKInfo contains a group of parameters for client provided encryption key.
26+
CPKInfo *CPKInfo
27+
// HTTPHeaders contains the HTTP headers for path operations.
28+
HTTPHeaders *HTTPHeaders
29+
//PathExpiryOptions *ExpiryOptions
30+
// LeaseDuration specifies the duration of the lease.
31+
LeaseDuration *time.Duration
32+
// ProposedLeaseID specifies the proposed lease ID for the file.
33+
ProposedLeaseID *string
34+
// Permissions is the octal representation of the permissions for user, group and mask.
35+
Permissions *string
36+
// Umask is the umask for the file.
37+
Umask *string
38+
// Owner is the owner of the file.
39+
Owner *string
40+
// Group is the owning group of the file.
41+
Group *string
42+
// ACL is the access control list for the file.
43+
ACL *string
44+
}
45+
46+
func (o *CreateOptions) format() (*generated.LeaseAccessConditions, *generated.ModifiedAccessConditions, *generated.PathHTTPHeaders, error) {
47+
// TODO: add all other required options for the create operation, we don't need sourceModAccCond since this is not rename
48+
leaseAccessConditions, modifiedAccessConditions := shared.FormatPathAccessConditions(o.AccessConditions)
49+
httpHeaders := &generated.PathHTTPHeaders{
50+
CacheControl: o.HTTPHeaders.CacheControl,
51+
ContentDisposition: o.HTTPHeaders.ContentDisposition,
52+
ContentEncoding: o.HTTPHeaders.ContentEncoding,
53+
ContentLanguage: o.HTTPHeaders.ContentLanguage,
54+
ContentMD5: o.HTTPHeaders.ContentMD5,
55+
ContentType: o.HTTPHeaders.ContentType,
56+
TransactionalContentHash: o.HTTPHeaders.ContentMD5,
57+
}
58+
return leaseAccessConditions, modifiedAccessConditions, httpHeaders, nil
59+
}
60+
61+
// DeleteOptions contains the optional parameters when calling the Delete operation. dfs endpoint
62+
type DeleteOptions struct {
63+
// AccessConditions specifies parameters for accessing the directory
64+
AccessConditions *azdatalake.AccessConditions
65+
}
66+
67+
func (o *DeleteOptions) format() (*generated.LeaseAccessConditions, *generated.ModifiedAccessConditions, error) {
68+
leaseAccessConditions, modifiedAccessConditions := shared.FormatPathAccessConditions(o.AccessConditions)
69+
return leaseAccessConditions, modifiedAccessConditions, nil
70+
}
71+
72+
type RenameOptions struct {
73+
// SourceModifiedAccessConditions specifies parameters for accessing the source directory
74+
SourceModifiedAccessConditions *SourceModifiedAccessConditions
75+
// AccessConditions specifies parameters for accessing the destination directory
76+
AccessConditions *azdatalake.AccessConditions
77+
}
78+
79+
// GetPropertiesOptions contains the optional parameters for the Client.GetProperties method
80+
type GetPropertiesOptions struct {
81+
AccessConditions *azdatalake.AccessConditions
82+
CPKInfo *CPKInfo
83+
}
84+
85+
func (o *GetPropertiesOptions) format() *blob.GetPropertiesOptions {
86+
if o == nil {
87+
return nil
88+
}
89+
accessConditions := shared.FormatBlobAccessConditions(o.AccessConditions)
90+
return &blob.GetPropertiesOptions{
91+
AccessConditions: accessConditions,
92+
CPKInfo: &blob.CPKInfo{
93+
EncryptionKey: o.CPKInfo.EncryptionKey,
94+
EncryptionAlgorithm: o.CPKInfo.EncryptionAlgorithm,
95+
EncryptionKeySHA256: o.CPKInfo.EncryptionKeySHA256,
96+
},
97+
}
98+
}
99+
100+
// ===================================== PATH IMPORTS ===========================================
101+
102+
// CPKInfo contains a group of parameters for client provided encryption key.
103+
type CPKInfo = path.CPKInfo
104+
105+
// CPKScopeInfo contains a group of parameters for client provided encryption scope.
106+
type CPKScopeInfo = path.CPKScopeInfo
107+
108+
// HTTPHeaders contains the HTTP headers for path operations.
109+
type HTTPHeaders = path.HTTPHeaders
110+
111+
// SourceModifiedAccessConditions identifies the source path access conditions.
112+
type SourceModifiedAccessConditions = path.SourceModifiedAccessConditions
113+
114+
// SetAccessControlOptions contains the optional parameters when calling the SetAccessControl operation.
115+
type SetAccessControlOptions = path.SetAccessControlOptions
116+
117+
// GetAccessControlOptions contains the optional parameters when calling the GetAccessControl operation.
118+
type GetAccessControlOptions = path.GetAccessControlOptions
119+
120+
// SetAccessControlRecursiveOptions contains the optional parameters when calling the SetAccessControlRecursive operation.
121+
type SetAccessControlRecursiveOptions = path.SetAccessControlRecursiveOptions
122+
123+
// SetMetadataOptions contains the optional parameters when calling the SetMetadata operation.
124+
type SetMetadataOptions = path.SetMetadataOptions
125+
126+
// SetHTTPHeadersOptions contains the optional parameters when calling the SetHTTPHeaders operation.
127+
type SetHTTPHeadersOptions = path.SetHTTPHeadersOptions
128+
129+
// RemoveAccessControlRecursiveOptions contains the optional parameters when calling the RemoveAccessControlRecursive operation.
130+
type RemoveAccessControlRecursiveOptions = path.RemoveAccessControlRecursiveOptions
131+
132+
// UpdateAccessControlRecursiveOptions contains the optional parameters when calling the UpdateAccessControlRecursive operation.
133+
type UpdateAccessControlRecursiveOptions = path.UpdateAccessControlRecursiveOptions
134+
135+
// SharedKeyCredential contains an account's name and its primary or secondary key.
136+
type SharedKeyCredential = exported.SharedKeyCredential
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
//go:build go1.18
2+
// +build go1.18
3+
4+
// Copyright (c) Microsoft Corporation. All rights reserved.
5+
// Licensed under the MIT License. See License.txt in the project root for license information.
6+
7+
package directory
8+
9+
import (
10+
"github.com/Azure/azure-sdk-for-go/sdk/storage/azdatalake/internal/generated"
11+
"github.com/Azure/azure-sdk-for-go/sdk/storage/azdatalake/internal/path"
12+
)
13+
14+
// CreateResponse contains the response fields for the Create operation.
15+
type CreateResponse = generated.PathClientCreateResponse
16+
17+
// DeleteResponse contains the response fields for the Delete operation.
18+
type DeleteResponse = generated.PathClientDeleteResponse
19+
20+
// SetAccessControlResponse contains the response fields for the SetAccessControl operation.
21+
type SetAccessControlResponse = path.SetAccessControlResponse
22+
23+
// SetAccessControlRecursiveResponse contains the response fields for the SetAccessControlRecursive operation.
24+
type SetAccessControlRecursiveResponse = path.SetAccessControlRecursiveResponse
25+
26+
// UpdateAccessControlRecursiveResponse contains the response fields for the UpdateAccessControlRecursive operation.
27+
type UpdateAccessControlRecursiveResponse = path.SetAccessControlRecursiveResponse
28+
29+
// RemoveAccessControlRecursiveResponse contains the response fields for the RemoveAccessControlRecursive operation.
30+
type RemoveAccessControlRecursiveResponse = path.SetAccessControlRecursiveResponse
31+
32+
// GetPropertiesResponse contains the response fields for the GetProperties operation.
33+
type GetPropertiesResponse = path.GetPropertiesResponse
34+
35+
// SetMetadataResponse contains the response fields for the SetMetadata operation.
36+
type SetMetadataResponse = path.SetMetadataResponse
37+
38+
// SetHTTPHeadersResponse contains the response fields for the SetHTTPHeaders operation.
39+
type SetHTTPHeadersResponse = path.SetHTTPHeadersResponse
40+
41+
// RenameResponse contains the response fields for the Rename operation.
42+
type RenameResponse = path.CreateResponse
43+
44+
// GetAccessControlResponse contains the response fields for the GetAccessControl operation.
45+
type GetAccessControlResponse = path.GetAccessControlResponse

0 commit comments

Comments
 (0)