Community
 
 
 

CloudPortal Business Manager 2.x

팔로워 324명
 
Avatar
Pankaj Paliwal

How to access CloudPortal to get Volume related information?

Avatar

How to access CloudPortal to get Volume related information?

Some data in CPBM is fetched from CloudPortal during user operating, Such as Instances and Volumes in Service:

 

a.png .

 

Who know how to get the information in the Custom Report development?

 

From CloudPortal log I found CPBM should access  CloudPortal by http api:

 

2014-01-27 14:21:31,448 DEBUG [cloud.api.ApiServlet] (catalina-exec-12:null) ===END===  10.201.190.107 -- GET  response=json&pagesize=14&listall=true&page=1&command=listVolumes&tenantParam=a0b2dd0c-43cc-440a-8058-6f0de6598af4&_=1390803690873&sessionkey=Yuqv5n4nTenKGOrZHkHr%2BJUaYiQ%3D&jSessionId=1017A22F03129D8C69040076BBF77BB9
2014-01-27 14:21:31,678 DEBUG [cloud.api.ApiServlet] (catalina-exec-7:null) ===START===  10.201.190.107 -- GET  id=1a52bace-e7cd-443b-8335-209b9bdfac1f&response=json&listall=true&command=listVolumes&tenantParam=a0b2dd0c-43cc-440a-8058-6f0de6598af4&_=1390803691096&sessionkey=Yuqv5n4nTenKGOrZHkHr%2BJUaYiQ%3D&jSessionId=1017A22F03129D8C69040076BBF77BB9
2014-01-27 14:21:31,697 DEBUG [cloud.api.ApiServlet] (catalina-exec-7:null) ===END===  10.201.190.107 -- GET  id=1a52bace-e7cd-443b-8335-209b9bdfac1f&response=json&listall=true&command=listVolumes&tenantParam=a0b2dd0c-43cc-440a-8058-6f0de6598af4&_=1390803691096&sessionkey=Yuqv5n4nTenKGOrZHkHr%2BJUaYiQ%3D&jSessionId=1017A22F03129D8C69040076BBF77BB9

 


Yongjun Tan MEMBERS
댓글 3개
0
 
 

공식 댓글

Avatar
Pankaj Paliwal
Avatar

Hi Yongjun,

 

You can find the API and Secret key under My Profile >> API Credentials >> <in section for the CCP service>.

And the endpoint will be http://<CPBM host>:<port>/portal/client/apis/<ccp suffix>

 

*CCP suffix is a unique code provided when you add a new instance of a CCP service.

 

 

Thanks,

Manish


Manish Agarwal CITRIX EMPLOYEES
댓글 작업 고유 링크

댓글을 남기려면 로그인하세요.

 
 

Previous 댓글 3개

Avatar
Pankaj Paliwal
Avatar

How to access CloudPortal to get Volume related information?

Hi Yongjun,

 

Sorry, but the CPBM customisation does not provide any way to make direct call to any cloud service. The calls that you see in the CCP logs are the calls made from the CCP connector running in CPBM.

 

 

Thanks,

Manish


Manish Agarwal CITRIX EMPLOYEES
댓글 작업 고유 링크
Avatar
Pankaj Paliwal
Avatar

Thanks, Manish

 

From "CloudPlatform(powered by Apache CloudStack) Version 4.2.1 Developer's Guide Revised November 15, 2013 03:00 pm Pacific" I got that we can access CloudPlatform  by API Request:

It said in Chapter 5:

Making API Requests
All CloudStack API requests are submitted in the form of a HTTP GET/POST with an associated
command and any parameters. A request is composed of the following whether in HTTP or HTTPS:
⢠CloudStack API URL: This is the web services API entry point(for example, http://
⢠Command: The web services command you wish to execute, such as start a virtual machine or
create a disk volume
⢠Parameters: Any additional required or optional parameters for the command
A sample API GET request looks like the following:
command=deployVirtualMachine&serviceOfferingId=1&diskOfferingId=1&templateId=2&zoneId=4&apiKey=miVr6X7u6b
jB8CG20YI3yaxXcgpyuaIRmFI_EJTVwZ0nUkkJbPmY3y2bciKwFQ&signature=Lxx1DM40AjcXU%2FcaiK8RAP0O1hU
%3D

 

 

I tried to do that like above guide but failed. I suspect signature is generated wrongly.

Where can I get the api key and secret key? It is admin's keys?

============================

To generate the signature.
1. For each field-value pair (as separated by a â&â) in the Command String, URL encode each value
so that it can be safely sent via HTTP GET.
Note
Make sure all spaces are encoded as â%20â rather than â+â.
 
2. Lower case the entire Command String and sort it alphabetically via the field for each field-value
pair. The result of this step would look like the following.
apikey=mivr6x7u6bn_sdahobpjnejpgest35exq-
jb8cg20yi3yaxxcgpyuairmfi_ejtvwz0nukkjbpmy3y2bcikwfq&command=deployvirtualmachine&diskofferingid=1&serviceof
 
3. Take the sorted Command String and run it through the HMAC SHA-1 hashing algorithm (most
programming languages offer a utility method to do this) with the userâs Secret Key. Base64
46Enabling API Call Expiration
encode the resulting byte array in UTF-8 so that it can be safely transmitted via HTTP. The final
string produced after Base64 encoding should be âLxx1DM40AjcXU%2FcaiK8RAP0O1hU%3Dâ.
By reconstructing the final URL in the format Base URL+API Path+Command String+Signature,
the final URL should look like:
command=deployVirtualMachine&serviceOfferingId=1&diskOfferingId=1&templateId=2&zoneId=4&apiKey=miVr6X
jB8CG20YI3yaxXcgpyuaIRmFI_EJTVwZ0nUkkJbPmY3y2bciKwFQ&signature=Lxx1DM40AjcXU
%2FcaiK8RAP0O1hU%3D

Yongjun Tan MEMBERS
댓글 작업 고유 링크

Top Contributors