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 GetAttributeValues
dengan CLI
Contoh kode berikut menunjukkan cara menggunakanGetAttributeValues
.
- CLI
-
- AWS CLI
-
Untuk mengambil daftar nilai atribut
get-attribute-values
Contoh berikut mengambil daftar nilai yang tersedia untuk atribut yang diberikan.aws pricing get-attribute-values \ --service-code
AmazonEC2
\ --attribute-namevolumeType
\ --max-items2
Output:
{ "NextToken": "eyJOZXh0VG9rZW4iOiBudWxsLCAiYm90b190cnVuY2F0ZV9hbW91bnQiOiAyfQ==", "AttributeValues": [ { "Value": "Cold HDD" }, { "Value": "General Purpose" } ] }
-
Untuk detail API, lihat GetAttributeValues
di Referensi AWS CLI Perintah.
-
- PowerShell
-
- Alat untuk PowerShell V4
-
Contoh 1: Mengembalikan nilai untuk atribut 'VolumeType' untuk Amazon EC2 di wilayah us-east-1.
Get-PLSAttributeValue -ServiceCode AmazonEC2 -AttributeName "volumeType" -region us-east-1
Output:
Value ----- Cold HDD General Purpose Magnetic Provisioned IOPS Throughput Optimized HDD
-
Untuk detail API, lihat GetAttributeValuesdi Referensi Alat AWS untuk PowerShell Cmdlet (V4).
-
- Alat untuk PowerShell V5
-
Contoh 1: Mengembalikan nilai untuk atribut 'VolumeType' untuk Amazon EC2 di wilayah us-east-1.
Get-PLSAttributeValue -ServiceCode AmazonEC2 -AttributeName "volumeType" -region us-east-1
Output:
Value ----- Cold HDD General Purpose Magnetic Provisioned IOPS Throughput Optimized HDD
-
Untuk detail API, lihat GetAttributeValuesdi Referensi Alat AWS untuk PowerShell Cmdlet (V5).
-