### Install boto3 SDK Source: https://docs.wasabi.com/apidocs/before-you-begin-to-use-wacm-connect-api This command installs the boto3 library, the AWS SDK for Python, which is used to interact with Wasabi's S3-compatible API. Ensure you have pip installed. ```bash pip install boto3 ``` -------------------------------- ### Get Usages API - HTTP Request Example Source: https://docs.wasabi.com/apidocs/get-usages Demonstrates how to make an HTTP GET request to the 'Get Usages' endpoint of the WACM Connect API. This example shows the structure of the URL and query parameters used to filter utilization records. Note that a sub-account cannot read its own usages; only parent account users have this access. ```HTTP GET /v1/usages?page=Example1&size=Example2&governanceAccountId=Example3432&controlAccountId=Example13337&subAccountId=Example234&latest=Exampletrue&from=Example2024-01-03&to=Example2024-05-05&wasabiAccountNumber=Example454353 ``` -------------------------------- ### Query Parameters Example for Bucket Utilizations API Source: https://docs.wasabi.com/apidocs/stats-api-get-v1standalone-utilizations-bucket-bucketnumber An example demonstrating the use of query parameters to filter and paginate results when requesting bucket utilization data. Parameters include page number, page size, latest flag, and date range. ```text https://stats.wasabisys.com/v1/standalone/utilizations/bucket/:bucketNumber?pageNum=0&pageSize=1&latest=true&from=2023-12-25&to=2024-12-25 ``` -------------------------------- ### Get Sub-Accounts API Request Example Source: https://docs.wasabi.com/apidocs/get-sub-accounts This code sample demonstrates how to make a GET request to the 'Get Sub-Accounts' endpoint. It includes common query parameters for filtering and pagination. Note that authentication (username and password) is required but not shown in the request URL. ```HTTP GET /v1/sub-accounts?page=12&size=17&id=4363&name=Subaccount-name&controlAccountId=13337&governanceAccountId=3430&status=paid_account&wasabiAccountName=wasabiaccountname@wasabi.com&wasabiAccountNumber=345643&includeDeleted=true&includeKeys=true Host: api.wasabisys.com Authorization: Basic ``` -------------------------------- ### Wasabi Utilization Metrics Example (JSON) Source: https://docs.wasabi.com/apidocs/billing-and-utilization-metrics An example of the JSON structure representing Wasabi's daily utilization metrics. These metrics capture various aspects of storage usage and API activity. ```json { "NumBillableObjects": 1, "NumBillableDeletedObjects": 1, "RawStorageSizeBytes": 1000000000, "PaddedStorageSizeBytes": 1000000000, "MetadataStorageSizeBytes": 87, "DeletedStorageSizeBytes": 1000000000, "OrphanedStorageSizeBytes": 0, "MinStorageChargeBytes": 106374182313, "NumAPICalls": 18, "UploadBytes": 89349, "DownloadBytes": 36784, "StorageWroteBytes": 62325, "StorageReadBytes": 0, "NumGETCalls": 0, "NumPUTCalls": 2, "NumDELETECalls": 0, "NumLISTCalls": 3, "NumHEADCalls": 0, "DeleteBytes": 0 } ``` -------------------------------- ### Get Usages by ID - JSON Response Example Source: https://docs.wasabi.com/apidocs/get-usages-by-id This is an example of a successful JSON response from the 'Get Usages by ID' endpoint. It includes detailed information about the utilization record. ```json { "id": 324334, "startTime": "2022-12-06", "endTime": "2022-12-07", "activeStorage": 0, "deletedStorage": 0, "storageWrote": 0, "storageRead": 0, "activeObjects": 0, "deletedObjects": 0, "egress": 0, "ingress": 0, "apiCalls": 0, "subAccountId": 12345, "subAccountName": "", "subAccountEmail": "", "channelAccountId": null, "channelAccountName": null, "channelAccountEmail": null, "controlAccountId": 6789, "controlAccountName": "", "controlAccountEmail": "", "governanceAccountId": null, "governanceAccountName": null, "wasabiAccountNumber": 676040 } ``` -------------------------------- ### Retrieve Job Metadata - Example Request Source: https://docs.wasabi.com/apidocs/get-job-metadata-1 An example of how to make a request to the Wasabi API to retrieve job metadata. This demonstrates the necessary headers and path parameters. It requires a valid Wasabi User access key and secret key for authentication. ```json { "DestinationPath": "s3://metabucket/jobs/2025_04_29/7b6ba1dd-b4a2-42d2-8825-0f41c2355c4d/philtest_metadata.json" } ``` -------------------------------- ### Interact with Wasabi using Python (boto3) Source: https://docs.wasabi.com/apidocs/before-you-begin-to-use-wacm-connect-api This Python script utilizes the boto3 SDK to connect to Wasabi's S3 service and perform common operations like uploading a file and listing objects in a bucket. You need to replace placeholder values for access keys, secret keys, and endpoint URLs with your actual credentials and desired bucket/path. ```python import boto3 session = boto3.session.Session() s3 = session.client( service_name='s3', aws_access_key_id='YOUR_ACCESS_KEY', aws_secret_access_key='YOUR_SECRET_KEY', endpoint_url='https://s3.us-west-1.wasabisys.com' ) # Upload a file s3.upload_file('localfile.txt', 'my-wasabi-bucket', 'remote/path/localfile.txt') # List files response = s3.list_objects_v2(Bucket='my-wasabi-bucket') for obj in response.get('Contents', []): print(obj['Key']) ``` -------------------------------- ### Upload File via cURL Source: https://docs.wasabi.com/apidocs/before-you-begin-to-use-wacm-connect-api This snippet demonstrates how to upload a file to Wasabi using the cURL command-line tool. It requires a pre-signed URL or AWS Signature v4 headers, which involve an Authorization header with your Access Key and Signature, and an x-amz-date header with a timestamp. Manual signing is complex, making SDKs or CLI a preferred method for most use cases. ```bash curl -X PUT \ --upload-file ./myfile.txt \ "https://s3.us-west-1.wasabisys.com/my-wasabi-bucket/myfile.txt" \ -H "Authorization: AWS :" \ -H "x-amz-date: " ``` -------------------------------- ### Standalone Utilizations API Request Example Source: https://docs.wasabi.com/apidocs/stats-api-get-v1standalone-utilizations This example shows a structured representation of a GET request to the Wasabi Stats API for standalone utilizations. It includes the Authorization header with API keys and details the URL with query parameters. ```json { "name": "Read Standalone Utilizations", "request": { "method": "GET", "header": [ { "key": "Authorization", "value": "AccessKey:SecretKey", "type": "text" } ], "url": { "raw": "https://stats.wasabisys.com/v1/standalone/utilizations?includeRegionalUtilizations=true&pageNum=0&pageSize=0&latest=true&from=2023-12-01&to=2024-02-02", "protocol": "https", "host": [ "stats", "wasabisys", "com" ], "path": [ "v1", "standalone", "utilizations" ], "query": [ { "key": "to", "value": "2024-02-02", "disabled": true }, { "key": "from", "value": "2023-12-01", "disabled": true }, { "key": "latest", "value": "true" }, { "key": "includeRegionalUtilizations", "value": "true" }, { "key": "pageNum", "value": "0" }, { "key": "pageSize", "value": "0" } ] } } } ``` -------------------------------- ### Make Authenticated API Request with curl Source: https://docs.wasabi.com/apidocs/wacm-connect-api-authentication This example shows how to make a GET request to the WACM Connect API using curl. It includes the necessary Authorization header with a base64-encoded username and API key. ```shell curl -X GET https://api.wacm.wasabisys.com/resource \ -H "Authorization: Basic dXNlcm5hbWU6YXBpa2V5MTIzNDU2" ``` -------------------------------- ### Create Bucket using cURL Source: https://docs.wasabi.com/apidocs/core-api-operation-examples Demonstrates how to create a new bucket in Wasabi Cloud Storage using a PUT request with cURL. Requires proper authentication headers and bucket naming conventions. ```bash curl -X PUT \ -H "Host: your-bucket-name.s3.wasabisys.com" \ -H "Date: " \ -H "Authorization: AWS :" \ https://s3.wasabisys.com/your-bucket-name ``` -------------------------------- ### Get Job Error - 500 Internal Server Error Response Example Source: https://docs.wasabi.com/apidocs/get-job-error-1 This snippet shows an example of an internal server error response (HTTP 500) from the Get Job Error API. It indicates a problem on the server side preventing the request from being fulfilled. The response is in JSON format. ```json { "Error": "An unexpected error occurred while processing the job.", "ErrorCode": "INTERNAL_ERROR" } ``` -------------------------------- ### Authentication with API Clients (Python Example) Source: https://docs.wasabi.com/apidocs/wacm-connect-api-authentication Demonstrates how to authenticate with the WACM Connect API using Python's requests library and Basic Auth. ```APIDOC ## Authentication With API Clients (Python) ### Description If your HTTP client supports Basic Auth, you can configure it using your WACM username and API key. ### Request Example (Python) ```python import requests from requests.auth import HTTPBasicAuth response = requests.get( "https://api.wacm.wasabisys.com/resource", auth=HTTPBasicAuth('your_username', 'your_api_key') ) print(response.status_code) print(response.json()) ``` ``` -------------------------------- ### Get Usages by ID - Curl Example Source: https://docs.wasabi.com/apidocs/get-usages-by-id This code snippet demonstrates how to call the 'Get Usages by ID' endpoint using cURL. It requires the utilization ID as a path parameter and assumes basic authentication. ```curl curl -X GET \ 'https://api.wasabisys.com/v1/usages/{utilizationId}' \ -H 'Authorization: Basic ' ``` -------------------------------- ### Download Object using cURL Source: https://docs.wasabi.com/apidocs/core-api-operation-examples Illustrates how to download an object from a Wasabi Cloud Storage bucket using cURL. This requires the object's key and valid authentication credentials. ```bash curl \ -H "Authorization: AWS :" \ https://your-bucket-name.s3.wasabisys.com/file.jpg -o downloaded.jpg ``` -------------------------------- ### Request Example: Standalone Bucket Utilizations - GET Source: https://docs.wasabi.com/apidocs/stats-api-get-v1standalone-utilizations-bucket-bucketnumber A sample HTTP GET request to retrieve standalone bucket utilization data. It includes the necessary Authorization header and specifies various query parameters for filtering and pagination. ```json { "name": "Read Standalone Bucket Utilization based on bucket number", "request": { "method": "GET", "header": [ { "key": "Authorization", "value": "AccessKey:SecretKey", "type": "text" } ], "url": { "raw": "https://stats.wasabisys.com/v1/standalone/utilizations/bucket/:bucketNumber?pageNum=0&pageSize=1&latest=true&from=2023-12-25&to=2024-12-25", "protocol": "https", "host": [ "stats", "wasabisys", "com" ], "path": [ "v1", "standalone", "utilizations", "bucket", ":bucketNumber" ], "query": [ { "key": "from", "value": "2023-12-25", "disabled": true }, { "key": "to", "value": "2024-12-25", "disabled": true }, { "key": "pageNum", "value": "0" }, { "key": "pageSize", "value": "1" }, { "key": "latest", "value": "true" } ], "variable": [ { "key": "bucketNumber", "value": "bardhatest06mar" } ] } } ``` -------------------------------- ### List All Access Keys for Account Source: https://docs.wasabi.com/apidocs/iam-and-sts-support Lists all access keys for the specified account. If the username is an asterisk (*), it lists keys for all users, including the root user. ```APIDOC ## POST /iam ### Description Lists all access keys for the specified account. If the `UserName` parameter is set to an asterisk (*), access keys for all users, including the root user, are returned. The username for the root user is returned as blank. ### Method POST ### Endpoint /iam ### Parameters #### Request Body - **Action** (string) - Required - The action to perform, which is 'ListAccessKeys'. - **UserName** (string) - Optional - The username for which to list access keys. Defaults to listing keys for all users if omitted or set to '*'. ### Request Example ```json { "Action": "ListAccessKeys", "UserName": "*" } ``` ### Response #### Success Response (200) - **ListAccessKeysResult** (object) - **AccessKeyMetadata** (array) - A list of access key metadata objects. - **UserName** (string) - The username associated with the access key (blank for root user). - **AccessKeyId** (string) - The ID of the access key. - **Status** (string) - The status of the access key (e.g., 'Active', 'Inactive'). - **CreateDate** (string) - The date and time the access key was created. - **ResponseMetadata** (object) - Contains metadata about the request. #### Response Example ```json { "ListAccessKeysResponse": { "ListAccessKeysResult": { "AccessKeyMetadata": [ { "UserName": "", "AccessKeyId": "AKIAIOSF4XEXAMPLEID1", "Status": "Active", "CreateDate": "2020-01-01T00:00:00Z" }, { "UserName": "user1", "AccessKeyId": "AKIAIOSF4XEXAMPLEID2", "Status": "Active", "CreateDate": "2020-01-01T00:00:00Z" } ] }, "ResponseMetadata": { "RequestId": "example-request-id" } } } ``` ``` -------------------------------- ### Get Job Error - 401 Unauthorized Response Example Source: https://docs.wasabi.com/apidocs/get-job-error-1 This snippet illustrates an unauthorized access response (HTTP 401) for the Get Job Error API. It indicates that the provided API keys are invalid or insufficient for the request. The response is in JSON format. ```json { "Error": "Unauthorized", "ErrorCode": "UNAUTHORIZED" } ``` -------------------------------- ### Submit a new job Source: https://docs.wasabi.com/apidocs/wasabi-air-api-endpoints Submit a job with specified configuration and settings. ```APIDOC ## POST /jobs ### Description Submit a job with specified configuration and settings. ### Method POST ### Endpoint /jobs ### Parameters #### Header Parameters - **x-amz-access-key** (string) - Required - Wasabi access key for authenticating requests. ### Request Body [Details about the job configuration and settings would be provided here] ### Response #### Success Response (200 or 201) - **jobId** (string) - The ID of the submitted job. #### Response Example { "jobId": "some-unique-job-id" } ``` -------------------------------- ### Get Countries API Response Example Source: https://docs.wasabi.com/apidocs/get-countries This snippet shows an example of the JSON response when successfully retrieving a list of countries from the Wasabi API. The response is an array of objects, where each object contains a 'name' property representing a country code. ```json [ { "name": "AF" }, { "name": "AX" } ] ``` -------------------------------- ### Get Storage Amounts Source: https://docs.wasabi.com/apidocs/get-storage-amounts Retrieves all available storage amount options. This endpoint is intended for Distributor/Governance users to view and select storage options for new Standalone Accounts. Access is restricted to users with specific permissions. ```APIDOC ## GET /v1/accounts/storage-amounts ### Description Retrieves all available storage amount options. This endpoint is intended for Distributor/Governance users to view and select storage options for new Standalone Accounts. Access is restricted to users with specific permissions. ### Method GET ### Endpoint /v1/accounts/storage-amounts ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body None ### Request Example None ### Response #### Success Response (200) - **Array** - A list of available storage amount options. #### Response Example ```json [ { "name": "Less than 25 TB" }, { "name": "25 - 50 TB" }, { "name": "50 - 100 TB" }, { "name": "100 - 150 TB" }, { "name": "150 - 250 TB" }, { "name": "250 - 500 TB" }, { "name": "500 TB - 1 PB" }, { "name": "1 - 20 PB" }, { "name": "20+ PB" } ] ``` ``` -------------------------------- ### Submit Job Request Example Source: https://docs.wasabi.com/apidocs/submit-a-new-job-1 This example demonstrates how to structure a JSON request to submit a new job to the Wasabi API. It includes mandatory fields like job name and services, along with optional fields like priority and batch ID. The services object specifies which processing modules to enable and allows for custom configuration. ```json { "Name": "MyJobName", "Priority": 5, "Services": { "ocr": "", "s2t": "", "nld": "", "audiotag": "", "face": "", "logo": { "config": { "rec_confidence_threshold": 0.85 } } }, "Batch": "batch_2024_11_21", "Destination": { "Bucket": "airstream-output-2", "Region": "us-west-1" }, "Source": { "Endpoint": "s3.us-west-1.wasabisys.com", "Bucket": "wasabifs-chm", "Region": "us-west-1", "ObjectKey": "MP4/Commercial.mp4" } } ``` -------------------------------- ### Get Job Error - 404 Not Found Response Example Source: https://docs.wasabi.com/apidocs/get-job-error-1 This snippet demonstrates a 'Not Found' response (HTTP 404) when the specified job ID does not exist. The response includes an error message and an error code for troubleshooting. It is returned in JSON format. ```json { "ErrorCode": "NOT_FOUND", "Error": "An unexpected error occurred while processing the job." } ``` -------------------------------- ### API Elements Overview Source: https://docs.wasabi.com/apidocs/api-guides Provides a general overview of the essential components that constitute a typical RESTful API, as used by Wasabi. ```APIDOC ## API Elements Overview This section outlines the fundamental components of a RESTful API. ### Base URL The root address for API requests. Example: `https://api.example.com/v1/` ### Endpoints Specific paths that represent resources or actions within the API. Examples: - `GET /users` - `POST /users` - `GET /users/{id}` ### HTTP Methods Standard methods defining the operation to be performed: - `GET`: Retrieve data - `POST`: Create new data - `PUT`: Update data (replace) - `PATCH`: Update data (partial) - `DELETE`: Remove data ### Request Headers Metadata sent with requests, including: - `Authorization`: For authentication tokens (e.g., `Bearer `) - `Content-Type`: Specifies the request body format (e.g., `application/json`) - `Accept`: Indicates the desired response format (e.g., `application/json`) ### Request Parameters Parameters used to refine API requests: - **Path Parameters**: Part of the endpoint URL (e.g., `{id}` in `/users/{id}`) - **Query Parameters**: Appended to the URL after a `?` (e.g., `?role=admin` in `/users?role=admin`) - **Body Parameters**: Included in the request body for `POST`, `PUT`, `PATCH` methods (typically JSON). ### Request Body The data payload sent with `POST`, `PUT`, or `PATCH` requests, usually in JSON format. ### Response The data returned by the API, typically in JSON format. Includes: - **Status Code**: Indicates the outcome of the request (e.g., `200 OK`, `404 Not Found`). - **Response Body**: Contains the requested data or error details. - **Headers**: May include information like rate limits or content type. ### Status Codes Standard HTTP codes signify the request result: - `200 OK`: Successful request. - `201 Created`: Resource successfully created. - `400 Bad Request`: Invalid or malformed request. - `401 Unauthorized`: Missing or invalid authentication credentials. - `403 Forbidden`: User lacks permissions. - `404 Not Found`: The requested resource does not exist. - `500 Internal Server Error`: An error occurred on the server. ### Authentication Methods used to verify identity and permissions: - API keys - OAuth 2.0 - JWT (JSON Web Tokens) - Basic authentication (less secure) ``` -------------------------------- ### Get Job Error - 200 Response Example Source: https://docs.wasabi.com/apidocs/get-job-error-1 This snippet shows a successful response (HTTP 200) when fetching job error details. It includes the job's ID, current status, an error code, and the count of errors. The response format is JSON. ```json { "Id": "12345", "Status": "in_progress", "ErrorCode": "INTERNAL_ERROR", "ErrorCount": 0 } ``` -------------------------------- ### Object Management API Source: https://docs.wasabi.com/apidocs/core-api-operation-examples Endpoints for managing objects (files) within buckets, including uploading and downloading. ```APIDOC ## PUT // ### Description Uploads an object (file) to a specified bucket. ### Method PUT ### Endpoint https://s3..wasabisys.com// ### Parameters #### Path Parameters - **bucket-name** (string) - Required - The name of the bucket where the object will be stored. - **object-key** (string) - Required - The name of the object, including any path. #### Request Body - **file** (binary) - Required - The content of the file to upload. ### Request Example ```bash curl -X PUT \ -T "localfile.jpg" \ -H "Host: your-bucket-name.s3.wasabisys.com" \ -H "Date: " \ -H "Authorization: AWS :" \ https://your-bucket-name.s3.wasabisys.com/file.jpg ``` ### Response #### Success Response (200) - **Location** (string) - The URL of the uploaded object. #### Response Example ```json { "Location": "https://your-bucket-name.s3.wasabisys.com/file.jpg" } ``` ## GET // ### Description Downloads an object from a specified bucket. ### Method GET ### Endpoint https://.s3.wasabisys.com/ ### Parameters #### Path Parameters - **bucket-name** (string) - Required - The name of the bucket from which to download the object. - **object-key** (string) - Required - The name of the object to download. ### Request Example ```bash curl \ -H "Authorization: AWS :" \ https://your-bucket-name.s3.wasabisys.com/file.jpg -o downloaded.jpg ``` ### Response #### Success Response (200) - **file content** (binary) - The content of the downloaded object. #### Response Example (Binary content of the file `downloaded.jpg`) ``` -------------------------------- ### Get Standalone Utilizations API Request Source: https://docs.wasabi.com/apidocs/stats-api-get-v1standalone-utilizations This snippet demonstrates how to make a GET request to the Wasabi Stats API to retrieve standalone utilization data. It includes example query parameters for filtering by date, region, and recency, and requires Wasabi API keys with billing permissions. ```http GET /v1/standalone/utilizations https://stats.wasabisys.com/v1/standalone/utilizations?includeRegionalUtilizations=true&pageNum=0&pageSize=0&latest=true&from=2023-12-01&to=2024-02-02 ``` -------------------------------- ### POST /jobs Source: https://docs.wasabi.com/apidocs/submit-a-new-job-1 Submit a new job with specified configuration and settings. Requires Wasabi authentication. ```APIDOC ## POST /jobs ### Description Submit a job with specified configuration and settings. Requires Wasabi authentication using API keys. ### Method POST ### Endpoint /jobs ### Parameters #### Headers - **x-amz-access-key** (string) - Required - Wasabi access key for authenticating requests. - **x-amz-secret-key** (string) - Required - Wasabi secret key for authenticating requests. #### Request Body - **Name** (string) - Required - Name of the job. Min length: 1, Max length: 256. Must contain non-whitespace characters. - **Priority** (integer) - Optional - Job priority (1-10). - **Services** (object) - Required - An object where each key is a service identifier (e.g., "ocr", "s2t"). Include a key to enable that service. Values can be empty to accept defaults or an object with a "config" key to override service-specific parameters. - **Batch** (string) - Optional - Batch identifier for grouping jobs. Max length: 256. - **Destination** (object) - Required - Destination details. - **Bucket** (string) - Required - Destination bucket name. - **Region** (string) - Required - S3 region for the destination. - **Source** (object) - Required - Source details. - **Endpoint** (string) - Optional - S3 endpoint URL for the source. - **Bucket** (string) - Required - Source bucket name. - **Region** (string) - Optional - S3 region for the source. - **ObjectKey** (string) - Required - Object key or path to the file in the source bucket. ### Request Example ```json { "Name": "MyJobName", "Priority": 5, "Services": { "ocr": "", "s2t": "", "nld": "", "audiotag": "", "face": "", "logo": { "config": { "rec_confidence_threshold": 0.85 } } }, "Batch": "batch_2024_11_21", "Destination": { "Bucket": "airstream-output-2", "Region": "us-west-1" }, "Source": { "Endpoint": "s3.us-west-1.wasabisys.com", "Bucket": "wasabifs-chm", "Region": "us-west-1", "ObjectKey": "MP4/Commercial.mp4" } } ``` ### Response #### Success Response (200) - **Job** (object) - Details of the submitted job. - **Id** (string) - Unique ID for the job. - **Name** (string) - Name of the job. - **Source** (object) - Source details. - **Endpoint** (string) - S3 endpoint URL. - **Bucket** (string) - Source bucket name. - **Region** (string) - S3 region. - **ObjectKey** (string) - Object key or path to the file. - **Provider** (string) - Storage provider (e.g., wasabi, OBS, IBM). - **Services** (object) - Services and their configurations. - **UserId** (string) - User who submitted the job. - **Created** (string) - Timestamp when the job was created (date-time). - **Completed** (string) - Timestamp when the job was completed (date-time). - **Priority** (integer) - Job priority (1-10). - **Batch** (string) - Optional batch identifier. - **Status** (string) - Current status of the job (e.g., "submitted", "in_progress", "completed", "failed", "cancelled"). - **Destination** (object) - Destination details. - **Bucket** (string) - Destination bucket name. - **Region** (string) - S3 region. #### Response Example (200 OK) ```json { "Job": { "Id": "67345137bcb6dce44b35a6a6281711e7", "Name": "MyJobName", "Source": { "Endpoint": "s3.us-west-1.wasabisys.com", "Bucket": "wasabifs-chm", "Region": "us-west-1", "ObjectKey": "MP4/Commercial.mp4" }, "Provider": "wasabi", "Services": { "ocr": "", "s2t": "", "nld": "", "audiotag": "", "face": "", "logo": { "config": { "rec_confidence_threshold": 0.85 } } }, "UserId": "10000", "Created": "2024-11-13T07:11:51.658Z", "Completed": "2024-11-13T07:11:51.658Z", "Priority": 5, "Batch": "batch_2024_11_21", "Status": "submitted", "Destination": { "Bucket": "airstream-output-2", "Region": "us-west-1" } } } ``` #### Error Responses - **400 Bad Request**: Invalid request (e.g., parsing errors, missing/invalid fields, source/destination issues). - Example: `{"Error": "source object not found or inaccessible", "ErrorCode": "BAD_REQUEST"}` - **401 Unauthorized**: Authentication failed. - Example: `{"Error": "Unauthorized", "ErrorCode": "UNAUTHORIZED"}` - **403 Forbidden**: User does not have permission. - **429 Too Many Requests**: Rate limit exceeded (e.g., monthly quota reached, daily cap exceeded). - Example: `{"Error": "Monthly quota reached", "ErrorCode": "QUOTA_EXCEEDED"}` - **500 Internal Server Error**: An unexpected error occurred on the server. - Example: `{"Error": "An unexpected error occurred while processing the job.", "ErrorCode": "INTERNAL_ERROR"}` ``` -------------------------------- ### Get Usages API - JSON Response Example Source: https://docs.wasabi.com/apidocs/get-usages Illustrates the expected JSON response structure when successfully retrieving utilization records using the 'Get Usages' API method. This includes details like storage metrics, object counts, API calls, and account identifiers. The response format is application/json. ```json { "id": 1234567, "startTime": "2023-08-07", "endTime": "2023-08-08", "activeStorage": 0, "deletedStorage": 0, "storageWrote": 0, "storageRead": 0, "activeObjects": 0, "deletedObjects": 0, "egress": 0, "ingress": 0, "apiCalls": 0, "subAccountId": 12345, "subAccountName": "", "subAccountEmail": "", "channelAccountId": null, "channelAccountName": null, "channelAccountEmail": null, "controlAccountId": 6789, "controlAccountName": "", "controlAccountEmail": "", "governanceAccountId": null, "governanceAccountName": null, "wasabiAccountNumber": 676040 } ``` -------------------------------- ### Bucket Management API Source: https://docs.wasabi.com/apidocs/core-api-operation-examples Endpoints for managing buckets, which are containers for storing objects. ```APIDOC ## PUT / ### Description Creates a new bucket. Bucket names must be globally unique. ### Method PUT ### Endpoint https://s3..wasabisys.com/ ### Parameters #### Path Parameters - **bucket-name** (string) - Required - The name of the bucket to create. ### Request Example ```bash curl -X PUT \ -H "Host: your-bucket-name.s3.wasabisys.com" \ -H "Date: " \ -H "Authorization: AWS :" \ https://s3.wasabisys.com/your-bucket-name ``` ### Response #### Success Response (200) - **message** (string) - Confirmation of bucket creation. #### Response Example ```json { "message": "Bucket created successfully" } ``` ``` -------------------------------- ### Retrieve Job Details using JavaScript (Node.js) Source: https://docs.wasabi.com/apidocs/get-job-details-1 This Node.js example uses the 'axios' library to make an HTTP GET request to retrieve job details. It includes the job ID and authentication headers in the request. The output will be the JSON response or an error message. ```javascript const axios = require('axios'); const jobId = 'YOUR_JOB_ID'; const accessKey = 'YOUR_ACCESS_KEY'; const secretKey = 'YOUR_SECRET_KEY'; const apiEndpoint = 'https://your-wasabi-api-endpoint/jobs/'; const headers = { 'x-amz-access-key': accessKey, 'x-amz-secret-key': secretKey }; axios.get(`${apiEndpoint}${jobId}`, { headers }) .then(response => { console.log(response.data); }) .catch(error => { console.error('Error fetching job details:', error.message); }); ``` -------------------------------- ### Upload Object using cURL Source: https://docs.wasabi.com/apidocs/core-api-operation-examples Shows how to upload a file (object) to a specified bucket in Wasabi Cloud Storage using a PUT request with cURL. This operation requires the file to be uploaded and authentication details. ```bash curl -X PUT \ -T "localfile.jpg" \ -H "Host: your-bucket-name.s3.wasabisys.com" \ -H "Date: " \ -H "Authorization: AWS :" \ https://your-bucket-name.s3.wasabisys.com/file.jpg ``` -------------------------------- ### GET Object Response Headers Source: https://docs.wasabi.com/apidocs/operations-on-objects Allows customization of response headers for GET object requests by prefixing desired headers with 'response-'. ```APIDOC ## GET // ### Description Customizes GET object response headers. Any header in the request prefixed with 'response-' (e.g., 'response-content-type: application/json') will be returned in the response without the 'response-' prefix (e.g., 'content-type: application/json'). ### Method GET ### Endpoint `//` ### Parameters #### Query Parameters - **response-header-name** (string) - Optional - Prefix the desired response header name with 'response-' to have it included in the response. ### Request Example (No specific request example provided, but implies standard GET object request with custom headers) ### Response #### Success Response (200) Headers specified with the 'response-' prefix in the request will be returned. #### Response Example (Example response not provided in the source text) ```