<commit_before># Usage

*Docker Scaler* is controlled by sending HTTP requests to **[SCALER_IP]:[SCALER_PORT]**

## Scaling Services

This request queries docker service labels: `com.df.scaleMin`, `com.df.scaleMax`, `com.df.scaleDownBy`, `com.df.scaleUpBy` to determine how much to scale the service. Please see [configuration](configuration.md) for details.

- **URL:**
    `/v1/scale-service`

- **Method:**
    `POST`

- **Request Body:**

```json
{
    "groupLabels": {
        "scale": "up",
        "service": "example_web"
    }
}
```

The `service` value is the name of the service to scale. The `scale` value accepts `up` for scaling up and `down` for scaling down.

## Rescheduling All Services

This request only reschedule services with label: `com.df.reschedule=true`. See [Configuration](configuration.md) to change this default.

- **URL:**
    `/v1/reschedule-services`

- **Method:**
    `POST`

## Rescheduling One Service

This request only reschedule target service with label: `com.df.reschedule=true`. See [Configuration](configuration.md) to change this default.

- **URL:**
    `/v1/reschedule-service`

- **Method:**
    `POST`

- **Query Parameters:**

| Query   | Description                   | Required |
|---------|-------------------------------|----------|
| service | Name of service to reschedule | yes      |

## Scaling Nodes

- **URL:**
    `/v1/scale-nodes`<commit_msg>DOC: More details<commit_after># Usage

*Docker Scaler* is controlled by sending HTTP requests to **[SCALER_IP]:[SCALER_PORT]**

## Scaling Services

This request queries docker service labels: `com.df.scaleMin`, `com.df.scaleMax`, `com.df.scaleDownBy`, `com.df.scaleUpBy` to determine how much to scale the service by. The request body conforms to the alertmanager notifications so that *Docker Scaler* can be used as a webhook.

- **URL:**
    `/v1/scale-service`

- **Method:**
    `POST`

- **Request Body:**

```json
{
    "groupLabels": {
        "scale": "up",
        "service": "example_web"
    }
}
```

The `service` value is the name of the service to scale. The `scale` value accepts `up` for scaling up and `down` for scaling down.

## Rescheduling All Services

This request only reschedule services with label: `com.df.reschedule=true`. See [Configuration](configuration.md) to change this default.

- **URL:**
    `/v1/reschedule-services`

- **Method:**
    `POST`

## Rescheduling One Service

This request only reschedule target service with label: `com.df.reschedule=true`. See [Configuration](configuration.md) to change this default.

- **URL:**
    `/v1/reschedule-service`

- **Method:**
    `POST`

- **Query Parameters:**

| Query   | Description                   | Required |
|---------|-------------------------------|----------|
| service | Name of service to reschedule | yes      |

## Scaling Nodes

The request body conforms to the alertmanager notifications so that *Docker Scaler* can be used as a webhook.

- **URL:**
    `/v1/scale-nodes`
{'fraction_non_alphanumeric': 0.16923592493297587, 'fraction_numerical': 0.002680965147453083, 'mean_word_length': 3.066757493188011, 'pattern_counts': {'":': 6, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4841061', 'n_tokens_mistral': 928, 'n_tokens_neox': 908, 'n_words': 297}