summaryrefslogtreecommitdiff
path: root/openstackclient/compute
Commit message (Collapse)AuthorAgeFilesLines
* Migrate server_groups to the new APIViolet Kurtz2022-08-021-45/+58
| | | | | | Moved the server_groups to the new API. Change-Id: Ied7bd6f56e277f0c5efcd5ba028765f9be65050f
* Merge "Add more filter option of columns for server list -c COLUMN"Zuul2022-06-201-0/+21
|\
| * Add more filter option of columns for server list -c COLUMNJIHOJU2022-04-191-0/+21
| | | | | | | | | | | | | | | | | | | | | | | | In order to improve the convenient of use, columns corresponding to the "--long" option has been added so that it can be used in the filter. Currently filterable columns include the following: 'ID', 'Name', 'Status', 'Networks', 'Image', 'Flavor'. Story: 2009150 Task: 43113 Change-Id: I6760ca5da0e3707d1d746ae5eeec7d9162020d15
* | Add 'Host Status' to 'server list --long' with >= v2.16melanie witt2022-05-161-0/+15
| | | | | | | | | | | | | | | | | | | | | | | | | | Currently, the 'Host Status' field is shown only for 'server show' but not for 'server list'. The host_status can be helpful for users who are having issues with servers that show a status of ACTIVE, as it can show a hint about the compute host status when nova policy is configured to allow it. Story: 2009689 Task: 44003 Change-Id: I6209cf52044218b7b32ab2fa5712574f12ba2f5f
* | Merge "Fix typos"Zuul2022-05-161-2/+2
|\ \
| * | Fix typosCyril Roelandt2021-10-261-2/+2
| | | | | | | | | | | | Change-Id: Idd502c8df21da79ff3b9339870f38378f5337879
* | | Stop using private _is_uuid_like methodPavlo Shchelokovskyy2022-04-201-3/+3
| |/ |/| | | | | | | | | | | | | | | | | | | | | | | | | | | currently this double-private method of a dependency library is used in several places (openstack.cloud._utils._is_uuid_like) openstacksdk deliberatly chose not to depend on oslo.utils to keep dependenies to the minimum, so it just copied several methods from it, including the is_uuid_like. python-openstackclient however already depends on oslo.utils, so using the public method from oslo.utils should be preferred and more stable. Change-Id: I578ffa36ffb00c9d47ee12a149313201973edd32
* | compute: Add 'Security Groups' for 'server list'Thobias Salazar Trevisan2022-03-151-0/+11
| | | | | | | | | | | | | | Add a column with security groups name for --long option on server list. Change-Id: I7062f224e18c3c8ac96a06d7ce97f9fab473bdb9
* | compute: Move server migrations commands to their own fileStephen Finucane2022-03-092-463/+485
| | | | | | | | | | | | | | | | The 'openstackclient.compute.v2.server' module is getting rather large. The server migration commands don't need to be in there. Move them. Change-Id: I8b2600cfd9f8e37d3093c52c7222d85e84e7fc89 Signed-off-by: Stephen Finucane <sfinucan@redhat.com>
* | compute: Allow retrieval of migration by UUIDStephen Finucane2022-03-091-5/+97
| | | | | | | | | | | | | | | | | | The nova API doesn't allow you to retrieve migration records by UUID, only ID. This is confusing. Work around it by listing records and filtering this list. Change-Id: I932c9c70420e85056509513e005bb78168e70611 Signed-off-by: Stephen Finucane <sfinucan@redhat.com>
* | Merge "Fix 'server event list|show' for deleted servers"Zuul2022-03-091-9/+29
|\ \
| * | Fix 'server event list|show' for deleted serversmelanie witt2022-02-091-9/+29
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | As of compute microversion >= 2.21, support for list and show of server events for deleted servers was added. This however wasn't working using the openstackclient because the compute GET /servers/{server_id} will not return a deleted server, so osc_lib.utils.find_resource() fails to find the server and the command bails early. This adds a check for a uuid-like <server> arg and uses it directly if the <server> cannot be found via find_resource(). A note is also added to the command help to indicate that list and show for deleted servers will only work if a server ID is passed (name will not work). Story: 2009841 Task: 44443 Change-Id: Icd33b3b9a3a1855d7893dd111bbb2aca059f45fd
* | | Merge "compute: Use correct command class for 'show migration'"Zuul2022-03-091-2/+7
|\ \ \
| * | | compute: Use correct command class for 'show migration'Stephen Finucane2021-11-031-2/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We should be inheriting from 'ShowOne'. Failure to do so results in a tuple being dumped to the screen. Not what we intended. While we're here, we update the docstring of this command to clarify the command's intent. Nova does not provide an API to retrieve an individual migration record for a cold migration or completed live migration. As such, the 'server migration show' command only works for in-progress live-migrations. Change-Id: I2e2fe3da7d642b9e8e3d930603dcde178cd68cde Signed-off-by: Stephen Finucane <sfinucan@redhat.com> Story: 2009658 Task: 43837
* | | | Merge "compute: Don't warn if disk overcommit params unset"Zuul2022-02-091-2/+6
|\ \ \ \ | |/ / / | | / / | |/ / |/| |
| * | compute: Don't warn if disk overcommit params unsetStephen Finucane2021-11-031-2/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Due to a small logic error, we were emitting a warning about a deprecated option when the user tried to live migrate an instance using microversion 2.25 even though the user hadn't actually set that option. Correct this. Change-Id: Ib61e817bd4ced9b5533e7c7f9d8f0b45fe81c211 Signed-off-by: Stephen Finucane <sfinucan@redhat.com> Story: 2009657 Task: 43836
* | | Merge "Skip original_name from flavor info"Zuul2022-01-171-1/+1
|\ \ \
| * | | Skip original_name from flavor infoArtem Goncharov2022-01-141-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In the new SDK we are going to add additional parameter to the flavor which make no use for OSC. Exclude it explicitly since it also cause failing tests. Change-Id: Ie35e60498cf18f05c878611df6f88607a04b1870
* | | | Switch compute service list, delete and set to sdk.Ritvik Vinodkumar2022-01-141-60/+71
|/ / / | | | | | | | | | | | | | | | Switch the compute service commands from novaclient to SDK. Change-Id: I16498905101d6c2702a3ccbaf8cf5e3098d51992
* | | Merge "Include hosts in aggregate list --long"Zuul2021-12-251-0/+2
|\ \ \
| * | | Include hosts in aggregate list --longDavid Caro2021-06-031-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This makes it easier to get the total list of aggregates and the hosts belonging to each of them (specially for scripting purposes). Change-Id: I94833c15075ae655bc11e7c0fc47c0abad5846fc Signed-off-by: David Caro <me@dcaro.es>
* | | | Merge "compute: Return information about fixed IP"Zuul2021-12-251-5/+28
|\ \ \ \
| * | | | compute: Return information about fixed IPStephen Finucane2021-12-141-5/+28
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The compute API provides this information to us. We might as well use it. Change-Id: I5608fa80745975ce49712718452cfe296c0f64d2 Signed-off-by: Stephen Finucane <sfinucan@redhat.com>
* | | | | Merge "Switch add fixed IP to SDK"Zuul2021-12-251-15/+29
|\ \ \ \ \ | |/ / / /
| * | | | Switch add fixed IP to SDKRitvik Vinodkumar2021-12-141-15/+29
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Switch the add fixed IP command from novaclient to SDK. Change-Id: I4752ea7b4bfc17e04b8f46dbe9a68d938501a89e
* | | | | compute: Pass through args to sshHugh Saunders2021-12-151-20/+56
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Why limit a user to preset ssh arguments? Capture them all and send them along to ssh to deal with. This allows users to use the full range of ssh arguments, including specifying a command to run on the instance. For example: openstack server ssh -4 upg -- -l cirros -i ~/id_rsa_upg "date; uptime" SSH arguments that openstackclient currently mirrors are deprecated except for -4 and -6, as they are useful for retrieving the correct instance IP. Change-Id: Ia50786d5eee52688e180550fe16aeb8af610154b Co-authored-by: Stephen Finucane <stephen@that.guru>
* | | | | compute: Fix weird option definition for 'server ssh'Stephen Finucane2021-12-151-29/+4
|/ / / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | argparse allows you to specify multiple options for a given argument when declaring the argument. For some reason, we weren't doing this for the 'server ssh' command. There's no apparent reason for doing things this way and it's been that way since the beginning (2013) so let's not do that. We also add unit tests since they were missing and should exist. Change-Id: I67a9e6516d7057266210cd4083e9ddeb1cfaa5de Signed-off-by: Stephen Finucane <sfinucan@redhat.com>
* | | | Fix RemoveServerVolumeDr. Jens Harbott2021-12-081-11/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The nova API we're using to delete a server volume attachment needs to be handed a volume, not a volume attachment. Also make sure that we create an error if the volume isn't actually attached to the server. Signed-off-by: Dr. Jens Harbott <harbott@osism.tech> Co-authored-by: Stephen Finucane <sfinucan@redhat.com> Change-Id: I12abd3787ea47acb4da282d00fdc1989405a0564
* | | | Merge "compute: Show flavor in 'server list' with API >= 2.47"Zuul2021-11-301-20/+22
|\ \ \ \
| * | | | compute: Show flavor in 'server list' with API >= 2.47Khomesh Thakre2021-11-301-20/+22
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Fix the issue where the flavor name was empty in server list output. This requires somewhat invasive unit test changes to reflect the changed API response from the server, but this has the upside of meaning we don't need new tests since what we have validates things. Also drop the flavor ID column as it is removed from the compute API. Change-Id: Ica3320242a38901c1180b2b29109c9474366fde0 Signed-off-by: Khomesh Thakre <khomeshthakre24@gmail.com> Story: 2008257 Task: 41113
* | | | | Merge "Switch openstack server remove port/network to using sdk"Zuul2021-11-301-9/+16
|\ \ \ \ \
| * | | | | Switch openstack server remove port/network to using sdkDiwei Zhu2021-11-291-9/+16
| | | | | | | | | | | | | | | | | | | | | | | | Change-Id: I1540c1f52e9a107dba20eeea9dc323c5510fe2b1
* | | | | | Merge "Switch server suspend and server resume to SDK"Zuul2021-11-301-10/+10
|\ \ \ \ \ \
| * | | | | | Switch server suspend and server resume to SDKThrivikram Mudunuri2021-11-291-10/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Switch the server suspend and server resume commands from novaclient to SDK. Use the SDK versions of test fakes to support fake Server resources. Change-Id: Idd0b4f13fab0f238e42844a7d759538bbda24f68
* | | | | | | Merge "Switch server pause and server unpause to SDK"Zuul2021-11-301-11/+11
|\ \ \ \ \ \ \ | |/ / / / / / | | | / / / / | |_|/ / / / |/| | | | |
| * | | | | Switch server pause and server unpause to SDKThrivikram Mudunuri2021-11-291-11/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Switch the server pause and server unpause commands from novaclient to SDK. Use the SDK versions of test fakes to support fake Server resources. Change-Id: Id626f06f3d7edd44b306b7fc7b9b00d04af09621
* | | | | | compute: Reorder building of columns for 'server list'Stephen Finucane2021-11-301-87/+105
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This has no impact on the end result, but it should make fixing issues introduced by API microversion 2.69 a little easier. Change-Id: I7d70eac8aa1a6197ed05a49f071e6899ec219c03 Signed-off-by: Stephen Finucane <sfinucan@redhat.com>
* | | | | | Merge "Switch server image create to SDK"Zuul2021-11-291-9/+9
|\ \ \ \ \ \ | |/ / / / / |/| | | | |
| * | | | | Switch server image create to SDKThrivikram Mudunuri2021-11-161-9/+9
| | |_|/ / | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Switch the server image create command from novaclient to SDK. Use the SDK versions of test fakes to support fake Server resources. Also, fetch updated image *after* waiting. If a user requests that we wait (--wait) for a server image to become active before returning, then we should probably return the final image. If we don't then the image can appear to be in a non-active state when it fact it's active. Correct this by fetching the image after the wait call. Change-Id: I83a403c035add9ab041ed6d59b5b29e42267f143
* | | | | Switch command server remove volume to sdkDiwei Zhu2021-11-261-10/+17
| |/ / / |/| | | | | | | | | | | Change-Id: If6f6cf93b55a67e767c54de8ce21f25252cf99ca
* | | | Switch command server add volume to sdk.Diwei Zhu2021-11-221-21/+17
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | File tests.unit.volume.v2.fakes is modified to provide sdk volume fakes. File tests.unit.compute.v2.fakes is modified to provide sdk volume attachment fakes. For test, setup_sdk_volumes_mock() method is created so that volumes are created in similar way as servers are created. Change-Id: I290ba83b6ba27a1377ab73fd0ae06ecced25efd1
* | | | Merge "Switch openstack server add port/network to using sdk."Zuul2021-11-151-12/+11
|\ \ \ \
| * | | | Switch openstack server add port/network to using sdk.Diwei Zhu2021-11-141-12/+11
| |/ / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The old novaclient.v2.server.Server.interface_attach() method is replaced with proxy.create_server_interface(). In swargs, 'net_id' and 'port_id' are mutual-exclusive, if one of them is given with value, the other one cannot be None, as the API would responde with 400 (None is not string). In unit test, temporary method 'setup_sdk_servers_mock' is added, because other tests are still using the old 'setup_servers_mock'. Functional tests are added. Releasenote is generated. Change-Id: I9899f0509febc5143560a1859ae6344d0a6d1427
* | | | compute: Return details of attached volumes5.7.0Stephen Finucane2021-11-031-2/+20
|/ / / | | | | | | | | | | | | | | | | | | | | | | | | The API behind the 'server add volume' command returns details of the created volume attachment, however, we were dropping these results rather than displaying them to the user. Correct this. Change-Id: I3f7e121220d29422ccf4e6940de2f28bb8496c83 Signed-off-by: Stephen Finucane <sfinucan@redhat.com>
* | | Switch server backup to sdk.Diwei Zhu2021-10-271-6/+3
| |/ |/| | | | | | | | | | | | | | | Switch this command from novaclient to SDK. As this is the first command related to server that we are migrating, we need to extend our test fakes to support fake Server resources. The extended fakes will replace the old ones once all commands related to server are switched. Change-Id: If476fb1614a64320ed071bbda35e941bf3290a2e
* | compute: Fix filtering servers by tagsStephen Finucane2021-10-131-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The nova API expects the 'tags' and 'not-tags' filters of the 'GET /servers' (list servers) API to be a CSV string [1]: tags (Optional) A list of tags to filter the server list by. Servers that match all tags in this list will be returned. Boolean expression in this case is 't1 AND t2'. Tags in query must be separated by comma. New in version 2.26 not-tags (Optional) A list of tags to filter the server list by. Servers that don’t match all tags in this list will be returned. Boolean expression in this case is 'NOT (t1 AND t2)'. Tags in query must be separated by comma. New in version 2.26 We were instead providing a Python list, which was simply being URL encoded. Correct this. [1] https://docs.openstack.org/api-ref/compute/?expanded=list-servers-detail#list-servers Change-Id: Ie0251a0dccdf3385089e5bbaedf646a5e928cc48 Signed-off-by: Stephen Finucane <sfinucan@redhat.com> Closes-Bug: #1946816
* | Merge "Add --trusted-image-cert option for server create"Zuul2021-10-061-1/+31
|\ \
| * | Add --trusted-image-cert option for server createPavlo Shchelokovskyy2021-09-301-1/+31
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | this already exists for server rebuild, but was missing for server create. This option is supported from Compute API version >= 2.63, and is only available for servers booted directly from images (not from volumes, not from snapshots, and not from images first converted to volumes). Additionally, this patch removes mentions of OS_TRUSTED_IMAGE_CERTIFICATE_IDS env var from similar option help string in server rebuild command as it is not actually implemented yet. Change-Id: I4e9faea05c499bd91034d1d284c44fdcc8e18db5
* | | Merge "Fix typo error in listing server's column name"Zuul2021-10-061-1/+1
|\ \ \ | |/ / |/| |
| * | Fix typo error in listing server's column nameLEE JAE YONG2021-08-281-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | openstack server list -c "Created At" command doesn't work because the wrong variable was used here. When we receive resp data, Created At data is saved with the name "created". But in "server.py", we append columns as created_at. So it seems to print an empty table. Story: 2009149 Task: 43112 Change-Id: I06de6903d5cc427a8b0fdcd168fec47192f4365b