Hi. With a brand-new install, the order of operati...
# prefect-server
s
Hi. With a brand-new install, the order of operations is 1.
prefect backend server
2.
prefect server start
If I don't want "default" displayed on the UI (i.e. I just need one tenant, but don't want it named "default"), I need to add a new tenant. This is done through 3.
prefect server create-tenant --name "Some Other Name"
This now creates a new, additional, tenant. I only need one... Ideally, the steps would be, from above, 1 then 3 then 2. However, that order doesn't work because the server (database) has to be up for cmd 3 to work. Would it be useful to have the default tenant name as optional argument to
prefect server start
? Or am I missing something w.r.t. the creation of my tenant?
z
Hey @Stéphan Taljaard -- since this is your own deployment you can just connect to the psql database and modify the existing tenant name at any time
There are some other deployment patterns for Server (such as the helm chart) which expose this, so perhaps it's worth adding a
--skip-create-tenant
flag to
prefect server start
allowing you to create your own tenant after words.
s
Great. I was trying my hand at GraphQL now to delete the "default" tenant, but I think renaming is a all-round better option. Thanks. When I get a chance, I'll see if I can submit a
--skip-create-tenant
change to the repo.
n
You can also update the tenant name and slug directly from the Interactive API using this:
Copy code
mutation UpdateTenant($name: String!, $slug: String!) {
  update_tenant_name(input: { name: $name }) {
    id
  }
  update_tenant_slug(input: { slug: $slug }) {
    id
  }
}
or by going to the "Account" page under the Team menu and setting those from the Profile tile
🙌 1
s
@nicholas seems some changes to your mutation is required.
Copy code
mutation UpdateTenant($tenant_id: String!, $name: String!, $slug: String!) {
  update_tenant_name(input: { tenant_id: $tenant_id, name: $name }) {
    id
  }
  update_tenant_slug(input: { tenant_id: $tenant_id, slug: $slug }) {
    id
  }
}
I'm just struggling now to pass the id in variable as type UUID. Can you point me in the right direction on how to cast as uuid?
"Variable \"$tenant_id\" of type \"String!\" used in position expecting type \"UUID!\".",
n
Hi @Stéphan Taljaard - try this:
Copy code
mutation UpdateTenant($tenant_id: UUID!, $name: String!, $slug: String!) {
  update_tenant_name(input: { tenant_id: $tenant_id, name: $name }) {
    id
  }
  update_tenant_slug(input: { tenant_id: $tenant_id, slug: $slug }) {
    id
  }
}
1