Merge "Included content for ceilometer CLI section in user guide"

This commit is contained in:
Jenkins 2013-10-09 00:51:09 +00:00 committed by Gerrit Code Review
commit fbdb827d94
4 changed files with 171 additions and 2 deletions

View File

@ -34,6 +34,8 @@
href="section_swift_cli_commands.xml"/>
<?hard page-break?>
<xi:include
href="section_heat_cli_commands.xml"
/>
href="section_heat_cli_commands.xml"/>
<?hard page-break?>
<xi:include
href="section_ceilometer_cli_commands.xml"/>
</appendix>

View File

@ -0,0 +1,91 @@
<?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" version="5.0"
xml:id="ceilometer_client_commands">
<title>ceilometer commands</title>
<para>The ceilometer client is the command-line interface for the
OpenStack Metering API.</para>
<para>For help on a specific ceilometer command, enter:</para>
<screen><prompt>$</prompt> <userinput><command>ceilometer</command> <option>help</option> <replaceable>COMMAND</replaceable></userinput></screen>
<example>
<title>Usage</title>
<screen><computeroutput>ceilometer [--version] [-d] [-v] [-k] [--cert-file CERT_FILE]
[--key-file KEY_FILE] [--ca-file CA_FILE]
[--timeout TIMEOUT] [--os-username OS_USERNAME]
[--os-password OS_PASSWORD] [--os-tenant-id OS_TENANT_ID]
[--os-tenant-name OS_TENANT_NAME]
[--os-auth-url OS_AUTH_URL]
[--os-region-name OS_REGION_NAME]
[--os-auth-token OS_AUTH_TOKEN]
[--ceilometer-url CEILOMETER_URL]
[--ceilometer-api-version CEILOMETER_API_VERSION]
[--os-service-type OS_SERVICE_TYPE]
[--os-endpoint-type OS_ENDPOINT_TYPE]
&lt;subcommand> ...</computeroutput></screen>
</example>
<example>
<title>Positional arguments</title>
<screen><computeroutput>&lt;subcommand>
alarm-create Create a new alarm.
alarm-delete Delete an alarm.
alarm-list List the user's alarms.
alarm-show Show an alarm.
alarm-update Update an existing alarm.
meter-list List the user's meters.
resource-list List the resources.
resource-show Show the resource.
sample-create Create a sample.
sample-list List the samples for this meters.
statistics List the statistics for this meter.
help Display help about this program or one of its
subcommands.</computeroutput></screen>
</example>
<example>
<title>Optional arguments</title>
<screen><computeroutput> -d, --debug Defaults to env[HEATCLIENT_DEBUG]
--version show program's version number and exit
-d, --debug Defaults to env[CEILOMETERCLIENT_DEBUG]
-v, --verbose Print more verbose output
-k, --insecure Explicitly allow ceilometerclient to perform
"insecure" SSL (https) requests. The server's
certificate will not be verified against any
certificate authorities. This option should be used
with caution.
--cert-file CERT_FILE
Path of certificate file to use in SSL connection.
This file can optionally be prepended with the private
key.
--key-file KEY_FILE Path of client key to use in SSL connection. This
option is not necessary if your key is prepended to
your cert file.
--ca-file CA_FILE Path of CA SSL certificate(s) used to verify the
remote server certificate. Without this option
ceilometer looks for the default system CA
certificates.
--timeout TIMEOUT Number of seconds to wait for a response
--os-username OS_USERNAME
Defaults to env[OS_USERNAME]
--os-password OS_PASSWORD
Defaults to env[OS_PASSWORD]
--os-tenant-id OS_TENANT_ID
Defaults to env[OS_TENANT_ID]
--os-tenant-name OS_TENANT_NAME
Defaults to env[OS_TENANT_NAME]
--os-auth-url OS_AUTH_URL
Defaults to env[OS_AUTH_URL]
--os-region-name OS_REGION_NAME
Defaults to env[OS_REGION_NAME]
--os-auth-token OS_AUTH_TOKEN
Defaults to env[OS_AUTH_TOKEN]
--ceilometer-url CEILOMETER_URL
Defaults to env[CEILOMETER_URL]
--ceilometer-api-version CEILOMETER_API_VERSION
Defaults to env[CEILOMETER_API_VERSION] or 2
--os-service-type OS_SERVICE_TYPE
Defaults to env[OS_SERVICE_TYPE]
--os-endpoint-type OS_ENDPOINT_TYPE
Defaults to env[OS_ENDPOINT_TYPE]</computeroutput></screen>
</example>
</section>

