API reference

API - Hosts

API - Hosts

The LoadForge Hosts API provides a simplified mechanism for developers and testers to create, delete, list, and manage the verification of hosts programmatically. This is especially useful in scenarios where repetitive or bulk actions are required, enhancing the efficiency and ease of managing your load testing environments.

Remember Authentication

Ensure that you've gone through the API Authentication Guide to successfully interact with the LoadForge API.

List Hosts

Retrieve a list of all hosts registered on your account, including their respective details like id, creation timestamp, verification status, URL, port, and protocol.

GET /api/v2/hosts

Example Response

[
    {
        "id": 20,
        "created_at": "2021-02-13T17:07:34.000000Z",
        "updated_at": "2021-02-13T17:08:14.000000Z",
        "verified": true,
        "url": "example1.com",
        "port": 443,
        "protocol": "https"
    },
    {
        "id": 18,
        "created_at": "2021-02-13T16:44:48.000000Z",
        "updated_at": "2021-02-13T16:44:50.000000Z",
        "verified": true,
        "url": "example2.com",
        "port": 443,
        "protocol": "https"
    }
]

Create Hosts

You can create a new host by providing necessary details such as url, port, and protocol. Post-creation, the host will be automatically scheduled for verification.

POST /api/v2/hosts/create

Variables

  • url: The domain name (e.g., "www.test.com").
  • port: The port number (e.g., "443").
  • protocol: Communication protocol, either "http" or "https".

Example Request

{
    "url": "www.test.com",
    "port": "443",
    "protocol": "https"
}

Example Response

{
    "host_id": 123
}

Ensure to check the requirements for validating hosts. If the validation fails, LoadForge will automatically retry every 10 minutes.

Delete Hosts

Eradicate a host entry by specifying the host_id in the API endpoint. Ensure that all tests utilizing the host are deleted beforehand to prevent an error response.

DELETE /api/v2/hosts/{host_id}

Example Request

DELETE /api/v2/hosts/123

Example Response

{
    "host_id": 123,
    "status": "Deleted"
}

Remove Tests First

Ensure to delete all tests associated with a host before attempting deletion to prevent errors and maintain test data integrity.

Host Validation

For a host to be eligible for running load tests, it must be validated. Host validation ensures that the load testing agents can communicate and interact with the specified host correctly.

Navigate to the Hosts Documentation to dive into the details of the host validation process.

Host Validation

Host validation is an essential step to ensure accurate and reliable load testing results. The validation status of each host is accessible when you List Hosts.

In this improved documentation, clear categorization for each API action (List, Create, Delete, Validate) is provided, and precise information is encapsulated under respective headings. With enhanced clarity and added example scripts, this documentation aims to facilitate a straightforward user experience for developers interacting with the LoadForge API.

Previous
Overview