Skip to content
Isaac Finnegan edited this page Dec 3, 2013 · 28 revisions

Intro

There are three categories of URL endpoints that the API provides:

  • device (or system) entity
  • generic entity
  • special API

The CMDB API attempts to be restful as an HTTP REST API. The API currently only has full suport for JSON input and output. As the API is driven by the pp_lexicon.xml schema definition document and the cmdb_api.conf config file, the number of resources or URL endpoints is defined as a part of the configuration of the installation. Several basic entity types are defined in the default configuration. For these, all of them, except for the device (system) entity behave the same way, with some variation for the device endpoint. The API supports GET/PUT/POST/DELETE for almost all objects, but PUT behaves more like the proposed 'PATCH' verb. For each of these APIs, operations are performed rest-fully against the URL endpoint using the GET/PUT/POST/DELETE verbs. For device and generic the usage of the verbs is the same:

  • GET: returns resource or array of resources. The resource is returned directly when accessed using the key and the URL endpoint. When URL search parameters are used, an array of resources is returned, even if one or zero resources match the search criteria. An array of all resources is also returned when access the resource endpoint without a key.
  • PUT: for idempotent edit operations on a resource. Must be accessed via the full URL resource endpoint with key. ( /cmdb_api/v1/system/webserver01.exmple.com )
  • POST: for non-idempotent create operations of the endpoint resource type

Device (system) & generic entity API

Clone this wiki locally