Fleets

Create a Fleet Policy

Create a fleet policy. Policies are conditions that the fleet must respect.

post/v1/fleet/{fleet_name}/policies

Request

  • Base URL: https://api.edgegap.com
  • URL: https://api.edgegap.com/v1/fleet/{fleet_name}/policies
  • Auth: API key in header authorization

Path parameters

fleet_namestring required

The name of the fleet

Request body

namestring required

Name of the Policy

enabledboolean required

If the Policy is enabled. Defaults to true.

type'Location' | 'Tag' | 'Coordinates' required

Type of the Policy. See our documentation for more information on the type and it's data.

minimuminteger required

Minimum deployments at all time

maximuminteger required

Maximum deployments for the provided type.

thresholdnumber required

Based on the number of sockets connected, how filled should a session deployment be before initiating a scale-up deployment. Float between 0.1 and 1.

dataobject required

JSON object for your filters. See our documentation for more information.

Example request

{
  "name": "policy_name",
  "enabled": true,
  "type": "Location",
  "minimum": 1,
  "maximum": 1,
  "data": {
    "filters": [
      {
        "field": "city",
        "values": [
          "Montreal"
        ],
        "filter_type": "any"
      }
    ]
  }
}

Response

Success

namestring required

Name of the Policy

enabledboolean required

If the Policy is enabled. Defaults to true.

type'Location' | 'Tag' | 'Coordinates' required

Type of the Policy. See our documentation for more information on the type and it's data.

minimuminteger required

Minimum deployments at all time

maximuminteger required

Maximum deployments for the provided type.

thresholdnumber required

Based on the number of sockets connected, how filled should a session deployment be before initiating a scale-up deployment. Float between 0.1 and 1.

dataobject required

JSON object for your filters. See our documentation for more information.

create_timestring

UTC time of policy creation

last_updatedstring

UTC time of policy last update

Example response

{
  "name": "policy_name",
  "enabled": true,
  "type": "Location",
  "minimum": 1,
  "maximum": 1,
  "data": {
    "filters": [
      {
        "field": "city",
        "values": [
          "Montreal"
        ],
        "filter_type": "any"
      }
    ]
  },
  "create_time": "2022-01-01 00:00:00.000000",
  "last_updated": "2022-01-01 00:00:00.000000"
}

Changes

No recorded changes to this operation across all 1 revision of this API.