Commit Graph

16 Commits

Author SHA1 Message Date
Takashi Natsume 935fe75a66 Refactor constructing request body
Add a private static method to construct a request body
for create requests in the
novaclient.v2.volumes.VolumeManager class.

Change-Id: I884ad4b471e3d196255901499c75a1a2f0535f65
Signed-off-by: Takashi Natsume <takanattie@gmail.com>
2021-05-06 18:00:10 +09:00
zhangbailin 4d6c70d25d Microversion 2.85: Change volume-update CLI
This commit add a new CLI
``nova volume-update [--[no-]delete-on-termination]
<server> <src_volume> <dest_volume>`` to update
'delete_on_termination' for an attached volume, that the user can
decide whether to delete attached volumes when destroying the server.

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

Change-Id: I1fc64fb6e6611c92c6b72265e1bf4b32e9c45f0a
Blueprint: destroy-instance-with-datavolume
2020-04-09 08:52:05 +08:00
zhangbailin cd396b8b61 Microversion 2.79: Add delete_on_termination to volume-attach API
Support add 'delete_on_termination' field to the voume attach API to
support configuring whether to delete the data volume when the server
is destroyed.

* Updating the ``nova volume-attachments`` command to show the
  ``delete_on_termination`` value if 2.79 or greater is used.
* The '--delete-on-termination' option is added to the `nova volume-attach`
  CLI.

Depends-On: https://review.opendev.org/#/c/673133/
Part of blueprint support-delete-on-termination-in-server-attach-volume

Change-Id: I8dcf2fd21a2fd99ca4e05bd953fbbe026be3a619
2019-09-09 12:43:42 -04:00
zhangdaolong baa23254ec Fix the inappropriate parameter name
The argument to the function should be the volume ID,
not the attachment ID.So the argument name of the
function here is easy to misunderstand.

Change-Id: Ie093b6acebe8b9e8dbdfed89856666db25bcf756
2017-07-16 23:34:57 +08:00
Takashi NATSUME e11a1266bb Microversion 2.49 - Virt device tagged attach
Change-Id: I65a2d33710f85e9b8c342d6ff4c1e4cc82990b8c
Implements: blueprint virt-device-tagged-attach-detach
2017-07-12 01:16:31 +09:00
john-griffith 428742b404 Fix help message and description for volume-update
The help for the `volume-update` command says:

update_server_volume(server_id, attachment_id, new_volume_id)
Update the volume identified by the attachment ID, that is
attached to the given server ID

Parameters:
server_id – The ID of the server
attachment_id – The ID of the attachment
new_volume_id – The ID of the new volume to attach
Return type:
Volume

But in reality the command takes an original volume and a
destination volume. The update help is also not very clear
regarding what the command actually does and the fact that
it's primarily a libvirt data migration from src volume to
destination volume.

This patch modifies the help to show the correct arguments
and also adds some more info regarding what the command
is doing.

Change-Id: Ia267285f85854976545c2a72c3729c1bfcb2c991
Closes-Bug: #1690397
2017-05-13 22:54:18 +00:00
jichenjc d5ecc50063 Remove 1.1 extension comment
According to recent nova changes, extension is deprecated and
1.1 is also deprecated, so to avoid confusion, remove
those comments in the code

Change-Id: Idc78af2151a0fff159c9b32595ed72a04808b7ee
2017-04-27 15:40:29 +08:00
Matt Riedemann a425702689 Remove deprecated volume(snapshot) commands/bindings
23f13437dd deprecated the
purely volume or volume-snapshot related CLIs and python
API bindings during Kilo. python-cinderclient should be
used for the python API bindings now, and python-openstackclient
should be used for the CLI for those operations.

The alternate_service_type context manager is also removed
since it was only used for proxying through to the volume API
endpoint.

Since the proxy for creating volumes is removed, we have to
add python-cinderclient for testing the volume attachment
CLIs/APIs that are left intact.

Change-Id: I09a6501603667350f49b1b1fa130353a6d5272a2
2016-04-03 14:05:05 -04:00
Takashi NATSUME 209f172242 Add return-request-id-to-caller function(5/5)
Add return-request-id-to-caller function to
resources and resource managers in the following files.
The methods in the resource class and resource manager return
a wrapper class that has 'request_ids' property.
The caller can get request ids of the callee via the property.

* novaclient/v2/volume_snapshots.py
* novaclient/v2/volumes.py
* novaclient/v2/volume_types.py

