organizations

The organizations command allows you to create, modify and view organization resources.

Usage: croud organizations [-h]
                           {create,get,list,edit,delete,auditlogs,users,secrets,files,credits,customer}
                           ...

Note

The organizations auditlogs and organizations users subcommands are only available to organization admins and superusers.

organizations create

Usage: croud organizations create [-h] --name NAME [--plan-type {1,2,3,4,5,6}]
                                  [--region REGION]
                                  [--output-fmt {table,wide,json,yaml}]
                                  [--sudo]

Required Arguments

--name

The organization name to use.

Optional Arguments

--plan-type

Possible choices: 1, 2, 3, 4, 5, 6

The support plan to use for the organization. Argument is for superusers only.

--region, -r

Temporarily use the specified region that command will be run in.

--output-fmt, --format, -o

Possible choices: table, wide, json, yaml

Change the formatting of the output.

--sudo

Run the given command as superuser.

Default: False

Example

sh$ croud organizations create --name my-org
+--------------------------------------+--------+------------+
| id                                   | name   |   planType |
|--------------------------------------+--------+------------|
| f6c39580-5719-431d-a508-0cee4f9e8209 | my-org |          3 |
+--------------------------------------+--------+------------+
==> Success: Organization created.

organizations list

Usage: croud organizations list [-h] [--region REGION]
                                [--output-fmt {table,wide,json,yaml}] [--sudo]

Optional Arguments

--region, -r

Temporarily use the specified region that command will be run in.

--output-fmt, --format, -o

Possible choices: table, wide, json, yaml

Change the formatting of the output.

--sudo

Run the given command as superuser.

Default: False

Example

sh$ croud organizations list
+--------------------------------------+--------+------------+
| id                                   | name   |   planType |
|--------------------------------------+--------+------------|
| f6c39580-5719-431d-a508-0cee4f9e8209 | my-org |          3 |
+--------------------------------------+--------+------------+

organizations edit

Usage: croud organizations edit [-h] [--name NAME] [--plan-type {1,2,3,4,5,6}]
                                [--org-id ORG_ID] [--region REGION]
                                [--output-fmt {table,wide,json,yaml}] [--sudo]

Optional Arguments

--name

The new organization name to use.

--plan-type

Possible choices: 1, 2, 3, 4, 5, 6

The new support plan to use for the organization.

--org-id

The organization ID to use.

--region, -r

Temporarily use the specified region that command will be run in.

--output-fmt, --format, -o

Possible choices: table, wide, json, yaml

Change the formatting of the output.

--sudo

Run the given command as superuser.

Default: False

Example

sh$ croud organizations edit --name new-name
+--------------------------------------+-------------+-------------+
| id                                   | name        |   plan_type |
|--------------------------------------+-------------+-------------|
| f6c39580-5719-431d-a508-0cee4f9e8209 | new-name    |           3 |
+--------------------------------------+-------------+-------------+
==> Success: Organization edited.

organizations delete

Usage: croud organizations delete [-h] [-y] [--org-id ORG_ID]
                                  [--region REGION]
                                  [--output-fmt {table,wide,json,yaml}]
                                  [--sudo]

Optional Arguments

-y, --yes

Default: False

--org-id

The organization ID to use.

--region, -r

Temporarily use the specified region that command will be run in.

--output-fmt, --format, -o

Possible choices: table, wide, json, yaml

Change the formatting of the output.

--sudo

Run the given command as superuser.

Default: False

Example

sh$ croud organizations delete \
    --org-id f6c39580-5719-431d-a508-0cee4f9e8209
Are you sure you want to delete the organization? [yN] y
==> Success: Organization deleted.

organizations auditlogs

Usage: croud organizations auditlogs [-h] {list} ...

organizations auditlogs list

Usage: croud organizations auditlogs list [-h] [--action ACTION] [--from FROM]
                                          [--to TO] [--org-id ORG_ID]
                                          [--region REGION]
                                          [--output-fmt {table,wide,json,yaml}]
                                          [--sudo]

