Unverified Commit 06af028a authored by Lucas Sartor Chauvin's avatar Lucas Sartor Chauvin Committed by GitHub
Browse files

Add documentation for instances.get and licenses.* rest-api endpoints (#1852)

parent cf98c103
......@@ -26,6 +26,7 @@ When calling a production Rocket.Chat server, ensure it is running via HTTPS and
| `/api/v1/spotlight` | Searches for users or rooms that are visible to the user. | [Link](methods/miscellaneous/spotlight.md) |
| `/api/v1/statistics` | Statistics about the Rocket.Chat server. | [Link](methods/miscellaneous/statistics.md) |
| `/api/v1/statistics.list` | Selectable statistics about the Rocket.Chat server. | [Link](methods/miscellaneous/statistics-list.md) |
| `/api/v1/instances.get` | Gets all running instances. | [Link](methods/miscellaneous/instances-get.md) |
### Assets
......@@ -352,6 +353,12 @@ When calling a production Rocket.Chat server, ensure it is running via HTTPS and
| :--- | :--- | :--- |
| `/api/v1/webdav.getMyAccounts` | Retrieves the user's webdav accounts. | [Link](methods/webdav/getmyaccounts.md) |
### Licenses
| Url | Method | Short Description | Details Page |
| :--- | :--- | :--- | :--- |
| `/api/v1/licenses.get` | `GET` | Gets all active licenses. | [Link](methods/licenses/get.md) |
| `/api/v1/licenses.add` | `POST` | Adds a new license. | [Link](methods/licenses/add.md) |
## Language specific wrappers
### Java
......
---
description: REST API Licenses Methods
---
# Licenses
| Url | Method | Short Description | Details Page |
| :--- | :--- | :--- | :--- |
| `/api/v1/licenses.get` | `GET` | Gets all active licenses. | [Link](get.md) |
| `/api/v1/licenses.add` | `POST` | Adds a new license. | [Link](add.md) |
# Add
Adds a new license.
| URL | Requires Auth | Required Permission | HTTP Method |
| :--- | :--- |:--- | :--- |
| `/api/v1/licenses.add` | `yes` | `edit-privileged-setting` | `POST` |
## Payload
| Argument | Example | Required | Description |
| :--- | :--- | :--- | :--- |
| `license` | `k0HVkh8Fs...` | Required | The value of a valid license. |
## Example Call
```bash
curl -H "Content-type:application/json" \
-H "X-Auth-Token: xytlUWJtCuxuDiwBfnoJpPR3qI7FWIB6LZbOKFeiIEu" \
-H "X-User-Id: aobEdbYhXfu5hkeqG" \
http://localhost:3000/api/v1/licenses.get
-d '{"license": "k0HVkh8Fs..."}'
```
## Example Result
```javascript
{
"success": true
}
```
## Change Log
| Version | Description |
| :--- | :--- |
| 3.10 | Added |
# Get
Gets all active licenses.
| URL | Requires Auth | Required Permission | HTTP Method |
| :--- | :--- |:--- | :--- |
| `/api/v1/licenses.get` | `yes` | `view-privileged-setting` | `GET` |
## Example Call
```bash
curl -H "X-Auth-Token: xytlUWJtCuxuDiwBfnoJpPR3qI7FWIB6LZbOKFeiIEu" \
-H "X-User-Id: aobEdbYhXfu5hkeqG" \
http://localhost:3000/api/v1/licenses.get
```
## Example Result
```javascript
{
"licenses": [
{
"url": "localhost:3000",
"expiry": "2021-01-01",
"modules": [
"enterprise:*"
],
"maxActiveUsers": 200,
"maxGuestUsers": 3,
"maxRoomsPerGuest": 10
}
],
"success": true
}
```
## Change Log
| Version | Description |
| :--- | :--- |
| 3.10 | Added |
......@@ -14,4 +14,5 @@ Just some generic information, such as information about the server and authenti
| `/api/v1/spotlight` | Searches for users or rooms that are visible to the user. | [Link](spotlight.md) |
| `/api/v1/statistics` | Statistics about the Rocket.Chat server. | [Link](statistics.md) |
| `/api/v1/statistics.list` | Selectable statistics about the Rocket.Chat server. | [Link](statistics-list.md) |
| `/api/v1/instances.get` | Gets all running instances. | [Link](methods/miscellaneous/instances-get.md) |
# Instances - Get
Gets all running instances.
| URL | Requires Auth | Required Permission | HTTP Method |
| :--- | :--- |:--- | :--- |
| `/api/v1/instances.get` | `yes` | `view-statistics` | `GET` |
## Example Call
```bash
curl -H "X-Auth-Token: xytlUWJtCuxuDiwBfnoJpPR3qI7FWIB6LZbOKFeiIEu" \
-H "X-User-Id: aobEdbYhXfu5hkeqG" \
http://localhost:3000/api/v1/instances.get
```
## Example Result
Result while running only **one** instance.
```javascript
{
"instances": [
{
"_id": "nujL3Zb6wxYfKcRq9",
"_createdAt": "2020-12-29T17:03:19.425Z",
"_updatedAt": "2020-12-29T17:04:59.434Z",
"extraInformation": {
"host": "undefined",
"port": "29703",
"os": {
"type": "Linux",
"platform": "linux",
"arch": "x64",
"release": "4.19.128-microsoft-standard",
"uptime": 11250,
"loadavg": [
1.4970703125,
1.5146484375,
1.48486328125
],
"totalmem": 6594183168,
"freemem": 263098368,
"cpus": 12
},
"nodeVersion": "v12.18.4"
},
"name": "rocket.chat",
"pid": 25877
}
],
"success": true
}
```
## Change Log
| Version | Description |
| :--- | :--- |
| 3.10 | Added |
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment