Centreon Map API (22.10 and 22.04)

Centron MAP REST API

This document shows how to use Centreon MAP REST API to manage views, read the following document for more details.

Information

NOTICE : Adding an element to a view requires 1 HTTP call on the view endpoint, which will update the elements of the view automatically, according to the content request.


See below for the list of resources available through REST API :

  • Map : Access point to a main view.

  • View : Canvas used to contain various graphical elements (shapes, hosts, services etc.).

  • Graphical elements :

    • Container : Graphical representation of a sub-view. When a container is created, automatically the sub-view it stands for is created.

    • Centreon resources : Graphical representation of Centreon resources, such as

      • HostGroup
      • Host
      • ServiceGroup
      • MetaService
      • Service
      • Business Activity
    • Widgets : Dynamic gadget which agglomerates some underlying data

      • Output
      • Gauge
      • Line chart
      • Pie chart
      • Link legend
      • Process
    • Shapes : Static geometric forms

      • Ellipse
      • Triangle
      • Rectangle
    • Media : Speaks for itself

      • Image
      • URL
      • Text
    • Links : Line shaped elements

      • Simple
      • Status
      • Metric

Authentication

Endpoint to authenticate on server with Centreon credentials

Retrieve a session token

Return a session token on success. The most important values to store are "jwtToken", because it is they that will have to be returned in other header calls.

Request Body schema: application/json
login
required
string

Centreon user

password
required
string

Password of this user

Responses

Request samples

Content type
application/json
{
  • "login": "string",
  • "password": "string"
}

Response samples

Content type
application/json
{
  • "jwtToken": "string"
}

Server

Endpoint to retrieve server information

Get the server MAP version

Return the actual version of the server

Responses

Response samples

Content type
application/json
{
  • "version": "string"
}

Get the health of the server MAP

Return the status of the server

Responses

Response samples

Content type
application/json
{
  • "status": "string"
}

Map

Endpoint to manage Maps and import/export/migrate a map

Get list of available maps

Retrieve the list of available Maps and their root View

query Parameters
size
integer <int64>
Default: 25

size

offset
integer <int64>
Default: 0

offset

header Parameters
Authorization
required
string

Concatenation of "bearer " and "jwtToken" value from authentication

Responses

Response samples

Content type
application/json
[
  • {
    }
]

Create a Map

Create a Map with a root View. The view will be created automatically. You must to have creator role to create a map.

header Parameters
Authorization
required
string

Concatenation of "bearer " and "jwtToken" value from authentication

Request Body schema: application/json
name
required
string

Map name

description
string

More information about the Map

locked
boolean
Default: false

Lock the view to prevent deleting it

hidden
boolean
Default: false

Do not display it in the default listing

object (Image)

Properties of the image

Responses

Request samples

Content type
application/json
{
  • "name": "string",
  • "description": "string",
  • "locked": false,
  • "hidden": false,
  • "image": {
    }
}

Response samples

Content type
application/json
{
  • "id": 0,
  • "name": "string",
  • "description": "string",
  • "locked": false,
  • "hidden": false,
  • "image": {
    },
  • "viewId": 0,
  • "privilege": "OWNER",
  • "mapStatus": "OK"
}

Update a Map content

Update a Map with new properties, NOT for the element in its view. Only admin user or user with creator role can update a map.

header Parameters
Authorization
required
string

Concatenation of "bearer " and "jwtToken" value from authentication

Request Body schema: application/json
id
required
integer <int64>

The id of map

name
string

Map name

description
string

More information about the Map

locked
boolean
Default: false

Lock the view to prevent deleting it

hidden
boolean
Default: false

Do not display it in the default listing

object (Image)

Properties of the image

viewId
integer <int64>

The id of view (The view represents the "canvas" of the requested Map)

privilege
string
Enum: "OWNER" "EDITOR" "VIEWER" "NONE"
mapStatus
string
Enum: "OK" "WARNING" "CRITICAL" "UNKNOWN" "PENDING" "NA"

Worst status ("ok", "warning", "critical", "unknown", "pending", "na")

Responses

Request samples

