Tenants

Using the tenants command, it is possible to manage tenants.

This command manages tenants.

Usage:
  Permguard authn tenants [flags]
  Permguard authn tenants [command]

Available Commands:
  create      Create a tenant
  delete      Delete a tenant
  list        List tenants
  update      Update a tenant

Flags:
      --zone-id int    zone id
  -h, --help          help for tenants

Global Flags:
  -o, --output string   output format (default "terminal")
  -v, --verbose          true for verbose output
  -w, --workdir string   workdir (default ".")
  -v, --verbose         true for verbose output

Use "Permguard authn tenants [command] --help" for more information about a command.

The output from your current version of Permguard may differ from the example provided on this page.

Create a Tenant

The permguard authn tenants create command allows to create a tenant for the mandatory input zone and name.

permguard authn tenants create --zone-id 273165098782 --name matera-branch

output:

2e190ee712494838bb54d67e2a0c496a: matera-branch
JSON Output
permguard authn tenants create --zone-id 273165098782 --name matera-branch --output json

output:

{
  "tenant": [
    {
      "tenant_id": "2e190ee712494838bb54d67e2a0c496a",
      "created_at": "2024-08-25T14:14:33.794Z",
      "updated_at": "2024-08-25T14:14:33.794Z",
      "zone_id": 273165098782,
      "name": "matera-branch"
    }
  ]
}

Get All Tenant

The permguard authn tenants list command allows for the retrieval of all tenants.

permguard authn tenants list --zone-id 273165098782

output:

0f85cbd14e3f462882f0e09d9f64ff40: london-branch
1fb7c545dce74cb18b2e4896d3e9a96e: leeds-branch
2e190ee712494838bb54d67e2a0c496a: matera-branch
51548dac972c4df183b312a3b665e8e2: pisa-branch
59c3f233d0a0447fb2a977ad9605d12c: bari-branch
aca65c4dea4d488ab5a52b63b0ba25ef: milan-branch
ec40fe0ce651404a8cc0e4ab1e386053: birmingham-branch
JSON Output
permguard authn tenants list --zone-id 273165098782 --output json

output:

{
  "tenant": [
    {
      "tenant_id": "0f85cbd14e3f462882f0e09d9f64ff40",
      "created_at": "2024-08-25T14:16:43.778Z",
      "updated_at": "2024-08-25T14:16:43.778Z",
      "zone_id": 273165098782,
      "name": "london-branch"
    },
    {
      "tenant_id": "1fb7c545dce74cb18b2e4896d3e9a96e",
      "created_at": "2024-08-25T14:16:44.802Z",
      "updated_at": "2024-08-25T14:16:44.802Z",
      "zone_id": 273165098782,
      "name": "leeds-branch"
    },
    {
      "tenant_id": "2e190ee712494838bb54d67e2a0c496a",
      "created_at": "2024-08-25T14:14:33.794Z",
      "updated_at": "2024-08-25T14:14:33.794Z",
      "zone_id": 273165098782,
      "name": "matera-branch"
    },
    {
      "tenant_id": "51548dac972c4df183b312a3b665e8e2",
      "created_at": "2024-08-25T14:16:41.657Z",
      "updated_at": "2024-08-25T14:16:41.657Z",
      "zone_id": 273165098782,
      "name": "pisa-branch"
    },
    {
      "tenant_id": "59c3f233d0a0447fb2a977ad9605d12c",
      "created_at": "2024-08-25T14:16:42.753Z",
      "updated_at": "2024-08-25T14:16:42.753Z",
      "zone_id": 273165098782,
      "name": "bari-branch"
    },
    {
      "tenant_id": "aca65c4dea4d488ab5a52b63b0ba25ef",
      "created_at": "2024-08-25T14:16:40.585Z",
      "updated_at": "2024-08-25T14:16:40.585Z",
      "zone_id": 273165098782,
      "name": "milan-branch"
    },
    {
      "tenant_id": "ec40fe0ce651404a8cc0e4ab1e386053",
      "created_at": "2024-08-25T14:16:45.815Z",
      "updated_at": "2024-08-25T14:16:45.815Z",
      "zone_id": 273165098782,
      "name": "birmingham-branch"
    }
  ]
}