Co-authored-by: Ankit Agrawal <ankit11.agrawal@nttdata.com>
Change-Id: I4de8c5cf685a5970acc92f8a58a1db26a8d9ffc7
Implements: blueprint return-request-id-to-caller
2016-01-28 11:24:03 +00:00
Andrey Kurilin 3350a5713d Change default service_type for volumes managers
Currently, novaclient's gates are broken due to missed 'volume' service_type.
This patch changes default service type for all volume related managers to
"volumev2" and leave ability to set "volume" service_type.

Change-Id: Ia1e1d3def1e6127cc2b97797c577c15265f879bd
Closes-Bug: #1501258
2015-09-30 14:20:04 +03:00
Matt Riedemann eaf1e56b21 Update path to subunit2html in post_test_hook
Per:

http://lists.openstack.org/pipermail/openstack-dev/2015-August/072982.html

The location of subunit2html changed on the images in the gate
so update the path used in the post_test_hook.

Long-term we should just use what's in devstack-gate.

Change-Id: I5e50e7d7ad845aba26403df1df412c0a139a6dc7
Closes-Bug: #1491646

--------------
squashed with:
--------------

Don't pass null device when attaching a volume

The v2.1 API schema rejects null device values in an
os-volume_attachments request, so only include the device in the request
if one is specified on the command line.

Closes-Bug: #1491325

Change-Id: I4fa4019f19f9af6ff350db2fb6e524fa8570a6f3
2015-09-02 19:08:09 -07:00
Matt Riedemann f3fef4ab2f Change future nova version number references based on new values
The nova server liberty version is changing from 2015.2 to 12.0.0 and
the 2016.1 'M' release will be 13.0.0 so update the deprecation warnings
in the docs and code using those versions.

Depends on nova change 192406.

Change-Id: I6a35fa0dda798fad93b804d00a46af80f08d475c
2015-06-17 14:26:19 -07:00
Matt Riedemann 23f13437dd Deprecate volume/volume-type/volume-snapshot CRUD CLIs/APIs
This deprecates all of the volume CLIs/APIs that go directly to the
cinder API via the volume service type.

This will emit a warning each time a deprecated CLI/API is used and also
updates the help docs for the deprecated CLIs and docstrings for APIs.

The plan is to do a release once this is merged so people start seeing
it and then we'll actually remove the deprecated CLIs/APIs in the first
python-novaclient release after the Nova server 2016.1 'M' release.

DocImpact: The volume, volume-type and volume-snapshot CRUD CLIs/APIs are
           deprecated and will be removed after the Nova 2016.1 release.
           Use python-cinderclient or openstackclient for CLIs instead.
           Use python-cinderclient or python-openstacksdk for APIs instead.

Related-Bug: #1454369

Change-Id: I4e92f924739de9b664e08117984bfb60359f2212
2015-06-02 14:14:06 -07:00
melanie witt e0f5072907 Ensure the use of volume endpoint in volumes apis
Currently, several of the volumes apis depend on callers to pass
service_type='volume' as a parameter when creating a client object,
to route correctly. The problem is, it makes it impossible for
callers to work with both the compute and volume endpoints at the
same time. They can either work with compute and have volumes.* calls
return 404, or they can work with volume and have servers.* images.*
flavors.* calls return 404.

The CLI sets service_type='volume' for client objects for the
following commands via a decorator:

volume-list
volume-show
volume-create
volume-delete
volume-snapshot-list
volume-snapshot-show
volume-snapshot-create
volume-snapshot-delete
volume-type-list
volume-type-create
volume-type-delete

With this change, the service_type 'volume' is set in the api,
so the decorators on the shell commands are no longer needed.

Closes-Bug: #1431154

Change-Id: I11b48ac14fa4c64d8aae528552ec5b363be384c5
2015-03-17 01:19:11 +00:00
Anand Shanmugam 41ef74971e nova client cinder query param changed to display_name
nova client is not able to show the list of volumes when
querying by name.This is because cinder api accepts only
display_name as query parameter and when qeried with 'name'
parameter returns a empty list

Change-Id: Ie4ffc275d1754052d9e239d8457baf6f7fd53b83
Closes-Bug: #1430415
2015-03-11 20:48:46 +05:30
Andrey Kurilin 0a60aae852 Rename v1_1 to v2
Module novaclient.v1_1 is used as implementation of V1.1, V2 and V3.
Since future development(microversioning) will be done across V2,
implementation should be done in appropriate module(to prevent misleading).

Despite the fact that implementation for all versions are equal, discover
method for contrib path worked only for v1.1. This patch fixes this bug and
modifies shell tests to check all versions.

Change-Id: Ib6798f4dfe177586302141f522dc593560ce6a5b
2015-02-04 17:40:46 +02:00