Skip to main content

get data-container

Overview#

You can review your data container by using the get command.

Commands#

spawnctl get data-containers
spawnctl get data-container <ContainerName_Or_ContainerID>

You can change the output format when getting data containers to return more information. -o json will print the data container information out as JSON, including connection details (hostname, port, username, password). This makes it easier to consume Spawn as part of a startup script for an application as you can dynamically configure database connection details.

spawnctl get data-container <ContainerName_Or_ContainerID> -o json

If you are an admin of your organisation, you can use the --org command to check all data-containers created within your organisation.

Examples#

Get all data-containers you own:

spawnctl get data-containers

Get specific data-containers you own:

spawnctl get data-container 10001

Get all data-containers within your organisation:

spawnctl get data-containers --org

Get specific data-container within your organisation:

spawnctl get data-container 10001 --org

Tutorial#

In this tutorial we will create a data image, then create a data container from that image. We will then review the data container information.

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
    ID Name Revision Status Engine CreatedAt ExpiresAt
    10001 dev-rambbomj rev.0 Completed PostgreSQL:11.0 1 minute ago Never
  6. You can also get only that specific container.

    $ spawnctl get data-container dev-rambbomj
    ID Name Revision Status Engine CreatedAt ExpiresAt
    10001 dev-rambbomj rev.0 Completed PostgreSQL:11.0 1 minute ago Never