Share via


DataLakeFileSystemClient class

DataLakeFileSystemClient は、Azure Storage ファイル システムへの URL を表し、ディレクトリとファイルを操作できます。

Extends

StorageClient

コンストラクター

DataLakeFileSystemClient(string, Pipeline)

URL とパイプラインから DataLakeFileSystemClient のインスタンスを作成します。

DataLakeFileSystemClient(string, StorageSharedKeyCredential | AnonymousCredential | TokenCredential, StoragePipelineOptions)

URL と資格情報から DataLakeFileSystemClient のインスタンスを作成します。

プロパティ

name

現在のファイル システムの名前。

継承されたプロパティ

accountName
credential

AnonymousCredential、StorageSharedKeyCredential、またはサービスに対する要求を @azure/identity 認証するためのパッケージからの任意の資格情報など。 TokenCredential インターフェイスを実装するオブジェクトを指定することもできます。 指定しない場合は、AnonymousCredential が使用されます。

url

エンコードされた URL 文字列値。

メソッド

create(FileSystemCreateOptions)

指定したアカウントの下に新しいファイル システムを作成します。 同じ名前のファイル システムが既に存在する場合、操作は失敗します。

https://docs.microsoft.com/en-us/rest/api/storageservices/create-container」を参照してください。

createIfNotExists(FileSystemCreateOptions)

指定したアカウントの下に新しいファイル システムを作成します。 同じ名前のファイル システムが既に存在する場合は、変更されません。

https://docs.microsoft.com/en-us/rest/api/storageservices/create-container」を参照してください。

delete(FileSystemDeleteOptions)

現在のファイル システムを削除します。

https://docs.microsoft.com/en-us/rest/api/storageservices/delete-container」を参照してください。

deleteIfExists(FileSystemDeleteOptions)

現在のファイル システムが存在する場合は削除します。

https://docs.microsoft.com/en-us/rest/api/storageservices/delete-container」を参照してください。

exists(FileSystemExistsOptions)

このクライアントで表されるファイル システムが存在する場合は true を返します。それ以外の場合は false。

注: 既存のファイル システムは他のクライアントまたはアプリケーションによって削除される可能性があるため、この関数は注意して使用してください。 その逆も同様に、同じ名前の新しいファイル システムは、この関数の完了後に他のクライアントまたはアプリケーションによって追加される可能性があります。

generateSasUrl(FileSystemGenerateSasUrlOptions)

共有キー資格情報を使用して構築された DataLakeFileSystemClient でのみ使用できます。

渡されたクライアント プロパティとパラメーターに基づいて、サービス Shared Access Signature (SAS) URI を生成します。 SAS は、クライアントの共有キー資格情報によって署名されます。

https://docs.microsoft.com/en-us/rest/api/storageservices/constructing-a-service-sas」を参照してください。

getAccessPolicy(FileSystemGetAccessPolicyOptions)

指定したファイル システムのアクセス許可を取得します。 アクセス許可は、ファイル システム データにパブリックにアクセスできるかどうかを示します。

警告: startsOn 文字列と expiresOn 文字列を解析すると、JavaScript 日付の精度が失われる可能性があります。 たとえば、新しい Date("2018-12-31T03:44:23.8827891Z").toISOString() は "2018-12-31T03:44:23.882Z" を取得します。

https://docs.microsoft.com/en-us/rest/api/storageservices/get-container-acl」を参照してください。

getDataLakeLeaseClient(string)

ファイル システムのリースを管理する DataLakeLeaseClient を取得します。

getDirectoryClient(string)

現在のファイル システムの下に DataLakeDirectoryClient オブジェクトを作成します。

getFileClient(string)

現在のファイル システムの下に DataLakeFileClient オブジェクトを作成します。

getProperties(FileSystemGetPropertiesOptions)

指定したファイル システムのすべてのユーザー定義メタデータとシステム プロパティを返します。

警告: 応答で返されるオブジェクトのキーは metadata 、最初に大文字が含まれていた場合でも小文字になります。 これは、 オプションを使用includeMetadataして DataLakeServiceClient のメソッドによってlistFileSystems返されるメタデータ キーとは異なり、元の大文字と小文字は保持されます。

