Dies ist eine alte Version des Dokuments!


rs-cmdb API documentation

HTTP Request methods

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

Request structure

<HTTP_METHOD> /rest/<IF_NAME>/<object>[/...] HTTP/1.1

Output format

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.

Authentication

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
Example
$ 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"}

Objects

The list of 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 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
device Management of devices and device names
devtype
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
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

ipaddr object

Method URL Notes
GET /rest/{IF}/ipnet returns a list of all IP networks
GET /rest/{IF}/ipnet/{id} returns a list of all IP addresses in this IP network
available parameters
Parameter Type Method Notes
id int GET, PUT, DELETE unique identifier of the object
name string POST,PUT name (DNS) assigned to ip address
addr IP POST, PUT IP address
natip int POST, PUT NAT IP address
natdir text POST, PUT NAT direction
gateway int POST, PUT default gateway flag
dhcp int POST, PUT dhcp flag
notes int POST, PUT further description
objstatus int POST, PUT Status of the IP address
ipif_id int POST, PUT link to interface
ipdevice_id int POST, PUT link to device

<< zurück

iparea object

Method URL Notes
GET /rest/{IF}/iparea returns a list of all iparea objects
GET /rest/{IF}/iparea/{id} information about a single iparea
GET /rest/{IF}/iparea/{id}/iparea returns a list of all ipareas below the iparea in the tree
GET /rest/{IF}/iparea/{id}/ipnet returns a list of all ipnets connected
available parameters
Parameter Type Method Notes
id int GET, PUT, DELETE unique identifier of the object
name string POST,PUT iparea's name or readable identifier
net IP POST network address of iparea
bits int POST number of bits (CIDR), related to the iparea size
func int POST, PUT global flag
notes text POST, PUT further notes or description of the iparea

<< zurück

ipnet object

Method URL Notes
GET /rest/{IF}/ipnet returns a list of all IP networks
GET /rest/{IF}/ipnet/{id} information of the IP network
GET /rest/{IF}/ipnet/{id}/ipaddr returns a list of all IP addresses in this IP network
GET /rest/{IF}/ipnet/{id}/natip returns a list of all IP NAT addresses in this IP network
GET /rest/{IF}/ipnet/{id}/dhcpoption returns a list of the dhcp options of this network
GET /rest/{IF}/ipnet/{id}/dhcprange returns a list of the dhcp ranges of this network
GET /rest/{IF}/ipnet/{id}/service returns a list of all services that are related to this network
available parameters
Parameter Type Method Notes
id int GET, PUT, DELETE unique identifier of the object
name string POST,PUT network's name or readable identifier
net IP POST network address
bits int POST number of bits (CIDR), related to the network size
notes text POST, PUT Description of the network
vrf_id int POST, PUT id of the related VRF
realm_id int POST, PUT id of the related realm
tenant_id int POST, PUT id of the related tenant

<< zurück

ipservice object

license object

natip object

natpool object

netarea object

Method URL Notes
GET /rest/{IF}/netarea returns a list of all netareas
GET /rest/{IF}/netarea/{id} Information about a single netarea
GET /rest/{IF}/netarea/{id}/netarea returns a list of all netareas below the selected in the tree
GET /rest/{IF}/netarea/{id}/iparea returns the assigned ipareas
GET /rest/{IF}/netarea/{id}/vlandomain returns the assigned vlandomains
GET /rest/{IF}/netarea/{id}/vlan returns a list of all vlans assigned to the netarea
GET /rest/{IF}/netarea/{id}/ipnet returns a list of all ipnets assigned to the netarea
available parameters
Parameter Type Method Notes
id int GET, PUT, DELETE unique identifier of the object
name string POST,PUT netarea's name, unique per hierarchy level
notes text POST, PUT Description
plancount int POST, PUT Number of planned users in the netarea
tcontact string POST, PUT name, UPN, etc. of the technical contact of this netarea
area_id int POST link to the geographical area
netarea_id int POST link to the predecessor in the netarea-hierarchy

<< zurück

realm object

request object

software object

tenant object

user object

vlan object

vlandomain object

vrf object