s3.php¶
S3 storage management module: creating and deleting accounts, managing buckets and files, retrieving usage statistics, managing tariff plans, and billing.
API Methods¶
| Method | Action | Description |
|---|---|---|
create_account | create a free S3 account | Creates a free S3 account for a client with the specified plan and location, creates a bucket, and initializes counters. |
create_bucket | create a bucket | Creates a new bucket in an existing S3 account. |
create_order | create a paid order | Creates a paid order for S3 storage, creates a service in billing, and creates a user account. |
delete_account | delete S3 account | Completely deletes the user's S3 account and all associated data. |
delete_bucket | delete a bucket | Deletes the specified bucket from the S3 account. |
delete_file | delete a file | Deletes the specified file from the S3 bucket. |
delete_payment_account | delete a paid account | Sets the termination date for a paid S3 account. |
get_buckets | get bucket list (AWS) | Returns the user's bucket list via the AWS API, including traffic and snapshot information. |
get_buckets_rmq | get bucket list (RMQ) | Returns the bucket list via the message queue (RMQ), including detailed usage statistics and access keys. |
get_files | get file list | Returns a list of files and folders in the specified bucket with pagination and search support. |
get_users | get user list | Returns a list of S3 users with filtering by plan, location, email, and traffic statistics. |
history | get plan history | Returns the change history for the specified tariff plan. |
list_plans | get tariff plan list | Returns a list of available S3 storage tariff plans. |
show_key | get access key | Returns the decrypted access key (access_key or secret_key) for an S3 account. |
s3/cancel_payment_account_deletion¶
Cancels the scheduled deletion of a paid S3 account, restoring its status.
HTTP Method: POST
Parameters:
| Parameter | Required | Type | Description |
|---|---|---|---|
| action | ✅ | string | Method identifier: cancel_payment_account_deletion |
| token | ✅ | string | Authorization token |
| s3uid | ✅ | string | Unique S3 account identifier |
| id | ❌ | int | Client ID (for administrators) |
Example Request
Example of a successful response
s3/create_account¶
Creates a free S3 account for a client with the specified plan and location, creates a bucket, and initializes counters.
HTTP Method: POST
Parameters:
| Parameter | Required | Type | Description |
|---|---|---|---|
| action | ✅ | string | Method identifier: create_account |
| token | ✅ | string | Authorization token |
| plan_id | ✅ | int | Tariff plan ID |
| bucket_name | ✅ | string | Name of the bucket to create |
| location | ✅ | string | Location code (e.g., NL) |
Example Request
Example of a successful response
s3/create_bucket¶
Creates a new bucket in an existing S3 account.
HTTP Method: POST
Parameters:
| Parameter | Required | Type | Description |
|---|---|---|---|
| action | ✅ | string | Method identifier: create_bucket |
| token | ✅ | string | Authorization token |
| s3uid | ✅ | string | Unique S3 account identifier |
| bucket_name | ✅ | string | Name of the bucket to create |
Example Request
Example of a successful response
s3/create_order¶
Creates a paid order for S3 storage, creates a service in billing, and creates a user account.
HTTP Method: POST
Parameters:
| Parameter | Required | Type | Description |
|---|---|---|---|
| action | ✅ | string | Method identifier: create_order |
| token | ✅ | string | Authorization token |
| plan_id | ✅ | int | Tariff plan ID |
| bucket_name | ✅ | string | Name of the bucket to create |
| location | ✅ | string | Location code (e.g., NL) |
Example Request
Example of a successful response
s3/delete_account¶
Completely deletes the user's S3 account and all associated data.
HTTP Method: POST
Parameters:
| Parameter | Required | Type | Description |
|---|---|---|---|
| action | ✅ | string | Method identifier: delete_account |
| token | ✅ | string | Authorization token |
| s3uid | ✅ | string | Unique S3 account identifier |
Example Request
Example of a successful response
s3/delete_bucket¶
Deletes the specified bucket from the S3 account.
HTTP Method: POST
Parameters:
| Parameter | Required | Type | Description |
|---|---|---|---|
| action | ✅ | string | Method identifier: delete_bucket |
| token | ✅ | string | Authorization token |
| s3uid | ✅ | string | Unique S3 account identifier |
| bucket_name | ✅ | string | Name of the bucket to delete |
Example Request
s3/delete_file¶
Deletes the specified file from the S3 bucket.
HTTP Method: POST
Parameters:
| Parameter | Required | Type | Description |
|---|---|---|---|
| action | ✅ | string | Method identifier: delete_file |
| token | ✅ | string | Authorization token |
| s3uid | ✅ | string | Unique S3 account identifier |
| bucket_name | ✅ | string | Bucket name |
| filename | ✅ | string | Path to the file to delete |
Example Request
Example of a successful response
s3/delete_payment_account¶
Sets the termination date for a paid S3 account.
HTTP Method: POST
Parameters:
| Parameter | Required | Type | Description |
|---|---|---|---|
| action | ✅ | string | Method identifier: delete_payment_account |
| token | ✅ | string | Authorization token |
| s3uid | ✅ | string | Unique S3 account identifier |
Example Request
Example of a successful response
s3/get_buckets¶
Returns the user's bucket list via the AWS API, including traffic and snapshot information.
HTTP Method: POST
Parameters:
| Parameter | Required | Type | Description |
|---|---|---|---|
| action | ✅ | string | Method identifier: get_buckets |
| token | ✅ | string | Authorization token |
| s3uid | ✅ | string | Unique S3 account identifier |
Example Request
Example of a successful response
s3/get_buckets_rmq¶
Returns the bucket list via the message queue (RMQ), including detailed usage statistics and access keys.
HTTP Method: POST
Parameters:
| Parameter | Required | Type | Description |
|---|---|---|---|
| action | ✅ | string | Method identifier: get_buckets_rmq |
| token | ✅ | string | Authorization token |
| s3uid | ✅ | string | Unique S3 account identifier |
Example Request
Example of a successful response
{
"result": "OK",
"action": "get_buckets_rmq",
"message": [
{
"name": "data-bucket",
"usage": 1073741824
}
],
"bandwidth": 204800,
"usage_storage": 1073741824,
"quota": 5368709120,
"snapshots": [
{
"bandwidth_usage": 204800,
"storage_usage": 1073741824,
"created_at": "2023-10-27T10:00:00Z"
}
],
"access_key": "AKIAIOSFODNN7EXAMPLE",
"secret_key": "wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY"
}
s3/get_files¶
Returns a list of files and folders in the specified bucket with pagination and search support.
HTTP Method: POST
Parameters:
| Parameter | Required | Type | Description |
|---|---|---|---|
| action | ✅ | string | Method identifier: get_files |
| token | ✅ | string | Authorization token |
| s3uid | ✅ | string | Unique S3 account identifier |
| bucket_name | ✅ | string | Bucket name |
| continuation_token | ❌ | string | Token for pagination |
| max_keys | ❌ | int | Maximum number of files (up to 100) |
| search | ❌ | string | Search string in file names |
Example Request
Example of a successful response
s3/get_users¶
Returns a list of S3 users with filtering by plan, location, email, and traffic statistics.
HTTP Method: POST
Parameters:
| Parameter | Required | Type | Description |
|---|---|---|---|
| action | ✅ | string | Method identifier: get_users |
| token | ✅ | string | Authorization token |
| id | ❌ | int | Client ID (for admin) |
| plan_id | ❌ | int | Filter by plan ID |
| s3uid | ❌ | string | Filter by S3UID |
| ❌ | string | Filter by email | |
| billing | ❌ | string | Filter by billing location |
| limit | ❌ | int | Record limit |
| order | ❌ | string | Sorting field |
| order_by | ❌ | string | Sorting direction (ASC/DESC) |
| period_from | ❌ | string | Start date for traffic (YYYY-MM-DD) |
| period_to | ❌ | string | End date for traffic (YYYY-MM-DD) |
Example Request
Example of a successful response
{
"result": "OK",
"action": "get_users",
"s3_users": [
{
"id": 123,
"s3uid": "s3-12345",
"email": "[email protected]",
"plan_id": 5,
"location": "NL",
"traffic": 104857600,
"storage_usage": 524288000,
"service": {
"status": "active",
"termination_date": "2024-10-27"
}
}
]
}
s3/history¶
Returns the change history for the specified tariff plan.
HTTP Method: POST
Parameters:
| Parameter | Required | Type | Description |
|---|---|---|---|
| action | ✅ | string | Method identifier: history |
| token | ✅ | string | Authorization token |
| id | ✅ | int | Tariff plan ID |
Example Request
s3/list_plans¶
Returns a list of available S3 storage tariff plans.
HTTP Method: POST
Parameters:
| Parameter | Required | Type | Description |
|---|---|---|---|
| action | ✅ | string | Method identifier: list_plans |
| token | ✅ | string | Authorization token |
| id | ❌ | int | Specific plan ID (for admin) |
Example Request
Example of a successful response
s3/show_key¶
Returns the decrypted access key (access_key or secret_key) for an S3 account.
HTTP Method: POST
Parameters:
| Parameter | Required | Type | Description |
|---|---|---|---|
| action | ✅ | string | Method identifier: show_key |
| token | ✅ | string | Authorization token |
| s3uid | ✅ | string | Unique S3 account identifier |
| s3_key | ✅ | string | Key type: 'access_key' or 'secret_key' |
Example Request