| 1 |
========= |
| 2 |
Using CLI |
| 3 |
========= |
| 4 |
|
| 5 |
monasca CLI |
| 6 |
----------- |
| 7 |
|
| 8 |
.. toctree:: |
| 9 |
:maxdepth: 2 |
| 10 |
|
| 11 |
monasca CLI guide <monasca> |
| 12 |
monasca CLI formatting <monasca-formatting> |
| 13 |
monasca CLI debugging <monasca-debug> |
| 14 |
|
| 15 |
|
| 16 |
Usage |
| 17 |
----- |
| 18 |
|
| 19 |
You'll find complete documentation on the shell by running |
| 20 |
|
| 21 |
``monasca help``:: |
| 22 |
|
| 23 |
usage: monasca [--version] [-v | -q] [--log-file LOG_FILE] [-h] [--debug] |
| 24 |
[--os-cloud <cloud-config-name>] |
| 25 |
[--os-region-name <auth-region-name>] |
| 26 |
[--os-cacert <ca-bundle-file>] [--os-cert <certificate-file>] |
| 27 |
[--os-key <key-file>] [--verify | --insecure] |
| 28 |
[--os-default-domain <auth-domain>] |
| 29 |
[--os-interface <interface>] [--timing] [--os-beta-command] |
| 30 |
[--os-auth-type <auth-type>] [--os-code <auth-code>] |
| 31 |
[--os-protocol <auth-protocol>] |
| 32 |
[--os-project-name <auth-project-name>] |
| 33 |
[--os-trust-id <auth-trust-id>] |
| 34 |
[--os-domain-name <auth-domain-name>] |
| 35 |
[--os-user-domain-id <auth-user-domain-id>] |
| 36 |
[--os-access-token-type <auth-access-token-type>] |
| 37 |
[--os-default-domain-name <auth-default-domain-name>] |
| 38 |
[--os-access-token-endpoint <auth-access-token-endpoint>] |
| 39 |
[--os-access-token <auth-access-token>] |
| 40 |
[--os-domain-id <auth-domain-id>] |
| 41 |
[--os-user-domain-name <auth-user-domain-name>] |
| 42 |
[--os-openid-scope <auth-openid-scope>] |
| 43 |
[--os-user-id <auth-user-id>] |
| 44 |
[--os-identity-provider <auth-identity-provider>] |
| 45 |
[--os-username <auth-username>] [--os-auth-url <auth-auth-url>] |
| 46 |
[--os-client-secret <auth-client-secret>] |
| 47 |
[--os-default-domain-id <auth-default-domain-id>] |
| 48 |
[--os-discovery-endpoint <auth-discovery-endpoint>] |
| 49 |
[--os-client-id <auth-client-id>] |
| 50 |
[--os-project-domain-name <auth-project-domain-name>] |
| 51 |
[--os-project-domain-id <auth-project-domain-id>] |
| 52 |
[--os-password <auth-password>] |
| 53 |
[--os-redirect-uri <auth-redirect-uri>] |
| 54 |
[--os-endpoint <auth-endpoint>] [--os-token <auth-token>] |
| 55 |
[--os-passcode <auth-passcode>] |
| 56 |
[--os-project-id <auth-project-id>] |
| 57 |
[--monasca-api-url MONASCA_API_URL] |
| 58 |
[--monasca-api-version MONASCA_API_VERSION] |
| 59 |
|
| 60 |
Command-line interface to the OpenStack APIs |
| 61 |
|
| 62 |
optional arguments: |
| 63 |
--version show program's version number and exit |
| 64 |
-v, --verbose Increase verbosity of output. Can be repeated. |
| 65 |
-q, --quiet Suppress output except warnings and errors. |
| 66 |
--log-file LOG_FILE Specify a file to log output. Disabled by default. |
| 67 |
-h, --help Show help message and exit. |
| 68 |
--debug Show tracebacks on errors. |
| 69 |
--os-cloud <cloud-config-name> |
| 70 |
Cloud name in clouds.yaml (Env: OS_CLOUD) |
| 71 |
--os-region-name <auth-region-name> |
| 72 |
Authentication region name (Env: OS_REGION_NAME) |
| 73 |
--os-cacert <ca-bundle-file> |
| 74 |
CA certificate bundle file (Env: OS_CACERT) |
| 75 |
--os-cert <certificate-file> |
| 76 |
Client certificate bundle file (Env: OS_CERT) |
| 77 |
--os-key <key-file> Client certificate key file (Env: OS_KEY) |
| 78 |
--verify Verify server certificate (default) |
| 79 |
--insecure Disable server certificate verification |
| 80 |
--os-default-domain <auth-domain> |
| 81 |
Default domain ID, default=default. (Env: |
| 82 |
OS_DEFAULT_DOMAIN) |
| 83 |
--os-interface <interface> |
| 84 |
Select an interface type. Valid interface types: |
| 85 |
[admin, public, internal]. (Env: OS_INTERFACE) |
| 86 |
--timing Print API call timing info |
| 87 |
--os-beta-command Enable beta commands which are subject to change |
| 88 |
--os-auth-type <auth-type> |
| 89 |
Select an authentication type. Available types: |
| 90 |
v2token, admin_token, v3oidcauthcode, v2password, |
| 91 |
v3password, v3oidcaccesstoken, v3oidcpassword, token, |
| 92 |
v3oidcclientcredentials, v3tokenlessauth, v3token, |
| 93 |
v3totp, password. Default: selected based on --os- |
| 94 |
username/--os-token (Env: OS_AUTH_TYPE) |
| 95 |
--os-code <auth-code> |
| 96 |
With v3oidcauthcode: OAuth 2.0 Authorization Code |
| 97 |
(Env: OS_CODE) |
| 98 |
--os-protocol <auth-protocol> |
| 99 |
With v3oidcauthcode: Protocol for federated plugin |
| 100 |
With v3oidcaccesstoken: Protocol for federated plugin |
| 101 |
With v3oidcpassword: Protocol for federated plugin |
| 102 |
With v3oidcclientcredentials: Protocol for federated |
| 103 |
plugin (Env: OS_PROTOCOL) |
| 104 |
--os-project-name <auth-project-name> |
| 105 |
With v3oidcauthcode: Project name to scope to With |
| 106 |
v3password: Project name to scope to With |
| 107 |
v3oidcaccesstoken: Project name to scope to With |
| 108 |
v3oidcpassword: Project name to scope to With token: |
| 109 |
Project name to scope to With v3oidcclientcredentials: |
| 110 |
Project name to scope to With v3tokenlessauth: Project |
| 111 |
name to scope to With v3token: Project name to scope |
| 112 |
to With v3totp: Project name to scope to With |
| 113 |
password: Project name to scope to (Env: |
| 114 |
OS_PROJECT_NAME) |
| 115 |
--os-trust-id <auth-trust-id> |
| 116 |
With v2token: Trust ID With v3oidcauthcode: Trust ID |
| 117 |
With v2password: Trust ID With v3password: Trust ID |
| 118 |
With v3oidcaccesstoken: Trust ID With v3oidcpassword: |
| 119 |
Trust ID With token: Trust ID With |
| 120 |
v3oidcclientcredentials: Trust ID With v3token: Trust |
| 121 |
ID With v3totp: Trust ID With password: Trust ID (Env: |
| 122 |
OS_TRUST_ID) |
| 123 |
--os-domain-name <auth-domain-name> |
| 124 |
With v3oidcauthcode: Domain name to scope to With |
| 125 |
v3password: Domain name to scope to With |
| 126 |
v3oidcaccesstoken: Domain name to scope to With |
| 127 |
v3oidcpassword: Domain name to scope to With token: |
| 128 |
Domain name to scope to With v3oidcclientcredentials: |
| 129 |
Domain name to scope to With v3tokenlessauth: Domain |
| 130 |
name to scope to With v3token: Domain name to scope to |
| 131 |
With v3totp: Domain name to scope to With password: |
| 132 |
Domain name to scope to (Env: OS_DOMAIN_NAME) |
| 133 |
--os-user-domain-id <auth-user-domain-id> |
| 134 |
With v3password: User's domain id With v3totp: User's |
| 135 |
domain id With password: User's domain id (Env: |
| 136 |
OS_USER_DOMAIN_ID) |
| 137 |
--os-access-token-type <auth-access-token-type> |
| 138 |
With v3oidcauthcode: OAuth 2.0 Authorization Server |
| 139 |
Introspection token type, it is used to decide which |
| 140 |
type of token will be used when processing token |
| 141 |
introspection. Valid values are: "access_token" or |
| 142 |
"id_token" With v3oidcpassword: OAuth 2.0 |
| 143 |
Authorization Server Introspection token type, it is |
| 144 |
used to decide which type of token will be used when |
| 145 |
processing token introspection. Valid values are: |
| 146 |
"access_token" or "id_token" With |
| 147 |
v3oidcclientcredentials: OAuth 2.0 Authorization |
| 148 |
Server Introspection token type, it is used to decide |
| 149 |
which type of token will be used when processing token |
| 150 |
introspection. Valid values are: "access_token" or |
| 151 |
"id_token" (Env: OS_ACCESS_TOKEN_TYPE) |
| 152 |
--os-default-domain-name <auth-default-domain-name> |
| 153 |
With token: Optional domain name to use with v3 API |
| 154 |
and v2 parameters. It will be used for both the user |
| 155 |
and project domain in v3 and ignored in v2 |
| 156 |
authentication. With password: Optional domain name to |
| 157 |
use with v3 API and v2 parameters. It will be used for |
| 158 |
both the user and project domain in v3 and ignored in |
| 159 |
v2 authentication. (Env: OS_DEFAULT_DOMAIN_NAME) |
| 160 |
--os-access-token-endpoint <auth-access-token-endpoint> |
| 161 |
With v3oidcauthcode: OpenID Connect Provider Token |
| 162 |
Endpoint. Note that if a discovery document is being |
| 163 |
passed this option will override the endpoint provided |
| 164 |
by the server in the discovery document. With |
| 165 |
v3oidcpassword: OpenID Connect Provider Token |
| 166 |
Endpoint. Note that if a discovery document is being |
| 167 |
passed this option will override the endpoint provided |
| 168 |
by the server in the discovery document. With |
| 169 |
v3oidcclientcredentials: OpenID Connect Provider Token |
| 170 |
Endpoint. Note that if a discovery document is being |
| 171 |
passed this option will override the endpoint provided |
| 172 |
by the server in the discovery document. (Env: |
| 173 |
OS_ACCESS_TOKEN_ENDPOINT) |
| 174 |
--os-access-token <auth-access-token> |
| 175 |
With v3oidcaccesstoken: OAuth 2.0 Access Token (Env: |
| 176 |
OS_ACCESS_TOKEN) |
| 177 |
--os-domain-id <auth-domain-id> |
| 178 |
With v3oidcauthcode: Domain ID to scope to With |
| 179 |
v3password: Domain ID to scope to With |
| 180 |
v3oidcaccesstoken: Domain ID to scope to With |
| 181 |
v3oidcpassword: Domain ID to scope to With token: |
| 182 |
Domain ID to scope to With v3oidcclientcredentials: |
| 183 |
Domain ID to scope to With v3tokenlessauth: Domain ID |
| 184 |
to scope to With v3token: Domain ID to scope to With |
| 185 |
v3totp: Domain ID to scope to With password: Domain ID |
| 186 |
to scope to (Env: OS_DOMAIN_ID) |
| 187 |
--os-user-domain-name <auth-user-domain-name> |
| 188 |
With v3password: User's domain name With v3totp: |
| 189 |
User's domain name With password: User's domain name |
| 190 |
(Env: OS_USER_DOMAIN_NAME) |
| 191 |
--os-openid-scope <auth-openid-scope> |
| 192 |
With v3oidcauthcode: OpenID Connect scope that is |
| 193 |
requested from authorization server. Note that the |
| 194 |
OpenID Connect specification states that "openid" must |
| 195 |
be always specified. With v3oidcpassword: OpenID |
| 196 |
Connect scope that is requested from authorization |
| 197 |
server. Note that the OpenID Connect specification |
| 198 |
states that "openid" must be always specified. With |
| 199 |
v3oidcclientcredentials: OpenID Connect scope that is |
| 200 |
requested from authorization server. Note that the |
| 201 |
OpenID Connect specification states that "openid" must |
| 202 |
be always specified. (Env: OS_OPENID_SCOPE) |
| 203 |
--os-user-id <auth-user-id> |
| 204 |
With v2password: User ID to login with With |
| 205 |
v3password: User ID With v3totp: User ID With |
| 206 |
password: User id (Env: OS_USER_ID) |
| 207 |
--os-identity-provider <auth-identity-provider> |
| 208 |
With v3oidcauthcode: Identity Provider's name With |
| 209 |
v3oidcaccesstoken: Identity Provider's name With |
| 210 |
v3oidcpassword: Identity Provider's name With |
| 211 |
v3oidcclientcredentials: Identity Provider's name |
| 212 |
(Env: OS_IDENTITY_PROVIDER) |
| 213 |
--os-username <auth-username> |
| 214 |
With v2password: Username to login with With |
| 215 |
v3password: Username With v3oidcpassword: Username |
| 216 |
With v3totp: Username With password: Username (Env: |
| 217 |
OS_USERNAME) |
| 218 |
--os-auth-url <auth-auth-url> |
| 219 |
With v2token: Authentication URL With v3oidcauthcode: |
| 220 |
Authentication URL With v2password: Authentication URL |
| 221 |
With v3password: Authentication URL With |
| 222 |
v3oidcaccesstoken: Authentication URL With |
| 223 |
v3oidcpassword: Authentication URL With token: |
| 224 |
Authentication URL With v3oidcclientcredentials: |
| 225 |
Authentication URL With v3tokenlessauth: |
| 226 |
Authentication URL With v3token: Authentication URL |
| 227 |
With v3totp: Authentication URL With password: |
| 228 |
Authentication URL (Env: OS_AUTH_URL) |
| 229 |
--os-client-secret <auth-client-secret> |
| 230 |
With v3oidcauthcode: OAuth 2.0 Client Secret With |
| 231 |
v3oidcpassword: OAuth 2.0 Client Secret With |
| 232 |
v3oidcclientcredentials: OAuth 2.0 Client Secret (Env: |
| 233 |
OS_CLIENT_SECRET) |
| 234 |
--os-default-domain-id <auth-default-domain-id> |
| 235 |
With token: Optional domain ID to use with v3 and v2 |
| 236 |
parameters. It will be used for both the user and |
| 237 |
project domain in v3 and ignored in v2 authentication. |
| 238 |
With password: Optional domain ID to use with v3 and |
| 239 |
v2 parameters. It will be used for both the user and |
| 240 |
project domain in v3 and ignored in v2 authentication. |
| 241 |
(Env: OS_DEFAULT_DOMAIN_ID) |
| 242 |
--os-discovery-endpoint <auth-discovery-endpoint> |
| 243 |
With v3oidcauthcode: OpenID Connect Discovery Document |
| 244 |
URL. The discovery document will be used to obtain the |
| 245 |
values of the access token endpoint and the |
| 246 |
authentication endpoint. This URL should look like |
| 247 |
https://idp.example.org/.well-known/openid- |
| 248 |
configuration With v3oidcpassword: OpenID Connect |
| 249 |
Discovery Document URL. The discovery document will be |
| 250 |
used to obtain the values of the access token endpoint |
| 251 |
and the authentication endpoint. This URL should look |
| 252 |
like https://idp.example.org/.well-known/openid- |
| 253 |
configuration With v3oidcclientcredentials: OpenID |
| 254 |
Connect Discovery Document URL. The discovery document |
| 255 |
will be used to obtain the values of the access token |
| 256 |
endpoint and the authentication endpoint. This URL |
| 257 |
should look like https://idp.example.org/.well-known |
| 258 |
/openid-configuration (Env: OS_DISCOVERY_ENDPOINT) |
| 259 |
--os-client-id <auth-client-id> |
| 260 |
With v3oidcauthcode: OAuth 2.0 Client ID With |
| 261 |
v3oidcpassword: OAuth 2.0 Client ID With |
| 262 |
v3oidcclientcredentials: OAuth 2.0 Client ID (Env: |
| 263 |
OS_CLIENT_ID) |
| 264 |
--os-project-domain-name <auth-project-domain-name> |
| 265 |
With v3oidcauthcode: Domain name containing project |
| 266 |
With v3password: Domain name containing project With |
| 267 |
v3oidcaccesstoken: Domain name containing project With |
| 268 |
v3oidcpassword: Domain name containing project With |
| 269 |
token: Domain name containing project With |
| 270 |
v3oidcclientcredentials: Domain name containing |
| 271 |
project With v3tokenlessauth: Domain name containing |
| 272 |
project With v3token: Domain name containing project |
| 273 |
With v3totp: Domain name containing project With |
| 274 |
password: Domain name containing project (Env: |
| 275 |
OS_PROJECT_DOMAIN_NAME) |
| 276 |
--os-project-domain-id <auth-project-domain-id> |
| 277 |
With v3oidcauthcode: Domain ID containing project With |
| 278 |
v3password: Domain ID containing project With |
| 279 |
v3oidcaccesstoken: Domain ID containing project With |
| 280 |
v3oidcpassword: Domain ID containing project With |
| 281 |
token: Domain ID containing project With |
| 282 |
v3oidcclientcredentials: Domain ID containing project |
| 283 |
With v3tokenlessauth: Domain ID containing project |
| 284 |
With v3token: Domain ID containing project With |
| 285 |
v3totp: Domain ID containing project With password: |
| 286 |
Domain ID containing project (Env: |
| 287 |
OS_PROJECT_DOMAIN_ID) |
| 288 |
--os-password <auth-password> |
| 289 |
With v2password: Password to use With v3password: |
| 290 |
User's password With v3oidcpassword: Password With |
| 291 |
password: User's password (Env: OS_PASSWORD) |
| 292 |
--os-redirect-uri <auth-redirect-uri> |
| 293 |
With v3oidcauthcode: OpenID Connect Redirect URL (Env: |
| 294 |
OS_REDIRECT_URI) |
| 295 |
--os-endpoint <auth-endpoint> |
| 296 |
With admin_token: The endpoint that will always be |
| 297 |
used (Env: OS_ENDPOINT) |
| 298 |
--os-token <auth-token> |
| 299 |
With v2token: Token With admin_token: The token that |
| 300 |
will always be used With token: Token to authenticate |
| 301 |
with With v3token: Token to authenticate with (Env: |
| 302 |
OS_TOKEN) |
| 303 |
--os-passcode <auth-passcode> |
| 304 |
With v3totp: User's TOTP passcode (Env: OS_PASSCODE) |
| 305 |
--os-project-id <auth-project-id> |
| 306 |
With v3oidcauthcode: Project ID to scope to With |
| 307 |
v3password: Project ID to scope to With |
| 308 |
v3oidcaccesstoken: Project ID to scope to With |
| 309 |
v3oidcpassword: Project ID to scope to With token: |
| 310 |
Project ID to scope to With v3oidcclientcredentials: |
| 311 |
Project ID to scope to With v3tokenlessauth: Project |
| 312 |
ID to scope to With v3token: Project ID to scope to |
| 313 |
With v3totp: Project ID to scope to With password: |
| 314 |
Project ID to scope to (Env: OS_PROJECT_ID) |
| 315 |
--monasca-api-url MONASCA_API_URL |
| 316 |
Defaults to env[MONASCA_API_URL]. |
| 317 |
--monasca-api-version MONASCA_API_VERSION |
| 318 |
Defaults to env[MONASCA_API_VERSION] or 2_0 |
| 319 |
|
| 320 |
Commands: |
| 321 |
alarm-count Count alarms. |
| 322 |
alarm-definition-create Create an alarm definition. |
| 323 |
alarm-definition-delete Delete the alarm definition. |
| 324 |
alarm-definition-list List alarm definitions for this tenant. |
| 325 |
alarm-definition-patch Patch the alarm definition. |
| 326 |
alarm-definition-show Describe the alarm definition. |
| 327 |
alarm-definition-update Update the alarm definition. |
| 328 |
alarm-delete Delete the alarm. |
| 329 |
alarm-history Alarm state transition history. |
| 330 |
alarm-history-list List alarms state history. |
| 331 |
alarm-list List alarms for this tenant. |
| 332 |
alarm-patch Patch the alarm state. |
| 333 |
alarm-show Describe the alarm. |
| 334 |
alarm-update Update the alarm state. |
| 335 |
complete print bash completion command |
| 336 |
dimension-name-list List names of metric dimensions. |
| 337 |
dimension-value-list List names of metric dimensions. |
| 338 |
help print detailed help for another command |
| 339 |
measurement-list List measurements for the specified metric. |
| 340 |
metric-create Create metric. |
| 341 |
metric-create-raw Create metric from raw json body. |
| 342 |
metric-list List metrics for this tenant. |
| 343 |
metric-name-list List names of metrics. |
| 344 |
metric-statistics List measurement statistics for the specified metric. |
| 345 |
notification-create Create notification. |
| 346 |
notification-delete Delete notification. |
| 347 |
notification-list List notifications for this tenant. |
| 348 |
notification-patch Patch notification. |
| 349 |
notification-show Describe the notification. |
| 350 |
notification-type-list List notification types supported by monasca. |
| 351 |
notification-update Update notification. |
| 352 |
|
| 353 |
Bash Completion |
| 354 |
--------------- |
| 355 |
|
| 356 |
Basic command tab completion can be enabled by sourcing the bash completion |
| 357 |
script. |
| 358 |
|
| 359 |
:: |
| 360 |
|
| 361 |
monasca completion >> /usr/local/share/monasca.bash_completion |