Horizon/RESTAPI

Horizon REST API
Starting in Kilo, Horizon has a REST API that allows client side code to make API through the Horizon server without DJANGO server side rendering. This is to support the angular work being done in Horizon. It takes care of issues like cross origin resource scripting as well as leveraging authentication and authorization libraries already in existence.

THESE APIs ARE FOR THE EXCLUSIVE USE OF HORIZON DEVELOPMENT AND ARE NOT INTENDED FOR EXTERNAL USE AT THIS TIME
They are very early in development and intended to support in tree development. Until further notice, there will be no deprecation period if they need to change.

Liberty
Server sideː Client sideː

Kilo
Summit Talkː Server sideː Client sideː

Testing
To Test the Horizon REST APIs using POSTMAN (Chrome Plugin), login normally going to the exact API address (or localhost) that you'll use from POSTMAN. Once you've logged in your browser will have an access cookie that it'll pass on with all its requests.

You will also want to install the POSTMAN interceptor and log into horizon from your browser.

GET requests
Input the URL.

For exampleː http://127.0.0.1:8005/api/glance/images

Set the following header:

The GET requests should include a csrftoken cookie (eg. csrftoken=onXnBfMqIxuFGr437P91Uuxdl09t2ykQ). You should copy this off if you need to perform any POST requests.

POST requests
Input the URL.

For exampleː http://127.0.0.1:8005/api/nova/keypairs/

Set the following headers

Set the raw content as JSON formatted.

Exampleː

{ "name":"foo" }

Postman Collections
Some POSTMAN Collections to help with testing can be found below. The date that they worked is listed and collection follows.

2016-04-18
Cinder Horizonː https://www.getpostman.com/collections/342a35ae1063767049ed Glance Directː https://www.getpostman.com/collections/2ec9be630bc6b860e31d Glance Horizonː https://www.getpostman.com/collections/0fb61d16402b0b2bb640 Keystone Directː https://www.getpostman.com/collections/a8364572e67c0f067c2e Keystone Horizonː https://www.getpostman.com/collections/3fe2767e50acf34893fc Network Abstraction Horizonː https://www.getpostman.com/collections/165869c840477c8b22a7 Neutron Directː https://www.getpostman.com/collections/96ced18cd6483318ccf1 Neutron Horizonː https://www.getpostman.com/collections/f372f0480ada8fdb61ed Nova Directː https://www.getpostman.com/collections/127fc0afe0dacd4806d5 Nova Horizonː https://www.getpostman.com/collections/b5d0ed70a0c7b5f82d03 Horizon Policyː https://www.getpostman.com/collections/dd65a2cc201169bcab91 Searchlight Directː https://www.getpostman.com/collections/4165d893505350d5761a Searchlight Horizonː https://www.getpostman.com/collections/2c1fa8a695303122ad7a

Work with the following Postman environment at the bottom of this page.

2015-04-06
Keystone: https://www.getpostman.com/collections/311080eb87c7bca1b7b1 Neutron: https://www.getpostman.com/collections/401a40ae526887e378ef Network: https://www.getpostman.com/collections/be29e7af5243d09d8b99 Nova Direct: https://www.getpostman.com/collections/0b6e8b0eb23687bfeec0 Nova Horizon: https://www.getpostman.com/collections/1c24ae62ea46c8a56791 Policy: https://www.getpostman.com/collections/acf134dde5c77ad81a1b Cinder: https://www.getpostman.com/collections/6c7391cd25603c2218fe Config: https://www.getpostman.com/collections/b64d279e663de38897c8 Glance: https://www.getpostman.com/collections/2dd5e5e2e849bf3880fc