RETIRED, Client library for RACK API
Go to file
takehirokaneko b2e011a456 Add python-keystoneclient to requirements.txt
Change-Id: I392264248c746130504ac1227ed37b43fd299827
2014-12-18 13:22:06 +09:00
rackclient Add async fork 2014-10-15 04:36:15 +00:00
.gitignore Add async fork 2014-10-15 04:36:15 +00:00
.gitreview Add .gitreview file. 2014-10-02 10:23:56 +09:00
LICENSE Initial commit 2014-09-01 11:20:22 +09:00
README.md Modify the format of README from rst to md 2014-10-02 10:34:30 +09:00
group-init.conf.sample Adds complete python api for RACK API 2014-10-02 10:30:31 +09:00
openstack-common.conf Initial commit 2014-09-01 11:20:22 +09:00
requirements.txt Add python-keystoneclient to requirements.txt 2014-12-18 13:22:06 +09:00
setup.cfg Change description-file from README.rst to README.md 2014-10-06 16:39:25 +09:00
setup.py Adds complete python api for RACK API 2014-10-02 10:30:31 +09:00

README.md

Client library for RACK API

python-rackcilent

This is a client library for RACK API. It provides a python API and a command-line tool.

Install

git clone https://github.com/stackforge/python-rackclient.git
cd python-rackclient
pip install -r requirements.txt
python setup.py install

command-line

Once you have rackclient installed, you can use a shell command, rack, that interacts with RACK API.

You'll need to provide the endpoint of RACK API. You can set it with --rack-url option or as a environment variable:

export RACK_URL=http://example.com:8088/v1

Now you are all set.

You'll find complete documentation on the shell by running rack help command.

python API

There's also a python API. This is a very simple example:

from rackclient.v1 import client

# main client object
rack = client.Client(rack_url='http://192.168.100.218:8088/v1')

# create a process group
group = rack.groups.create(name='test-group')

# create a keypair
rack.keypairs.create(gid=group.gid, is_default=True)

# create a securitygroup
rules = [
    {
        "protocol": "tcp",
        "port_range_max": "65535",
        "port_range_min": "1",
        "remote_ip_prefix": "0.0.0.0/0"
    }
]
rack.securitygroups.create(gid=group.gid, is_default=True, securitygroup_rules=rules)

# create a network
rack.networks.create(gid=group.gid, cidr="10.10.10.0/24", dns_nameservers=["8.8.8.8"], ext_router_id="eda01125-8c40-41dd-a694-db7578ed7725")

# boot a rack-proxy
rack.proxy.create(gid=group.gid, nova_flavor_id="2", glance_image_id="42ec5e05-ade9-426d-a70a-fd5e02fcf261")

# boot a process
process = rack.processes.create(gid=group.gid, nova_flavor_id="2", glance_image_id="90d8d31c-6386-4740-8ae5-e8a80b8fc6dd")

# You can access the process's context as object's attribute
print process.gid, process.pid, process.name, ...

RACK Project Resources