View File

@ -38,6 +38,8 @@
<xi:include href="section_swift_cli_howto.xml"/>
<?hard-pagebreak?>
<xi:include href="section_heat_cli.xml"/>
<?hard-pagebreak?>
<xi:include href="section_ceilometer_cli.xml"/>
<?hard-pagebreak?>
<xi:include href="../common/section_cinder_cli_manage_volumes.xml"/>
</chapter>

View File

@ -0,0 +1,74 @@
<?xml version="1.0" encoding="UTF-8"?>
<section 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="ceilometer_cli_commands">
<title>Metering</title>
<para>Metering is the service that measures cloud resources within OpenStack. It collects information about what, who, when and how much regarding anything that can be billed. For Havana, metering is available to the user using only the CLI.</para>
<para>As an example, we create a heat autoscaling stack and see some of the ceilometer command outputs.</para>
<procedure>
<step><para>Create a heat autoscaling stack, using the following command:</para>
<screen><prompt>$</prompt> <userinput><?db-font-size 75%?>heat stack-create -f cfn/F17/AutoScalingCeilometer.yaml -P "KeyName=heat_key"</userinput></screen>
</step>
<step><para>To see the list of heat resources created, run the following command:</para>
<screen><prompt>$</prompt> <userinput><?db-font-size 75%?>heat resource-list</userinput></screen>
<screen><computeroutput><?db-font-size 65%?>
+--------------------------+-----------------------------------------+-----------------+----------------------+
| resource_name | resource_type |resource_status | updated_time |
+--------------------------+-----------------------------------------+-----------------+----------------------+
| CfnUser | AWS::IAM::User |CREATE_COMPLETE | 2013-10-02T05:53:41Z |
| WebServerKeys | AWS::IAM::AccessKey |CREATE_COMPLETE | 2013-10-02T05:53:42Z |
| LaunchConfig | AWS::AutoScaling::LaunchConfiguration |CREATE_COMPLETE | 2013-10-02T05:53:43Z |
| ElasticLoadBalancer | AWS::ElasticLoadBalancing::LoadBalancer |UPDATE_COMPLETE | 2013-10-02T05:55:58Z |
| WebServerGroup | AWS::AutoScaling::AutoScalingGroup |CREATE_COMPLETE | 2013-10-02T05:55:58Z |
| WebServerScaleDownPolicy | AWS::AutoScaling::ScalingPolicy |CREATE_COMPLETE | 2013-10-02T05:56:00Z |
| WebServerScaleUpPolicy | AWS::AutoScaling::ScalingPolicy |CREATE_COMPLETE | 2013-10-02T05:56:00Z |
| CPUAlarmHigh | OS::Ceilometer::Alarm |CREATE_COMPLETE | 2013-10-02T05:56:02Z |
| CPUAlarmLow | OS::Ceilometer::Alarm |CREATE_COMPLETE | 2013-10-02T05:56:02Z |
+--------------------------+-----------------------------------------+-----------------+----------------------+</computeroutput></screen>
</step>
<step><para>To see the list of alarms set, run the following command:</para>
<screen><prompt>$</prompt> <userinput><?db-font-size 75%?>ceilometer alarm-list</userinput></screen>
<screen><computeroutput><?db-font-size 65%?>
+--------------------------------------+------------------------------+-------------------+---------+------------+-------------------------------+
| Alarm ID | Name | State | Enabled | Continuous | Alarm condition |
+--------------------------------------+------------------------------+-------------------+---------+------------+-------------------------------+
| 4f896b40-0859-460b-9c6a-b0d329814496 | as-CPUAlarmLow-i6qqgkf2fubs | insufficient data | True | False | cpu_util &lt; 15.0 during 1x 60s |
| 75d8ecf7-afc5-4bdc-95ff-19ed9ba22920 | as-CPUAlarmHigh-sf4muyfruy5m | insufficient data | True | False | cpu_util > 50.0 during 1x 60s |
+--------------------------------------+------------------------------+-------------------+---------+------------+-----------------------------+</computeroutput></screen>
</step>
<step><para>To see the list of meters set, run the following command:</para>
<screen><prompt>$</prompt> <userinput><?db-font-size 75%?>ceilometer meter-list</userinput></screen>
<screen><computeroutput><?db-font-size 65%?>
+--------------------------+------------+----------+-----------------------------------------------------------------------+------------------------------------+
| Name | Type | Unit | Resource ID | User ID | Project ID |
+--------------------------+------------+----------+-----------------------------------------------------------------------+------------------------------------+
| cpu | cumulative | ns | 3965b41b-81b0-4386-bea5-6ec37c8841c1 | d1a2996d3b1f4e0e8645ba9650308011 | bf03bf32e3884d489004ac995ff7a61c |
| cpu | cumulative | ns | 62520a83-73c7-4084-be54-275fe770ef2c | d1a2996d3b1f4e0e8645ba9650308011 | bf03bf32e3884d489004ac995ff7a61c |
| cpu_util | gauge | % | 3965b41b-81b0-4386-bea5-6ec37c8841c1 | d1a2996d3b1f4e0e8645ba9650308011 | bf03bf32e3884d489004ac995ff7a61c |
+--------------------------+------------+----------+-----------------------------------------------------------------------+------------------------------------+</computeroutput></screen>
</step>
<step><para>To see the list of samples, run the following command:</para>
<screen><prompt>$</prompt> <userinput><?db-font-size 75%?>ceilometer sample-list -m cpu_util</userinput></screen>
<screen><computeroutput><?db-font-size 65%?>
+--------------------------------------+----------+-------+---------------+------+---------------------+
| Resource ID | Name | Type | Volume | Unit | Timestamp |
+--------------------------------------+----------+-------+---------------+------+---------------------+
| 3965b41b-81b0-4386-bea5-6ec37c8841c1 | cpu_util | gauge | 3.98333333333 | % | 2013-10-02T10:50:12 |
+--------------------------------------+----------+-------+---------------+------+---------------------+</computeroutput></screen>
</step>
<step><para>To see the statistics, run the following command:</para>
<screen><prompt>$</prompt> <userinput><?db-font-size 75%?>ceilometer statistics -m cpu_util</userinput></screen>
<screen><computeroutput><?db-font-size 65%?>
+--------+---------------------+---------------------+-------+---------------+---------------+---------------+---------------+----------+---------------------+---------------------+
| Period | Period Start | Period End | Count | Min | Max | Sum | Avg | Duration | Duration Start | Duration End |
+--------+---------------------+---------------------+-------+---------------+---------------+---------------+---------------+----------+---------------------+---------------------+
| 0 | 2013-10-02T10:50:12 | 2013-10-02T10:50:12 | 1 | 3.98333333333 | 3.98333333333 | 3.98333333333 | 3.98333333333 | 0.0 | 2013-10-02T10:50:12 | 2013-10-02T10:50:12 |
+--------+---------------------+---------------------+-------+---------------+---------------+---------------+---------------+----------+---------------------+---------------------+</computeroutput></screen>
</step>
</procedure>
</section>