以下のコード例は、ListDocuments
の使用方法を示しています。
- AWS CLI
-
例 1: ドキュメントを一覧表示するには
次の
list-documents
の例では、カスタムタグでタグ付けされたリクエスト元のアカウントが所有するドキュメントを一覧表示します。aws ssm list-documents \ --filters
Key=Owner,Values=Self
Key=tag:DocUse,Values=Testing
出力:
{ "DocumentIdentifiers": [ { "Name": "Example", "Owner": "29884EXAMPLE", "PlatformTypes": [ "Windows", "Linux" ], "DocumentVersion": "1", "DocumentType": "Automation", "SchemaVersion": "0.3", "DocumentFormat": "YAML", "Tags": [ { "Key": "DocUse", "Value": "Testing" } ] } ] }
詳細については、「AWS Systems Manager ユーザーガイド」の「AWS Systems Manager ドキュメント」を参照してください。
例 2: 共有ドキュメントを一覧表示するには
次の
list-documents
の例では、AWS が所有していないプライベート共有ドキュメントを含む共有ドキュメントを一覧表示します。aws ssm list-documents \ --filters
Key=Name,Values=sharedDocNamePrefix
Key=Owner,Values=Private
出力:
{ "DocumentIdentifiers": [ { "Name": "Example", "Owner": "12345EXAMPLE", "PlatformTypes": [ "Windows", "Linux" ], "DocumentVersion": "1", "DocumentType": "Command", "SchemaVersion": "0.3", "DocumentFormat": "YAML", "Tags": [] } ] }
詳細については、「AWS Systems Manager ユーザーガイド」の「AWS Systems Manager ドキュメント」を参照してください。
-
API の詳細については、「AWS CLI コマンドリファレンス」の「ListDocuments
」を参照してください。
-
AWS SDK デベロッパーガイドとコード例の詳細なリストについては、「このサービスを AWS SDK で使用する」を参照してください。このトピックには、使用開始方法に関する情報と、以前の SDK バージョンの詳細も含まれています。