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/order | Creates a new S3 storage account based on a specific plan and location. This action handles user creation in the S3 system, bucket initialization, and billing service setup. |
create_bucket | create bucket | Creates a new S3 bucket with specified configurations. |
create_order | create order | Creates a new S3 account and bucket based on the selected plan, location, and bucket name. Handles billing, quota allocation, and service activation. |
delete_account | delete_account | Deletes an S3 account associated with a specific bucket name and region. |
delete_bucket | delete bucket | Deletes a specified S3 bucket from the system. |
delete_file | delete file | Deletes a specific file from S3 storage |
delete_payment_account | delete_payment_account | Deletes a specific S3 payment account associated with a bucket. |
get_buckets | get buckets | Retrieves a list of S3 buckets, usage statistics, and account credentials for the specified user. |
get_buckets_rmq | get buckets rmq | Retrieves detailed S3 account information including bucket list, storage usage, metering, billing info, and credentials. |
get_files | get files | Retrieves a list of files from S3 buckets based on provided filters. |
get_users | get users | Retrieves a list of S3 users/accounts based on provided filters. |
history | get history | Retrieves the history of S3 operations or logs based on provided filters. |
list_plans | get list of s3 plans | Returns a list of available S3 storage plans including pricing and location information. |
show_key | get s3 key info | Retrieves S3 UID information based on bucket name, region, and storage type. |
s3/cancel_payment_account_deletion¶
Cancels the scheduled deletion of an S3 payment account.
HTTP Method: POST
Parameters:
| Parameter | Required | Type | Description |
|---|---|---|---|
| action | ✅ | string | Method identifier: cancel_payment_account_deletion |
| token | ✅ | string | Authentication token for API access |
| params[account_id] | ✅ | int | The unique identifier of the S3 account to restore |
Example Request
Example of a successful response
Failure response
``` { "code": -1, "message": "Invalid token or insufficient permissions" }
```
s3/create_account¶
Creates a new S3 storage account based on a specific plan and location. This action handles user creation in the S3 system, bucket initialization, and billing service setup.
HTTP Method: POST
Parameters:
| Parameter | Required | Type | Description |
|---|---|---|---|
| token | ✅ | string | Authentication token for API access |
| bucket_name | ✅ | string | The name of the S3 bucket to be created |
| plan_id | ✅ | int | ID of the storage plan to subscribe to |
| location | ❌ | string | The physical location/region for the bucket (defaults to NL) |
Example Request
Example of a successful response
Failure response
``` { "code": -1, "message": "S3 account was creating, however bucket create error - [error_details]" }
```
s3/create_bucket¶
Creates a new S3 bucket with specified configurations.
HTTP Method: POST
Parameters:
| Parameter | Required | Type | Description |
|---|---|---|---|
| token | ✅ | string | Authentication token |
| params[bucket_name] | ✅ | string | Name of the bucket to create |
Example Request
Failure response
``` { "code": -1, "message": "Bucket creation failed" }
```
s3/create_order¶
Creates a new S3 account and bucket based on the selected plan, location, and bucket name. Handles billing, quota allocation, and service activation.
HTTP Method: POST
Parameters:
| Parameter | Required | Type | Description |
|---|---|---|---|
| token | ✅ | string | Authentication token |
| ip | ❌ | string | Client IP address |
| params[plan_id] | ✅ | int | ID of the S3 plan to subscribe to |
| params[location] | ✅ | string | The location code for the bucket |
| params[bucket_name] | ✅ | string | Desired name of the S3 bucket |
Example Request
Example of a successful response
Failure response
``` { "code": -1, "message": "customer not found" }
```
s3/delete_account¶
Deletes an S3 account associated with a specific bucket name and region.
HTTP Method: POST
Parameters:
| Parameter | Required | Type | Description |
|---|---|---|---|
| token | ✅ | string | Authentication token for the request |
| params[bucket_name] | ✅ | string | The name of the S3 bucket to be deleted |
| params[region] | ✅ | string | The region associated with the S3 bucket |
Example Request
Example of a successful response
Failure response
``` { "code": -1, "message": "Bucket not found or access denied" }
```
s3/delete_bucket¶
Deletes a specified S3 bucket from the system.
HTTP Method: POST
Parameters:
| Parameter | Required | Type | Description |
|---|---|---|---|
| token | ✅ | string | Authentication token for API access |
| params[bucket_name] | ✅ | string | The name of the bucket to be deleted |
Example Request
Example of a successful response
Failure response
``` { "code": -1, "message": "Bucket not found" }
```
s3/delete_file¶
Deletes a specific file from S3 storage
HTTP Method: POST
Parameters:
| Parameter | Required | Type | Description |
|---|---|---|---|
| action | ✅ | string | Method identifier: delete_file |
| token | ✅ | string | Authentication token |
| ip | ❌ | string | Client IP address |
Example Request
Failure response
``` { "code": -1, "message": "File not found or access denied" }
```
s3/delete_payment_account¶
Deletes a specific S3 payment account associated with a bucket.
HTTP Method: POST
Parameters:
| Parameter | Required | Type | Description |
|---|---|---|---|
| token | ✅ | string | Authentication token for the request |
| params[bucket_name] | ✅ | string | The name of the S3 bucket to target |
Example Request
Example of a successful response
Failure response
``` { "code": -1, "message": "Bucket not found or access denied" }
```
s3/get_buckets¶
Retrieves a list of S3 buckets, usage statistics, and account credentials for the specified user.
HTTP Method: POST|GET
Parameters:
| Parameter | Required | Type | Description |
|---|---|---|---|
| action | ✅ | string | The action to perform (get_buckets) |
| token | ✅ | string | Authentication token |
| id | ❌ | integer | Customer ID (used if requester is admin) |
| s3uid | ✅ | string | The S3 account UID to query |
Example Request
Example of a successful response
{
"result": "OK",
"action": "get_buckets",
"message": [
{
"Name": "bucket-name-1",
"usage": 1024
},
{
"Name": "bucket-name-2",
"usage": 512
}
],
"usage_storage": 1536,
"quota": 5000,
"metering": {
"traffic_used_gb": 1.5,
"storage_used_gb": 1.4
},
"billing": {
"service_id": 123,
"currency": "EUR",
"period": {
"start": "2024-01-01T00:00:00Z",
"end": "2024-02-01T00:00:00Z"
},
"limits": {
"traffic_gb": 10,
"storage_gb": 50
}
},
"access_key": "AKIAEXAMPLE123456789",
"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_buckets_rmq¶
Retrieves detailed S3 account information including bucket list, storage usage, metering, billing info, and credentials.
HTTP Method: POST
Parameters:
| Parameter | Required | Type | Description |
|---|---|---|---|
| action | ✅ | string | Method identifier: get_buckets_rmq |
| token | ✅ | string | Authentication token |
| ip | ❌ | string | Client IP address |
| s3uid | ✅ | int | S3 account UID |
Example Request
Example of a successful response
{
"result": "OK",
"action": "get_buckets_rmq",
"message": [
{
"name": "bucket-1",
"usage": 1024,
"created_at": "2024-01-01T12:00:00Z"
},
{
"name": "bucket-2",
"usage": 512,
"created_at": "2024-01-02T12:00:00Z"
}
],
"usage_storage": 1536,
"quota": 10240,
"metering": {
"total_requests": 5000,
"total_data_gb": 1.5
},
"billing": {
"service_id": 123,
"currency": "EUR",
"period": {
"start": "2024-01-01T00:00:00Z",
"end": "2024-01-31T23:59:59Z"
},
"limits": {
"traffic_gb": 100.0,
"storage_gb": 50
},
"current_period": {
"traffic_used_gb": 12.5,
"storage_used_gb": 45.0,
"billed_traffic_gb": 12.5,
"billed_storage_gb": 45.0,
"billed_traffic_amount": 5.5,
"billed_storage_amount": 22.5
},
"overage": null,
"records": [],
"error": "billing_unavailable"
},
"access_key": "AKIAIOSFODNN7EXAMPLE",
"secret_key": "wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY",
"endpoint": "s3.us-east-1.amazonaws.com"
}
Failure response
``` { "code": -1, "message": "S3 account not found for this customer" }
```
s3/get_files¶
Retrieves a list of files from S3 buckets based on provided filters.
HTTP Method: POST
Parameters:
| Parameter | Required | Type | Description |
|---|---|---|---|
| token | ✅ | string | Authentication token for API access |
| ip | ❌ | string | Client IP address for validation |
Example of a successful response
{
"result": "OK",
"action": "get_files",
"data": [
{
"id": 1024,
"name": "backup_2023_10_01.zip",
"size": 52428800,
"type": "application/zip",
"last_modified": "2023-10-01T12:00:00Z",
"bucket": "my-storage-bucket"
},
{
"id": 1025,
"name": "config.json",
"size": 1024,
"type": "application/json",
"last_modified": "2023-10-02T08:30:00Z",
"bucket": "my-storage-bucket"
}
]
}
Failure response
``` { "code": -1, "message": "Access denied" }
```
s3/get_users¶
Retrieves a list of S3 users/accounts based on provided filters.
HTTP Method: POST
Parameters:
| Parameter | Required | Type | Description |
|---|---|---|---|
| token | ✅ | string | Authentication token for API access |
| ip | ❌ | string | Client IP address for validation |
| customer_id | ❌ | int | Filter by customer ID |
| plan_id | ❌ | int | Filter by plan ID |
| s3uid | ❌ | string | Filter by S3 UID |
| ❌ | string | Filter by email address | |
| billing | ❌ | string | Filter by billing location |
| storage_type | ❌ | string | Filter by storage type (Default: Standard) |
| region | ❌ | string | Filter by region |
Example Request
Example of a successful response
{
"result": "OK",
"action": "get_users",
"data": [
{
"id": 1024,
"name": "[email protected]",
"email": "[email protected]",
"billing": "NL",
"currency": "EUR",
"plan": "Standard Plan",
"active": 1,
"status": "active"
}
]
}
Failure response
``` { "code": -1, "message": "Invalid token" }
```
s3/history¶
Retrieves the history of S3 operations or logs based on provided filters.
HTTP Method: POST
Parameters:
| Parameter | Required | Type | Description |
|---|---|---|---|
| token | ✅ | string | Authentication token for API access |
| params[bucket] | ❌ | string | The name of the S3 bucket to fetch history for |
Example Request
Example of a successful response
{
"result": "OK",
"action": "history",
"data": [
{
"id": 1024,
"event": "BucketCreated",
"timestamp": "2024-05-20T14:30:00Z",
"user_id": 55,
"details": {
"ip": "192.168.1.1",
"action": "create"
}
},
{
"id": 1025,
"event": "ObjectDeleted",
"timestamp": "2024-05-21T09:15:00Z",
"user_id": 12,
"details": {
"ip": "10.0.0.5",
"action": "delete"
}
}
]
}
Failure response
``` { "code": -1, "message": "Unauthorized access or invalid token" }
```
s3/list_plans¶
Returns a list of available S3 storage plans including pricing and location information.
HTTP Method: POST
Parameters:
| Parameter | Required | Type | Description |
|---|---|---|---|
| token | ✅ | string | Authentication token for API access |
| ip | ❌ | string | Client IP address for validation |
Example of a successful response
Failure response
``` { "code": -1, "message": "Invalid token" }
```
s3/show_key¶
Retrieves S3 UID information based on bucket name, region, and storage type.
HTTP Method: POST
Parameters:
| Parameter | Required | Type | Description |
|---|---|---|---|
| token | ✅ | string | Authentication token |
| ip | ❌ | string | Client IP address |
| params[bucket_name] | ✅ | string | The name of the S3 bucket |
| params[region] | ✅ | string | S3 region identifier |
| params[storage_type] | ✅ | string | The type of storage to query |
Example Request
Example of a successful response
Failure response
``` { "code": -1, "message": "Error retrieving S3 UID information" }
```