https://docs.microsoft.com/en-us/rest/api/storageservices/get-container-properties」を参照してください。

listDeletedPaths(ListDeletedPathsOptions)

指定したファイル システムのすべてのパス (ディレクトリとファイル) を一覧表示する非同期反復可能な反復子を返します。

.byPage() は、ページ内のパスを一覧表示する非同期反復可能反復子を返します。

構文を使用する for await 例:

// Get the fileSystemClient before you run these snippets,
// Can be obtained from `serviceClient.getFileSystemClient("<your-filesystem-name>");`
let i = 1;
for await (const deletePath of fileSystemClient.listDeletedPaths()) {
  console.log(`Path ${i++}: ${deletePath.name}`);
}

iter.next() の使用例:

let i = 1;
let iter = fileSystemClient.listDeletedPaths();
let deletedPathItem = await iter.next();
while (!deletedPathItem.done) {
  console.log(`Path ${i++}: ${deletedPathItem.value.name}`);
  pathItem = await iter.next();
}

byPage() の使用例:

// passing optional maxPageSize in the page settings
let i = 1;
for await (const response of fileSystemClient.listDeletedPaths().byPage({ maxPageSize: 20 })) {
  for (const deletePath of response.pathItems) {
    console.log(`Path ${i++}: ${deletePath.name}`);
  }
}

マーカーでページングを使用する例:

let i = 1;
let iterator = fileSystemClient.listDeletedPaths().byPage({ maxPageSize: 2 });
let response = (await iterator.next()).value;

// Prints 2 path names
for (const path of response.pathItems) {
  console.log(`Path ${i++}: ${path.name}}`);
}

// Gets next marker
let marker = response.continuationToken;

// Passing next marker as continuationToken

iterator = fileSystemClient.listDeletedPaths().byPage({ continuationToken: marker, maxPageSize: 10 });
response = (await iterator.next()).value;

// Prints 10 path names
for (const deletePath of response.deletedPathItems) {
  console.log(`Path ${i++}: ${deletePath.name}`);
}

https://docs.microsoft.com/rest/api/storageservices/list-blobs」を参照してください。

listPaths(ListPathsOptions)

指定したファイル システムのすべてのパス (ディレクトリとファイル) を一覧表示する非同期反復可能な反復子を返します。

.byPage() は、ページ内のパスを一覧表示する非同期反復可能反復子を返します。

構文を使用する for await 例:

// Get the fileSystemClient before you run these snippets,
// Can be obtained from `serviceClient.getFileSystemClient("<your-filesystem-name>");`
let i = 1;
for await (const path of fileSystemClient.listPaths()) {
  console.log(`Path ${i++}: ${path.name}, isDirectory?: ${path.isDirectory}`);
}

iter.next() の使用例:

let i = 1;
let iter = fileSystemClient.listPaths();
let pathItem = await iter.next();
while (!pathItem.done) {
  console.log(`Path ${i++}: ${pathItem.value.name}, isDirectory?: ${pathItem.value.isDirectory}`);
  pathItem = await iter.next();
}

byPage() の使用例:

// passing optional maxPageSize in the page settings
let i = 1;
for await (const response of fileSystemClient.listPaths().byPage({ maxPageSize: 20 })) {
  for (const path of response.pathItems) {
    console.log(`Path ${i++}: ${path.name}, isDirectory?: ${path.isDirectory}`);
  }
}

マーカーでページングを使用する例:

let i = 1;
let iterator = fileSystemClient.listPaths().byPage({ maxPageSize: 2 });
let response = (await iterator.next()).value;

// Prints 2 path names
for (const path of response.pathItems) {
  console.log(`Path ${i++}: ${path.name}, isDirectory?: ${path.isDirectory}`);
}

// Gets next marker
let marker = response.continuationToken;

// Passing next marker as continuationToken

iterator = fileSystemClient.listPaths().byPage({ continuationToken: marker, maxPageSize: 10 });
response = (await iterator.next()).value;

// Prints 10 path names
for (const path of response.pathItems) {
  console.log(`Path ${i++}: ${path.name}, isDirectory?: ${path.isDirectory}`);
}

