

翻訳は機械翻訳により提供されています。提供された翻訳内容と英語版の間で齟齬、不一致または矛盾がある場合、英語版が優先します。

# CLI で `DescribeVolumeStatus` を使用する
<a name="example_ec2_DescribeVolumeStatus_section"></a>

次のサンプルコードは、`DescribeVolumeStatus` を使用する方法を説明しています。

------
#### [ CLI ]

**AWS CLI**  
**単一ボリュームのステータスを記述するには**  
このコマンド例では、ボリューム `vol-1234567890abcdef0` のステータスを記述します。  
コマンド:  

```
aws ec2 describe-volume-status --volume-ids vol-1234567890abcdef0
```
出力:  

```
{
    "VolumeStatuses": [
        {
            "VolumeStatus": {
                "Status": "ok",
                "Details": [
                    {
                        "Status": "passed",
                        "Name": "io-enabled"
                    },
                    {
                        "Status": "not-applicable",
                        "Name": "io-performance"
                    }
                ]
            },
            "AvailabilityZone": "us-east-1a",
            "VolumeId": "vol-1234567890abcdef0",
            "Actions": [],
            "Events": []
        }
    ]
}
```
**障害のあるボリュームのステータスを記述するには**  
このコマンド例では、障害のあるすべてのボリュームのステータスを記述します。この例では、障害のあるボリュームはありません。  
コマンド:  

```
aws ec2 describe-volume-status --filters Name=volume-status.status,Values=impaired
```
出力:  

```
{
    "VolumeStatuses": []
}
```
ステータスチェックに失敗したボリュームがある場合 (ステータスに障害がある場合)、「*Amazon EC2 ユーザーガイド*」の「Working with an Impaired Volume」を参照してください。  
+  API の詳細については、「*AWS CLI コマンドリファレンス*」の「[DescribeVolumeStatus](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/ec2/describe-volume-status.html)」を参照してください。

------
#### [ PowerShell ]

**Tools for PowerShell V4**  
**例 1: この例では、指定されたボリュームのステータスを記述します。**  

```
Get-EC2VolumeStatus -VolumeId vol-12345678
```
**出力:**  

```
Actions          : {}
AvailabilityZone : us-west-2a
Events           : {}
VolumeId         : vol-12345678
VolumeStatus     : Amazon.EC2.Model.VolumeStatusInfo
```

```
(Get-EC2VolumeStatus -VolumeId vol-12345678).VolumeStatus
```
**出力:**  

```
Details                         Status
-------                         ------
{io-enabled, io-performance}    ok
```

```
(Get-EC2VolumeStatus -VolumeId vol-12345678).VolumeStatus.Details
```
**出力:**  

```
Name                            Status
----                            ------
io-enabled                      passed
io-performance                  not-applicable
```
+  API の詳細については、「*AWS Tools for PowerShell コマンドレットリファレンス (V4)*」の「[DescribeVolumeStatus](https://docs.aws.amazon.com/powershell/v4/reference)」を参照してください。

**Tools for PowerShell V5**  
**例 1: この例では、指定されたボリュームのステータスを記述します。**  

```
Get-EC2VolumeStatus -VolumeId vol-12345678
```
**出力:**  

```
Actions          : {}
AvailabilityZone : us-west-2a
Events           : {}
VolumeId         : vol-12345678
VolumeStatus     : Amazon.EC2.Model.VolumeStatusInfo
```

```
(Get-EC2VolumeStatus -VolumeId vol-12345678).VolumeStatus
```
**出力:**  

```
Details                         Status
-------                         ------
{io-enabled, io-performance}    ok
```

```
(Get-EC2VolumeStatus -VolumeId vol-12345678).VolumeStatus.Details
```
**出力:**  

```
Name                            Status
----                            ------
io-enabled                      passed
io-performance                  not-applicable
```
+  API の詳細については、「*AWS Tools for PowerShell コマンドレットリファレンス (V5)*」の「[DescribeVolumeStatus](https://docs.aws.amazon.com/powershell/v5/reference)」を参照してください。

------

 AWS SDK 開発者ガイドとコード例の完全なリストについては、「」を参照してください[AWS SDK を使用して Amazon EC2 リソースを作成する](sdk-general-information-section.md)。このトピックには、使用開始方法に関する情報と、以前の SDK バージョンの詳細も含まれています。