Content type
application/json
{
  • "id": 0,
  • "name": "string",
  • "description": "string",
  • "locked": false,
  • "hidden": false,
  • "image": {
    },
  • "viewId": 0,
  • "privilege": "OWNER",
  • "mapStatus": "OK"
}

Response samples

Content type
application/json
{
  • "id": 0,
  • "name": "string",
  • "description": "string",
  • "locked": false,
  • "hidden": false,
  • "image": {
    },
  • "viewId": 0,
  • "privilege": "OWNER",
  • "mapStatus": "OK"
}

Retrieve a map by its ID

Retrieve a map by its ID, its root View ID will be retrieved as well

path Parameters
id
required
integer <int64>

Identifier of the Map to retrieve

header Parameters
Authorization
required
string

Concatenation of "bearer " and "jwtToken" value from authentication

Responses

Response samples

Content type
application/json
{
  • "id": 0,
  • "name": "string",
  • "description": "string",
  • "locked": false,
  • "hidden": false,
  • "image": {
    },
  • "viewId": 0,
  • "privilege": "OWNER",
  • "mapStatus": "OK"
}

Remove a Map

Remove a Map. If it's root view is not refered in another container, it will also be removed. Only admin user or user with creator role can delete a map.

path Parameters
id
required
integer <int64>

Identifier of the map to delete

header Parameters
Authorization
required
string

Concatenation of "bearer " and "jwtToken" value from authentication

Responses

Response samples

Content type
application/json
{
  • "id": 0,
  • "name": "string",
  • "description": "string",
  • "locked": false,
  • "hidden": false,
  • "image": {
    },
  • "viewId": 0,
  • "privilege": "OWNER",
  • "mapStatus": "OK"
}

Export a Map

Export a map with all elements.

path Parameters
id
required
integer <int64>

Identifier of the map to export

header Parameters
Authorization
required
string

Concatenation of "bearer " and "jwtToken" value from authentication

Responses

Response samples

Content type
application/json
{
  • "name": "string",
  • "description": "string",
  • "locked": false,
  • "hidden": false,
  • "image": {
    },
  • "view": {
    }
}

Import a Map

Import a Map with all elements.

header Parameters
Authorization
required
string

Concatenation of "bearer " and "jwtToken" value from authentication

Request Body schema: application/json
name
string

Map name

description
string

More information about the Map

locked
boolean
Default: false

Lock the view to prevent deleting it

hidden
boolean
Default: false

Do not display it in the default listing

object (Image)

Properties of the image

object

Responses

Request samples

Content type
application/json
{
  • "name": "string",
  • "description": "string",
  • "locked": false,
  • "hidden": false,
  • "image": {
    },
  • "view": {
    }
}

Response samples

Content type
application/json
{
  • "name": "string",
  • "description": "string",
  • "locked": false,
  • "hidden": false,
  • "image": {
    },
  • "view": {
    }
}

Migrate a Map from Map (Legacy)

Migrate a Map from Map (Legacy) with all elements. Only admin user can migrate a map.

header Parameters
Authorization
required
string

Concatenation of "bearer " and "jwtToken" value from authentication

Responses

Response samples

Content type
application/json
{
  • "name": "string",
  • "description": "string",
  • "locked": false,
  • "hidden": false,
  • "image": {
    },
  • "view": {
    }
}

View

Endpoint to manage View

Retrieve a View by its ID

Retrieve a View by its ID, with contained element ids

path Parameters
mapId
required
integer <int64>

Identifier of the Map to retrieve

id
required
integer <int64>

Identifier of the View to retrieve

header Parameters
Authorization
required
string

Concatenation of "bearer " and "jwtToken" value from authentication

Responses

Response samples

Content type
application/json
{
  • "id": 0,
  • "resources": [
    ],
  • "containers": [
    ],
  • "links": [
    ],
  • "media": [
    ],
  • "shapes": [
    ],
  • "widgets": [
    ],
  • "isGeo": true,
  • "latitude": 0,
  • "longitude": 0,
  • "zoom": 0,
  • "xPov": 0,
  • "yPov": 0
}

Retrieve breadcrumb by view ID

Retrieve builded breadcrumb, following the path from the map root view up to the given one.

path Parameters
mapId
required
integer <int64>

Identifier of the Map to retrieve

