LOG IN SIGN UP
Documentation

Creating and using server entries with Dynamic Servers

  Last updated April 16, 2017

Fastly's Dynamic Servers feature distributes and directs incoming requests to a pool of servers that you dynamically manage. A server entry is an address (IP address or hostname) of a server to which the Dynamic Servers feature can forward requests. You can add up to three server entries to a pool. Fastly can then select any one of the server entries based on a selection policy defined for the pool.

Creating a server entry

To add a server entry to the pool, make the following API call in a terminal application:

curl -vs -H "Fastly-Key: FASTLY_API_TOKEN" -X POST https://api.fastly.com/service/<service_id>/pool/<pool_id>/server -d 'address=<hostname_or_ip_address>'

The response will look like this:

{
   "id": "6kEuoknxiaDBCLiAjKqyXq",
   "service_id": "<service_id>",
   "pool_id": "<pool_id>",
   "weight": "100",
   "max_conn": "200",
   "port": "80",
   "address": "<hostname_or_ip_address>",
   "comment": "",
   "created_at": "2016-06-20T08:20:36+00:00",
   "updated_at": "2016-06-20T08:20:36+00:00",
   "deleted_at": null
}

Viewing server entries

To see information related to a single server entry, make the following API call in a terminal application:

curl -vs -H "Fastly-Key: FASTLY_API_TOKEN" https://api.fastly.com/service/<service_id>/pool/<pool_id>/server/<hostname_or_ip_address>

The response will look like this:

{
   "id": "6kEuoknxiaDBCLiAjKqyXq",
   "service_id": "<service_id>",
   "pool_id": "<pool_id>",
   "weight": "100",
   "max_conn": "200",
   "port": "80",
   "address": "<hostname_or_ip_address>",
   "comment": "",
   "created_at": "2016-06-20T08:20:36+00:00",
   "updated_at": "2016-06-20T08:20:36+00:00",
   "deleted_at": null
}

To view a list of all server entries attached a particular pool, make the following API call in a terminal application:

curl -vs -H "Fastly-Key: FASTLY_API_TOKEN" https://api.fastly.com/service/<service_id>/pool/<pool_id>/servers

The response will look like this:

[
{
   "id": "6kEuoknxiaDBCLiAjKqyXq",
   "service_id": "<service_id>",
   "pool_id": "<pool_id>",
   "weight": "100",
   "max_conn": "200",
   "port": "80",
   "address": "<hostname_or_ip_address>",
   "comment": "",
   "created_at": "2016-06-20T08:20:36+00:00",
   "updated_at": "2016-06-20T08:20:36+00:00",
   "deleted_at": null
}
]

Deleting a server entry

To permanently delete a server entry, make the following API call in a terminal application:

curl -vs -H "Fastly-Key: FASTLY_API_TOKEN" -X DELETE https://api.fastly.com/service/<service_id>/pool/<pool_id>/server/<server_id>

The response will look like this:

{
  "status":"ok"
}

Additional resources:


Back to Top