https://docs.microsoft.com/rest/api/storageservices/list-blobs」を参照してください。

setAccessPolicy(PublicAccessType, SignedIdentifier<AccessPolicy>[], FileSystemSetAccessPolicyOptions)

指定したファイル システムのアクセス許可を設定します。 アクセス許可は、ファイル システム内のディレクトリまたはファイルにパブリックにアクセスできるかどうかを示します。

ファイル システムのアクセス許可を設定すると、既存のアクセス許可が置き換えられます。 アクセスまたは containerAcl が指定されていない場合は、既存のファイル システム ACL が削除されます。

https://docs.microsoft.com/en-us/rest/api/storageservices/set-container-acl」を参照してください。

setMetadata(Metadata, FileSystemSetMetadataOptions)

指定したファイル システムに対して 1 つ以上のユーザー定義の名前と値のペアを設定します。

オプションが指定されていない場合、または パラメーターにメタデータが定義されていない場合は、ファイル システムメタデータが削除されます。

https://docs.microsoft.com/en-us/rest/api/storageservices/set-container-metadata」を参照してください。

undeletePath(string, string, FileSystemUndeletePathOption)

論理的に削除されたパスを復元します。

https://docs.microsoft.com/en-us/rest/api/storageservices/undelete-blob」を参照してください。

コンストラクターの詳細

DataLakeFileSystemClient(string, Pipeline)

URL とパイプラインから DataLakeFileSystemClient のインスタンスを作成します。

new DataLakeFileSystemClient(url: string, pipeline: Pipeline)

パラメーター

url

string

"https://myaccount.dfs.core.windows.net/filesystem" など、Azure Storage データ レイク ファイル システムを指すクライアント文字列。 AnonymousCredential を使用している場合は、SAS を追加できます (例: "https://myaccount.dfs.core.windows.net/filesystem?sasString")。

pipeline
Pipeline

newPipeline() を呼び出して既定のパイプラインを作成するか、カスタマイズされたパイプラインを指定します。

DataLakeFileSystemClient(string, StorageSharedKeyCredential | AnonymousCredential | TokenCredential, StoragePipelineOptions)

URL と資格情報から DataLakeFileSystemClient のインスタンスを作成します。

new DataLakeFileSystemClient(url: string, credential?: StorageSharedKeyCredential | AnonymousCredential | TokenCredential, options?: StoragePipelineOptions)

パラメーター

url

string

"https://myaccount.dfs.core.windows.net/filesystem" など、Azure Storage データ レイク ファイル システムを指すクライアント文字列。 AnonymousCredential を使用している場合は、SAS を追加できます (例: "https://myaccount.dfs.core.windows.net/filesystem?sasString")。

credential

StorageSharedKeyCredential | AnonymousCredential | TokenCredential

AnonymousCredential、StorageSharedKeyCredential、またはサービスに対する要求を @azure/identity 認証するためのパッケージからの任意の資格情報など。 TokenCredential インターフェイスを実装するオブジェクトを指定することもできます。 指定しない場合は、AnonymousCredential が使用されます。

options
StoragePipelineOptions

省略可能。 HTTP パイプラインを構成するためのオプション。

プロパティの詳細

name

現在のファイル システムの名前。

string name

プロパティ値

string

継承されたプロパティの詳細

accountName

accountName: string

プロパティ値

string

継承元 StorageClient.accountName

credential

AnonymousCredential、StorageSharedKeyCredential、またはサービスに対する要求を @azure/identity 認証するためのパッケージからの任意の資格情報など。 TokenCredential インターフェイスを実装するオブジェクトを指定することもできます。 指定しない場合は、AnonymousCredential が使用されます。

credential: StorageSharedKeyCredential | AnonymousCredential | TokenCredential

プロパティ値

継承元 StorageClient.credential

url

エンコードされた URL 文字列値。

url: string

プロパティ値

string

継承元 StorageClient.url

メソッドの詳細

create(FileSystemCreateOptions)

指定したアカウントの下に新しいファイル システムを作成します。 同じ名前のファイル システムが既に存在する場合、操作は失敗します。

https://docs.microsoft.com/en-us/rest/api/storageservices/create-container」を参照してください。

