Questo contenuto non è disponibile nella lingua selezionata.

Chapter 10. Deleting a bucket from your object store


To delete a bucket from your object store from your workbench, use the delete_bucket() method.

Prerequisites

  • You have cloned the odh-doc-examples repository to your workbench.
  • You have opened the s3client_examples.ipynb file in your workbench.
  • You have installed Boto3 and configured an S3 client.
  • You have ensured that the bucket that you want to delete is empty.

Procedure

  1. In the Jupyter notebook, locate the following instructions to delete a bucket:

    #Delete bucket
    s3_client.delete_bucket(Bucket='<bucket_name>')
  2. Replace <bucket_name> with the name of the bucket that you want to delete and run the code cell.

    #Delete bucket
    s3_client.delete_bucket(Bucket='aqs971-image-registry')

    The output displays an HTTP response status code of 200, which indicates that the request was successful.

Verification

  • Locate the instructions to list buckets, and execute the code cell.

    for bucket in s3_client.list_bucket()[‘Buckets’]:
        print(bucket[‘Name’])

    The bucket that you deleted does not appear in the output.

Red Hat logoGithubredditYoutubeTwitter

Formazione

Prova, acquista e vendi

Community

Informazioni sulla documentazione di Red Hat

Aiutiamo gli utenti Red Hat a innovarsi e raggiungere i propri obiettivi con i nostri prodotti e servizi grazie a contenuti di cui possono fidarsi. Esplora i nostri ultimi aggiornamenti.

Rendiamo l’open source più inclusivo

Red Hat si impegna a sostituire il linguaggio problematico nel codice, nella documentazione e nelle proprietà web. Per maggiori dettagli, visita il Blog di Red Hat.

Informazioni su Red Hat

Forniamo soluzioni consolidate che rendono più semplice per le aziende lavorare su piattaforme e ambienti diversi, dal datacenter centrale all'edge della rete.

Theme

© 2026 Red Hat
Torna in cima