Sign inSign up

microfocus/cms-restgw

By microfocus

•Updated almost 9 years ago

CMS Restful API Gateway

Image
0

428

microfocus/cms-restgw repository overview

⁠CMS Restful API Gateway

This docker Image to provide a light weight Restful API Gateway for HPE CMS UCMDB⁠. It can be used together with UCMDB 10.22+.

You can use this image to get UCMDB CI information by url GET or POST after authentication.

Authorization:

The rest service currently uses JWT tokens for authorization. The following rest calls do not require a token: get sample data model, get sample topology and get sample event. All other calls require a token. A token can be obtained by making a rest call to the following endpoint: /authenticate POST with the following payload: { "username": "admin", "password": "admin", "clientContext": 1 } The service will return a token that has to be used for future rest calls. The usage of the token is as follows: Authorization: Bearer TOKEN This should be added in the header of the request(key: Authorization, value: Bearer TOKEN) where TOKEN is the token returned by the authorization service

Examples:

Request Type: GET Request: /sampleDataModel Input:NA Description: you can get these sampleDataModel before authentication, this can check the config of rest-api.

Request Type: GET Request:/dataModel/ci/97be02636b1b56ceb397da30d7dca64f Input:NA Description: you can get CI information by CI global ID after authentication.

Request Type: POST Request: /topology Input:Query_1 Description: you can get Query_1's all data after authentication

⁠Building the image

Three files are needed to support build Restful API Gateway image: Dockerfile; rest-api.war; SettingRestGW;

  SettingRestGW: 

#!/bin/bash echo username = "$1" > /usr/local/tomcat/conf/rest_credentials.txt echo password = "$2" >> /usr/local/tomcat/conf/rest_credentials.txt echo ucmdb_host = "$3" > /usr/local/tomcat/conf/rest_api.properties echo 'ucmdb_protocol = http'>> /usr/local/tomcat/conf/rest_api.properties echo 'ucmdb_port = 8080'>> /usr/local/tomcat/conf/rest_api.properties /usr/local/tomcat/bin/startup.sh exec bash

You can get rest-api.war from any uCMDB after 10.22 in ..\UCMDB\UCMDBServer\tools\rest-api-standalone.war, and rename it to rest-api.war.

put all of them in one place and build the Dockerfile, you could get Restful API Gateway image.

⁠Launching the image

If you already build the image or pull this image, please launching it by this command:

docker run -t -i -p [port you want to expose: port you will use into image(default port is 8080)] [your image and tag] [UCMDB username] [password] [IP address of UCMDB Server]

such as if you run

           docker run -t -i -p 9004:8080 restgw:001 sysadmin [password] [ucmdb ip]

It means you could get data from UCMDB server ucmdb ip by Restful API through the API port 9004.

Tag summary

Content type

Image

Digest

Size

169.9 MB

Last updated

almost 9 years ago

docker pull microfocus/cms-restgw