Skip to main content

update data-container

Overview#

You can update your data containers to change their lifetime by using the update command.

Lifetime#

You can specify a lifetime for a data container via the lifetime flag. This will automatically delete your data container after the time specified, in time duration format (number followed by a unit suffix. Valid units are "h", "m", "s").

If no value is provided, your data container will have an unlimited lifetime, and will only be deleted if you explicitly request it.

Organisations#

If you are an admin of your organisation, you can use the --org command to update data-containers that are part of your organisation.

Commands#

spawnctl update data-container <ContainerName_Or_ContainerID> --lifetime <LifetimeDurationString>

To rename an existing data container use the --name option:

spawnctl update data-container <OldContainerName_Or_ContainerID> --name <NewContainerName>

Tutorial#

In this tutorial we will create a data container with an unlimited lifetime, then update it to expire in 2 hours.

As a prerequisite you should've followed the instructions to install spawnctl and created a data image

  1. Create a data container from a 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>;
  2. 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 EXPIRES AT
    dev-rambbomj 10001 rev.0 2 Running PostgreSQL 1 minute ago Never
  3. Run the update command to change the lifetime of the container to expire 2 hours from now

    $ spawnctl update data-container dev-rambbomj --lifetime 2h
    Container: 'dev-rambbomj' updated!
  4. Verify that the lifetime of the container has been updated

    $ spawnctl get data-containers
    NAME CONTAINER ID REVISION STATUS MESSAGE ENGINE CREATED EXPIRES AT
    dev-rambbomj 10001 rev.0 2 Running PostgreSQL 1 minute ago 2 hours from now