-
Notifications
You must be signed in to change notification settings - Fork 5.1k
Added DataLake SDK #8235
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
Added DataLake SDK #8235
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -4,6 +4,7 @@ | |
| <TargetSecondaryTestTenant>SecondaryTenant</TargetSecondaryTestTenant> | ||
| <TargetPreviewBlobTenant>NotInPreview</TargetPreviewBlobTenant> <!-- Internal only --> | ||
| <TargetOAuthTenant>OAuthTenant</TargetOAuthTenant> | ||
| <TargetHierarchicalNamespaceTenant>NamespaceTenant</TargetHierarchicalNamespaceTenant> | ||
|
|
||
| <TenantConfigurations> | ||
| <!-- Replace [ACCOUNT] and [ACCOUNT-KEY] --> | ||
|
|
@@ -23,6 +24,7 @@ | |
| <ConnectionString>DefaultEndpointsProtocol=https;AccountName=[ACCOUNT];AccountKey=[ACCOUNT-KEY];EndpointSuffix=core.windows.net</ConnectionString> | ||
| </TenantConfiguration> | ||
|
|
||
| <!-- A storage account with Read-only geo-redundant access (RA-GRS) enabled --> | ||
| <!-- Replace [RAGRS-ACCOUNT] and [RAGRS-ACCOUNT-KEY] --> | ||
| <TenantConfiguration> | ||
| <TenantName>SecondaryTenant</TenantName> | ||
|
|
@@ -39,16 +41,19 @@ | |
| <TableServiceSecondaryEndpoint>http://[RAGRS-ACCOUNT]-secondary.table.core.windows.net</TableServiceSecondaryEndpoint> | ||
| </TenantConfiguration> | ||
|
|
||
| <!-- A storage account with Oauth access --> | ||
| <!-- Replace [OAUTH-ACCOUNT] and [OAUTH-ACCOUNT-KEY] --> | ||
| <TenantConfiguration> | ||
| <TenantName>OAuthTenant</TenantName> | ||
| <TenantType>Cloud</TenantType> | ||
| <AccountName>[OAUTH-ACCOUNT]</AccountName> | ||
| <AccountKey>[OAUTH-ACCOUNT-KEY]</AccountKey> | ||
|
|
||
| <ActiveDirectoryApplicationId>[ActiveDirectoryApplicationId]</ActiveDirectoryApplicationId> | ||
| <ActiveDirectoryApplicationSecret>[ActiveDirectoryApplicationSecret]</ActiveDirectoryApplicationSecret> | ||
| <ActiveDirectoryTenantId>[ActiveDirectoryTenantId]</ActiveDirectoryTenantId> | ||
| <ActiveDirectoryAuthEndpoint>https://login.microsoftonline.com/</ActiveDirectoryAuthEndpoint> | ||
|
|
||
| <BlobServiceEndpoint>http://[OAUTH-ACCOUNT].blob.core.windows.net</BlobServiceEndpoint> | ||
| <QueueServiceEndpoint>http://[OAUTH-ACCOUNT].queue.core.windows.net</QueueServiceEndpoint> | ||
| <TableServiceEndpoint>http://[OAUTH-ACCOUNT].table.core.windows.net</TableServiceEndpoint> | ||
|
|
@@ -59,7 +64,8 @@ | |
| <TableServiceSecondaryEndpoint>http://[OAUTH-ACCOUNT]-secondary.table.core.windows.net</TableServiceSecondaryEndpoint> | ||
| </TenantConfiguration> | ||
|
|
||
| <!-- Replace [RAGRS-ACCOUNT] and [RAGRS-ACCOUNT-KEY] --> | ||
| <!-- A storage account with premium preformance enabled --> | ||
| <!-- Replace [RAGRS-ACCOUNT] and [RAGRS-ACCOUNT-KEY] --> | ||
| <TenantConfiguration> | ||
| <TenantName>PremiumBlobTenant</TenantName> | ||
| <TenantType>Cloud</TenantType> | ||
|
|
@@ -74,5 +80,28 @@ | |
| <FileServiceSecondaryEndpoint>http://[PREMIUM-ACCOUNT]-secondary.file.core.windows.net</FileServiceSecondaryEndpoint> | ||
| <TableServiceSecondaryEndpoint>http://[PREMIUM-ACCOUNT]-secondary.table.core.windows.net</TableServiceSecondaryEndpoint> | ||
| </TenantConfiguration> | ||
|
|
||
| <!-- A storge account with hierarchical namespace enabled and OAuth access --> | ||
| <!-- Replace [NAMESPACE-ACCOUNT] and [NAMESPACE-ACCOUNT-KEY] --> | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Nit - mind adding a blurb in Contributing.md about this one? https://github.com/Azure/azure-sdk-for-net/blob/master/sdk/storage/CONTRIBUTING.md#configuration
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||
| <TenantConfiguration> | ||
| <TenantName>NamespaceTenant</TenantName> | ||
| <TenantType>Cloud</TenantType> | ||
| <AccountName>[NAMESPACE-ACCOUNT]</AccountName> | ||
| <AccountKey>[NAMESPACE-ACCOUNT-KEY]</AccountKey> | ||
|
|
||
| <ActiveDirectoryApplicationId>[ActiveDirectoryApplicationId]</ActiveDirectoryApplicationId> | ||
| <ActiveDirectoryApplicationSecret>[ActiveDirectoryApplicationSecret]</ActiveDirectoryApplicationSecret> | ||
| <ActiveDirectoryTenantId>[ActiveDirectoryTenantId]</ActiveDirectoryTenantId> | ||
| <ActiveDirectoryAuthEndpoint>https://login.microsoftonline.com/</ActiveDirectoryAuthEndpoint> | ||
|
|
||
| <BlobServiceEndpoint>http://[NAMESPACE-ACCOUNT].blob.core.windows.net</BlobServiceEndpoint> | ||
| <QueueServiceEndpoint>http://[NAMESPACE-ACCOUNT].queue.core.windows.net</QueueServiceEndpoint> | ||
| <TableServiceEndpoint>http://[NAMESPACE-ACCOUNT].table.core.windows.net</TableServiceEndpoint> | ||
| <FileServiceEndpoint>http://[NAMESPACE-ACCOUNT].file.core.windows.net</FileServiceEndpoint> | ||
| <BlobServiceSecondaryEndpoint>http://[NAMESPACE-ACCOUNT]-secondary.blob.core.windows.net</BlobServiceSecondaryEndpoint> | ||
| <QueueServiceSecondaryEndpoint>http://[NAMESPACE-ACCOUNT]-secondary.queue.core.windows.net</QueueServiceSecondaryEndpoint> | ||
| <FileServiceSecondaryEndpoint>http://[NAMESPACE-ACCOUNT]-secondary.file.core.windows.net</FileServiceSecondaryEndpoint> | ||
| <TableServiceSecondaryEndpoint>http://[NAMESPACE-ACCOUNT]-secondary.table.core.windows.net</TableServiceSecondaryEndpoint> | ||
| </TenantConfiguration> | ||
| </TenantConfigurations> | ||
| </TestConfigurations> | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,33 @@ | ||
| // Copyright (c) Microsoft Corporation. All rights reserved. | ||
| // Licensed under the MIT License. | ||
|
|
||
| using Azure.Storage.Blobs.Models; | ||
| using Azure.Storage.Files.DataLake.Models; | ||
|
|
||
| namespace Azure.Storage.Files.DataLake | ||
| { | ||
| internal static class BlobContainerItemExtensions | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. If you wanted to put all of these in a
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||
| { | ||
| internal static FileSystemItem ToFileSystemItem(this BlobContainerItem containerItem) => | ||
| new FileSystemItem() | ||
| { | ||
| Name = containerItem.Name, | ||
| Properties = new FileSystemProperties() | ||
| { | ||
| LastModified = containerItem.Properties.LastModified, | ||
| LeaseStatus = containerItem.Properties.LeaseStatus.HasValue | ||
| ? (Models.LeaseStatus)containerItem.Properties.LeaseStatus : default, | ||
| LeaseState = containerItem.Properties.LeaseState.HasValue | ||
| ? (Models.LeaseState)containerItem.Properties.LeaseState : default, | ||
| LeaseDuration = containerItem.Properties.LeaseDuration.HasValue | ||
| ? (Models.LeaseDurationType)containerItem.Properties.LeaseDuration : default, | ||
| PublicAccess = containerItem.Properties.PublicAccess.HasValue | ||
| ? (Models.PublicAccessType)containerItem.Properties.PublicAccess : default, | ||
| HasImmutabilityPolicy = containerItem.Properties.HasImmutabilityPolicy, | ||
| HasLegalHold = containerItem.Properties.HasLegalHold, | ||
| ETag = containerItem.Properties.ETag | ||
| }, | ||
| Metadata = containerItem.Metadata | ||
| }; | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We should talk after the next release about how to generate some of these mappings to minimize the amount of effort required to keep everything in sync.
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||
| } | ||
| } | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,35 @@ | ||
| // Copyright (c) Microsoft Corporation. All rights reserved. | ||
| // Licensed under the MIT License. | ||
|
|
||
| using Azure.Storage.Blobs.Models; | ||
| using Azure.Storage.Files.DataLake.Models; | ||
|
|
||
| namespace Azure.Storage.Files.DataLake | ||
| { | ||
| internal static class BlobDownloadDetailsExtensions | ||
| { | ||
| internal static FileDownloadDetails ToFileDownloadDetails(this BlobDownloadDetails blobDownloadProperties) => | ||
| new FileDownloadDetails() | ||
| { | ||
| LastModified = blobDownloadProperties.LastModified, | ||
| Metadata = blobDownloadProperties.Metadata, | ||
| ContentRange = blobDownloadProperties.ContentRange, | ||
| ETag = blobDownloadProperties.ETag, | ||
| ContentEncoding = blobDownloadProperties.ContentEncoding, | ||
| ContentDisposition = blobDownloadProperties.ContentDisposition, | ||
| ContentLanguage = blobDownloadProperties.ContentLanguage, | ||
| CopyCompletedOn = blobDownloadProperties.CopyCompletedOn, | ||
| CopyStatusDescription = blobDownloadProperties.CopyStatusDescription, | ||
| CopyId = blobDownloadProperties.CopyId, | ||
| CopyProgress = blobDownloadProperties.CopyProgress, | ||
| CopyStatus = (Models.CopyStatus)blobDownloadProperties.CopyStatus, | ||
| LeaseDuration = (Models.LeaseDurationType)blobDownloadProperties.LeaseDuration, | ||
| LeaseState = (Models.LeaseState)blobDownloadProperties.LeaseState, | ||
| LeaseStatus = (Models.LeaseStatus)blobDownloadProperties.LeaseStatus, | ||
| AcceptRanges = blobDownloadProperties.AcceptRanges, | ||
| IsServerEncrypted = blobDownloadProperties.IsServerEncrypted, | ||
| EncryptionKeySha256 = blobDownloadProperties.EncryptionKeySha256, | ||
| ContentHash = blobDownloadProperties.BlobContentHash | ||
| }; | ||
| } | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,20 @@ | ||
| // Copyright (c) Microsoft Corporation. All rights reserved. | ||
| // Licensed under the MIT License. | ||
|
|
||
| using Azure.Storage.Blobs.Models; | ||
| using Azure.Storage.Files.DataLake.Models; | ||
|
|
||
| namespace Azure.Storage.Files.DataLake | ||
| { | ||
| internal static class BlobDownloadInfoExtensions | ||
| { | ||
| internal static FileDownloadInfo ToFileDownloadInfo(this BlobDownloadInfo blobDownloadInfo) => | ||
| new FileDownloadInfo() | ||
| { | ||
| ContentLength = blobDownloadInfo.ContentLength, | ||
| Content = blobDownloadInfo.Content, | ||
| ContentHash = blobDownloadInfo.ContentHash, | ||
| Properties = blobDownloadInfo.Details.ToFileDownloadDetails() | ||
| }; | ||
| } | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,42 @@ | ||
| // Copyright (c) Microsoft Corporation. All rights reserved. | ||
| // Licensed under the MIT License. | ||
|
|
||
| using Azure.Storage.Blobs.Models; | ||
| using Azure.Storage.Files.DataLake.Models; | ||
|
|
||
| namespace Azure.Storage.Files.DataLake | ||
| { | ||
| internal static class BlobPropertiesExtensions | ||
| { | ||
| internal static PathProperties ToPathProperties(this BlobProperties blobProperties) => | ||
| new PathProperties() | ||
| { | ||
| LastModified = blobProperties.LastModified, | ||
| CreatedOn = blobProperties.CreatedOn, | ||
| Metadata = blobProperties.Metadata, | ||
| CopyCompletedOn = blobProperties.CopyCompletedOn, | ||
| CopyStatusDescription = blobProperties.CopyStatusDescription, | ||
| CopyId = blobProperties.CopyId, | ||
| CopyProgress = blobProperties.CopyProgress, | ||
| CopySource = blobProperties.CopySource, | ||
| IsIncrementalCopy = blobProperties.IsIncrementalCopy, | ||
| LeaseDuration = (Models.LeaseDurationType)blobProperties.LeaseDuration, | ||
| LeaseStatus = (Models.LeaseStatus)blobProperties.LeaseStatus, | ||
| LeaseState = (Models.LeaseState)blobProperties.LeaseState, | ||
| ContentLength = blobProperties.ContentLength, | ||
| ContentType = blobProperties.ContentType, | ||
| ETag = blobProperties.ETag, | ||
| ContentHash = blobProperties.ContentHash, | ||
| ContentEncoding = blobProperties.ContentEncoding, | ||
| ContentDisposition = blobProperties.ContentDisposition, | ||
| ContentLanguage = blobProperties.ContentLanguage, | ||
| CacheControl = blobProperties.CacheControl, | ||
| AcceptRanges = blobProperties.AcceptRanges, | ||
| IsServerEncrypted = blobProperties.IsServerEncrypted, | ||
| EncryptionKeySha256 = blobProperties.EncryptionKeySha256, | ||
| AccessTier = blobProperties.AccessTier, | ||
| ArchiveStatus = blobProperties.ArchiveStatus, | ||
| AccessTierChangedOn = blobProperties.AccessTierChangedOn | ||
| }; | ||
| } | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,19 @@ | ||
| // Copyright (c) Microsoft Corporation. All rights reserved. | ||
| // Licensed under the MIT License. | ||
|
|
||
| using Azure.Core; | ||
| using Azure.Storage.Blobs; | ||
| using Azure.Storage.Files.DataLake.Models; | ||
|
|
||
| namespace Azure.Storage.Files.DataLake | ||
| { | ||
| #pragma warning disable AZC0008 // ClientOptions should have a nested enum called ServiceVersion | ||
|
||
| /// <summary> | ||
| /// Provides the client configuration options for connecting to Azure Data Lake service. | ||
| /// </summary> | ||
| public class DataLakeClientOptions : BlobClientOptions | ||
| #pragma warning restore AZC0008 // ClientOptions should have a nested enum called ServiceVersion | ||
| { | ||
|
|
||
| } | ||
| } | ||
Uh oh!
There was an error while loading. Please reload this page.