Skip to content

Commit

Permalink
AzDatalake APIView (#20757)
Browse files Browse the repository at this point in the history
* 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]>
  • Loading branch information
16 people authored Jun 12, 2023
1 parent a93ed52 commit bcd2b48
Show file tree
Hide file tree
Showing 48 changed files with 3,435 additions and 189 deletions.
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 {
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
72 changes: 72 additions & 0 deletions sdk/storage/azdatalake/directory/client.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
//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/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 *SharedKeyCredential, options *azdatalake.ClientOptions) (*Client, error) {
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
)
136 changes: 136 additions & 0 deletions sdk/storage/azdatalake/directory/models.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,136 @@
//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/exported"
"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

// SharedKeyCredential contains an account's name and its primary or secondary key.
type SharedKeyCredential = exported.SharedKeyCredential
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

0 comments on commit bcd2b48

Please sign in to comment.