Optional Arguments

--action

The audit event action.

--from

Only show events from this point in time.

--to

Only show events older than this.

--org-id

The organization ID to use.

--region, -r

Temporarily use the specified region that command will be run in.

--output-fmt, --format, -o

Possible choices: table, wide, json, yaml

Change the formatting of the output.

--sudo

Run the given command as superuser.

Default: False

Example

sh$ croud organizations auditlogs list \
    --org-id f6c39580-5719-431d-a508-0cee4f9e8209
+------------------------+--------------------------------------+----------------------------------+
| action                 | actor                                | created                          |
|------------------------+--------------------------------------+----------------------------------|
| product.create_cluster | e4c6e51f-bd56-4d92-bdf8-9947531c3225 | 2019-11-05T12:35:23.168000+00:00 |
| project.add_user       | e4c6e51f-bd56-4d92-bdf8-9947531c3225 | 2019-11-05T12:22:31.796000+00:00 |
| project.create         | e4c6e51f-bd56-4d92-bdf8-9947531c3225 | 2019-11-05T12:22:31.196000+00:00 |
| organization.add_user  | e4c6e51f-bd56-4d92-bdf8-9947531c3225 | 2019-11-05T12:20:57.610000+00:00 |
| organization.create    | e4c6e51f-bd56-4d92-bdf8-9947531c3225 | 2019-11-05T12:20:57.598000+00:00 |
+------------------------+--------------------------------------+----------------------------------+

Note

The full context for each auditlog event is available through the JSON output format:

sh$ croud organizations auditlogs list \
    --org-id f6c39580-5719-431d-a508-0cee4f9e8209 \
    --output-fmt json

organizations users

Usage: croud organizations users [-h] {add,list,remove} ...

organizations users add

Usage: croud organizations users add [-h] --user USER --role ROLE
                                     [--org-id ORG_ID] [--region REGION]
                                     [--output-fmt {table,wide,json,yaml}]
                                     [--sudo]

Required Arguments

--user

The user email address or ID to use.

--role

The role FQN to use. Run croud users roles list for a list of available roles.

Optional Arguments

--org-id

The organization ID to use.

--region, -r

Temporarily use the specified region that command will be run in.

--output-fmt, --format, -o

Possible choices: table, wide, json, yaml

Change the formatting of the output.

--sudo

Run the given command as superuser.

Default: False

Example

sh$ croud organizations users add \
    --org-id f6c39580-5719-431d-a508-0cee4f9e8209 \
    --role org_member \
    --user john.doe@example.com
+--------------------------------------+------------+--------------------------------------+
| organization_id                      | role_fqn   | user_id                              |
|--------------------------------------+------------+--------------------------------------|
| f6c39580-5719-431d-a508-0cee4f9e8209 | org_member | e4c6e51f-bd56-4d92-bdf8-9947531c3225 |
+--------------------------------------+------------+--------------------------------------+
==> Success: User added to organization.

organizations users list

Usage: croud organizations users list [-h] [--org-id ORG_ID] [--region REGION]
                                      [--output-fmt {table,wide,json,yaml}]
                                      [--sudo]

Optional Arguments

--org-id

The organization ID to use.

--region, -r

Temporarily use the specified region that command will be run in.

--output-fmt, --format, -o

Possible choices: table, wide, json, yaml

Change the formatting of the output.

--sudo

Run the given command as superuser.

Default: False

Example

sh$ croud organizations users list \
    --org-id f6c39580-5719-431d-a508-0cee4f9e8209
+----------------------+--------------------+----------+--------------------------------------+
| email                | organization_roles | username | uid                                  |
|----------------------+--------------------+----------+--------------------------------------|
| john.doe@example.com | org_admin          | john.doe | e4c6e51f-bd56-4d92-bdf8-9947531c3225 |
+----------------------+--------------------+----------+--------------------------------------+

organizations users remove

