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' 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' 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