rs-cmdb REST API uses standard HTTP methods as described in the table below
| Method | Action | Notes |
|---|---|---|
| GET | read | show object information |
| POST | create | create objects |
| PUT | write | change object attributes |
| PATCH | change | special predefined changes at objects |
| DELETE | delete | delete objects |
<HTTP_METHOD> /rest/<IF_NAME>/<object>[/...] HTTP/1.1
rs-cmdb REST API supports JSON format.
Typically, the output contains the requested data only. For debugging purposes additional meta information can be delivered by switching it on in the interface configuration.
API uses a token for each session to manage the access to the interface. Receiving a token needs authentication with a pre shared key (PSK) and a valid username with password. Authentication is done via “authorization” HTTP header. The received token must be delivered in each request as “token” in the HTTP header. Exceptional, the token can be delivered as plain text instead of embedding it in JSON.
PSK and further parameters have to be aligned in the interface (IF) definition.
| Method | URL | Notes |
|---|---|---|
| POST | /rest/{IF}/token/{PSK} | log on to the API and returns the token |
| GET | /rest/{IF}/token | return expiration date and time |
| PATCH | /rest/{IF}/token | prolongs the expiration of the token |
| DELETE | /rest/{IF}/token | log off from API and cleaning up the session |
$ curl -X POST --user user:password https://demo.rscmdb.de/rest/sample/token/psk
{"token":"1s8edkoitj38j9l3lkvrv9fmn7","expires":"2024-10-26 19:44:18"}
$ curl -X GET https://demo.rscmdb.de/rest/sample/token --header "token: 1s8edkoitj38j9l3lkvrv9fmn7"
{"expires":"2024-10-26 19:44:18"}
The list of the available objects depends on the actual interface definition. Some of the objects may not be available in every implementation. Also the visibility of the objects depends on the user and group rights.
| Object | Drescription |
|---|---|
| address | postal addresses for area object |
| area | object to manage geographical area dependencies, anchor for physical staff (i.e. devices) |
| asnr | documentation of AS-numbers |
| cabinet | object to document cabinets and the content like panels or devices |
| device | Management of devices and device names |
| devtype | device templates to create devices |
| dhcpoption | object to manage DHCP optione depending to IP networks |
| dhcprange | object to manage DHCP-ranges depending to IP networks |
| group | Group management |
| ipaddr | object to manage IP addresses (V4) |
| iparea | object to manage IP container information, related to nearea objects |
| ipnet | object to manage IP-Networks (V4) |
| ipservice | object to document IP services like DNS, ssh … |
| license | Documentation and management of software licenses |
| natip | object to manage NAT IP assignments (also accessible with ipnet object) |
| natpool | object to manage IP networks containing NAT IP addresses |
| netarea | object to manage logical network related structures, container for ipareas |
| realm | object to manage realm information and dependencies |
| request | Request handling |
| software | Documentation and management of software (i.e. applications, operating systems) |
| tenant | object to manage tenant information and dependencies |
| user | User management |
| vlan | Management of VLAN information and assignments |
| vlandomain | Mangement of VLAN-Domains |
| vrf | VRF management |