summaryrefslogtreecommitdiff
path: root/openstackclient/common/quota.py
Commit message (Collapse)AuthorAgeFilesLines
* Merge "Add '--force; parameter to 'openstack quota set'"Zuul2020-07-061-0/+8
|\
| * Add '--force; parameter to 'openstack quota set'hackertron2020-04-141-0/+8
| | | | | | | | | | | | | | | | | | The compute service allows us to to force set a quota, setting a quota value that is less than the amount of the resource currently consumed. Expose this feature by way of a '--force' boolean parameter. Change-Id: I1d1ac1ac46f49f64794ffc8631e166935537966c
* | Allow os quota list query to filter by projectJose Castro Leon2020-03-121-2/+11
|/ | | | | | | | | | In the os quota list command, project parameter is completely ignored ending up in a request to all projects and then all quotas. This patch enables back the parameter and does a single call to quotas if specified. Change-Id: Ie17c256e2bdc307dcd94ad5be7abdbffa776d369 Story: 2007422 Task: 39043
* Merge "Show correct name for resource with quota set to zero"Zuul2020-01-141-1/+1
|\
| * Show correct name for resource with quota set to zeroAlex Katz2020-01-081-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In case quota for the resource is set to zero "openstack quota show" command will not map the resource name according to one of the following dicts: - COMPUTE_QUOTAS - NOVA_NETWORK_QUOTAS - VOLUME_QUOTAS - NETWORK_QUOTAS For example: $ openstack quota set --secgroups 10 admin $ openstack quota show admin -f json|egrep "(secgroups|security_groups)" "secgroups": 10, $ openstack quota set --secgroups 0 admin $ openstack quota show admin -f json|egrep "(secgroups|security_groups)" "security_groups": 0, Change-Id: I94ed9e6b41b1cc692297c01e6c7582998dcacfda
* | Replace six.iteritems() with .items()lihaijing2020-01-091-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 Co-Authored-By: Akihiro Motoki <amotoki@gmail.com> Change-Id: I4b9edb326444264c0f6c4ad281acaac356a07e85 Implements: blueprint replace-iteritems-with-items
* common: autogenerate docsEric Fried2019-11-051-11/+31
| | | | | | | | | | | | | | | | | $namespace = openstack.common The subcommand documents for $namespace were hardcoded and thus prone to drift over time. This commit removes the hardcoded content and uses the autoprogram-cliff directive to generate them automatically from the subcommand configuration classes. This incorporates a correction to `openstack versions show`: The command `openstack versions show --help` showed a copy/paste error, using <region-name> for the metavar for both --service and --status. Fix. Change-Id: I7658fed40d71f4c20ee27908ade433534657cfe5 Co-Authored-By: Pierre Prinetti <pierreprinetti@redhat.com> Co-Authored-By: Matt Riedemann <mriedem.os@gmail.com>
* Merge "Delete the LB object quotas set command in openstackclient"Zuul2019-03-131-3/+0
|\
| * Delete the LB object quotas set command in openstackclientyanpuqing2018-06-201-3/+0
| | | | | | | | | | | | | | | | | | | | | | Setting octavia quotas should use "openstack loadbalancer quota set", not "openstack quota set". The vip parameter had be removed from octavia. The patch removes '--vips', '--health-monitors', '--l7policies' parameter in "openstack quota set" command. Change-Id: Id0046195aa93bae62264d9de7d123cf63bd0fb7e Task: 19657 Story: 2002016
* | Mention compute API 2.50 in openstack quota show --classMatt Riedemann2019-03-071-1/+4
| | | | | | | | | | | | | | | | | | | | | | There is a bug in the compute API until microversion 2.50 where the server-groups and server-group-members class quota fields aren't returned. This just mentions that microversion in the command help text. Change-Id: I029a614a922d642c578618c478c4d0a29a394fc2 Task: 21490 Story: 2002194
* | Add support for get details of QuotaSławek Kapłoński2019-02-241-64/+167
|/ | | | | | | | | | With passing "--detail" argument to "openstack quota list", details about current usage should be returned. It is currently supported by Nova and Neutron so details of resources from those projects can be returned. Change-Id: I48fda15b34283bb7c66ea18ed28262f48b9229fe Related-Bug: #1716043
* wrong values in openstack quota show commandnidhimittalhada2017-07-241-5/+21
| | | | | | | | | | | "openstack quota show" shows wrong value in field project and project_id. project UUID is shown in field project. and project is coming as None. Corrected it. Change-Id: I237e49858feab14ec5e5bc6d8cb79c9f6f5ea9c0 Closes-Bug: #1679906
* Ignore more exceptions in quota listDean Troyer2017-05-111-1/+4
| | | | | | | | Additional exceptions can be thrown here, ignore additional project lookup exceptions, but still not all. Server failures are still interesting, for example. Change-Id: I9a750ae8e8efa29a36bbd1e34b50b6ace0658260
* Funcional tests: quota listDean Troyer2017-05-021-16/+62
| | | | | | | | | | | | The quota list tests have a race in them where occasionally a project is deleted in another test between the time that quota list gets a list of all projects and it gets the quota for the projects from the service; the get quota call fails on the non-existant project. The quota list functional tests have been substantially re-written to properly test the exception handling. Change-Id: I71e6bbb5d46fcea4718a5a870f9a66a2c20fff0f
* Fix quota functional tests for nova-netDean Troyer2017-04-261-2/+5
| | | | | | | | | We need to skip some functional tests when testing against a nova-net cloud so add the bits to detect that. Also JSON-ify the quota functional tests and add the skips for nova-net. Change-Id: Ibfeeb3f967f34c98e80271a8214cf95dc50407f1
* Merge "OSC Quota List"Jenkins2017-03-211-0/+173
|\
| * OSC Quota ListSindhu Devale2017-03-101-0/+173
| | | | | | | | | | | | | | | | Implement Neutron feature of Quota List into OpenStack Client. Change-Id: Idf941acf8d00b136776b7381b877c56d82622f57 Partially-Implements: blueprint neutron-client-quota
* | Trivial FixReedip2017-03-051-1/+1
|/ | | | | | Add a space in the quota error message Change-Id: I159708b42e86f6b02f8733103a687561d550f650
* Remove remaining uses of SDK Proxy.sessionDean Troyer2017-02-191-35/+1
| | | | | | | SDK commit Ie67c240e3caa5e100ce07db3862718195c894748 exposed lingering uses of Proxy.session in OSC. Get rid of them. Change-Id: Icab230f1897a446cf3deb0e3d0550d24e11a0ef3
* Remove quota set workaround for SDK <0.9.13Dean Troyer2017-02-171-30/+3
| | | | Change-Id: I89732c49e73ac5a789fdbe19536389f7e93ac0e6
* Fix quota set command error for SDK > 0.9.10Huanxuan Ao2017-01-151-3/+30
| | | | | | | | | | A bug in OpenStack SDK 0.9.11 and 0.9.12 that causes quota set command to fail. This can be removed when the proposed SDK fix (https://review.openstack.org/#/c/419911/) is released and in the minimum SDK version in global requirements. Closes-Bug: #1655445 Change-Id: I63132f5f762f0120282f8b92e72512763063e3c6
* Fix quota show --default commandDean Troyer2017-01-141-1/+35
| | | | | | | | | | | | Work around a bug in OpenStack SDK 0.9.11 and 0.9.12 that causes quota show --default to fail. This can be removed when the proposed SDK fix (https://review.openstack.org/420301) is reelased and in the minimum SDK version in global requirements. quota set --network is still broken, I can't fix it at the moment... Closes-bug: 1656572 Change-Id: Ice77e14782c33e672176afbab36bba95b73d7a11
* Fix quota show outputReedip2017-01-121-0/+4
| | | | | | | | | | | | Currently Quota Show expects dictionary to be returned for Network client, similar to Volume and Compute clients, but Network Object is being returned, causing the "openstack quota show" to fail. This patch takes care of this issue. Depends-On: Ie0e045ff4888615d68804fd739d5b995ca11e9a1 Change-Id: Ic507997cba09fcfa84dd1151d6922f56a7c5187b Closes-Bug:#1655537
* translate all command help strings3.4.0Steve Martinelli2016-11-171-2/+2
| | | | | | | | | | | | | | Leverage the new cliff command class attribute (_description) to get the help of a command, this allows us to mark strings for translation. We could not do this before since the help was grabbed from the docstring. This also depends on a new release of cliff and a bump to the minimum level in osc's requirements. Closes-Bug: 1636209 Depends-On: Id915f6aa7d95a0ff3dc6e2ceaac5decb3f3bf0da Change-Id: I8673080bb5625e8e3c499feaefd42dfc7121e96f
* Merge "Fix openstack quota set/show --class not work"Jenkins2016-09-201-17/+15
|\
| * Fix openstack quota set/show --class not workqtang2016-09-141-17/+15
| | | | | | | | | | | | | | | | identity_client should not be used for quota class operation. Update code to fix the qutoa class set/show issue. Change-Id: I71c59c08a0d5da29982497f589e1efe131997f21 Closes-Bug: #1609233
* | Fix quota-update issue in LBaaSReedip2016-09-161-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Currently L7Policies cannot be updated( it was missing in implementation in neutronclient). The same has been taken care in the current patch. Also, currently quota doesnt support updating the members in an LBaaS pool. This patch temporarily removes it, till it is not confirmed that LBaaS v2 needs to support quotas for members or not. Change-Id: I25a54a57debb762a32a280ece8c081fc52365f0f Closes-Bug: #1624097
* | Fix Quota Support for HMsReedip2016-09-161-1/+1
|/ | | | | | | | | | Health Monitors could not be updated using the `openstack quota update` CLI. This patch fixes the same. Change-Id: Ic5a4fa5dce5767e40139137131114834d564f89a Closes-Bug: #1624225
* Support fetching network project default quotaRui Chen2016-09-131-2/+7
| | | | | | | | | | Neutron server and openstacksdk had supported to fetch network project default quota, this patch add the CLI support in openstackclient. Change-Id: If0ef74c268c41a866c62156da0603a40ae4e6e31 Closes-Bug: #1204956 Depends-On: I6a4e2a146351dd1e7d652442511f1ef2c279da42
* Set quota "per_volume_gigabytes", "backup_gigabytes" and "backups"Rui Chen2016-09-121-1/+11
| | | | | | | | | "per_volume_gigabytes", "backup_gigabytes" and "backups" items can be shown in "openstack quota show" command, but can't be updated by "openstack quota set". This patch fix the issue. Change-Id: I47db5a69d4e4ef6e140f2735257c83e1fb052760 Closes-Bug: #1609767
* Allow setting quotas for server groups and server group membersElena Ezhova2016-07-271-0/+2
| | | | | | | | Adds support of --server-groups and --server-group-members options to the "quota set" command. Change-Id: I178d1e267d010be7e908adefcf3b15abdafd9da4 Closes-Bug: #1602223
* Remove execute permission on a few filesSongmingYan2016-07-221-0/+0
| | | | | | | Some files have execute permission unnecessarily. Change them from 755 to 644. Change-Id: I471ebd1c3d123ad4a7376f7f5996f53f8c2d9b0b
* Correct reraising of exceptionqinchunhua2016-07-071-1/+1
| | | | | | | | | When an exception was caught and rethrown, it should call 'raise' without any arguments because it shows the place where an exception occured initially instead of place where the exception re-raised. Change-Id: I5fb6dea5da7fb6e1e2b339a713c7d37f8c99e407
* Make set/unset commands in compute/image/common return normally when nothing ↵Tang Chen2016-06-211-5/+0
| | | | | | | | | | specified After this patch, all set/unset commands will return normally when nothing specified. Change-Id: Id94d0329faa1a674006a9aae901f834b41917317 Close-bug: #1588588
* osc-lib: commandDean Troyer2016-06-131-1/+1
| | | | | | | Leave command.py and test_command.py as a sanity check during the deprecation period. Change-Id: I24e1b755cbfbcbcaeb5273ec0c9706b82384fc85
* osc-lib: utilsDean Troyer2016-06-131-2/+3
| | | | | | | | Use osc-lib directly for utils. Leave openstackclient.common.utils for deprecation period. Change-Id: I5bd9579abc4e07f45219ccd0565626e6667472f7
* Fix i18n supports in commomHuanxuan Ao2016-06-071-7/+8
| | | | | | | | I checked all the files in openstackclient/common and fixed the missing i18n supprots. Change-Id: Id7f76a24aae663f5832ef9bcf1bd5a6b7081af24 Partial-bug: #1574965
* Add newline to strings in stdout/stderr.write()Lu lei2016-06-061-1/+1
| | | | | | Function stdout/stderr.write() can't break line automatically. Change-Id: I903c2d1cc1a669adb6be5aa4eb783d3b9943e685
* Add network support for "quota set"Fang Zhen2016-05-191-9/+50
| | | | | | | | | | The "quota set" command support compute and volume quotas previously. This patch add support network. Partially-implements: blueprint neutron-client-quota Closes-bug: 1489441 Change-Id: I9d297f52bc30614b3493f09ed15f8f1d3f8ff952
* Support quota show for current projectRichard Theis2016-04-211-11/+18
| | | | | | | | | | The "os quota show" command "<project/class>" argument is now optional. If not specified, the user's current project is used. This allows non-admin users to show quotas for their current project. Change-Id: I602d4cc09c9d29ce84271eff78137f8810cb1a47 Closes-Bug: #1572733
* Fixed a bunch of spacingBrandon Palm2016-02-231-2/+2
| | | | | | | Nothing too complicated here. I fixed a bunch of spacing issues that I saw in OSC. Change-Id: I935ab48e7c5bac5f88ecdb3a05f73fb44fc9f41d
* Merge "Fix showing network quotas for a project"Jenkins2016-02-021-4/+7
|\
| * Fix showing network quotas for a projectRichard Theis2016-02-021-4/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The OpenStack SDK is now used for the network client. However, the 'openstack quota show' command wasn't updated for the client change. As a result, the command will fail to show network quotas when a project name is specified. For example: $ openstack quota show admin 'Proxy' object has no attribute 'show_quota' This patch set fixes the command by using the OpenStack SDK to get network quotas for a project. Change-Id: I59a7b6780a7b80cd09e79d40d214751b25d3016e Related-To: blueprint neutron-client Closes-Bug: #1528249
* | log take_action parameters in a single placeAkihiro Motoki2016-02-021-11/+2
|/ | | | | | | | | | | | Previously each command logs take_action parameters explicitly by using @utils.log_method decorator or log.debug(). Some commands have no logging. This commit calls a logger in the base class and drops all logging definition from individual commands. Closes-Bug: #1532294 Change-Id: I43cd0290a4353c68c075bade9571c940733da1be
* Add project name/ID validation for "openstack quota show"xiexs2015-11-291-3/+9
| | | | | | | A validation is necessary to check the existence of project. This patch is similar to Ia2d8c96527820e25b074e6486d3f39c5ad7eae60. Change-Id: Id8895ba7a21ecad05942619a82a87c0dc68eae53
* Unable to set some compute quotasRichard Theis2015-11-201-0/+1
| | | | | | | | | | | | | | | | | | | | | | The OpenStackClient mapping of 'openstack quota set' arguments isn't correct for compute quota items that have to different names. For example, the --injected-file-size argument is mapped to injected_file_size, but the compute quotas item is actually injected_file_content_bytes. This incorrect mapping prevented the impacted compute quota items from being set. The problem impacts the following 'openstack quota set' arguments: --injected-file-size --injected-path-size --properties --secgroup-rules --secgroups This patch set also expands the compute quota unit tests to verify all compute quota items that can be set. Change-Id: I0a2f241e425f4811e4ae55be183ac0c8b0805c2a Closes-Bug: #1475831
* Add project-name/-id validation for the OSC "openstack quota set"xiexs2015-11-041-4/+11
| | | | | | | | | The quota info would be set into DB, even though the project actually does not exist. This patch tried to add a validation to forbid this undesirable behavior. Change-Id: Ia2d8c96527820e25b074e6486d3f39c5ad7eae60 Closes-Bug: #1512638
* Merge "Add tests for volume quota set"Jenkins2015-09-191-2/+1
|\
| * Add tests for volume quota setTerryHowe2015-08-111-2/+1
| | | | | | | | | | | | | | Add some tests for volume quota set and get rid of TODO about using the value instead of the key to get the attribute. Change-Id: I57aa57951aeea65965966e63af922cda532d759d
* | Use a common decorator to log 'take_action' activationJoshua Harlow2015-09-011-2/+4
|/ | | | | | | | | Instead of duplicating the same log statement throughout the code, the same logic can be provided by a shared decorator that abstracts away the logging capability and unifies it behind a common function instead. Change-Id: Icc63bced7347c8bbf0299a4c5821425a10892a79