App Services API Reference

Introduction

This document provides a comprehensive reference for the App Services API. You can use this API to programmatically manage and interact with your application services, including creating, retrieving, updating, and deleting resources.

All API requests should be made to the base URL: https://api.example.com/v1.

Authentication is typically handled via API keys or OAuth tokens, as described in the Authentication section.

Endpoints

Applications

GET /applications

Retrieves a list of all applications associated with your account.

Query Parameters

Name Type Description Required
status string Filter applications by their status (e.g., 'active', 'inactive'). Optional
limit integer Maximum number of applications to return. Optional
offset integer Number of applications to skip before returning results. Optional

Success Response (200 OK)

[
    {
        "id": "app_123abc",
        "name": "My Awesome App",
        "status": "active",
        "created_at": "2023-10-27T10:00:00Z",
        "updated_at": "2023-10-27T10:30:00Z"
    },
    {
        "id": "app_456def",
        "name": "Another Service",
        "status": "inactive",
        "created_at": "2023-10-26T15:00:00Z",
        "updated_at": "2023-10-26T15:05:00Z"
    }
]
GET /applications/{applicationId}

Retrieves details for a specific application by its ID.

Path Parameters

Name Type Description Required
applicationId string The unique identifier of the application. Required

Success Response (200 OK)

{
    "id": "app_123abc",
    "name": "My Awesome App",
    "status": "active",
    "region": "us-east-1",
    "created_at": "2023-10-27T10:00:00Z",
    "updated_at": "2023-10-27T10:30:00Z",
    "config": {
        "memory_mb": 512,
        "cpu_cores": 1
    }
}

Error Response (404 Not Found)

{
    "error": "Application not found",
    "code": 404
}
POST /applications

Creates a new application.

Request Body

{
    "name": "New Project",
    "region": "eu-west-2",
    "config": {
        "memory_mb": 1024,
        "cpu_cores": 2
    }
}

Success Response (201 Created)

{
    "id": "app_789ghi",
    "name": "New Project",
    "status": "pending",
    "region": "eu-west-2",
    "created_at": "2023-10-27T11:00:00Z",
    "updated_at": "2023-10-27T11:00:00Z",
    "config": {
        "memory_mb": 1024,
        "cpu_cores": 2
    }
}
PUT /applications/{applicationId}

Updates an existing application.

Path Parameters

Name Type Description Required
applicationId string The unique identifier of the application to update. Required

Request Body

{
    "status": "active",
    "config": {
        "memory_mb": 1024
    }
}

Success Response (200 OK)

{
    "id": "app_123abc",
    "name": "My Awesome App",
    "status": "active",
    "region": "us-east-1",
    "created_at": "2023-10-27T10:00:00Z",
    "updated_at": "2023-10-27T11:15:00Z",
    "config": {
        "memory_mb": 1024,
        "cpu_cores": 1
    }
}
DELETE /applications/{applicationId}

Deletes an application by its ID. This action is irreversible.

Path Parameters

Name Type Description Required
applicationId string The unique identifier of the application to delete. Required

Success Response (204 No Content)

Indicates successful deletion with no response body.

Error Response (404 Not Found)

{
    "error": "Application not found",
    "code": 404
}

Services

GET /applications/{applicationId}/services

Retrieves a list of services associated with a specific application.

Path Parameters

Name Type Description Required
applicationId string The unique identifier of the application. Required

Success Response (200 OK)

[
    {
        "id": "svc_abc789",
        "name": "API Gateway",
        "type": "gateway",
        "status": "running",
        "created_at": "2023-10-27T10:05:00Z"
    },
    {
        "id": "svc_def456",
        "name": "Database Cluster",
        "type": "database",
        "status": "running",
        "created_at": "2023-10-27T10:10:00Z"
    }
]
POST /applications/{applicationId}/services

Creates a new service for an application.

Path Parameters

Name Type Description Required
applicationId string The unique identifier of the application. Required

Request Body

{
    "name": "Cache Instance",
    "type": "cache",
    "config": {
        "memory_gb": 4,
        "eviction_policy": "LRU"
    }
}

Success Response (201 Created)

{
    "id": "svc_ghi123",
    "name": "Cache Instance",
    "type": "cache",
    "status": "creating",
    "created_at": "2023-10-27T11:30:00Z",
    "config": {
        "memory_gb": 4,
        "eviction_policy": "LRU"
    }
}