857 Commits

Author SHA1 Message Date
jay
bae89b3014 Output correct json for security groups in 'openstack server show'
Fixes incorrect json output for 'openstack server show -f json'.
The security group json output groups all the json as one
for e.g. "security_groups": "name='group1'\nname='group2'"
The correct output should be
"security_groups" : [{"name" : "group1"}, {"name" : "group2"}]
properties and volumes_attached fields also has similar issue.

Story: 2007755

Change-Id: I1b1cac716329e0530400aff782c08000b21d8e1d
2020-09-14 15:22:27 +02:00
yanpuqing
533af9f1b2 Client should parse string to boolean for value 'is_domain'
When we use "--property" parameter, client get lists these the
value is string type, but the type of the value 'is_domain'
should be boolean, so we should judge it and parse it.
The patch parse string to boolean for value 'is_domain'.

Co-Authored-By: Lance Bragstad <lbragstad@gmail.com>

Change-Id: I37c9eb854524bde3a1530bfe2e3a03810fb1a676
Task: 30039
Story: 2005246
2020-05-29 07:53:13 -05:00
Zuul
af1ffc456f Merge "Revert "Disallow setting default on internal network"" 2020-04-22 15:40:21 +00:00
Zuul
790ead00bb Merge "Add resource option immutable" 2020-04-17 10:25:30 +00:00
Zuul
92254bb0ac Merge "Add 'subnetpool' type support to rbac commands" 2020-04-15 08:44:49 +00:00
Zuul
347c5b9df4 Merge "Add 'address_scope' type support to network rbac commands" 2020-04-10 00:18:56 +00:00
Igor Malinovskiy
557e65d8eb Add 'subnetpool' type support to rbac commands
Change-Id: Id6e528ebd1bf21ca142e60052d28371f97f629ac
Partial-Bug: #1862032
Depends-On: https://review.opendev.org/710755
2020-04-09 19:50:38 +03:00
Vishakha Agarwal
7f66273d3f Add resource option immutable
This patch adds the --immutable and --no-immutable option to the
role, project and domain CLI.

Related-Patch: https://review.opendev.org/#/c/712182/

Change-Id: I9c3bdd741f28bf558267fb217818d947597ce13e
2020-04-08 13:51:01 +00:00
Zuul
78b18030b5 Merge "Support for stateless security groups" 2020-04-08 08:31:28 +00:00
Vasyl Saienko
bdaebeb508 Revert "Disallow setting default on internal network"
The original patch assumes that both --external and --is-default are set
in the same request and broke case when --is-default is set as an
network update. The validation logic have to be moved on API side to
avoid extra API calls from openstackclient.

This reverts commit 962efd949feb461283a9bb4a668fbd310f80ba40.

Related-Bug: #1745658

Change-Id: Idf08abb0e08a6880f89c3e9df9dd2ac82f36c432
2020-04-08 07:14:52 +00:00
pedro
74a7c1d9d6 Add description field to portforwarding NAT rules
Add the `description` field to Floating IP Port Forwardings

Depends-On: https://review.opendev.org/#/c/705038/
Change-Id: I6477368e32570c96cacddba4f86455262e533277
Implements: blueprint portforwarding-description
Closes-Bug: #1850818
2020-04-02 13:15:19 -03:00
Zuul
70f1ff375a Merge "Add command: router add/remove route --route" 2020-04-01 11:03:51 +00:00
Tom Stappaerts
5e62411e5f Support for stateless security groups
Add support for stateful attribute of security groups,
using --stateful and --no-stateful flag on security group.
This allows a user to create security groups with stateful
false.

Change-Id: Ifd20b5fc47fd0ea0bb5aeda84820dcc0fb1e8847
Blueprint: stateless-security-groups
Depends-On: https://review.opendev.org/711513/
2020-03-31 12:05:18 +02:00
Bence Romsics
dba57c85d5 Add command: router add/remove route --route
Add commands to osc to call the two new API methods introduced by
new Neutron extension: extraroute-atomic.

Bump our openstacksdk requirement to >=0.38.0 which contains
the corresponding sdk change.

The lower-constraints of dogpile.cache and keystoneauth1 are bumped
because of requirements bumps in openstacksdk.

The lower-constraint of decorator is bumped because of problem already
fixed by amotoki here: https://review.opendev.org/701706

