# Modify a Monitoring Pipeline Instance

Ensures that the pipeline with the provided ID is created or modified. The full pipeline needs to be provided to ensure (either update or create) the pipeline. Non present data will only be filled with defaults or left empty, but not take previous values into consideration.

To ensure that the pipeline with the provided ID is created or modified, perform `PUT` request.

## Request

The following is a sample request. Remember to replace the `{pipelineID}` with a valid ID of the specific pipeline you want to create or update.

```bash
curl --location \
--request PUT 'https://monitoring.de-txl.ionos.com/pipelines/{pipelineID}' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer $TOKEN' \
--data-raw '{
  "metadata": {},
  "properties": {
    "name": "Pipeline1"
  }
}'
```

{% tabs %}
{% tab title="Path Parameters" %}
Below is the list of mandatory path parameters for updating a Monitoring Pipeline:

| Path Parameters | Type   | Description                    | Example                                |
| --------------- | ------ | ------------------------------ | -------------------------------------- |
| `pipelineId`    | string | The ID (UUID) of the Pipeline. | `f72521ba-1590-5998-bf96-6eb997a5887d` |
| {% endtab %}    |        |                                |                                        |

{% tab title="Request Body Parameters" %}
Below is the list of mandatory body parameters for updating a Monitoring Pipeline:

| Body Parameters | Required | Type   | Description                                                                                    | Example                          |
| --------------- | -------- | ------ | ---------------------------------------------------------------------------------------------- | -------------------------------- |
| `metadata`      | no       | object | Metadata                                                                                       | `{}`                             |
| `properties`    | yes      | object | A pipeline consists of the generic rules and configurations of a monitoring pipeline instance. | `{ "name": "Updated Pipeline" }` |
| {% endtab %}    |          |        |                                                                                                |                                  |

{% tab title="Request Header Parameters" %}
To make authenticated requests to the API, the following fields are mandatory in the request header:

| Header Parameters | Required | Type   | Description                                                                                                                              |
| ----------------- | -------- | ------ | ---------------------------------------------------------------------------------------------------------------------------------------- |
| `Authorization`   | yes      | string | The Bearer token enables requests to authenticate using a JSON Web Token (JWT). The token can be generated using the Authentication API. |
| `Content-Type`    | yes      | string | Set this to `application/json`.                                                                                                          |
| {% endtab %}      |          |        |                                                                                                                                          |
| {% endtabs %}     |          |        |                                                                                                                                          |

## Response

The following is a sample response. The values returned by each response differ based on the request.

**200 Successful operation**

```json
{
  "id": "f72521ba-1590-5998-bf96-6eb997a5887d",
  "type": "pipeline",
  "href": "/pipelines/f72521ba-1590-5998-bf96-6eb997a5887d",
  "metadata": {
    "createdDate": "2020-12-10T13:37:50+01:00",
    "createdBy": "ionos:identity:::users/87f9a82e-b28d-49ed-9d04-fba2c0459cd3",
    "createdByUserId": "87f9a82e-b28d-49ed-9d04-fba2c0459cd3",
    "lastModifiedDate": "2020-12-11T13:37:50+01:00",
    "lastModifiedBy": "ionos:identity:::users/87f9a82e-b28d-49ed-9d04-fba2c0459cd3",
    "lastModifiedByUserId": "87f9a82e-b28d-49ed-9d04-fba2c0459cd3",
    "resourceURN": "ionos:<product>:<location>:<contract>:<resource-path>",
    "status": "AVAILABLE",
    "statusMessage": null,
    "key": "momSrlgAAEmaYEvBsMr^HsYn",
    "grafanaEndpoint": "https://grafana.logging.de-txl.ionos.com",
    "httpEndpoint": "https://f8ss7fgr7s-metrics.jf9ejf8t6hrt.monitoring.de-txl.ionos.com"
  },
  "properties": {
    "name": "Pipeline1"
  }
}
```

{% hint style="success" %}
\*\*Result:\*\* The Monitoring Pipeline is successfully updated or created.
{% endhint %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.ionos.com/cloud/observability/monitoring-service/api-how-tos/modify-monitoring-pipeline.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
