Skip to content

Commit d5082dd

Browse files
committed
add mt list, list tenant plans
1 parent 21ce1e2 commit d5082dd

File tree

3 files changed

+50
-9
lines changed

3 files changed

+50
-9
lines changed

api/4/tenants.md

Lines changed: 22 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -12,13 +12,13 @@ The Tenants API **requires** a key which can be generated using the [Tenants CLI
1212

1313
## Request signing
1414

15-
Requests to the Tenants API **must** be signed by passing the `X-Signature` header containing a base64-encoded signature of the request body.
15+
Requests to the Tenants API **must** be signed by passing the `X-Signature` header containing the request signature.
1616

1717
```plain
1818
X-Signature: request_signature_here
1919
```
2020

21-
Signatures must be generated using the raw request body string and the [Tenants Private Key](../../application/configuration/multitenancy.md#tenants-key-pair).
21+
Signatures must be generated using the raw request body string and the [Tenants Private Key](../../application/configuration/multitenancy.md#tenants-key-pair), with base64 encoding.
2222

2323
```php
2424
$signed = $privateKey->sign($body);
@@ -27,6 +27,17 @@ $signature = base64_encode($signed);
2727

2828
## `/_/api/4/tenants`
2929

30+
### GET `/_/api/4/tenants`
31+
32+
`200` List all tenants.
33+
34+
```sh
35+
curl -X GET "/_/api/4/tenants" \
36+
-H "Content-Type: application/json" \
37+
-H "X-API-Key: your_api_key" \
38+
-H "X-Signature: request_signature" \
39+
```
40+
3041
### POST `/_/api/4/tenants`
3142

3243
`201` Create a new tenant.
@@ -56,9 +67,9 @@ curl -X POST "/_/api/4/tenants" \
5667

5768
```
5869

59-
## `/_/api/4/tenants/{tenantId}`
70+
## `/_/api/4/tenants/{id}`
6071

61-
### GET `/_/api/4/tenants/{tenantId}`
72+
### GET `/_/api/4/tenants/{id}`
6273

6374
`200` Retrieve tenant details.
6475

@@ -69,7 +80,7 @@ curl -X GET "/_/api/4/tenants/tenant123" \
6980
-H "X-Signature: request_signature" \
7081
```
7182

72-
### PATCH `/_/api/4/tenants/{tenantId}`
83+
### PATCH `/_/api/4/tenants/{id}`
7384

7485
`204` Edit tenant information.
7586

@@ -94,7 +105,7 @@ curl -X PATCH "/_/api/4/tenants/tenant123" \
94105
}'
95106
```
96107

97-
### DELETE `/_/api/4/tenants/{tenantId}`
108+
### DELETE `/_/api/4/tenants/{id}`
98109

99110
`204` Delete a tenant.
100111

@@ -139,7 +150,9 @@ curl -X POST "/_/api/4/tenants-plans" \
139150
}'
140151
```
141152

142-
### GET: `/_/api/4/tenants-plans/{planId}`
153+
## `/_/api/4/tenants-plans/{id}`
154+
155+
### GET: `/_/api/4/tenants-plans/{id}`
143156

144157
`200` Retrieve tenant plan details.
145158

@@ -150,7 +163,7 @@ curl -X GET "/_/api/4/tenants-plans/basic_plan" \
150163
-H "X-Signature: request_signature" \
151164
```
152165

153-
### PATCH: `/_/api/4/tenants-plans/{planId}`
166+
### PATCH: `/_/api/4/tenants-plans/{id}`
154167

155168
`204` Edit tenant plan information.
156169

@@ -170,7 +183,7 @@ curl -X PATCH "/_/api/4/tenants-plans/basic_plan" \
170183
}'
171184
```
172185

173-
### DELETE `/_/api/4/tenants-plans/{planId}`
186+
### DELETE `/_/api/4/tenants-plans/{id}`
174187

175188
`204` Delete a tenant plan.
176189

application/configuration/multitenancy.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -216,6 +216,14 @@ app/bin/tenants -C create \
216216

217217
Command above creates tenant `tenant1` associated with the hostname `example.com`, enabled, with plan `my-plan`.
218218

219+
### Listing tenants
220+
221+
Use [list](../../application/reference/cli.md#list-tenants):
222+
223+
```sh
224+
app/bin/tenants -C list
225+
```
226+
219227
### Installing Chevereto
220228

221229
After creating a tenant, the application requires to [setup](../../application/installing/installation.md#setup), which can be made via CLI or HTTP.

application/reference/cli.md

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -303,6 +303,26 @@ app/bin/tenants -C create \
303303
| limits | (optional) Tenant limits JSON |
304304
| env | (optional) Tenant environment JSON |
305305

306+
### Get tenant
307+
308+
The `get` command retrieves an existing tenant in the Chevereto infrastructure.
309+
310+
```sh
311+
app/bin/tenants -C get --id 1
312+
```
313+
314+
| Option | Description |
315+
| ------ | ----------- |
316+
| id | Tenant ID |
317+
318+
### List tenants
319+
320+
The `list` command outputs the list of tenants in the Chevereto infrastructure.
321+
322+
```sh
323+
app/bin/tenants -C list
324+
```
325+
306326
### Edit tenant
307327

308328
The `edit` command modifies an existing tenant in the Chevereto infrastructure.

0 commit comments

Comments
 (0)