id
required
integer <int64>

Identifier of the View to retrieve

header Parameters
Authorization
required
string

Concatenation of "bearer " and "jwtToken" value from authentication

Responses

Response samples

Content type
application/json
{
  • "viewId": 0,
  • "label": "string",
  • "viewStatus": "OK"
}

Create / Update / Delete a Graphical Element

Create, Update and Delete an existing Graphical Element to the target view.

path Parameters
mapId
required
integer <int64>

Identifier of the Map in which to update or delete the Element

header Parameters
Authorization
required
string

Concatenation of "bearer " and "jwtToken" value from authentication

Request Body schema: application/json
One of
id
integer <int64>

The id of view

Array of HostGroup (object) or Host (object) or ServiceGroup (object) or MetaService (object) or Service (object) or BusinessActivity (object)
containers
Array of integers <int64>
links
Array of integers <int64>
media
Array of integers <int64>
shapes
Array of integers <int64>
widgets
Array of integers <int64>
isGeo
boolean
latitude
number <float>
longitude
number <float>
zoom
number <float>
xPov
number <float>
yPov
number <float>

Responses

Request samples

Content type
application/json
Example
{
  • "id": 0,
  • "resources": [
    ],
  • "containers": [
    ],
  • "links": [
    ],
  • "media": [
    ],
  • "shapes": [
    ],
  • "widgets": [
    ],
  • "isGeo": true,
  • "latitude": 0,
  • "longitude": 0,
  • "zoom": 0,
  • "xPov": 0,
  • "yPov": 0
}

Response samples

Content type
application/json
Example
{
  • "id": 0,
  • "resources": [
    ],
  • "containers": [
    ],
  • "links": [
    ],
  • "media": [
    ],
  • "shapes": [
    ],
  • "widgets": [
    ],
  • "isGeo": true,
  • "latitude": 0,
  • "longitude": 0,
  • "zoom": 0,
  • "xPov": 0,
  • "yPov": 0
}

Geoview

Endpoint to manage Geoview

Get a list of available Geoiews

Get a list of available Geoiews

header Parameters
Authorization
required
string

Concatenation of "bearer " and "jwtToken" value from authentication

Responses

Response samples

Content type
application/json
[
  • {
    }
]

Create a Geoview

Create a Geoview

header Parameters
Authorization
required
string

Concatenation of "bearer " and "jwtToken" value from authentication

Request Body schema: application/json
id
integer <int64>

The id of geoview

name
string

Name of the geoview

object
zoom
integer

Lower zoom levels means that the map shows entire continents, while higher zoom levels means that the map can show details of a city.

markerClustering
boolean
Default: false

Group markers by cluster

htHostGroupIds
Array of integers

The list of host indexed by host group identifiers

baBusinessViewIds
Array of integers

The list of business activities indexed by business view

dataLayerIds
Array of integers

The list of data layers

hostGroupIds
Array of integers

The list of hostgroup

Responses

Request samples

Content type
application/json
{
  • "id": 0,
  • "name": "string",
  • "position": {
    },
  • "zoom": 0,
  • "markerClustering": false,
  • "htHostGroupIds": [
    ],
  • "baBusinessViewIds": [
    ],
  • "dataLayerIds": [
    ],
  • "hostGroupIds": [
    ]
}

Response samples

Content type
application/json
{
  • "id": 0,
  • "name": "string",
  • "position": {
    },
  • "zoom": 0,
  • "markerClustering": false,
  • "htHostGroupIds": [
    ],
  • "baBusinessViewIds": [
    ],
  • "dataLayerIds": [
    ],
  • "hostGroupIds": [
    ]
}

Get a Geoiew

Get a Geoiew

path Parameters
id
required
integer <int64>

Update a Geoview by its ID

header Parameters
Authorization
required
string

Concatenation of "bearer " and "jwtToken" value from authentication

Responses

Response samples

Content type
application/json
{
  • "id": 0,
  • "name": "string",
  • "position": {
    },
  • "zoom": 0,
  • "markerClustering": false,
  • "htHostGroupIds": [
    ],
  • "baBusinessViewIds": [
    ],
  • "dataLayerIds": [
    ],
  • "hostGroupIds": [
    ]
}

