> For the complete documentation index, see [llms.txt](https://academy.cegedim.cloud/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://academy.cegedim.cloud/itcare/itcare-api.md).

# ITCare API

## Getting started with the ITCare API <a href="#apiitcare-gettingstartedwiththeitcare-api" id="apiitcare-gettingstartedwiththeitcare-api"></a>

The ITCare REST API complies with the OpenAPI standard specifications.\
The online documentation is available at this address: [https://api.cegedim.cloud/](https://api.cegedim.cloud/itcare-console/swagger-ui/index.html)

Example:

{% code title="Get ITCare status" %}

```bash
curl -X GET "https://api.cegedim.cloud/itcare/health"
```

{% endcode %}

## ITCare API structure <a href="#apiitcare-philosiphy" id="apiitcare-philosiphy"></a>

Each resource belongs to one of these 3 levels of hierarchy : Category, Type, Family. An overview of the categorization is described as follows :

| Category           | Type          | family |
| ------------------ | ------------- | ------ |
| Application server | Tomcat        |        |
|                    | Wildfly       |        |
| Container          | Kubernetes    |        |
| Instance           | Linux         | CentOS |
|                    |               | Debian |
|                    |               | Oracle |
|                    |               | RHEL   |
|                    |               | Ubuntu |
|                    | Windows       |        |
|                    | Unix          |        |
| Load balancer      | Load Balancer |        |
| Managed database   | MariaDB       |        |
|                    | OpenSearch    |        |
|                    | PostgreSQL    |        |
|                    | Redis         |        |
|                    | SQL Server    |        |
| Message broker     | Apache Kafka  |        |
|                    | RabbitMQ      |        |
| Storage            | GlusterFS     |        |

When getting a resource an attribut named `path` is available in the output to inform about which category-type-family to navigate in order to get details about the resource.

The API is resource centric : the main entry point of the API could be `/compute/resources`. It can be used to explore basic informations and navigate to the proper category and get the details.

## What date/time format is used by the API? <a href="#apiitcare-whatdate-timeformatisusedbytheapi" id="apiitcare-whatdate-timeformatisusedbytheapi"></a>

JSON does not natively support the Date/Time format.\
All parameters tagged as Date by the API are therefore strings in ISO8601 format.

```
YYYY-MM-DDTHH:MM:SS.sssZ
```

Z corresponds to the time zone: +0200 for example.

```
2016-06-01T12:27:19.000+0200
```

For GET requests, do not forget to URL-Encode these parameters.

## Can I run blank actions via the API? <a href="#apiitcare-canirunblankactionsviatheapi" id="apiitcare-canirunblankactionsviatheapi"></a>

Some methods allow testing of API calls without actually triggering the action in ITCare. However, the validation is still done. To activate the Dry Run mode, simply add a custom header to your HTTP requests:

```
ITCare-DryRun: true
```

Once the server processes your request, the same custom header will be included in the response.

## How do asynchronous actions work? <a href="#apiitcare-howdoasynchronousactionswork" id="apiitcare-howdoasynchronousactionswork"></a>

Some methods are asynchronous and require a delay after their invocation.\
This applies to time-consuming transactions such as resource administration or reporting.\
Methods that operate asynchronously will respond:

* an HTTP return code 202
* a body containing a tracking ID for the current asynchronous operation

Here is an example of code in Python 3 (with the `requests` library) that explains the asynchronous operation:

{% code overflow="wrap" %}

```python
import time
import requests

BASE_URL = "https://api.cegedim.cloud/itcare"
token = "<access_token>"  # see the Authentication page
headers = {"Authorization": f"Bearer {token}"}

# Launch the action (HTTP 202 response) and get its descriptor
response = requests.post(f"{BASE_URL}/api/resource", json=my_payload, headers=headers, timeout=30)
response.raise_for_status()
action = response.json()

# Loop on getting its status
while action["status"] == "IN_PROGRESS":
    time.sleep(1)
    response = requests.get(f"{BASE_URL}/api/actions/{action['id']}", headers=headers, timeout=30)
    response.raise_for_status()
    action = response.json()

# Print its status
print(action["status"])
```

{% endcode %}

The status of the actions can be :

* IN\_PROGRESS
* SUCCESS
* ERROR


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

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

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://academy.cegedim.cloud/itcare/itcare-api.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

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.
