L'opération get-bucket-inventory permet de consulter une tâche d'inventaire spécifique dans un bucket.
Prérequis
Par défaut, un compte Alibaba Cloud est autorisé à consulter les tâches d'inventaire d'un bucket. Pour effectuer cette opération via un utilisateur RAM ou des identifiants STS, vous devez disposer de l'autorisation oss:GetBucketInventory. Pour plus d'informations, consultez la rubrique Grant a custom policy.
Syntaxe
ossutil api get-bucket-inventory --bucket value --inventory-id value [flags]
|
Paramètre |
Type |
Description |
|
--bucket |
string |
Nom du bucket. |
|
--inventory-id |
string |
ID de la tâche d'inventaire. |
La commande
get-bucket-inventorycorrespond à l'API GetBucketInventory. Pour le détail des paramètres de l'API, consultez la documentation GetBucketInventory.Pour la liste des options globales disponibles, consultez la rubrique Global command-line options.
Exemples
-
Consultez la tâche d'inventaire nommée
report1pour le bucketexamplebucket.ossutil api get-bucket-inventory --bucket examplebucket --inventory-id report1 -
Consultez la tâche d'inventaire
report1du bucketexamplebucketet affichez le résultat au format JSON.ossutil api get-bucket-inventory --bucket examplebucket --inventory-id report1 --output-format json -
Consultez la tâche d'inventaire
report1du bucketexamplebucketet affichez le résultat au format YAML.ossutil api get-bucket-inventory --bucket examplebucket --inventory-id report1 --output-format yaml