Skip to content

Commit

Permalink
Adds starting point for an OpenStack CLI guide.
Browse files Browse the repository at this point in the history
Patchset reorganizes based on feedback.

Patchset 4 and 5 addresses Diane's feedback, separating out version, help,
and so on.
Patchset 6 renames some files, adds some glance CLI commands in an
outline, unfinished.

Fixes
bug 1019718
bug 1031578
bug 988902

Change-Id: I530b29eca200830d866b09431e522efdc3454f2c
  • Loading branch information
annegentle committed Aug 20, 2012
1 parent 65b9fbe commit d68bcba
Show file tree
Hide file tree
Showing 23 changed files with 2,177 additions and 54 deletions.
64 changes: 19 additions & 45 deletions doc/src/docbkx/api-quick-start/src/docbkx/cli-uses.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
xmlns:xlink="http://www.w3.org/1999/xlink"
xml:id="Setting-Up-Python-novaclient"
version="5.0">
<title>Setting Up python-novaclient</title>
<title>Setting Up python-novaclient</title>

<para>For more serious scripting work, you can use a client like the python-novaclient or openstack-compute clients. The python-novaclient implements the Compute 1.1 API while the openstack-compute client works against the Rackspace Cloud Servers public cloud which is the OpenStack Compute 1.0 API. You only need a username and password to use the python-novaclient tool. </para>
<para>Installing the python-novaclient gives you a <code>nova</code> shell command that enables
Expand All @@ -16,35 +16,11 @@
<programlisting>
$ pip install -e git+https://github.com/openstack/python-novaclient.git#egg=python-novaclient
</programlisting>
<para>Now that you have installed the python-novaclient, confirm the installation by entering:</para><programlisting>
$ nova help

usage: nova [--debug] [--os_username OS_USERNAME] [--os_password OS_PASSWORD]
[--os_tenant_name OS_TENANT_NAME] [--os_auth_url OS_AUTH_URL]
[--os_region_name OS_REGION_NAME] [--service_type SERVICE_TYPE]
[--service_name SERVICE_NAME] [--endpoint_type ENDPOINT_TYPE]
[--version VERSION]
&lt;subcommand&gt; ...
</programlisting>
<para>In return, you will get a listing of all the commands and
parameters for the nova command line client. By setting up the
required parameters as environment variables, you can fly
through these commands on the command line. You can add
--os_username on the nova command, or set them as environment
variables. When using TryStack, you are supplied with an
endpoint, which the nova client recognizes as the NOVA_URL. On
TryStack, you can retrieve these environment variables at
https://trystack.org/dash/api_info/ after logging in.</para>
<para><programlisting>
export NOVA_USERNAME=facebook12345679
export NOVA_API_KEY=coolword
export NOVA_PROJECT_ID=facebook12345679
export NOVA_URL=https://nova-api.trystack.org:5443/v2.0
export NOVA_VERSION=1.1
</programlisting>
</para>
<para>Here are more detailed install instructions including how to
source your credentials.</para>
<xi:include href="../../../cli-guide/src/cli_install.xml" />

<section xml:id="Launching-Images-a09140"><title>Listing Images</title><para>Before you can go about the business of building your cloud, you
<section xml:id="Listing-Images-a09140"><title>Listing Images</title><para>Before you can go about the business of building your cloud, you
want to know what images are available to you by asking
the image service what kinds of configurations are
available. The image service could be compared to iTunes
Expand All @@ -65,7 +41,13 @@ $ nova image-list
+----+--------------------------------------+--------+--------+
</programlisting></para>
<para>Next you need to know the relative sizes of each of these. </para>
<para><programlisting>

<para>With the information about what is available to you, you can choose the combination of image and flavor to create your virtual servers and launch instances. </para></section>
<section xml:id="Listing-Flavors"><title>Listing Flavors</title>
<para>You also need to know the ID of the flavor
To get the list of flavors, their names,
status, and ID, use this command:</para>
<programlisting>
$ nova flavor-list

+----+-----------+-----------+------+-----------+------+-------+-------------+
Expand All @@ -77,20 +59,10 @@ $ nova flavor-list
| 4 | m1.large | 8192 | 80 | N/A | 0 | 4 | |
| 5 | m1.xlarge | 16384 | 160 | N/A | 0 | 8 | |
+----+-----------+-----------+------+-----------+------+-------+-------------+
</programlisting></para>
<para>You can also narrow down the list by using grep to find only
the Ubuntu 11.04 images with a command like this: </para>
<para>
<programlisting>

$ nova image-list | grep 'natty'

| 12 | natty-server-cloudimg-amd64-kernel | ACTIVE | |
| 13 | natty-server-cloudimg-amd64 | ACTIVE | |
</programlisting>
</para>
<para>With the information about what is available to you, you can choose the combination of image and flavor to create your virtual servers and launch instances. </para></section>
<section xml:id="Listing-Images-a01518"><title>Launching Instances </title>
</programlisting>
<para>With the information about what is available to you, you can choose the combination of image and flavor to create your virtual servers and launch instances. </para></section>