Change-Id: Ia9b9c216f1d1161ebedac31594a2c464d77f4ae2
Depends-On: https://review.opendev.org/674324
Partial-Bug: #1826396 (rfe)
Related-Change: https://review.opendev.org/655680 (spec)
2020-03-30 16:19:05 +02:00
Vishakha Agarwal
05da145eae Adding options to user cli
User options [1] can be set by making POST and PATCH
request for /v3/users API calls but cannot by openstack
CLI because of no user options defined in create and update
user CLI [2]. This patch adds the user options [1] in
create user and update user CLI.

[1] https://docs.openstack.org/keystone/latest/admin/resource-options.html#multi-factor-auth-rules
[2] https://docs.openstack.org/api-ref/identity/v3/#create-user

Change-Id: I4e41bae2e8cfbe92d52b14d856991bedcd44164f
2020-03-26 22:24:39 +05:30
Igor Malinovskiy
f03cb68ad8 Add 'address_scope' type support to network rbac commands
Change-Id: I6a4b7219934805c1bbd1e88fcc670ae231d9ac37
Partial-Bug: #1862968
Depends-On: https://review.opendev.org/709122
2020-03-26 12:40:12 +00:00
Zuul
74616cd235 Merge "Complete switch from glanceclient to SDK for image service" 2020-03-25 15:19:21 +00:00
Zuul
21c883b3d3 Merge "Switch image to use SDK" 2020-03-25 15:19:20 +00:00
Zuul
2c8d705a24 Merge "Add unit tests and release note for dns_publish_fixed_ip" 2020-03-24 21:24:52 +00:00
Artem Goncharov
768a64aac5 Complete switch from glanceclient to SDK for image service
In https://review.opendev.org/#/c/650374/ a work has been started to
switch image service support from glanceclient with all it's
dependencies to the SDK version. With this change version 1 (anyway
deprecated since ages) is also being switched to SDK.

Change-Id: Ic391500af02a73d81d64a9e9113cca85c9e24390
2020-03-24 13:13:06 +00:00
Artem Goncharov
60e7c51df4 Switch image to use SDK
This is a work to switch OSC from using glanceclient to OpenStackSDK.

With this change only v2 is using OpenStackSDK. V1 is still using
glanceclient and will be switched in a separate change.

Remove the direct depend on keystoneauth- let that flow through
openstacksdk.

Depends-on: https://review.opendev.org/#/c/698972
Change-Id: I36f292fb70c98f6e558f58be55d533d979c47ca7
2020-03-23 14:38:32 -05:00
Zuul
fc12033f1d Merge "Now we can add description for role creation in OSC" 2020-03-20 18:59:44 +00:00
Hongbin Lu
962efd949f Disallow setting default on internal network
The ``--default`` option should be only used for external network.
Default internal network is not currently supported so we disallow
it for now.

Change-Id: Ia9d39b40e1e041d7bda0f6a27d058e382b572e1a
Closes-Bug: #1745658
2020-03-09 21:01:53 -05:00
Monty Taylor
e6e4b73efa Complete "Drop python2 support" goal
We stopped testing python2, but there are more things to be cleanup.

- Remove python2 entries from setup.cfg
- Add releasenotes
- remove universal wheel since this is only python 3 now

Change-Id: Ie2bbb4d34b8411939ad5cfd750fc76c933779542
2020-02-05 05:58:51 +00:00
Colleen Murphy
70ab3f9dd5 Add support for app cred access rules
This commit introduces the --access-rules option for 'application
credential create' as well as new 'access rule' commands for listing,
showing, and deleting access rules.

bp whitelist-extension-for-app-creds

Change-Id: I04834b2874ec2a70da456a380b5bef03a392effa
2020-01-17 11:14:51 -08:00
Dean Troyer
68aa35f35f Add unit tests and release note for dns_publish_fixed_ip
Follow-up to https://review.opendev.org/#/c/679834/ which
added the options and lacked both a release note and
minimal option-handling unit tests.

Change-Id: Ibb2820add9b2fedaf5a8b1a77babf043f6641724
Signed-off-by: Dean Troyer <dtroyer@gmail.com>
2020-01-14 09:53:13 -06:00
KeithMnemonic
f5384ae16a Fix openstack server list --deleted --marker option
This patch removes using the "name" option for a marker when
--deleted is also used. The find_resource() function
that is being called does not correctly handle using the marker
as the "name" in the search when also using deleted=True.
One simple way to fix this is force the marker to only be an ID
when --deleted is used. This is how the nova client works.

