Centreon Map API (beta)

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 2 actions (2 HTTP calls), creating the element and attaching it to the view.


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
      • Polygon
    • 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 "studioSession", 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

200

Return a session token

401

Connection unauthorized

500

Internal Server Error

post /authentication

Centreon Studio API

{protocol}://{urlServer}/centreon-studio/api/beta/authentication

Request samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "login": "string",
  • "password": "string"
}

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "studioSession": "string",
  • "login": "string"
}

Get the server MAP version

Return the actual version of the server

Responses

200

OK

500

Internal Server Error

get /authentication/serverVersion

Centreon Studio API

{protocol}://{urlServer}/centreon-studio/api/beta/authentication/serverVersion

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "server-version": "string"
}

Map

Endpoint to manage Maps and import/export a map

Get list of available maps

Retrieve the list of available Maps and their root View

query Parameters
count
integer <int64>
Default: 25

count

offset
integer <int64>
Default: 0

offset

header Parameters
studio-session
required
string

Studio session token used for authentication

X-Client-Version
required
string

Server version according to the format : xx.yy.zz (e.g 19.10.0)

Responses

200

Successfully retrieved list of maps

204

No content

401

Unauthorized

403

Access not authorized

404

Resource not found

500

Technical error occurred

get /maps

Centreon Studio API

{protocol}://{urlServer}/centreon-studio/api/beta/maps

Response samples

Content type
application/json
Copy
Expand all Collapse all
[
  • {
    }
]

Create a Map

Create a Map with a root View. The view will be created automatically

header Parameters
studio-session
required
string

Studio session token used for authentication

X-Client-Version
required
string

Server version according to the format : xx.yy.zz (e.g 19.10.0)

Request Body schema: application/json
label
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

md5
string

The md5 of the image associated to the Map

Responses

201

Successfully create a Map

401

Unauthorized

403

Access not authorized

500

Technical error occurred

post /maps

Centreon Studio API

{protocol}://{urlServer}/centreon-studio/api/beta/maps

Request samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "label": "string",
  • "description": "string",
  • "locked": false,
  • "hidden": false,
  • "md5": "string"
}

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "id": 0,
  • "label": "string",
  • "description": "string",
  • "locked": false,
  • "hidden": false,
  • "md5": "string",
  • "viewId": 0
}

Update a Map content

Update a Map with new properties, NOT for the element in its view

header Parameters
studio-session
required
string

Studio session token used for authentication

X-Client-Version
required
string

Server version according to the format : xx.yy.zz (e.g 19.10.0)

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

The id of map

label
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

md5
string

The md5 of the image associated to the Map

viewId
integer <int64>

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

Responses

200

OK

401

Unauthorized

403

Access not authorized

404

Resource not found

500

Technical error occurred

put /maps

Centreon Studio API

{protocol}://{urlServer}/centreon-studio/api/beta/maps

Request samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "id": 0,
  • "label": "string",
  • "description": "string",
  • "locked": false,
  • "hidden": false,
  • "md5": "string",
  • "viewId": 0
}

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "id": 0,
  • "label": "string",
  • "description": "string",
  • "locked": false,
  • "hidden": false,
  • "md5": "string",
  • "viewId": 0
}

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
studio-session
required
string

Studio session token used for authentication

X-Client-Version
required
string

Server version according to the format : xx.yy.zz (e.g 19.10.0)

Responses

200

OK

401

Unauthorized

403

Access not authorized

500

Technical error occurred

get /maps/{id}

Centreon Studio API

{protocol}://{urlServer}/centreon-studio/api/beta/maps/{id}

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "id": 0,
  • "label": "string",
  • "description": "string",
  • "locked": false,
  • "hidden": false,
  • "md5": "string",
  • "viewId": 0
}

Remove a Map

Remove a Map. If it's root view is not refered in another container, it will also be removed

path Parameters
id
required
integer <int64>

Identifier of the map to delete

header Parameters
studio-session
required
string

Studio session token used for authentication

X-Client-Version
required
string

Server version according to the format : xx.yy.zz (e.g 19.10.0)

Responses

200

OK

401

Unauthorized

403

Access not authorized

404

Resource not found

500

Technical error occurred

delete /maps/{id}

Centreon Studio API

{protocol}://{urlServer}/centreon-studio/api/beta/maps/{id}

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "id": 0,
  • "label": "string",
  • "description": "string",
  • "locked": false,
  • "hidden": false,
  • "md5": "string",
  • "viewId": 0
}

Export a Map

Export a map with all elements.

path Parameters
id
required
integer <int64>

Identifier of the map to delete

header Parameters
studio-session
required
string

Studio session token used for authentication

X-Client-Version
required
string

Server version according to the format : xx.yy.zz (e.g 19.10.0)

Responses

200

OK

401

Unauthorized

403

Access not authorized

404

Resource not found

500

Technical error occurred

get /maps/export/{mapId}

Centreon Studio API

{protocol}://{urlServer}/centreon-studio/api/beta/maps/export/{mapId}

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "label": "string",
  • "description": "string",
  • "locked": false,
  • "hidden": false,
  • "md5": "string",
  • "view":
    {
    }
}

Import a Map

Import a Map with all elements.

header Parameters
studio-session
required
string

Studio session token used for authentication

X-Client-Version
required
string

Server version according to the format : xx.yy.zz (e.g 19.10.0)

Responses

200

OK

401

Unauthorized

403

Access not authorized

404

Resource not found

500

Technical error occurred

post /maps/import

Centreon Studio API

{protocol}://{urlServer}/centreon-studio/api/beta/maps/import

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "label": "string",
  • "description": "string",
  • "locked": false,
  • "hidden": false,
  • "md5": "string",
  • "view":
    {