Ask Your Question
0

how to use openstack APIs in the java or python applications [closed]

asked 2014-04-28 06:47:46 -0500

Indrajeet N gravatar image

Hell sir, I want to develop a framework for the secure live migration of virtual machine and to do that i have installed the openstack cloud. In order to create a framework i need to use the openstack APIs in java or python programming. Please give details about using the APIs of virtual machines and all.

edit retag flag offensive reopen merge delete

Closed for the following reason the question is answered, right answer was accepted by Bill@Metacloud
close date 2014-06-05 19:12:41.003614

2 answers

Sort by ยป oldest newest most voted
1

answered 2014-04-28 07:39:55 -0500

updated 2014-04-28 07:40:15 -0500

You could read the API quick start guide.

Basically you must perform a two step process:

  • authenticate against Keystone (Openstack Identity Service)
  • call Openstack APIs
edit flag offensive delete link more

Comments

thank you. How do i call openstack apis from java or python application?

Indrajeet N gravatar imageIndrajeet N ( 2014-05-05 01:01:26 -0500 )edit
3

answered 2014-04-28 11:55:57 -0500

Here is some python code to authenticate and add a new project/tenant. Run this python code after you install the command line utils and python.

from keystoneclient.v2_0 import client
keystone = client.Client(username="user_name", password="your_passwd", tenant_name="Demo", auth_url="http://horizon_url:5000/v2.0")
list=keystone.tenants.list()
tenant = keystone.tenants.create(tenant_name="test-1", description="My new tenant! via API and Python", enabled=True)

edit flag offensive delete link more

Comments

thank you for your reply sir. I need some more clarification about these APIs so i will put some more questions and try to help me regarding that.

Indrajeet N gravatar imageIndrajeet N ( 2014-05-05 01:00:36 -0500 )edit

Get to know Ask OpenStack

Resources for moderators

Question Tools

1 follower

Stats

Asked: 2014-04-28 06:47:46 -0500

Seen: 353 times

Last updated: Apr 28 '14