Create and delete tenants
In this tutorial, you will learn how to create and delete tenants using the EDK CLI, this lesson is applicable if you have been given a tenant_admin role.
To get help with commands for managing tenants, you can use the edk tenant --help command.
Usage: edk tenant [options] [command] <command>
manage tenants
Options:
-h, --help display help for command
Commands:
list [options] list all tenants
switch [options] change tenant context
create [options] <name> create a tenant
delete [options] delate a tenant
usage [options] get data and compute usage for the tenant
user manage tenant users
role manage roles for tenant users
help [command] display help for command
Create a tenant
If you have been provided the tenant_admin role, you create a tenant by running edk tenant create in the command-line. You can get help with the command by running edk tenant create --help.
Run edk tenant create in the command-line, and define a tenant machine-name, which must contain only alphanumeric characters.
edk tenant create MyTenant
You will see the following output if you have been provided the tenant_admin role.
✔ Tenant MyTenant successfully created
Following creation you may want to switch the tenant context to the new tenant by running the following command:
edk tenant switch
Which will result in:
✔ Select a tenant to switch context to › MyTenant
Tenant context successfully updated to XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX
Delete a tenant
If you have been provided the tenant_admin role, you delete a tenant by running edk tenant delete in the command-line, which will apply to the current tenant context. You can get help with the command by running edk tenant delete --help.
Run edk tenant delete in the command-line, and define a tenant machine-name, which must contain only alphanumeric characters.
edk tenant delete
Which will result in the following:
✔ Confirm deletion of tenant MyTenant (XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX) … yes
✔ Tenant XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX successfully deleted
It's important to remember that the tenant command edk tenant delete relates to the current tenant context, take care with deletion because the action may have irreversible effects.
Next steps
In this tutorial you learnt how to create and delete tenants, continue to the next tutorial to learn how to create and delete workspaces.