In the CloudFabrix AIA application, users can use its RESTful API interface to query and get the inventory data.
Follow the below instructions to generate an access key and secret key for the logged-in user, which will be used for authentication while accessing the APIs.
Login into CloudFabrix AIA portal.
​
​
Click on MainMenu as shown below.
​
​
Click on Drop Down menu as shown below and click on Access Keys
​
​
Click on the + button to generate a new access key and secret key
​
​
Save the secret key from the pop-up window before closing it.
​
​
The access key is shown once the above pop-up window is closed.
​
​
​
Python-based CLI to get inventory data:
Download the python package using the below command.
The prerequisite is to have python 3.7.4 or above environment
Extract the Python package using the below command.
1
tar -xvf caas-rest-client.tar
Copied!
Configure the configfile.json with the user's access-key and secret-key
1
cd caas-rest-client
2
​
3
cat configfile.json
4
​
5
{
6
"secure": true,
7
"host": "<ip-address-of-cfxaia-platform>",
8
"login-method": "access-key",
9
"access-key": "<access-key-id>",
10
"secret-key": "<secret-key-id>"
11
}
Copied!
host: AIA platform's IP address
access-key: User's API access key id generated in the above steps
secret-key: User's API secret key id generated in the above steps
Once configfile.json is configured with appropriate API credentials, run the below command to list all of the available reports and their metadata definitions. Save the output to a file to see all of the available report definitions.
Report definitions are nothing but metadata of each widget (pie chart, tabular chart, etc..) available within the AIA portal under different pages/reports. Each report will have a URI path which will be used to query the data.
​
​
​
Below command provides an example URI of a report that fetches the inventory data of that report.
CloudFabrix AIA application's API needs Source & Repository details as input while querying the inventory data. These values are based on the page where the report resides in the AIA UI. The below table gives these values for different pages.
Page Name
Source
Repository
Overall
lcm-manager-customer
assetLCMMaster
POR Insights
lcm-manager-customer
replacementProjection (or) assetLCMMaster
HW Assets
lcm-manager-customer
assetLCMMaster
SW Assets
lcm-manager-customer
assetLCMMaster
Contracts
lcm-manager-customer
contract-details
App Dependency
asset-app-dependency
adm
Assets List
lcm-manager-customer
assetLCMMaster
​
Below API query gets all of the available repositories under the source lcm-manager-customer within the AIA application
1
curl -k -X POST -H 'content-type: application/json' \
Each report definition from the above API response will have a report-uri string like the below example output capture, which is needed while querying the inventory data from that report.
For fetching the inventory data from a report, API requires url (i.e. report-uri from the above API's response) and filters as input parameters as shown in the below example.
1
curl -k -X POST -H 'content-type: application/json' \