function create(options?: FileSystemCreateOptions): Promise<FileSystemCreateResponse>

パラメーター

options
FileSystemCreateOptions

省略可能。 ファイル システムを作成するときのオプション。

戻り値

createIfNotExists(FileSystemCreateOptions)

指定したアカウントの下に新しいファイル システムを作成します。 同じ名前のファイル システムが既に存在する場合は、変更されません。

https://docs.microsoft.com/en-us/rest/api/storageservices/create-container」を参照してください。

function createIfNotExists(options?: FileSystemCreateOptions): Promise<FileSystemCreateIfNotExistsResponse>

パラメーター

戻り値

delete(FileSystemDeleteOptions)

現在のファイル システムを削除します。

https://docs.microsoft.com/en-us/rest/api/storageservices/delete-container」を参照してください。

function delete(options?: FileSystemDeleteOptions): Promise<FileSystemDeleteResponse>

パラメーター

options
FileSystemDeleteOptions

省略可能。 ファイル システムを削除するときのオプション。

戻り値

deleteIfExists(FileSystemDeleteOptions)

現在のファイル システムが存在する場合は削除します。

https://docs.microsoft.com/en-us/rest/api/storageservices/delete-container」を参照してください。

function deleteIfExists(options?: FileSystemDeleteOptions): Promise<FileSystemDeleteIfExistsResponse>

パラメーター

戻り値

exists(FileSystemExistsOptions)

このクライアントで表されるファイル システムが存在する場合は true を返します。それ以外の場合は false。

注: 既存のファイル システムは他のクライアントまたはアプリケーションによって削除される可能性があるため、この関数は注意して使用してください。 その逆も同様に、同じ名前の新しいファイル システムは、この関数の完了後に他のクライアントまたはアプリケーションによって追加される可能性があります。

function exists(options?: FileSystemExistsOptions): Promise<boolean>

パラメーター

戻り値

Promise<boolean>

generateSasUrl(FileSystemGenerateSasUrlOptions)

共有キー資格情報を使用して構築された DataLakeFileSystemClient でのみ使用できます。

渡されたクライアント プロパティとパラメーターに基づいて、サービス Shared Access Signature (SAS) URI を生成します。 SAS は、クライアントの共有キー資格情報によって署名されます。

https://docs.microsoft.com/en-us/rest/api/storageservices/constructing-a-service-sas」を参照してください。

function generateSasUrl(options: FileSystemGenerateSasUrlOptions): Promise<string>

パラメーター

options
FileSystemGenerateSasUrlOptions

省略可能なパラメーター。

戻り値

Promise<string>

このクライアントによって表されるリソースへの URI と、生成された SAS トークンで構成される SAS URI。

getAccessPolicy(FileSystemGetAccessPolicyOptions)

指定したファイル システムのアクセス許可を取得します。 アクセス許可は、ファイル システム データにパブリックにアクセスできるかどうかを示します。

警告: startsOn 文字列と expiresOn 文字列を解析すると、JavaScript 日付の精度が失われる可能性があります。 たとえば、新しい Date("2018-12-31T03:44:23.8827891Z").toISOString() は "2018-12-31T03:44:23.882Z" を取得します。

https://docs.microsoft.com/en-us/rest/api/storageservices/get-container-acl」を参照してください。

function getAccessPolicy(options?: FileSystemGetAccessPolicyOptions): Promise<FileSystemGetAccessPolicyResponse>

パラメーター

options
FileSystemGetAccessPolicyOptions

省略可能。 ファイル システム アクセス ポリシーを取得するときのオプション。

戻り値

getDataLakeLeaseClient(string)

ファイル システムのリースを管理する DataLakeLeaseClient を取得します。

function getDataLakeLeaseClient(proposeLeaseId?: string): DataLakeLeaseClient

パラメーター

proposeLeaseId

string

省略可能。 最初に提案されたリース ID。

戻り値

getDirectoryClient(string)

現在のファイル システムの下に DataLakeDirectoryClient オブジェクトを作成します。

function getDirectoryClient(directoryName: string): DataLakeDirectoryClient

パラメーター

directoryName

string