Usage: croud organizations users remove [-h] --user USER [--org-id ORG_ID]
                                        [--region REGION]
                                        [--output-fmt {table,wide,json,yaml}]
                                        [--sudo]

Required Arguments

--user

The user email address or ID to use.

Optional Arguments

--org-id

The organization ID to use.

--region, -r

Temporarily use the specified region that command will be run in.

--output-fmt, --format, -o

Possible choices: table, wide, json, yaml

Change the formatting of the output.

--sudo

Run the given command as superuser.

Default: False

Example

sh$ croud organizations users remove \
    --org-id f6c39580-5719-431d-a508-0cee4f9e8209 \
    --user john.doe@example.io
==> Success: User removed from organization.

organizations files

Usage: croud organizations files [-h] {get,list,create,delete} ...

organizations files list

Usage: croud organizations files list [-h] --org-id ORG_ID [--region REGION]
                                      [--output-fmt {table,wide,json,yaml}]
                                      [--sudo]

Required Arguments

--org-id

The organization ID to use.

Optional Arguments

--region, -r

Temporarily use the specified region that command will be run in.

--output-fmt, --format, -o

Possible choices: table, wide, json, yaml

Change the formatting of the output.

--sudo

Run the given command as superuser.

Default: False

Example

sh$ croud organizations files list \
    --org-id f6c39580-5719-431d-a508-0cee4f9e8209
+--------------------------------------+---------------------+----------+
| id                                   | name                | status   |
|--------------------------------------+---------------------+----------|
| 9b5d438f-036c-410f-b6f4-9adfb1feb252 | nyc_taxi            | UPLOADED |
+--------------------------------------+---------------------+----------+

organizations files delete

Usage: croud organizations files delete [-h] --org-id ORG_ID --file-id FILE_ID
                                        [--region REGION]
                                        [--output-fmt {table,wide,json,yaml}]
                                        [--sudo]

Required Arguments

--org-id

The organization ID to use.

--file-id

The ID of the file.

Optional Arguments

--region, -r

Temporarily use the specified region that command will be run in.

--output-fmt, --format, -o

Possible choices: table, wide, json, yaml

Change the formatting of the output.

--sudo

Run the given command as superuser.

Default: False

Example

sh$ croud organizations files delete \
    --org-id f6c39580-5719-431d-a508-0cee4f9e8209 \
    --file-id 327ad0e6-607f-4f99-a4cc-c1e98bf28e4d
==> Success: File upload deleted.

organizations files get

Usage: croud organizations files get [-h] --org-id ORG_ID --file-id FILE_ID
                                     [--region REGION]
                                     [--output-fmt {table,wide,json,yaml}]
                                     [--sudo]

Required Arguments

--org-id

The organization ID to use.

--file-id

The ID of the file.

Optional Arguments

--region, -r

Temporarily use the specified region that command will be run in.

--output-fmt, --format, -o

Possible choices: table, wide, json, yaml

Change the formatting of the output.

--sudo

Run the given command as superuser.

Default: False

Example

sh$ croud organizations files get \
    --org-id f6c39580-5719-431d-a508-0cee4f9e8209 \
    --file-id 327ad0e6-607f-4f99-a4cc-c1e98bf28e4d
+--------------------------------------+----------+----------+-------------+-------------------------------------------------------------+
| id                                   | name     | status   | file_size   | download_url                                                |
|--------------------------------------+----------+----------+-------------+-------------------------------------------------------------|
| 327ad0e6-607f-4f99-a4cc-c1e98bf28e4d | nyc_taxi | UPLOADED | 107.56 MiB  | https://cratedb-file-uploads.s3.amazonaws.com/some/download |
+--------------------------------------+----------+----------+-------------+-------------------------------------------------------------+

organizations secrets

Usage: croud organizations secrets [-h] {list,create,delete} ...

organizations secrets list

Usage: croud organizations secrets list [-h] --org-id ORG_ID [--region REGION]
                                        [--output-fmt {table,wide,json,yaml}]
                                        [--sudo]

Required Arguments

--org-id

The organization ID to use.

Optional Arguments

--region, -r

Temporarily use the specified region that command will be run in.

--output-fmt, --format, -o

Possible choices: table, wide, json, yaml

Change the formatting of the output.

--sudo

Run the given command as superuser.

Default: False

Example

sh$ croud organizations secrets list \
    --org-id f6c39580-5719-431d-a508-0cee4f9e8209
+--------------------------------------+--------+----------+------------------+
| id                                   | type   | name     | description      |
|--------------------------------------+--------+----------+------------------|
| e9068b31-14f5-4629-b585-70b3b8ae73bf | AWS    | mysecret | **********esskey |
+--------------------------------------+--------+----------+------------------+

organizations secrets delete

Usage: croud organizations secrets delete [-h] --org-id ORG_ID --secret-id
                                          SECRET_ID [--region REGION]
                                          [--output-fmt {table,wide,json,yaml}]
                                          [--sudo]

Required Arguments

--org-id

The organization ID to use.

--secret-id

The secret ID to use.

Optional Arguments

--region, -r

Temporarily use the specified region that command will be run in.

--output-fmt, --format, -o

Possible choices: table, wide, json, yaml

Change the formatting of the output.

--sudo

Run the given command as superuser.

Default: False

Example

sh$ croud organizations secrets delete \
    --org-id f6c39580-5719-431d-a508-0cee4f9e8209 \
    --secret-id e9068b31-14f5-4629-b585-70b3b8ae73bf
==> Success: Secret deleted.

organizations secrets create

Usage: croud organizations secrets create [-h] --org-id ORG_ID --name NAME
                                          --type {AWS,AZURE}
                                          [--access-key ACCESS_KEY]
                                          [--secret-key SECRET_KEY]
                                          [--connection-string CONNECTION_STRING]
                                          [--region REGION]
                                          [--output-fmt {table,wide,json,yaml}]
                                          [--sudo]

Required Arguments

--org-id

The organization ID to use.

--name

The name the secret will be known as.

--type

Possible choices: AWS, AZURE

The type of Secret. Either AWS or Azure.

Optional Arguments

--access-key

For an AWS type secret, the access key ID.

--secret-key

For an AWS type secret, the secret key.

--connection-string

For an Azure type secret, the connection string or URL that grants access to a resource.

--region, -r

Temporarily use the specified region that command will be run in.

--output-fmt, --format, -o

Possible choices: table, wide, json, yaml

Change the formatting of the output.

--sudo

Run the given command as superuser.

Default: False

Example

sh$ croud organizations secrests create \
    --org-id f6c39580-5719-431d-a508-0cee4f9e8209 \
    --name mysecret \
    --type AWS \
    --access-key AKIAUVOXAVYAPIBHQK7I \
    --secret-key mysecretkey
+--------------------------------------+--------+----------+------------------+
| id                                   | type   | name     | description      |
|--------------------------------------+--------+----------+------------------|
| 71e7c5da-51fa-44f2-b178-d95052cbe620 | AWS    | mysecret | **********BHQK7I |
+--------------------------------------+--------+----------+------------------+
==> Success: Secret created.

organizations credits

Usage: croud organizations credits [-h] {list,create,edit,expire} ...

organizations credits list

Usage: croud organizations credits list [-h] --org-id ORG_ID [--status STATUS]
                                        [--region REGION]
                                        [--output-fmt {table,wide,json,yaml}]
                                        [--sudo]

Required Arguments

--org-id

The organization ID to use.

Optional Arguments

--status

Filter credits by status, comma separated. Valid values are ACTIVE and EXPIRED. By default only ACTIVE credits are listed.

--region, -r

Temporarily use the specified region that command will be run in.

--output-fmt, --format, -o

Possible choices: table, wide, json, yaml

Change the formatting of the output.

--sudo

Run the given command as superuser.

Default: False

Example

