2020-04-28 18:06:59 +01:00
|
|
|
# satellite/admin
|
|
|
|
|
|
|
|
Satellite Admin package provides API endpoints for administrative tasks.
|
|
|
|
|
|
|
|
Requires setting `Authorization` header for requests.
|
|
|
|
|
2020-10-20 00:35:54 +01:00
|
|
|
## User Management
|
|
|
|
|
|
|
|
### POST /api/user
|
2020-05-18 21:37:18 +01:00
|
|
|
|
|
|
|
Adds a new user.
|
|
|
|
|
2020-06-13 17:33:08 +01:00
|
|
|
An example of a required request body:
|
2020-05-18 21:37:18 +01:00
|
|
|
|
|
|
|
```json
|
|
|
|
{
|
|
|
|
"email": "alice@mail.test",
|
|
|
|
"fullName": "Alice Test",
|
|
|
|
"password": "password"
|
|
|
|
}
|
|
|
|
```
|
|
|
|
|
2020-06-13 17:33:08 +01:00
|
|
|
A successful response body:
|
2020-05-18 21:37:18 +01:00
|
|
|
|
|
|
|
```json
|
|
|
|
{
|
|
|
|
"id": "12345678-1234-1234-1234-123456789abc",
|
|
|
|
"email": "alice@mail.test",
|
|
|
|
"fullName": "Alice Test",
|
|
|
|
"shortName": "",
|
|
|
|
"passwordHash": ""
|
|
|
|
}
|
|
|
|
```
|
|
|
|
|
2020-10-20 00:35:54 +01:00
|
|
|
### PUT /api/user/{user-email}
|
2020-05-20 10:20:04 +01:00
|
|
|
|
|
|
|
Updates the details of existing user found by its email.
|
|
|
|
|
2020-10-02 23:40:15 +01:00
|
|
|
Some example request bodies:
|
|
|
|
|
|
|
|
```json
|
|
|
|
{
|
|
|
|
"email": "alice+2@mail.test"
|
|
|
|
}
|
|
|
|
```
|
2020-05-20 10:20:04 +01:00
|
|
|
|
|
|
|
```json
|
|
|
|
{
|
|
|
|
"email": "alice+2@mail.test",
|
2020-10-02 23:40:15 +01:00
|
|
|
"shortName": "myNickName"
|
|
|
|
}
|
|
|
|
```
|
|
|
|
|
|
|
|
```json
|
|
|
|
{
|
|
|
|
"projectLimit": 200
|
2020-05-20 10:20:04 +01:00
|
|
|
}
|
|
|
|
```
|
|
|
|
|
2020-10-20 00:35:54 +01:00
|
|
|
### GET /api/user/{user-email}
|
2020-04-28 18:06:59 +01:00
|
|
|
|
|
|
|
This endpoint returns information about user and their projects.
|
|
|
|
|
2020-06-13 17:33:08 +01:00
|
|
|
A successful response body:
|
2020-04-28 18:06:59 +01:00
|
|
|
|
|
|
|
```json
|
|
|
|
{
|
|
|
|
"user":{
|
|
|
|
"id": "12345678-1234-1234-1234-123456789abc",
|
|
|
|
"fullName": "Alice Bob",
|
2020-10-02 23:40:15 +01:00
|
|
|
"email":"alice@example.test",
|
|
|
|
"projectLimit": 10
|
2020-04-28 18:06:59 +01:00
|
|
|
},
|
|
|
|
"projects":[
|
|
|
|
{
|
|
|
|
"id": "abcabcab-1234-abcd-abcd-abecdefedcab",
|
|
|
|
"name": "Project",
|
|
|
|
"description": "Project to store data.",
|
|
|
|
"ownerId": "12345678-1234-1234-1234-123456789abc"
|
|
|
|
}
|
2020-05-19 11:36:13 +01:00
|
|
|
],
|
|
|
|
"coupons": [
|
|
|
|
{
|
|
|
|
"id": "2fcdbb8f-8d4d-4e6d-b6a7-8aaa1eba4c89",
|
|
|
|
"userId": "12345678-1234-1234-1234-123456789abc",
|
|
|
|
"duration": 2,
|
|
|
|
"amount": 3000,
|
|
|
|
"description": "promotional coupon (valid for 2 billing cycles)",
|
2020-06-13 17:33:08 +01:00
|
|
|
"type": 0,
|
2020-05-19 11:36:13 +01:00
|
|
|
"status": 0,
|
|
|
|
"created": "2020-05-19T00:34:13.265761+02:00"
|
|
|
|
}
|
2020-04-28 18:06:59 +01:00
|
|
|
]
|
|
|
|
}
|
|
|
|
```
|
|
|
|
|
2020-10-20 00:35:54 +01:00
|
|
|
### DELETE /api/user/{user-email}
|
2020-07-06 22:31:40 +01:00
|
|
|
|
|
|
|
Deletes the user.
|
|
|
|
|
2020-10-20 00:35:54 +01:00
|
|
|
## Coupon Management
|
|
|
|
|
|
|
|
### POST /api/coupon
|
2020-05-19 11:36:13 +01:00
|
|
|
|
|
|
|
Adds a coupon for specific user.
|
|
|
|
|
2020-06-13 17:33:08 +01:00
|
|
|
An example of a required request body:
|
2020-05-19 11:36:13 +01:00
|
|
|
|
|
|
|
```json
|
|
|
|
{
|
|
|
|
"userId": "12345678-1234-1234-1234-123456789abc",
|
|
|
|
"duration": 2,
|
|
|
|
"amount": 3000,
|
|
|
|
"description": "promotional coupon (valid for 2 billing cycles)"
|
|
|
|
}
|
|
|
|
```
|
|
|
|
|
2020-06-13 17:33:08 +01:00
|
|
|
A successful response body:
|
|
|
|
|
2020-05-19 11:36:13 +01:00
|
|
|
```json
|
|
|
|
{
|
|
|
|
"id": "2fcdbb8f-8d4d-4e6d-b6a7-8aaa1eba4c89"
|
|
|
|
}
|
|
|
|
```
|
|
|
|
|
2020-10-20 00:35:54 +01:00
|
|
|
### GET /api/coupon/{coupon-id}
|
2020-05-19 11:36:13 +01:00
|
|
|
|
|
|
|
Gets a coupon with the specified id.
|
|
|
|
|
2020-06-13 17:33:08 +01:00
|
|
|
A successful response body:
|
2020-05-19 11:36:13 +01:00
|
|
|
|
|
|
|
```json
|
|
|
|
{
|
|
|
|
"id": "2fcdbb8f-8d4d-4e6d-b6a7-8aaa1eba4c89",
|
|
|
|
"userId": "12345678-1234-1234-1234-123456789abc",
|
|
|
|
"duration": 2,
|
|
|
|
"amount": 3000,
|
|
|
|
"description": "promotional coupon (valid for 2 billing cycles)",
|
2020-06-13 17:33:08 +01:00
|
|
|
"type": 0,
|
2020-05-19 11:36:13 +01:00
|
|
|
"status": 0,
|
|
|
|
"created": "2020-05-19T00:34:13.265761+02:00"
|
|
|
|
}
|
|
|
|
```
|
|
|
|
|
2020-10-20 00:35:54 +01:00
|
|
|
### DELETE /api/coupon/{coupon-id}
|
2020-05-19 13:49:44 +01:00
|
|
|
|
|
|
|
Deletes the specified coupon.
|
|
|
|
|
2020-10-20 00:35:54 +01:00
|
|
|
## Project Management
|
|
|
|
|
|
|
|
### POST /api/project
|
|
|
|
|
|
|
|
Adds a project for specific user.
|
|
|
|
|
|
|
|
An example of a required request body:
|
|
|
|
|
|
|
|
```json
|
|
|
|
{
|
|
|
|
"ownerId": "ca7aa0fb-442a-4d4e-aa36-a49abddae837",
|
|
|
|
"projectName": "My Second Project"
|
|
|
|
}
|
|
|
|
```
|
|
|
|
|
|
|
|
A successful response body:
|
|
|
|
|
|
|
|
```json
|
|
|
|
{
|
|
|
|
"projectId": "ca7aa0fb-442a-4d4e-aa36-a49abddae646"
|
|
|
|
}
|
|
|
|
```
|
|
|
|
|
|
|
|
### GET /api/project/{project-id}/usage
|
2020-08-13 13:40:05 +01:00
|
|
|
|
|
|
|
This endpoint returns whether the project has outstanding usage or not.
|
|
|
|
|
|
|
|
A project with not usage returns status code 200 and `{"result":"no project usage exist"}`.
|
|
|
|
|
2020-10-20 00:35:54 +01:00
|
|
|
### GET /api/project/{project-id}/limit
|
2020-04-28 18:06:59 +01:00
|
|
|
|
|
|
|
This endpoint returns information about project limits.
|
|
|
|
|
2020-06-13 17:33:08 +01:00
|
|
|
A successful response body:
|
2020-04-28 18:06:59 +01:00
|
|
|
|
|
|
|
```json
|
|
|
|
{
|
2020-05-27 07:22:45 +01:00
|
|
|
"usage": {
|
|
|
|
"amount": "1.0 TB",
|
|
|
|
"bytes": 1000000000000
|
|
|
|
},
|
|
|
|
"bandwidth": {
|
|
|
|
"amount": "1.0 TB",
|
|
|
|
"bytes": 1000000000000
|
|
|
|
},
|
|
|
|
"rate": {
|
|
|
|
"rps": 0
|
|
|
|
}
|
2020-04-28 18:06:59 +01:00
|
|
|
}
|
|
|
|
```
|
|
|
|
|
2020-10-20 00:35:54 +01:00
|
|
|
### POST /api/project/{project-id}/limit?usage={value}
|
2020-04-28 18:06:59 +01:00
|
|
|
|
|
|
|
Updates usage limit for a project.
|
|
|
|
|
2020-10-20 00:35:54 +01:00
|
|
|
### POST /api/project/{project-id}/limit?bandwidth={value}
|
2020-05-27 07:22:45 +01:00
|
|
|
|
|
|
|
Updates bandwidth limit for a project.
|
|
|
|
|
2020-10-20 00:35:54 +01:00
|
|
|
### POST /api/project/{project-id}/limit?rate={value}
|
2020-04-28 18:06:59 +01:00
|
|
|
|
2020-05-11 17:05:36 +01:00
|
|
|
Updates rate limit for a project.
|
|
|
|
|
2020-10-20 00:35:54 +01:00
|
|
|
### POST /api/project/{project-id}/limit?buckets={value}
|
2020-07-15 15:14:56 +01:00
|
|
|
|
|
|
|
Updates bucket limit for a project.
|
|
|
|
|
2020-10-20 00:35:54 +01:00
|
|
|
### GET /api/project/{project-id}
|
2020-09-05 20:17:18 +01:00
|
|
|
|
|
|
|
Gets the common information about a project.
|
|
|
|
|
2020-10-20 00:35:54 +01:00
|
|
|
### PUT /api/project/{project-id}
|
2020-07-06 21:28:49 +01:00
|
|
|
|
|
|
|
Updates project name or description.
|
|
|
|
|
|
|
|
```json
|
|
|
|
{
|
|
|
|
"projectName": "My new Project Name",
|
|
|
|
"description": "My new awesome description!"
|
|
|
|
}
|
|
|
|
```
|
|
|
|
|
2020-10-20 00:35:54 +01:00
|
|
|
### DELETE /api/project/{project-id}
|
2020-05-18 18:36:09 +01:00
|
|
|
|
|
|
|
Deletes the project.
|
|
|
|
|
2020-10-20 00:35:54 +01:00
|
|
|
### POST /api/project/{project}/apikey
|
2020-05-11 17:05:36 +01:00
|
|
|
|
2020-10-20 00:35:54 +01:00
|
|
|
Adds an apikey for specific project.
|
2020-05-11 17:05:36 +01:00
|
|
|
|
2020-06-13 17:33:08 +01:00
|
|
|
An example of a required request body:
|
2020-05-11 17:05:36 +01:00
|
|
|
|
|
|
|
```json
|
|
|
|
{
|
2020-10-20 00:35:54 +01:00
|
|
|
"name": "My first API Key"
|
2020-05-11 17:05:36 +01:00
|
|
|
}
|
|
|
|
```
|
2020-10-20 00:35:54 +01:00
|
|
|
**Note:** Additionally you can specify `partnerId` to associate it with the given apikey.
|
|
|
|
If you specify it, it has to be a valid uuid and not an empty string.
|
2020-05-11 17:05:36 +01:00
|
|
|
|
2020-06-13 17:33:08 +01:00
|
|
|
A successful response body:
|
2020-05-11 17:05:36 +01:00
|
|
|
|
|
|
|
```json
|
|
|
|
{
|
2020-10-20 00:35:54 +01:00
|
|
|
"apikey": "13YqdMKxAVBamFsS6Mj3sCQ35HySoA254xmXCCQGJqffLnqrBaQDoTcCiCfbkaFPNewHT79rrFC5XRm4Z2PENtRSBDVNz8zcjS28W5v"
|
2020-05-11 17:05:36 +01:00
|
|
|
}
|
2020-05-14 13:50:58 +01:00
|
|
|
```
|
2020-10-20 00:35:54 +01:00
|
|
|
|
|
|
|
### DELETE /api/project/{project}/apikey/{name}
|
|
|
|
|
|
|
|
Deletes the given apikey by its name.
|
|
|
|
|
|
|
|
## APIKey Management
|
|
|
|
|
|
|
|
### DELETE /api/apikey/{apikey}
|
|
|
|
|
|
|
|
Deletes the given apikey.
|