8 Commits

Author SHA1 Message Date
guiyanxing
af7129cda3 Add '--type'and other options to network rbac list
This patch adds '--type','--action','--long' filtering options
to network rbac list command

Change-Id: I21846820ab223bb7832e89eb2d7658bbec271aec
Closes-Bug: #1648307
Partially-Implements: blueprint network-commands-options
2016-12-21 09:43:07 +08:00
Abhishek Raut
1256aee491 SDK Refactor: Prepare network rbac commands
Prepare the OSC "network rbac" commands for the SDK refactor.
See [1] for details.

[1] https://etherpad.openstack.org/p/osc-network-command-sdk-support

Change-Id: I6f25e167d7f933667173b04a4b0ad55baf3c56f2
Partially-Implements: blueprint network-command-sdk-support
2016-11-19 22:44:02 -08:00
Steve Martinelli
0ef8535036 translate all command help strings
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
2016-11-17 02:33:42 +00:00
Huanxuan Ao
57d5f94540 Allow input the QoS policy name in network rbac create command
We could input a QoS policy ID for the "rbac_object"
parameter in "network rbac create" command but not
name before. After this change, "rbac_object" parameter
can be both QoS policy name or ID.

Change-Id: I0fd6b5b5ae410074d85475ef49e5a0a9a52bf86f
2016-10-20 12:37:40 +08:00
Huanxuan Ao
7f93d8cc88 Show "target_project_id" attribute properly for network rbac object
According to the code in SDK:
https://github.com/openstack/python-openstacksdk/blob/master/openstack/network/v2/rbac_policy.py#L34
we can see the conlumn of "target_tenant" should be
"targer_project_id" but not "target_project". It is
the reason why could not show the "target_project"
in OSC, so this patch fix it.

Before this change:
(openstack) network rbac show b74fd644-e057-4d44-8ae1-7ca9967ea1e1
+----------------+--------------------------------------+
| Field          | Value                                |
+----------------+--------------------------------------+
| action         | access_as_shared                     |
| id             | b74fd644-e057-4d44-8ae1-7ca9967ea1e1 |
| object_id      | 8735b57f-606a-4f65-9902-2052a6d2a66d |
| object_type    | network                              |
| project_id     | 01c0ba43101b4080a52a5f79a55c56ff     |
| target_project |                                      |
+----------------+--------------------------------------+
After this change:
(openstack) network rbac show b74fd644-e057-4d44-8ae1-7ca9967ea1e1
+-------------------+--------------------------------------+
| Field             | Value                                |
+-------------------+--------------------------------------+
| action            | access_as_shared                     |
| id                | b74fd644-e057-4d44-8ae1-7ca9967ea1e1 |
| object_id         | 8735b57f-606a-4f65-9902-2052a6d2a66d |
| object_type       | network                              |
| project_id        | 01c0ba43101b4080a52a5f79a55c56ff     |
| target_project_id | c7ab4d2ea9e1487095a8ca24ea44ef38     |
+-------------------+--------------------------------------+

Change-Id: I53df127bfc3e43288c6afecdf872e6101b94a658
Closes-Bug: #1608903
2016-08-05 10:05:58 +08:00
Huanxuan Ao
fac3214581 Implement "network rbac set" command
Add "network rbac set" command which just supports
setting a target project.
Also, This patch adds the doc, unit test and functional test.
But there is a bug of showing network RBAC
https://bugs.launchpad.net/python-openstacksdk/+bug/1608903
We need to skip the functional test before this bug fixed.

Change-Id: I756f448bb333cf1098a735e57a1c5dc4edf195d4
Partially-Implements: blueprint neutron-client-rbac
2016-08-03 10:49:57 +08:00
Huanxuan Ao
13bc3793e0 Implement network rbac create and delete commands
Add "network rbac create" and "network rbac delete" commands
and also add unit tests, functional tests, docs and release
note for them.

Change-Id: I5fd58342f2deaa9bae7717412a942a21bbd7d045
Partially-Implements: blueprint neutron-client-rbac
2016-07-28 10:23:29 +08:00
ting wang
6c7a30ab38 Implement rbac list and show command
1. implement "openstack network rbac list"
2. implement "openstack network rbac show"
3. also add FakeRBACPolicy to test "network rbac xxx" command
The unit test class similar to FakeRouter, which is able to
fake one or more rbac policies. It will be used by the rbac
CRUD patches.

Change-Id: I6c97bc8819698546895fd530464a2cbb347bf77d
Co-Authored-By: Huanxuan Ao <huanxuan.ao@easystack.cn>
Partially-Implements: blueprint neutron-client-rbac
Depends-On: I88f409a24947b67146c0f93ec8480834cef56d2f
2016-06-27 10:44:41 +08:00