Skip to content

Commit 8fd0022

Browse files
tasherif-msftjhendrixMSFTealsurrichardpark-msftazure-sdk
authored
[AzDatalake] Pipelines + cleanup (#21298)
* 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) * 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 * ci pipeline * code cov * test resources file * fix ci * ci fix * ci fix * ci fix * ci * generated blobs * cleanup * cleanup * fix sas * cleanup * cleanup * cleanup * added tests for recursive acls * added one more tests for dir * added more tests * added more tests * tests * tests * added more tests for fs and fixed some linting issues * cleanup --------- 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 58726b9 commit 8fd0022

Some content is hidden

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

61 files changed

+16885
-928
lines changed

eng/config.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,10 @@
2828
"Name": "azqueue",
2929
"CoverageGoal": 0.60
3030
},
31+
{
32+
"Name": "azdatalake",
33+
"CoverageGoal": 0.60
34+
},
3135
{
3236
"Name": "azfile",
3337
"CoverageGoal": 0.75

sdk/storage/azdatalake/LICENSE.txt

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) Microsoft Corporation. All rights reserved.
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE

sdk/storage/azdatalake/assets.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,5 @@
22
"AssetsRepo": "Azure/azure-sdk-assets",
33
"AssetsRepoPrefixPath": "go",
44
"TagPrefix": "go/storage/azdatalake",
5-
"Tag": "go/storage/azdatalake_78f150eb1d"
5+
"Tag": "go/storage/azdatalake_ec80a91bf3"
66
}

