Migrates API quick start one pager to RST

- Adds openstack commands

Change-Id: I57780453bd8ee214d10b646e7a989de7e33fa2a9
This commit is contained in:
Anne Gentle 2015-08-26 22:07:42 -05:00
parent 2dab47ceae
commit 4e986a3c7c
32 changed files with 1090 additions and 991 deletions

View File

@ -1,88 +0,0 @@
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<parent>
<groupId>org.openstack.docs</groupId>
<artifactId>parent-pom</artifactId>
<version>1.0.0-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>openstack-api-quick-start</artifactId>
<packaging>jar</packaging>
<name>OpenStack API Quick Start</name>
<properties>
<!-- This is set by Jenkins according to the branch. -->
<release.path.name>local</release.path.name>
<comments.enabled>1</comments.enabled>
</properties>
<!-- ################################################ -->
<!-- USE "mvn clean generate-sources" to run this POM -->
<!-- ################################################ -->
<build>
<!--
Setting the source and resource directories is not required for building the
project, but it provides certain IDEs with information necessary to show the
proper folder structure when the pom.xml is opened as a project.
-->
<sourceDirectory>src</sourceDirectory>
<resources>
<resource>
<directory>locale</directory>
</resource>
</resources>
<plugins>
<plugin>
<groupId>com.rackspace.cloud.api</groupId>
<artifactId>clouddocs-maven-plugin</artifactId>
<!-- version is set in ../pom.xml file -->
<executions>
<execution>
<id>goal2</id>
<goals>
<goal>generate-webhelp</goal>
</goals>
<phase>generate-sources</phase>
<configuration>
<!-- These parameters only apply to webhelp -->
<enableDisqus>1</enableDisqus>
<disqusShortname>os-apiquickstart</disqusShortname>
<enableGoogleAnalytics>1</enableGoogleAnalytics>
<googleAnalyticsId>UA-17511903-1</googleAnalyticsId>
<!-- The following elements sets the autonumbering of sections in output for chapter numbers but no numbered sections-->
<webhelpIncludeSearchTab>false</webhelpIncludeSearchTab>
<chapterAutolabel>0</chapterAutolabel>
<chunkFirstSections>0</chunkFirstSections>
<sectionAutolabel>0</sectionAutolabel>
<sectionLabelIncludesComponentLabel>0</sectionLabelIncludesComponentLabel>
<preProcess>
<mkdir
dir="${project.build.directory}/docbkx/webhelp/api-quick-start-onepager/content"/>
<echo
file="${project.build.directory}/docbkx/webhelp/api-quick-start-onepager/content/deleteme.html"
> &lt;html xmlns="http://www.w3.org/1999/xhtml">
&lt;body> &lt;div id="content"> &lt;p>foo bar
baz&lt;/p> &lt;/div> &lt;/body> &lt;/html> </echo>
</preProcess>
<postProcess>
<delete
file="${project.build.directory}/docbkx/webhelp/api-quick-start-onepager/content/deleteme.html"
/>
</postProcess>
</configuration>
</execution>
</executions>
<configuration>
<!-- These parameters apply to pdf and webhelp -->
<xincludeSupported>true</xincludeSupported>
<sourceDirectory>src/docbkx</sourceDirectory>
<includes> api-quick-start-onepager.xml </includes>
<!--<canonicalUrlBase>http://docs.openstack.org/api/api-quick-start/content/</canonicalUrlBase>-->
<profileSecurity>reviewer</profileSecurity>
<branding>openstack</branding>
</configuration>
</plugin>
</plugins>
</build>
</project>

23
api-quick-start/setup.cfg Normal file
View File

@ -0,0 +1,23 @@
[metadata]
name = OpenStack API Quick Start
summary = OpenStack API Quick Start
description-file =
README.rst
author = OpenStack Documentation
author-email = openstack-docs@lists.openstack.org
home-page = http://docs.openstack.org/
classifier =
Intended Audience :: Developers
License :: OSI Approved :: Apache Software License
Operating System :: POSIX :: Linux
[build_sphinx]
all_files = 1
build-dir = build
source-dir = source
[pbr]
warnerrors = True
[wheel]
universal = 1

6
api-quick-start/setup.py Executable file
View File

@ -0,0 +1,6 @@
#!/usr/bin/env python
import setuptools
setuptools.setup(
setup_requires=['pbr'],
pbr=True)

View File

@ -0,0 +1,689 @@
==============
OpenStack APIs
==============
To authenticate access to OpenStack services, you must first issue an
authentication request to OpenStack Identity to acquire an
authentication token. To request an authentication token, you must
supply a payload of credentials in the authentication request.
Credentials are usually a combination of your user name and password,
and optionally, the name or ID of the tenant in which your cloud runs.
Ask your cloud administrator for your user name, password, and tenant so
that you can generate authentication tokens. Alternatively, you can
supply a token rather than a user name and password.
When you send API requests, you include the token in the
``X-Auth-Token`` header. If you access multiple OpenStack services, you
must get a token for each service. A token is valid for a limited time
before it expires. A token can also become invalid for other reasons.
For example, if the roles for a user change, existing tokens for that
user are invalid.
Authentication and API request workflow
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#. Request an authentication token from the Identity endpoint that your
cloud administrator gave you. Send a payload of credentials in the
request as shown in :ref:`authenticate`. If the request succeeds, the server
returns an authentication token.
#. Send API requests and include the token in the ``X-Auth-Token``
header. Continue to send API requests with that token until the service
completes the request or a 401 Unauthorized error occurs.
#. If the 401 Unauthorized error occurs, request another token.
The examples in this section use cURL commands. For information about
cURL, see http://curl.haxx.se/. For information about the OpenStack
APIs, see `OpenStack API
Reference <http://developer.openstack.org/api-ref.html>`__.
.. _authenticate:
Authenticate
~~~~~~~~~~~~
The payload of credentials to authenticate contains these parameters:
+-----------------------+----------------+--------------------------------------+
| Parameter | Type | Description |
+=======================+================+======================================+
| username (required) | xsd:string | The user name. If you do not provide |
| | | a user name and password, you must |
| | | provide a token. |
+-----------------------+----------------+--------------------------------------+
| password (required) | xsd:string | The password for the user. |
+-----------------------+----------------+--------------------------------------+
| *tenantName* | xsd:string | The tenant name. Both the |
| (Optional) | | *tenantId* and *tenantName* |
| | | are optional, but should not be |
| | | specified together. If both |
| | | attributes are specified, the server |
| | | responds with a 400 Bad Request. |
+-----------------------+----------------+--------------------------------------+
| *tenantId* | xsd:string | The tenant ID. Both the |
| (Optional) | | *tenantId* and *tenantName* |
| | | are optional, but should not be |
| | | specified together. If both |
| | | attributes are specified, the server |
| | | responds with a 400 Bad Request. If |
| | | you do not know the tenantId, you |
| | | can send a request with "" for the |
| | | tenantId and get the ID returned to |
| | | you in the response. |
+-----------------------+----------------+--------------------------------------+
| token (Optional) | xsd:string | A token. If you do not provide a |
| | | token, you must provide a user name |
| | | and password. |
+-----------------------+----------------+--------------------------------------+
For a typical OpenStack deployment that runs Identity, use the following cURL
command to request a token with your tenantName and ID:
.. code::
$ curl -s -X POST http://8.21.28.222:5000/v2.0/tokens \
-H "Content-Type: application/json" \
-d '{"auth": {"tenantName": "'"$OS_TENANT_NAME"'", "passwordCredentials":
{"username": "'"$OS_USERNAME"'", "password": "'"$OS_PASSWORD"'"}}}' \
| python -m json.tool
If the request succeeds, you receive a 200 OK response followed by a
response body that contains a token in the form ``"id":"token"`` and an
expiration date and time in the form ``"expires":"datetime"``.
.. note::
If you do not know your tenant name or ID, you can send an
authentication request with an empty tenantName, as follows:
.. code::
$ curl -s -X POST http://8.21.28.222:5000/v2.0/tokens \
-H "Content-Type: application/json" \
-d '{"auth": {"tenantName": "", "passwordCredentials":
{"username": "'"$OS_USERNAME"'", "password": "'"$OS_PASSWORD"'"}}}' \
| python -m json.tool
The following example shows a successful response:
.. code::
{
"access": {
"metadata": {
"is_admin": 0,
"roles": [
"9fe2ff9ee4384b1894a90878d3e92bab"
]
},
"serviceCatalog": [
{
"endpoints": [
{
"adminURL": "http://10.100.0.222:8774/v2/TENANT_ID",
"id": "0eb78b6d3f644438aea327d9c57b7b5a",
"internalURL": "http://10.100.0.222:8774/v2/TENANT_ID",
"publicURL": "http://8.21.28.222:8774/v2/TENANT_ID",
"region": "RegionOne"
}
],
"endpoints_links": [],
"name": "nova",
"type": "compute"
},
{
"endpoints": [
{
"adminURL": "http://10.100.0.222:9696/",
"id": "3f4b6015a2f9481481ca03dace8acf32",
"internalURL": "http://10.100.0.222:9696/",
"publicURL": "http://8.21.28.222:9696/",
"region": "RegionOne"
}
],
"endpoints_links": [],
"name": "neutron",
"type": "network"
},
{
"endpoints": [
{
"adminURL": "http://10.100.0.222:8776/v2/TENANT_ID",
"id": "16f6416588f64946bdcdf4a431a8f252",
"internalURL": "http://10.100.0.222:8776/v2/TENANT_ID",
"publicURL": "http://8.21.28.222:8776/v2/TENANT_ID",
"region": "RegionOne"
}
],
"endpoints_links": [],
"name": "cinder_v2",
"type": "volumev2"
},
{
"endpoints": [
{
"adminURL": "http://10.100.0.222:8779/v1.0/TENANT_ID",
"id": "be48765ae31e425cb06036b1ebab694a",
"internalURL": "http://10.100.0.222:8779/v1.0/TENANT_ID",
"publicURL": "http://8.21.28.222:8779/v1.0/TENANT_ID",
"region": "RegionOne"
}
],
"endpoints_links": [],
"name": "trove",
"type": "database"
},
{
"endpoints": [
{
"adminURL": "http://10.100.0.222:9292",
"id": "1adfcb5414304f3596fb81edb2dfb514",
"internalURL": "http://10.100.0.222:9292",
"publicURL": "http://8.21.28.222:9292",
"region": "RegionOne"
}
],
"endpoints_links": [],
"name": "glance",
"type": "image"
},
{
"endpoints": [
{
"adminURL": "http://10.100.0.222:8777",
"id": "350f3b91d73f4b3ab8a061c94ac31fbb",
"internalURL": "http://10.100.0.222:8777",
"publicURL": "http://8.21.28.222:8777",
"region": "RegionOne"
}
],
"endpoints_links": [],
"name": "ceilometer",
"type": "metering"
},
{
"endpoints": [
{
"adminURL": "http://10.100.0.222:8000/v1/",
"id": "2198b0d32a604e75a5cc1e13276a813d",
"internalURL": "http://10.100.0.222:8000/v1/",
"publicURL": "http://8.21.28.222:8000/v1/",
"region": "RegionOne"
}
],
"endpoints_links": [],
"name": "heat-cfn",
"type": "cloudformation"
},
{
"endpoints": [
{
"adminURL": "http://10.100.0.222:8776/v1/TENANT_ID",
"id": "7c193c4683d849ca8e8db493722a4d8c",
"internalURL": "http://10.100.0.222:8776/v1/TENANT_ID",
"publicURL": "http://8.21.28.222:8776/v1/TENANT_ID",
"region": "RegionOne"
}
],
"endpoints_links": [],
"name": "cinder",
"type": "volume"
},
{
"endpoints": [
{
"adminURL": "http://10.100.0.222:8773/services/Admin",
"id": "11fac8254be74d7d906110f0069e5748",
"internalURL": "http://10.100.0.222:8773/services/Cloud",
"publicURL": "http://8.21.28.222:8773/services/Cloud",
"region": "RegionOne"
}
],
"endpoints_links": [],
"name": "nova_ec2",
"type": "ec2"
},
{
"endpoints": [
{
"adminURL": "http://10.100.0.222:8004/v1/TENANT_ID",
"id": "38fa4f9afce34d4ca0f5e0f90fd758dd",
"internalURL": "http://10.100.0.222:8004/v1/TENANT_ID",
"publicURL": "http://8.21.28.222:8004/v1/TENANT_ID",
"region": "RegionOne"
}
],
"endpoints_links": [],
"name": "heat",
"type": "orchestration"
},
{
"endpoints": [
{
"adminURL": "http://10.100.0.222:35357/v2.0",
"id": "256cdf78ecb04051bf0f57ec11070222",
"internalURL": "http://10.100.0.222:5000/v2.0",
"publicURL": "http://8.21.28.222:5000/v2.0",
"region": "RegionOne"
}
],
"endpoints_links": [],
"name": "keystone",
"type": "identity"
}
],
"token": {
"audit_ids": [
"gsjrNoqFSQeuLUo0QeJprQ"
],
"expires": "2014-12-15T15:09:29Z",
"id": "TOKEN_ID",
"issued_at": "2014-12-15T14:09:29.794527",
"tenant": {
"description": "Auto created account",
"enabled": true,
"id": "TENANT_ID",
"name": "USERNAME"
}
},
"user": {
"id": "USER_ID",
"name": "USERNAME",
"roles": [
{
"name": "_member_"
}
],
"roles_links": [],
"username": "USERNAME"
}
}
}
Send API requests
~~~~~~~~~~~~~~~~~
This section shows how to make some basic Compute API calls. For a
complete list of Compute API v2.0 calls, see `Compute APIs and
Extensions <http://developer.openstack.org/api-ref-compute-v2.html>`__.
Use the Compute API to list flavors, as follows:
.. code::
$ curl -s -H \
"X-Auth-Token:token" \
http://8.21.28.222:8774/v2/tenant_id/flavors \
| python -m json.tool
.. code::
{
"flavors": [
{
"id": "1",
"links": [
{
"href": "http://8.21.28.222:8774/v2/f9828a18c6484624b571e85728780ba8/flavors/1",
"rel": "self"
},
{
"href": "http://8.21.28.222:8774/f9828a18c6484624b571e85728780ba8/flavors/1",
"rel": "bookmark"
}
],
"name": "m1.tiny"
},
{
"id": "2",
"links": [
{
"href": "http://8.21.28.222:8774/v2/f9828a18c6484624b571e85728780ba8/flavors/2",
"rel": "self"
},
{
"href": "http://8.21.28.222:8774/f9828a18c6484624b571e85728780ba8/flavors/2",
"rel": "bookmark"
}
],
"name": "m1.small"
},
{
"id": "3",
"links": [
{
"href": "http://8.21.28.222:8774/v2/f9828a18c6484624b571e85728780ba8/flavors/3",
"rel": "self"
},
{
"href": "http://8.21.28.222:8774/f9828a18c6484624b571e85728780ba8/flavors/3",
"rel": "bookmark"
}
],
"name": "m1.medium"
},
{
"id": "4",
"links": [
{
"href": "http://8.21.28.222:8774/v2/f9828a18c6484624b571e85728780ba8/flavors/4",
"rel": "self"
},
{
"href": "http://8.21.28.222:8774/f9828a18c6484624b571e85728780ba8/flavors/4",
"rel": "bookmark"
}
],
"name": "m1.large"
},
{
"id": "5",
"links": [
{
"href": "http://8.21.28.222:8774/v2/f9828a18c6484624b571e85728780ba8/flavors/5",
"rel": "self"
},
{
"href": "http://8.21.28.222:8774/f9828a18c6484624b571e85728780ba8/flavors/5",
"rel": "bookmark"
}
],
"name": "m1.xlarge"
}
]
}
Use the Compute API to list images, as follows:
.. code::
$ curl -s -H \
"X-Auth-Token:token" \
http://8.21.28.222:8774/v2/tenant_id/images \
| python -m json.tool
.. code::
{
"images": [
{
"id": "2dadcc7b-3690-4a1d-97ce-011c55426477",
"links": [
{
"href": "http://8.21.28.222:8774/v2/f9828a18c6484624b571e85728780ba8/images/2dadcc7b-3690-4a1d-97ce-011c55426477",
"rel": "self"
},
{
"href": "http://8.21.28.222:8774/f9828a18c6484624b571e85728780ba8/images/2dadcc7b-3690-4a1d-97ce-011c55426477",
"rel": "bookmark"
},
{
"href": "http://8.21.28.222:9292/f9828a18c6484624b571e85728780ba8/images/2dadcc7b-3690-4a1d-97ce-011c55426477",
"type": "application/vnd.openstack.image",
"rel": "alternate"
}
],
"name": "Fedora 21 x86_64"
},
{
"id": "cfba3478-8645-4bc8-97e8-707b9f41b14e",
"links": [
{
"href": "http://8.21.28.222:8774/v2/f9828a18c6484624b571e85728780ba8/images/cfba3478-8645-4bc8-97e8-707b9f41b14e",
"rel": "self"
},
{
"href": "http://8.21.28.222:8774/f9828a18c6484624b571e85728780ba8/images/cfba3478-8645-4bc8-97e8-707b9f41b14e",
"rel": "bookmark"
},
{
"href": "http://8.21.28.222:9292/f9828a18c6484624b571e85728780ba8/images/cfba3478-8645-4bc8-97e8-707b9f41b14e",
"type": "application/vnd.openstack.image",
"rel": "alternate"
}
],
"name": "Ubuntu 14.04 amd64"
},
{
"id": "2e4c08a9-0ecd-4541-8a45-838479a88552",
"links": [
{
"href": "http://8.21.28.222:8774/v2/f9828a18c6484624b571e85728780ba8/images/2e4c08a9-0ecd-4541-8a45-838479a88552",
"rel": "self"
},
{
"href": "http://8.21.28.222:8774/f9828a18c6484624b571e85728780ba8/images/2e4c08a9-0ecd-4541-8a45-838479a88552",
"rel": "bookmark"
},
{
"href": "http://8.21.28.222:9292/f9828a18c6484624b571e85728780ba8/images/2e4c08a9-0ecd-4541-8a45-838479a88552",
"type": "application/vnd.openstack.image",
"rel": "alternate"
}
],
"name": "CentOS 7 x86_64"
},
{
"id": "c8dd9096-60c1-4e23-a486-82955481df9f",
"links": [
{
"href": "http://8.21.28.222:8774/v2/f9828a18c6484624b571e85728780ba8/images/c8dd9096-60c1-4e23-a486-82955481df9f",
"rel": "self"
},
{
"href": "http://8.21.28.222:8774/f9828a18c6484624b571e85728780ba8/images/c8dd9096-60c1-4e23-a486-82955481df9f",
"rel": "bookmark"
},
{
"href": "http://8.21.28.222:9292/f9828a18c6484624b571e85728780ba8/images/c8dd9096-60c1-4e23-a486-82955481df9f",
"type": "application/vnd.openstack.image",
"rel": "alternate"
}
],
"name": "CentOS 6.5 x86_64"
},
{
"id": "f97b8d36-935e-4666-9c58-8a0afc6d3796",
"links": [
{
"href": "http://8.21.28.222:8774/v2/f9828a18c6484624b571e85728780ba8/images/f97b8d36-935e-4666-9c58-8a0afc6d3796",
"rel": "self"
},
{
"href": "http://8.21.28.222:8774/f9828a18c6484624b571e85728780ba8/images/f97b8d36-935e-4666-9c58-8a0afc6d3796",
"rel": "bookmark"
},
{
"href": "http://8.21.28.222:9292/f9828a18c6484624b571e85728780ba8/images/f97b8d36-935e-4666-9c58-8a0afc6d3796",
"type": "application/vnd.openstack.image",
"rel": "alternate"
}
],
"name": "Fedora 20 x86_64"
}
]
}
Use the Compute API to list servers, as follows:
.. code::
$ curl -s -H \
"X-Auth-Token:token" \
http://8.21.28.222:8774/v2/tenant_id/servers \
| python -m json.tool
.. code::
{
"servers": [
{
"id": "41551256-abd6-402c-835b-e87e559b2249",
"links": [
{
"href": "http://8.21.28.222:8774/v2/f8828a18c6484624b571e85728780ba8/servers/41551256-abd6-402c-835b-e87e559b2249",
"rel": "self"
},
{
"href": "http://8.21.28.222:8774/f8828a18c6484624b571e85728780ba8/servers/41551256-abd6-402c-835b-e87e559b2249",
"rel": "bookmark"
}
],
"name": "test-server"
}
]
}
OpenStack command-line clients
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
For scripting work and simple requests, you can use a command-line client like
the ``openstack-client`` client. This client enables you to use the Identity,
Compute, Block Storage, and Object Storage APIs through a command-line
interface. Also, each OpenStack project has a related client project that
includes Python API bindings and a CLI.
For information about the command-line clients, see `OpenStack
Command-Line Interface Reference <http://docs.openstack.org/cli-reference/content/>`__.
Install the clients
-------------------
Use ``pip`` to install the OpenStack clients on a Mac OS X or Linux
system. It is easy and ensures that you get the latest version of the
client from the `Python Package Index <http://pypi.python.org/pypi>`__.
Also, ``pip`` lets you update or remove a package.
You must install each project's client separately, but the
python-openstackclient covers multiple projects.
Run this command to install or update a client package:
.. code::
$ sudo pip install [--upgrade] python-PROJECTclient
Where *PROJECT* is the project name.
For example, to install the ``openstack`` client, run this command:
.. code::
$ sudo pip install python-openstackclient
To update the ``openstack`` client, run this command:
.. code::
$ sudo pip install --upgrade python-openstackclient
To remove the ``openstack`` client, run this command:
.. code::
$ sudo pip uninstall python-openstackclient
Before you can issue client commands, you must download and source the
``openrc`` file to set environment variables.
For complete information about the OpenStack clients, including how to
source the ``openrc`` file, see `OpenStack End User
Guide <http://docs.openstack.org/user-guide/>`__, `OpenStack Admin
User Guide <http://docs.openstack.org/user-guide-admin/>`__, and
`OpenStack Command-Line Interface
Reference <http://docs.openstack.org/cli-reference/content/>`__.
Launch an instance
------------------
To launch instances, you must choose a name, an image, and a flavor for
your instance.
To list available images, call the Compute API through the ``openstack``
client, as follows:
.. code::
$ openstack image list
.. code::
+--------------------------------------+------------------+
| ID | Name |
+--------------------------------------+------------------+
| a5604931-af06-4512-8046-d43aabf272d3 | fedora-20.x86_64 |
+--------------------------------------+------------------+
To list flavors, run this command:
.. code::
$ openstack flavor list
.. code::
+----+-----------+-----------+------+-----------+------+-------+-----------+
| ID | Name | Memory_MB | Disk | Ephemeral | Swap | VCPUs | Is_Public |
+----+-----------+-----------+------+-----------+------+-------+-----------+
| 1 | m1.tiny | 512 | 0 | 0 | | 1 | True |
| 2 | m1.small | 2048 | 20 | 0 | | 1 | True |
| 3 | m1.medium | 4096 | 40 | 0 | | 2 | True |
| 4 | m1.large | 8192 | 80 | 0 | | 4 | True |
| 42 | m1.nano | 64 | 0 | 0 | | 1 | True |
| 5 | m1.xlarge | 16384 | 160 | 0 | | 8 | True |
| 84 | m1.micro | 128 | 0 | 0 | | 1 | True |
+----+-----------+-----------+------+-----------+------+-------+-----------+
To launch an instance, note the IDs of your desired image and flavor.
To launch an instance named ``my_instance``, run the ``openstack server
create`` command with the image and flavor IDs and the server name, as follows:
.. code::
$ openstack server create --image 949c80c8-b4ac-4315-844e-69f9bef39ed1 --flavor 1 my_instance
.. code::
+--------------------------------------+---------------------------------------------------------+
| Field | Value |
+--------------------------------------+---------------------------------------------------------+
| OS-DCF:diskConfig | MANUAL |
| OS-EXT-AZ:availability_zone | nova |
| OS-EXT-STS:power_state | 0 |
| OS-EXT-STS:task_state | scheduling |
| OS-EXT-STS:vm_state | building |
| OS-SRV-USG:launched_at | None |
| OS-SRV-USG:terminated_at | None |
| accessIPv4 | |
| accessIPv6 | |
| addresses | |
| adminPass | 3vgzpLzChoac |
| config_drive | |
| created | 2015-08-27T03:02:27Z |
| flavor | m1.tiny (1) |
| hostId | |
| id | 1553694c-d711-4954-9b20-84b8cb4598c6 |
| image | fedora-20.x86_64 (a5604931-af06-4512-8046-d43aabf272d3) |
| key_name | None |
| name | my_instance |
| os-extended-volumes:volumes_attached | [] |
| progress | 0 |
| project_id | 9f0e4aa4fd3d4b0ea3184c0fe7a32210 |
| properties | |
| security_groups | [{u'name': u'default'}] |
| status | BUILD |
| updated | 2015-08-27T03:02:28Z |
| user_id | b3ce0cfc170641e98ff5e42b1be9c85a |
+--------------------------------------+---------------------------------------------------------+
.. note::
For information about the default ports that the OpenStack components
use, see `Firewalls and default ports`_ in the *OpenStack Configuration
Reference*.
.. _Firewalls and default ports: http://docs.openstack.org/kilo/config-reference/content/firewalls-default-ports.html

