2020-03-24 22:08:34 +00:00
|
|
|
---
|
|
|
|
layout: api
|
|
|
|
page_title: Scaling Policies - HTTP API
|
2020-03-24 22:26:34 +00:00
|
|
|
sidebar_title: Scaling Policies <sup>0.11 Beta</sup>
|
2020-03-24 22:08:34 +00:00
|
|
|
description: The /scaling/policy endpoints are used to list and view scaling policies.
|
|
|
|
---
|
|
|
|
|
|
|
|
# Scaling Policies HTTP API
|
|
|
|
|
|
|
|
The `/scaling/policies` and `/scaling/policy/` endpoints are used to list and view scaling policies.
|
|
|
|
|
2020-03-24 22:26:34 +00:00
|
|
|
## List Scaling Policies <sup>0.11 Beta</sup>
|
2020-03-24 22:08:34 +00:00
|
|
|
|
|
|
|
This endpoint returns the scaling policies from all jobs.
|
|
|
|
|
|
|
|
| Method | Path | Produces |
|
|
|
|
| ------ | ------------------- | ------------------ |
|
|
|
|
| `GET` | `/scaling/policies` | `application/json` |
|
|
|
|
|
|
|
|
The table below shows this endpoint's support for
|
|
|
|
[blocking queries](/api#blocking-queries), [consistency modes](/api#consistency-modes) and
|
|
|
|
[required ACLs](/api#acls).
|
|
|
|
|
|
|
|
| Blocking Queries | Consistency Modes | ACL Required |
|
|
|
|
| ---------------- | ----------------- | ---------------------------------- |
|
|
|
|
| `YES` | `all` | `namespace:list-scaling-policies` |
|
|
|
|
|
|
|
|
### Sample Request
|
|
|
|
|
|
|
|
```shell
|
|
|
|
$ curl \
|
|
|
|
https://localhost:4646/v1/scaling/policies
|
|
|
|
```
|
|
|
|
|
|
|
|
### Sample Response
|
|
|
|
|
|
|
|
```json
|
|
|
|
[
|
|
|
|
{
|
|
|
|
"CreateIndex": 10,
|
|
|
|
"Enabled": true,
|
|
|
|
"ID": "5e9f9ef2-5223-6d35-bac1-be0f3cb974ad",
|
|
|
|
"ModifyIndex": 10,
|
|
|
|
"Target": {
|
|
|
|
"Group": "cache",
|
|
|
|
"Job": "example",
|
|
|
|
"Namespace": "default"
|
|
|
|
}
|
|
|
|
}
|
|
|
|
]
|
|
|
|
```
|
|
|
|
|
2020-03-24 22:26:34 +00:00
|
|
|
## Read Scaling Policy <sup>0.11 Beta</sup>
|
2020-03-24 22:08:34 +00:00
|
|
|
|
|
|
|
This endpoint reads a specific scaling policy.
|
|
|
|
|
|
|
|
| Method | Path | Produces |
|
|
|
|
| ------ | ---------------------------- | ------------------ |
|
|
|
|
| `GET` | `/scaling/policy/:policy_id` | `application/json` |
|
|
|
|
|
|
|
|
The table below shows this endpoint's support for
|
|
|
|
[blocking queries](/api#blocking-queries), [consistency modes](/api#consistency-modes) and
|
|
|
|
[required ACLs](/api#acls).
|
|
|
|
|
|
|
|
| Blocking Queries | Consistency Modes | ACL Required |
|
|
|
|
| ---------------- | ----------------- | -------------------------------- |
|
|
|
|
| `YES` | `all` | `namespace:read-scaling-policy` |
|
|
|
|
|
|
|
|
### Parameters
|
|
|
|
|
|
|
|
- `:policy_id` `(string: <required>)` - Specifies the ID of the scaling policy (as returned
|
|
|
|
by the scaling policy list endpoint). This is specified as part of the path.
|
|
|
|
|
|
|
|
### Sample Request
|
|
|
|
|
|
|
|
```shell
|
|
|
|
$ curl \
|
|
|
|
https://localhost:4646/v1/scaling/policy/5e9f9ef2-5223-6d35-bac1-be0f3cb974ad
|
|
|
|
```
|
|
|
|
|
|
|
|
### Sample Response
|
|
|
|
|
|
|
|
```json
|
|
|
|
{
|
|
|
|
"CreateIndex": 10,
|
|
|
|
"Enabled": true,
|
|
|
|
"ID": "5e9f9ef2-5223-6d35-bac1-be0f3cb974ad",
|
|
|
|
"Max": 10,
|
|
|
|
"Min": 0,
|
|
|
|
"ModifyIndex": 10,
|
|
|
|
"Policy": {
|
|
|
|
"engage": true,
|
|
|
|
"foo": "bar",
|
|
|
|
"howdy": "doody",
|
|
|
|
"value": 6.0
|
|
|
|
},
|
|
|
|
"Target": {
|
|
|
|
"Group": "cache",
|
|
|
|
"Job": "example",
|
|
|
|
"Namespace": "default"
|
|
|
|
}
|
|
|
|
}
|
|
|
|
```
|
|
|
|
|