戻り値

getFileClient(string)

現在のファイル システムの下に DataLakeFileClient オブジェクトを作成します。

function getFileClient(fileName: string): DataLakeFileClient

パラメーター

fileName

string

戻り値

getProperties(FileSystemGetPropertiesOptions)

指定したファイル システムのすべてのユーザー定義メタデータとシステム プロパティを返します。

警告: 応答で返されるオブジェクトのキーは metadata 、最初に大文字が含まれていた場合でも小文字になります。 これは、 オプションを使用includeMetadataして DataLakeServiceClient のメソッドによってlistFileSystems返されるメタデータ キーとは異なり、元の大文字と小文字は保持されます。

https://docs.microsoft.com/en-us/rest/api/storageservices/get-container-properties」を参照してください。

function getProperties(options?: FileSystemGetPropertiesOptions): Promise<FileSystemGetPropertiesResponse>

パラメーター

options
FileSystemGetPropertiesOptions

省略可能。 ファイル システムのプロパティを取得するときのオプション。

戻り値

listDeletedPaths(ListDeletedPathsOptions)

指定したファイル システムのすべてのパス (ディレクトリとファイル) を一覧表示する非同期反復可能な反復子を返します。

.byPage() は、ページ内のパスを一覧表示する非同期反復可能反復子を返します。

構文を使用する for await 例:

// Get the fileSystemClient before you run these snippets,
// Can be obtained from `serviceClient.getFileSystemClient("<your-filesystem-name>");`
let i = 1;
for await (const deletePath of fileSystemClient.listDeletedPaths()) {
  console.log(`Path ${i++}: ${deletePath.name}`);
}

iter.next() の使用例:

let i = 1;
let iter = fileSystemClient.listDeletedPaths();
let deletedPathItem = await iter.next();
while (!deletedPathItem.done) {
  console.log(`Path ${i++}: ${deletedPathItem.value.name}`);
  pathItem = await iter.next();
}

byPage() の使用例:

// passing optional maxPageSize in the page settings
let i = 1;
for await (const response of fileSystemClient.listDeletedPaths().byPage({ maxPageSize: 20 })) {
  for (const deletePath of response.pathItems) {
    console.log(`Path ${i++}: ${deletePath.name}`);
  }
}

マーカーでページングを使用する例:

let i = 1;
let iterator = fileSystemClient.listDeletedPaths().byPage({ maxPageSize: 2 });
let response = (await iterator.next()).value;

// Prints 2 path names
for (const path of response.pathItems) {
  console.log(`Path ${i++}: ${path.name}}`);
}

// Gets next marker
let marker = response.continuationToken;

// Passing next marker as continuationToken

iterator = fileSystemClient.listDeletedPaths().byPage({ continuationToken: marker, maxPageSize: 10 });
response = (await iterator.next()).value;

// Prints 10 path names
for (const deletePath of response.deletedPathItems) {
  console.log(`Path ${i++}: ${deletePath.name}`);
}

https://docs.microsoft.com/rest/api/storageservices/list-blobs」を参照してください。

function listDeletedPaths(options?: ListDeletedPathsOptions): PagedAsyncIterableIterator<DeletedPath, FileSystemListDeletedPathsResponse, PageSettings>

パラメーター

options
ListDeletedPathsOptions

省略可能。 削除されたパスを一覧表示するときのオプション。

戻り値

listPaths(ListPathsOptions)

指定したファイル システムのすべてのパス (ディレクトリとファイル) を一覧表示する非同期反復可能な反復子を返します。

.byPage() は、ページ内のパスを一覧表示する非同期反復可能反復子を返します。

構文を使用する for await 例:

// Get the fileSystemClient before you run these snippets,
// Can be obtained from `serviceClient.getFileSystemClient("<your-filesystem-name>");`
let i = 1;
for await (const path of fileSystemClient.listPaths()) {
  console.log(`Path ${i++}: ${path.name}, isDirectory?: ${path.isDirectory}`);
}

iter.next() の使用例:

let i = 1;
let iter = fileSystemClient.listPaths();
let pathItem = await iter.next();
while (!pathItem.done) {
  console.log(`Path ${i++}: ${pathItem.value.name}, isDirectory?: ${pathItem.value.isDirectory}`);
  pathItem = await iter.next();
}

