Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remote API documentation #13

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions pterodactyl/remote/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

This API is used for Wings communication and is primarily for Wings, but can be accessed externally. This API is not documented so there is very little information about it.

# Access
## Access

Unknown.
The `Authorization` header must be present in the requests and must be prefixed with "Bearer " followed by the node's token_id, a period, then the node's token. The token can be obtained in the configuration page of a node in the admin panel, or from the [node configuration endpoint](/pterodactyl/application/nodes.md#get-nodesidconfiguration) in the application API.

WIP. Add more information about headers here.
72 changes: 72 additions & 0 deletions pterodactyl/remote/server_backups.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
### `GET /api/remote/backups/:backup`

Returns the required presigned urls to upload a backup to S3 cloud storage.

### Parameters

| Name | Visibility | Description |
| --------- | ---------- | ------------------------------- |
| size | optional | The amount of backup URLs to give. |

### Responses

WIP.

Sources

- [app/Http/Controllers/Api/Remote/Backups/BackupRemoteUploadController.php#L33](https://github.com/pterodactyl/panel/blob/v1.11.3/app/Http/Controllers/Api/Remote/Backups/BackupRemoteUploadController.php#L33)

### `POST /api/remote/backups/:backup`

Handles updating the state of a backup.

### Body

| Name | Visibility | Type | Description |
| ----- | ---------- | ------ | -------------------------------------------- |
| data | required | object | An object containing the checksum, checksum type, backup size, success state, and parts of the backup. |

### Example Body

```json
{
"data": {
"checksum": string,
"checksum_type": string,
"size": number,
"successful", boolean,
"parts": [
{
"etag": string,
"part_number": number,
}
]
}
}
```

### Responses

WIP.

Sources

- [app/Http/Controllers/Api/Remote/Backups/BackupStatusController.php#L31](https://github.com/pterodactyl/panel/blob/v1.11.3/app/Http/Controllers/Api/Remote/Backups/BackupStatusController.php#L31)

### `POST /api/remote/backups/:backup/restore`

Handles toggling the restoration status of a server.

### Body

| Name | Visibility | Type | Description |
| ----- | ---------- | ------ | -------------------------------------------- |
| successful | required | boolean | The success state of the backup restoration. |

### Responses

WIP.

Sources

- [app/Http/Controllers/Api/Remote/Backups/BackupStatusController.php#L78](https://github.com/pterodactyl/panel/blob/v1.11.3/app/Http/Controllers/Api/Remote/Backups/BackupStatusController.php#L78)
42 changes: 42 additions & 0 deletions pterodactyl/remote/server_installation.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
### `GET /api/remote/servers/:uuid`

Returns details about the server that allows Wings to self-recover and ensure that the state of the server matches the Panel at all times.

### Responses

WIP.

Sources

- [app/Http/Controllers/Api/Remote/Servers/ServerDetailsController.php#L35](https://github.com/pterodactyl/panel/blob/v1.11.3/app/Http/Controllers/Api/Remote/Servers/ServerDetailsController.php#L35)

### `GET /api/remote/servers/:uuid/install`

Returns installation information for a server.

### Responses

WIP.

Sources

- [app/Http/Controllers/Api/Remote/Servers/ServerInstallController.php#L30](https://github.com/pterodactyl/panel/blob/v1.11.3/app/Http/Controllers/Api/Remote/Servers/ServerInstallController.php#L30)

### `POST /api/remote/servers/:uuid/install`

Updates the installation state of a server.

### Body

| Name | Visibility | Type | Description |
| ----- | ---------- | ------ | -------------------------------------------- |
| successful | required | boolean | Notifies the server has completed the installation process. |
| reinstall | required | boolean | The state of the server. |

### Responses

WIP.

Sources

- [app/Http/Controllers/Api/Remote/Servers/ServerInstallController.php#L48](https://github.com/pterodactyl/panel/blob/v1.11.3/app/Http/Controllers/Api/Remote/Servers/ServerInstallController.php#L48)
23 changes: 23 additions & 0 deletions pterodactyl/remote/server_transfer.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
### `POST /api/remote/servers/:uuid/transfer/success`

The daemon notifies the panel about a transfer success.

### Responses

WIP.

Sources

- [app/Http/Controllers/Api/Remote/Servers/ServerTransferController.php#L50](https://github.com/pterodactyl/panel/blob/v1.11.3/app/Http/Controllers/Api/Remote/Servers/ServerTransferController.php#L50)

### `POST /api/remote/servers/:uuid/transfer/failure`

The daemon notifies the panel about a transfer failure.

### Responses

WIP.

Sources

- [app/Http/Controllers/Api/Remote/Servers/ServerTransferController.php#L34](https://github.com/pterodactyl/panel/blob/v1.11.3/app/Http/Controllers/Api/Remote/Servers/ServerTransferController.php#L34)
68 changes: 68 additions & 0 deletions pterodactyl/remote/servers.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
### `GET /api/remote/servers`

Lists all servers with their configurations that are assigned to the requesting node.

### Parameters

| Name | Visibility | Description |
| --------- | ---------- | ------------------------------- |
| page | optional | The page to list. |
| per_page | optional | The amount of servers to list. |

### Responses

WIP.

Sources

- [https://github.com/pterodactyl/panel/blob/v1.11.3/app/Http/Controllers/Api/Remote/Servers/ServerDetailsController.php#L49](app/Http/Controllers/Api/Remote/Servers/ServerDetailsController.php#L49)

---

### `POST /api/remote/servers/reset`

Resets the state of all servers on the node to be normal.

### Responses

WIP.

Sources

- [app/Http/Controllers/Api/Remote/Servers/ServerDetailsController.php#L72](https://github.com/pterodactyl/panel/blob/v1.11.3/app/Http/Controllers/Api/Remote/Servers/ServerDetailsController.php#L72)

---

### `POST /api/remote/activity`

### Body

| Name | Visibility | Type | Description |
| ----- | ---------- | ------ | -------------------------------------------- |
| data | required | array | An array with all server activity data. |

### Example Body

```json
{
"data": [
{
"server": string,
"event": string,
"timestamp": string, // timestamp
"metadata": , // null, string or json blob with event specific metadata (it depends)
"ip": string, // ip address or empty string
"user": string, // user uuid or empty string
},
...
]
}
```

### Responses

WIP.

Sources

- [app/Http/Controllers/Api/Remote/ActivityProcessingController.php#L20](https://github.com/pterodactyl/panel/blob/v1.11.3/app/Http/Controllers/Api/Remote/ActivityProcessingController.php#L20)
19 changes: 19 additions & 0 deletions pterodactyl/remote/sftp.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
### `POST /api/remote/sftp/auth`

Authenticate a set of credentials and return the associated server details for a SFTP connection on the daemon. This supports both public key and password based credentials.

### Body

| Name | Visibility | Type | Description |
| ----- | ---------- | ------ | -------------------------------------------- |
| type | required | string | Determine if the password should check authentication with either the "public_key" or "ssh_key". |
| username | required | string | The username of the user attempting to login. |
| password | required | string | The password of the user attempting to login. |

### Responses

WIP.

Sources

- [app/Http/Controllers/Api/Remote/SftpAuthenticationController.php#L34](https://github.com/pterodactyl/panel/blob/v1.11.3/app/Http/Controllers/Api/Remote/SftpAuthenticationController.php#L34)