View File

@ -0,0 +1,301 @@
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
# implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# This file is execfile()d with the current directory set to its
# containing dir.
#
# Note that not all possible configuration values are present in this
# autogenerated file.
#
# All configuration values have a default; values that are commented out
# serve to show the default.
import os
import openstackdocstheme
# If extensions (or modules to document with autodoc) are in another directory,
# add these directories to sys.path here. If the directory is relative to the
# documentation root, use os.path.abspath to make it absolute, like shown here.
# sys.path.insert(0, os.path.abspath('.'))
# -- General configuration ------------------------------------------------
# If your documentation needs a minimal Sphinx version, state it here.
# needs_sphinx = '1.0'
# Add any Sphinx extension module names here, as strings. They can be
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
# ones.
extensions = []
# Add any paths that contain templates here, relative to this directory.
# templates_path = ['_templates']
# The suffix of source filenames.
source_suffix = '.rst'
# The encoding of source files.
# source_encoding = 'utf-8-sig'
# The master toctree document.
master_doc = 'index'
# General information about the project.
project = u'API-Quick-Start'
bug_tag = u'api-site'
copyright = u'2015, OpenStack contributors'
# The version info for the project you're documenting, acts as replacement for
# |version| and |release|, also used in various other places throughout the
# built documents.
#
# The short X.Y version.
version = '0.1'
# The full version, including alpha/beta/rc tags.
release = '0.1'
# A few variables have to be set for the log-a-bug feature.
# giturl: The location of conf.py on Git. Must be set manually.
# gitsha: The SHA checksum of the bug description. Extracted from git log.
# bug_tag: Tag for categorizing the bug. Must be set manually.
# pwd: source tree - this is needed only for openstackdocstheme <= 1.2.2
# These variables are passed to the logabug code via html_context.
giturl = u'http://git.openstack.org/cgit/openstack/api-site/tree/api-quick-start/source'
git_cmd = "/usr/bin/git log | head -n1 | cut -f2 -d' '"
gitsha = os.popen(git_cmd).read().strip('\n')
# source tree
pwd = os.popen("pwd").read().strip('\n')
# html_context allows us to pass arbitrary values into the html template
html_context = {"pwd": pwd, "gitsha": gitsha, "bug_tag": bug_tag,
"giturl": giturl}
# The language for content autogenerated by Sphinx. Refer to documentation
# for a list of supported languages.
# language = None
# There are two options for replacing |today|: either, you set today to some
# non-false value, then it is used:
# today = ''
# Else, today_fmt is used as the format for a strftime call.
# today_fmt = '%B %d, %Y'
# List of patterns, relative to source directory, that match files and
# directories to ignore when looking for source files.
exclude_patterns = []
# The reST default role (used for this markup: `text`) to use for all
# documents.
# default_role = None
# If true, '()' will be appended to :func: etc. cross-reference text.
# add_function_parentheses = True
# If true, the current module name will be prepended to all description
# unit titles (such as .. function::).
# add_module_names = True
# If true, sectionauthor and moduleauthor directives will be shown in the
# output. They are ignored by default.
# show_authors = False
# The name of the Pygments (syntax highlighting) style to use.
pygments_style = 'sphinx'
# A list of ignored prefixes for module index sorting.
# modindex_common_prefix = []
# If true, keep warnings as "system message" paragraphs in the built documents.
# keep_warnings = False
# -- Options for HTML output ----------------------------------------------
# The theme to use for HTML and HTML Help pages. See the documentation for
# a list of builtin themes.
html_theme = 'openstackdocs'
# Theme options are theme-specific and customize the look and feel of a theme
# further. For a list of options available for each theme, see the
# documentation.
# html_theme_options = {}
# Add any paths that contain custom themes here, relative to this directory.
html_theme_path = [openstackdocstheme.get_html_theme_path()]
# The name for this set of Sphinx documents. If None, it defaults to
# "<project> v<release> documentation".
# html_title = None
# A shorter title for the navigation bar. Default is the same as html_title.
# html_short_title = None
# The name of an image file (relative to this directory) to place at the top
# of the sidebar.
# html_logo = None
# The name of an image file (within the static path) to use as favicon of the
# docs. This file should be a Windows icon file (.ico) being 16x16 or 32x32
# pixels large.
# html_favicon = None
# Add any paths that contain custom static files (such as style sheets) here,
# relative to this directory. They are copied after the builtin static files,
# so a file named "default.css" will overwrite the builtin "default.css".
# html_static_path = ['_static']
# Add any extra paths that contain custom files (such as robots.txt or
# .htaccess) here, relative to this directory. These files are copied
# directly to the root of the documentation.
# html_extra_path = []
# If not '', a 'Last updated on:' timestamp is inserted at every page bottom,
# using the given strftime format.
# So that we can enable "log-a-bug" links from each output HTML page, this
# variable must be set to a format that includes year, month, day, hours and
# minutes.
html_last_updated_fmt = '%Y-%m-%d %H:%M'
# If true, SmartyPants will be used to convert quotes and dashes to
# typographically correct entities.
# html_use_smartypants = True
# Custom sidebar templates, maps document names to template names.
# html_sidebars = {}
# Additional templates that should be rendered to pages, maps page names to
# template names.
# html_additional_pages = {}
# If false, no module index is generated.
# html_domain_indices = True
# If false, no index is generated.
html_use_index = False
# If true, the index is split into individual pages for each letter.
# html_split_index = False
# If true, links to the reST sources are added to the pages.
# This one is needed for "Report a bug".
# html_show_sourcelink = True
# If true, "Created using Sphinx" is shown in the HTML footer. Default is True.
# html_show_sphinx = True
# If true, "(C) Copyright ..." is shown in the HTML footer. Default is True.
# html_show_copyright = True
# If true, an OpenSearch description file will be output, and all pages will
# contain a <link> tag referring to it. The value of this option must be the
# base URL from which the finished HTML is served.
# html_use_opensearch = ''
# This is the file name suffix for HTML files (e.g. ".xhtml").
# html_file_suffix = None
# Output file base name for HTML help builder.
htmlhelp_basename = 'API-Quick-Start'
# -- Options for LaTeX output ---------------------------------------------
latex_elements = {
# The paper size ('letterpaper' or 'a4paper').
# 'papersize': 'letterpaper',
# The font size ('10pt', '11pt' or '12pt').
# 'pointsize': '10pt',
# Additional stuff for the LaTeX preamble.
# 'preamble': '',
}
# Grouping the document tree into LaTeX files. List of tuples
# (source start file, target name, title,
# author, documentclass [howto, manual, or own class]).
latex_documents = [
('index', 'FirstApp.tex', u'FirstApp Documentation',
u'OpenStack Doc Team', 'manual'),
]
# The name of an image file (relative to this directory) to place at the top of
# the title page.
# latex_logo = None
# For "manual" documents, if this is true, then toplevel headings are parts,
# not chapters.
# latex_use_parts = False
# If true, show page references after internal links.
# latex_show_pagerefs = False
# If true, show URL addresses after external links.
# latex_show_urls = False
# Documents to append as an appendix to all manuals.
# latex_appendices = []
# If false, no module index is generated.
# latex_domain_indices = True
# -- Options for manual page output ---------------------------------------
# One entry per manual page. List of tuples
# (source start file, name, description, authors, manual section).
man_pages = [
('index', 'api-quick-start', u'API Quick Start Documentation',
[u'OpenStack Doc Team'], 1)
]
# If true, show URL addresses after external links.
# man_show_urls = False
# -- Options for Texinfo output -------------------------------------------
# Grouping the document tree into Texinfo files. List of tuples
# (source start file, target name, title, author,
# dir menu entry, description, category)
texinfo_documents = [
('index', 'api-quick-start', u'API Quick Start Documentation',
u'OpenStack Doc Team', 'APIQuickStart', 'Describes basic OpenStack API concepts.',
'Miscellaneous'),
]
# Documents to append as an appendix to all manuals.
# texinfo_appendices = []
# If false, no module index is generated.
# texinfo_domain_indices = True
# How to display URL addresses: 'footnote', 'no', or 'inline'.
# texinfo_show_urls = 'footnote'
# If true, do not generate a @detailmenu in the "Top" node's menu.
# texinfo_no_detailmenu = False
# Set to True to enable printing of the TODO sections
todo_include_todos = False
# -- Options for Internationalization output ------------------------------
locale_dirs = ['locale/']
# -- Options for PDF output --------------------------------------------------
pdf_documents = [
('index', u'api-quick-start', u'API Quick Start Documentation',
u'OpenStack contributors')
]

