Ada lebih banyak contoh AWS SDK yang tersedia di repo Contoh SDK AWS Doc
Terjemahan disediakan oleh mesin penerjemah. Jika konten terjemahan yang diberikan bertentangan dengan versi bahasa Inggris aslinya, utamakan versi bahasa Inggris.
Gunakan GetBucketInventoryConfiguration
dengan CLI
Contoh kode berikut menunjukkan cara menggunakanGetBucketInventoryConfiguration
.
- CLI
-
- AWS CLI
-
Untuk mengambil konfigurasi inventaris untuk bucket
get-bucket-inventory-configuration
Contoh berikut mengambil konfigurasi inventaris untuk bucket yang ditentukan dengan ID1
.aws s3api get-bucket-inventory-configuration \ --bucket
amzn-s3-demo-bucket
\ --id1
Output:
{ "InventoryConfiguration": { "IsEnabled": true, "Destination": { "S3BucketDestination": { "Format": "ORC", "Bucket": "arn:aws:s3:::amzn-s3-demo-bucket", "AccountId": "123456789012" } }, "IncludedObjectVersions": "Current", "Id": "1", "Schedule": { "Frequency": "Weekly" } } }
-
Untuk detail API, lihat GetBucketInventoryConfiguration
di Referensi AWS CLI Perintah.
-
- PowerShell
-
- Alat untuk PowerShell V4
-
Contoh 1: Perintah ini mengembalikan detail inventaris bernama 'testinventory' untuk bucket S3 yang diberikan.
Get-S3BucketInventoryConfiguration -BucketName 'amzn-s3-demo-bucket' -InventoryId 'testinventory'
-
Untuk detail API, lihat GetBucketInventoryConfigurationdi Referensi Alat AWS untuk PowerShell Cmdlet (V4).
-
- Alat untuk PowerShell V5
-
Contoh 1: Perintah ini mengembalikan detail inventaris bernama 'testinventory' untuk bucket S3 yang diberikan.
Get-S3BucketInventoryConfiguration -BucketName 'amzn-s3-demo-bucket' -InventoryId 'testinventory'
-
Untuk detail API, lihat GetBucketInventoryConfigurationdi Referensi Alat AWS untuk PowerShell Cmdlet (V5).
-