Référence

Référence#

Cette page est générée depuis api/agent.yaml, à la racine du dépôt. C’est la source unique du contrat : en cas d’écart avec le reste de la documentation, c’est elle qui fait foi.

GET /vpcs#

List all VPCs

Example request:

GET /vpcs HTTP/1.1
Host: example.com
Status Codes:
  • 200 OK –

    List of VPCs

    Example response:

    HTTP/1.1 200 OK
    Content-Type: application/json
    
    [
        {
            "name": "string",
            "state": "creating",
            "cidr": "string"
        }
    ]
    

  • 500 Internal Server Error –

    Internal server error

    Example response:

    HTTP/1.1 500 Internal Server Error
    Content-Type: application/json
    
    {
        "error": "string"
    }
    

POST /vpcs#

Create a VPC

Example request:

POST /vpcs HTTP/1.1
Host: example.com
Content-Type: application/json

{
    "name": "string",
    "cidr": "string"
}
Status Codes:
  • 202 Accepted –

    VPC creation accepted

    Example response:

    HTTP/1.1 202 Accepted
    Content-Type: application/json
    
    {
        "name": "string",
        "state": "creating",
        "cidr": "string"
    }
    

  • 400 Bad Request –

    Missing required field or invalid request body

    Example response:

    HTTP/1.1 400 Bad Request
    Content-Type: application/json
    
    {
        "error": "string"
    }
    

  • 409 Conflict –

    VPC already exists

    Example response:

    HTTP/1.1 409 Conflict
    Content-Type: application/json
    
    {
        "error": "string"
    }
    

  • 500 Internal Server Error –

    Internal server error

    Example response:

    HTTP/1.1 500 Internal Server Error
    Content-Type: application/json
    
    {
        "error": "string"
    }
    

GET /vpcs/{name}#

Get VPC status and info

Parameters:
  • name (string) – Resource name

Example request:

GET /vpcs/{name} HTTP/1.1
Host: example.com
Status Codes:
  • 200 OK –

    VPC found

    Example response:

    HTTP/1.1 200 OK
    Content-Type: application/json
    
    {
        "name": "string",
        "state": "creating",
        "cidr": "string"
    }
    

  • 404 Not Found –

    Resource not found

    Example response:

    HTTP/1.1 404 Not Found
    Content-Type: application/json
    
    {
        "error": "string"
    }
    

  • 500 Internal Server Error –

    Internal server error

    Example response:

    HTTP/1.1 500 Internal Server Error
    Content-Type: application/json
    
    {
        "error": "string"
    }
    

DELETE /vpcs/{name}#

Delete a VPC

Parameters:
  • name (string) – Resource name

Status Codes:
  • 202 Accepted –

    VPC deletion accepted

    Example response:

    HTTP/1.1 202 Accepted
    Content-Type: application/json
    
    {
        "name": "string",
        "state": "creating",
        "cidr": "string"
    }
    

  • 404 Not Found –

    Resource not found

    Example response:

    HTTP/1.1 404 Not Found
    Content-Type: application/json
    
    {
        "error": "string"
    }
    

  • 409 Conflict –

    VPC not deletable — only running or error states can be deleted, and all its subnets must be deleted first

    Example response:

    HTTP/1.1 409 Conflict
    Content-Type: application/json
    
    {
        "error": "string"
    }
    

  • 500 Internal Server Error –

    Internal server error

    Example response:

    HTTP/1.1 500 Internal Server Error
    Content-Type: application/json
    
    {
        "error": "string"
    }
    

GET /vms#

List all VMs

Example request:

GET /vms HTTP/1.1
Host: example.com
Status Codes:
  • 200 OK –

    List of VMs

    Example response:

    HTTP/1.1 200 OK
    Content-Type: application/json
    
    [
        {
            "name": "string",
            "state": "creating",
            "metadata_port": "string",
            "memory": 1,
            "cpus": 1,
            "interfaces": [
                {
                    "subnet": "string",
                    "ip": "string",
                    "primary": true
                }
            ],
            "storage": [
                {
                    "path": "string",
                    "dev": "string"
                }
            ],
            "uefi": true
        }
    ]
    

  • 500 Internal Server Error –

    Internal server error

    Example response:

    HTTP/1.1 500 Internal Server Error
    Content-Type: application/json
    
    {
        "error": "string"
    }
    