sh$ croud organizations credits list \
    --org-id f6c39580-5719-431d-a508-0cee4f9e8209
+--------------------------------------+-----------------+------------------+---------------------+------------+----------+
| id                                   | original_amount | remaining_amount | expiration_date     | comment    | status   |
|--------------------------------------+-----------------+------------------+---------------------+------------+----------|
| f8207787-8458-4cab-94c1-4ca84a702154 | $300.0          | $300.0           | 2023-12-24T12:34:56 | Free Trial | ACTIVE   |
+--------------------------------------+-----------------+------------------+---------------------+------------+----------+

organizations credits create

Usage: croud organizations credits create [-h] --org-id ORG_ID --amount AMOUNT
                                          --expiration-date EXPIRATION_DATE
                                          --comment COMMENT [--region REGION]
                                          [--output-fmt {table,wide,json,yaml}]
                                          [--sudo]

Required Arguments

--org-id

The organization ID to use.

--amount

The amount to be credited in USD.

--expiration-date

The expiration date of the credit in ISO 8601 format (i.e. 2024-01-01T10:00:00Z).

--comment

The reason for creating this credit.

Optional Arguments

--region, -r

Temporarily use the specified region that command will be run in.

--output-fmt, --format, -o

Possible choices: table, wide, json, yaml

Change the formatting of the output.

--sudo

Run the given command as superuser.

Default: False

Example

sh$ croud organizations credits create \
    --org-id f6c39580-5719-431d-a508-0cee4f9e8209 \
    --amount 300 \
    --expiration-date 2023-12-24T12:34:56Z \
    --comment "Free Trial" \
    --sudo
+--------------------------------------+-----------------+---------------------+------------+----------+
| id                                   | original_amount | expiration_date     | comment    | status   |
|--------------------------------------+-----------------+---------------------+------------+----------|
| f8207787-8458-4cab-94c1-4ca84a702154 | $300.0          | 2023-12-24T12:34:56 | Free Trial | ACTIVE   |
+--------------------------------------+-----------------+---------------------+------------+----------+
==> Success: Credit created.

Note

This command is only available for superusers.

organizations credits edit

Usage: croud organizations credits edit [-h] --org-id ORG_ID --credit-id
                                        CREDIT_ID [--amount AMOUNT]
                                        [--expiration-date EXPIRATION_DATE]
                                        [--comment COMMENT] [--region REGION]
                                        [--output-fmt {table,wide,json,yaml}]
                                        [--sudo]

Required Arguments

--org-id

The organization ID to use.

--credit-id

The credit ID to use.

Optional Arguments

--amount

The amount to be credited in USD. It can only be increased.

--expiration-date

The expiration date of the credit in ISO 8601 format (i.e. 2024-01-01T10:00:00Z).

--comment

The reason for creating this credit.

--region, -r

Temporarily use the specified region that command will be run in.

--output-fmt, --format, -o

Possible choices: table, wide, json, yaml

Change the formatting of the output.

--sudo

Run the given command as superuser.

Default: False

Example

sh$ croud organizations credits edit \
    --org-id f6c39580-5719-431d-a508-0cee4f9e8209 \
    --credit-id f8207787-8458-4cab-94c1-4ca84a702154
    --amount 500
    --sudo
+--------------------------------------+-----------------+---------------------+------------+----------+
| id                                   | original_amount | expiration_date     | comment    | status   |
|--------------------------------------+-----------------+---------------------+------------+----------|
| f8207787-8458-4cab-94c1-4ca84a702154 | $500.0          | 2023-12-24T12:34:56 | Free Trial | ACTIVE   |
+--------------------------------------+-----------------+---------------------+------------+----------+
==> Success: Credit edited.

Note

This command is only available for superusers.

organizations credits expire

Usage: croud organizations credits expire [-h] --org-id ORG_ID --credit-id
                                          CREDIT_ID [--region REGION]
                                          [--output-fmt {table,wide,json,yaml}]
                                          [--sudo]