sdk/storage/azdatalake/ci.yml

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
trigger:
2+
branches:
3+
include:
4+
- main
5+
- feature/*
6+
- hotfix/*
7+
- release/*
8+
paths:
9+
include:
10+
- sdk/storage/azdatalake
11+
12+
pr:
13+
branches:
14+
include:
15+
- main
16+
- feature/*
17+
- hotfix/*
18+
- release/*
19+
paths:
20+
include:
21+
- sdk/storage/azdatalake
22+
23+
24+
stages:
25+
- template: /eng/pipelines/templates/jobs/archetype-sdk-client.yml
26+
parameters:
27+
ServiceDirectory: 'storage/azdatalake'
28+
RunLiveTests: true

sdk/storage/azdatalake/directory/client.go

Lines changed: 96 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,14 @@ import (
1111
"github.com/Azure/azure-sdk-for-go/sdk/azcore"
1212
"github.com/Azure/azure-sdk-for-go/sdk/azcore/policy"
1313
"github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime"
14+
"github.com/Azure/azure-sdk-for-go/sdk/azcore/to"
1415
"github.com/Azure/azure-sdk-for-go/sdk/storage/azblob/blockblob"
1516
"github.com/Azure/azure-sdk-for-go/sdk/storage/azdatalake/datalakeerror"
17+
"github.com/Azure/azure-sdk-for-go/sdk/storage/azdatalake/file"
1618
"github.com/Azure/azure-sdk-for-go/sdk/storage/azdatalake/internal/base"
1719
"github.com/Azure/azure-sdk-for-go/sdk/storage/azdatalake/internal/exported"
1820
"github.com/Azure/azure-sdk-for-go/sdk/storage/azdatalake/internal/generated"
21+
"github.com/Azure/azure-sdk-for-go/sdk/storage/azdatalake/internal/generated_blob"
1922
"github.com/Azure/azure-sdk-for-go/sdk/storage/azdatalake/internal/path"
2023
"github.com/Azure/azure-sdk-for-go/sdk/storage/azdatalake/internal/shared"
2124
"github.com/Azure/azure-sdk-for-go/sdk/storage/azdatalake/sas"
@@ -29,7 +32,7 @@ import (
2932
type ClientOptions base.ClientOptions
3033

3134
// Client represents a URL to the Azure Datalake Storage service.
32-
type Client base.CompositeClient[generated.PathClient, generated.PathClient, blockblob.Client]
35+
type Client base.CompositeClient[generated.PathClient, generated_blob.BlobClient, blockblob.Client]
3336

3437
// NewClient creates an instance of Client with the specified values.
3538
// - directoryURL - the URL of the directory e.g. https://<account>.dfs.core.windows.net/fs/dir
@@ -128,12 +131,15 @@ func NewClientWithSharedKeyCredential(directoryURL string, cred *SharedKeyCreden
128131
// NewClientFromConnectionString creates an instance of Client with the specified values.
129132
// - connectionString - a connection string for the desired storage account
130133
// - options - client options; pass nil to accept the default values
131-
func NewClientFromConnectionString(connectionString string, options *ClientOptions) (*Client, error) {
134+
func NewClientFromConnectionString(connectionString string, dirPath, fsName string, options *ClientOptions) (*Client, error) {
132135
parsed, err := shared.ParseConnectionString(connectionString)
133136
if err != nil {
134137
return nil, err
135138
}
136139

140+
dirPath = strings.ReplaceAll(dirPath, "\\", "/")
141+
parsed.ServiceURL = runtime.JoinPaths(parsed.ServiceURL, fsName, dirPath)
142+
137143
if parsed.AccountKey != "" && parsed.AccountName != "" {
138144
credential, err := exported.NewSharedKeyCredential(parsed.AccountName, parsed.AccountKey)
139145
if err != nil {
@@ -146,31 +152,30 @@ func NewClientFromConnectionString(connectionString string, options *ClientOptio
146152
}
147153

148154
func (d *Client) generatedDirClientWithDFS() *generated.PathClient {
149-
//base.SharedKeyComposite((*base.CompositeClient[generated.BlobClient, generated.BlockBlobClient])(bb))
150-
dirClientWithDFS, _, _ := base.InnerClients((*base.CompositeClient[generated.PathClient, generated.PathClient, blockblob.Client])(d))
155+
dirClientWithDFS, _, _ := base.InnerClients((*base.CompositeClient[generated.PathClient, generated_blob.BlobClient, blockblob.Client])(d))
151156
return dirClientWithDFS
152157
}
153158

154-
func (d *Client) generatedDirClientWithBlob() *generated.PathClient {
155-
_, dirClientWithBlob, _ := base.InnerClients((*base.CompositeClient[generated.PathClient, generated.PathClient, blockblob.Client])(d))
159+
func (d *Client) generatedDirClientWithBlob() *generated_blob.BlobClient {
160+
_, dirClientWithBlob, _ := base.InnerClients((*base.CompositeClient[generated.PathClient, generated_blob.BlobClient, blockblob.Client])(d))
156161
return dirClientWithBlob
157162
}
158163

159164
func (d *Client) blobClient() *blockblob.Client {
160-
_, _, blobClient := base.InnerClients((*base.CompositeClient[generated.PathClient, generated.PathClient, blockblob.Client])(d))
165+
_, _, blobClient := base.InnerClients((*base.CompositeClient[generated.PathClient, generated_blob.BlobClient, blockblob.Client])(d))
161166
return blobClient
162167
}
163168

164169
func (d *Client) getClientOptions() *base.ClientOptions {
165-
return base.GetCompositeClientOptions((*base.CompositeClient[generated.PathClient, generated.PathClient, blockblob.Client])(d))
170+
return base.GetCompositeClientOptions((*base.CompositeClient[generated.PathClient, generated_blob.BlobClient, blockblob.Client])(d))
166171
}
167172

168173
func (d *Client) sharedKey() *exported.SharedKeyCredential {
169-
return base.SharedKeyComposite((*base.CompositeClient[generated.PathClient, generated.PathClient, blockblob.Client])(d))
174+
return base.SharedKeyComposite((*base.CompositeClient[generated.PathClient, generated_blob.BlobClient, blockblob.Client])(d))
170175
}
171176

172177
func (d *Client) identityCredential() *azcore.TokenCredential {
173-
return base.IdentityCredentialComposite((*base.CompositeClient[generated.PathClient, generated.PathClient, blockblob.Client])(d))
178+
return base.IdentityCredentialComposite((*base.CompositeClient[generated.PathClient, generated_blob.BlobClient, blockblob.Client])(d))
174179
}
175180

176181
// DFSURL returns the URL endpoint used by the Client object.
@@ -183,7 +188,27 @@ func (d *Client) BlobURL() string {
183188
return d.generatedDirClientWithBlob().Endpoint()
184189
}
185190

186-
//TODO: create method to get file client - this will require block blob to have a method to get another block blob
191+
// NewFileClient creates a new file.Client object by concatenating fileName to the end of this Client's URL.
192+
// The new file.Client uses the same request policy pipeline as the Client.
193+
func (d *Client) NewFileClient(fileName string) (*file.Client, error) {
194+
fileName = url.PathEscape(fileName)
195+
fileURL := runtime.JoinPaths(d.DFSURL(), fileName)
196+
newBlobURL, fileURL := shared.GetURLs(fileURL)
197+
var newBlobClient *blockblob.Client
198+
var err error
199+
if d.identityCredential() != nil {
200+
newBlobClient, err = blockblob.NewClient(newBlobURL, *d.identityCredential(), nil)
201+
} else if d.sharedKey() != nil {
202+
blobSharedKey, _ := d.sharedKey().ConvertToBlobSharedKey()
203+
newBlobClient, err = blockblob.NewClientWithSharedKeyCredential(newBlobURL, blobSharedKey, nil)
204+
} else {
205+
newBlobClient, err = blockblob.NewClientWithNoCredential(newBlobURL, nil)
206+
}
207+
if err != nil {
208+
return nil, exported.ConvertToDFSError(err)
209+
}
210+
return (*file.Client)(base.NewPathClient(fileURL, newBlobURL, newBlobClient, d.generatedDirClientWithDFS().InternalClient().WithClientName(shared.FileClient), d.sharedKey(), d.identityCredential(), d.getClientOptions())), nil
211+
}
187212

188213
// Create creates a new directory (dfs1).
189214
func (d *Client) Create(ctx context.Context, options *CreateOptions) (CreateResponse, error) {
@@ -260,12 +285,12 @@ func (d *Client) SetAccessControl(ctx context.Context, options *SetAccessControl
260285
return resp, err
261286
}
262287

263-
func (d *Client) setAccessControlHelper(mode generated.PathSetAccessControlRecursiveMode, listOptions *generated.PathClientSetAccessControlRecursiveOptions) *runtime.Pager[SetAccessControlRecursiveResponse] {
264-
return runtime.NewPager(runtime.PagingHandler[SetAccessControlRecursiveResponse]{
265-
More: func(page SetAccessControlRecursiveResponse) bool {
288+
func (d *Client) setAccessControlPager(mode generated.PathSetAccessControlRecursiveMode, listOptions *generated.PathClientSetAccessControlRecursiveOptions) *runtime.Pager[generated.PathClientSetAccessControlRecursiveResponse] {
289+
return runtime.NewPager(runtime.PagingHandler[generated.PathClientSetAccessControlRecursiveResponse]{
290+
More: func(page generated.PathClientSetAccessControlRecursiveResponse) bool {
266291
return page.Continuation != nil && len(*page.Continuation) > 0
267292
},
268-
Fetcher: func(ctx context.Context, page *SetAccessControlRecursiveResponse) (SetAccessControlRecursiveResponse, error) {
293+
Fetcher: func(ctx context.Context, page *generated.PathClientSetAccessControlRecursiveResponse) (generated.PathClientSetAccessControlRecursiveResponse, error) {
269294
var req *policy.Request
270295
var err error
271296
if page == nil {
@@ -277,15 +302,15 @@ func (d *Client) setAccessControlHelper(mode generated.PathSetAccessControlRecur
277302
err = exported.ConvertToDFSError(err)
278303
}
279304
if err != nil {
280-
return SetAccessControlRecursiveResponse{}, err
305+
return generated.PathClientSetAccessControlRecursiveResponse{}, err
281306
}
282307
resp, err := d.generatedDirClientWithDFS().InternalClient().Pipeline().Do(req)
283308
err = exported.ConvertToDFSError(err)
284309
if err != nil {
285-
return SetAccessControlRecursiveResponse{}, err
310+
return generated.PathClientSetAccessControlRecursiveResponse{}, err
286311
}
287312
if !runtime.HasStatusCode(resp, http.StatusOK) {
288-
return SetAccessControlRecursiveResponse{}, runtime.NewResponseError(resp)
313+
return generated.PathClientSetAccessControlRecursiveResponse{}, runtime.NewResponseError(resp)
289314
}
290315
newResp, err := d.generatedDirClientWithDFS().SetAccessControlRecursiveHandleResponse(resp)
291316
return newResp, exported.ConvertToDFSError(err)
@@ -294,22 +319,61 @@ func (d *Client) setAccessControlHelper(mode generated.PathSetAccessControlRecur
294319

295320
}
296321

297-
// NewSetAccessControlRecursivePager sets the owner, owning group, and permissions for a directory (dfs1).
298-
func (d *Client) NewSetAccessControlRecursivePager(ACL string, options *SetAccessControlRecursiveOptions) *runtime.Pager[SetAccessControlRecursiveResponse] {
322+
func (d *Client) setAccessControlRecursiveHelper(mode generated.PathSetAccessControlRecursiveMode, listOptions *generated.PathClientSetAccessControlRecursiveOptions, options *SetAccessControlRecursiveOptions) (SetAccessControlRecursiveResponse, error) {
323+
pager := d.setAccessControlPager(mode, listOptions)
324+
counter := *options.MaxBatches
325+
continueOnFailure := listOptions.ForceFlag
326+
totalSuccessfulDirs := int32(0)
327+
totalSuccessfulFiles := int32(0)
328+
totalFailureCount := int32(0)
329+
finalResponse := SetAccessControlRecursiveResponse{
330+
DirectoriesSuccessful: &totalSuccessfulDirs,
331+
FilesSuccessful: &totalSuccessfulFiles,
332+
FailureCount: &totalFailureCount,
333+
FailedEntries: []*ACLFailedEntry{},
334+
}
335+
for pager.More() && counter != 0 {
336+
resp, err := pager.NextPage(context.Background())
337+
if err != nil {
338+
return finalResponse, exported.ConvertToDFSError(err)
339+
}
340+
finalResponse.DirectoriesSuccessful = to.Ptr(*finalResponse.DirectoriesSuccessful + *resp.DirectoriesSuccessful)
341+
finalResponse.FilesSuccessful = to.Ptr(*finalResponse.FilesSuccessful + *resp.FilesSuccessful)
342+
finalResponse.FailureCount = to.Ptr(*finalResponse.FailureCount + *resp.FailureCount)
343+
finalResponse.FailedEntries = append(finalResponse.FailedEntries, resp.FailedEntries...)
344+
counter = counter - 1
345+
if !*continueOnFailure && *resp.FailureCount > 0 {
346+
return finalResponse, exported.ConvertToDFSError(err)
347+
}
348+
}
349+
return finalResponse, nil
350+
}
351+
352+
// SetAccessControlRecursive sets the owner, owning group, and permissions for a directory (dfs1).
353+
func (d *Client) SetAccessControlRecursive(ACL string, options *SetAccessControlRecursiveOptions) (SetAccessControlRecursiveResponse, error) {
354+
if options == nil {
355+
options = &SetAccessControlRecursiveOptions{}
356+
}
299357
mode, listOptions := options.format(ACL, "set")
300-
return d.setAccessControlHelper(mode, listOptions)
358+
return d.setAccessControlRecursiveHelper(mode, listOptions, options)
301359
}
302360

303-
// NewUpdateAccessControlRecursivePager updates the owner, owning group, and permissions for a directory (dfs1).
304-
func (d *Client) NewUpdateAccessControlRecursivePager(ACL string, options *UpdateAccessControlRecursiveOptions) *runtime.Pager[UpdateAccessControlRecursiveResponse] {
361+
// UpdateAccessControlRecursive updates the owner, owning group, and permissions for a directory (dfs1).
362+
func (d *Client) UpdateAccessControlRecursive(ACL string, options *UpdateAccessControlRecursiveOptions) (SetAccessControlRecursiveResponse, error) {
363+
if options == nil {
364+
options = &UpdateAccessControlRecursiveOptions{}
365+
}
305366
mode, listOptions := options.format(ACL, "modify")
306-
return d.setAccessControlHelper(mode, listOptions)
367+
return d.setAccessControlRecursiveHelper(mode, listOptions, options)
307368
}
308369

309-
// NewRemoveAccessControlRecursivePager removes the owner, owning group, and permissions for a directory (dfs1).
310-
func (d *Client) NewRemoveAccessControlRecursivePager(ACL string, options *RemoveAccessControlRecursiveOptions) *runtime.Pager[RemoveAccessControlRecursiveResponse] {
370+
// RemoveAccessControlRecursive removes the owner, owning group, and permissions for a directory (dfs1).
371+
func (d *Client) RemoveAccessControlRecursive(ACL string, options *RemoveAccessControlRecursiveOptions) (SetAccessControlRecursiveResponse, error) {
372+
if options == nil {
373+
options = &RemoveAccessControlRecursiveOptions{}
374+
}
311375
mode, listOptions := options.format(ACL, "remove")
312-
return d.setAccessControlHelper(mode, listOptions)
376+
return d.setAccessControlRecursiveHelper(mode, listOptions, options)
313377
}
314378

315379
// GetAccessControl gets the owner, owning group, and permissions for a directory (dfs1).
@@ -340,12 +404,12 @@ func (d *Client) SetHTTPHeaders(ctx context.Context, httpHeaders HTTPHeaders, op
340404

341405
// GetSASURL is a convenience method for generating a SAS token for the currently pointed at blob.
342406
// It can only be used if the credential supplied during creation was a SharedKeyCredential.
343-
func (f *Client) GetSASURL(permissions sas.DirectoryPermissions, expiry time.Time, o *GetSASURLOptions) (string, error) {
344-
if f.sharedKey() == nil {
407+
func (d *Client) GetSASURL(permissions sas.DirectoryPermissions, expiry time.Time, o *GetSASURLOptions) (string, error) {
408+
if d.sharedKey() == nil {
345409
return "", datalakeerror.MissingSharedKeyCredential
346410
}
347411

348-
urlParts, err := sas.ParseURL(f.BlobURL())
412+
urlParts, err := sas.ParseURL(d.BlobURL())
349413
err = exported.ConvertToDFSError(err)
350414
if err != nil {
351415
return "", err
@@ -360,14 +424,14 @@ func (f *Client) GetSASURL(permissions sas.DirectoryPermissions, expiry time.Tim
360424
Permissions: permissions.String(),
361425
StartTime: st,
362426
ExpiryTime: expiry.UTC(),
363-
}.SignWithSharedKey(f.sharedKey())
427+
}.SignWithSharedKey(d.sharedKey())
364428

365429
err = exported.ConvertToDFSError(err)
366430
if err != nil {
367431
return "", err
368432
}
369433

370-
endpoint := f.BlobURL() + "?" + qps.Encode()
434+
endpoint := d.BlobURL() + "?" + qps.Encode()
371435

372436
return endpoint, nil
373437
}

0 commit comments

Comments
 (0)