Using the --deleted option is available to users with the admin
role by default. If you're an admin listing --deleted servers
with a marker by name, find_resource() is going to fail to find
it since it doesn't apply the --deleted filter to find_resource().

The find_resource() function is trying to find the marker server
by name if it's not found by id, and to find it by name it's
listing servers with the given marker as the name, but not
applying the --deleted filter so it doesn't get back any results.

In the story it was suggested modifying find_resource to include
the deleted query param when it's specified on the command line but
that didn't work because it still results in something like this:

http://192.168.1.123/compute/v2.1/servers?deleted=True&name=4cecd49f-bc25-4a7e-826e-4aea6f9267d9

It seems like there are bugs in find_resource().

Restricting the marker to be the server ID when listing deleted servers
is probably OK since if you're using --deleted you're an admin and you could
be listing across all projects and if you're filtering by a server across all
projects anyway (not that you have to, I'm just saying if you are), or even
showing a server in another project, you have to do it by id rather than name
because find_resource() won't find the server in another project by name, only ID.

story: 2006761
Task: 37258

Change-Id: Ib878982b1d469212ca3483dcfaf407a8e1d2b417
2020-01-02 20:05:56 +00:00
zhangbailin
874a726f52 Microversion 2.79: Add delete_on_termination to volume-attach API
Added ``--disable-delete-on-termination`` and
``--enable-delete-on-termination`` options to the
``openstack server add volume`` command that enables users to mark
whether to delete the attached volume when the server is destroyed.

Depends-On: https://review.opendev.org/#/c/681267/

Part of blueprint support-delete-on-termination-in-server-attach-volume

Change-Id: I6b5cd54b82a1135335a71b9768a1a2c2012f755b
2019-11-19 21:07:20 +00:00
Zuul
7e98aaefa9 Merge "Add parent project filter for listing projects" 2019-10-22 21:16:40 +00:00
154df0d069 Update master for stable/train
Add file to the reno documentation build to show release notes for
stable/train.

Use pbr instruction to increment the minor version number
automatically so that master versions are higher than the versions on
stable/train.

Change-Id: I2cab236b14bc5eac173d815a634c8d8eb2afee04
Sem-Ver: feature
2019-10-04 13:06:18 +00:00
Zuul
371f5f5522 Merge "Add 'openstack server migrate (confirm|revert)' commands" 2019-10-03 11:19:48 +00:00
Zuul
aa64eb6b0a Merge "Update release table for Train and 4.0.0" 2019-09-11 19:35:52 +00:00
Dean Troyer
cb0c20b23c Update release table for Train and 4.0.0
Also clean up some docs and release notes.

Change-Id: I73feec747ca1bd12be5e5700c9ca608ed3a8b2c2
Signed-off-by: Dean Troyer <dtroyer@gmail.com>
2019-09-10 23:48:32 -05:00
Zuul
9101440c07 Merge "Add doc and relnote for review 639652" 2019-09-11 04:00:32 +00:00
Zuul
71d805008b Merge "Default to Cinder v3 API" 2019-09-10 21:23:52 +00:00
Stephen Finucane
609988ebac Add 'openstack server migrate (confirm|revert)' commands
While cold migration and resize are essentially the same operation under
the hood, meaning one could use the 'openstack server resize confirm'
and 'openstack server resize revert' commands instead, there is no
reason the operator needs to know this. Add these flags as syntactic
sugar to help simplify operators lives.

The help texts for both the 'openstack server resize' and 'openstack
server migrate' commands are updated to clarify the relationship between
the two operations.

Change-Id: I0cb6304c794bffaec785add9f7b8cf53ab28cacd
Signed-off-by: Stephen Finucane <sfinucan@redhat.com>
2019-09-10 13:45:41 +00:00
Zuul
d1385971bb Merge "Add floating IP Port Forwarding commands" 2019-09-09 16:12:23 +00:00
Dean Troyer
037a800538 Add doc and relnote for review 639652
https://review.opendev.org/639652/

Change-Id: I10c0f8a0e09150e7d516ed9cb7ffb2a8e8fe4911
Signed-off-by: Dean Troyer <dtroyer@gmail.com>
2019-09-09 10:31:49 -05:00
Sean McGinnis
a96089ff6d Default to Cinder v3 API
This switches the default Cinder API version to v3 to prepare for v2
going away.

Change-Id: Icca1512b715409e3001c0fd2d1ea663d5e71ec02
Signed-off-by: Sean McGinnis <sean.mcginnis@gmail.com>
2019-09-09 09:35:44 -05:00
zhangbailin
dd1ce37042 Follow-up: fix the invalid releasenote link
By reviewing OSC's releasenote document [1], I found that the
blueprint index is invalid. This patch fixes this problem.

[1]https://docs.openstack.org/releasenotes/python-openstackclient/unreleased.html#new-features

Related-On: https://review.opendev.org/#/c/665336
Part of blueprint support-specifying-az-when-restore-shelved-server

Change-Id: I14066dcfff5a585d51b4f365883a86a5cc086d45
2019-09-05 11:11:26 +08:00
zhangbailin
fcd46acb69 Microversion 2.77: Support Specifying AZ to unshelve
This patch adds a new parameter ``--availability-zone`` to
``openstack server unshelve`` command. This can help users to specify
an ``availability_zone`` to unshelve a shelve offloaded server from
2.77 microversion.

Depends-On: https://review.opendev.org/679295

Implements: blueprint support-specifying-az-when-restore-shelved-server

Change-Id: Ia431e27c2a17fe16466707cc362532860ecf22df
2019-09-03 21:38:44 +00:00
Takashi Kajinami
7c1b6a799e Add parent project filter for listing projects
This patch introduces a new option --parent into project list,
to specify a parent project to filter projects which has
the given project as their parent.

Depends-on: https://review.opendev.org/#/c/677101
Change-Id: I6725262cf040e0ec6ceca9cf0462ce59224049c6
2019-09-02 09:05:37 +09:00
LIU Yulong
f044016e29 Add floating IP Port Forwarding commands
Add following commands:
  floating ip port forwarding create
  floating ip port forwarding delete
  floating ip port forwarding list
  floating ip port forwarding set
  floating ip port forwarding show

Closes-Bug: #1811352
Change-Id: I6a5642e8acce28fc830410d4fa3180597b862761
2019-08-29 07:39:42 +08:00
Zuul
a15e4741fa Merge "Add 'openstack server resize (confirm|revert)' commands" 2019-08-20 18:12:20 +00:00
Zuul
8ef2602447 Merge "Add openstack server create --boot-from-volume option" 2019-08-20 18:10:21 +00:00
Zuul
07fcb733fc Merge "Support type=image with --block-device-mapping option" 2019-08-20 17:58:30 +00:00
Zuul
b0ec909160 Merge "Fix compute service set handling for 2.53+" 2019-08-20 17:53:33 +00:00
Zuul
9042668da4 Merge "Make configuration show not require auth" 2019-08-09 17:29:40 +00:00
Matt Riedemann
b9d6310556 Add openstack server create --boot-from-volume option
This adds a --boot-from-volume option to the server create
command which is used with the --image or --image-property
option and will create a volume-backed server from the
specified image with the specified size. Similar to the
--volume option, the created root volume will not be deleted
when the server is deleted. The --boot-from-volume option
is not allowed with the --volume option since they both create
a block device mapping with boot_index=0.

Change-Id: I88c590361cb232c1df7b5bb010dcea307080d34c
Story: 2006302
Task: 36017
2019-08-09 16:44:46 +00:00
Matt Riedemann
6a199bd141 Support type=image with --block-device-mapping option
The --block-device-mapping option on the server create
command currently only supports booting from volume and
volume snapshot. A common boot-from-volume scenario is
providing an image and letting nova orchestrate the
creation of the image-backed volume and attaching it to
the server.

This adds support for type=image in the --block-device-mapping
option. The volume size is required in this case. Note that
the CLI currently says if type=snapshot that size is also required
but that's technically not true. When booting from a volume
snapshot, the compute API will use the size of the volume snapshot
to create the volume if an explicit size is not provided. For the
purposes of this patch, we need the size anyway for the image
being the block device mapping source type.

Change-Id: I57b3c261d8309f7b9f62a3e91612bce592a887a3
Story: 2006302
Task: 36016
2019-08-09 16:36:17 +00:00