Update a Geoiew

Update a Geoiew

path Parameters
id
required
integer <int64>

Update a Geoview by its ID

header Parameters
Authorization
required
string

Concatenation of "bearer " and "jwtToken" value from authentication

Request Body schema: application/json
id
integer <int64>

The id of geoview

name
string

Name of the geoview

object
zoom
integer

Lower zoom levels means that the map shows entire continents, while higher zoom levels means that the map can show details of a city.

markerClustering
boolean
Default: false

Group markers by cluster

htHostGroupIds
Array of integers

The list of host indexed by host group identifiers

baBusinessViewIds
Array of integers

The list of business activities indexed by business view

dataLayerIds
Array of integers

The list of data layers

hostGroupIds
Array of integers

The list of hostgroup

Responses

Request samples

Content type
application/json
{
  • "id": 0,
  • "name": "string",
  • "position": {
    },
  • "zoom": 0,
  • "markerClustering": false,
  • "htHostGroupIds": [
    ],
  • "baBusinessViewIds": [
    ],
  • "dataLayerIds": [
    ],
  • "hostGroupIds": [
    ]
}

Response samples

Content type
application/json
{
  • "id": 0,
  • "name": "string",
  • "position": {
    },
  • "zoom": 0,
  • "markerClustering": false,
  • "htHostGroupIds": [
    ],
  • "baBusinessViewIds": [
    ],
  • "dataLayerIds": [
    ],
  • "hostGroupIds": [
    ]
}

Delete a Geoiew

Delete a Geoiew

path Parameters
id
required
integer <int64>

Delete a Geoview by its ID

header Parameters
Authorization
required
string

Concatenation of "bearer " and "jwtToken" value from authentication

Responses

Response samples

Content type
application/json
{
  • "id": 0,
  • "name": "string",
  • "position": {
    },
  • "zoom": 0,
  • "markerClustering": false,
  • "htHostGroupIds": [
    ],
  • "baBusinessViewIds": [
    ],
  • "dataLayerIds": [
    ],
  • "hostGroupIds": [
    ]
}

Role and Privilege

Endpoint to manage Role and Privilege

Retrieve the privileges of a map by its ID

Retrieve the privileges of a map by its ID. Only the admin user or the user who is part of an aclgroup with owner privilege on the map can retrieve privileges of the map.

path Parameters
mapId
required
integer <int64>

Identifier of the Map to retrieve

header Parameters
Authorization
required
string

Concatenation of "bearer " and "jwtToken" value from authentication

Responses

Response samples

Content type
application/json
[
  • {
    }
]

Update the privileges of a map by its ID

Update the privileges of a map by its ID. Only the admin user or the user who is part of an aclgroup with owner privilege on the map can update privileges of the map.

path Parameters
mapId
required
integer <int64>

Identifier of the Map to update

header Parameters
Authorization
required
string

Concatenation of "bearer " and "jwtToken" value from authentication

Request Body schema: application/json
Array ()
id
required
integer

The identifier of the aclgroup

name
required
string

The name of the aclgroup

mapId
required
integer

The identifier of the map

privilege
required
string
Enum: "OWNER" "EDITOR" "VIEWER" "NONE"

Responses

Request samples

Content type
application/json
[
  • {
    }
]

Response samples

Content type
application/json
[
  • {
    }
]

Retrieve the roles of each aclgroup

Retrieve the roles of each aclgroup. Only the admin user can retrieve the roles of each aclgroup.

header Parameters
Authorization
required
string

Concatenation of "bearer " and "jwtToken" value from authentication

Responses

Response samples

Content type
application/json
[
  • {
    }
]

Update the role of aclgroups

Update the role of aclgroups. Only the admin user can update the roles of aclgroup.

header Parameters
Authorization
required
string

Concatenation of "bearer " and "jwtToken" value from authentication

Request Body schema: application/json
Array ()
id
required
integer

The identifier of the aclgroup

name
required
string

The name of the aclgroup

isCreator
required
boolean

True means the aclgroup is creator

Responses

Request samples

Content type
application/json
[
  • {
    }
]

Response samples

Content type
application/json
[
  • {
    }
]