View File

@ -0,0 +1,57 @@
===================
OpenStack API Guide
===================
Although you install each OpenStack service separately, the OpenStack
services work together to meet your cloud needs: Identity, Compute,
Images, Block Storage, Networking (neutron), Object Storage, Databases, and
Metering. With the `TryStack <http://www.trystack.org/>`__ OpenStack
installation, these services work together in the background of the
installation.
After you authenticate through Identity, you can use the other OpenStack
APIs to create and manage resources in your OpenStack cloud. You can
launch instances from images and assign metadata to instances through
the Compute API or the **openstack** command-line client.
To begin sending API requests, use one of the following methods:
- **cURL**
A command-line tool that lets you send HTTP requests and receive
responses. See `the section called “OpenStack
APIs” <#Compute_API_Quick_Start>`__.
- **OpenStack command-line client**
The OpenStack project provides a command-line client that enables
you to access APIs through easy-to-use commands. See `the section
called “OpenStack command-line clients” <#cli-intro>`__.
- **REST clients**
Both Mozilla and Google provide browser-based graphical interfaces
for REST. For Firefox, see
`RESTClient <https://addons.mozilla.org/en-US/firefox/addon/restclient/>`__.
For Chrome, see
`rest-client <http://code.google.com/p/rest-client/>`__.
- **OpenStack Python Software Development Kit (SDK)**
Use this SDK to write Python automation scripts that create and
manage resources in your OpenStack cloud. The SDK implements Python
bindings to the OpenStack API, which enables you to perform
automation tasks in Python by making calls on Python objects rather
than making REST calls directly. All OpenStack command-line tools are
implemented by using the Python SDK. See `OpenStack Python
SDK <http://docs.openstack.org/user-guide/sdk.html>`__ in the
*OpenStack End User Guide*.
Learn more
----------
.. toctree::
api-quick-start

View File