byPage() の使用例:

// passing optional maxPageSize in the page settings
let i = 1;
for await (const response of fileSystemClient.listPaths().byPage({ maxPageSize: 20 })) {
  for (const path of response.pathItems) {
    console.log(`Path ${i++}: ${path.name}, isDirectory?: ${path.isDirectory}`);
  }
}

マーカーでページングを使用する例:

let i = 1;
let iterator = fileSystemClient.listPaths().byPage({ maxPageSize: 2 });
let response = (await iterator.next()).value;

// Prints 2 path names
for (const path of response.pathItems) {
  console.log(`Path ${i++}: ${path.name}, isDirectory?: ${path.isDirectory}`);
}

// Gets next marker
let marker = response.continuationToken;

// Passing next marker as continuationToken

iterator = fileSystemClient.listPaths().byPage({ continuationToken: marker, maxPageSize: 10 });
response = (await iterator.next()).value;

// Prints 10 path names
for (const path of response.pathItems) {
  console.log(`Path ${i++}: ${path.name}, isDirectory?: ${path.isDirectory}`);
}

https://docs.microsoft.com/rest/api/storageservices/list-blobs」を参照してください。

function listPaths(options?: ListPathsOptions): PagedAsyncIterableIterator<Path, FileSystemListPathsResponse, PageSettings>

パラメーター

options
ListPathsOptions

省略可能。 パスを一覧表示するときのオプション。

戻り値

setAccessPolicy(PublicAccessType, SignedIdentifier<AccessPolicy>[], FileSystemSetAccessPolicyOptions)

指定したファイル システムのアクセス許可を設定します。 アクセス許可は、ファイル システム内のディレクトリまたはファイルにパブリックにアクセスできるかどうかを示します。

ファイル システムのアクセス許可を設定すると、既存のアクセス許可が置き換えられます。 アクセスまたは containerAcl が指定されていない場合は、既存のファイル システム ACL が削除されます。

https://docs.microsoft.com/en-us/rest/api/storageservices/set-container-acl」を参照してください。

function setAccessPolicy(access?: PublicAccessType, fileSystemAcl?: SignedIdentifier<AccessPolicy>[], options?: FileSystemSetAccessPolicyOptions): Promise<FileSystemSetAccessPolicyResponse>

パラメーター

access
PublicAccessType

省略可能。 ファイル システム内のデータへのパブリック アクセスのレベル。

fileSystemAcl

SignedIdentifier<AccessPolicy>[]

省略可能。 一意の ID とアクセス ポリシーの詳細を持つ要素の配列。

options
FileSystemSetAccessPolicyOptions

省略可能。 ファイル システム アクセス ポリシーを設定するときのオプション。

戻り値

setMetadata(Metadata, FileSystemSetMetadataOptions)

指定したファイル システムに対して 1 つ以上のユーザー定義の名前と値のペアを設定します。

オプションが指定されていない場合、または パラメーターにメタデータが定義されていない場合は、ファイル システムメタデータが削除されます。

https://docs.microsoft.com/en-us/rest/api/storageservices/set-container-metadata」を参照してください。

function setMetadata(metadata?: Metadata, options?: FileSystemSetMetadataOptions): Promise<FileSystemSetMetadataResponse>

パラメーター

metadata
Metadata

既存のメタデータをこの値に置き換えます。 値が指定されていない場合、既存のメタデータは削除されます。

options
FileSystemSetMetadataOptions

省略可能。 ファイル システム メタデータを設定するときのオプション。

戻り値

undeletePath(string, string, FileSystemUndeletePathOption)

論理的に削除されたパスを復元します。

https://docs.microsoft.com/en-us/rest/api/storageservices/undelete-blob」を参照してください。

function undeletePath(deletedPath: string, deletionId: string, options?: FileSystemUndeletePathOption): Promise<FileSystemUndeletePathResponse>

パラメーター

deletedPath

string

必須。 削除されたパスのパス。

deletionId

string

必須。 論理的に削除されたパスに関連付けられている削除 ID。

戻り値