summaryrefslogtreecommitdiff
path: root/novaclient/v2/servers.py
Commit message (Collapse)AuthorAgeFilesLines
* Microversion 2.91: Support specifying destination host to unshelveRené Ribaud2022-07-281-2/+63
| | | | | | | | | | This patch adds ``host`` to novaclient api. This can help administrators to specify a ``host`` to unshelve a shelve offloaded server from 2.91 microversion. Depends-On: https://review.opendev.org/c/openstack/nova/+/831507 Implements: blueprint unshelve-to-host Change-Id: I7efc8f0b0ef159e16cefee761bff5d7e90d0c427
* Microversion 2.90 - Configurable hostnamesxena-em17.6.0Stephen Finucane2021-09-021-33/+100
| | | | | | Change-Id: Icd4362a07196e59bafcdfaff44323ce1386d4f55 Signed-off-by: Stephen Finucane <stephenfin@redhat.com> Depends-On: https://review.opendev.org/c/openstack/nova/+/778550/
* Make 'server list --config-drive' a boolean optionStephen Finucane2020-04-081-5/+4
| | | | | | | | | | | | Instead of passing through whatever the user provides and exposing this bug in the REST API, simply make the opt a boolean one in expectation of a day where the API issues have been resolved. This also introduces machinery necessary to use more of these types of opts in the future. Change-Id: I9033540ac65ac0ee7337f16bdd002060652092ea Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
* Microversion 2.83 - Add more filters for the nova list commandVictor Coutellier2020-04-071-0/+6
| | | | | | | | | | | | | | | | | | | Add these new filters, admin-only until microversion 2.82: - availability-zone - config-drive - key-name - power-state - task-state - vm-state - progress Existing user filter will be available to non admin since microversion 2.83. Part of blueprint non-admin-filter-instance-by-az Change-Id: Id2b5e600c0a41790830823031b20983808cb5ace
* Remove sixStephen Finucane2020-02-211-18/+9
| | | | | | | | Mostly a find-replace job. Let's do this now so we don't have to carry it for the next decade. Change-Id: I7bef9fb7c6895f746cee1aca6522786f38b9857c Signed-off-by: Stephen Finucane <sfinucan@redhat.com>
* Add a check for --config-drive option on nova bootTakashi NATSUME2019-09-181-2/+2
| | | | | | | | | | | | | | A value of the '--config-drive' option must be a boolean value on the 'nova boot' command because nova accepts a boolean value only for the 'config_drive' parameter. So add a check for the '--config-drive' option on the 'nova boot' command. Fix a description for 'config_drive' parameter in the 'create' method of the novaclient.v2.ServerManager class. Change-Id: Ic6e65139302fbb662fb6ba60e73633dad8ffb72e Closes-Bug: #1825061
* Microversion 2.78 - show server topologyYongli He2019-09-061-0/+18
| | | | | | | | | | | Add support microversion 2.78 which adds server topology information in the output of the following new command: nova server-topology Depends-on: https://review.opendev.org/#/c/621476/ Change-Id: I6467d52d2528a37348458baf4842b571a97f3ed2 Implements: blueprint show-server-numa-topology
* Microversion 2.77: Support Specifying AZ to unshelvezhangbailin2019-08-281-0/+29
| | | | | | | | | | | This patch adds a new parameter ``--availability-zone`` to ``nova 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/#/c/663851/ Implements: blueprint support-specifying-az-when-restore-shelved-server Change-Id: I8bce8f430bc54f03bacc105e37fc8b3bbf2432c2
* Update api-ref locationAndreas Jaeger2019-07-221-1/+1
| | | | | | | | | | | | | | The api documentation is now published on docs.openstack.org instead of developer.openstack.org. Update all links that are changed to the new location. Note that redirects will be set up as well but let's point now to the new location. For details, see: http://lists.openstack.org/pipermail/openstack-discuss/2019-July/007828.html Change-Id: I53120e2ff3ae337a55c4cd0904bc9ad1dd54d082
* Add host and hypervisor_hostname to create serverszhu.boxiang2019-07-081-3/+27
| | | | | | | | | | Adds the --host and --hypervisor-hostname options to the nova boot command and related python API bindings. Depends-On: https://review.opendev.org/#/c/645520/ Change-Id: If16d00b75f4d5f2b96aa6e3f32a973108049d928 Blueprint: add-host-and-hypervisor-hostname-flag-to-create-server
* Merge "Allow passing negative values for the locked search_opt in ↵Zuul2019-05-231-2/+7
|\ | | | | | | cs.servers.list"
| * Allow passing negative values for the locked search_opt in cs.servers.listSurya Seetharaman2019-05-221-2/+7
| | | | | | | | | | | | | | | | | | | | | | | | This patch adds support for novaclient to pass the "locked" search_opts with a "False" value upto the server side. This is required for the OSC change[1] to support the "unlocked" filter parameter. [1] https://review.opendev.org/#/c/659124/ Related to blueprint add-locked-reason Change-Id: I0907f4ad2decb308c9db8b0cf9e7962bf1b517b5
* | Merge "Optimize limit option docs string description for novaclient"Zuul2019-05-171-0/+4
|\ \ | |/ |/|
| * Optimize limit option docs string description for novaclientchenke2019-05-171-0/+4
| | | | | | | | Change-Id: I85ee36b0447869771782d1059957a46447940b59
* | Microversion 2.73: Support adding the reason behind a server lockSurya Seetharaman2019-05-131-0/+28
|/ | | | | | | | | | | | | This patch adds a new parameter ``--reason`` to ``nova lock`` command and ``--locked`` filtering/sorting parameter to ``nova list`` command. This can help users to provide a reason when locking the server and to filter/sort instances based on their locked or value from 2.73 microversion. Implements blueprint add-locked-reason Depends-On: https://review.opendev.org/#/c/648662/ Change-Id: I438e6db2dd5000ba388d0a0f1c8ab74b96b47a71
* Add support for microversion v2.7213.0.0Lajos Katona2019-03-061-0/+4
| | | | | | | | | | | | | This microversion in Nova is added to support Neutron ports having resource request during server create to guarantee minimum bandwidth QoS. This is a behavior-only change in the compute API, there are no changes to the server create request or response schema. Change-Id: I1a39390015acd8703e8bab55af13f5c75ae226db Depends-On: https://review.openstack.org/636360 Partial-Bug: #1578989 See-Also: https://review.openstack.org/502306 (nova spec) See-Also: https://review.openstack.org/508149 (neutron spec)
* Merge "Fix output of interface-attach command"Zuul2019-02-261-2/+4
|\
| * Fix output of interface-attach commandTakashi NATSUME2019-02-191-2/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add output of a result in the 'nova interface-attach' command when it is successful. Make the following methods return a 'NetworkInterface' object instead of a 'Server' object. * The 'interface_attach' method in the 'novaclient.v2.Server' class * The 'interface_attach' method in the 'novaclient.v2.ServerManager' class Remove unnecessary code in the 'nova interface-detach' command because the response body is not returned. Change-Id: Id5316d8ad4a4b67e8399b51e602aafc83bc128c6 Closes-Bug: #1816511
* | Make Server.networks use a predictable sort orderMatt Riedemann2019-02-201-2/+9
|/ | | | | | | | | | | | This changes the Server.networks property method to return an OrderedDict where the keys (network labels) are sorted which will allow for a predictable sort order on the resulting networks attached to a Server resource. This affects the output of "nova list" and "nova show" commands so a simple release note is added to mention the change. Change-Id: I2e9b3c6a256509c045966035da24d58628f1b33b
* Microversion 2.68: Remove 'forced' live migrations, evacuationsStephen Finucane2019-02-131-52/+124
| | | | | | | | | | | Update the commands and Python API bindings to reflect the new microversion. The various evacuate microversion functions are DRY'd up along the way. Change-Id: Ibfc905292258ffde05800387e5d6bbad4823085c Signed-off-by: Stephen Finucane <sfinucan@redhat.com> Depends-On: https://review.openstack.org/#/c/634600/ Implements: blueprint remove-force-flag-from-live-migrate-and-evacuate
* Fix flavor keyerror when nova boot vmzhaolihui2018-12-131-1/+1
| | | | | | | | | | | | | | | | | | | | When creating a server (the 'nova boot' command), it calls 'POST /servers' API. The response does not have 'addresses' and 'flavor' attributes. When accessing 'networks' attribute in the '_print_server' function, it calls 'GET /servers/{server_id}' and get the 'addresses' and 'flavor' attributes. If 'GET /servers/{server_id}' fails, the server object does not have the 'flavor' attribute, then KeyError is raised when accessing it. Fix the issue by making it raise a CommandError when the 'GET /servers/{server_id}' fails. Co-Authored-By: Takashi Natsume <natsume.takashi@lab.ntt.co.jp> Change-Id: I3ef096c61b0e05a637ab0c4a1027338fa87e4f09 Closes-Bug: #1781368
* Fix a type of block_device_mapping_v2 in a commentTakashi NATSUME2018-11-211-2/+3
| | | | | Change-Id: I9c74402fbc4b2390b64265c6f174bc7e343900cc Closes-Bug: #1804198
* Add support for microversion 2.67: BDMv2 volume_typeMatt Riedemann2018-10-141-0/+8
| | | | | | | | | | | | | This adds the nova boot command and python API binding support for creating a server with block device mappings defined using a specific volume type. Depends-On: https://review.openstack.org/606398/ Depends-On: https://review.openstack.org/#/c/610349/ Part of blueprint boot-instance-specific-storage-backend Change-Id: I484ee065119b5783db212ea64efa60e87c40338c
* Microversion 2.63 - Add trusted_image_certificatesJackie Truong2018-06-151-3/+32
| | | | | | | | | | | | | | | | | | | | | | | | | This change adds a `--trusted-image-certificate-id` option to the `nova boot` and `nova rebuild` commands. This option takes in a a single trusted certificate ID. The option may be used multiple times to specify multiple trusted certificate IDs, which will be used to validate certificates in the image signature verification process. If ID values are not specified using this option, the value of the newly added OS_TRUSTED_IMAGE_CERTIFICATE_IDS environment variable will be used instead. This value will be converted into a list before being passed on. The ``nova rebuild`` command also gets a new ``--trusted-image-certificates-unset`` option to unset/reset the trusted image certificates in a server during rebuild. This is similar to unsetting key_name and user_data during rebuild. Corresponding `trusted_image_certificates` kwarg has been added to the server create and rebuild Python API bindings. Co-Authored-By: Brianna Poulos <Brianna.Poulos@jhuapl.edu> Co-Authored-By: Matt Riedemann <mriedem.os@gmail.com> Change-Id: I235541a689732826950c7b2a510d5835211120c3 Implements: blueprint nova-validate-certificates
* Merge "Revert "Fix listing of instances above API max_limit""10.3.0Zuul2018-06-061-4/+1
|\
| * Revert "Fix listing of instances above API max_limit"Matt Riedemann2018-06-051-4/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This reverts commit eff607ccef91d09052d58f6798f68d67404f51ce. There was no apparent need for the change being reverted since user can list all servers by specifying --limit=1 when running the nova list command. The change introduced a problem whereby the first pass to list instances from the server would get up to [api]/max_limit (default 1000) results and then call again with a marker. If the last instance in the list (the marker) is corrupted in the instance_mappings table in the API DB by not having an associated cell mapping, listing instances will always fail with a MarkerNotFound error even though the CLI user is not passing a marker nor specifying --limit=-1. The corrupted instance mapping record resulting in the MarkerNotFound error is something else that should be fixed on the server side (and likely result in a 500) but the change in behavior of the CLI makes it always fail if you hit this even if you're not passing a marker. Change-Id: Ibb43f500a74733b85bd3242592d36985bfb45856 Closes-Bug: #1773945
* | Fix the docstring for the update methodTatiana Kholkina2018-02-191-1/+1
|/ | | | | | | | It is impossible to provide a description to update method in versions 2.0-2.18. But the docstring of the method says that it can update a description. Change-Id: I832e8a752779277a045bd127e2e6c6a3ae88f840
* Fix listing of instances above API max_limitJacek Tomasiak2018-02-071-1/+4
| | | | | | | | | Output of `nova list` command contained only `max_limit` entries even when there were more. The list needs to be obtained in multiple requests and the paging loop was terminated prematurely. Change-Id: I4194e6d5e34ecc0ac704851c08bb895e223aa850 Closes-Bug: 1743532
* Add support for the 2.57 microversionMatt Riedemann2018-01-151-19/+47
| | | | | | | | | | | | | | | | | | | | With the 2.57 microversion, we: * Deprecate the --file option from the nova boot and nova rebuild CLIs and API bindings. * Add --user-data and --user-data-unset to the nova rebuild CLI and API bindings. * Deprecate the maxPersonality and maxPersonalitySize fields from the nova limits and nova absolute-limits CLIs and API bindings. * Deprecate injected_files, injected_file_content_bytes, and injected_file_path_bytes from the nova quota-show, nova quota-update, nova quota-defaults, nova quota-class-show, and nova quota-class-update CLIs and API bindings. Part of blueprint deprecate-file-injection Change-Id: Id13e3eac3ef87d429454042ac7046e865774ff8e
* Remove deprecated fixedip/floatingip/virtual interface CLIs/APIsMatt Riedemann2018-01-111-108/+0
| | | | | | | | | | | The add-fixed-ip, remove-fixed-ip, floating-ip-associate, floating-ip-disassociate, and virtual-interface-list CLIs and related python API bindings were deprecated in the 9.0.0 release in Pike via change Ie76283962c375b735f30ccb3053db07cf2330de2. This removes the CLIs and related python API bindings and will go into the 10.0.0 release. Change-Id: Icb667973c65d26395db660b1c7b919550db66d08
* Microversion 2.56 - Enable cold migration with target hostTakashi NATSUME2017-12-041-0/+28
| | | | | Change-Id: I4deea811ffae3e7944d5ec10ca0bbf2bfa056a7c Implements: blueprint cold-migration-with-target-queens
* Microversion 2.54 - Enable reset keypair while rebuildTakashi NATSUME2017-11-171-0/+11
| | | | | | | | | | | | Adds support for microversion 2.54 which adds resetting keypair and unsetting keypair in rebuild operation. Adds optional ``--key-name`` and ``--key-unset`` options in the ``nova rebuild`` command. The ``--key-name`` and ``--key-unset`` cannot be specified at the same time. Change-Id: Ie2a39bb29dd59c070adc94e79ea0f6473227a427 Implements: blueprint rebuild-keypair-reset
* Stop posting to os-volumes_bootMonty Taylor2017-11-161-8/+4
| | | | | | | os-volumes_boot is an old clone of /servers and is not documented in the API docs. POST to /servers. Change-Id: If0161a89877f19f24e91d780cf227fdc48e7e860
* Fix reservation_id not supported by Nova APIJeremy Liu2017-08-061-5/+7
| | | | | | | | | | Nova API accepts "return_reservation_id" instead of "reservation_id" when creating instances [1]. This patch fixed that. [1] https://github.com/openstack/nova/blob/master/nova/api/openstack/compute/schemas/multiple_create.py#L19 Change-Id: Ie58248aa1cd981b877c7e592db698faffcd01d9a Closes-bug: #1693818
* Update URLs in docs, comments and setup.cfgTakashi NATSUME2017-07-281-1/+1
| | | | | | | | | Some URLs are broken, so fix them. The other URLs are redirect to new URLs, so replace them with new ones. Change-Id: Ida2fd70ad0d7b029fadfe91be14d7180b9b5b8d1 Closes-Bug: #1707104
* Allow tuple as for nics valueAndrey Kurilin2017-07-271-2/+3
| | | | | | | | | | | | | | | | | `novaclient.servers.boot` accepts 'nics' argument with information about network interfaces to attach. Originally, it accepts a list or a string. In case if a list value, the proper method iterates over it for processing and constructs a right structure for Nova-API. A tuple type is similar to a list type in the processing method and can look more logical for some developers (a tuple is a sequence of immutable python object, which can be ideal for predefined nics) and doensn't require anything to change in code except one validation check. Also, this patch adds more info in the error message for validation step. Change-Id: Ief9d22fefb0a64afc346c56e832c6c0b2b3d8fcb
* Microversion 2.52 - Support tag when bootKevin_Zheng2017-07-191-1/+10
| | | | | | Change-Id: Ib65894f0e128c599db8d3440fe5a8427e62d5782 Depends-On: Ifcaaf285c8f98a1d0e8bbbc87b2f57fbce057346 Implements: blueprint support-tag-instance-when-boot
* Microversion 2.49 - Virt device tagged attachTakashi NATSUME2017-07-121-0/+39
| | | | | Change-Id: I65a2d33710f85e9b8c342d6ff4c1e4cc82990b8c Implements: blueprint virt-device-tagged-attach-detach
* Cleanup duplicated methodsAndrey Kurilin2017-06-221-52/+0
| | | | | | | | | Methods `get_vnc_console`, `get_rdp_console`, `get_serial_console` and `get_spice_console` of ServersManager have complitely equal code, args spec and docstrings for 2.0-2.5 and 2.6+ microversions. There is no reason to duplicate those methods, so this patch removes duplicates. Change-Id: I8c0e6f1f9138958bdb5d840cfd89e584c89895b0
* 2.45: createImage/createBackup image_id is in response bodyMatt Riedemann2017-04-261-3/+9
| | | | | | | | | | | | | | | This adds support for microversion 2.45 which changes the response on the createImage and createBackup server action APIs to return the image_id for the created snapshot image in a json dict in the response body rather than in a Location header (which is gone in microversion >= 2.45). Since the 'nova backup' command was not printing out the created image ID before, that is also added in this microversion. Part of blueprint remove-create-image-location-header-response Change-Id: Id48aa7b14e2d25008287549b04db437ca9c3f548
* 2.44: Deprecate multinic/floatingIP actions and os-virtual-interfacesMatt Riedemann2017-04-251-6/+23
| | | | | | | | | | | | The 2.44 microversion deprecates the addFixedIP, removeFixedIP, addFloatingIP, removeFloatingIP server action APIs and os-virtual-interfaces API. This change deprecates the CLIs and python API bindings in novaclient. Implements blueprint deprecate-multinic-proxy-api Change-Id: Ie76283962c375b735f30ccb3053db07cf2330de2
* Remove deprecated security_groups APIsMatt Riedemann2017-03-201-2/+6
| | | | | | | | | | | | | | | | | These were deprecated in Newton: aaebeb05a03e34281a091dc6dfc4672b01cdfbbb The SecurityGroup resource object is left since the list-secgroup command and list_security_group servers API code still uses that object. The /servers/{server_id}/os-security-groups API is a proxy to Neutron but was not deprecated in microversion 2.36 so it's not yet deprecated here in the client. Change-Id: I6fa14f43d48f1e035ef54bd2d0078506f0c6d6e0
* Grammar typo in the comments for function set_meta.Jeffrey Guan2017-02-231-2/+2
| | | | | Change-Id: Ia62c8e37f240f0dfc00950f6ef6e1ecc4d5b9453 Closes-Bug: #1668336
* Make _console() publichuangtianhua2017-01-181-26/+80
| | | | | | | | | | | | | | | | Heat wants to use 'novaclient.v2.servers. ServerManager._console' method to simplify the implementation of retrieving server console. It's better to change the method to public for public use. The patch changes: 1. add public method named get_console_url() for class 'novaclient.v2.servers.Server' 2. rename _console() to get_console_url() for class 'novaclient.v2.servers.ServerManager' Change-Id: I3d1485468d1d0a79d4002981ebe05b6cdf2332e7 Closes-Bug: #1651677
* Replace six.iteritems() with .items()gengchc22016-12-091-1/+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: I6289f46344876d19d9a6793875f896cedc85a01c
* Add support for v2.37 and auto-allocated networkingMatt Riedemann2016-08-191-24/+47
| | | | | | | | | | | | This adds support for the v2.37 microversion. The networks part of the server create request is required in this microversion so if nothing is specified for --nic arguments on the command line we default to 'auto' for backward compatibility in the CLI. Part of blueprint get-me-a-network Change-Id: I6636ddcd3be7bf393d2d69cc6c1ba5c7d65ff674
* Virtual device tagging client supportArtom Lifshitz2016-07-121-0/+18
| | | | | | | | | | | In order to support virtual device role tagging that was introduced in microversion 2.32, this patch adds: * The 'tag' key to the --nic flag when booting an instance. * The 'tag' key to the --block-device flag when booting an instance. Change-Id: I1866c670994254bc2849b494e318f4ff8cc44eb7 Implements: blueprint virt-device-role-tagging
* Add support for microversion 2.30Sylvain Bauza2016-06-221-2/+34
| | | | | | | | | | | Now the os-migrateLive API supports a new body argument called 'force' which helps the operators to bypass the scheduler call in case they provide a host. Also modifies the host_evacuate_live helper method in the contrib tree to make sure operators also have the force flag in case they need it for a global call. Change-Id: Id7fcd88ad060390ac6d1a21510d84363ed643957 Implements: blueprint check-destination-on-migrations-newton
* Add support for microversion 2.29Sylvain Bauza2016-06-221-2/+41
| | | | | | | | | | | Now the os-evacuate API supports a new body argument called 'force' which helps the operators to bypass the scheduler call in case they provide a host. Also modifies the host_evacuate helper method in the contrib tree to make sure operators also have the force flag in case they need it for a global call. Change-Id: I5272e9809a7d8be482e87548c6a3b11186c5d1e1 Partially-Implements: blueprint check-destination-on-migrations-newton
* Extend microversion stuff to support resource classesAndrey Kurilin2016-06-161-44/+56
| | | | | | | | | | | | | | | | | | | | | | | | | | | Current implementation of novaclient.api_versions.wraps allow to use versioned methods for shell functions and resource managers. As resource managers can have versioned methods, resource objects can have it too, but it was not implemented yet. This patch fixes this omission. Changes: - Add api_version property to base resource class. It is mapped to api_version property of manager class; - Move `novaclient.utils.generate_function_name` to `novaclient.api_versions._generate_function_name`, since this method is specific to microversion stuff and should not used outside api_versions module; - Rewrite _generate_function_name to handle class(owner) name. Previously, it was improssible to have two classes in one module with versioned methods with equal names. - Remove call of generate_function_name from novaclient.shell. Shell module should not take care about function identifiers. get_substitutions accepts object with __id__ property now. - Mark _add_substitution as private method, since it should not be used outside api_versions module - Split all versioned methods of Server resource from novaclient.v2.servers module. Change-Id: Icfce16bfa6f919d7f8451d592f4a8e276b1f1709