@ -1,172 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<section xmlns="http://docbook.org/ns/docbook"
xmlns:xi="http://www.w3.org/2001/XInclude"
xmlns:xlink="http://www.w3.org/1999/xlink"
xml:id="Compute_API_Quick_Start" version="5.0">
<title>OpenStack APIs</title>
<para>To authenticate access to OpenStack services, you must first
issue an authentication request to OpenStack Identity
to acquire an authentication token. To request an
authentication token, you must supply a payload of credentials
in the authentication request.</para>
<para>Credentials are usually a combination of your user name and
password, and optionally, the name or ID of the tenant in
which your cloud runs. Ask your cloud administrator for your
user name, password, and tenant so that you can generate
authentication tokens. Alternatively, you can supply a token
rather than a user name and password.</para>
<para>When you send API requests, you include the token in the
<literal>X-Auth-Token</literal> header. If you access
multiple OpenStack services, you must get a token for each
service. A token is valid for a limited time before it
expires. A token can also become invalid for other reasons.
For example, if the roles for a user change, existing tokens
for that user are invalid.</para>
<orderedlist>
<title>Authentication and API request workflow</title>
<listitem>
<para>Request an authentication token from the Identity
endpoint that your cloud administrator gave
you. Send a payload of credentials in the
request:</para>
<informaltable rules="all" width="85%">
<col width="30%"/>
<col width="20%"/>
<col width="50%"/>
<thead>
<tr>
<th>Parameter</th>
<th>Type</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td>username (required)</td>
<td>xsd:string</td>
<td>The user name. If you do not provide a
user name and password, you must provide a
token.</td>
</tr>
<tr>
<td>password (required)</td>
<td>xsd:string</td>
<td>The password for the user.</td>
</tr>
<tr>
<td>tenantName (Optional)</td>
<td>xsd:string</td>
<td>The tenant name. Both the
<parameter>tenantId</parameter> and
<parameter>tenantName</parameter> are
optional, but should not be specified
together. If both attributes are
specified, the server responds with a
<errorcode>400</errorcode>
<errorname>Bad Request</errorname>.</td>
</tr>
<tr>
<td>tenantId (Optional)</td>
<td>capi:UUID</td>
<td>The tenant ID. Both the
<parameter>tenantId</parameter> and
<parameter>tenantName</parameter> are optional,
but should not be specified together. If both
attributes are specified, the server responds with a
<errorcode>400</errorcode>
<errorname>Bad Request</errorname>. If you do not
know the tenantId, you can send a request with ""
for the tenantId and get the ID returned to you in
the response.</td>
</tr>
<tr>
<td>token (Optional)</td>
<td>capi:UUID</td>
<td>A token. If you do not provide a token,
you must provide a user name and
password.</td>
</tr>
</tbody>
</informaltable>
<para>If the request succeeds, the server returns an
authentication token.</para>
</listitem>
<listitem>
<para>Send API requests and include the token in the
<literal>X-Auth-Token</literal> header. Continue
to send API requests with that token until the job
completes or a <errorcode>401</errorcode>
<errortext>Unauthorized</errortext> error
occurs.</para>
</listitem>
<listitem>
<para>If the <errorcode>401</errorcode>
<errortext>Unauthorized</errortext> error occurs,
request another token.</para>
</listitem>
</orderedlist>
<para>The examples in this section use cURL commands. For
information about cURL, see <link
xlink:href="http://curl.haxx.se/"
>http://curl.haxx.se/</link>. For information about the
OpenStack APIs, see <link
xlink:href="http://developer.openstack.org/api-ref.html"
>OpenStack API Reference</link>.</para>
<?hard-pagebreak?>
<section xml:id="authenticate">
<title>Authenticate</title>
<para>For a typical OpenStack deployment that runs
Identity, use a cURL command like the following
command to request a token:</para>
<screen><?db-font-size 70%?><prompt>$</prompt> <userinput>curl -s -X POST http://8.21.28.222:5000/v2.0/tokens \
-H "Content-Type: application/json" \
-d '{"auth": {"tenantName": "'"$OS_TENANT_NAME"'", "passwordCredentials":
{"username": "'"$OS_USERNAME"'", "password": "'"$OS_PASSWORD"'"}}}' \
| python -m json.tool</userinput></screen>
<para>If the request succeeds, you receive a <returnvalue>200
OK</returnvalue> response followed by a response body
that contains a token in the form
<code>"id":"<replaceable>token</replaceable>"</code>
and an expiration date and time in the form
<code>"expires":"<replaceable>datetime</replaceable>"</code>.</para>
<para>The following example shows a successful
response:</para>
<programlisting language="json"><?db-font-size 60%?><xi:include href="get_credentials_resp.json" parse="text"/></programlisting>
<note>
<para>If you do not know your tenant name or ID, you can
send an authentication request with an empty tenantName,
as follows:</para>
<screen><?db-font-size 70%?><prompt>$</prompt> <userinput>curl -s -X POST http://8.21.28.222:5000/v2.0/tokens \
-H "Content-Type: application/json" \
-d '{"auth": {"tenantName": "", "passwordCredentials":
{"username": "'"$OS_USERNAME"'", "password": "'"$OS_PASSWORD"'"}}}' \
| python -m json.tool</userinput></screen>
</note>
</section>
<section xml:id="send-api-requests">
<title>Send API requests</title>
<para>This section shows how to make some basic
Compute API calls. For a complete list of
Compute API calls, see <link
xlink:href="http://developer.openstack.org/api-ref-compute-v2.html"
>Compute APIs and Extensions</link>.</para>
<para>Use the Compute API to list flavors, as follows:</para>
<screen><?db-font-size 70%?><prompt>$</prompt> <userinput>curl -s -H \
"X-Auth-Token:<replaceable>token</replaceable>" \
http://8.21.28.222:8774/v2/<replaceable>tenant_id</replaceable>/flavors \
| python -m json.tool</userinput></screen>
<programlisting><?db-font-size 60%?><xi:include href="flavors-post-resp.json" parse="text"/></programlisting>
<para>Use the Compute API to list images, as follows:</para>
<screen><?db-font-size 70%?><prompt>$</prompt> <userinput>curl -s -H \
"X-Auth-Token:<replaceable>token</replaceable>" \
http://8.21.28.222:8774/v2/<replaceable>tenant_id</replaceable>/images \
| python -m json.tool</userinput></screen>
<programlisting><?db-font-size 60%?><xi:include href="images-post-resp.json" parse="text"/></programlisting>
<para>Use the Compute API to list servers, as follows:</para>
<screen><?db-font-size 70%?><prompt>$</prompt> <userinput>curl -s -H \
"X-Auth-Token:<replaceable>token</replaceable>" \
http://8.21.28.222:8774/v2/<replaceable>tenant_id</replaceable>/servers \
| python -m json.tool</userinput></screen>
<programlisting><?db-font-size 60%?><xi:include href="servers-post-resp.json" parse="text"/></programlisting>
</section>
</section>

View File

@ -1,67 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<chapter xmlns="http://docbook.org/ns/docbook"
xmlns:xlink="http://www.w3.org/1999/xlink"
xmlns:xi="http://www.w3.org/2001/XInclude"
xmlns:svg="http://www.w3.org/2000/svg"
xmlns:html="http://www.w3.org/1999/xhtml" version="5.0"
xml:id="openstack-api-quick-start">
<title>OpenStack API Quick Start</title>
<?dbhtml stop-chunking?>
<para>Although you install each OpenStack service separately, the
OpenStack services work together to meet your cloud needs:
Identity, Compute, Image service, Block Storage, Networking
(neutron), Object Storage, Orchestration, and Telemetry. With
the <link xlink:href="http://www.trystack.org/"
>TryStack</link> OpenStack installation, these services
work together in the background of the installation.</para>
<para>After you authenticate through Identity, you can use the
other OpenStack APIs to create and manage resources in your
OpenStack cloud. You can launch instances from images and
assign metadata to instances through the Compute API or the
<command>nova</command> command-line client.</para>
<para>To begin sending API requests, use one of the following
methods:</para>
<itemizedlist>
<listitem>
<para><emphasis role="bold">cURL</emphasis></para>
<para>A command-line tool that lets you send HTTP requests
and receive responses. See <xref
linkend="Compute_API_Quick_Start"/>.</para>
</listitem>
<listitem>
<para><emphasis role="bold">OpenStack command-line
clients</emphasis></para>
<para>Each OpenStack project provides a command-line
client that enables you to access its API through
easy-to-use commands. See <xref linkend="cli-intro"
/>.</para>
</listitem>
<listitem>
<para><emphasis role="bold">REST clients</emphasis></para>
<para>Both Mozilla and Google provide browser-based
graphical interfaces for REST. For Firefox, see <link
xlink:href="https://addons.mozilla.org/en-US/firefox/addon/restclient/"
>RESTClient</link>. For Chrome, see <link
xlink:href="http://code.google.com/p/rest-client/"
>rest-client</link>.</para>
</listitem>
<listitem>
<para><emphasis role="bold">OpenStack Python Software
Development Kit (SDK)</emphasis></para>
<para>Use this SDK to write Python automation scripts that
create and manage resources in your OpenStack cloud.
The SDK implements Python bindings to the OpenStack
API, which enables you to perform automation tasks in
Python by making calls on Python objects rather than
making REST calls directly. All OpenStack command-line
tools are implemented by using the Python SDK. See
<link
xlink:href="http://docs.openstack.org/user-guide/sdk.html"
>OpenStack Python SDK</link> in the
<citetitle>OpenStack End User
Guide</citetitle>.</para>
</listitem>
</itemizedlist>
<xi:include href="api-quick-start-intro.xml"/>
<xi:include href="cli-uses.xml"/>
</chapter>

View File

@ -1,174 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<section xmlns="http://docbook.org/ns/docbook"
xmlns:xi="http://www.w3.org/2001/XInclude"
xmlns:xlink="http://www.w3.org/1999/xlink" xml:id="cli-intro"
version="5.0">
<title>OpenStack command-line clients</title>
<para>For scripting work, you can use a command-line client like
the <systemitem role="client">python-novaclient</systemitem>
client. This client enables you to use the Compute API through
a command-line interface.</para>
<para>For information about the command-line clients, see <link
xlink:href="http://docs.openstack.org/cli-reference/content/"
><citetitle>OpenStack Command-Line Interface
Reference</citetitle></link>.</para>
<section xml:id="cli_clients_install">
<title>Install the clients</title>
<para>Use <command>pip</command> to install the OpenStack
clients on a Mac OS X or Linux system. It is easy and
ensures that you get the latest version of the client from
the <link xlink:href="http://pypi.python.org/pypi">Python
Package Index</link>. Also, <command>pip</command>
lets you update or remove a package.</para>
<para>You must install each client separately.</para>
<para>Run this command to install or update a client
package:</para>
<screen><?db-font-size 70%?><prompt>$</prompt> <userinput>sudo pip install [--upgrade] python-<replaceable>PROJECT</replaceable>client</userinput></screen>
<para>Where <replaceable>PROJECT</replaceable> is the project
name.</para>
<para>For example, to install the <command>nova</command>
client, run this command:</para>
<screen><?db-font-size 70%?><prompt>$</prompt> <userinput>sudo pip install python-novaclient</userinput></screen>
<para>To update the <command>nova</command> client, run this
command:</para>
<screen><?db-font-size 70%?><prompt>$</prompt> <userinput>sudo pip install --upgrade python-novaclient</userinput></screen>
<para>To remove the <command>nova</command> client, run this
command:</para>
<screen><?db-font-size 70%?><prompt>$</prompt> <userinput>sudo pip uninstall python-novaclient</userinput></screen>
<para>Before you can issue client commands, you must download
and source the <filename>openrc</filename> file to set
environment variables.</para>
<para>For complete information about the OpenStack clients,
including how to source the <filename>openrc</filename>
file, see <link
xlink:href="http://docs.openstack.org/user-guide/"
xmlns:svg="http://www.w3.org/2000/svg"
xmlns:html="http://www.w3.org/1999/xhtml"
><citetitle>OpenStack End User
Guide</citetitle></link>, <link
xlink:href="http://docs.openstack.org/user-guide-admin/"
xmlns:svg="http://www.w3.org/2000/svg"
xmlns:html="http://www.w3.org/1999/xhtml"
><citetitle>OpenStack Admin User
Guide</citetitle></link>, and <link
xlink:href="http://docs.openstack.org/cli-reference/content/"
><citetitle>OpenStack Command-Line Interface
Reference</citetitle></link>.</para>
</section>
<section xml:id="list-images">
<title>Launch an instance</title>
<para>To launch instances, you must choose a name, an image,
and a flavor for your instance.</para>
<para>To list available images, call the Compute API through
the <command>nova</command> client, as follows:</para>
<screen><?db-font-size 70%?><prompt>$</prompt> <userinput>nova image-list</userinput></screen>
<screen><?db-font-size 60%?><computeroutput>+--------------------------------------+---------------------------------+--------+--------+
| ID | Name | Status | Server |
+--------------------------------------+---------------------------------+--------+--------+
| 949c80c8-b4ac-4315-844e-69f9bef39ed1 | cirros-0.3.1-x86_64-uec | ACTIVE | |
| 2d96f33d-ff66-4cac-b377-820cdf51204a | cirros-0.3.1-x86_64-uec-kernel | ACTIVE | |
| eda9e5cb-4c8c-4e88-b580-7fac80ad8e78 | cirros-0.3.1-x86_64-uec-ramdisk | ACTIVE | |
+--------------------------------------+---------------------------------+--------+--------+</computeroutput></screen>
<para>To list flavors, run this command:</para>
<screen><?db-font-size 70%?><prompt>$</prompt> <userinput>nova flavor-list</userinput></screen>
<screen><?db-font-size 60%?><computeroutput>+----+-----------+-----------+------+-----------+------+-------+-------------+-----------+
| ID | Name | Memory_MB | Disk | Ephemeral | Swap | VCPUs | RXTX_Factor | Is_Public |
+----+-----------+-----------+------+-----------+------+-------+-------------+-----------+
| 1 | m1.tiny | 512 | 0 | 0 | | 1 | 1.0 | True |
| 2 | m1.small | 2048 | 20 | 0 | | 1 | 1.0 | True |
| 3 | m1.medium | 4096 | 40 | 0 | | 2 | 1.0 | True |
| 4 | m1.large | 8192 | 80 | 0 | | 4 | 1.0 | True |
| 42 | m1.nano | 64 | 0 | 0 | | 1 | 1.0 | True |
| 5 | m1.xlarge | 16384 | 160 | 0 | | 8 | 1.0 | True |
| 84 | m1.micro | 128 | 0 | 0 | | 1 | 1.0 | True |
+----+-----------+-----------+------+-----------+------+-------+-------------+-----------+</computeroutput> </screen>
<para>To launch an instance, note the IDs of your desired
image and flavor.</para>
<para>To launch an instance named
<literal>my_instance</literal>, run the <command>nova
boot</command> command with the image and flavor IDs
and the server name, as follows:</para>
<screen><?db-font-size 70%?><prompt>$</prompt> <userinput>nova boot --image 949c80c8-b4ac-4315-844e-69f9bef39ed1 --flavor 2 my_instance</userinput></screen>
<screen><?db-font-size 60%?><computeroutput>+-------------------------------------+--------------------------------------+
| Property | Value |
+-------------------------------------+--------------------------------------+
| OS-DCF:diskConfig | MANUAL |
| OS-EXT-AZ:availability_zone | nova |
| OS-EXT-SRV-ATTR:host | None |
| OS-EXT-SRV-ATTR:hypervisor_hostname | None |
| OS-EXT-SRV-ATTR:instance_name | instance-00000001 |
| OS-EXT-STS:power_state | 0 |
| OS-EXT-STS:task_state | scheduling |
| OS-EXT-STS:vm_state | building |
| accessIPv4 | |
| accessIPv6 | |
| adminPass | XysUgJRnkB2y |
| config_drive | |
| created | 2013-11-07T17:34:16Z |
| flavor | m1.small |
| hostId | |
| id | 66129319-1f1d-420d-a226-bf9fc5ea0138 |
| image | cirros-0.3.1-x86_64-uec |
| key_name | None |
| metadata | {} |
| name | my_instance |
| progress | 0 |
| security_groups | [{u'name': u'default'}] |
| status | BUILD |
| tenant_id | 604bbe45ac7143a79e14f3158df67091 |
| updated | 2013-11-07T17:34:16Z |
| user_id | 3273a50d6cfb4a2ebc75e83cb86e1554 |
+-------------------------------------+--------------------------------------+</computeroutput></screen>
<para>Use the <command>nova list</command> command to view
your server:</para>
<screen><?db-font-size 70%?><prompt>$</prompt> <userinput>nova list</userinput></screen>
<screen><?db-font-size 60%?><computeroutput>+--------------------------------------+-------------+--------+------------+-------------+------------------+
| ID | Name | Status | Task State | Power State | Networks |
+--------------------------------------+-------------+--------+------------+-------------+------------------+
| 66129319-1f1d-420d-a226-bf9fc5ea0138 | my_instance | ACTIVE | None | Running | private=10.0.0.2 |
+--------------------------------------+-------------+--------+------------+-------------+------------------+</computeroutput></screen>
<para>To view details for a specified server, use the
<command>nova show</command> command. Include the ID
of the server:</para>
<screen><?db-font-size 70%?><prompt>$</prompt> <userinput>nova show 66129319-1f1d-420d-a226-bf9fc5ea0138</userinput></screen>
<screen><?db-font-size 60%?><computeroutput>+-------------------------------------+----------------------------------------------------------------+
| Property | Value |
+-------------------------------------+----------------------------------------------------------------+
| OS-DCF:diskConfig | MANUAL |
| OS-EXT-AZ:availability_zone | nova |
| OS-EXT-SRV-ATTR:host | devstack-grizzly |
| OS-EXT-SRV-ATTR:hypervisor_hostname | devstack-grizzly |
| OS-EXT-SRV-ATTR:instance_name | instance-00000001 |
| OS-EXT-STS:power_state | 1 |
| OS-EXT-STS:task_state | None |
| OS-EXT-STS:vm_state | active |
| accessIPv4 | |
| accessIPv6 | |
| config_drive | |
| created | 2013-11-07T17:34:16Z |
| flavor | m1.small (2) |
| hostId | d57e6f9f7885c615794b4d5a87103509620b6a7f567f7e7bd57e97a2 |
| id | 66129319-1f1d-420d-a226-bf9fc5ea0138 |
| image | cirros-0.3.1-x86_64-uec (949c80c8-b4ac-4315-844e-69f9bef39ed1) |
| key_name | None |
| metadata | {} |
| name | my_instance |
| private network | 10.0.0.2 |
| progress | 0 |
| security_groups | [{u'name': u'default'}] |
| status | ACTIVE |
| tenant_id | 604bbe45ac7143a79e14f3158df67091 |
| updated | 2013-11-07T17:34:32Z |
| user_id | 3273a50d6cfb4a2ebc75e83cb86e1554 |
+-------------------------------------+----------------------------------------------------------------+</computeroutput></screen>
<note>
<para>For information about the default ports that the
OpenStack components use, see <link
xlink:href="http://docs.openstack.org/trunk/config-reference/content/firewalls-default-ports.html">
<citetitle>Appendix A. Firewalls and default
ports</citetitle>
</link> in the <citetitle>OpenStack Configuration
Reference</citetitle>.</para>
</note>
</section>
</section>

