summaryrefslogtreecommitdiff
path: root/openstackclient/compute/client.py
Commit message (Collapse)AuthorAgeFilesLines
* Update default nova api version to 2.1qtang2016-09-281-1/+2
| | | | | | | | | | Ref:https://review.openstack.org/#/c/311653/ We should use 2.1 as the default nova version now The API_MIN_VERSION of novaclient has already changed to 2.1 Change-Id: I9ff16cf052556e5d3756f81e02a8e76e8f315df5 Closes-bug: #1588171
* osc-lib: shellDean Troyer2016-08-051-2/+2
| | | | | | | | | | | | | Convert to using ClientManager and OpenStackShell from osc-lib. * Change all internal uses of ClientManager private attributes that are now public in osc-lib's ClientManager. Leave back-compat copies in place in OSC's clientManager so we don't break plugins. * Put some work-arounds in place for changes in osc-lib that we need until a new release makes it through the g-r and u-c change process. * Add a test for Unicode decoding of argv in shell.main() to parallel the one in osc-lib. Change-Id: I85289740d4ca081f2aca8c9b40ec422ad25d302c
* Fix foundation copyrightsDean Troyer2016-06-141-1/+1
| | | | | | | | The OpenStack LLC copyrights date from before OpenStack was transferred to the foundation. These appear to be getting copy-pasted to new files so at least should reflect the correct entity. Change-Id: I02953d752cb24ead6aa4ad8bfe257a48317c9f13
* osc-lib: utilsDean Troyer2016-06-131-1/+2
| | | | | | | | Use osc-lib directly for utils. Leave openstackclient.common.utils for deprecation period. Change-Id: I5bd9579abc4e07f45219ccd0565626e6667472f7
* osc-lib: exceptionsDean Troyer2016-06-131-1/+2
| | | | | | | | Use osc-lib directly for exceptions. Leave openstackclient.common.exceptions for deprecation period. Change-Id: Iea3e862302372e1b31ccd27f69db59b4953ca828
* Fix some missing i18n support problems in computeHuanxuan Ao2016-06-031-9/+9
| | | | | | | Found and Fix some missing i18n support problems in compute/client.py Change-Id: I54374f4eddafd9f80b6ccdaf8f8c30e098df105e Partial-bug: #1574965
* Support X.latest format for OS_COMPUTE_API_VERSIONRui Chen2016-04-201-19/+26
| | | | | | | | | OSC don't support to use "X.latest" format in order to talk with the latest nova microversion API, that is very helpful shortcut usage to use new nova side features, this patch implement it. Change-Id: I87918addff1f50fbc6eb72ca82b31813330753b5 Closes-Bug: #1561838
* Replace string format arguments with function parametersting.wang2016-02-201-1/+1
| | | | | | | | There are files containing string format arguments inside logging messages. Using logging function parameters should be preferred. Change-Id: I15b405bf4d4715263fe1e1262982467b3d4bc1f4 Closes-Bug: #1321274
* Use `discover_extensions` for novaclientAndrey Kurilin2015-09-111-7/+3
| | | | | | | | | novaclien v2.26.0 includes `discover_extensions` method, which returns list of all nova extensions based of version. Such method allows us to reduce imports of novaclient's modules and construct novaclient instance simpler. Change-Id: Idbe3ed275fb4a7e3918b11669dcfad47b8de4fb9
* Use novaclient.client.Client for initialization Nova clientAndrey Kurilin2015-09-091-8/+8
| | | | | | | | `novaclient.client.Client` is a recommended entry point for novaclient. It supports backward-compatibility and allows Nova-folks to change interfaces of inner versioned clients classes. Change-Id: Iaf20714f63c307f88a451759f041ca509fbcf6f8
* Fix compute API version snafuDean Troyer2015-09-041-0/+49
| | | | | | | | | | | | | | | | | | | | | | novaclient 2.27.0 introduced the API microversion discovery and client.Client now wants an api_version argument to properly work out the correct API version in use. OSC needs to provide this when required. Letting the compute client plugin do the version validity checking makes more sense than encoding it into shell.py, so I've added a new OSC plugin interface function check_api_version() that is called from shell.py if it exists. If it either does not exist or it returns False the previous version checking using API_VERSIONS is still performed. compute.client.check_api_version() conditionally imports the new novaclient.api_versions module and uses it if successful. Otherwise check_api_version() returns False and the previous code path is resumed. One side-effect of this is that it is now valid to use --os-compute-api-version with any valid microversion supported by the installed python-novaclient. Closes-Bug: #1492467 Change-Id: I4535b38a5639a03a9597bf83f6394f9bb45c2b9e
* Do not set default versions in parsed argsTerryHowe2015-07-181-5/+3
| | | | | | | | | | | Setting default versions in parsed args makes it so OCC cannot tell if the argument was parsed, an environment variable was set or it is just defaulted. In order to set api versions from OCC, it will have to be defaulted after processing OCC. Closes-Bug: #1453229 Change-Id: I4d065919397b783f3bdd4022c986c0234a7a16e6
* Rename endpoint type to interfaceTerryHowe2015-07-151-3/+2
| | | | | Change-Id: I4e21d09bc747e8210f4f79a1d6c4c7ccf2f25d1c Closes-Bug: #1454392
* Add --os-endpoint-type cli optional argumentRoxana Gherle2015-07-021-0/+5
| | | | | | | | | | | | User should be able to specify the endpoint type through a CLI optional argument/ENV variable setting. We will name this new optional argument: --os-endpoint-type (Env: OS_ENDPOINT_TYPE) and based on the value given, the service API will use that specific endpoint type. Possible values: public, admin, internal. DocImpact Closes-Bug: #1454392 Change-Id: Ife3d4e46b44c0ddcd712b1130e27e362545a9a29
* Merge "Defer client imports"Jenkins2015-04-191-8/+9
|\
| * Defer client importsDean Troyer2015-04-151-8/+9
| | | | | | | | | | | | | | | | | | | | | | | | So we really weren't deferring the loading of client libs dadgummit, do that for real where possible. This shaves a couple of tenths off the static import times. Also defer as much import-time procesing as possible. This is a little ugly in api.auth but this also eliminates import of the auth plugins until they are needed. Change-Id: Ia11d4b9cf98231d37449103fc29101dc17afb009
* | Add warning message if unknown version suppliedTerryHowe2015-04-131-0/+3
|/ | | | | | | Print a warning message if an unknown api version is supplied. An attempt will be made to run the command anyway. Change-Id: Idec8e88fe9621f10ec4b7eecd90708fb3730f56f
* Handle novaclient >2.20.0Dean Troyer2015-03-031-9/+8
| | | | | | | | | | As of 2.21.0 novaclient moved all of the v1_1 classes to v2 with a deprecation warning. The version-non-specific interfaces provided in novaclient.client are insufficient to support a few specific commands in OSC so we need to conditionally import directly from the correct classes. Closes-Bug: #1418024 Change-Id: I864b1908737803069dc1419c9cbca391b985c932
* Compute calls ignore region selectionTerry Howe2014-12-241-0/+1
| | | | | | | | Calls to compute commands ignore region selection. The region is not passed to the get_endpoint call. Change-Id: I1ccfc56d7cb27a00b8982232a40ace21f2c0e9a2 Closes-Bug: 1405416
* Liberalize version matching a bitDean Troyer2014-11-161-0/+1
| | | | | | | | | | | | | | | | | For class-loading purposes we can just use the major version, so accept that. Only Identity and Compute were affected; Compute is included just to be pedantically complete. For command groups we also just use the major version so fix Compute and the version option handling. Change the internal default for Identity to a simple '2' so it is also consistent with the rest of the world. Then comes microversioning... Closes-Bug: #1292638 Change-Id: Ibaf823b31caa288a83de38d2c258860b128b87d8
* Remove now-unnecessary client creation hacksDean Troyer2014-10-181-8/+1
| | | | | | | | | | | | | | | | | | | | Clients that can use ksc Session don't need the old junk to fake auth anymore: * compute * volume Clients that still need to be fed credentials can pick directly from the auth object in clientmanager. The _token attribute is removed, the token can be retrieved from the auth object: openstackclient/tests/common/test_clientmanager.py This change will break any plugin that relies on getting a token from instance._token. They should be updated to use the above, or preferable, to use keystoneclient.session.Session to create its HTTP interface object. Change-Id: I877a29de97a42f85f12a14c274fc003e6fba5135
* Merge "Add plugin to support token-endpoint auth"Jenkins2014-10-171-17/+4
|\
| * Add plugin to support token-endpoint authDean Troyer2014-10-121-17/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The ksc auth plugins do not have support for the original token-endpoint (aka token flow) auth where the user supplies a token (possibly the Keystone admin_token) and an API endpoint. This is used for bootstrapping Keystone but also has other uses when a scoped user token is provided. The api.auth:TokenEndpoint class is required to provide the same interface methods so all of the special-case code branches to support token-endpoint can be removed. Some additional cleanups related to ClientManager and creating the Compute client also were done to streamline using sessions. Change-Id: I1a6059afa845a591eff92567ca346c09010a93af
* | Fix operation on clouds with availability-zonesMonty Taylor2014-10-111-1/+1
|/ | | | | | | | | In a cloud with AZs, you can get multiple entries back from the service catalog - one for each AZ and then one that is AZ agnostic that's tied to the region. If the region_name is plumbed all the way through, this works as intended. Change-Id: I3b365ea306e8111fc80830672ae8080a5d1dc8e0
* Merge "Add basic timing support"Jenkins2014-07-111-1/+3
|\
| * Add basic timing supportDean Troyer2014-07-081-1/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add support for --timing options. Use cliff via a pseudo-command 'Timing' to support multiple outputformats. If an output format other than the default 'table' is selected use CSV since the timing data is in list form. Will pick up timing data for any client object that has a method similar to novaclient's get_timings(). TODO: * Stop instantiating all of the clientmanager client objects just to check for timing data. Descriptor magic required? Change-Id: I7f1076b7a250fba6a8b24b2ae9353a7f51b792b2
* | Merge "Clean up make_client() logging"Jenkins2014-07-081-1/+1
|\ \
| * | Clean up make_client() loggingDean Troyer2014-07-081-1/+1
| |/ | | | | | | Change-Id: I0b6760a6401b50e3dfb891af75424ae89df42ebc
* | Add support to list compute extensionsSteve Martinelli2014-07-031-2/+5
|/ | | | | | | | Since novaclient has support to list extensions, we should add some of the logic to our list extensions command. Closes-Bug: #1337684 Change-Id: I3074225780142df265a34add03e60c0f7c64c711
* replace string format arguments with function parametersChristian Berendt2014-05-201-1/+1
| | | | | | | | There are files containing string format arguments inside logging messages. Using logging function parameters should be preferred. Change-Id: Ic749ac9eb55564ed631d57055a5a4dfc3aebd169
* Displaying curl commands for nova and cinder callsFlorent Flament2014-01-021-1/+6
| | | | | | | | | | | | When using the -v option, displays curl equivalent commands and http messages exchanged with the nova and cinder API servers. Displays the same messages as those displayed with the --debug option of python-novaclient and python-cinderclient. Implements: blueprint curl-commands-in-debugging-messages for nova and cinder related calls Change-Id: Ibc8ef79d874334585b81d652b9c7df9e874fffa9
* Expand support for command extensionsDean Troyer2013-11-211-0/+16
| | | | | | | | | | | | Allows client libraries to have complete access to the rest of the OSC ClientManager. In addition, extension libraries can define global options (for API version options/env vars) and define versioned API entry points similar to the in-repo commands. The changes to ClientManager exposed some issues in the existing object api tests that needed to be cleaned up. Change-Id: Ic9662edf34c5dd130a2f1a69d2454adefc1f8a95
* Add options to support TLS certificate verificationDean Troyer2013-10-071-2/+2
| | | | | | | | | | Add --os-cacert and --verify|--insecure options using the same sematics as the other project CLIs. --verify is included for completeness. Bug: 1236608 Change-Id: I8a116d790db5aa4cb17a2207efedce7cb229eba3
* Remove tenant round 1 - global optionsDean Troyer2013-07-311-1/+1
| | | | | | | | | Change the global auth options to use 'project', leave the original tenant options in place but silent for compatability with the existing project CLI auth options. This is the only compatibility for tenant usage in this changeover. Change-Id: I3cce6e552f18822cc9f445ec5f301b0f5d9003f8
* Upgraded to PEP8 1.3.3 to stay aligned with Nova, etc.Josh Kearney2013-01-311-6/+3
| | | | | | | | Made all the necessary changes to pass new PEP8 standards. Also cleaned up docstrings to conform to the HACKING stanards. Change-Id: Ib8df3030da7a7885655689ab5da0717748c9edbe
* Standardize on a copyright header and ensure all files have them.Josh Kearney2013-01-241-12/+10
| | | | Change-Id: I64812bca01ca655c9cf9239a0daea84907082a29
* Clean up test environment and remove unused imports.Josh Kearney2013-01-221-1/+0
| | | | | | First round of adding more complete unit test coverage. Change-Id: Ic1979c499ca6fcb784892a95954a3527539c4e53
* Update compute client bitsDean Troyer2012-09-051-4/+13
| | | | | | | * add server create, delete, pause, reboot, rebuild resume, suspend, unpause commands Change-Id: I728ec199e4562bd621c3a73106c90d8b790b459a
* Move get_client_class() to common.utilsDean Troyer2012-05-111-3/+5
| | | | | | * add constants for API_NAME Change-Id: I8ccf72f032227e0a452d96303181549b1b11a5d1
* Add API versioning supportDean Troyer2012-05-101-1/+1
| | | | | | | | | * Specific versions supported are managed in XXXXXX.client.py with a mapping from version to client class. This is based on the scheme that is included in novaclient; none of the other client libs have that capability. Change-Id: I930b197f1189e7f52c3b0096e73e0773cf925542
* Add copyright notices and update datesDean Troyer2012-05-101-0/+17
| | | | Change-Id: I54a7d99328143205ab97ea930aeeeb69fe92c76c
* More identity client configDean Troyer2012-05-101-3/+8
| | | | | | | | | | | | | | * move auth option checking back to OpenStackShell() to keep the shell-level interaction at that level; add checking for token flow options * make identity.client.make_client() configure keystoneclient.v2_0.Client() properly for both password flow and token flow auth * eliminated ClientManager.init_token(), set _service_catalog in __init__() * compute client handles token flow Change-Id: I42481b5424489387798c4ec6d3e2a723ab1e6067
* Add Identity to ClientManagerDean Troyer2012-05-041-3/+6
| | | | | | | | * Make the Identity client in identity.client.make_client() * Auth via ClientManager.identity * Skip extra auth roundtrip in compute client Change-Id: I0190639e38f83997c233195f6cc27ff3afdfba10
* Fix "help" command and implement "list server" and "show server"Doug Hellmann2012-05-041-0/+32
blueprint client-manager blueprint nova-client bug 992841 Move the authentication logic into a new ClientManager class so that only commands that need to authenticate will trigger that code. Implement "list server" and "show server" commands as examples of using the ClientManager, Lister, and ShowOne classes. Change-Id: I9845b70b33bae4b193dbe41871bf0ca8e286a727