搭DescribeFileSystems配 AWS SDK或使用 CLI - AWS SDK 程式碼範例

AWS 文檔 AWS SDK示例 GitHub 回購中有更多SDK示例

本文為英文版的機器翻譯版本,如內容有任何歧義或不一致之處,概以英文版為準。

DescribeFileSystems配 AWS SDK或使用 CLI

下列程式碼範例會示範如何使用DescribeFileSystems

CLI
AWS CLI

描述檔案系統

下列describe-file-systems範例說明指定的檔案系統。

aws efs describe-file-systems \ --file-system-id fs-c7a0456e

輸出:

{ "FileSystems": [ { "OwnerId": "123456789012", "CreationToken": "console-d7f56c5f-e433-41ca-8307-9d9c0example", "FileSystemId": "fs-c7a0456e", "FileSystemArn": "arn:aws:elasticfilesystem:us-west-2:123456789012:file-system/fs-48499b4d", "CreationTime": 1595286880.0, "LifeCycleState": "available", "Name": "my-file-system", "NumberOfMountTargets": 3, "SizeInBytes": { "Value": 6144, "Timestamp": 1600991437.0, "ValueInIA": 0, "ValueInStandard": 6144 }, "PerformanceMode": "generalPurpose", "Encrypted": true, "KmsKeyId": "arn:aws:kms:us-west-2:123456789012:key/a59b3472-e62c-42e4-adcf-30d92example", "ThroughputMode": "bursting", "Tags": [ { "Key": "Name", "Value": "my-file-system" } ] } ] }

如需詳細資訊,請參閱 Amazon 彈性EFS檔案系統使用者指南中的管理 Amazon 檔案系統

PowerShell
適用的工具 PowerShell

範例 1:傳回區域中呼叫者帳戶所擁有之所有檔案系統的集合。

Get-EFSFileSystem

輸出:

CreationTime : 5/26/2015 4:02:38 PM CreationToken : 1a2bff54-85e0-4747-bd95-7bc172c4f555 FileSystemId : fs-1a2b3c4d LifeCycleState : available Name : NumberOfMountTargets : 0 OwnerId : 123456789012 SizeInBytes : Amazon.ElasticFileSystem.Model.FileSystemSize CreationTime : 5/26/2015 4:06:23 PM CreationToken : 2b4daa14-85e0-4747-bd95-7bc172c4f555 FileSystemId : fs-4d3c2b1a ...

範例 2:傳回指定檔案系統的詳細資訊。

Get-EFSFileSystem -FileSystemId fs-1a2b3c4d

範例 3:使用建立檔案系統時指定的冪等建立權杖,傳回檔案系統的詳細資訊。

Get-EFSFileSystem -CreationToken 1a2bff54-85e0-4747-bd95-7bc172c4f555
  • 如需詳API細資訊,請參閱AWS Tools for PowerShell 指令程DescribeFileSystems式參考中的。