s3.php¶
S3 storage management module: creating and deleting accounts, managing buckets and files, obtaining usage statistics, managing pricing plans and billing.
API Methods¶
| Method | Action | Description |
|---|---|---|
create_account | create S3 account | Creates a new S3 account (bucket) for the client, links it to a pricing plan, and creates an order in the billing system. |
create_bucket | create S3 bucket | Creates a new S3 bucket for the user. Verifies that s3uid belongs to the current client and creates the bucket via the provider API. |
create_order | create S3 account order | Creates a new S3 account, a bucket, and links it to a pricing plan with automatic payment through billing. |
delete_account | delete account | Deletes the user's S3 account, performing action auditing and logging into history. |
delete_bucket | delete S3 bucket | Deletes the specified bucket from S3 storage if it belongs to the user. |
delete_file | delete file | Deletes the specified file from the user's S3 bucket |
delete_payment_account | delete payment account (subscription cancellation request) | Requests S3 service cancellation and subsequent deletion of the payment account. Returns information about the cancellation date. |
get_buckets | get buckets list | Returns a list of the user's S3 buckets, including bandwidth usage and snapshots information |
get_buckets_rmq | get bucket info via RMQ | Returns a list of the user's buckets, their usage information, billing data, metrics, and S3 access credentials. |
get_files | get S3 files | Returns a list of files and folders in the specified bucket with support for pagination and search. |
get_users | get S3 users list | Returns a list of S3 users with details on traffic, storage, and service data (billing/status) |
history | get history | Returns event history related to a specific S3 account or user |
list_plans | get plans lists | Returns a list of available S3 plans considering user permissions and location. For administrators, it returns the full list; for clients, only active plans with prices in their currency. |
show_key | get S3 access keys | Returns the decrypted secret key or access key for the specified S3 account |
s3/cancel_payment_account_deletion¶
Cancels the service cancellation process for an 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 | User's S3 UID |
Example Request
Example of a successful response
Failure response
``` { "code": -1, "message": "S3 account not found for this customer" }
```
s3/create_account¶
Creates a new S3 account (bucket) for the client, links it to a pricing plan, and creates an order in the billing system.
HTTP-method: POST
Parameters:
| Parameter | Required | Type | Description |
|---|---|---|---|
| action | ✅ | string | Method identifier: create_account |
| token | ✅ | string | Authorization token |
| bucket_name | ✅ | string | Name of the bucket being created |
| plan_id | ✅ | int | Pricing plan ID |
| location | ❌ | string | Data storage location (region) |
Example Request
Example of a successful response
Failure response
``` { "code": -1, "message": "S3 account was being created, but a bucket creation error occurred: Invalid bucket name" }
```
s3/create_bucket¶
Creates a new S3 bucket for the user. Verifies that s3uid belongs to the current client and creates the bucket via the provider API.
HTTP-method: POST
Parameters:
| Parameter | Required | Type | Description |
|---|---|---|---|
| action | ✅ | string | Method action |
| token | ✅ | string | Authorization token |
| s3uid | ✅ | string | Unique identifier of the user's S3 account |
| bucket_name | ✅ | string | Name of the bucket being created |
Example Request
Example of a successful response
Failure response
``` { "code": -1, "message": "S3 account not found for this customer" }
```
s3/create_order¶
Creates a new S3 account, a bucket, and links it to a pricing plan with automatic payment through billing.
HTTP-method: POST
Parameters:
| Parameter | Required | Type | Description |
|---|---|---|---|
| action | ✅ | string | Method identifier: create_order |
| token | ✅ | string | Authorization token |
| bucket_name | ✅ | string | Name of the bucket being created |
| plan_id | ✅ | int | Selected pricing plan ID |
| location | ❌ | string | Data storage location (region) |
Example Request
Example of a successful response
Failure response
``` { "code": -1, "message": "S3 account was being created, however a bucket creation error occurred - Invalid bucket name. Please contact the administrator." }
```
s3/delete_account¶
Deletes the user's S3 account, performing action auditing and logging into history.
HTTP-method: POST
Parameters:
| Parameter | Required | Type | Description |
|---|---|---|---|
| action | ✅ | string | Action command |
| token | ✅ | string | Authorization token |
| s3uid | ✅ | string | S3 account identifier |
| reason | ❌ | string | Reason for account deletion |
Example Request
Example of a successful response
Failure response
``` { "code": -1, "message": "S3 account not found for this customer", "details": { "s3uid": "abc-123" } }
```
s3/delete_bucket¶
Deletes the specified bucket from S3 storage if it belongs to the user.
HTTP-method: POST
Parameters:
| Parameter | Required | Type | Description |
|---|---|---|---|
| action | ✅ | string | Action command |
| token | ✅ | string | Authorization token |
| id | ❌ | integer | User ID (for administrators) |
| s3uid | ✅ | string | Unique identifier of the S3 account |
| bucket_name | ✅ | string | Bucket name to be deleted |
Example Request
Example of a successful response
Failure response
``` { "code": -1, "message": "Delete S3 bucket error: Bucket not empty. Response: Error message" }
```
s3/delete_file¶
Deletes the specified file from the user's S3 bucket
HTTP-method: POST
Parameters:
| Parameter | Required | Type | Description |
|---|---|---|---|
| action | ✅ | string | Method identifier: delete_file |
| token | ✅ | string | Authorization token |
| s3uid | ✅ | string | Unique identifier of the S3 account |
| bucket_name | ✅ | string | Bucket name |
| filename | ✅ | string | Path or name of the file to be deleted |
Example Request
Failure response
``` { "code": -1, "message": "Delete S3 file error: {error}. Response: {response}" }
```
s3/delete_payment_account¶
Requests S3 service cancellation and subsequent deletion of the payment account. Returns information about the cancellation date.
HTTP-method: POST
Parameters:
| Parameter | Required | Type | Description |
|---|---|---|---|
| action | ✅ | string | Method identifier: delete_payment_account |
| token | ✅ | string | Authorization token |
| id | ❌ | integer | User ID (for administrators) |
| s3uid | ✅ | string | S3 UID of the account |
Example Request
Example of a successful response
Failure response
``` { "code": -1, "message": "S3 account not found for this customer" }
```
s3/get_buckets¶
Returns a list of the user's S3 buckets, including bandwidth usage and snapshots information
HTTP-method: POST|GET
Parameters:
| Parameter | Required | Type | Description |
|---|---|---|---|
| action | ✅ | string | Method identifier: get_buckets |
| token | ✅ | string | Authorization token |
| id | ❌ | integer | User ID (for administrators) |
| s3uid | ✅ | string | S3 UID of the account |
Example Request
Example of a successful response
Failure response
``` { "code": -1, "message": "S3 account not found for this customer" }
```
s3/get_buckets_rmq¶
Returns a list of the user's buckets, their usage information, billing data, metrics, and S3 access credentials.
HTTP-method: POST
Parameters:
| Parameter | Required | Type | Description |
|---|---|---|---|
| action | ✅ | string | Action: get_user_info |
| token | ✅ | string | Authorization token |
| id | ❌ | int | Client ID (for administrators) |
| s3uid | ✅ | string | Unique identifier of the S3 account |
Example Request
Example of a successful response
{
"result": "OK",
"action": "get_buckets_rmq",
"message": [
{
"name": "example-bucket",
"usage": 1024
},
{
"name": "data-bucket",
"usage": 512
}
],
"usage_storage": 1536,
"quota": 5000,
"metering": {
"total_traffic_gb": 15.5,
"total_storage_peak_gb": 2.4
},
"billing": {
"service_id": 123,
"currency": "USD",
"period": {
"start": "2024-01-01T00:00:00Z",
"end": "2024-02-01T00:00:00Z"
},
"limits": {
"traffic_gb": 100.0,
"storage_gb": 500
},
"current_period": {
"traffic_used_gb": 15.5,
"storage_used_gb": 2.4,
"billed_traffic_gb": 0.0,
"billed_storage_gb": 0.0,
"billed_traffic_amount": 0.0,
"billed_storage_amount": 0.0
},
"overage": null,
"records": [],
"error": "billing_unavailable"
},
"access_key": "AKIAIOSFODNN7EXAMPLE",
"secret_key": "wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY",
"endpoint": "s3.eu-central-1.amazonaws.com"
}
Failure response
``` { "code": -1, "message": "S3 account not found for this customer" }
```
s3/get_files¶
Returns a list of files and folders in the specified bucket with support for pagination and search.
HTTP-method: GET
Parameters:
| Parameter | Required | Type | Description |
|---|---|---|---|
| action | ✅ | string | Command: get_files |
| token | ✅ | string | Authorization token |
| s3uid | ✅ | string | Unique identifier of the S3 account |
| bucket_name | ✅ | string | Bucket name |
| continuation_token | ❌ | string | Pagination token (next page) |
| max_keys | ❌ | int | Maximum number of keys (up to 100) |
| search | ❌ | string | Search query by filename |
Example Request
Example of a successful response
Failure response
``` { "code": -1, "message": "S3 account not found for this customer", "details": { "s3uid": "unknown_id" } }
```
s3/get_users¶
Returns a list of S3 users with details on traffic, storage, and service data (billing/status)
HTTP-method: POST|GET
Parameters:
| Parameter | Required | Type | Description |
|---|---|---|---|
| action | ✅ | string | Method identifier: get_users |
| token | ✅ | string | Authorization token |
| id | ❌ | integer | Client ID (for administrator) |
| plan_id | ❌ | integer | Pricing plan ID |
| s3uid | ❌ | string | User's S3 UID |
| ❌ | string | Search by email | |
| billing | ❌ | string | Billing location |
| storage_type | ❌ | string | Storage type (Standard/Cold) |
| location | ❌ | string | Location for search |
| period_from | ❌ | string | Period start date (YYYY-MM-DD) |
| period_to | ❌ | string | Period end date (YYYY-MM-DD) |
| offset | ❌ | integer | Offset for pagination |
| limit | ❌ | integer | Number of records per page |
| order | ❌ | string | Sorting field (total_traffic_period_gb or total_storage_peak_gb) |
| order_by | ❌ | string | Sort direction (ASC/DESC) |
Example Request
Example of a successful response
{
"result": "OK",
"action": "get_users",
"s3_users": [
{
"id": 125,
"s3uid": "b8815337-test",
"email": "[email protected]",
"region": "US",
"currency": "USD",
"traffic": 45.5,
"storage_usage": 120.0,
"price": {
"base_price": 10.0,
"price": 10.0
},
"service": {
"id": 550,
"entity_id": 125,
"service_ident": "abcde123",
"period": "monthly",
"period_start": "2024-01-01T00:00:00Z",
"period_end": "2024-02-01T00:00:00Z",
"next_commit_date": "2024-02-01T00:00:00Z",
"status": "active"
}
}
]
}
Failure response
``` { "code": -1, "message": "customer not found" }
```
s3/history¶
Returns event history related to a specific S3 account or user
HTTP-method: POST|GET
Parameters:
| Parameter | Required | Type | Description |
|---|---|---|---|
| action | ✅ | string | Method identifier: history |
| token | ✅ | string | Authorization token |
| id | ❌ | integer | User or entity ID to retrieve history for |
Example Request
Example of a successful response
Failure response
``` { "code": -1, "message": "S3/history: invalid command" }
```
s3/list_plans¶
Returns a list of available S3 plans considering user permissions and location. For administrators, it returns the full list; for clients, only active plans with prices in their currency.
HTTP-method: POST|GET
Parameters:
| Parameter | Required | Type | Description |
|---|---|---|---|
| action | ✅ | string | Method identifier: list_plans |
| token | ✅ | string | Authorization token |
| id | ❌ | int | Specific plan ID (for administrators) |
Example Request
Example of a successful response
{
"result": "OK",
"action": "list_plans",
"plans": [
{
"id": 1,
"name": "Standard Plan",
"active": 1,
"storage_type": "standard",
"quota": 500,
"traffic_overage_price": {
"RUB": 1.5,
"EUR": 0.02,
"USD": 0.02
},
"storage_overage_price": {
"RUB": 0.5,
"EUR": 0.005,
"USD": 0.005
},
"monthly_price": {
"base_price": 10.0,
"price": "10.0"
}
}
]
}
Failure response
``` { "code": -1, "message": "action required" }
```
s3/show_key¶
Returns the decrypted secret key or access key for the specified S3 account
HTTP-method: POST|GET
Parameters:
| Parameter | Required | Type | Description |
|---|---|---|---|
| action | ✅ | string | Method identifier: show_key |
| token | ✅ | string | Authorization token |
| s3uid | ✅ | string | Unique identifier of the S3 account |
| s3_key | ✅ | string | Type of requested key (secret_key or access_key) |
Example Request