<section xml:id="Listing-Images-a01518"><title>Launching Instances </title>

<para> To launch a server, you choose an image you want to match
up to a size, find the ID for the image and the ID for the
Expand Down Expand Up @@ -141,7 +113,9 @@ $ nova list
</programlisting></para>

<para>There are three statuses you may see - ACTIVE, BUILDING, and UNKNOWN. The BUILDING status is transient and you likely will not see it. If you see UNKNOWN, run <code>nova list</code> again until it goes away.</para>
<para>To view all the information about a particular server, use nova show with the ID of the server that you got from the nova list command.</para>
<para>To view all the information about a particular server, use
<code>nova show</code> with the ID of the server that
you got from the nova list command.</para>
<programlisting>
$ nova show 1805

Expand Down
134 changes: 134 additions & 0 deletions doc/src/docbkx/cli-guide/pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,134 @@
<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">

<modelVersion>4.0.0</modelVersion>

<groupId>org.openstack.docs</groupId>
<artifactId>openstack-guide</artifactId>
<version>1.0.0-SNAPSHOT</version>
<packaging>jar</packaging>
<name>OpenStack CLI Guide</name>
<!-- ################################################ -->
<!-- Use "mvn clean generate-sources" to run this POM -->
<!-- ################################################ -->
<profiles>
<profile>
<id>Rackspace Research Repositories</id>
<activation>
<activeByDefault>true</activeByDefault>
</activation>
<repositories>
<repository>
<id>rackspace-research</id>
<name>Rackspace Research Repository</name>
<url>http://maven.research.rackspacecloud.com/content/groups/public/</url>
</repository>
</repositories>
<pluginRepositories>
<pluginRepository>
<id>rackspace-research</id>
<name>Rackspace Research Repository</name>
<url>http://maven.research.rackspacecloud.com/content/groups/public/</url>
</pluginRepository>
</pluginRepositories>
</profile>
</profiles>

<build>
<resources>
<resource>
<directory>target/docbkx/pdf</directory>
<excludes>
<exclude>**/*.fo</exclude>
</excludes>
</resource>
</resources>
<plugins>

<plugin>
<groupId>com.rackspace.cloud.api</groupId>
<artifactId>clouddocs-maven-plugin</artifactId>
<version>1.4.0</version>
<executions>
<!--<execution>
<id>goal1</id>
<goals>
<goal>generate-pdf</goal>
</goals>
<phase>generate-sources</phase>
<configuration>
<highlightSource>false</highlightSource>
<sectionAutolabel>0</sectionAutolabel>
<sectionLabelIncludesComponentLabel>0</sectionLabelIncludesComponentLabel>
</configuration>
</execution>-->
<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-cliguide</disqusShortname>
<enableGoogleAnalytics>1</enableGoogleAnalytics>
<googleAnalyticsId>UA-17511903-6</googleAnalyticsId>
<!--<generateToc>
appendix toc,title
article/appendix nop
article toc,title
book title,figure,table,example,equation
chapter toc,title
part toc,title
preface toc,title
qandadiv toc
qandaset toc
reference toc,title
set toc,title
</generateToc>-->
<!-- 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/bk-cli-guide/content"/>
<echo
file="${project.build.directory}/docbkx/webhelp/bk-cli-guide/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/bk-cli-guide/content/deleteme.html"/>
</postProcess>

</configuration>
</execution>
</executions>
<configuration>
<!-- These parameters apply to pdf and webhelp -->
<xincludeSupported>true</xincludeSupported>
<sourceDirectory>src</sourceDirectory>
<includes>
bk-cli-guide.xml
</includes>
<!--<canonicalUrlBase>http://docs.openstack.org/cli/bk-cli-guide/content/</canonicalUrlBase>-->
<profileSecurity>reviewer</profileSecurity>
<branding>openstack</branding>
</configuration>
</plugin>
</plugins>
</build>

</project>
30 changes: 30 additions & 0 deletions doc/src/docbkx/cli-guide/src/bk-cli-guide.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
<?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-cli-guide">
<title>OpenStack CLI Guide</title>
<?dbhtml stop-chunking?>
<para> Each OpenStack project has a Command-Line-Interface (CLI)
that interacts with the service's REST API. </para>

<xi:include href="cli_overview.xml" />
<xi:include href="cli_credentials.xml" />
<xi:include href="cli_version.xml" />
<xi:include href="cli_help.xml" />
<xi:include href="nova_cli_install.xml"/>
<xi:include href="nova_cli_commands.xml"/>
<xi:include href="nova_cli_howto.xml"/>
<xi:include href="glance_cli_install.xml"/>
<xi:include href="glance_cli_commands.xml"/>
<xi:include href="glance_cli_howto.xml"/>
<xi:include href="keystone_cli_install.xml"/>
<xi:include href="keystone_cli_commands.xml"/>
<xi:include href="swift_cli_install.xml"/>
<xi:include href="swift_cli_commands.xml"/>
<!--<xi:include href="quantum_cli_install.xml"/>
<xi:include href="quantum_cli_commands.xml"/>-->

</chapter>

0 comments on commit d68bcba

Please sign in to comment.