summaryrefslogtreecommitdiff
path: root/heatclient/v1/stacks.py
Commit message (Collapse)AuthorAgeFilesLines
* Remove sixTakashi Kajinami2022-05-091-1/+1
| | | | | | | This library no longer supports Python 2, thus usage of six can be removed. Change-Id: I8d0c1cfd6dff375b3b7756a5b36c95a2df3f04c6
* Update stack_id clearify for heat client functionsricolin2019-08-031-10/+28
| | | | | | | | | | most of our client major function require stack_id. We should provide more specific information (at lest in function description) to clearify that it's allowed to feed in stack name to `stack_id` too. For example, both `heat.stacks.get($Stack_UUID)` and `heat.stacks.get($Stack_Name)` works. Change-Id: I4428097140e0391a77679f5c69e00966f249efd7
* Mark stacks returned by get loadedThomas Herve2018-06-071-1/+1
| | | | | | | | | | When calling stacks.get, mark the returning stacks as loaded, so that attribute retrieval works right away. If not, any getattr on the Stack will call get() which will request the stack again (and ignore things like resolve_outputs). Change-Id: I3a3f25aa0c6f88e7e4274107c0578fd30dc9f155 Related-Bug: #1774958
* Replace six.iteritems() with .items()M V P Nitesh2017-03-311-2/+1
| | | | | | | | | | | | 1.As mentioned in [1], we should avoid using six.iteritems to achieve iterators. We can use dict.items instead, as it will return iterators in PY3 as well. And dict.items/keys will more readable. 2.In py2, the performance about list should be negligible, see the link [2]. [1] https://wiki.openstack.org/wiki/Python3 [2] http://lists.openstack.org/pipermail/openstack-dev/2015-June/066391.html Change-Id: I3913e8876b34e112140788d7a405da6eedfb5f29
* Support openstack stack exporthuangtianhua2017-02-141-0/+7
| | | | | | | | Heat supports exporting data of stack preparing for abandon stack. This change supports 'openstack stack export' in client. Change-Id: I5d3778f307d10174dbb738548282f7495bd9c825
* Move required modules from oslo-incubatorrabi2016-11-121-1/+1
| | | | | | | | | | | | Move the required module to heatclient/common. - heatclient/openstack/common/apiclient/base.py It also moves some required functions and exceptions from heatclient/openstack/common/cliutils.py and heatclient/openstack/common/exceptions.py. Change-Id: I68704c7fab9417492d8390ad05a9797f78d46907
* Graduate to oslo.i18n and cleanup incubator usageChuck Short2016-11-081-1/+1
| | | | | | | | | Graduate from Oslo Incubator to oslo.i18n library. Cleanup of unused Oslo Incubator utils. Added optional enable_lazy() usage. Change-Id: I5ec02477f3f52f4d7097669120581e82cced3748 Signed-off-by: Chuck Short <chuck.short@canonical.com>
* Standardize import formatshizhihui2016-08-031-1/+1
| | | | | | | According to the rule in http://docs.openstack.org/developer/hacking/#imports I modify some irregular import format in heatclinet. Change-Id: I0200ddad88ee833d7de9d6df2c1519e4f4560db7
* Add support for stack file listSteven Hardy2016-07-211-0/+13
| | | | | | | | This shows the files map for a given stack Depends-On: I3198b6a7dc06648af24c198d39470f3b0d5d6f11 Change-Id: Ib7d033a660fe294bf3f7b42e4aa7020149ce24c1 blueprint: files-show
* Allow redirects to use location from responserabi2016-05-171-2/+6
| | | | | | | | | This allows redirects to use fully qualified location from response header and removes the check to prohibit redirects to different project(required for super admin actions). Change-Id: I46876189e96375922c4f0bf30452b7c4980fe39c
* Add client library support for retrieving a stack's environmentJay Dobies2016-04-181-0/+13
| | | | | | Change-Id: I84aa5ed9dc2b8aee089de3b1e1810552b8f2dd96 Depends-On: I7e3577dfc854018245d79afdfee45a9d250d73a7 Implements: blueprint environment-show
* Merge "Adds ignore_errors for template-validate command"Jenkins2016-02-101-2/+15
|\
| * Adds ignore_errors for template-validate commandKanagaraj Manickam2016-02-091-2/+15
| | | | | | | | | | | | | | | | template-validate --ignore-errors <ERR1,ERR2> implements blueprint heat-template-validate-improvements Change-Id: Ice4f623bc06366ddd600d5cb72d236e5a4459e19
* | Add show_nested support to update --dry-runSteven Hardy2016-01-181-6/+5
|/ | | | | | | | | Currently update preview provides no way to show the updates for nested stack resources, so this adds a flag --show-nested, which is similar to other interfaces e.g template-validate. Closes-Bug: #1521971 Change-Id: I06f3b52d5d48dd5e6e266321e58ca8e6116d6017
* Add resolve_outputs parameter to stack get methodOleksii Chuprykov2016-01-121-2/+7
| | | | | | | | | | Also add --no-resolve-outputs parameter to heat stack-show command to let user get stack without outputs. @APIImpact, @DOCImpact Depends-On: I03104efc535a7bd4326cbec56c01cd887db38ab6 Change-Id: I6c715fe90e42259e744b76924673194d0a81c07e
* Use stack lookup for getting stack name/idOleksii Chuprykov2015-12-211-42/+42
| | | | | | | | | Use stack lookup without redirecting to stack show when we need to get only stack id. This significantly reduces load on engine for large stacks, because, for example, we doesn't resolve outputs for variety of api calls. Change-Id: Ifcd61f8b039c930a4c2d20d31b5ccb8b11864e5b
* Merge "Add output API calls implementations"Jenkins2015-11-271-0/+21
|\
| * Add output API calls implementationsPeter Razumovsky2015-11-161-0/+21
| | | | | | | | | | | | | | | | | | | | Add output APIs support for output-show and output-list commands. Now output-show and output-list uses output calls instead of requesting stack get. implements bp api-call-output Change-Id: I1bc1cee1c78ecf0c9a18ecc0a871d38e4141e0f7 Depends on: Ia24b24f59e2c592801e4e670ba5510f642ecf45c
* | Enable pep8 H405 testsricolin2015-11-161-2/+1
|/ | | | | | | Enabled H405 multi line docstring summary not separated with an empty line in tox testing. Change-Id: I89d063133154ae343315872b677fa06cc901cf3b
* Add PATCH support for stack-update --dry-runSteven Hardy2015-10-021-3/+8
| | | | | | | | | | | | | Previously we just passed the "existing" kwarg directly to the PUT, which was then ignored by the API, so PATCH update preview commands wouldn't work. Now heat supports PATCH preview_update_stack, we can revise this to use the PATCH method when appropriate. Requires this heat patch for --existing --dry-run to work when used together: https://review.openstack.org/#/c/230054 Change-Id: Ib07c0a83edfbef7a08b4af344850d0a791b7704d Closes-Bug: #1501207
* Ability to specify show_nested for template validationJay Dobies2015-09-161-1/+5
| | | | | | | | | This is the client-side change to support Idb51c983fc07e49d371b8ccb3cea6f7e92f99903 Change-Id: I83744bd552bcb5cee183336bec97ab616bd82a91 Implements-blueprint: nested-validation Closes-Bug: #1495695
* Add CLI option for update dry-runRyan S. Brown2015-09-041-0/+10
| | | | | | | | | | | | | | | | When performing a stack-update using the --dry-run option will change the output behavior. Instead of printing a list of stacks, the --dry-run option will print the name, type, and action to be taken on resources in the updated stack. Docs change here https://review.openstack.org/132870/ Engine change here https://review.openstack.org/#/c/122473/ Implements: partial-blueprint update-dry-run Co-Authored-By: Jason Dunsmore <jasondunsmore@gmail.com> Change-Id: I3dd54084ce7bd5140b28e81b6eb2349123494de9
* Fix TypeError when call keystoneclient session.request()huangtianhua2015-07-061-3/+2
| | | | | | | | | | | | | | A TypeError raised when run cmd 'heat resource-show': TypeError: request() got an unexpected keyword argument 'follow_redirects' This problem was introduced by the change I90bc9d9fcd1058c3eca288f08dd134810f1b0000 to move SessionClient from HTTPClient to adapter, due there is no keyword argument 'follow_redirects' in keystoneclient session.request() method. Change-Id: I91f13da740bf1e66dffd68cdf666a24d68aa543d Closes-Bug: #1471650
* Move usage methods *_request to get/post/etcPeter Razumovsky2015-06-091-36/+39
| | | | | | | | HTTPClient has methods get/post/put and others, which use json_request and raw_request, but other code uses requests method instead of them. Change-Id: I74ee34430afdae17f83ccdc877cc882f94651bce
* Implement restore operationThomas Herve2014-11-101-0/+11
| | | | | | | | | This adds new methods to manage snapshot restoration. blueprint stack-snapshot Co-Authored-By: ala.rezmerita@cloudwatt.com Change-Id: I917c5d89f586110c0614e05e134bebde27d4db55
* Implement snapshot operationsThomas Herve2014-11-101-0/+45
| | | | | | | | | | This adds the various commands corresponding to the new snasphot methods. blueprint stack-snapshot Co-Authored-By: ala.rezmerita@cloudwatt.com Change-Id: I8803c54c5cd76700f1591c8d28650bf60a2f5167
* Fix stack update for Python APITetyana Lashchova2014-09-191-2/+1
| | | | | | | | | | Change I30a2b223d7dd19a717ed989b419b1e6cb2ac143b introduced 'existing' keyword to stack-udpate command that became effectively required argument to stack.update method of the client's Python API, breaking backward compatibility. Change-Id: Icda3313805c29ab36773a4edc8c9f8c874b71ca3 Closes-Bug: #1371167
* Add stack-update argument for patching parametersWinnie Tsang2014-09-161-1/+3
| | | | | | | | | | A new argument named existing for stack-update will be supported by the heat engine to use the parameters stored in the Db. Partially-implements: blueprint troubleshooting-low-level-control Partial-Bug: 1224828 Change-Id: I30a2b223d7dd19a717ed989b419b1e6cb2ac143b
* Merge "Remove dependent module py3kcompat"Jenkins2014-03-201-2/+2
|\
| * Remove dependent module py3kcompatllg82122014-03-181-2/+2
| | | | | | | | | | | | | | | | | | | | | | Module py3kcompat was removed from oslo-incubator, we can use six directly. * Sync commit of removing py3kcompat from oslo * use six replace usage of py3kcompat Change-Id: If0f9397588b2180fe198e804cbbb5b5c8420fe76 Closes-Bug: #1280033
* | Merge "Modify stack ID lookup to only use stacks:lookup"Jenkins2014-03-201-3/+9
|\ \
| * | Modify stack ID lookup to only use stacks:lookupSteven Hardy2014-03-141-3/+9
| |/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Currently when we lookup a stack ID (fully qualified name/id) via stacks:lookup, we also follow the redirect to stacks:show, which is not allowed for stack users. We don't actually need to follow the redirect, as we already have the required ID, so instead we return the redirect response, so we can just allow all users to do stacks:lookup in the policy. This is useful for clients who want to call API actions which are allowed for stack users, e.g resource:signal without having to know both the name and ID of the stack. Change-Id: I6f079cbc7ac3c680f15941668b4efbe4c3c5d60d Partial-Bug: #1291097
* | Add stack-preview supportAnderson Mesquita2014-03-181-0/+10
|/ | | | | | Co-Authored-By: Richard Lee <rblee88@gmail.com> Change-Id: I4d7b12f6da09411d45dd6022dc11b8ece76b4932 Implements: blueprint preview-stack
* Update apiclient.base and reuse new functionalAndrey Kurilin2014-02-191-5/+2
| | | | | | | | | | | | | Module apiclient.base has several updates in oslo, so we need to sync latest code to have ability to reuse new functional. Updates in oslo which related to usage of apiclient.base in heatclient: - I491f9b54c7074546cf738c6150666bfcc3966a78 - I1db6c12a1f798de7f7fafd0c34fb0ef523610153 Related to bp common-client-library-2 Change-Id: I509d6efb0c8eef87ba2e4aa02ebb44ba149a9860
* Python3: use six.iteritems() rather than dict.iteritems()Cyril Roelandt2014-02-121-1/+2
| | | | | | This is compatible with both Python 2 and 3. Change-Id: If8c3a4a6fe028a3a1dc6899f0f4e65c89403d267
* python-heatclient stack-abandon supportVijendar Komalla2014-02-101-0/+11
| | | | | | | Adding stack-abandon support for python-heatclient. Partial-Bug: #1262267 Change-Id: Ifaec08558103137fe8288d00ba8d7188f01afe03
* Port to python requestsChmouel Boudjnah2014-02-071-3/+3
| | | | | | | | | | Since python requests has builtins SSL verification we can get ride of our own implementation. Increase tests coverage of heatclient.common.http along the way. Partial Implements: blueprint python-requests-port Change-Id: I04a169da2334acc91e538ca02cba79d9765752b5
* Add filter option to stack-listAnderson Mesquita2014-02-051-7/+5
| | | | | | | | | | | | | | | | | Add ability to use filters on stack-list by passing a ``--filters`` options to the command line. This option can appear multiple times or be used once with several key=value filters separated by semicolons. If the same key appears more than once, both will be taken into account when sending the request to the API. e.g.: The option: ``--filters status=COMPLETE;status=FAILED`` Will issue the call: ``/stacks?status=COMPLETE&status=FAILED`` Closes-Bug: 1268816 Change-Id: I553d6b5e3ceebdb24dcd4e4c8e409a4375d72333
* Add pagination (limit and marker) to stack-listAnderson Mesquita2014-02-051-21/+14
| | | | | | | | | | | | | Add support for ``limit`` and ``marker`` on stack-list and remove unnecessary ``page_size`` parameter. When using ``limit`` and/or ``marker``, stack-list will keep previous behavior and list all stacks starting from ``marker`` up to ``limit``, even if limit exceeds API limit restrictions, by using multiple calls to /stacks endpoint. Partial-Bug: 1268816 Change-Id: Ifb08c1aadd3629d60ddc56ffc507c99b9dba80ce
* Reuse BaseManager and Resource from osloAndrey Kurilin2013-12-161-15/+21
| | | | | | | | | In the process of unification of the clients code we should reuse common functionality from Oslo. Related to blueprint common-client-library-2 Change-Id: I44a1344e3eb40220d8b795fd05e44623195116a2
* Revert "Don't call credentials_headers() twice"Steven Hardy2013-12-031-2/+4
| | | | | | | | | | | | | | | | | | | When we create or update a stack, when deferred_auth_method=password (which is the default in heat.conf), the client must pass the username and password, even if they don't need to for authentication (ie they're passing a token). Otherwise there's no username and password in the context to store, and the engine validation in heat/engine/service.py::_validate_deferred_auth_context fails. No such issue exists when deferred_auth_method=trusts, which is why this problem was missed during testing of the patch being reverted. Note some fixup in addition to the revert was required to make the tests pass, as ShellTestToken and ShellTestStandaloneToken now require username/password set in the fake env. This reverts commit a7ba3c323b16227e0ba2527f21bc89625f125234 Change-Id: I0e7bc3f748022c2bf5ef7ef6dfe4d97953e3fcab
* Don't call credentials_headers() twiceSteven Hardy2013-11-271-4/+2
| | | | | | | | | | | | We don't need to call credentials_headers in the stack create/update code, as it's already called in the HTTPClient. This has the side- effect of simplifying the shell test, which currently has to mock header arguments to json_request, which are incorrect anyway because HTTPClient always sets X-Auth-Token if a token is passed in (as evidenced by bug #1250731) Change-Id: I6212cf5a50f5a8d919f743e23ece4bd1d0e1ad1c Partial-Bug: #1252248
* Returning the json body after a stack-create or stack-updateTim Schnell2013-11-081-0/+4
| | | | | | | | | This allows the downstream service access to the data coming back from the REST API, primarily the stack id. implements blueprint return-id-on-stack-create Change-Id: I24db9c28fca1f50f5ef1452679f444095d22d103
* align the order of parameters for urlencode()Kui Shi2013-10-231-1/+2
| | | | | | | | | | | | | | | | | In Python 3.3, hash randomization is enabled by default. It causes the iteration order of dicts and sets to be unpredictable and differ across Python runs. In the test case, the fixed expecting string will not match the test result, it is relying on the dict order. This change transforms the input dict to a sequence of two-element list, with fixed order, and exchange the order of "limit" and "marker" for expecting string. Partial implement: blueprint py33-support Change-Id: If9c25fb0d457b31034111e7e879f1f95a576a78f
* Use the six library for compatabilityKui Shi2013-10-221-2/+2
| | | | | | | | | | Replace dict.iteritems() with six.iteritems(dict) Import six for StringIO Import urlutils for urlencode Partial implement: blueprint py33-support Change-Id: Ieae1299915168ef10ff54e0a9e9a346350e9d1fb
* Replace OpenStack LLC with OpenStack FoundationZhiQiang Fan2013-09-201-1/+1
| | | | | Change-Id: I8f2697ca99192078d5db2adb4db98287520d9895 Fixes-Bug: #1214176
* Stack instance identifier propertySteve Baker2013-09-041-5/+8
| | | | | | | | | | | | | The identifier property formats the stack name and ID for REST API request paths. This has the following consequences for each action method: - get, same behaviour but using the identifier property - delete, using the full identifier avoids one http redirect - update, this method was non-functional before this change, and is now fixed Change-Id: Ib2b12826243e25772acccb8ca56039e54d3857d5
* Remove unused Stack data method0.2.4Steve Baker2013-08-071-3/+0
| | | | Change-Id: Ia3fce29a58957b84f2eba33ac1b2ecfb04543939
* Do not paginate stack list unless page_size is setSteve Baker2013-08-071-5/+5
| | | | | | | | | | | | | | | | | Pagination on the server has not yet been implemented, however the client assumes it is, causing infinite recursion when paginate is called. With this change, no pagination is attempted unless page_size is specified. However the 'limit' parameter is still honored, so it is still possible to cap the total number of results returned. heatclient users should not set page_size until pagination has been implemented on the server. The stack list in Horizon currently does not attempt to paginate, so is not affected. Fixes: bug #1207839 Change-Id: I4087d3a8af48206d6ebe3edc441469464e4a401a
* Custom Stack get method to avoid lookup redirectsSteve Baker2013-08-071-0/+10
| | | | Change-Id: I15dd4e9168cba6fd05371fed097d52cbf33cb15d