DataLakeFileSystemClient class
DataLakeFileSystemClient, Azure Depolama dosya sisteminin dizinlerini ve dosyalarını işlemenize olanak sağlayan bir URL'yi temsil eder.
- Extends
-
StorageClient
Oluşturucular
| Data |
URL ve işlem hattından DataLakeFileSystemClient örneği oluşturur. |
| Data |
URL'den ve kimlik bilgisinden DataLakeFileSystemClient örneği oluşturur. |
Özellikler
| name | Geçerli dosya sisteminin adı. |
Devralınan Özellikler
| account |
|
| credential | AnonymousCredential, StorageSharedKeyCredential gibi veya hizmete yönelik isteklerin kimliğini doğrulamak için |
| url | Kodlanmış URL dizesi değeri. |
Yöntemler
| create(File |
Belirtilen hesap altında yeni bir dosya sistemi oluşturur. Aynı ada sahip dosya sistemi zaten varsa, işlem başarısız olur. Bkz. https://learn.microsoft.com/rest/api/storageservices/create-container |
| create |
Belirtilen hesap altında yeni bir dosya sistemi oluşturur. Aynı ada sahip dosya sistemi zaten varsa, değiştirilmez. Bkz. https://learn.microsoft.com/rest/api/storageservices/create-container |
| delete(File |
Geçerli dosya sistemini silin. Bkz. https://learn.microsoft.com/rest/api/storageservices/delete-container |
| delete |
Varsa geçerli dosya sistemini silin. Bkz. https://learn.microsoft.com/rest/api/storageservices/delete-container |
| exists(File |
Bu istemci tarafından temsil edilen Dosya sistemi varsa true döndürür; false olarak ayarlayın. NOT: Mevcut bir dosya sistemi diğer istemciler veya uygulamalar tarafından silinebileceğinden bu işlevi dikkatli kullanın. Aynı ada sahip yeni dosya sistemi, bu işlev tamamlandıktan sonra diğer istemciler veya uygulamalar tarafından eklenebilir. |
| generate |
Yalnızca paylaşılan anahtar kimlik bilgileriyle yapılan DataLakeFileSystemClient için kullanılabilir. Geçirilen istemci özelliklerine ve parametrelerine göre Hizmet Paylaşılan Erişim İmzası (SAS) URI'sini imzalamak için dize oluşturur. SAS, istemcinin paylaşılan anahtar kimlik bilgileriyle imzalanır. Bkz. https://learn.microsoft.com/rest/api/storageservices/constructing-a-service-sas |
| generate |
Yalnızca paylaşılan anahtar kimlik bilgileriyle yapılan DataLakeFileSystemClient için kullanılabilir. geçirilen istemci özelliklerine ve parametrelerine göre bir Hizmet Paylaşılan Erişim İmzası (SAS) URI'sini oluşturur. SAS, istemcinin paylaşılan anahtar kimlik bilgileriyle imzalanır. Bkz. https://learn.microsoft.com/rest/api/storageservices/constructing-a-service-sas |
| generate |
Geçirilen istemci özelliklerine ve parametrelerine göre Hizmet Paylaşılan Erişim İmzası (SAS) URI'sini imzalamak için dize oluşturur. SAS, giriş kullanıcı temsilcisi anahtarı tarafından imzalanır. Bkz. https://learn.microsoft.com/rest/api/storageservices/constructing-a-service-sas |
| generate |
geçirilen istemci özelliklerine ve parametrelerine göre bir Hizmet Paylaşılan Erişim İmzası (SAS) URI'sini oluşturur. SAS, giriş kullanıcı temsilcisi anahtarı tarafından imzalanır. Bkz. https://learn.microsoft.com/rest/api/storageservices/constructing-a-service-sas |
| get |
Belirtilen dosya sistemi için izinleri alır. İzinler, dosya sistemi verilerine genel olarak erişilip erişilemeyeceğini gösterir. UYARI: JavaScript Tarihi, startsOn ve expiresOn dizelerini ayrıştırırken duyarlık kaybına neden olabilir. Örneğin, yeni Date("2018-12-31T03:44:23.8827891Z").toISOString() "2018-12-31T03:44:23.882Z" değerini alır. Bkz. https://learn.microsoft.com/rest/api/storageservices/get-container-acl |
| get |
Dosya sistemindeki kiraları yöneten bir DataLakeLeaseClient alın. |
| get |
Geçerli dosya sistemi altında bir DataLakeDirectoryClient nesnesi oluşturur. |
| get |
Geçerli dosya sistemi altında bir DataLakeFileClient nesnesi oluşturur. |
| get |
Belirtilen dosya sistemi için kullanıcı tanımlı tüm meta verileri ve sistem özelliklerini döndürür. UYARI: Yanıtta döndürülen Bkz. https://learn.microsoft.com/rest/api/storageservices/get-container-properties |
| list |
Belirtilen dosya sistemi altındaki tüm yolları (dizinler ve dosyalar) listelemek için zaman uyumsuz bir yinelenebilir yineleyici döndürür. .byPage() sayfalardaki yolları listelemek için zaman uyumsuz bir yinelenebilir yineleyici döndürür.
İşaretçi ile disk belleği kullanma örneği:
Bkz. https://learn.microsoft.com/rest/api/storageservices/list-blobs |
| list |
Belirtilen dosya sistemi altındaki tüm yolları (dizinler ve dosyalar) listelemek için zaman uyumsuz bir yinelenebilir yineleyici döndürür. .byPage() sayfalardaki yolları listelemek için zaman uyumsuz bir yinelenebilir yineleyici döndürür.
İşaretçi ile disk belleği kullanma örneği:
Bkz. https://learn.microsoft.com/rest/api/storageservices/list-blobs |
| set |
Belirtilen dosya sistemi için izinleri ayarlar. İzinler, bir dosya sistemindeki dizinlere veya dosyalara genel olarak erişilip erişilemeyeceğini gösterir. Bir dosya sistemi için izinleri ayarladığınızda, var olan izinler değiştirilir. Erişim veya containerAcl sağlanmadıysa, mevcut dosya sistemi ACL'si kaldırılır. Bkz. https://learn.microsoft.com/rest/api/storageservices/set-container-acl |
| set |
Belirtilen dosya sistemi için bir veya daha fazla kullanıcı tanımlı ad-değer çifti ayarlar. Seçenek sağlanmadıysa veya parametresinde tanımlı meta veri yoksa, dosya sistemi meta verileri kaldırılır. Bkz. https://learn.microsoft.com/rest/api/storageservices/set-container-metadata |
| undelete |
Geçici olarak silinen yolu geri yükler. Bkz. https://learn.microsoft.com/rest/api/storageservices/undelete-blob |
Oluşturucu Ayrıntıları
DataLakeFileSystemClient(string, Pipeline)
URL ve işlem hattından DataLakeFileSystemClient örneği oluşturur.
new DataLakeFileSystemClient(url: string, pipeline: Pipeline)
Parametreler
- url
-
string
"https://myaccount.dfs.core.windows.net/filesystem" gibi Azure Storage data lake dosya sistemine işaret eden bir İstemci dizesi. AnonymousCredential kullanıyorsanız , "https://myaccount.dfs.core.windows.net/filesystem?sasString" gibi bir SAS ekleyebilirsiniz.
- pipeline
- Pipeline
Varsayılan işlem hattı oluşturmak veya özelleştirilmiş bir işlem hattı sağlamak için newPipeline() çağrısında bulunabilirsiniz.
DataLakeFileSystemClient(string, StorageSharedKeyCredential | AnonymousCredential | TokenCredential, StoragePipelineOptions)
URL'den ve kimlik bilgisinden DataLakeFileSystemClient örneği oluşturur.
new DataLakeFileSystemClient(url: string, credential?: StorageSharedKeyCredential | AnonymousCredential | TokenCredential, options?: StoragePipelineOptions)
Parametreler
- url
-
string
"https://myaccount.dfs.core.windows.net/filesystem" gibi Azure Storage data lake dosya sistemine işaret eden bir İstemci dizesi. AnonymousCredential kullanıyorsanız , "https://myaccount.dfs.core.windows.net/filesystem?sasString" gibi bir SAS ekleyebilirsiniz.
- credential
-
StorageSharedKeyCredential | AnonymousCredential | TokenCredential
AnonymousCredential, StorageSharedKeyCredential gibi veya hizmete yönelik isteklerin kimliğini doğrulamak için @azure/identity paketindeki herhangi bir kimlik bilgisi. TokenCredential arabirimini uygulayan bir nesne de sağlayabilirsiniz. Belirtilmezse, AnonymousCredential kullanılır.
- options
- StoragePipelineOptions
Optional. HTTP işlem hattını yapılandırma seçenekleri.
Özellik Ayrıntıları
name
Geçerli dosya sisteminin adı.
string name
Özellik Değeri
string
Devralınan Özellik Detayları
accountName
accountName: string
Özellik Değeri
string
StorageClient.accountName'den Devralınan
credential
AnonymousCredential, StorageSharedKeyCredential gibi veya hizmete yönelik isteklerin kimliğini doğrulamak için @azure/identity paketindeki herhangi bir kimlik bilgisi. TokenCredential arabirimini uygulayan bir nesne de sağlayabilirsiniz. Belirtilmezse, AnonymousCredential kullanılır.
credential: StorageSharedKeyCredential | AnonymousCredential | TokenCredential
Özellik Değeri
StorageClient.credential'dan Devralınmış
url
Kodlanmış URL dizesi değeri.
url: string
Özellik Değeri
string
StorageClient.url'den Devralınan
Yöntem Ayrıntıları
create(FileSystemCreateOptions)
Belirtilen hesap altında yeni bir dosya sistemi oluşturur. Aynı ada sahip dosya sistemi zaten varsa, işlem başarısız olur.
Bkz. https://learn.microsoft.com/rest/api/storageservices/create-container
function create(options?: FileSystemCreateOptions): Promise<FileSystemCreateResponse>
Parametreler
- options
- FileSystemCreateOptions
Optional. Dosya sistemi oluştururken seçenekler.
Döndürülenler
Promise<FileSystemCreateResponse>
createIfNotExists(FileSystemCreateOptions)
Belirtilen hesap altında yeni bir dosya sistemi oluşturur. Aynı ada sahip dosya sistemi zaten varsa, değiştirilmez.
Bkz. https://learn.microsoft.com/rest/api/storageservices/create-container
function createIfNotExists(options?: FileSystemCreateOptions): Promise<FileSystemCreateIfNotExistsResponse>
Parametreler
- options
- FileSystemCreateOptions
Döndürülenler
Promise<FileSystemCreateIfNotExistsResponse>
delete(FileSystemDeleteOptions)
Geçerli dosya sistemini silin.
Bkz. https://learn.microsoft.com/rest/api/storageservices/delete-container
function delete(options?: FileSystemDeleteOptions): Promise<FileSystemDeleteResponse>
Parametreler
- options
- FileSystemDeleteOptions
Optional. Dosya sistemini silerken seçenekler.
Döndürülenler
Promise<FileSystemDeleteResponse>
deleteIfExists(FileSystemDeleteOptions)
Varsa geçerli dosya sistemini silin.
Bkz. https://learn.microsoft.com/rest/api/storageservices/delete-container
function deleteIfExists(options?: FileSystemDeleteOptions): Promise<FileSystemDeleteIfExistsResponse>
Parametreler
- options
- FileSystemDeleteOptions
Döndürülenler
Promise<FileSystemDeleteIfExistsResponse>
exists(FileSystemExistsOptions)
Bu istemci tarafından temsil edilen Dosya sistemi varsa true döndürür; false olarak ayarlayın.
NOT: Mevcut bir dosya sistemi diğer istemciler veya uygulamalar tarafından silinebileceğinden bu işlevi dikkatli kullanın. Aynı ada sahip yeni dosya sistemi, bu işlev tamamlandıktan sonra diğer istemciler veya uygulamalar tarafından eklenebilir.
function exists(options?: FileSystemExistsOptions): Promise<boolean>
Parametreler
- options
- FileSystemExistsOptions
Döndürülenler
Promise<boolean>
generateSasStringToSign(FileSystemGenerateSasUrlOptions)
Yalnızca paylaşılan anahtar kimlik bilgileriyle yapılan DataLakeFileSystemClient için kullanılabilir.
Geçirilen istemci özelliklerine ve parametrelerine göre Hizmet Paylaşılan Erişim İmzası (SAS) URI'sini imzalamak için dize oluşturur. SAS, istemcinin paylaşılan anahtar kimlik bilgileriyle imzalanır.
Bkz. https://learn.microsoft.com/rest/api/storageservices/constructing-a-service-sas
function generateSasStringToSign(options: FileSystemGenerateSasUrlOptions): string
Parametreler
- options
- FileSystemGenerateSasUrlOptions
İsteğe bağlı parametreler.
Döndürülenler
string
Bu istemci tarafından temsil edilen kaynağın URI'sini ve ardından oluşturulan SAS belirtecini içeren SAS URI'sini.
generateSasUrl(FileSystemGenerateSasUrlOptions)
Yalnızca paylaşılan anahtar kimlik bilgileriyle yapılan DataLakeFileSystemClient için kullanılabilir.
geçirilen istemci özelliklerine ve parametrelerine göre bir Hizmet Paylaşılan Erişim İmzası (SAS) URI'sini oluşturur. SAS, istemcinin paylaşılan anahtar kimlik bilgileriyle imzalanır.
Bkz. https://learn.microsoft.com/rest/api/storageservices/constructing-a-service-sas
function generateSasUrl(options: FileSystemGenerateSasUrlOptions): Promise<string>
Parametreler
- options
- FileSystemGenerateSasUrlOptions
İsteğe bağlı parametreler.
Döndürülenler
Promise<string>
Bu istemci tarafından temsil edilen kaynağın URI'sini ve ardından oluşturulan SAS belirtecini içeren SAS URI'sini.
generateUserDelegationSasStringToSign(FileSystemGenerateSasUrlOptions, UserDelegationKey)
Geçirilen istemci özelliklerine ve parametrelerine göre Hizmet Paylaşılan Erişim İmzası (SAS) URI'sini imzalamak için dize oluşturur. SAS, giriş kullanıcı temsilcisi anahtarı tarafından imzalanır.
Bkz. https://learn.microsoft.com/rest/api/storageservices/constructing-a-service-sas
function generateUserDelegationSasStringToSign(options: FileSystemGenerateSasUrlOptions, userDelegationKey: UserDelegationKey): string
Parametreler
- options
- FileSystemGenerateSasUrlOptions
İsteğe bağlı parametreler.
- userDelegationKey
- UserDelegationKey
blobServiceClient.getUserDelegationKey() dönüş değeri
Döndürülenler
string
Bu istemci tarafından temsil edilen kaynağın URI'sini ve ardından oluşturulan SAS belirtecini içeren SAS URI'sini.
generateUserDelegationSasUrl(FileSystemGenerateSasUrlOptions, UserDelegationKey)
geçirilen istemci özelliklerine ve parametrelerine göre bir Hizmet Paylaşılan Erişim İmzası (SAS) URI'sini oluşturur. SAS, giriş kullanıcı temsilcisi anahtarı tarafından imzalanır.
Bkz. https://learn.microsoft.com/rest/api/storageservices/constructing-a-service-sas
function generateUserDelegationSasUrl(options: FileSystemGenerateSasUrlOptions, userDelegationKey: UserDelegationKey): Promise<string>
Parametreler
- options
- FileSystemGenerateSasUrlOptions
İsteğe bağlı parametreler.
- userDelegationKey
- UserDelegationKey
blobServiceClient.getUserDelegationKey() dönüş değeri
Döndürülenler
Promise<string>
Bu istemci tarafından temsil edilen kaynağın URI'sini ve ardından oluşturulan SAS belirtecini içeren SAS URI'sini.
getAccessPolicy(FileSystemGetAccessPolicyOptions)
Belirtilen dosya sistemi için izinleri alır. İzinler, dosya sistemi verilerine genel olarak erişilip erişilemeyeceğini gösterir.
UYARI: JavaScript Tarihi, startsOn ve expiresOn dizelerini ayrıştırırken duyarlık kaybına neden olabilir. Örneğin, yeni Date("2018-12-31T03:44:23.8827891Z").toISOString() "2018-12-31T03:44:23.882Z" değerini alır.
Bkz. https://learn.microsoft.com/rest/api/storageservices/get-container-acl
function getAccessPolicy(options?: FileSystemGetAccessPolicyOptions): Promise<FileSystemGetAccessPolicyResponse>
Parametreler
- options
- FileSystemGetAccessPolicyOptions
Optional. Dosya sistemi erişim ilkesi alma seçenekleri.
Döndürülenler
Promise<FileSystemGetAccessPolicyResponse>
getDataLakeLeaseClient(string)
Dosya sistemindeki kiraları yöneten bir DataLakeLeaseClient alın.
function getDataLakeLeaseClient(proposeLeaseId?: string): DataLakeLeaseClient
Parametreler
- proposeLeaseId
-
string
Optional. İlk önerilen kira kimliği.
Döndürülenler
getDirectoryClient(string)
Geçerli dosya sistemi altında bir DataLakeDirectoryClient nesnesi oluşturur.
function getDirectoryClient(directoryName: string): DataLakeDirectoryClient
Parametreler
- directoryName
-
string
Döndürülenler
getFileClient(string)
Geçerli dosya sistemi altında bir DataLakeFileClient nesnesi oluşturur.
function getFileClient(fileName: string): DataLakeFileClient
Parametreler
- fileName
-
string
Döndürülenler
getProperties(FileSystemGetPropertiesOptions)
Belirtilen dosya sistemi için kullanıcı tanımlı tüm meta verileri ve sistem özelliklerini döndürür.
UYARI: Yanıtta döndürülen metadata nesnesinin anahtarları başlangıçta büyük harf karakterler içerse bile küçük harfle gösterilir. Bu, özgün büyük/küçük harflerini koruyacak
Bkz. https://learn.microsoft.com/rest/api/storageservices/get-container-properties
function getProperties(options?: FileSystemGetPropertiesOptions): Promise<FileSystemGetPropertiesResponse>
Parametreler
- options
- FileSystemGetPropertiesOptions
Optional. Dosya sistemi özelliklerini alma seçenekleri.
Döndürülenler
Promise<FileSystemGetPropertiesResponse>
listDeletedPaths(ListDeletedPathsOptions)
Belirtilen dosya sistemi altındaki tüm yolları (dizinler ve dosyalar) listelemek için zaman uyumsuz bir yinelenebilir yineleyici döndürür.
.byPage() sayfalardaki yolları listelemek için zaman uyumsuz bir yinelenebilir yineleyici döndürür.
for await söz dizimi kullanan örnek:
import { DataLakeServiceClient } from "@azure/storage-file-datalake";
import { DefaultAzureCredential } from "@azure/identity";
const account = "<account>";
const datalakeServiceClient = new DataLakeServiceClient(
`https://${account}.dfs.core.windows.net`,
new DefaultAzureCredential(),
);
const fileSystemName = "<file system name>";
const fileSystemClient = datalakeServiceClient.getFileSystemClient(fileSystemName);
let i = 1;
const deletedPaths = fileSystemClient.listDeletedPaths();
for await (const deletedPath of deletedPaths) {
console.log(`Deleted path ${i++}: ${deletedPath.name}, deleted on: ${deletedPath.deletedOn}`);
}
iter.next()kullanan örnek:
import { DataLakeServiceClient } from "@azure/storage-file-datalake";
import { DefaultAzureCredential } from "@azure/identity";
const account = "<account>";
const datalakeServiceClient = new DataLakeServiceClient(
`https://${account}.dfs.core.windows.net`,
new DefaultAzureCredential(),
);
const fileSystemName = "<file system name>";
const fileSystemClient = datalakeServiceClient.getFileSystemClient(fileSystemName);
let i = 1;
const deletedPaths = fileSystemClient.listDeletedPaths();
let { value, done } = await deletedPaths.next();
while (!done) {
console.log(`Deleted path ${i++}: ${value.name}, deleted on: ${value.deletedOn}`);
({ value, done } = await deletedPaths.next());
}
byPage()kullanan örnek:
import { DataLakeServiceClient } from "@azure/storage-file-datalake";
import { DefaultAzureCredential } from "@azure/identity";
const account = "<account>";
const datalakeServiceClient = new DataLakeServiceClient(
`https://${account}.dfs.core.windows.net`,
new DefaultAzureCredential(),
);
const fileSystemName = "<file system name>";
const fileSystemClient = datalakeServiceClient.getFileSystemClient(fileSystemName);
let i = 1;
for await (const response of fileSystemClient.listDeletedPaths().byPage({ maxPageSize: 20 })) {
if (response.pathItems) {
for (const deletedPath of response.pathItems) {
console.log(`Deleted path ${i++}: ${deletedPath.name}, deleted on: ${deletedPath.deletedOn}`);
}
}
}
İşaretçi ile disk belleği kullanma örneği:
import { DataLakeServiceClient } from "@azure/storage-file-datalake";
import { DefaultAzureCredential } from "@azure/identity";
const account = "<account>";
const datalakeServiceClient = new DataLakeServiceClient(
`https://${account}.dfs.core.windows.net`,
new DefaultAzureCredential(),
);
const fileSystemName = "<file system name>";
const fileSystemClient = datalakeServiceClient.getFileSystemClient(fileSystemName);
let i = 1;
let deletedPaths = fileSystemClient.listDeletedPaths().byPage({ maxPageSize: 2 });
let response = (await deletedPaths.next()).value;
// Prints 2 deleted paths
if (response.deletedPathItems) {
for (const deletedPath of response.deletedPathItems) {
console.log(`Deleted path ${i++}: ${deletedPath.name}, deleted on: ${deletedPath.deletedOn}`);
}
}
// Gets next marker
let marker = response.continuationToken;
// Passing next marker as continuationToken
deletedPaths = fileSystemClient
.listDeletedPaths()
.byPage({ continuationToken: marker, maxPageSize: 10 });
response = (await deletedPaths.next()).value;
// Prints 10 deleted paths
if (response.deletedPathItems) {
for (const deletedPath of response.deletedPathItems) {
console.log(`Deleted path ${i++}: ${deletedPath.name}, deleted on: ${deletedPath.deletedOn}`);
}
}
Bkz. https://learn.microsoft.com/rest/api/storageservices/list-blobs
function listDeletedPaths(options?: ListDeletedPathsOptions): PagedAsyncIterableIterator<DeletedPath, FileSystemListDeletedPathsResponse, PageSettings>
Parametreler
- options
- ListDeletedPathsOptions
Optional. Silinen yolları listelerken seçenekler.
Döndürülenler
listPaths(ListPathsOptions)
Belirtilen dosya sistemi altındaki tüm yolları (dizinler ve dosyalar) listelemek için zaman uyumsuz bir yinelenebilir yineleyici döndürür.
.byPage() sayfalardaki yolları listelemek için zaman uyumsuz bir yinelenebilir yineleyici döndürür.
for await söz dizimi kullanan örnek:
import { DataLakeServiceClient } from "@azure/storage-file-datalake";
import { DefaultAzureCredential } from "@azure/identity";
const account = "<account>";
const datalakeServiceClient = new DataLakeServiceClient(
`https://${account}.dfs.core.windows.net`,
new DefaultAzureCredential(),
);
const fileSystemName = "<file system name>";
const fileSystemClient = datalakeServiceClient.getFileSystemClient(fileSystemName);
let i = 1;
const paths = fileSystemClient.listPaths();
for await (const path of paths) {
console.log(`Path ${i++}: ${path.name}, is directory: ${path.isDirectory}`);
}
iter.next()kullanan örnek:
import { DataLakeServiceClient } from "@azure/storage-file-datalake";
import { DefaultAzureCredential } from "@azure/identity";
const account = "<account>";
const datalakeServiceClient = new DataLakeServiceClient(
`https://${account}.dfs.core.windows.net`,
new DefaultAzureCredential(),
);
const fileSystemName = "<file system name>";
const fileSystemClient = datalakeServiceClient.getFileSystemClient(fileSystemName);
let i = 1;
const paths = fileSystemClient.listPaths();
let { value, done } = await paths.next();
while (!done) {
console.log(`Path ${i++}: ${value.name}, is directory: ${value.isDirectory}`);
({ value, done } = await paths.next());
}
byPage()kullanan örnek:
import { DataLakeServiceClient } from "@azure/storage-file-datalake";
import { DefaultAzureCredential } from "@azure/identity";
const account = "<account>";
const datalakeServiceClient = new DataLakeServiceClient(
`https://${account}.dfs.core.windows.net`,
new DefaultAzureCredential(),
);
const fileSystemName = "<file system name>";
const fileSystemClient = datalakeServiceClient.getFileSystemClient(fileSystemName);
let i = 1;
for await (const response of fileSystemClient.listPaths().byPage({ maxPageSize: 20 })) {
if (response.pathItems) {
for (const path of response.pathItems) {
console.log(`Path ${i++}: ${path.name}, is directory: ${path.isDirectory}`);
}
}
}
İşaretçi ile disk belleği kullanma örneği:
import { DataLakeServiceClient } from "@azure/storage-file-datalake";
import { DefaultAzureCredential } from "@azure/identity";
const account = "<account>";
const datalakeServiceClient = new DataLakeServiceClient(
`https://${account}.dfs.core.windows.net`,
new DefaultAzureCredential(),
);
const fileSystemName = "<file system name>";
const fileSystemClient = datalakeServiceClient.getFileSystemClient(fileSystemName);
let i = 1;
let paths = fileSystemClient.listPaths().byPage({ maxPageSize: 2 });
let response = (await paths.next()).value;
// Prints 2 paths
if (response.pathItems) {
for (const path of response.pathItems) {
console.log(`Path ${i++}: ${path.name}, is directory: ${path.isDirectory}`);
}
}
// Gets next marker
let marker = response.continuationToken;
// Passing next marker as continuationToken
paths = fileSystemClient.listPaths().byPage({ continuationToken: marker, maxPageSize: 10 });
response = (await paths.next()).value;
// Prints 10 paths
if (response.pathItems) {
for (const path of response.pathItems) {
console.log(`Path ${i++}: ${path.name}, is directory: ${path.isDirectory}`);
}
}
Bkz. https://learn.microsoft.com/rest/api/storageservices/list-blobs
function listPaths(options?: ListPathsOptions): PagedAsyncIterableIterator<Path, FileSystemListPathsResponse, PageSettings>
Parametreler
- options
- ListPathsOptions
Optional. Yolları listelerken seçenekler.
Döndürülenler
setAccessPolicy(PublicAccessType, SignedIdentifier<AccessPolicy>[], FileSystemSetAccessPolicyOptions)
Belirtilen dosya sistemi için izinleri ayarlar. İzinler, bir dosya sistemindeki dizinlere veya dosyalara genel olarak erişilip erişilemeyeceğini gösterir.
Bir dosya sistemi için izinleri ayarladığınızda, var olan izinler değiştirilir. Erişim veya containerAcl sağlanmadıysa, mevcut dosya sistemi ACL'si kaldırılır.
Bkz. https://learn.microsoft.com/rest/api/storageservices/set-container-acl
function setAccessPolicy(access?: PublicAccessType, fileSystemAcl?: SignedIdentifier<AccessPolicy>[], options?: FileSystemSetAccessPolicyOptions): Promise<FileSystemSetAccessPolicyResponse>
Parametreler
- access
- PublicAccessType
Optional. Dosya sistemindeki verilere genel erişim düzeyi.
- fileSystemAcl
Optional. Her biri benzersiz bir kimliğe ve erişim ilkesinin ayrıntılarına sahip öğe dizisi.
- options
- FileSystemSetAccessPolicyOptions
Optional. Dosya sistemi erişim ilkesini ayarlarken seçenekler.
Döndürülenler
Promise<FileSystemSetAccessPolicyResponse>
setMetadata(Metadata, FileSystemSetMetadataOptions)
Belirtilen dosya sistemi için bir veya daha fazla kullanıcı tanımlı ad-değer çifti ayarlar.
Seçenek sağlanmadıysa veya parametresinde tanımlı meta veri yoksa, dosya sistemi meta verileri kaldırılır.
Bkz. https://learn.microsoft.com/rest/api/storageservices/set-container-metadata
function setMetadata(metadata?: Metadata, options?: FileSystemSetMetadataOptions): Promise<FileSystemSetMetadataResponse>
Parametreler
- metadata
- Metadata
Var olan meta verileri bu değerle değiştirin. Değer sağlanmazsa, mevcut meta veriler kaldırılır.
- options
- FileSystemSetMetadataOptions
Optional. Dosya sistemi meta verilerini ayarlarken seçenekler.
Döndürülenler
Promise<FileSystemSetMetadataResponse>
undeletePath(string, string, FileSystemUndeletePathOption)
Geçici olarak silinen yolu geri yükler.
Bkz. https://learn.microsoft.com/rest/api/storageservices/undelete-blob
function undeletePath(deletedPath: string, deletionId: string, options?: FileSystemUndeletePathOption): Promise<FileSystemUndeletePathResponse>
Parametreler
- deletedPath
-
string
Required. Silinen yolun yolu.
- deletionId
-
string
Required. Geçici olarak silinen yol ile ilişkili silme kimliği.
- options
- FileSystemUndeletePathOption
Döndürülenler
Promise<FileSystemUndeletePathResponse>