POST /vms#

Start a VM

Example request:

POST /vms HTTP/1.1
Host: example.com
Content-Type: application/json

{
    "name": "string",
    "memory": 1,
    "cpus": 1,
    "metadata": {
        "password": "string",
        "sshkey": "string",
        "user_data": "c3RyaW5n"
    },
    "interfaces": [
        {
            "subnet": "string",
            "ip": "string",
            "primary": true
        }
    ],
    "storage": [
        {
            "path": "string",
            "dev": "string"
        }
    ],
    "uefi": true
}
Status Codes:
  • 202 Accepted –

    VM start accepted

    Example response:

    HTTP/1.1 202 Accepted
    Content-Type: application/json
    
    {
        "name": "string",
        "state": "creating",
        "metadata_port": "string",
        "memory": 1,
        "cpus": 1,
        "interfaces": [
            {
                "subnet": "string",
                "ip": "string",
                "primary": true
            }
        ],
        "storage": [
            {
                "path": "string",
                "dev": "string"
            }
        ],
        "uefi": true
    }
    

  • 400 Bad Request –

    Missing required field or invalid request body

    Example response:

    HTTP/1.1 400 Bad Request
    Content-Type: application/json
    
    {
        "error": "string"
    }
    

  • 409 Conflict –

    VM already exists

    Example response:

    HTTP/1.1 409 Conflict
    Content-Type: application/json
    
    {
        "error": "string"
    }
    

  • 422 Unprocessable Entity –

    Subnet not found, or not in creating/running state

    Example response:

    HTTP/1.1 422 Unprocessable Content
    Content-Type: application/json
    
    {
        "error": "string"
    }
    

  • 500 Internal Server Error –

    Internal server error

    Example response:

    HTTP/1.1 500 Internal Server Error
    Content-Type: application/json
    
    {
        "error": "string"
    }
    

GET /vms/{name}#

Get VM status and info

Parameters:
  • name (string) – Resource name

Example request:

GET /vms/{name} HTTP/1.1
Host: example.com
Status Codes:
  • 200 OK –

    VM found

    Example response:

    HTTP/1.1 200 OK
    Content-Type: application/json
    
    {
        "name": "string",
        "state": "creating",
        "metadata_port": "string",
        "memory": 1,
        "cpus": 1,
        "interfaces": [
            {
                "subnet": "string",
                "ip": "string",
                "primary": true
            }
        ],
        "storage": [
            {
                "path": "string",
                "dev": "string"
            }
        ],
        "uefi": true
    }
    

  • 404 Not Found –

    Resource not found

    Example response:

    HTTP/1.1 404 Not Found
    Content-Type: application/json
    
    {
        "error": "string"
    }
    

  • 500 Internal Server Error –

    Internal server error

    Example response:

    HTTP/1.1 500 Internal Server Error
    Content-Type: application/json
    
    {
        "error": "string"
    }
    

DELETE /vms/{name}#

Stop a VM

Parameters:
  • name (string) – Resource name

Status Codes:
  • 202 Accepted –

    VM stop accepted

    Example response:

    HTTP/1.1 202 Accepted
    Content-Type: application/json
    
    {
        "name": "string",
        "state": "creating",
        "metadata_port": "string",
        "memory": 1,
        "cpus": 1,
        "interfaces": [
            {
                "subnet": "string",
                "ip": "string",
                "primary": true
            }
        ],
        "storage": [
            {
                "path": "string",
                "dev": "string"
            }
        ],
        "uefi": true
    }
    

  • 404 Not Found –

    Resource not found

    Example response:

    HTTP/1.1 404 Not Found
    Content-Type: application/json
    
    {
        "error": "string"
    }
    

  • 409 Conflict –

    VM not stoppable — only running or error states can be stopped

    Example response:

    HTTP/1.1 409 Conflict
    Content-Type: application/json
    
    {
        "error": "string"
    }
    

  • 500 Internal Server Error –

    Internal server error

    Example response:

    HTTP/1.1 500 Internal Server Error
    Content-Type: application/json
    
    {
        "error": "string"
    }
    

GET /subnets#

List all subnets

Example request:

GET /subnets HTTP/1.1
Host: example.com
Status Codes:
  • 200 OK –

    List of subnets

    Example response:

    HTTP/1.1 200 OK
    Content-Type: application/json
    
    [
        {
            "name": "string",
            "state": "creating",
            "vpc": "string",
            "mode": "vxlan",
            "vxlan_id": 1,
            "local_iface": "string",
            "interface_ip": "string",
            "cidr": "string",
            "default_route": true,
            "gateway": "string"
        }
    ]
    

  • 500 Internal Server Error –

    Internal server error

    Example response:

    HTTP/1.1 500 Internal Server Error
    Content-Type: application/json
    
    {
        "error": "string"
    }
    

POST /subnets#

Create a subnet

Example request:

POST /subnets HTTP/1.1
Host: example.com
Content-Type: application/json

{
    "name": "string",
    "vpc": "string",
    "mode": "vxlan",
    "vxlan_id": 1,
    "iface_type": "string",
    "interface_ip": "string",
    "cidr": "string",
    "default_route": true,
    "gateway": "string"
}
Status Codes:
  • 202 Accepted –

    Subnet creation accepted

    Example response:

    HTTP/1.1 202 Accepted
    Content-Type: application/json
    
    {
        "name": "string",
        "state": "creating",
        "vpc": "string",
        "mode": "vxlan",
        "vxlan_id": 1,
        "local_iface": "string",
        "interface_ip": "string",
        "cidr": "string",
        "default_route": true,
        "gateway": "string"
    }
    

  • 400 Bad Request –

    Missing required field or unknown iface_type

    Example response:

    HTTP/1.1 400 Bad Request
    Content-Type: application/json
    
    {
        "error": "string"
    }
    

  • 409 Conflict –

    Subnet already exists

    Example response:

    HTTP/1.1 409 Conflict
    Content-Type: application/json
    
    {
        "error": "string"
    }
    

  • 422 Unprocessable Entity –

    Parent VPC does not exist or is not ready

    Example response:

    HTTP/1.1 422 Unprocessable Content
    Content-Type: application/json
    
    {
        "error": "string"
    }
    

  • 500 Internal Server Error –

    Internal server error

    Example response:

    HTTP/1.1 500 Internal Server Error
    Content-Type: application/json
    
    {
        "error": "string"
    }
    

GET /subnets/{name}#

Get subnet status and info

Parameters:
  • name (string) – Resource name

Example request:

GET /subnets/{name} HTTP/1.1
Host: example.com
Status Codes:
  • 200 OK –

    Subnet found

    Example response:

    HTTP/1.1 200 OK
    Content-Type: application/json
    
    {
        "name": "string",
        "state": "creating",
        "vpc": "string",
        "mode": "vxlan",
        "vxlan_id": 1,
        "local_iface": "string",
        "interface_ip": "string",
        "cidr": "string",
        "default_route": true,
        "gateway": "string"
    }
    

  • 404 Not Found –

    Resource not found

    Example response:

    HTTP/1.1 404 Not Found
    Content-Type: application/json
    
    {
        "error": "string"
    }
    

  • 500 Internal Server Error –

    Internal server error

    Example response:

    HTTP/1.1 500 Internal Server Error
    Content-Type: application/json
    
    {
        "error": "string"
    }
    

DELETE /subnets/{name}#

Delete a subnet

Parameters:
  • name (string) – Resource name

Status Codes:
  • 202 Accepted –

    Subnet deletion accepted

    Example response:

    HTTP/1.1 202 Accepted
    Content-Type: application/json
    
    {
        "name": "string",
        "state": "creating",
        "vpc": "string",
        "mode": "vxlan",
        "vxlan_id": 1,
        "local_iface": "string",
        "interface_ip": "string",
        "cidr": "string",
        "default_route": true,
        "gateway": "string"
    }
    

  • 404 Not Found –

    Resource not found

    Example response:

    HTTP/1.1 404 Not Found
    Content-Type: application/json
    
    {
        "error": "string"
    }
    

  • 409 Conflict –

    Subnet not deletable — only running or error states can be deleted

    Example response:

    HTTP/1.1 409 Conflict
    Content-Type: application/json
    
    {
        "error": "string"
    }
    

  • 500 Internal Server Error –

    Internal server error

    Example response:

    HTTP/1.1 500 Internal Server Error
    Content-Type: application/json
    
    {
        "error": "string"
    }