Welcome, Guest
Username: Password: Remember me
Archived CloudStack Forums for reference purposes please direct all future inquiries to the Apache CloudStack mailing lists.

incubator.apache.org/cloudstack/mailing-lists.html

TOPIC: Sample java project to do the API request signing

Sample java project to do the API request signing 1 year 4 months ago #11125

  • dharshanr
  • dharshanr's Avatar
  • OFFLINE
  • Junior Boarder
  • Posts: 24
  • Thank you received: 1
  • Karma: 0
Is there sample java code that i can use to sign a request? Most folks will need this piece of code. If it doesn't exist I am happy to write this code and contribute it to the CloudStack developer community.

regards,
Dharshan.

www.ScaleGrid.net
(SaaS for the private cloud)
The administrator has disabled public write access.

Re: Sample java project to do the API request signing 1 year 4 months ago #11138

  • optiplex
  • optiplex's Avatar
  • OFFLINE
  • Gold Boarder
  • Posts: 302
  • Thank you received: 55
  • Karma: 16
Hi,

I have found a cloudstack api java in google code there.
It's really well done and easy to start with.
The part to sign the request is in too if you just need that. I played a lot with this code so don't hesitate if you need help.
Bye
The administrator has disabled public write access.
The following user(s) said Thank You: ke4qqq

Re: Sample java project to do the API request signing 1 year 3 months ago #11515

  • dharshanr
  • dharshanr's Avatar
  • OFFLINE
  • Junior Boarder
  • Posts: 24
  • Thank you received: 1
  • Karma: 0
One quick comment - The signing code in this sample project does not handle spaces correctly. It encodes space as '+' instead of '%20'. If you have spaces in your input you will have manually replace '+' with '%20'. Took me a while to figure out :)
The administrator has disabled public write access.
The following user(s) said Thank You: optiplex

Re: Sample java project to do the API request signing 1 year 3 months ago #11541

  • optiplex
  • optiplex's Avatar
  • OFFLINE
  • Gold Boarder
  • Posts: 302
  • Thank you received: 55
  • Karma: 16
Right ! I didn't notice it cause I don't use space in all my name ... I know it's always source of troubles !
I ll change that too now !
The administrator has disabled public write access.

Re: Sample java project to do the API request signing 1 year 2 months ago #12064

  • chirauki
  • chirauki's Avatar
  • OFFLINE
  • Gold Boarder
  • Posts: 193
  • Thank you received: 19
  • Karma: 11
Hi,

I had this around for a while now, just pushed into github (github.com/chirauki/csapi).

Advice! I'm sysadmin, but I "code". Pretty ugly code, but working.

It takes two arguments, the command url and "json" if you want your answer in JSON. Something like:

java -jar csapi.jar command=listCapabilities json

It makes the "listCapabilities" api call and prints json answer.

Cloud keys are read from "cloud.properties" file.

It's pretty ugly...

thx
The administrator has disabled public write access.

Re: Sample java project to do the API request signing 11 months 3 weeks ago #12943

  • dharshanr
  • dharshanr's Avatar
  • OFFLINE
  • Junior Boarder
  • Posts: 24
  • Thank you received: 1
  • Karma: 0
Hi folks,

I've put together my experiences working with the CloudStack api in a blog post - http://www.scalegrid.net/blog/?p=230.

Hopefully others can benefit from this as well.

regards,
Dharshan
www.scalegrid.net
The administrator has disabled public write access.
Time to create page: 0.292 seconds

Open@Citrix

Citrix supports the open source community via developer support and evangeslism. We have a number of developers and evangelists that participate actively in the open source community in Apache Cloudstack, OpenDaylight, Xen Project and XenServer. We also conduct educational activities via the Build A Cloud events held all over the world. 

Connect