The gnocchi shell utility interacts with Gnocchi from the command line. It supports the entirety of the Gnocchi API.
You’ll need to provide the authentication method and your credentials to gnocchi.
You can do this with the --os-username, --os-password, --os-tenant-id and --os-auth-url options, but it’s easier to just set them as environment variables:
Your username.
Your password.
Project to work on.
The OpenStack auth server URL (Keystone).
If you’re using Gnocchi with no authentication, export the following variables in your environment:
export OS_AUTH_TYPE=gnocchi-noauth
export GNOCCHI_USER_ID=<youruserid>
export GNOCCHI_PROJECT_ID=<yourprojectid>
export GNOCCHI_ENDPOINT=http://urlofgnocchi
Note
OS_AUTH_TYPE is used globally by all clients supporting Keystone. Provide --os-auth-plugin gnocchi-noauth to the client instead if other clients are used in session.
If you’re using Gnocchi with basic authentication, export the following variables in your environment:
export OS_AUTH_TYPE=gnocchi-basic
export GNOCCHI_USER=<youruserid>
export GNOCCHI_ENDPOINT=http://urlofgnocchi
Note
OS_AUTH_TYPE is used globally by all clients supporting Keystone. Provide --os-auth-plugin gnocchi-basic to the client instead if other clients are used in session.
If you’re using Gnocchi with Keystone authentication, export the following variables in your environment with the appropriate values:
export OS_USERNAME=user
export OS_PASSWORD=pass
export OS_TENANT_NAME=myproject
export OS_AUTH_URL=http://auth.example.com:5000/v2.0
The command line tool will attempt to reauthenticate using your provided credentials for every request. You can override this behavior by manually supplying an auth token using --endpoint and --os-auth-token. You can alternatively set these environment variables:
export GNOCCHI_ENDPOINT=http://gnocchi.example.org:8041
export OS_AUTH_PLUGIN=token
export OS_AUTH_TOKEN=3bcc3d3a03f44e3d8377f9247b0ad155
For help on a specific gnocchi command, enter:
$ gnocchi help COMMAND
usage: gnocchi [--version] [-v | -q] [--log-file LOG_FILE] [-h] [--debug]
[--gnocchi-api-version GNOCCHI_API_VERSION] [--insecure]
[--os-cacert <ca-certificate>] [--os-cert <certificate>]
[--os-key <key>] [--timeout <seconds>] [--os-auth-type <name>]
[--user <gnocchi user>] [--endpoint <gnocchi endpoint>]
usage: gnocchi archive-policy create [-h]
[-f {html,json,json,shell,table,value,yaml,yaml}]
[-c COLUMN] [--max-width <integer>]
[--print-empty] [--noindent]
[--prefix PREFIX] -d <DEFINITION>
[-b BACK_WINDOW] [-m AGGREGATION_METHODS]
name
Create an archive policy
Positional arguments:
Optional arguments:
usage: gnocchi archive-policy delete [-h] name
Delete an archive policy
Positional arguments:
Optional arguments:
usage: gnocchi archive-policy list [-h]
[-f {csv,html,json,json,table,value,yaml,yaml}]
[-c COLUMN] [--max-width <integer>]
[--print-empty] [--noindent]
[--quote {all,minimal,none,nonnumeric}]
List archive policies
Optional arguments:
usage: gnocchi archive-policy show [-h]
[-f {html,json,json,shell,table,value,yaml,yaml}]
[-c COLUMN] [--max-width <integer>]
[--print-empty] [--noindent]
[--prefix PREFIX]
name
Show an archive policy
Positional arguments:
Optional arguments:
usage: gnocchi archive-policy update [-h]
[-f {html,json,json,shell,table,value,yaml,yaml}]
[-c COLUMN] [--max-width <integer>]
[--print-empty] [--noindent]
[--prefix PREFIX] -d <DEFINITION>
name
Update an archive policy
Positional arguments:
Optional arguments:
usage: gnocchi archive-policy-rule create [-h]
[-f {html,json,json,shell,table,value,yaml,yaml}]
[-c COLUMN] [--max-width <integer>]
[--print-empty] [--noindent]
[--prefix PREFIX] -a
ARCHIVE_POLICY_NAME -m
METRIC_PATTERN
name
Create an archive policy rule
Positional arguments:
Optional arguments:
usage: gnocchi archive-policy-rule delete [-h] name
Delete an archive policy rule
Positional arguments:
Optional arguments:
usage: gnocchi archive-policy-rule list [-h]
[-f {csv,html,json,json,table,value,yaml,yaml}]
[-c COLUMN] [--max-width <integer>]
[--print-empty] [--noindent]
[--quote {all,minimal,none,nonnumeric}]
List archive policy rules
Optional arguments:
usage: gnocchi archive-policy-rule show [-h]
[-f {html,json,json,shell,table,value,yaml,yaml}]
[-c COLUMN] [--max-width <integer>]
[--print-empty] [--noindent]
[--prefix PREFIX]
name
Show an archive policy rule
Positional arguments:
Optional arguments:
usage: gnocchi benchmark measures add [-h] [--resource-id RESOURCE_ID]
[-f {html,json,json,shell,table,value,yaml,yaml}]
[-c COLUMN] [--max-width <integer>]
[--print-empty] [--noindent]
[--prefix PREFIX] [--workers WORKERS]
--count COUNT [--batch BATCH]
[--timestamp-start TIMESTAMP_START]
[--timestamp-end TIMESTAMP_END] [--wait]
metric
Do benchmark testing of adding measurements
Positional arguments:
Optional arguments:
usage: gnocchi benchmark measures show [-h]
[-f {html,json,json,shell,table,value,yaml,yaml}]
[-c COLUMN] [--max-width <integer>]
[--print-empty] [--noindent]
[--prefix PREFIX]
[--resource-id RESOURCE_ID]
[--aggregation AGGREGATION]
[--start START] [--stop STOP]
[--granularity GRANULARITY] [--refresh]
[--resample RESAMPLE]
[--workers WORKERS] --count COUNT
metric
Do benchmark testing of measurements show
Positional arguments:
Optional arguments:
usage: gnocchi benchmark metric create [-h] [--resource-id RESOURCE_ID]
[-f {html,json,json,shell,table,value,yaml,yaml}]
[-c COLUMN] [--max-width <integer>]
[--print-empty] [--noindent]
[--prefix PREFIX]
[--archive-policy-name ARCHIVE_POLICY_NAME]
[--workers WORKERS] --count COUNT
[--keep]
Do benchmark testing of metric creation
Optional arguments:
usage: gnocchi benchmark metric show [-h] [--resource-id RESOURCE_ID]
[-f {html,json,json,shell,table,value,yaml,yaml}]
[-c COLUMN] [--max-width <integer>]
[--print-empty] [--noindent]
[--prefix PREFIX] [--workers WORKERS]
--count COUNT
metric [metric ...]
Do benchmark testing of metric show
Positional arguments:
Optional arguments:
usage: gnocchi capabilities list [-h]
[-f {html,json,json,shell,table,value,yaml,yaml}]
[-c COLUMN] [--max-width <integer>]
[--print-empty] [--noindent]
[--prefix PREFIX]
List capabilities
Optional arguments:
usage: gnocchi measures add [-h] [--resource-id RESOURCE_ID] -m MEASURE metric
Add measurements to a metric
Positional arguments:
Optional arguments:
usage: gnocchi measures batch-metrics [-h] file
Positional arguments:
Optional arguments:
usage: gnocchi measures batch-resources-metrics [-h] [--create-metrics] file
Positional arguments:
Optional arguments:
usage: gnocchi measures show [-h]
[-f {csv,html,json,json,table,value,yaml,yaml}]
[-c COLUMN] [--max-width <integer>]
[--print-empty] [--noindent]
[--quote {all,minimal,none,nonnumeric}]
[--resource-id RESOURCE_ID]
[--aggregation AGGREGATION] [--start START]
[--stop STOP] [--granularity GRANULARITY]
[--refresh] [--resample RESAMPLE]
metric
Get measurements of a metric
Positional arguments:
Optional arguments:
usage: gnocchi metric create [-h] [--resource-id RESOURCE_ID]
[-f {html,json,json,shell,table,value,yaml,yaml}]
[-c COLUMN] [--max-width <integer>]
[--print-empty] [--noindent] [--prefix PREFIX]
[--archive-policy-name ARCHIVE_POLICY_NAME]
[--unit UNIT]
[METRIC_NAME]
Create a metric
Positional arguments:
Optional arguments:
usage: gnocchi metric delete [-h] [--resource-id RESOURCE_ID]
metric [metric ...]
Delete a metric
Positional arguments:
Optional arguments:
usage: gnocchi metric list [-h]
[-f {csv,html,json,json,table,value,yaml,yaml}]
[-c COLUMN] [--max-width <integer>] [--print-empty]
[--noindent]
[--quote {all,minimal,none,nonnumeric}]
[--limit <LIMIT>] [--marker <MARKER>]
[--sort <SORT>]
List metrics
Optional arguments:
usage: gnocchi metric show [-h]
[-f {html,json,json,shell,table,value,yaml,yaml}]
[-c COLUMN] [--max-width <integer>] [--print-empty]
[--noindent] [--prefix PREFIX]
[--resource-id RESOURCE_ID]
metric
Show a metric
Positional arguments:
Optional arguments:
usage: gnocchi resource create [-h]
[-f {html,json,json,shell,table,value,yaml,yaml}]
[-c COLUMN] [--max-width <integer>]
[--print-empty] [--noindent] [--prefix PREFIX]
[--type RESOURCE_TYPE] [-a ATTRIBUTE]
[-m ADD_METRIC] [-n CREATE_METRIC]
resource_id
Create a resource
Positional arguments:
Optional arguments:
usage: gnocchi resource delete [-h] resource_id
Delete a resource
Positional arguments:
Optional arguments:
usage: gnocchi resource history [-h]
[-f {csv,html,json,json,table,value,yaml,yaml}]
[-c COLUMN] [--max-width <integer>]
[--print-empty] [--noindent]
[--quote {all,minimal,none,nonnumeric}]
[--details] [--limit <LIMIT>]
[--marker <MARKER>] [--sort <SORT>]
[--type RESOURCE_TYPE]
resource_id
Show the history of a resource
Positional arguments:
Optional arguments:
usage: gnocchi resource list [-h]
[-f {csv,html,json,json,table,value,yaml,yaml}]
[-c COLUMN] [--max-width <integer>]
[--print-empty] [--noindent]
[--quote {all,minimal,none,nonnumeric}]
[--details] [--history] [--limit <LIMIT>]
[--marker <MARKER>] [--sort <SORT>]
[--type RESOURCE_TYPE]
List resources
Optional arguments:
usage: gnocchi resource show [-h]
[-f {html,json,json,shell,table,value,yaml,yaml}]
[-c COLUMN] [--max-width <integer>]
[--print-empty] [--noindent] [--prefix PREFIX]
[--type RESOURCE_TYPE]
resource_id
Show a resource
Positional arguments:
Optional arguments:
usage: gnocchi resource update [-h]
[-f {html,json,json,shell,table,value,yaml,yaml}]
[-c COLUMN] [--max-width <integer>]
[--print-empty] [--noindent] [--prefix PREFIX]
[--type RESOURCE_TYPE] [-a ATTRIBUTE]
[-m ADD_METRIC] [-n CREATE_METRIC]
[-d DELETE_METRIC]
resource_id
Update a resource
Positional arguments:
Optional arguments:
usage: gnocchi resource-type create [-h]
[-f {html,json,json,shell,table,value,yaml,yaml}]
[-c COLUMN] [--max-width <integer>]
[--print-empty] [--noindent]
[--prefix PREFIX] [-a ATTRIBUTE]
name
Create a resource type
Positional arguments:
Optional arguments:
usage: gnocchi resource-type delete [-h] name
Delete a resource type
Positional arguments:
Optional arguments:
usage: gnocchi resource-type list [-h]
[-f {csv,html,json,json,table,value,yaml,yaml}]
[-c COLUMN] [--max-width <integer>]
[--print-empty] [--noindent]
[--quote {all,minimal,none,nonnumeric}]
List resource types
Optional arguments:
usage: gnocchi resource-type show [-h]
[-f {html,json,json,shell,table,value,yaml,yaml}]
[-c COLUMN] [--max-width <integer>]
[--print-empty] [--noindent]
[--prefix PREFIX]
name
Show a resource type
Positional arguments:
Optional arguments:
usage: gnocchi status [-h] [-f {html,json,json,shell,table,value,yaml,yaml}]
[-c COLUMN] [--max-width <integer>] [--print-empty]
[--noindent] [--prefix PREFIX]
Show the status of measurements processing
Optional arguments: