Skip to main content

delete data-container

Overview#

To delete a data container use the delete command.

Command#

spawnctl delete data-container <ContainerNames_Or_ContainerIDs>

If you are an admin of your organisation, you can delete data-containers within your organisation using the --org flag.

Examples#

Delete a data-container with id 10001:

spawnctl delete data-container 10001

Delete a data-container with name dev-rambbomj:

spawnctl delete data-container dev-rambbomj

Delete multiple data-container with ids 10001, 10002 and 10003:

spawnctl delete data-container 10001 10002 10003

Delete multiple data-container with names dev-rambbomj, dev-wtejgstr:

spawnctl delete data-container dev-rambbomj dev-wtejgstr

Delete a data-container with id 10001 that you do not own but is part of your organisation:

spawnctl delete data-container 10001 --org

Tutorial#

In this tutorial we will create a data image, then create a data container from that image and finally delete the data-container.

As a prerequisite you should've followed the instructions to install spawnctl

  1. Create a file development.yaml with your data image specifications.

    sourceType: empty
    name: dev
    engine: postgresql
    version: 11.0

    In this case we want to create a PostgreSQL data image that is completely empty and is named dev.

  2. Run the following command to create a data image.

    $ spawnctl create data-image -f ./development.yaml
    Data image 'dev' (10001) created!
  3. You can verify your data image by running the following command.

    $ spawnctl get data-images
    NAME IMAGE ID ENGINE STATUS MESSAGE CREATED
    dev 10001 PostgreSQL 2 Created 2 minutes ago
  4. Create a data container from the newly created data image.

    $ spawnctl create data-container --image dev
    Data container 'dev-rambbomj' (10001) created!
    -> Host=instances.spawn.cc;Port=53223;User ID=<some_user_id>;Password=<some_password>;
  5. You can verify your data container was properly created by running the following command.

    $ spawnctl get data-containers
    NAME CONTAINER ID REVISION STATUS MESSAGE ENGINE CREATED
    dev-rambbomj 10001 rev.0 2 Running PostgreSQL 1 minute ago
  6. You should now be able to delete your data container.

    $ spawnctl delete data-container dev-rambbomj
    Deleting container......
    dev-rambbomj