View File

@ -1,52 +0,0 @@
{
"endpoints": [
{
"adminurl": "http://166.78.21.23:3333",
"service_id": "95ce5af0aab747e497925a5be1d88b6b",
"region": "RegionOne",
"publicurl": "http://166.78.21.23:3333",
"id": "406cae0574614d829adcbdcf16b4949b",
"internalurl": "http://166.78.21.23:3333"
},
{
"adminurl": "http://166.78.21.23:8773/services/Admin",
"service_id": "5f1f74decf1f4478a962bcc64fc085bf",
"region": "RegionOne",
"publicurl": "http://166.78.21.23:8773/services/Cloud",
"id": "14c4ae919d4045b78154744f8de08bc8",
"internalurl": "http://166.78.21.23:8773/services/Cloud"
},
{
"adminurl": "http://166.78.21.23:8776/v1/$(tenant_id)s",
"service_id": "1d95b26ad4744e6bb0010f3755655986",
"region": "RegionOne",
"publicurl": "http://166.78.21.23:8776/v1/$(tenant_id)s",
"id": "c2c8807f17f544f2a4e813adce7997a4",
"internalurl": "http://166.78.21.23:8776/v1/$(tenant_id)s"
},
{
"adminurl": "http://166.78.21.23:35357/v2.0",
"service_id": "f7c3f51731df49cf876c816b96dba615",
"region": "RegionOne",
"publicurl": "http://166.78.21.23:5000/v2.0",
"id": "f872f18d21ac4a57ae6337bf7c3b4ff0",
"internalurl": "http://166.78.21.23:5000/v2.0"
},
{
"adminurl": "http://166.78.21.23:9292",
"service_id": "675b9a6b5d9140d794f0ca72414ed688",
"region": "RegionOne",
"publicurl": "http://166.78.21.23:9292",
"id": "9883108c61af480c8715448086ec59b0",
"internalurl": "http://166.78.21.23:9292"
},
{
"internalurl": "http://166.78.21.23:8774/v2/$(tenant_id)s",
"adminurl": "http://166.78.21.23:8774/v2/$(tenant_id)s",
"service_id": "ea8d30c196904f569645bb5f6558b7dc",
"region": "RegionOne",
"id": "552b1ad2d28a42c6a80f908c6047fc06",
"publicurl": "http://166.78.21.23:8774/v2/$(tenant_id)s"
}
]
}

View File

@ -1,74 +0,0 @@
{
"flavors": [
{
"id": "1",
"links": [
{
"href": "http://8.21.28.222:8774/v2/f9828a18c6484624b571e85728780ba8/flavors/1",
"rel": "self"
},
{
"href": "http://8.21.28.222:8774/f9828a18c6484624b571e85728780ba8/flavors/1",
"rel": "bookmark"
}
],
"name": "m1.tiny"
},
{
"id": "2",
"links": [
{
"href": "http://8.21.28.222:8774/v2/f9828a18c6484624b571e85728780ba8/flavors/2",
"rel": "self"
},
{
"href": "http://8.21.28.222:8774/f9828a18c6484624b571e85728780ba8/flavors/2",
"rel": "bookmark"
}
],
"name": "m1.small"
},
{
"id": "3",
"links": [
{
"href": "http://8.21.28.222:8774/v2/f9828a18c6484624b571e85728780ba8/flavors/3",
"rel": "self"
},
{
"href": "http://8.21.28.222:8774/f9828a18c6484624b571e85728780ba8/flavors/3",
"rel": "bookmark"
}
],
"name": "m1.medium"
},
{
"id": "4",
"links": [
{
"href": "http://8.21.28.222:8774/v2/f9828a18c6484624b571e85728780ba8/flavors/4",
"rel": "self"
},
{
"href": "http://8.21.28.222:8774/f9828a18c6484624b571e85728780ba8/flavors/4",
"rel": "bookmark"
}
],
"name": "m1.large"
},
{
"id": "5",
"links": [
{
"href": "http://8.21.28.222:8774/v2/f9828a18c6484624b571e85728780ba8/flavors/5",
"rel": "self"
},
{
"href": "http://8.21.28.222:8774/f9828a18c6484624b571e85728780ba8/flavors/5",
"rel": "bookmark"
}
],
"name": "m1.xlarge"
}
]
}

View File

@ -1,191 +0,0 @@
{
"access": {
"metadata": {
"is_admin": 0,
"roles": [
"9fe2ff9ee4384b1894a90878d3e92bab"
]
},
"serviceCatalog": [
{
"endpoints": [
{
"adminURL": "http://10.100.0.222:8774/v2/TENANT_ID",
"id": "0eb78b6d3f644438aea327d9c57b7b5a",
"internalURL": "http://10.100.0.222:8774/v2/TENANT_ID",
"publicURL": "http://8.21.28.222:8774/v2/TENANT_ID",
"region": "RegionOne"
}
],
"endpoints_links": [],
"name": "nova",
"type": "compute"
},
{
"endpoints": [
{
"adminURL": "http://10.100.0.222:9696/",
"id": "3f4b6015a2f9481481ca03dace8acf32",
"internalURL": "http://10.100.0.222:9696/",
"publicURL": "http://8.21.28.222:9696/",
"region": "RegionOne"
}
],
"endpoints_links": [],
"name": "neutron",
"type": "network"
},
{
"endpoints": [
{
"adminURL": "http://10.100.0.222:8776/v2/TENANT_ID",
"id": "16f6416588f64946bdcdf4a431a8f252",
"internalURL": "http://10.100.0.222:8776/v2/TENANT_ID",
"publicURL": "http://8.21.28.222:8776/v2/TENANT_ID",
"region": "RegionOne"
}
],
"endpoints_links": [],
"name": "cinder_v2",
"type": "volumev2"
},
{
"endpoints": [
{
"adminURL": "http://10.100.0.222:8779/v1.0/TENANT_ID",
"id": "be48765ae31e425cb06036b1ebab694a",
"internalURL": "http://10.100.0.222:8779/v1.0/TENANT_ID",
"publicURL": "http://8.21.28.222:8779/v1.0/TENANT_ID",
"region": "RegionOne"
}
],
"endpoints_links": [],
"name": "trove",
"type": "database"
},
{
"endpoints": [
{
"adminURL": "http://10.100.0.222:9292",
"id": "1adfcb5414304f3596fb81edb2dfb514",
"internalURL": "http://10.100.0.222:9292",
"publicURL": "http://8.21.28.222:9292",
"region": "RegionOne"
}
],
"endpoints_links": [],
"name": "glance",
"type": "image"
},
{
"endpoints": [
{
"adminURL": "http://10.100.0.222:8777",
"id": "350f3b91d73f4b3ab8a061c94ac31fbb",
"internalURL": "http://10.100.0.222:8777",
"publicURL": "http://8.21.28.222:8777",
"region": "RegionOne"
}
],
"endpoints_links": [],
"name": "ceilometer",
"type": "metering"
},
{
"endpoints": [
{
"adminURL": "http://10.100.0.222:8000/v1/",
"id": "2198b0d32a604e75a5cc1e13276a813d",
"internalURL": "http://10.100.0.222:8000/v1/",
"publicURL": "http://8.21.28.222:8000/v1/",
"region": "RegionOne"
}
],
"endpoints_links": [],
"name": "heat-cfn",
"type": "cloudformation"
},
{
"endpoints": [
{
"adminURL": "http://10.100.0.222:8776/v1/TENANT_ID",
"id": "7c193c4683d849ca8e8db493722a4d8c",
"internalURL": "http://10.100.0.222:8776/v1/TENANT_ID",
"publicURL": "http://8.21.28.222:8776/v1/TENANT_ID",
"region": "RegionOne"
}
],
"endpoints_links": [],
"name": "cinder",
"type": "volume"
},
{
"endpoints": [
{
"adminURL": "http://10.100.0.222:8773/services/Admin",
"id": "11fac8254be74d7d906110f0069e5748",
"internalURL": "http://10.100.0.222:8773/services/Cloud",
"publicURL": "http://8.21.28.222:8773/services/Cloud",
"region": "RegionOne"
}
],
"endpoints_links": [],
"name": "nova_ec2",
"type": "ec2"
},
{
"endpoints": [
{
"adminURL": "http://10.100.0.222:8004/v1/TENANT_ID",
"id": "38fa4f9afce34d4ca0f5e0f90fd758dd",
"internalURL": "http://10.100.0.222:8004/v1/TENANT_ID",
"publicURL": "http://8.21.28.222:8004/v1/TENANT_ID",
"region": "RegionOne"
}
],
"endpoints_links": [],
"name": "heat",
"type": "orchestration"
},
{
"endpoints": [
{
"adminURL": "http://10.100.0.222:35357/v2.0",
"id": "256cdf78ecb04051bf0f57ec11070222",
"internalURL": "http://10.100.0.222:5000/v2.0",
"publicURL": "http://8.21.28.222:5000/v2.0",
"region": "RegionOne"
}
],
"endpoints_links": [],
"name": "keystone",
"type": "identity"
}
],
"token": {
"audit_ids": [
"gsjrNoqFSQeuLUo0QeJprQ"
],
"expires": "2014-12-15T15:09:29Z",
"id": "TOKEN_ID",
"issued_at": "2014-12-15T14:09:29.794527",
"tenant": {
"description": "Auto created account",
"enabled": true,
"id": "TENANT_ID",
"name": "USERNAME"
}
},
"user": {
"id": "USER_ID",
"name": "USERNAME",
"roles": [
{
"name": "_member_"
}
],
"roles_links": [],
"username": "USERNAME"
}
}
}

