# S3 Deployment

### **Blimp – S3 Server Deployment**

These endpoints deploys S3-compatible MinIO servers on Züs, enabling seamless object storage for user allocations.

#### **Deploy S3 Server**

* **Path:** `/v2/blimp/deploy`
* **Method:** `POST`
* **Access:** Signature API
* **Description:**\
  Deploys an S3-compatible MinIO server for the authenticated user and returns the generated domain for access.
* **Body:** `handler.S3ServerDetails` (must include allocation ID, wallet ID, and configuration)
* **Response (201 Created):**

```json
{
  "id": 1,
  "wallet_id": 123,
  "ip": "192.168.1.10",
  "access_key": "AKIAIOSFODNN7EXAMPLE",
  "secret_key": "wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY",
  "allocation_id": "a1b2c3d4e5f6g7h8i9j0",
  "block_worker_url": "https://dev.0box.io/dns/",
  "minio_token": "minio-token-xyz",
  "s3_server_deployed": true,
  "domain": "blimp-192-168-1-10.0box.io",
  "last_update": "2025-06-08T12:34:00"
}
```

#### **Get All Blimp Deployments**

* **Path:** `/v2/blimp/deploy`
* **Method:** `GET`
* **Access:** Signature API
* **Description:**\
  Retrieves a list of all S3 server deployments for the authenticated user.
* **Query Parameters (optional):**
  * `limit`, `offset`
* **Response:** Array of `handler.S3ServerDetailsResponse` objects.

#### **Get Blimp Status by Deployment ID**

* **Path:** `/v2/blimp/deploy/:ID`
* **Method:** `GET`
* **Access:** Signature API
* **Description:**\
  Retrieves updated deployment status by ID.
* **Path Param:** `ID` (integer)
* **Response:**\
  Same as deploy response with updated `s3_server_deployed` flag and fields.

#### **Get Blimp Status by Allocation ID**

* **Path:** `/v2/blimp/deploy/allocation/:allocation_id`
* **Method:** `GET`
* **Access:** Signature API
* **Description:**\
  Fetches the S3 deployment tied to a specific allocation.
* **Path Param:** `allocation_id` (string)
* **Response:** Same as above.

#### **Delete Blimp Deployment**

* **Path:** `/v2/blimp/deploy/:ID`
* **Method:** `DELETE`
* **Access:** Signature API
* **Description:**\
  Deletes a specific Blimp deployment by ID.
* **Path Param:** `ID` (integer)
* **Response:**

```json
{
  "message": "blimp deployment deleted successfully"
}
```

***

### **Migration Deployments (S3 Migration)**

Migrates data from existing S3 sources into Züs allocations using dedicated migration microservices.

#### **Deploy S3 Migration Application**

* **Path:** `/v2/migration/deploy`
* **Method:** `POST`
* **Access:** Signature API
* **Description:**\
  Deploys an S3 migration server for a specified allocation. This tool is used to migrate data from external S3-compatible sources into a Züs allocation.
* **Body:** `handler.S3MigrationDetails` (must include wallet ID, IP, allocation ID, etc.)
* **Response (201 Created):**

```json
{
  "id": "1",
  "wallet_id": 123,
  "ip": "192.168.1.10",
  "bucket": "my-bucket",
  "allocation_id": "a1b2c3d4e5f6g7h8i9j0",
  "s3_migration_running": true,
  "domain": "blimp-192-168-1-10.0box.io",
  "block_worker_url": "https://dev.0box.io/dns/",
  "last_update": "2025-06-08T12:34:00"
}
```

#### **Get All Migration Deployments**

* **Path:** `/v2/migration/deploy`
* **Method:** `GET`
* **Access:** Signature API
* **Description:**\
  Retrieves a list of all S3 migration deployments created by the authenticated user.
* **Query Parameters (optional):**\
  `limit`, `offset`
* **Response:**\
  Array of `handler.S3MigrationDetailsResponse` objects.

#### **Get Migration Deployment by ID**

* **Path:** `/v2/migration/deploy/:ID`
* **Method:** `GET`
* **Access:** Signature API
* **Description:**\
  Fetches detailed status of a migration deployment using its numeric ID.
* **Path Param:** `ID` (integer)
* **Response:**\
  A single `handler.S3MigrationDetailsResponse` object, updated with live status fields.

#### **Get Migration Deployment by Allocation ID**

* **Path:** `/v2/migration/deploy/allocation/:allocation_id`
* **Method:** `GET`
* **Access:** Signature API
* **Description:**\
  Retrieves a migration deployment by its linked allocation ID.
* **Path Param:** `allocation_id` (string)
* **Response:**\
  `handler.S3MigrationDetailsResponse`

#### **Delete Migration Deployment**

* **Path:** `/v2/migration/deploy/:ID`
* **Method:** `DELETE`
* **Access:** Signature API
* **Description:**\
  Deletes a specific S3 migration deployment task by its ID.
* **Path Param:** `ID` (integer)
* **Response:**

```json
{
  "message": "migration deployment deleted successfully"
}
```
