View a markdown version of this page

Utilizzare DeleteObjectTagging con una CLI - AWS Esempi di codice SDK

Sono disponibili altri esempi AWS SDK nel repository AWS Doc SDK Examples. GitHub

Le traduzioni sono generate tramite traduzione automatica. In caso di conflitto tra il contenuto di una traduzione e la versione originale in Inglese, quest'ultima prevarrà.

Utilizzare DeleteObjectTagging con una CLI

Gli esempi di codice seguenti mostrano come utilizzare DeleteObjectTagging.

CLI
AWS CLI

Come eliminare i set di tag di un oggetto

L’esempio delete-object-tagging seguente elimina il tag con la chiave specificata dall’oggetto doc1.rtf.

aws s3api delete-object-tagging \ --bucket amzn-s3-demo-bucket \ --key doc1.rtf

Questo comando non produce alcun output.

PowerShell
Strumenti per PowerShell V4

Esempio 1: questo comando rimuove tutti i tag associati all’oggetto con la chiave “testfile.txt” nel bucket S3 specificato.

Remove-S3ObjectTagSet -Key 'testfile.txt' -BucketName 'amzn-s3-demo-bucket' -Select '^Key'

Output:

Confirm Are you sure you want to perform this action? Performing the operation "Remove-S3ObjectTagSet (DeleteObjectTagging)" on target "testfile.txt". [Y] Yes [A] Yes to All [N] No [L] No to All [S] Suspend [?] Help (default is "Y"): Y testfile.txt
  • Per i dettagli sull'API, vedere DeleteObjectTaggingin AWS Strumenti per PowerShell Cmdlet Reference (V4).

Strumenti per V5 PowerShell

Esempio 1: questo comando rimuove tutti i tag associati all’oggetto con la chiave “testfile.txt” nel bucket S3 specificato.

Remove-S3ObjectTagSet -Key 'testfile.txt' -BucketName 'amzn-s3-demo-bucket' -Select '^Key'

Output:

Confirm Are you sure you want to perform this action? Performing the operation "Remove-S3ObjectTagSet (DeleteObjectTagging)" on target "testfile.txt". [Y] Yes [A] Yes to All [N] No [L] No to All [S] Suspend [?] Help (default is "Y"): Y testfile.txt
  • Per i dettagli sull'API, vedere DeleteObjectTaggingin AWS Strumenti per PowerShell Cmdlet Reference (V5).