View File

@ -1,99 +0,0 @@
{
"images": [
{
"id": "2dadcc7b-3690-4a1d-97ce-011c55426477",
"links": [
{
"href": "http://8.21.28.222:8774/v2/f9828a18c6484624b571e85728780ba8/images/2dadcc7b-3690-4a1d-97ce-011c55426477",
"rel": "self"
},
{
"href": "http://8.21.28.222:8774/f9828a18c6484624b571e85728780ba8/images/2dadcc7b-3690-4a1d-97ce-011c55426477",
"rel": "bookmark"
},
{
"href": "http://8.21.28.222:9292/f9828a18c6484624b571e85728780ba8/images/2dadcc7b-3690-4a1d-97ce-011c55426477",
"type": "application/vnd.openstack.image",
"rel": "alternate"
}
],
"name": "Fedora 21 x86_64"
},
{
"id": "cfba3478-8645-4bc8-97e8-707b9f41b14e",
"links": [
{
"href": "http://8.21.28.222:8774/v2/f9828a18c6484624b571e85728780ba8/images/cfba3478-8645-4bc8-97e8-707b9f41b14e",
"rel": "self"
},
{
"href": "http://8.21.28.222:8774/f9828a18c6484624b571e85728780ba8/images/cfba3478-8645-4bc8-97e8-707b9f41b14e",
"rel": "bookmark"
},
{
"href": "http://8.21.28.222:9292/f9828a18c6484624b571e85728780ba8/images/cfba3478-8645-4bc8-97e8-707b9f41b14e",
"type": "application/vnd.openstack.image",
"rel": "alternate"
}
],
"name": "Ubuntu 14.04 amd64"
},
{
"id": "2e4c08a9-0ecd-4541-8a45-838479a88552",
"links": [
{
"href": "http://8.21.28.222:8774/v2/f9828a18c6484624b571e85728780ba8/images/2e4c08a9-0ecd-4541-8a45-838479a88552",
"rel": "self"
},
{
"href": "http://8.21.28.222:8774/f9828a18c6484624b571e85728780ba8/images/2e4c08a9-0ecd-4541-8a45-838479a88552",
"rel": "bookmark"
},
{
"href": "http://8.21.28.222:9292/f9828a18c6484624b571e85728780ba8/images/2e4c08a9-0ecd-4541-8a45-838479a88552",
"type": "application/vnd.openstack.image",
"rel": "alternate"
}
],
"name": "CentOS 7 x86_64"
},
{
"id": "c8dd9096-60c1-4e23-a486-82955481df9f",
"links": [
{
"href": "http://8.21.28.222:8774/v2/f9828a18c6484624b571e85728780ba8/images/c8dd9096-60c1-4e23-a486-82955481df9f",
"rel": "self"
},
{
"href": "http://8.21.28.222:8774/f9828a18c6484624b571e85728780ba8/images/c8dd9096-60c1-4e23-a486-82955481df9f",
"rel": "bookmark"
},
{
"href": "http://8.21.28.222:9292/f9828a18c6484624b571e85728780ba8/images/c8dd9096-60c1-4e23-a486-82955481df9f",
"type": "application/vnd.openstack.image",
"rel": "alternate"
}
],
"name": "CentOS 6.5 x86_64"
},
{
"id": "f97b8d36-935e-4666-9c58-8a0afc6d3796",
"links": [
{
"href": "http://8.21.28.222:8774/v2/f9828a18c6484624b571e85728780ba8/images/f97b8d36-935e-4666-9c58-8a0afc6d3796",
"rel": "self"
},
{
"href": "http://8.21.28.222:8774/f9828a18c6484624b571e85728780ba8/images/f97b8d36-935e-4666-9c58-8a0afc6d3796",
"rel": "bookmark"
},
{
"href": "http://8.21.28.222:9292/f9828a18c6484624b571e85728780ba8/images/f97b8d36-935e-4666-9c58-8a0afc6d3796",
"type": "application/vnd.openstack.image",
"rel": "alternate"
}
],
"name": "Fedora 20 x86_64"
}
]
}

View File

@ -1,18 +0,0 @@
{
"servers": [
{
"id": "41551256-abd6-402c-835b-e87e559b2249",
"links": [
{
"href": "http://8.21.28.222:8774/v2/f8828a18c6484624b571e85728780ba8/servers/41551256-abd6-402c-835b-e87e559b2249",
"rel": "self"
},
{
"href": "http://8.21.28.222:8774/f8828a18c6484624b571e85728780ba8/servers/41551256-abd6-402c-835b-e87e559b2249",
"rel": "bookmark"
}
],
"name": "test-server"
}
]
}

View File

@ -1,35 +0,0 @@
{
"tenants_links": [],
"tenants": [
{
"description": null,
"enabled": true,
"id": "3eddf34c2f814bd5bc50a382f8fba1c6",
"name": "demo"
},
{
"description": null,
"enabled": true,
"id": "604bbe45ac7143a79e14f3158df67091",
"name": "admin"
},
{
"description": null,
"enabled": true,
"id": "78323d3574e6421b98fe5894475c69fe",
"name": "service"
},
{
"description": null,
"enabled": true,
"id": "da73856734d84ec29958b048d8708d82",
"name": "invisible_to_admin"
},
{
"description": null,
"enabled": true,
"id": "ee30a93eaade41acbcf210780dd7a0ba",
"name": "alt_demo"
}
]
}

View File

@ -2,28 +2,10 @@
# directories to be set up
declare -A DIRECTORIES=(
["ca"]="api-quick-start"
["de"]="api-quick-start"
["es"]="api-quick-start"
["fr"]="api-quick-start"
["ja"]="api-quick-start"
["ko_KR"]="api-quick-start"
["pt_BR"]="api-quick-start"
["vi_VN"]="api-quick-start"
["zh_CN"]="api-quick-start"
)
# books to be built
declare -A BOOKS=(
["ca"]="api-quick-start"
["de"]="api-quick-start"
["es"]="api-quick-start"
["fr"]="api-quick-start"
["ja"]="api-quick-start"
["ko_KR"]="api-quick-start"
["pt_BR"]="api-quick-start"
["vi_VN"]="api-quick-start"
["zh_CN"]="api-quick-start"
)
# Where does the top-level pom live?
@ -38,6 +20,7 @@ DOC_DIR="./"
declare -A SPECIAL_BOOKS
SPECIAL_BOOKS=(
["firstapp"]="skip"
["api-quick-start"]="RST"
# These are translated in openstack-manuals
["common-rst"]="skip"
)

View File

@ -7,7 +7,6 @@
<version>1.0.0-SNAPSHOT</version>
<packaging>pom</packaging>
<modules>
<module>api-quick-start</module>
<module>api-guide</module>
<module>api-ref</module>
<module>api-ref-guides</module>

View File

@ -3,3 +3,4 @@
mkdir -p publish-docs
tools/build-firstapp-rst.sh
tools/build-api-start.sh

5
tools/build-api-start.sh Executable file
View File

@ -0,0 +1,5 @@
#!/bin/bash -e
mkdir -p publish-docs
tools/build-rst.sh api-quick-start --target api-quick-start

View File

@ -24,6 +24,7 @@ commands = openstack-doc-test --check-links {posargs}
commands =
openstack-doc-test --check-niceness {posargs}
doc8 firstapp
doc8 api-quick-start
[testenv:checksyntax]
commands =
@ -48,7 +49,7 @@ commands =
# Prepare documents (without www) so that they can get published on
# docs.openstack.org with just copying publish-docs/* over.
commands =
openstack-doc-test --check-build --publish --only-book api-quick-start
{toxinidir}/tools/build-api-start.sh
[testenv:publishdocs-api]
# Prepare documents (without www) so that they can get published on
@ -58,7 +59,7 @@ commands =
# We need to move api-ref-guides to the proper place:
mv publish-docs/api-ref-guides publish-docs/api-ref/
# Build and copy RST Guides
{toxinidir}/tools/build-all-rst.sh
{toxinidir}/tools/build-firstapp-rst.sh
# Delete firstapp draft documents
rm -rf publish-docs/draft/
@ -115,6 +116,10 @@ commands = sphinx-build -E -W -t libcloud firstapp/source firstapp/build/html
[testenv:firstapp-shade]
commands = sphinx-build -E -W -t shade firstapp/source firstapp/build-shade/html
[testenv:api-quick-start]
commands =
{toxinidir}/tools/build-api-start.sh
[doc8]
# Settings for doc8:
# Ignore target directories