Required Arguments

--org-id

The organization ID to use.

--credit-id

The credit ID to use.

Optional Arguments

--region, -r

Temporarily use the specified region that command will be run in.

--output-fmt, --format, -o

Possible choices: table, wide, json, yaml

Change the formatting of the output.

--sudo

Run the given command as superuser.

Default: False

Example

sh$ croud organizations credits expire \
    --org-id f6c39580-5719-431d-a508-0cee4f9e8209 \
    --credit-id f8207787-8458-4cab-94c1-4ca84a702154
    --sudo
==> Success: Credit expired.

Note

This command is only available for superusers.

organizations customer

Usage: croud organizations customer [-h] {get,edit} ...

organizations customer get

Usage: croud organizations customer get [-h] --org-id ORG_ID [--region REGION]
                                        [--output-fmt {table,wide,json,yaml}]
                                        [--sudo]

Required Arguments

--org-id

The organization ID to use.

Optional Arguments

--region, -r

Temporarily use the specified region that command will be run in.

--output-fmt, --format, -o

Possible choices: table, wide, json, yaml

Change the formatting of the output.

--sudo

Run the given command as superuser.

Default: False

Example

sh$ croud organizations customer get \
    --org-id 89dfe980-ea1c-4108-9fa1-2161d2ac6785
+---------+--------------+---------------+----------------------------------------------------------------------------------------------+----------------------+
| name    |        phone | email         | address                                                                                      | tax                  |
|---------+--------------+---------------+----------------------------------------------------------------------------------------------+----------------------|
| Company | +33123456789 | test@crate.io | {"city": "Vienna", "country": "AT", "line1": "street", "line2": null, "postal_code": "1010"} | ATU12345678 (eu_vat) |
+---------+--------------+---------------+----------------------------------------------------------------------------------------------+----------------------+

organizations customer edit

Usage: croud organizations customer edit [-h] --org-id ORG_ID --name NAME
                                         --email EMAIL --phone PHONE --country
                                         COUNTRY --city CITY --line1 LINE1
                                         [--line2 LINE2] --postal-code
                                         POSTAL_CODE [--tax-id TAX_ID]
                                         [--tax-id-type TAX_ID_TYPE]
                                         [--region REGION]
                                         [--output-fmt {table,wide,json,yaml}]
                                         [--sudo]

Required Arguments

--org-id

The organization ID to use.

--name

The organization name.

--email

The customer’s email.

--phone

The customer’s phone number.

--country

Billing address: country.

--city

Billing address: city.

--line1

Billing address: line 1.

--postal-code

Billing address: postal code.

Optional Arguments

--line2

Billing address: line 2.

--tax-id

The customer’s tax ID.

--tax-id-type

The customer’s tax ID type, e.g. ‘vat_eu’.

--region, -r

Temporarily use the specified region that command will be run in.

--output-fmt, --format, -o

Possible choices: table, wide, json, yaml

Change the formatting of the output.

--sudo

Run the given command as superuser.

Default: False

Example

sh$ croud organizations customer edit \
    --org-id 89dfe980-ea1c-4108-9fa1-2161d2ac6785 \
    --name Company \
    --email test@crate.io \
    --phone +33123456789 \
    --country FR \
    --city Paris \
    --line1 street \
    --line2 street \
    --postal-code 75000 \
    --tax-id FRAB123456789 \
    --tax-id-type eu_vat
+---------+--------------+---------------+--------------------------------------------------------------------------------------------------+------------------------+
| name    |        phone | email         | address                                                                                          | tax                    |
|---------+--------------+---------------+--------------------------------------------------------------------------------------------------+------------------------|
| Company | +33123456789 | test@crate.io | {"city": "Paris", "country": "FR", "line1": "street", "line2": "street", "postal_code": "75000"} | FRAB123456789 (eu_vat) |
+---------+--------------+---------------+--------------------------------------------------------------------------------------------------+------------------------+
==> Success: Organization's customer info edited.