Файловый менеджер - Редактировать - /opt/imh-python/lib/python3.9/site-packages/cinderclient/v2/__pycache__/volumes.cpython-39.pyc
Ðазад
a t�h�^ � @ sD d Z ddlmZ ddlmZ G dd� dej�ZG dd� dej�ZdS )z Volume interface (v2 extension).� )�basec @ s� e Zd ZdZdd� Zd<dd�Zdd� Zd=dd�Zd d� Zdd� Z dd� Z dd� Zdd� Zdd� Z dd� Zdd� Zdd� Zdd � Zd!d"� Zd>d#d$�Zd%d&� Zd?d'd(�Zd)d*� Zd+d,� Zd-d.� Zd/d0� Zd1d2� Zd@d3d4�ZdAd6d7�Zd8d9� Zd:d;� Zd S )B�VolumezDA volume is an extra block level storage to the OpenStack instances.c C s d| j S )Nz<Volume: %s>)�id��self� r ��/root/rpmbuild/BUILDROOT/imh-python39-modules-3.9.7-92.el8.x86_64/opt/imh-python/lib/python3.9/site-packages/cinderclient/v2/volumes.py�__repr__ s zVolume.__repr__Fc C s | j j| |d�S )zDelete this volume.)�cascade)�manager�delete)r r r r r r s z Volume.deletec K s | j j| fi |��S )z/Update the name or description for this volume.)r �update)r �kwargsr r r r s z Volume.update�rwNc C s | j �| ||||�S )a� Inform Cinder that the given volume is attached to the given instance. Calling this method will not actually ask Cinder to attach a volume, but to mark it on the DB as attached. If the volume is not actually attached to the given instance, inconsistent data will result. The right flow of calls is : 1- call reserve 2- call initialize_connection 3- call attach :param instance_uuid: uuid of the attaching instance. :param mountpoint: mountpoint on the attaching instance or host. :param mode: the access mode. :param host_name: name of the attaching host. )r �attach)r � instance_uuid� mountpoint�mode� host_namer r r r # s �z Volume.attachc C s | j �| �S )a� Inform Cinder that the given volume is detached from the given instance. Calling this method will not actually ask Cinder to detach a volume, but to mark it on the DB as detached. If the volume is not actually detached from the given instance, inconsistent data will result. The right flow of calls is : 1- call reserve 2- call initialize_connection 3- call detach )r �detachr r r r r 8 s z Volume.detachc C s | j �| �S )zReserve this volume.)r �reserve�r �volumer r r r G s zVolume.reservec C s | j �| �S )zUnreserve this volume.)r � unreserver r r r r K s zVolume.unreservec C s | j �| �S )zBegin detaching volume.)r �begin_detachingr r r r r O s zVolume.begin_detachingc C s | j �| �S )zRoll detaching volume.)r �roll_detachingr r r r r S s zVolume.roll_detachingc C s | j �| |�S )z]Initialize a volume connection. :param connector: connector dict from nova. )r �initialize_connection�r r � connectorr r r r W s zVolume.initialize_connectionc C s | j �| |�S )z\Terminate a volume connection. :param connector: connector dict from nova. )r �terminate_connectionr r r r r ^ s zVolume.terminate_connectionc C s | j �| |�S )z�Set or Append metadata to a volume. :param volume : The :class: `Volume` to set metadata on :param metadata: A dict of key/value pairs to set )r �set_metadata�r r �metadatar r r r e s zVolume.set_metadatac C s | j �| ||�S )z�Set a volume's image metadata. :param volume : The :class: `Volume` to set metadata on :param metadata: A dict of key/value pairs to set )r �set_image_metadatar! r r r r# m s zVolume.set_image_metadatac C s | j �| ||�S )��Delete specified keys from volume's image metadata. :param volume: The :class:`Volume`. :param keys: A list of keys to be removed. )r �delete_image_metadata)r r �keysr r r r% u s zVolume.delete_image_metadatac C s | j �| �S )��Show a volume's image metadata. :param volume : The :class: `Volume` where the image metadata associated. )r �show_image_metadatar r r r r( } s zVolume.show_image_metadatac C s | j �| ||||�S )a@ Upload a volume to image service as an image. :param force: Boolean to enables or disables upload of a volume that is attached to an instance. :param image_name: The new image name. :param container_format: Container format type. :param disk_format: Disk format type. :param visibility: The accessibility of image (allowed for 3.1-latest). :param protected: Boolean to decide whether prevents image from being deleted (allowed for 3.1-latest). )r �upload_to_image)r �force� image_name�container_format�disk_formatZ visibilityZ protectedr r r r) � s �zVolume.upload_to_imagec C s | j �| �S )z�Delete the specified volume ignoring its current state. :param volume: The UUID of the volume to force-delete. )r �force_deleter r r r r. � s zVolume.force_deletec C s | j �| |||�S )a� Update the volume with the provided state. :param state: The state of the volume to set. :param attach_status: The attach_status of the volume to be set, or None to keep the current status. :param migration_status: The migration_status of the volume to be set, or None to keep the current status. )r �reset_state)r �state� attach_status�migration_statusr r r r/ � s �zVolume.reset_statec C s | j �| |�S )z�Extend the size of the specified volume. :param volume: The UUID of the volume to extend :param new_size: The desired size to extend volume to. )r �extend�r r �new_sizer r r r3 � s z Volume.extendc C s | j �| |||�S )z!Migrate the volume to a new host.)r �migrate_volume)r �host�force_host_copy�lock_volumer r r r6 � s �zVolume.migrate_volumec C s | j �| ||�S )zChange a volume's type.)r �retype)r �volume_type�policyr r r r: � s z Volume.retypec C s | j �| |�S )z#Update all metadata of this volume.)r �update_all_metadata)r r"