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

AzDatalake APIView #20757

Merged
Merged
Show file tree
Hide file tree
Changes from 84 commits
Commits
Show all changes
88 commits
Select commit Hold shift + click to select a range
e8167a2
Enable gocritic during linting (#20715)
jhendrixMSFT Apr 28, 2023
86627ae
Cosmos DB: Enable merge support (#20716)
ealsur Apr 28, 2023
8ac8c6d
[azservicebus, azeventhubs] Stress test and logging improvement (#20710)
richardpark-msft May 1, 2023
9111616
update proxy version (#20712)
azure-sdk May 1, 2023
d6bf190
Return an error when you try to send a message that's too large. (#20…
richardpark-msft May 1, 2023
e2693bd
Changes in test that is failing in pipeline (#20693)
siminsavani-msft May 2, 2023
03f0ac3
[azservicebus, azeventhubs] Treat 'entity full' as a fatal error (#20…
richardpark-msft May 2, 2023
838842d
[azservicebus/azeventhubs] Redirect stderr and stdout to tee (#20726)
richardpark-msft May 3, 2023
20b4dd8
Update changelog with latest features (#20730)
jhendrixMSFT May 3, 2023
745d967
pass along the artifact name so we can override it later (#20732)
azure-sdk May 3, 2023
6dfd0cb
[azeventhubs] Fixing checkpoint store race condition (#20727)
richardpark-msft May 3, 2023
ed7f3c7
Fix azidentity troubleshooting guide link (#20736)
chlowell May 3, 2023
b2cddab
[Release] sdk/resourcemanager/paloaltonetworksngfw/armpanngfw/0.1.0 (…
Alancere May 4, 2023
2a8d96d
add sdk/resourcemanager/postgresql/armpostgresql live test (#20685)
Alancere May 4, 2023
0d22aed
add sdk/resourcemanager/eventhub/armeventhub live test (#20686)
Alancere May 4, 2023
5fa7df4
add sdk/resourcemanager/compute/armcompute live test (#20048)
Alancere May 4, 2023
c005ed6
sdk/resourcemanager/network/armnetwork live test (#20331)
Alancere May 4, 2023
36f766d
add sdk/resourcemanager/cosmos/armcosmos live test (#20705)
Alancere May 4, 2023
9c9d62a
Increment package version after release of azcore (#20740)
azure-sdk May 4, 2023
8bc3450
[azeventhubs] Improperly resetting etag in the checkpoint store (#20737)
richardpark-msft May 4, 2023
e1a6152
Eng workflows sync and branch cleanup additions (#20743)
azure-sdk May 4, 2023
04b463d
[azeventhubs] Latest start position can also be inclusive (ie, get th…
richardpark-msft May 4, 2023
8849196
Update GitHubEventProcessor version and remove pull_request_review pr…
azure-sdk May 5, 2023
27f5ee0
Rename DisableAuthorityValidationAndInstanceDiscovery (#20746)
chlowell May 5, 2023
a072438
added basic fs methods
tasherif-msft May 5, 2023
c6d86ea
corrections
tasherif-msft May 5, 2023
2eec707
fix (#20707)
Alancere May 6, 2023
22db2d4
AzFile (#20739)
souravgupta-msft May 8, 2023
0cbfd88
azfile: Fixing connection string parsing logic (#20798)
souravgupta-msft May 8, 2023
d54fb08
[azadmin] fix flaky test (#20758)
gracewilcox May 8, 2023
ad8ebd9
Prepare azidentity v1.3.0 for release (#20756)
chlowell May 8, 2023
e2a6f70
Fix broken podman link (#20801)
azure-sdk May 8, 2023
a59d912
[azquery] update doc comments (#20755)
gracewilcox May 8, 2023
bd3b467
Fixed contribution section (#20752)
bobtabor-msft May 8, 2023
132a01a
[azeventhubs,azservicebus] Some API cleanup, renames (#20754)
richardpark-msft May 8, 2023
8db51ca
Add supporting features to enable distributed tracing (#20301) (#20708)
jhendrixMSFT May 9, 2023
4a66b4f
Restore ARM CAE support for azcore beta (#20657)
chlowell May 9, 2023
7d4a3cb
Upgrade to stable azcore (#20808)
chlowell May 9, 2023
068c3be
Increment package version after release of data/azcosmos (#20807)
azure-sdk May 9, 2023
8e0f66e
Updating changelog (#20810)
souravgupta-msft May 9, 2023
ce926c4
Add fake package to azcore (#20711)
jhendrixMSFT May 9, 2023
1a145c5
Updating CHANGELOG.md (#20809)
siminsavani-msft May 9, 2023
90dfc5c
changelog (#20811)
tasherif-msft May 9, 2023
c7eda59
Increment package version after release of storage/azfile (#20813)
azure-sdk May 9, 2023
7fac0b5
Update changelog (azblob) (#20815)
siminsavani-msft May 9, 2023
498a2ef
[azquery] migration guide (#20742)
gracewilcox May 9, 2023
e73c092
Merge branch 'main' into datalake-service-client
tasherif-msft May 9, 2023
ccb967e
Increment package version after release of monitor/azquery (#20820)
azure-sdk May 9, 2023
f4e6a22
[keyvault] prep for release (#20819)
gracewilcox May 10, 2023
59181e8
more models
tasherif-msft May 11, 2023
8fd8eda
Merge branch 'main' into feature/azdatalake
tasherif-msft May 11, 2023
e4d5f36
Merge branch 'main' into datalake-service-client
tasherif-msft May 11, 2023
c94fa00
Merge remote-tracking branch 'upstream/feature/azdatalake' into featu…
tasherif-msft May 11, 2023
bec5bfd
Merge remote-tracking branch 'upstream/feature/azdatalake' into datal…
tasherif-msft May 11, 2023
df6dd55
Merge branch 'feature/azdatalake' into datalake-service-client
tasherif-msft May 11, 2023
18efd62
changed generated code and added more models
tasherif-msft May 11, 2023
3efbd78
added client files
tasherif-msft May 11, 2023
6921900
regenrated and added more models
tasherif-msft May 16, 2023
edef1cf
file and dir clients setup
tasherif-msft May 18, 2023
1a4a1f8
combined into one package
tasherif-msft May 18, 2023
dea58c4
added listing methods
tasherif-msft May 18, 2023
8bcc5eb
separated clients
tasherif-msft May 24, 2023
8dd0572
added additional clients
tasherif-msft May 24, 2023
e9a2d1d
clean up on path client
tasherif-msft May 26, 2023
9e0146c
more cleanup
tasherif-msft May 26, 2023
a96579c
more models for file client
tasherif-msft May 26, 2023
338b8b3
cleanup
tasherif-msft May 26, 2023
64865e1
regenerated using new autorest
tasherif-msft May 29, 2023
00fb147
more models for fs
tasherif-msft May 29, 2023
c95cb99
cleanup imports
tasherif-msft May 29, 2023
4cc1c57
further cleanup
tasherif-msft May 29, 2023
1df1123
lease acc conditions fixes
tasherif-msft May 29, 2023
67ea49d
lease acc conditions fixes
tasherif-msft May 29, 2023
68894ec
rename methods return type
tasherif-msft May 31, 2023
0871cb0
added lease
tasherif-msft May 31, 2023
6af7afb
cleanup
tasherif-msft May 31, 2023
fed7fd1
cleanup
tasherif-msft Jun 1, 2023
e5cc5e2
cleanup
tasherif-msft Jun 2, 2023
715f246
added go version
tasherif-msft Jun 2, 2023
410f7d2
feedback and cleanup
tasherif-msft Jun 5, 2023
f45d7b3
feedback and cleanup
tasherif-msft Jun 5, 2023
feda875
move path to internal and create common
tasherif-msft Jun 6, 2023
7eccb2f
moved access helpers to internal
tasherif-msft Jun 6, 2023
56151f7
make access conditions common
tasherif-msft Jun 6, 2023
a592289
cleanup
tasherif-msft Jun 6, 2023
3f54d1c
handled feedback
tasherif-msft Jun 7, 2023
5159328
cleanup
tasherif-msft Jun 8, 2023
57884c5
conn string parsing
tasherif-msft Jun 12, 2023
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
31 changes: 31 additions & 0 deletions sdk/storage/azdatalake/common.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
//go:build go1.18
// +build go1.18

// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.

package azdatalake

import (
"github.com/Azure/azure-sdk-for-go/sdk/azcore"
"github.com/Azure/azure-sdk-for-go/sdk/storage/azdatalake/internal/generated"
)

// ClientOptions contains the optional parameters when creating a Client.
type ClientOptions struct {
tasherif-msft marked this conversation as resolved.
Show resolved Hide resolved
azcore.ClientOptions
}

const SnapshotTimeFormat = "2006-01-02T15:04:05.0000000Z07:00"

// AccessConditions identifies container-specific access conditions which you optionally set.
type AccessConditions struct {
ModifiedAccessConditions *ModifiedAccessConditions
LeaseAccessConditions *LeaseAccessConditions
}

// LeaseAccessConditions contains optional parameters to access leased entity.
type LeaseAccessConditions = generated.LeaseAccessConditions

// ModifiedAccessConditions contains a group of parameters for specifying access conditions.
type ModifiedAccessConditions = generated.ModifiedAccessConditions
73 changes: 73 additions & 0 deletions sdk/storage/azdatalake/directory/client.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
//go:build go1.18
// +build go1.18

// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.

package directory

import (
"context"
"github.com/Azure/azure-sdk-for-go/sdk/azcore"
"github.com/Azure/azure-sdk-for-go/sdk/storage/azdatalake"
"github.com/Azure/azure-sdk-for-go/sdk/storage/azdatalake/internal/exported"
"github.com/Azure/azure-sdk-for-go/sdk/storage/azdatalake/internal/path"
)

// Client represents a URL to the Azure Datalake Storage service allowing you to manipulate datalake directories.
type Client struct {
path.Client
}

// NewClient creates an instance of Client with the specified values.
// - serviceURL - the URL of the storage account e.g. https://<account>.dfs.core.windows.net/
// - cred - an Azure AD credential, typically obtained via the azidentity module
// - options - client options; pass nil to accept the default values
func NewClient(serviceURL string, cred azcore.TokenCredential, options *azdatalake.ClientOptions) (*Client, error) {
return nil, nil
}

// NewClientWithNoCredential creates an instance of Client with the specified values.
// This is used to anonymously access a storage account or with a shared access signature (SAS) token.
// - serviceURL - the URL of the storage account e.g. https://<account>.dfs.core.windows.net/?<sas token>
// - options - client options; pass nil to accept the default values
func NewClientWithNoCredential(serviceURL string, options *azdatalake.ClientOptions) (*Client, error) {
return nil, nil
}

// NewClientWithSharedKeyCredential creates an instance of Client with the specified values.
// - serviceURL - the URL of the storage account e.g. https://<account>.dfs.core.windows.net/
// - cred - a SharedKeyCredential created with the matching storage account and access key
// - options - client options; pass nil to accept the default values
func NewClientWithSharedKeyCredential(serviceURL string, cred *exported.SharedKeyCredential, options *azdatalake.ClientOptions) (*Client, error) {
tasherif-msft marked this conversation as resolved.
Show resolved Hide resolved
return nil, nil
}

// NewClientFromConnectionString creates an instance of Client with the specified values.
// - connectionString - a connection string for the desired storage account
// - options - client options; pass nil to accept the default values
func NewClientFromConnectionString(connectionString string, options *azdatalake.ClientOptions) (*Client, error) {
return nil, nil
}

// Create creates a new directory (dfs1).
func (d *Client) Create(ctx context.Context, options *CreateOptions) (CreateResponse, error) {
return CreateResponse{}, nil
}

// Delete removes the directory (dfs1).
func (d *Client) Delete(ctx context.Context, options *DeleteOptions) (DeleteResponse, error) {
//TODO: pass recursive = true
return DeleteResponse{}, nil
}

// GetProperties returns the properties of the directory (blob3). #TODO: we may just move this method to path client
func (d *Client) GetProperties(ctx context.Context, options *GetPropertiesOptions) (GetPropertiesResponse, error) {
// TODO: format blob response to path response
return GetPropertiesResponse{}, nil
}

// Rename renames the directory (dfs1).
func (d *Client) Rename(ctx context.Context, newName string, options *RenameOptions) (RenameResponse, error) {
return RenameResponse{}, nil
}
35 changes: 35 additions & 0 deletions sdk/storage/azdatalake/directory/constants.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
//go:build go1.18
// +build go1.18

// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.

package directory

import (
"github.com/Azure/azure-sdk-for-go/sdk/storage/azdatalake/internal/path"
)

// RenameMode defines the rename mode for RenameDirectory
type RenameMode = path.RenameMode

const (
RenameModeLegacy RenameMode = path.RenameModeLegacy
RenameModePosix RenameMode = path.RenameModePosix
)

// SetAccessControlRecursiveMode defines the set access control recursive mode for SetAccessControlRecursive
type SetAccessControlRecursiveMode = path.SetAccessControlRecursiveMode

const (
SetAccessControlRecursiveModeSet SetAccessControlRecursiveMode = path.SetAccessControlRecursiveModeSet
SetAccessControlRecursiveModeModify SetAccessControlRecursiveMode = path.SetAccessControlRecursiveModeModify
SetAccessControlRecursiveModeRemove SetAccessControlRecursiveMode = path.SetAccessControlRecursiveModeRemove
)

type EncryptionAlgorithmType = path.EncryptionAlgorithmType

const (
EncryptionAlgorithmTypeNone EncryptionAlgorithmType = path.EncryptionAlgorithmTypeNone
EncryptionAlgorithmTypeAES256 EncryptionAlgorithmType = path.EncryptionAlgorithmTypeAES256
)
132 changes: 132 additions & 0 deletions sdk/storage/azdatalake/directory/models.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,132 @@
//go:build go1.18
// +build go1.18

// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.

package directory

import (
"github.com/Azure/azure-sdk-for-go/sdk/storage/azblob/blob"
"github.com/Azure/azure-sdk-for-go/sdk/storage/azdatalake"
"github.com/Azure/azure-sdk-for-go/sdk/storage/azdatalake/internal/generated"
"github.com/Azure/azure-sdk-for-go/sdk/storage/azdatalake/internal/path"
"github.com/Azure/azure-sdk-for-go/sdk/storage/azdatalake/internal/shared"
"time"
)

// CreateOptions contains the optional parameters when calling the Create operation. dfs endpoint
type CreateOptions struct {
// AccessConditions contains parameters for accessing the file.
AccessConditions *azdatalake.AccessConditions
// Metadata is a map of name-value pairs to associate with the file storage object.
Metadata map[string]*string
// CPKInfo contains a group of parameters for client provided encryption key.
CPKInfo *CPKInfo
// HTTPHeaders contains the HTTP headers for path operations.
HTTPHeaders *HTTPHeaders
//PathExpiryOptions *ExpiryOptions
// LeaseDuration specifies the duration of the lease.
LeaseDuration *time.Duration
// ProposedLeaseID specifies the proposed lease ID for the file.
ProposedLeaseID *string
// Permissions is the octal representation of the permissions for user, group and mask.
Permissions *string
// Umask is the umask for the file.
Umask *string
// Owner is the owner of the file.
Owner *string
// Group is the owning group of the file.
Group *string
// ACL is the access control list for the file.
ACL *string
}

func (o *CreateOptions) format() (*generated.LeaseAccessConditions, *generated.ModifiedAccessConditions, *generated.PathHTTPHeaders, error) {
// TODO: add all other required options for the create operation, we don't need sourceModAccCond since this is not rename
leaseAccessConditions, modifiedAccessConditions := shared.FormatPathAccessConditions(o.AccessConditions)
httpHeaders := &generated.PathHTTPHeaders{
CacheControl: o.HTTPHeaders.CacheControl,
ContentDisposition: o.HTTPHeaders.ContentDisposition,
ContentEncoding: o.HTTPHeaders.ContentEncoding,
ContentLanguage: o.HTTPHeaders.ContentLanguage,
ContentMD5: o.HTTPHeaders.ContentMD5,
ContentType: o.HTTPHeaders.ContentType,
TransactionalContentHash: o.HTTPHeaders.ContentMD5,
}
return leaseAccessConditions, modifiedAccessConditions, httpHeaders, nil
}

// DeleteOptions contains the optional parameters when calling the Delete operation. dfs endpoint
type DeleteOptions struct {
// AccessConditions specifies parameters for accessing the directory
AccessConditions *azdatalake.AccessConditions
}

func (o *DeleteOptions) format() (*generated.LeaseAccessConditions, *generated.ModifiedAccessConditions, error) {
leaseAccessConditions, modifiedAccessConditions := shared.FormatPathAccessConditions(o.AccessConditions)
return leaseAccessConditions, modifiedAccessConditions, nil
}

type RenameOptions struct {
// SourceModifiedAccessConditions specifies parameters for accessing the source directory
SourceModifiedAccessConditions *SourceModifiedAccessConditions
// AccessConditions specifies parameters for accessing the destination directory
AccessConditions *azdatalake.AccessConditions
}

// GetPropertiesOptions contains the optional parameters for the Client.GetProperties method
type GetPropertiesOptions struct {
AccessConditions *azdatalake.AccessConditions
CPKInfo *CPKInfo
}

func (o *GetPropertiesOptions) format() *blob.GetPropertiesOptions {
if o == nil {
return nil
}
accessConditions := shared.FormatBlobAccessConditions(o.AccessConditions)
return &blob.GetPropertiesOptions{
AccessConditions: accessConditions,
CPKInfo: &blob.CPKInfo{
EncryptionKey: o.CPKInfo.EncryptionKey,
EncryptionAlgorithm: o.CPKInfo.EncryptionAlgorithm,
EncryptionKeySHA256: o.CPKInfo.EncryptionKeySHA256,
},
}
}

// ===================================== PATH IMPORTS ===========================================

// CPKInfo contains a group of parameters for client provided encryption key.
type CPKInfo = path.CPKInfo

// CPKScopeInfo contains a group of parameters for client provided encryption scope.
type CPKScopeInfo = path.CPKScopeInfo

// HTTPHeaders contains the HTTP headers for path operations.
type HTTPHeaders = path.HTTPHeaders

// SourceModifiedAccessConditions identifies the source path access conditions.
type SourceModifiedAccessConditions = path.SourceModifiedAccessConditions

// SetAccessControlOptions contains the optional parameters when calling the SetAccessControl operation.
type SetAccessControlOptions = path.SetAccessControlOptions

// GetAccessControlOptions contains the optional parameters when calling the GetAccessControl operation.
type GetAccessControlOptions = path.GetAccessControlOptions

// SetAccessControlRecursiveOptions contains the optional parameters when calling the SetAccessControlRecursive operation.
type SetAccessControlRecursiveOptions = path.SetAccessControlRecursiveOptions

// SetMetadataOptions contains the optional parameters when calling the SetMetadata operation.
type SetMetadataOptions = path.SetMetadataOptions

// SetHTTPHeadersOptions contains the optional parameters when calling the SetHTTPHeaders operation.
type SetHTTPHeadersOptions = path.SetHTTPHeadersOptions

// RemoveAccessControlRecursiveOptions contains the optional parameters when calling the RemoveAccessControlRecursive operation.
type RemoveAccessControlRecursiveOptions = path.RemoveAccessControlRecursiveOptions

// UpdateAccessControlRecursiveOptions contains the optional parameters when calling the UpdateAccessControlRecursive operation.
type UpdateAccessControlRecursiveOptions = path.UpdateAccessControlRecursiveOptions
45 changes: 45 additions & 0 deletions sdk/storage/azdatalake/directory/responses.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
//go:build go1.18
// +build go1.18

// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.

package directory

import (
"github.com/Azure/azure-sdk-for-go/sdk/storage/azdatalake/internal/generated"
"github.com/Azure/azure-sdk-for-go/sdk/storage/azdatalake/internal/path"
)

// CreateResponse contains the response fields for the Create operation.
type CreateResponse = generated.PathClientCreateResponse

// DeleteResponse contains the response fields for the Delete operation.
type DeleteResponse = generated.PathClientDeleteResponse

// SetAccessControlResponse contains the response fields for the SetAccessControl operation.
type SetAccessControlResponse = path.SetAccessControlResponse

// SetAccessControlRecursiveResponse contains the response fields for the SetAccessControlRecursive operation.
type SetAccessControlRecursiveResponse = path.SetAccessControlRecursiveResponse

// UpdateAccessControlRecursiveResponse contains the response fields for the UpdateAccessControlRecursive operation.
type UpdateAccessControlRecursiveResponse = path.SetAccessControlRecursiveResponse

// RemoveAccessControlRecursiveResponse contains the response fields for the RemoveAccessControlRecursive operation.
type RemoveAccessControlRecursiveResponse = path.SetAccessControlRecursiveResponse

// GetPropertiesResponse contains the response fields for the GetProperties operation.
type GetPropertiesResponse = path.GetPropertiesResponse

// SetMetadataResponse contains the response fields for the SetMetadata operation.
type SetMetadataResponse = path.SetMetadataResponse

// SetHTTPHeadersResponse contains the response fields for the SetHTTPHeaders operation.
type SetHTTPHeadersResponse = path.SetHTTPHeadersResponse

// RenameResponse contains the response fields for the Rename operation.
type RenameResponse = path.CreateResponse

// GetAccessControlResponse contains the response fields for the GetAccessControl operation.
type GetAccessControlResponse = path.GetAccessControlResponse
Loading